Revision: 75449
          http://sourceforge.net/p/brlcad/code/75449
Author:   starseeker
Date:     2020-04-17 21:20:35 +0000 (Fri, 17 Apr 2020)
Log Message:
-----------
query.c functions group logically with the function in the beginning of 
dm-generic.c - consolidate

Modified Paths:
--------------
    brlcad/branches/dm-fb-merge/src/libdm/CMakeLists.txt
    brlcad/branches/dm-fb-merge/src/libdm/dm-generic.c

Removed Paths:
-------------
    brlcad/branches/dm-fb-merge/src/libdm/query.c

Modified: brlcad/branches/dm-fb-merge/src/libdm/CMakeLists.txt
===================================================================
--- brlcad/branches/dm-fb-merge/src/libdm/CMakeLists.txt        2020-04-17 
21:18:05 UTC (rev 75448)
+++ brlcad/branches/dm-fb-merge/src/libdm/CMakeLists.txt        2020-04-17 
21:20:35 UTC (rev 75449)
@@ -132,7 +132,6 @@
   knob.c
   labels.c
   options.c
-  query.c
   rect.c
   scale.c
   tcl.c

Modified: brlcad/branches/dm-fb-merge/src/libdm/dm-generic.c
===================================================================
--- brlcad/branches/dm-fb-merge/src/libdm/dm-generic.c  2020-04-17 21:18:05 UTC 
(rev 75448)
+++ brlcad/branches/dm-fb-merge/src/libdm/dm-generic.c  2020-04-17 21:20:35 UTC 
(rev 75449)
@@ -239,6 +239,155 @@
     return list;
 }
 
+int
+#if !defined(DM_WGL) && !defined(DM_OGL) && !defined(DM_X)
+dm_validXType(const char *UNUSED(dpy_string), const char *name)
+#else
+dm_validXType(const char *dpy_string, const char *name)
+#endif
+{
+    if (BU_STR_EQUAL(name, "wgl")) {
+#ifdef DM_WGL
+       return 1;
+#else
+       bu_log("Specified display type [%s] is not available in this 
compilation.", name);
+       return 0;
+#endif /* DM_WGL */
+    }
+    if (BU_STR_EQUAL(name, "ogl")) {
+#ifdef DM_OGL
+       Display *dpy;
+       int return_val;
+       if ((dpy = XOpenDisplay(dpy_string)) != NULL) {
+           if (XQueryExtension(dpy, "GLX", &return_val, &return_val, 
&return_val)) {
+               XCloseDisplay(dpy);
+               return 1;
+           }
+           XCloseDisplay(dpy);
+       }
+#else
+       bu_log("Specified display type [%s] is not available in this 
compilation.", name);
+#endif /* DM_OGL */
+       return 0;
+    }
+
+    if (BU_STR_EQUAL(name, "X")) {
+#ifdef DM_X
+       Display *dpy;
+       if ((dpy = XOpenDisplay(dpy_string)) != NULL) {
+           XCloseDisplay(dpy);
+           return 1;
+       }
+#else
+       bu_log("Specified display type [%s] is not available in this 
compilation.", name);
+#endif /* DM_X */
+       return 0;
+    }
+
+    if (BU_STR_EQUAL(name, "tk")) {
+#ifdef DM_TK
+       return 1;
+#else
+       bu_log("Specified display type [%s] is not available in this 
compilation.", name);
+#endif /* DM_TK */
+       return 0;
+    }
+
+    return 0;
+}
+
+/** dm_bestXType determines what mged will normally
+  * use as the default display manager
+  */
+
+char *
+#if !defined(DM_WGL) && !defined(DM_OGL) && !defined(DM_OSGL) && !defined(DM_X)
+dm_bestXType(const char *UNUSED(dpy_string))
+#else
+dm_bestXType(const char *dpy_string)
+#endif
+{
+
+#ifdef DM_OSGL
+    return "osgl";
+#endif
+
+#ifdef DM_WGL
+    /* should probably make sure wgl works */
+    return "wgl";
+#endif
+
+#ifdef DM_OGL
+    {
+       Display *dpy;
+       int return_val;
+       if (dpy_string) {
+           if ((dpy = XOpenDisplay(dpy_string)) != NULL) {
+               if (XQueryExtension(dpy, "GLX", &return_val, &return_val, 
&return_val)) {
+                   XCloseDisplay(dpy);
+                   return "ogl";
+               }
+               XCloseDisplay(dpy);
+           }
+       } else {
+           return "ogl";
+       }
+    }
+#endif
+
+#ifdef DM_X
+    {
+       if (dpy_string) {
+       Display *dpy;
+       if ((dpy = XOpenDisplay(dpy_string)) != NULL) {
+           XCloseDisplay(dpy);
+           return "X";
+       }
+       } else {
+           return "X";
+       }
+    }
+#endif
+
+#ifdef DM_TK
+    return "tk";
+#endif
+
+    return "nu";
+}
+
+
+/**
+ * dm_default_type suggests a display manager
+ */
+
+int
+dm_default_type()
+{
+
+#ifdef DM_OSGL
+    return DM_TYPE_OSGL;
+#endif
+
+#ifdef DM_WGL
+    return DM_TYPE_WGL;
+#endif
+
+#ifdef DM_OGL
+    return DM_TYPE_OGL;
+#endif
+
+#ifdef DM_X
+    return DM_TYPE_X;
+#endif
+
+#ifdef DM_TK
+    return DM_TYPE_TK;
+#endif
+    return DM_TYPE_NULL;
+}
+
+
 void
 dm_fogHint(struct dm *dmp, int fastfog)
 {

Deleted: brlcad/branches/dm-fb-merge/src/libdm/query.c
===================================================================
--- brlcad/branches/dm-fb-merge/src/libdm/query.c       2020-04-17 21:18:05 UTC 
(rev 75448)
+++ brlcad/branches/dm-fb-merge/src/libdm/query.c       2020-04-17 21:20:35 UTC 
(rev 75449)
@@ -1,194 +0,0 @@
-/*                         Q U E R Y . C
- * BRL-CAD
- *
- * Copyright (c) 2004-2020 United States Government as represented by
- * the U.S. Army Research Laboratory.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this file; see the file named COPYING for more
- * information.
- */
-/** @file libdm/query.c
- *
- */
-
-#include "common.h"
-
-#include <string.h>
-
-#ifdef HAVE_X11_XLIB_H
-#  include <X11/Xlib.h>
-#endif
-
-#include "tcl.h"
-
-#include "vmath.h"
-#include "dm.h"
-
-
-int
-#if !defined(DM_WGL) && !defined(DM_OGL) && !defined(DM_X)
-dm_validXType(const char *UNUSED(dpy_string), const char *name)
-#else
-dm_validXType(const char *dpy_string, const char *name)
-#endif
-{
-    if (BU_STR_EQUAL(name, "wgl")) {
-#ifdef DM_WGL
-       return 1;
-#else
-       bu_log("Specified display type [%s] is not available in this 
compilation.", name);
-       return 0;
-#endif /* DM_WGL */
-    }
-    if (BU_STR_EQUAL(name, "ogl")) {
-#ifdef DM_OGL
-       Display *dpy;
-       int return_val;
-       if ((dpy = XOpenDisplay(dpy_string)) != NULL) {
-           if (XQueryExtension(dpy, "GLX", &return_val, &return_val, 
&return_val)) {
-               XCloseDisplay(dpy);
-               return 1;
-           }
-           XCloseDisplay(dpy);
-       }
-#else
-       bu_log("Specified display type [%s] is not available in this 
compilation.", name);
-#endif /* DM_OGL */
-       return 0;
-    }
-
-    if (BU_STR_EQUAL(name, "X")) {
-#ifdef DM_X
-       Display *dpy;
-       if ((dpy = XOpenDisplay(dpy_string)) != NULL) {
-           XCloseDisplay(dpy);
-           return 1;
-       }
-#else
-       bu_log("Specified display type [%s] is not available in this 
compilation.", name);
-#endif /* DM_X */
-       return 0;
-    }
-
-    if (BU_STR_EQUAL(name, "tk")) {
-#ifdef DM_TK
-       return 1;
-#else
-       bu_log("Specified display type [%s] is not available in this 
compilation.", name);
-#endif /* DM_TK */
-       return 0;
-    }
-
-    return 0;
-}
-
-/** dm_bestXType determines what mged will normally
-  * use as the default display manager
-  */
-
-char *
-#if !defined(DM_WGL) && !defined(DM_OGL) && !defined(DM_OSGL) && !defined(DM_X)
-dm_bestXType(const char *UNUSED(dpy_string))
-#else
-dm_bestXType(const char *dpy_string)
-#endif
-{
-
-#ifdef DM_OSGL
-    return "osgl";
-#endif
-
-#ifdef DM_WGL
-    /* should probably make sure wgl works */
-    return "wgl";
-#endif
-
-#ifdef DM_OGL
-    {
-       Display *dpy;
-       int return_val;
-       if (dpy_string) {
-           if ((dpy = XOpenDisplay(dpy_string)) != NULL) {
-               if (XQueryExtension(dpy, "GLX", &return_val, &return_val, 
&return_val)) {
-                   XCloseDisplay(dpy);
-                   return "ogl";
-               }
-               XCloseDisplay(dpy);
-           }
-       } else {
-           return "ogl";
-       }
-    }
-#endif
-
-#ifdef DM_X
-    {
-       if (dpy_string) {
-       Display *dpy;
-       if ((dpy = XOpenDisplay(dpy_string)) != NULL) {
-           XCloseDisplay(dpy);
-           return "X";
-       }
-       } else {
-           return "X";
-       }
-    }
-#endif
-
-#ifdef DM_TK
-    return "tk";
-#endif
-
-    return "nu";
-}
-
-
-/**
- * dm_default_type suggests a display manager
- */
-
-int
-dm_default_type()
-{
-
-#ifdef DM_OSGL
-    return DM_TYPE_OSGL;
-#endif
-
-#ifdef DM_WGL
-    return DM_TYPE_WGL;
-#endif
-
-#ifdef DM_OGL
-    return DM_TYPE_OGL;
-#endif
-
-#ifdef DM_X
-    return DM_TYPE_X;
-#endif
-
-#ifdef DM_TK
-    return DM_TYPE_TK;
-#endif
-    return DM_TYPE_NULL;
-}
-
-/*
- * Local Variables:
- * mode: C
- * tab-width: 8
- * indent-tabs-mode: t
- * c-file-style: "stroustrup"
- * End:
- * ex: shiftwidth=4 tabstop=8
- */

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.



_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to