Revision: 76769
http://sourceforge.net/p/brlcad/code/76769
Author: starseeker
Date: 2020-08-15 01:05:57 +0000 (Sat, 15 Aug 2020)
Log Message:
-----------
This is getting too painful to keep straight - just go ahead and pull in the
more recent trunk changes to RELEASE. Better to sort them out now instead of
trying to untangle the trunk and RELEASE changes after an even longer
divergence.
Modified Paths:
--------------
brlcad/branches/RELEASE/doc/README.Windows
brlcad/branches/RELEASE/include/bu/magic.h
brlcad/branches/RELEASE/include/dm/CMakeLists.txt
brlcad/branches/RELEASE/include/dm/bview.h
brlcad/branches/RELEASE/include/dm.h
brlcad/branches/RELEASE/include/ged/defines.h
brlcad/branches/RELEASE/include/ged/view.h
brlcad/branches/RELEASE/include/tclcad.h
brlcad/branches/RELEASE/misc/CMakeLists.txt
brlcad/branches/RELEASE/misc/repoconv/NOTES
brlcad/branches/RELEASE/src/fbserv/fbserv.c
brlcad/branches/RELEASE/src/fbserv/server.c
brlcad/branches/RELEASE/src/libdm/CMakeLists.txt
brlcad/branches/RELEASE/src/libdm/X/CMakeLists.txt
brlcad/branches/RELEASE/src/libdm/X/dm-X.c
brlcad/branches/RELEASE/src/libdm/X/dm-X.h
brlcad/branches/RELEASE/src/libdm/X/fb_X.h
brlcad/branches/RELEASE/src/libdm/dm-generic.c
brlcad/branches/RELEASE/src/libdm/dm_plugins.cpp
brlcad/branches/RELEASE/src/libdm/glx/CMakeLists.txt
brlcad/branches/RELEASE/src/libdm/glx/dm-ogl.c
brlcad/branches/RELEASE/src/libdm/glx/dm-ogl.h
brlcad/branches/RELEASE/src/libdm/glx/fb_ogl.h
brlcad/branches/RELEASE/src/libdm/glx/if_ogl.c
brlcad/branches/RELEASE/src/libdm/include/calltable.h
brlcad/branches/RELEASE/src/libdm/include/private.h
brlcad/branches/RELEASE/src/libdm/null/dm-Null.c
brlcad/branches/RELEASE/src/libdm/null/dm-Null.h
brlcad/branches/RELEASE/src/libdm/osgl/CMakeLists.txt
brlcad/branches/RELEASE/src/libdm/osgl/dm-osgl.cpp
brlcad/branches/RELEASE/src/libdm/osgl/dm-osgl.h
brlcad/branches/RELEASE/src/libdm/osgl/fb_osgl.h
brlcad/branches/RELEASE/src/libdm/osgl/if_osgl.cpp
brlcad/branches/RELEASE/src/libdm/plot/CMakeLists.txt
brlcad/branches/RELEASE/src/libdm/plot/dm-plot.c
brlcad/branches/RELEASE/src/libdm/plot/dm-plot.h
brlcad/branches/RELEASE/src/libdm/postscript/CMakeLists.txt
brlcad/branches/RELEASE/src/libdm/postscript/dm-ps.c
brlcad/branches/RELEASE/src/libdm/postscript/dm-ps.h
brlcad/branches/RELEASE/src/libdm/qt/CMakeLists.txt
brlcad/branches/RELEASE/src/libdm/qt/dm-qt.cpp
brlcad/branches/RELEASE/src/libdm/qt/dm-qt.h
brlcad/branches/RELEASE/src/libdm/qt/fb_qt.h
brlcad/branches/RELEASE/src/libdm/tests/dm_test.c
brlcad/branches/RELEASE/src/libdm/tk/CMakeLists.txt
brlcad/branches/RELEASE/src/libdm/tk/dm-tk.c
brlcad/branches/RELEASE/src/libdm/tk/dm-tk.h
brlcad/branches/RELEASE/src/libdm/txt/CMakeLists.txt
brlcad/branches/RELEASE/src/libdm/txt/dm-txt.c
brlcad/branches/RELEASE/src/libdm/wgl/CMakeLists.txt
brlcad/branches/RELEASE/src/libdm/wgl/dm-wgl.c
brlcad/branches/RELEASE/src/libdm/wgl/dm-wgl.h
brlcad/branches/RELEASE/src/libdm/wgl/fb_wgl.h
brlcad/branches/RELEASE/src/libged/arb/rotate_arb_face.c
brlcad/branches/RELEASE/src/libged/bb/bb.c
brlcad/branches/RELEASE/src/libged/bigE/bigE.c
brlcad/branches/RELEASE/src/libged/bot/bot.cpp
brlcad/branches/RELEASE/src/libged/bot/bot_dump.c
brlcad/branches/RELEASE/src/libged/bot/check.cpp
brlcad/branches/RELEASE/src/libged/bot/edbot.c
brlcad/branches/RELEASE/src/libged/bot/extrude.cpp
brlcad/branches/RELEASE/src/libged/bot/remesh.cpp
brlcad/branches/RELEASE/src/libged/clone/clone.c
brlcad/branches/RELEASE/src/libged/comb/comb.c
brlcad/branches/RELEASE/src/libged/comb_std/comb_std.c
brlcad/branches/RELEASE/src/libged/copymat/copymat.c
brlcad/branches/RELEASE/src/libged/display_list.c
brlcad/branches/RELEASE/src/libged/draw/draw.c
brlcad/branches/RELEASE/src/libged/draw/preview.c
brlcad/branches/RELEASE/src/libged/edcodes/edcodes.c
brlcad/branches/RELEASE/src/libged/edit/edit.c
brlcad/branches/RELEASE/src/libged/edmater/edmater.c
brlcad/branches/RELEASE/src/libged/erase/erase.c
brlcad/branches/RELEASE/src/libged/exec.cpp
brlcad/branches/RELEASE/src/libged/facetize/facetize.cpp
brlcad/branches/RELEASE/src/libged/gdiff/gdiff.c
brlcad/branches/RELEASE/src/libged/ged.c
brlcad/branches/RELEASE/src/libged/ged_private.h
brlcad/branches/RELEASE/src/libged/ged_util.c
brlcad/branches/RELEASE/src/libged/get/get.c
brlcad/branches/RELEASE/src/libged/get_obj_bounds.c
brlcad/branches/RELEASE/src/libged/get_type/get_type.c
brlcad/branches/RELEASE/src/libged/include/plugin.h
brlcad/branches/RELEASE/src/libged/joint/joint.c
brlcad/branches/RELEASE/src/libged/kill/kill.c
brlcad/branches/RELEASE/src/libged/killrefs/killrefs.c
brlcad/branches/RELEASE/src/libged/killtree/killtree.c
brlcad/branches/RELEASE/src/libged/mater/mater.cpp
brlcad/branches/RELEASE/src/libged/metaball/metaball.c
brlcad/branches/RELEASE/src/libged/move_arb_edge/move_arb_edge.c
brlcad/branches/RELEASE/src/libged/move_arb_face/move_arb_face.c
brlcad/branches/RELEASE/src/libged/ocenter/ocenter.c
brlcad/branches/RELEASE/src/libged/orotate/orotate.c
brlcad/branches/RELEASE/src/libged/oscale/oscale.c
brlcad/branches/RELEASE/src/libged/otranslate/otranslate.c
brlcad/branches/RELEASE/src/libged/pipe/pipe.c
brlcad/branches/RELEASE/src/libged/pipe.c
brlcad/branches/RELEASE/src/libged/polyclip.cpp
brlcad/branches/RELEASE/src/libged/process/process.c
brlcad/branches/RELEASE/src/libged/protate/protate.c
brlcad/branches/RELEASE/src/libged/pscale/pscale.c
brlcad/branches/RELEASE/src/libged/pset/pset.c
brlcad/branches/RELEASE/src/libged/ptranslate/ptranslate.c
brlcad/branches/RELEASE/src/libged/put/put.c
brlcad/branches/RELEASE/src/libged/put_comb/put_comb.c
brlcad/branches/RELEASE/src/libged/remove/remove.c
brlcad/branches/RELEASE/src/libged/rmater/rmater.c
brlcad/branches/RELEASE/src/libged/rtabort/rtabort.c
brlcad/branches/RELEASE/src/libged/rtcheck/rtcheck.c
brlcad/branches/RELEASE/src/libged/rtwizard/rtwizard.c
brlcad/branches/RELEASE/src/libged/select/select.c
brlcad/branches/RELEASE/src/libged/set_transparency/set_transparency.c
brlcad/branches/RELEASE/src/libged/vdraw/vdraw.c
brlcad/branches/RELEASE/src/libged/view/data_lines.c
brlcad/branches/RELEASE/src/libged/wcodes/wcodes.c
brlcad/branches/RELEASE/src/libged/zap/zap.c
brlcad/branches/RELEASE/src/libtclcad/dm.c
brlcad/branches/RELEASE/src/libtclcad/fb.c
brlcad/branches/RELEASE/src/libtclcad/tclcad_mouse.c
brlcad/branches/RELEASE/src/libtclcad/tclcad_obj.c
brlcad/branches/RELEASE/src/libtclcad/tclcad_obj_wrapper.c
brlcad/branches/RELEASE/src/libtclcad/tclcad_polygons.c
brlcad/branches/RELEASE/src/libtclcad/tclcad_private.h
brlcad/branches/RELEASE/src/libtclcad/view/arrows.c
brlcad/branches/RELEASE/src/libtclcad/view/autoview.c
brlcad/branches/RELEASE/src/libtclcad/view/axes.c
brlcad/branches/RELEASE/src/libtclcad/view/draw.c
brlcad/branches/RELEASE/src/libtclcad/view/faceplate.c
brlcad/branches/RELEASE/src/libtclcad/view/labels.c
brlcad/branches/RELEASE/src/libtclcad/view/lines.c
brlcad/branches/RELEASE/src/libtclcad/view/refresh.c
brlcad/branches/RELEASE/src/libtclcad/view/util.c
brlcad/branches/RELEASE/src/libtclcad/view/view.h
brlcad/branches/RELEASE/src/mged/CMakeLists.txt
brlcad/branches/RELEASE/src/mged/attach.c
brlcad/branches/RELEASE/src/mged/chgview.c
brlcad/branches/RELEASE/src/mged/cmd.c
brlcad/branches/RELEASE/src/mged/dodraw.c
brlcad/branches/RELEASE/src/mged/doevent.c
brlcad/branches/RELEASE/src/mged/fbserv.c
brlcad/branches/RELEASE/src/mged/mged.c
brlcad/branches/RELEASE/src/mged/mged.h
brlcad/branches/RELEASE/src/mged/mged_dm.h
brlcad/branches/RELEASE/src/mged/overlay.c
brlcad/branches/RELEASE/src/mged/setup.c
brlcad/branches/RELEASE/src/mged/utility1.c
brlcad/branches/RELEASE/src/mged/wdb_obj.c
brlcad/branches/RELEASE/src/rt/usage.cpp
brlcad/branches/RELEASE/src/shapes/coil.c
Added Paths:
-----------
brlcad/branches/RELEASE/misc/repoconv/github_ci_actions.yml
Removed Paths:
-------------
brlcad/branches/RELEASE/include/dm/dm-design.h
brlcad/branches/RELEASE/src/mged/fbserv.h
Property Changed:
----------------
brlcad/branches/RELEASE/
brlcad/branches/RELEASE/NEWS
brlcad/branches/RELEASE/doc/
brlcad/branches/RELEASE/include/
brlcad/branches/RELEASE/src/libbu/
brlcad/branches/RELEASE/src/libged/polyclip.cpp
Index: brlcad/branches/RELEASE
===================================================================
--- brlcad/branches/RELEASE 2020-08-15 00:35:05 UTC (rev 76768)
+++ brlcad/branches/RELEASE 2020-08-15 01:05:57 UTC (rev 76769)
Property changes on: brlcad/branches/RELEASE
___________________________________________________________________
Modified: svn:mergeinfo
## -1,5 +1,5 ##
/brlcad/branches/RELEASE:60491
-/brlcad/branches/bioh:75720-75728
+/brlcad/branches/bioh:75720-75728,76354,76366-76367,76377-76506
/brlcad/branches/brep-debug:61373,61375,61404,61427,61429,61470,61544,61567,61576,61999,62018,62094,62098,62107,62117,62406,62416-62519,62521-62584,62593-62614,62623,62658,62660-62674,62681-62771,62876,62901,62907,62910,62925,62928,62931-63025,63027,63051,63054-63056,63069,63071-63073,63122,63160-63161,63165,63171,63184,63187,63189-63190,63193-63196,63200,63202,63205-63210,63213,63219-63225,63232-63233,63236,63238,63338,63350-63353,63481,63618,63669,64173-64174,64176-64177,64229-64233,64242,64244,64360-64362,65165,65245,65249,65334,65833-65834,66370-66375,66931-66932,66934,67012-67015,67018-67019,67021-67022,67406,67740,67746-67748,67950,67952,68144-68145,68636,68640-68643,68820,69081,69109,69168,69206,69289,69346,69460-69461,69582-69583,69719-69721,69857-69859,69927,69995-69996,70148-70149,70347-70349,70377,70526-70527,71006-71007,71009-71022,71046-71047,71049,71096-71100
/brlcad/branches/bullet:62518
/brlcad/branches/cmake:43219
## -7,4 +7,4 ##
/brlcad/branches/opencl:65867-66137
/brlcad/branches/osg:62110-62113
/brlcad/branches/prep-cache:68236-68933
-/brlcad/trunk:36844-37285,37571-38764,38777-38845,41559-43155,43159-43908,44241-44324,44326-44385,44710-45373,45377,45379-47342,47370-68122,68125-75207,75325,75375,75377-75378,75387,75470-75472,75477,75492,75495,75549,75565-75566,75656-75661,75672,75675,75678,75729,75811,76641-76644,76655,76662-76663,76729-76730,76748-76764
\ No newline at end of property
+/brlcad/trunk:36844-37285,37571-38764,38777-38845,41559-43155,43159-43908,44241-44324,44326-44385,44710-45373,45377,45379-47342,47370-68122,68125-75207,75325,75375,75377-75378,75387,75470-75472,75477,75492,75495,75549,75565-75566,75656-75661,75672,75675,75678,75729,75811,76641-76768
\ No newline at end of property
Index: brlcad/branches/RELEASE/NEWS
===================================================================
--- brlcad/branches/RELEASE/NEWS 2020-08-15 00:35:05 UTC (rev 76768)
+++ brlcad/branches/RELEASE/NEWS 2020-08-15 01:05:57 UTC (rev 76769)
Property changes on: brlcad/branches/RELEASE/NEWS
___________________________________________________________________
Modified: svn:mergeinfo
## -1,4 +1,5 ##
/brlcad/branches/RELEASE/NEWS:60491
+/brlcad/branches/bioh/NEWS:76354-76506
/brlcad/branches/brep-debug/NEWS:61373,61375,61404,61427,61429,61470,61544,61567,61576,61999,62018,62094,62098,62107,62117,62406,62416-62519,62521-62584,62593-62614,62623,62658,62660-62674,62681-62771,62876,62901,62907,62910,62925,62928,62931-63025,63027,63051,63054-63056,63069,63071-63073,63122,63160-63161,63165,63171,63184,63187,63189-63190,63193-63196,63200,63202,63205-63210,63213,63219-63225,63232-63233,63236,63238,63338,63350-63353,63481,63618,63669,64173-64174,64176-64177,64229-64233,64242,64244,64360-64362,65165,65245,65249,65334,65833-65834,66370-66375,66931-66932,66934,67012-67015,67018-67019,67021-67022,67406,67740,67746-67748,67950,67952,68144-68145,68636,68640-68643,68820,69081,69109,69168,69206,69289,69346,69460-69461,69582-69583,69719-69721,69857-69859,69927,69995-69996,70148-70149,70347-70349,70377,70526-70527,71006-71007,71009-71022,71046-71047,71049,71096-71100
/brlcad/branches/bullet/NEWS:62518
/brlcad/branches/cmake/NEWS:43219
## -8,4 +9,4 ##
/brlcad/branches/prep-cache/NEWS:68236-68933
/brlcad/branches/tcltk86/NEWS:68300-75257
/brlcad/trunk:68170-68252
-/brlcad/trunk/NEWS:36844-37285,37571-38764,38777-38845,41559-43155,43159-43908,44241-44324,44326-44385,44710-45373,45377,45379-47342,47370-68122,68125-74373,74376-75141,75375,75377-75378,75565-75566,75811,76748-76764
\ No newline at end of property
+/brlcad/trunk/NEWS:36844-37285,37571-38764,38777-38845,41559-43155,43159-43908,44241-44324,44326-44385,44710-45373,45377,45379-47342,47370-68122,68125-74373,74376-75141,75375,75377-75378,75565-75566,75811,76645-76654,76748-76764
\ No newline at end of property
Index: brlcad/branches/RELEASE/doc
===================================================================
--- brlcad/branches/RELEASE/doc 2020-08-15 00:35:05 UTC (rev 76768)
+++ brlcad/branches/RELEASE/doc 2020-08-15 01:05:57 UTC (rev 76769)
Property changes on: brlcad/branches/RELEASE/doc
___________________________________________________________________
Modified: svn:mergeinfo
## -1,3 +1,4 ##
+/brlcad/branches/bioh/doc:76354,76366-76506
/brlcad/branches/brep-debug/doc:61373,61375,61404,61427,61429,61470,61544,61567,61576,61999,62018,62094,62098,62107,62117,62406,62416-62519,62521-62584,62593-62614,62623,62658,62660-62674,62681-62771,62876,62901,62907,62910,62925,62928,62931-63025,63027,63051,63054-63056,63069,63071-63073,63122,63160-63161,63165,63171,63184,63187,63189-63190,63193-63196,63200,63202,63205-63210,63213,63219-63225,63232-63233,63236,63238,63338,63350-63353,63481,63618,63669,64173-64174,64176-64177,64229-64233,64242,64244,64360-64362,65165,65245,65249,65334,65833-65834,66370-66375,66931-66932,66934,67012-67015,67018-67019,67021-67022,67406,67740,67746-67748,67950,67952,68144-68145,68636,68640-68643,68820,69081,69109,69206,69289,69346,69460-69461,69582-69583,69719-69721,69857-69859,69927
/brlcad/branches/bullet/doc:62518
/brlcad/branches/cmake/doc:43219
## -5,4 +6,5 ##
/brlcad/branches/opencl/doc:65867-66137
/brlcad/branches/osg/doc:62110-62113
/brlcad/branches/prep-cache/doc:68236-68933
-/brlcad/branches/tcltk86/doc:68300-75257
\ No newline at end of property
+/brlcad/branches/tcltk86/doc:68300-75257
+/brlcad/trunk/doc:76645-76726
\ No newline at end of property
Modified: brlcad/branches/RELEASE/doc/README.Windows
===================================================================
--- brlcad/branches/RELEASE/doc/README.Windows 2020-08-15 00:35:05 UTC (rev
76768)
+++ brlcad/branches/RELEASE/doc/README.Windows 2020-08-15 01:05:57 UTC (rev
76769)
@@ -65,7 +65,9 @@
value of 10.0.15063.0.)
Note that for this to work the SDK version in question must be
-installed on the system.
+installed on the system. To see what versions are installed,
+look for Windows SDK installs in the "Apps & Features" Setup
+interface.
===========================================
Index: brlcad/branches/RELEASE/include
===================================================================
--- brlcad/branches/RELEASE/include 2020-08-15 00:35:05 UTC (rev 76768)
+++ brlcad/branches/RELEASE/include 2020-08-15 01:05:57 UTC (rev 76769)
Property changes on: brlcad/branches/RELEASE/include
___________________________________________________________________
Added: svn:mergeinfo
## -0,0 +1,10 ##
+/brlcad/branches/RELEASE/include:60491
+/brlcad/branches/bioh/include:75720-75728,76354-76506
+/brlcad/branches/brep-debug/include:61373,61375,61404,61427,61429,61470,61544,61567,61576,61999,62018,62094,62098,62107,62117,62406,62416-62519,62521-62584,62593-62614,62623,62658,62660-62674,62681-62771,62876,62901,62907,62910,62925,62928,62931-63025,63027,63051,63054-63056,63069,63071-63073,63122,63160-63161,63165,63171,63184,63187,63189-63190,63193-63196,63200,63202,63205-63210,63213,63219-63225,63232-63233,63236,63238,63338,63350-63353,63481,63618,63669,64173-64174,64176-64177,64229-64233,64242,64244,64360-64362,65165,65245,65249,65334,65833-65834,66370-66375,66931-66932,66934,67012-67015,67018-67019,67021-67022,67406,67740,67746-67748,67950,67952,68144-68145,68636,68640-68643,68820,69081,69109,69168,69206,69289,69346,69460-69461,69582-69583,69719-69721,69857-69859,69927,69995-69996,70148-70149,70347-70349,70377,70526-70527,71006-71007,71009-71022,71046-71047,71049,71096-71100
+/brlcad/branches/bullet/include:62518
+/brlcad/branches/cmake/include:43219
+/brlcad/branches/gct/include:62423-62425
+/brlcad/branches/opencl/include:65867-66137
+/brlcad/branches/osg/include:62110-62113
+/brlcad/branches/prep-cache/include:68236-68933
+/brlcad/trunk/include:36844-37285,37571-38764,38777-38845,41559-43155,43159-43908,44241-44324,44326-44385,44710-45373,45377,45379-47342,47370-68122,68125-75207,75325,75375,75377-75378,75387,75470-75472,75477,75492,75495,75549,75565-75566,75656-75661,75672,75675,75678,75729,75811,76641-76726,76729-76730,76748-76764
\ No newline at end of property
Modified: brlcad/branches/RELEASE/include/bu/magic.h
===================================================================
--- brlcad/branches/RELEASE/include/bu/magic.h 2020-08-15 00:35:05 UTC (rev
76768)
+++ brlcad/branches/RELEASE/include/bu/magic.h 2020-08-15 01:05:57 UTC (rev
76769)
@@ -209,6 +209,7 @@
/* misc */
#define ANIMATE_MAGIC 0x414e4963 /**< ANIc */
+#define BVIEW_MAGIC 0x62766965 /**< bvie */
#define CURVE_BEZIER_MAGIC 0x62657a69 /**< bezi */
#define CURVE_CARC_MAGIC 0x63617263 /**< carc */
#define CURVE_LSEG_MAGIC 0x6c736567 /**< lseg */
Modified: brlcad/branches/RELEASE/include/dm/CMakeLists.txt
===================================================================
--- brlcad/branches/RELEASE/include/dm/CMakeLists.txt 2020-08-15 00:35:05 UTC
(rev 76768)
+++ brlcad/branches/RELEASE/include/dm/CMakeLists.txt 2020-08-15 01:05:57 UTC
(rev 76769)
@@ -6,7 +6,6 @@
)
BRLCAD_MANAGE_FILES(dm_headers ${INCLUDE_DIR}/brlcad/dm)
-CMAKEFILES(dm-design.h)
CMAKEFILES(CMakeLists.txt)
# Local Variables:
Modified: brlcad/branches/RELEASE/include/dm/bview.h
===================================================================
--- brlcad/branches/RELEASE/include/dm/bview.h 2020-08-15 00:35:05 UTC (rev
76768)
+++ brlcad/branches/RELEASE/include/dm/bview.h 2020-08-15 01:05:57 UTC (rev
76769)
@@ -196,7 +196,8 @@
};
struct bview {
- struct bu_list l;
+ uint32_t magic; /**< @brief magic number */
+ struct bu_vls gv_name;
fastf_t gv_scale;
fastf_t gv_size; /**< @brief 2.0 *
scale */
fastf_t gv_isize; /**< @brief 1.0 /
size */
@@ -251,11 +252,14 @@
fastf_t gv_curve_scale;
fastf_t gv_data_vZ;
size_t gv_bot_threshold;
+ int gv_hidden;
+ void *dmp; /* Display manager pointer, if one is
associated with this view */
+ void *u_data; /* Caller data associated with this
view */
struct bu_ptbl *callbacks;
};
-struct bview_client_data {
+struct bview_solid_data {
struct display_list *gdlp;
int draw_solid_lines_only;
int wireframe_color_override;
@@ -266,37 +270,6 @@
void *freesolid;
};
-/**
- * A view object maintains state for controlling a view.
- */
-struct view_obj {
- struct bu_list l;
- struct bu_vls vo_name; /**< @brief view object
name/cmd */
- fastf_t vo_scale;
- fastf_t vo_size; /**< @brief 2.0 * scale */
- fastf_t vo_invSize; /**< @brief 1.0 / size */
- fastf_t vo_perspective; /**< @brief perspective angle
*/
- fastf_t vo_local2base; /**< @brief scale local units
to base units (i.e. mm) */
- fastf_t vo_base2local; /**< @brief scale base units
(i.e. mm) to local units */
- vect_t vo_aet;
- vect_t vo_eye_pos; /**< @brief eye position */
- vect_t vo_keypoint;
- char vo_coord; /**< @brief coordinate system
*/
- char vo_rotate_about; /**< @brief indicates what
point rotations are about */
- mat_t vo_rotation;
- mat_t vo_center;
- mat_t vo_model2view;
- mat_t vo_pmodel2view;
- mat_t vo_view2model;
- mat_t vo_pmat; /**< @brief perspective
matrix */
- struct bu_observer_list vo_observers;
- void (*vo_callback)(); /**< @brief called in
vo_update with vo_clientData and vop */
- void * vo_clientData; /**< @brief passed to
vo_callback */
- int vo_zclip;
- void *interp;
-};
-#define VIEW_OBJ_NULL ((struct view_obj *)0)
-
#endif /* DM_BVIEW_H */
/** @} */
Deleted: brlcad/branches/RELEASE/include/dm/dm-design.h
===================================================================
--- brlcad/branches/RELEASE/include/dm/dm-design.h 2020-08-15 00:35:05 UTC
(rev 76768)
+++ brlcad/branches/RELEASE/include/dm/dm-design.h 2020-08-15 01:05:57 UTC
(rev 76769)
@@ -1,223 +0,0 @@
-/* D M - D E S I G N . H
- * BRL-CAD
- *
- * Copyright (c) 2016-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 dm-design.h
- *
- * Design work on an updated API for libdm. This is currently just
- * speculative work and should not be regarded as any sort of active,
- * usable API.
- *
- */
-
-#ifndef DM_DM_DESIGN_H
-#define DM_DM_DESIGN_H
-
-#include "common.h"
-#include "vmath.h"
-#include "icv.h"
-#include "dm/defines.h"
-
-/* Display Manager Types */
-#define DM_TYPE_BAD -1
-#define DM_TYPE_NULL 0
-#define DM_TYPE_TXT 1
-#define DM_TYPE_QT 2
-#define DM_TYPE_OSG 3
-
-#define DM_STYLE_TXT 0
-#define DM_STYLE_WIREFRAME 1
-#define DM_STYLE_POINTS 2
-#define DM_STYLE_TRIANGLES 3
-#define DM_STYLE_HIDDEN_LINE 4
-struct dm_db_obj {
- int draw_style; /**< @brief bitmask for points, wireframe,
solid, hidden line, etc. */
- mat_t matrix; /**< @brief local matrix for individual
in-memory object manipulation during editing, when per-change disk I/O is too
expensive */
-};
-
-#define DM_VIEW_OBJ_TYPE_3DLINES 0
-#define DM_VIEW_OBJ_TYPE_2DLINES 1
-#define DM_VIEW_OBJ_TYPE_TRIANGLES 2
-#define DM_VIEW_OBJ_TYPE_TEXT 4
-#define DM_VIEW_OBJ_TYPE_FB 5
-struct dm_view_obj {
- int draw_type; /**< @brief obj type - framebuffer, 2D
lines, 3D lines, triangles, text, grouping object, etc. */
- struct bn_vlist *vlist; /**< @brief If the object defines
specific linear or triangular geometry for drawing
- (text may but is not required to,
and a framebuffer uses image data) it is here. */
- struct bu_ptbl *obj_set; /**< @brief A grouping object may
define a union of other objects (view and/or db) on which actions will be
performed */
- void *image_data;
- mat_t matrix;
-};
-
-
-/* Use a union to allow the display list object to hold both types */
-#define DM_DB_OBJ 1
-#define DM_VIEW_OBJ 2
-union dm_object {
- struct dm_db_obj db_obj;
- struct dm_view_obj view_obj;
-};
-
-/* TODO - this will probably need to be in bview.h for common access */
-struct dm_display_list {
- int obj_type;
- union dm_object obj;
- struct bu_vls *handle; /**< @brief For non-geometry
view objects, need a string handle. For geometry objects, full path string */
- int dirty_flag; /**< @brief If set, need to
(re)generate the drawing content for this object */
- int visibility_flag; /**< @brief Allows
users to hide/view objects without needing to recreate them */
- int highlight_flag; /**< @brief Identify
whether the object is highlighted within the view */
- fastf_t draw_width; /**< @brief !0 override's the
display manager's default Point radius/line width */
- int fontsize; /**< @brief !0 override's the
display manager's default font size when obj labeling is performed */
- unsigned char rgb[3]; /**< @brief local color
override */
- struct bu_attribute_value_set *obj_extra_settings; /**< @brief All
settings (generic and DMTYPE specific) listed here. */
- void *client_data; /**< @brief Slot to allow
applications to supply custom data */
-};
-
-struct dm {
- uint32_t dm_magic;
- int dm_type; /**< @brief drawing
canvas type (X, OSG, Qt, txt, etc.) currently in use by display manager */
- char *handle; /**< @brief short name of
device */
- int perspective; /**< @brief !0 means
perspective on */
- mat_t view_matrix; /**< @brief view matrix for the
default camera */
- mat_t proj_matrix; /**< @brief projection matrix
for the default camera */
- void *dm_data; /**< @brief pointer to the
actual low level, platform specific data (X window, OSG viewer, internal lists,
etc.) */
- int is_embedded; /**< @brief determine
if the display manager is stand-alone or embedded (impacts event handling) */
- void *parent_info; /**< @brief if dm is embedded,
parent_info must contain all the info necessary for libdm to embed the Window */
- struct bu_ptbl *dm_l; /**< @brief Display list for
this view */
- int fontsize; /**< @brief !0 override's the
auto font size */
- unsigned char dm_bg[3]; /**< @brief background color */
- unsigned char dm_fg[3]; /**< @brief default foreground
color */
- fastf_t draw_width; /**< @brief Default point
radius/line width */
- int width;
- int height;
- struct bu_attribute_value_set *dm_settings; /**< @brief All
settings (generic and DMTYPE specific) listed here. */
- void *client_data; /**< @brief Slot to allow
applications to store custom data */
-};
-
-const char *dm_common_reserved_settings[] = {
- "perspective" "Enable/disable perspective mode. Specifics of the
perspective mode are controlled by the projection matrix."
- "proj_mat" "Projection matrix, used for perspective mode."
- "view_mat" "View matrix - controls the \"camera\" position in space."
- "background_rgb" "Background color, specified using Red/Green/Blue color
values"
- "foreground_rgb" "Default color for foreground objects, specified using
Red/Green/Blue color values"
- "draw_width" "Default line width/point radius used when drawing
objects."
- "fontsize" "Default font size for text rendering."
- "width" "Width of display window."
- "height" "Height of display window."
- "\0"
-};
-
-const char *dm_obj_common_reserved_settings[] = {
- "local_mat" "Local positioning matrix, used (for example) during
object editing manipulations."
- "rgb" "Object color, specified using Red/Green/Blue color
values. Defaults to geometry object color, if present."
- "draw_width" "Local line width/point radius used when drawing objects."
- "fontsize" "Local font size for text rendering."
- "dirty" "Flag telling the display manager that the object state
is out of sync with the visible state."
- "visible" "Flag telling the display manager that the object is (or
isn't) supposed to be visible in the view."
- "highlight" "Flag telling the display manager to highlight this
object."
- "\0"
-};
-
-/* Structure of dm will (hopefully) be internal to libdm, so use a typedef for
the functions */
-typedef struct dm dm_s;
-
-/* Generic functions for all display managers */
-DM_EXPORT extern void dm_set_handle(dm_s *dmp, const char *handle);
-DM_EXPORT extern char *dm_get_handle(dm_s *dmp);
-DM_EXPORT extern void dm_set_perspective(dm_s *dmp, int
perspective_flag);
-DM_EXPORT extern int dm_get_perspective(dm_s *dmp);
-DM_EXPORT extern void dm_set_proj_mat(dm_s *dmp, mat_t pmat);
-DM_EXPORT extern matp_t dm_get_proj_mat(dm_s *dmp);
-DM_EXPORT extern void dm_set_view_mat(dm_s *dmp, mat_t vmat);
-DM_EXPORT extern matp_t dm_get_view_mat(dm_s *dmp);
-DM_EXPORT extern void dm_set_background_rgb(dm_s *dmp, unsigned char
r, unsigned char g, unsigned char b);
-DM_EXPORT extern unsigned char *dm_get_background_rgb(dm_s *dmp);
-DM_EXPORT extern void dm_set_foreground_rgb(dm_s *dmp, unsigned char
r, unsigned char g, unsigned char b);
-DM_EXPORT extern unsigned char *dm_get_foreground_rgb(dm_s *dmp);
-DM_EXPORT extern void dm_set_default_draw_width(dm_s *dmp, fastf_t
draw_width);
-DM_EXPORT extern fastf_t dm_get_default_draw_width(dm_s *dmp, fastf_t
draw_width);
-DM_EXPORT extern void dm_set_default_fontsize(dm_s *dmp, int
fontsize);
-DM_EXPORT extern int dm_get_default_fontsize(dm_s *dmp);
-DM_EXPORT extern void dm_set_width(dm_s *dmp, int width);
-DM_EXPORT extern int dm_get_width(dm_s *dmp);
-DM_EXPORT extern void dm_set_height(dm_s *dmp, int height);
-DM_EXPORT extern int dm_get_height(dm_s *dmp);
-
-
-DM_EXPORT extern const char **dm_get_reserved_settings(dm_s
*dmp); /* Will be a combination of global and dm specific reserved settings */
-DM_EXPORT extern int dm_is_reserved_setting(dm_s
*dmp, const char *key);
-DM_EXPORT extern const char *dm_about_reserved_setting(dm_s
*dmp, const char *key);
-DM_EXPORT extern struct bu_attribute_value_set *dm_get_settings(dm_s *dmp,
const char *key);
-DM_EXPORT extern int dm_set_setting(dm_s *dmp,
const char *key, const char *val);
-DM_EXPORT extern const char *dm_get_setting(dm_s *dmp,
const char *key);
-
-/* Object manipulators */
-DM_EXPORT extern int dm_obj_add(dm_s *dmp, const char *handle, int
style_type, struct bn_vlist *vlist, struct bu_ptbl *obj_set);
-DM_EXPORT extern int dm_obj_find(dm_s *dmp, const char *handle);
-DM_EXPORT extern void dm_obj_remove(dm_s *dmp, const char *handle);
-
-DM_EXPORT extern void dm_set_obj_localmat(dm_s *dmp, const char
*handle, mat_t matrix);
-DM_EXPORT extern matp_t dm_get_obj_localmat(dm_s *dmp, const char
*handle);
-DM_EXPORT extern void dm_set_obj_rgb(dm_s *dmp, const char *handle,
unsigned char r, unsigned char g, unsigned char b);
-DM_EXPORT extern unsigned char *dm_get_obj_rgb(dm_s *dmp, const char *handle);
-DM_EXPORT extern void dm_set_obj_draw_width(dm_s *dmp, const char
*handle, fastf_t draw_width);
-DM_EXPORT extern fastf_t dm_get_obj_draw_width(dm_s *dmp, const char
*handle);
-DM_EXPORT extern void dm_set_obj_fontsize(dm_s *dmp, const char
*handle, int fontsize);
-DM_EXPORT extern int dm_get_obj_fontsize(dm_s *dmp, const char
*handle);
-DM_EXPORT extern void dm_set_obj_dirty(dm_s *dmp, const char
*handle, int flag);
-DM_EXPORT extern int dm_get_obj_dirty(dm_s *dmp, const char
*handle);
-DM_EXPORT extern void dm_set_obj_visible(dm_s *dmp, const char
*handle, int flag);
-DM_EXPORT extern int dm_get_obj_visible(dm_s *dmp, const char
*handle);
-DM_EXPORT extern void dm_set_obj_highlight(dm_s *dmp, const char
*handle, int flag);
-DM_EXPORT extern int dm_get_obj_highlight(dm_s *dmp, const char
*handle);
-
-DM_EXPORT extern const char
**dm_get_obj_reserved_settings(dm_s *dmp); /* Will be a combination of global
and dm specific reserved settings */
-DM_EXPORT extern int dm_is_obj_reserved_setting(dm_s
*dmp, const char *key);
-DM_EXPORT extern const char
*dm_about_obj_reserved_setting(dm_s *dmp, const char *key);
-DM_EXPORT extern struct bu_attribute_value_set *dm_get_obj_settings(dm_s *dmp,
const char *handle);
-DM_EXPORT extern int dm_set_obj_setting(dm_s *dmp,
const char *handle, const char *key, const char *val);
-DM_EXPORT extern const char *dm_get_obj_setting(dm_s *dmp,
const char *handle, const char *key);
-
-/* TODO The visibility of the framebuffer is handled like any other object,
but it is likely necessary
- * to expose more of the details of the object to allow libfb to work
properly?*/
-/* Idle though - could an ascii raytrace (like the old GIFT output) be useful
for "txt mode" debugging of raytracing? */
-DM_EXPORT extern void *dm_get_framebuffer(dm_s *dmp);
-
-
-/* Display Manager / OS type aware functions */
-DM_EXPORT extern int dm_init(dm_s *dmp, int dm_t, int embedded, void
*parent_info); /* TODO - need an actual public struct to hold parent info? */
-DM_EXPORT extern int dm_close(dm_s *dmp);
-DM_EXPORT extern int dm_refresh(dm_s *dmp);
-DM_EXPORT extern void *dm_canvas(dm_s *dmp); /* Exposes the low level drawing
object (X window, OpenGL context, etc.) for custom drawing */
-DM_EXPORT extern int dm_get_type(dm_s *dmp);
-DM_EXPORT extern int dm_set_type(dm_s *dmp, int dm_t);
-DM_EXPORT extern int dm_get_image(dm_s *dmp, icv_image_t *image);
-DM_EXPORT extern int dm_get_obj_image(dm_s *dmp, const char *handle,
icv_image_t *image);
-
-#endif /* DM_DM_DESIGN_H */
-
-/** @} */
-/*
- * Local Variables:
- * mode: C
- * tab-width: 8
- * indent-tabs-mode: t
- * c-file-style: "stroustrup"
- * End:
- * ex: shiftwidth=4 tabstop=8
- */
Modified: brlcad/branches/RELEASE/include/dm.h
===================================================================
--- brlcad/branches/RELEASE/include/dm.h 2020-08-15 00:35:05 UTC (rev
76768)
+++ brlcad/branches/RELEASE/include/dm.h 2020-08-15 01:05:57 UTC (rev
76769)
@@ -74,18 +74,7 @@
void *dmh_data;
};
-/* TODO - after plugins are established, these should be movable to
- * the private subheaders */
DM_EXPORT extern struct dm dm_null;
-DM_EXPORT extern struct dm dm_ogl;
-DM_EXPORT extern struct dm dm_plot;
-DM_EXPORT extern struct dm dm_ps;
-DM_EXPORT extern struct dm dm_tk;
-DM_EXPORT extern struct dm dm_wgl;
-DM_EXPORT extern struct dm dm_X;
-DM_EXPORT extern struct dm dm_txt;
-DM_EXPORT extern struct dm dm_qt;
-DM_EXPORT extern struct dm dm_osgl;
DM_EXPORT extern void *dm_interp(struct dm *dmp);
DM_EXPORT extern int dm_share_dlist(struct dm *dmp1,
@@ -171,9 +160,13 @@
const char *type,
int argc,
const char *argv[]);
-DM_EXPORT extern struct bu_vls *dm_list_types(const char *separator); /* free
return list with bu_vls_free(list); BU_PUT(list, struct bu_vls); */
+DM_EXPORT extern void dm_list_types(struct bu_vls *list, const char
*separator);
DM_EXPORT const char *dm_bestXType(const char *dpy_string);
+DM_EXPORT extern int dm_have_graphics();
+/* This reports the graphics system associated with the specified dm type
(returned values
+ * right now would be NULL, Tk or Qt - another eventual possibility is
GLFW...) */
+DM_EXPORT extern const char *dm_graphics_system(const char *dmtype);
/* functions to make a dm struct hideable - will need to
* sort these out later */
@@ -181,8 +174,9 @@
DM_EXPORT extern struct dm *dm_get();
DM_EXPORT extern void dm_put(struct dm *dmp);
DM_EXPORT extern void dm_set_null(struct dm *dmp); /* TODO - HACK, need
general set mechanism */
-DM_EXPORT extern const char *dm_get_dm_name(struct dm *dmp);
+DM_EXPORT extern const char *dm_get_dm_name(const struct dm *dmp);
DM_EXPORT extern const char *dm_get_dm_lname(struct dm *dmp);
+DM_EXPORT extern const char *dm_get_graphics_system(const struct dm *dmp);
DM_EXPORT extern int dm_get_width(struct dm *dmp);
DM_EXPORT extern int dm_get_height(struct dm *dmp);
DM_EXPORT extern void dm_set_width(struct dm *dmp, int width);
@@ -190,6 +184,7 @@
DM_EXPORT extern void dm_geometry_request(struct dm *dmp, int width, int
height);
DM_EXPORT extern void dm_internal_var(struct bu_vls *result, struct dm *dmp,
const char *key); // ick
DM_EXPORT extern fastf_t dm_get_aspect(struct dm *dmp);
+DM_EXPORT extern int dm_graphical(const struct dm *dmp);
DM_EXPORT extern const char *dm_get_type(struct dm *dmp);
DM_EXPORT extern unsigned long dm_get_id(struct dm *dmp);
DM_EXPORT extern void dm_set_id(struct dm *dmp, unsigned long new_id);
@@ -201,6 +196,9 @@
DM_EXPORT extern int dm_set_fg(struct dm *dmp, unsigned char r, unsigned char
g, unsigned char b, int strict, fastf_t transparency);
DM_EXPORT extern int dm_reshape(struct dm *dmp, int width, int height);
DM_EXPORT extern int dm_make_current(struct dm *dmp);
+DM_EXPORT extern int dm_doevent(struct dm *dmp, void *clientData, void
*eventPtr);
+DM_EXPORT extern int dm_get_dirty(struct dm *dmp);
+DM_EXPORT extern void dm_set_dirty(struct dm *dmp, int i);
DM_EXPORT extern vect_t *dm_get_clipmin(struct dm *dmp);
DM_EXPORT extern vect_t *dm_get_clipmax(struct dm *dmp);
DM_EXPORT extern int dm_get_bound_flag(struct dm *dmp);
Modified: brlcad/branches/RELEASE/include/ged/defines.h
===================================================================
--- brlcad/branches/RELEASE/include/ged/defines.h 2020-08-15 00:35:05 UTC
(rev 76768)
+++ brlcad/branches/RELEASE/include/ged/defines.h 2020-08-15 01:05:57 UTC
(rev 76769)
@@ -35,6 +35,7 @@
#include "bu/vls.h"
#include "dm/bview.h"
#include "rt/search.h"
+#include "rt/solid.h"
__BEGIN_DECLS
@@ -73,16 +74,23 @@
#define GED_DISPLAY_LIST_NULL ((struct display_list *)0)
#define GED_DRAWABLE_NULL ((struct ged_drawable *)0)
#define GED_VIEW_NULL ((struct bview *)0)
-#define GED_DM_VIEW_NULL ((struct ged_dm_view *)0)
#define GED_RESULT_NULL ((void *)0)
+/* Forward declaration */
+struct ged;
+
+typedef int (*ged_func_ptr)(struct ged *, int, const char *[]);
#define GED_FUNC_PTR_NULL ((ged_func_ptr)0)
-#define GED_REFRESH_CALLBACK_PTR_NULL ((ged_refresh_callback_ptr)0)
-#define GED_CREATE_VLIST_SOLID_CALLBACK_PTR_NULL
((ged_create_vlist_solid_callback_ptr)0)
-#define GED_CREATE_VLIST_CALLBACK_PTR_NULL ((ged_create_vlist_callback_ptr)0)
-#define GED_FREE_VLIST_CALLBACK_PTR_NULL ((ged_free_vlist_callback_ptr)0)
+/* Callback related definitions */
+typedef void (*ged_io_func_t)(void *, int);
+typedef void (*ged_refresh_func_t)(void *);
+typedef void (*ged_create_vlist_solid_func_t)(struct solid *);
+typedef void (*ged_create_vlist_display_list_func_t)(struct display_list *);
+typedef void (*ged_destroy_vlist_func_t)(unsigned int, int);
+struct ged_callback_state;
+
/**
* Definition of global parallel-processing semaphores.
*
@@ -116,10 +124,11 @@
struct ged_subprocess {
- struct bu_list l;
+ uint32_t magic; /**< @brief magic number */
struct bu_process *p;
void *chan;
int aborted;
+ struct ged *gedp;
};
/* FIXME: should be private */
@@ -145,11 +154,9 @@
/* FIXME: should be private */
struct ged_drawable {
- struct bu_list l;
- struct bu_list *gd_headDisplay; /**< @brief
head of display list */
+ struct bu_list *gd_headDisplay; /**< @brief head of
display list */
struct bu_list *gd_headVDraw; /**< @brief head of
vdraw list */
struct vd_curve *gd_currVHead; /**< @brief current
vdraw head */
- struct solid *gd_freeSolids; /**< @brief ptr to
head of free solid list */
char **gd_rt_cmd; /* DEPRECATED - will be
removed, do not use */
int gd_rt_cmd_len; /* DEPRECATED - will be
removed, do not use */
@@ -172,8 +179,8 @@
};
-typedef void (*ged_io_handler_callback_t)(void *, int);
+
struct ged_cmd;
/* struct details are private - use accessor functions to manipulate */
@@ -180,13 +187,19 @@
struct ged_results;
struct ged {
- struct bu_list l;
+ struct bu_vls go_name;
struct rt_wdb *ged_wdbp;
+ // The full set of bviews associated with this ged object
+ struct bu_ptbl ged_views;
+
+ void *u_data; /**< @brief User data associated with
this ged instance */
+
/** for catching log messages */
struct bu_vls *ged_log;
struct solid *freesolid; /* For now this is a struct
solid, but longer term that may not always be true */
+ struct bu_ptbl free_solids; /**< @brief solid structures
available for reuse */
/* @todo: add support for returning an array of objects, not just a
* simple string.
@@ -205,22 +218,22 @@
struct bview *ged_gvp;
struct bu_hash_tbl *ged_selections; /**< @brief object name ->
struct rt_object_selections */
- void *ged_refresh_clientdata; /**< @brief
client data passed to refresh handler */
- void (*ged_refresh_handler)(void *); /**< @brief
function for handling refresh requests */
- void (*ged_output_handler)(struct ged *, char *);
/**< @brief function for handling output */
char *ged_output_script; /**< @brief
script for use by the outputHandler */
- void (*ged_create_vlist_solid_callback)(struct solid
*); /**< @brief function to call after creating a vlist to create display
list for solid */
- void (*ged_create_vlist_callback)(struct
display_list *); /**< @brief function to call after all vlist created that
loops through creating display list for each solid */
- void (*ged_free_vlist_callback)(unsigned int, int);
/**< @brief function to call after freeing a vlist */
- /* FIXME -- this ugly hack needs to die. the result string should be
stored before the call. */
+
+ /* FIXME -- this ugly hack needs to die. the result string should
+ * be stored before the call.
+ */
int ged_internal_call;
- /* Handler functions for I/O communication with asynchronous subprocess
commands */
- int io_mode;
- void (*ged_create_io_handler)(void **chan, struct bu_process *p,
bu_process_io_t d, int mode, void *data, ged_io_handler_callback_t callback);
- void (*ged_delete_io_handler)(void *interp, void *chan, struct bu_process
*p, bu_process_io_t d, void *data, ged_io_handler_callback_t callback);
+ /* TODO: hide all callback related symbols, callback typedefs
+ * (above), and eventually most if not all of the remaining fields
+ * into an _impl structure so callers are not tightly coupled to
+ * the ged structure. access via public functions that have been
+ * given design consideration.
+ */
+
/* FOR LIBGED INTERNAL USE */
struct ged_cmd *cmds;
int (*add)(struct ged *gedp, const struct ged_cmd *cmd);
@@ -227,21 +240,51 @@
int (*del)(struct ged *gedp, const char *name);
int (*run)(struct ged *gedp, int ac, char *av[]);
- struct ged_subprocess gd_headSubprocess; /**< @brief head of forked
processes */
+ struct bu_ptbl ged_subp; /**< @brief forked sub-processes */
+ /* Interface to LIBDM */
+ void *ged_dmp;
+
+
+ /* Callbacks */
+
+ struct ged_callback_state *ged_cbs;
+ void (*ged_refresh_handler)(void *); /**< @brief
function for handling refresh requests */
+ void *ged_refresh_clientdata; /**< @brief
client data passed to refresh handler */
+ void (*ged_output_handler)(struct ged *, char *);
/**< @brief function for handling output */
+ void (*ged_create_vlist_solid_callback)(struct solid
*); /**< @brief function to call after creating a vlist to create display
list for solid */
+ void
(*ged_create_vlist_display_list_callback)(struct display_list *); /**<
@brief function to call after all vlist created that loops through creating
display list for each solid */
+ void (*ged_destroy_vlist_callback)(unsigned int,
int); /**< @brief function to call after freeing a vlist */
+
+ /* Handler functions for I/O communication with asynchronous subprocess
commands. There
+ * are two opaque data structures at play here, with different scopes.
One is the "data"
+ * pointer passed to ged_create_io_handler, which is used to store
command-specific
+ * information internal to the library (the simplest thing to do is pass
ged_subprocess
+ * in as the data pointer, but if that's not enough - see for example
rtcheck - this
+ * mechanism allows for more elaborate measures.
+ *
+ * The second is ged_io_data, which is set in gedp by the calling
application. This is where
+ * information specific to the parent's I/O environment (which by
definition the library
+ * can't know about as it is application specific) lives. It should be
assigned in the
+ * applications gedp before any calls to ged_create_io_handler are made.
+ * */
+ void (*ged_create_io_handler)(struct ged_subprocess *gp, bu_process_io_t
d, ged_io_func_t callback, void *data);
+ void (*ged_delete_io_handler)(struct ged_subprocess *gp, bu_process_io_t
fd);
+ void *ged_io_data; /**< brief caller supplied data */
+
+ // Other callbacks...
+ // Tcl command strings - these are libtclcad level callbacks that execute
user supplied Tcl commands if set:
+ // gdv_callback, gdv_edit_motion_delta_callback, go_more_args_callback,
go_rt_end_callback
+ //
+ // fbserv_obj: fbs_callback
+ // bview.h gv_callback (only used by MGED?)
+ // db_search_callback_t
+
void *ged_interp; /* Temporary - do not rely on when designing new
functionality */
db_search_callback_t ged_interp_eval; /* FIXME: broke the rule written on
the previous line */
- /* Interface to LIBDM */
- void *ged_dmp;
};
-typedef int (*ged_func_ptr)(struct ged *, int, const char *[]);
-typedef void (*ged_refresh_callback_ptr)(void *);
-typedef void (*ged_create_vlist_solid_callback_ptr)(struct solid *);
-typedef void (*ged_create_vlist_callback_ptr)(struct display_list *);
-typedef void (*ged_free_vlist_callback_ptr)(unsigned int, int);
-
/* accessor functions for ged_results - calling
* applications should not work directly with the
* internals of ged_results, which are not guaranteed
Modified: brlcad/branches/RELEASE/include/ged/view.h
===================================================================
--- brlcad/branches/RELEASE/include/ged/view.h 2020-08-15 00:35:05 UTC (rev
76768)
+++ brlcad/branches/RELEASE/include/ged/view.h 2020-08-15 01:05:57 UTC (rev
76769)
@@ -64,15 +64,10 @@
/* defined in display_list.c */
GED_EXPORT void dl_set_iflag(struct bu_list *hdlp, int iflag);
GED_EXPORT extern void dl_color_soltab(struct bu_list *hdlp);
-GED_EXPORT extern void dl_erasePathFromDisplay(struct bu_list *hdlp,
- struct db_i *dbip,
- void (*callback)(unsigned int,
int),
- const char *path,
- int allow_split,
- struct solid *freesolid);
+GED_EXPORT extern void dl_erasePathFromDisplay(struct ged *gedp, const char
*path, int allow_split);
GED_EXPORT extern struct display_list *dl_addToDisplay(struct bu_list *hdlp,
struct db_i *dbip, const char *name);
-GED_EXPORT extern int invent_solid(struct bu_list *hdlp, struct db_i *dbip,
void (*callback_create)(struct solid *), void (*callback_free)(unsigned int,
int), char *name, struct bu_list *vhead, long int rgb, int copy, fastf_t
transparency, int dmode, struct solid *freesolid, int csoltab);
+GED_EXPORT extern int invent_solid(struct ged *gedp, char *name, struct
bu_list *vhead, long int rgb, int copy, fastf_t transparency, int dmode, int
csoltab);
/* defined in ged.c */
GED_EXPORT extern void ged_view_init(struct bview *gvp);
@@ -154,6 +149,8 @@
GED_EXPORT extern int ged_polygons_overlap(struct ged *gedp, struct bg_polygon
*polyA, struct bg_polygon *polyB);
GED_EXPORT extern void ged_polygon_fill_segments(struct ged *gedp, struct
bg_polygon *poly, vect2d_t vfilldir, fastf_t vfilldelta);
+GED_EXPORT extern struct bview * ged_find_view(struct ged *gedp, const char
*key);
+
// TODO - this (and probably the grid logic too) belong at the libdm level -
they're operating
// on the bview, rather than the ged level data...
GED_EXPORT extern int ged_snap_to_lines(struct ged *gedp, fastf_t *vx, fastf_t
*vy);
Modified: brlcad/branches/RELEASE/include/tclcad.h
===================================================================
--- brlcad/branches/RELEASE/include/tclcad.h 2020-08-15 00:35:05 UTC (rev
76768)
+++ brlcad/branches/RELEASE/include/tclcad.h 2020-08-15 01:05:57 UTC (rev
76769)
@@ -133,38 +133,40 @@
DM_EXPORT extern int fbs_open(struct fbserv_obj *fbsp, int port);
DM_EXPORT extern int fbs_close(struct fbserv_obj *fbsp);
+struct tclcad_ged_data {
+ struct ged *gedp;
+ struct bu_vls go_more_args_callback;
+ int go_more_args_callback_cnt;
-struct ged_dm_view {
- struct bu_list l;
- struct bu_vls gdv_callback;
- struct bu_vls gdv_edit_motion_delta_callback;
- struct bu_vls gdv_name;
- struct bview *gdv_view;
- struct dm *gdv_dmp;
- struct fbserv_obj gdv_fbs;
- struct ged_obj *gdv_gop;
- int gdv_hide_view;
-};
+ // These are view related, but appear to be intended as global across all
+ // views associated with the gedp - that is why they are here and not in
+ // tclcad_view_data.
+ struct bu_hash_tbl *go_edited_paths;
+ struct bu_vls go_rt_end_callback;
+ int go_rt_end_callback_cnt;
+ int go_dlist_on;
+ int go_refresh_on;
-struct ged_obj {
- struct ged *go_gedp;
- struct ged_dm_view go_head_views;
- struct bu_vls go_name;
- struct bu_vls go_more_args_callback;
- struct bu_vls go_rt_end_callback;
+ // TODO - these really shouldn't be libtclcad specific... we don't want to
+ // depend on Tcl for label primitives...
struct bu_vls *go_prim_label_list;
int go_prim_label_list_size;
- int go_refresh_on;
- int go_dlist_on;
- Tcl_Interp *interp;
- struct bu_hash_tbl *go_edited_paths;
};
-#define GED_OBJ_NULL ((struct ged_obj *)0)
+// Data specific to an individual view rather than the geometry database
+// instance.
+struct tclcad_view_data {
+ struct ged *gedp;
+ struct bu_vls gdv_edit_motion_delta_callback;
+ int gdv_edit_motion_delta_callback_cnt;
+ struct bu_vls gdv_callback;
+ int gdv_callback_cnt;
+ struct fbserv_obj gdv_fbs;
+};
struct tclcad_obj {
struct bu_list l;
- struct ged_obj *to_gop;
+ struct ged *to_gedp;
Tcl_Interp *to_interp;
};
@@ -350,108 +352,108 @@
TCLCAD_EXPORT extern struct application *to_rt_gettrees_application(struct ged
*gedp,
int argc,
const char
*argv[]);
-TCLCAD_EXPORT extern void go_refresh(struct ged_obj *gop,
- struct ged_dm_view *gdvp);
-TCLCAD_EXPORT extern void go_refresh_draw(struct ged_obj *gop,
- struct ged_dm_view *gdvp,
+TCLCAD_EXPORT extern void go_refresh(struct ged *gedp,
+ struct bview *gdvp);
+TCLCAD_EXPORT extern void go_refresh_draw(struct ged *gedp,
+ struct bview *gdvp,
int restore_zbuffer);
-TCLCAD_EXPORT extern int go_view_axes(struct ged_obj *gop,
- struct ged_dm_view *gdvp,
+TCLCAD_EXPORT extern int go_view_axes(struct ged *gedp,
+ struct bview *gdvp,
int argc,
const char *argv[],
const char *usage);
TCLCAD_EXPORT extern int go_data_labels(Tcl_Interp *interp,
struct ged *gedp,
- struct ged_dm_view *gdvp,
+ struct bview *gdvp,
int argc,
const char *argv[],
const char *usage);
TCLCAD_EXPORT extern int go_data_arrows(Tcl_Interp *interp,
struct ged *gedp,
- struct ged_dm_view *gdvp,
+ struct bview *gdvp,
int argc,
const char *argv[],
const char *usage);
TCLCAD_EXPORT extern int go_data_pick(struct ged *gedp,
- struct ged_dm_view *gdvp,
+ struct bview *gdvp,
int argc,
const char *argv[],
const char *usage);
TCLCAD_EXPORT extern int go_data_axes(Tcl_Interp *interp,
struct ged *gedp,
- struct ged_dm_view *gdvp,
+ struct bview *gdvp,
int argc,
const char *argv[],
const char *usage);
TCLCAD_EXPORT extern int go_data_lines(Tcl_Interp *interp,
struct ged *gedp,
- struct ged_dm_view *gdvp,
+ struct bview *gdvp,
int argc,
const char *argv[],
const char *usage);
TCLCAD_EXPORT extern int go_data_move(Tcl_Interp *interp,
struct ged *gedp,
- struct ged_dm_view *gdvp,
+ struct bview *gdvp,
int argc,
const char *argv[],
const char *usage);
TCLCAD_EXPORT extern int go_data_move_object_mode(Tcl_Interp *interp,
struct ged *gedp,
- struct ged_dm_view *gdvp,
+ struct bview *gdvp,
int argc,
const char *argv[],
const char *usage);
TCLCAD_EXPORT extern int go_data_move_point_mode(Tcl_Interp *interp,
struct ged *gedp,
- struct ged_dm_view *gdvp,
+ struct bview *gdvp,
int argc,
const char *argv[],
const char *usage);
TCLCAD_EXPORT extern int go_data_polygons(Tcl_Interp *interp,
struct ged *gedp,
- struct ged_dm_view *gdvp,
+ struct bview *gdvp,
int argc,
const char *argv[],
const char *usage);
TCLCAD_EXPORT extern int go_mouse_poly_circ(Tcl_Interp *interp,
struct ged *gedp,
- struct ged_dm_view *gdvp,
+ struct bview *gdvp,
int argc,
const char *argv[],
const char *usage);
TCLCAD_EXPORT extern int go_mouse_poly_cont(Tcl_Interp *interp,
struct ged *gedp,
- struct ged_dm_view *gdvp,
+ struct bview *gdvp,
int argc,
const char *argv[],
const char *usage);
TCLCAD_EXPORT extern int go_mouse_poly_ell(Tcl_Interp *interp,
struct ged *gedp,
- struct ged_dm_view *gdvp,
+ struct bview *gdvp,
int argc,
const char *argv[],
const char *usage);
TCLCAD_EXPORT extern int go_mouse_poly_rect(Tcl_Interp *interp,
struct ged *gedp,
- struct ged_dm_view *gdvp,
+ struct bview *gdvp,
int argc,
const char *argv[],
const char *usage);
TCLCAD_EXPORT extern int go_poly_circ_mode(Tcl_Interp *interp,
struct ged *gedp,
- struct ged_dm_view *gdvp,
+ struct bview *gdvp,
int argc,
const char *argv[],
const char *usage);
TCLCAD_EXPORT extern int go_poly_ell_mode(Tcl_Interp *interp,
struct ged *gedp,
- struct ged_dm_view *gdvp,
+ struct bview *gdvp,
int argc,
const char *argv[],
const char *usage);
TCLCAD_EXPORT extern int go_poly_rect_mode(Tcl_Interp *interp,
struct ged *gedp,
- struct ged_dm_view *gdvp,
+ struct bview *gdvp,
int argc,
const char *argv[],
const char *usage);
@@ -460,13 +462,13 @@
struct bu_vls *result_str);
TCLCAD_EXPORT extern int go_poly_cont_build(Tcl_Interp *interp,
struct ged *gedp,
- struct ged_dm_view *gdvp,
+ struct bview *gdvp,
int argc,
const char *argv[],
const char *usage);
TCLCAD_EXPORT extern int go_poly_cont_build_end(Tcl_Interp *UNUSED(interp),
struct ged *gedp,
- struct ged_dm_view *gdvp,
+ struct bview *gdvp,
int argc,
const char *argv[],
const char *usage);
@@ -513,16 +515,17 @@
TCLCAD_EXPORT extern int tclcad_init(Tcl_Interp *interp, int init_gui, struct
bu_vls *tlog);
/**
- * Create Tcl specific I/O handlers
+ * Tcl specific I/O handlers
*/
+struct tclcad_io_data {
+ Tcl_Channel chan;
+ Tcl_Interp *interp;
+ int io_mode;
+};
TCLCAD_EXPORT void
-tclcad_create_io_handler(void **chan, struct bu_process *p, bu_process_io_t d,
int mode, void *data, ged_io_handler_callback_t callback);
-
-/**
- * Delete Tcl specific I/O handlers
- */
+tclcad_create_io_handler(struct ged_subprocess *p, bu_process_io_t d,
ged_io_func_t callback, void *data);
TCLCAD_EXPORT void
-tclcad_delete_io_handler(void *interp, void *chan, struct bu_process *p,
bu_process_io_t d, void *data, ged_io_handler_callback_t callback);
+tclcad_delete_io_handler(struct ged_subprocess *p, bu_process_io_t d);
/* dm_tcl.c */
Modified: brlcad/branches/RELEASE/misc/CMakeLists.txt
===================================================================
--- brlcad/branches/RELEASE/misc/CMakeLists.txt 2020-08-15 00:35:05 UTC (rev
76768)
+++ brlcad/branches/RELEASE/misc/CMakeLists.txt 2020-08-15 01:05:57 UTC (rev
76769)
@@ -215,6 +215,7 @@
repoconv/email_fixups.txt
repoconv/cvs_repaired/sphflake.pix,v
repoconv/gitattributes
+ repoconv/github_ci_actions.yml
repoconv/gitignore.tar.gz
repoconv/manual_merge_info.tar.gz
repoconv/md5.hpp
Modified: brlcad/branches/RELEASE/misc/repoconv/NOTES
===================================================================
--- brlcad/branches/RELEASE/misc/repoconv/NOTES 2020-08-15 00:35:05 UTC (rev
76768)
+++ brlcad/branches/RELEASE/misc/repoconv/NOTES 2020-08-15 01:05:57 UTC (rev
76769)
@@ -234,6 +234,7 @@
https://github.com/actions/starter-workflows/pull/47
https://github.com/cristianadam/HelloWorld/
https://github.com/marketplace/actions/run-cmake
+https://github.com/marketplace/actions/makensis
https://github.com/jurplel/install-qt-action
BRL-CAD's test will likely be quite heavy by normal testing standards,
Copied: brlcad/branches/RELEASE/misc/repoconv/github_ci_actions.yml (from rev
76740, brlcad/trunk/misc/repoconv/github_ci_actions.yml)
===================================================================
--- brlcad/branches/RELEASE/misc/repoconv/github_ci_actions.yml
(rev 0)
+++ brlcad/branches/RELEASE/misc/repoconv/github_ci_actions.yml 2020-08-15
01:05:57 UTC (rev 76769)
@@ -0,0 +1,150 @@
+#
+# This logic defines cross platform build testing for BRL-CAD using
+# Github's "Actions" mechanism.
+#
+# We define a setup similar to https://github.com/cristianadam/HelloWorld/
+#
+# Github has a time limit on these tests, and we also don't want to stress the
+# system too heavily (particularly if we want to run them per-commit.) For
+# testing purposes we're currently using distcheck, but for eventual
+# production use we need to change our build targets to something more
+# streamlined. It is probably also worth disabling step and gdal based
+# features for the standard tests, as those compilation pieces are quite
+# expensive - they should probably be regulated to something like a once-a-day
+# test.
+#
+# TODO - figure out how to schedule chron based jobs as well as the per
+# commit tests below, so we can define rarer but progressively more
+# comprehensive and heaver test runs.
+#
+# TODO - figure out if we can generate actual release binaries from the
+# artifacts of these builds.
+#
+
+name: BRL-CAD
+
+on: [push]
+
+jobs:
+ build:
+ #
+ # Define a matrix of the operating system and compiler combinations
+ # we want to build against.
+ #
+ name: ${{ matrix.config.name }}
+ runs-on: ${{ matrix.config.os }}
+ strategy:
+ fail-fast: false
+ matrix:
+ config:
+ - {
+ name: "Windows Latest MSVC", artifact: "Windows-MSVC.tar.xz",
+ os: windows-latest,
+ cc: "cl", cxx: "cl",
+ environment_script: "C:/Program Files (x86)/Microsoft Visual
Studio/2019/Enterprise/VC/Auxiliary/Build/vcvars64.bat"
+ }
+ - {
+ name: "Ubuntu Latest GCC", artifact: "Linux.tar.xz",
+ os: ubuntu-latest,
+ cc: "gcc", cxx: "g++"
+ }
+ - {
+ name: "macOS Latest Clang", artifact: "macOS.tar.xz",
+ os: macos-latest,
+ cc: "clang", cxx: "clang++"
+ }
+
+ #
+ # For each platform, we need to checkout the git repository,
+ # and run CMake.
+ #
+ # The logic below uses the approach demonstrated by Cristian Adam
+ # which takes CMake's scripting mode (-P) and passes in from stdin
+ # a script that incorporates values defined in the YAML environment.
+ #
+ # Windows in particular needs the environment set up for compilation,
+ # so the script recognizes when it is in that environment and
+ # operates accordingly.
+ #
+ steps:
+ - uses: actions/checkout@v1
+
+ - name: Configure
+ shell: cmake -P {0}
+ run: |
+ set(ENV{CC} ${{ matrix.config.cc }})
+ set(ENV{CXX} ${{ matrix.config.cxx }})
+
+ if ("${{ runner.os }}" STREQUAL "Windows" AND NOT "x${{
matrix.config.environment_script }}" STREQUAL "x")
+ execute_process(
+ COMMAND "${{ matrix.config.environment_script }}" && set
+ OUTPUT_FILE environment_script_output.txt
+ )
+ file(STRINGS environment_script_output.txt output_lines)
+ foreach(line IN LISTS output_lines)
+ if (line MATCHES "^([a-zA-Z0-9_-]+)=(.*)$")
+ set(ENV{${CMAKE_MATCH_1}} "${CMAKE_MATCH_2}")
+ endif()
+ endforeach()
+ endif()
+
+ set(path_separator ":")
+ if ("${{ runner.os }}" STREQUAL "Windows")
+ set(path_separator ";")
+ endif()
+ set(ENV{PATH} "$ENV{GITHUB_WORKSPACE}${path_separator}$ENV{PATH}")
+
+ execute_process(
+ COMMAND cmake
+ -S .
+ -B build
+ -D CMAKE_BUILD_TYPE=$ENV{BUILD_TYPE}
+ -D CMAKE_VERBOSE_DISTCHECK=ON
+ RESULT_VARIABLE result
+ )
+ if (NOT result EQUAL 0)
+ message(FATAL_ERROR "Bad exit status")
+ endif()
+
+ #
+ # As with the configure stage, the build uses CMake's scripting mode (-P)
+ # and passes a script in on stdin.
+ #
+ # Windows needs the environment set up for compilation - paths for the
+ # compilation are not set up by default in command line environments,
+ # unlike most Unix-like systems. Accordingly the script recognizes when
+ # it is on Windows and executes the necessary setup code.
+ #
+ - name: Build
+ shell: cmake -P {0}
+ run: |
+ if ("${{ runner.os }}" STREQUAL "Windows" AND NOT "x${{
matrix.config.environment_script }}" STREQUAL "x")
+ file(STRINGS environment_script_output.txt output_lines)
+ foreach(line IN LISTS output_lines)
+ if (line MATCHES "^([a-zA-Z0-9_-]+)=(.*)$")
+ set(ENV{${CMAKE_MATCH_1}} "${CMAKE_MATCH_2}")
+ endif()
+ endforeach()
+ endif()
+
+ set(path_separator ":")
+ if ("${{ runner.os }}" STREQUAL "Windows")
+ set(path_separator ";")
+ endif()
+ set(ENV{PATH} "$ENV{GITHUB_WORKSPACE}${path_separator}$ENV{PATH}")
+
+ if ("${{ runner.os }}" STREQUAL "Windows")
+ execute_process(
+ COMMAND cmake --build build --config Release --target
distcheck-enableall_release
+ RESULT_VARIABLE result
+ )
+ else ("${{ runner.os }}" STREQUAL "Windows")
+ execute_process(
+ COMMAND cmake --build build --config Release --target distcheck
+ RESULT_VARIABLE result
+ )
+ endif ("${{ runner.os }}" STREQUAL "Windows")
+ if (NOT result EQUAL 0)
+ message(FATAL_ERROR "Bad exit status")
+ endif()
+
Modified: brlcad/branches/RELEASE/src/fbserv/fbserv.c
===================================================================
--- brlcad/branches/RELEASE/src/fbserv/fbserv.c 2020-08-15 00:35:05 UTC (rev
76768)
+++ brlcad/branches/RELEASE/src/fbserv/fbserv.c 2020-08-15 01:05:57 UTC (rev
76769)
@@ -77,9 +77,11 @@
#include "bio.h"
#include "bu/app.h"
+#include "bu/color.h"
+#include "bu/exit.h"
+#include "bu/getopt.h"
+#include "bu/log.h"
#include "bu/malloc.h"
-#include "bu/getopt.h"
-#include "bu/exit.h"
#include "bu/snooze.h"
#include "vmath.h"
#include "dm.h"
@@ -107,7 +109,7 @@
int verbose = 0;
/* from server.c */
-extern const struct pkg_switch fb_server_pkg_switch[];
+extern const struct pkg_switch pkg_switch[];
extern struct fb *fb_server_fbp;
extern fd_set *fb_server_select_list;
extern int *fb_server_max_fd;
@@ -194,13 +196,36 @@
return 0;
}
+/*
+ * Communication error. An error occurred on the PKG link.
+ * It may be local, or it may be between us and the client we are serving.
+ * We send a copy to syslog or stderr.
+ * Don't send one down the wire, this can cause loops.
+ */
+static void
+communications_error(const char *str)
+{
+#if defined(HAVE_SYSLOG_H)
+ if (use_syslog) {
+ syslog(LOG_ERR, "%s", str);
+ } else {
+ fprintf(stderr, "%s", str);
+ }
+#else
+ fprintf(stderr, "%s", str);
+#endif
+ if (verbose) {
+ fprintf(stderr, "%s", str);
+ }
+}
+
static void
-setup_socket(int fd)
+fbserv_setup_socket(int fd)
{
int on = 1;
-#ifdef SO_KEEPALIVE
+#if defined(SO_KEEPALIVE)
if (setsockopt(fd, SOL_SOCKET, SO_KEEPALIVE, (char *)&on, sizeof(on)) < 0)
{
# ifdef HAVE_SYSLOG_H
syslog(LOG_WARNING, "setsockopt (SO_KEEPALIVE): %s", strerror(errno));
@@ -207,11 +232,10 @@
# endif
}
#endif
-#ifdef SO_RCVBUF
+#if defined(SO_RCVBUF)
/* try to set our buffers up larger */
{
- int m = 0;
- int n = 0;
+ int m = -1, n = -1;
int val;
int size;
@@ -224,14 +248,30 @@
(char *)&val, sizeof(val));
if (m >= 0 && n >= 0) break;
}
- if (m < 0 || n < 0) perror("fbserv setsockopt()");
+
+ if (m < 0 || n < 0)
+ perror("setsockopt");
}
#endif
}
+static void
+fbserv_drop_client(int sub)
+{
+ int fd;
-void
-new_client(struct pkg_conn *pcp)
+ if (clients[sub] == PKC_NULL)
+ return;
+
+ fd = clients[sub]->pkc_fd;
+
+ FD_CLR(fd, &select_list);
+ pkg_close(clients[sub]);
+ clients[sub] = PKC_NULL;
+}
+
+static void
+fbserv_new_client(struct pkg_conn *pcp)
{
int i;
@@ -244,7 +284,7 @@
clients[i] = pcp;
FD_SET(pcp->pkc_fd, &select_list);
V_MAX(max_fd, pcp->pkc_fd);
- setup_socket(pcp->pkc_fd);
+ fbserv_setup_socket(pcp->pkc_fd);
return;
}
fprintf(stderr, "fbserv: too many clients\n");
@@ -252,47 +292,8 @@
}
-void
-drop_client(int sub)
-{
- int fd;
- if (clients[sub] == PKC_NULL)
- return;
-
- fd = clients[sub]->pkc_fd;
-
- FD_CLR(fd, &select_list);
- pkg_close(clients[sub]);
- clients[sub] = PKC_NULL;
-}
-
-
/*
- * Communication error. An error occurred on the PKG link.
- * It may be local, or it may be between us and the client we are serving.
- * We send a copy to syslog or stderr.
- * Don't send one down the wire, this can cause loops.
- */
-static void
-comm_error(const char *str)
-{
-#if defined(HAVE_SYSLOG_H)
- if (use_syslog) {
- syslog(LOG_ERR, "%s", str);
- } else {
- fprintf(stderr, "%s", str);
- }
-#else
- fprintf(stderr, "%s", str);
-#endif
- if (verbose) {
- fprintf(stderr, "%s", str);
- }
-}
-
-
-/*
* Loop forever handling clients as they come and go.
* Access to the framebuffer may be interleaved, if the user
* wants it that way.
@@ -336,7 +337,7 @@
/* Accept any new client connections */
if (netfd > 0 && FD_ISSET(netfd, &infds)) {
- new_client(pkg_getclient(netfd, fb_server_pkg_switch, comm_error,
0));
+ fbserv_new_client(pkg_getclient(netfd, pkg_switch,
communications_error, 0));
nopens++;
}
@@ -350,7 +351,7 @@
if (! FD_ISSET(clients[i]->pkc_fd, &infds)) continue;
if (pkg_suckin(clients[i]) <= 0) {
/* Probably EOF */
- drop_client(i);
+ fbserv_drop_client(i);
ncloses++;
continue;
}
@@ -415,7 +416,7 @@
netfd = 0;
if (is_socket(netfd)) {
init_syslog();
- new_client(pkg_transerver(fb_server_pkg_switch, comm_error));
+ fbserv_new_client(pkg_transerver(pkg_switch, communications_error));
max_fd = 8;
once_only = 1;
main_loop();
@@ -448,7 +449,7 @@
/*
* Hang an unending listen for PKG connections
*/
- if ((netfd = pkg_permserver(portname, 0, 0, comm_error)) < 0)
+ if ((netfd = pkg_permserver(portname, 0, 0, communications_error)) < 0)
bu_exit(-1, NULL);
FD_SET(netfd, &select_list);
V_MAX(max_fd, netfd);
@@ -471,13 +472,13 @@
}
init_syslog();
- while ((netfd = pkg_permserver(portname, 0, 0, comm_error)) < 0) {
+ while ((netfd = pkg_permserver(portname, 0, 0, communications_error)) < 0)
{
static int error_count=0;
bu_snooze(BU_SEC2USEC(1));
if (error_count++ < 60) {
continue;
}
- comm_error("Unable to start the stand-alone framebuffer daemon after 60
seconds, giving up.");
+ communications_error("Unable to start the stand-alone framebuffer
daemon after 60 seconds, giving up.");
return 1;
}
@@ -485,7 +486,7 @@
int fbstat;
struct pkg_conn *pcp;
- pcp = pkg_getclient(netfd, fb_server_pkg_switch, comm_error, 0);
+ pcp = pkg_getclient(netfd, pkg_switch, communications_error, 0);
if (pcp == PKC_ERROR)
break; /* continue is unlikely to work */
@@ -496,7 +497,7 @@
/* Create 2nd level child process, "double detach" */
if (fork() == 0) {
/* 2nd level child -- start work! */
- new_client(pcp);
+ fbserv_new_client(pcp);
once_only = 1;
main_loop();
return 0;
@@ -516,7 +517,6 @@
return 2;
}
-
#ifndef _WIN32
/*
* Handles error or log messages from the frame buffer library.
@@ -546,8 +546,8 @@
for (i = MAX_CLIENTS-1; i >= 0; i--) {
if (clients[i] == NULL) continue;
if (pkg_send(MSG_ERROR, outbuf, want, clients[i]) != want) {
- comm_error("pkg_send error in fb_log, message was:\n");
- comm_error(outbuf);
+ communications_error("pkg_send error in fb_log, message was:\n");
+ communications_error(outbuf);
} else {
nsent++;
}
Modified: brlcad/branches/RELEASE/src/fbserv/server.c
===================================================================
--- brlcad/branches/RELEASE/src/fbserv/server.c 2020-08-15 00:35:05 UTC (rev
76768)
+++ brlcad/branches/RELEASE/src/fbserv/server.c 2020-08-15 01:05:57 UTC (rev
76769)
@@ -64,9 +64,9 @@
* which might send the message back across the wire.
*/
static void
-fb_server_got_unknown(struct pkg_conn *pcp, char *buf)
+fb_server_fb_unknown(struct pkg_conn *pcp, char *buf)
{
- fb_log("fb_server_got_unknown: message type %d not part of remote LIBFB
protocol, ignored.\n",
+ fb_log("fb_server_fb_unknown: message type %d not part of remote LIBFB
protocol, ignored.\n",
pcp->pkc_type);
(void)free(buf);
}
@@ -85,8 +85,10 @@
char rbuf[5*NET_LONG_LEN+1];
int want;
- if (buf == NULL) return;
- if (pcp == PKC_NULL) return;
+ if (buf == NULL)
+ return;
+ if (pcp == PKC_NULL)
+ return;
width = pkg_glong(&buf[0*NET_LONG_LEN]);
height = pkg_glong(&buf[1*NET_LONG_LEN]);
@@ -122,7 +124,8 @@
want = 5*NET_LONG_LEN;
if (pkg_send(MSG_RETURN, rbuf, want, pcp) != want)
fprintf(stderr, "pkg_send fb_open reply\n");
- if (buf) (void)free(buf);
+ if (buf)
+ (void)free(buf);
}
@@ -148,7 +151,8 @@
* If communication has broken, other end will know we are gone.
*/
(void)pkg_send(MSG_RETURN, rbuf, NET_LONG_LEN, pcp);
- if (buf) (void)free(buf);
+ if (buf)
+ (void)free(buf);
}
@@ -176,7 +180,8 @@
if (pkg_send(MSG_RETURN, rbuf, NET_LONG_LEN, pcp) != NET_LONG_LEN)
fprintf(stderr, "pkg_send fb_free reply\n");
- if (buf) (void)free(buf);
+ if (buf)
+ (void)free(buf);
fb_server_got_fb_free = 1;
}
@@ -188,8 +193,10 @@
RGBpixel bg;
char rbuf[NET_LONG_LEN+1];
- if (buf == NULL) return;
- if (pcp == PKC_NULL) return;
+ if (buf == NULL)
+ return;
+ if (pcp == PKC_NULL)
+ return;
bg[RED] = buf[0];
bg[GRN] = buf[1];
@@ -198,7 +205,8 @@
(void)pkg_plong(rbuf, fb_clear(fb_server_fbp, bg));
pkg_send(MSG_RETURN, rbuf, NET_LONG_LEN, pcp);
- if (buf) (void)free(buf);
+ if (buf)
+ (void)free(buf);
}
@@ -211,8 +219,10 @@
static unsigned char *scanbuf = NULL;
static size_t buflen = 0;
- if (buf == NULL) return;
- if (pcp == PKC_NULL) return;
+ if (buf == NULL)
+ return;
+ if (pcp == PKC_NULL)
+ return;
x = pkg_glong(&buf[0*NET_LONG_LEN]);
y = pkg_glong(&buf[1*NET_LONG_LEN]);
@@ -226,7 +236,8 @@
if ((scanbuf = (unsigned char *)malloc(buflen)) == NULL) {
fb_log("fb_read: malloc failed!");
- if (buf) (void)free(buf);
+ if (buf)
+ (void)free(buf);
buflen = 0;
return;
}
@@ -237,7 +248,8 @@
/* sending a 0-length package indicates error */
pkg_send(MSG_RETURN, (char *)scanbuf, ret*sizeof(RGBpixel), pcp);
- if (buf) (void)free(buf);
+ if (buf)
+ (void)free(buf);
}
@@ -253,8 +265,10 @@
int ret;
int type;
- if (buf == NULL) return;
- if (pcp == PKC_NULL) return;
+ if (buf == NULL)
+ return;
+ if (pcp == PKC_NULL)
+ return;
x = pkg_glong(&buf[0*NET_LONG_LEN]);
y = pkg_glong(&buf[1*NET_LONG_LEN]);
@@ -266,7 +280,8 @@
(void)pkg_plong(&rbuf[0*NET_LONG_LEN], ret);
pkg_send(MSG_RETURN, rbuf, NET_LONG_LEN, pcp);
}
- if (buf) (void)free(buf);
+ if (buf)
+ (void)free(buf);
}
@@ -280,8 +295,10 @@
static unsigned char *scanbuf = NULL;
static size_t buflen = 0;
- if (buf == NULL) return;
- if (pcp == PKC_NULL) return;
+ if (buf == NULL)
+ return;
+ if (pcp == PKC_NULL)
+ return;
xmin = pkg_glong(&buf[0*NET_LONG_LEN]);
ymin = pkg_glong(&buf[1*NET_LONG_LEN]);
@@ -297,7 +314,8 @@
if ((scanbuf = (unsigned char *)malloc(buflen)) == NULL) {
fb_log("fb_read: malloc failed!");
- if (buf) (void)free(buf);
+ if (buf)
+ (void)free(buf);
buflen = 0;
return;
}
@@ -308,7 +326,8 @@
/* sending a 0-length package indicates error */
pkg_send(MSG_RETURN, (char *)scanbuf, ret*sizeof(RGBpixel), pcp);
- if (buf) (void)free(buf);
+ if (buf)
+ (void)free(buf);
}
@@ -324,8 +343,10 @@
int ret;
int type;
- if (buf == NULL) return;
- if (pcp == PKC_NULL) return;
+ if (buf == NULL)
+ return;
+ if (pcp == PKC_NULL)
+ return;
x = pkg_glong(&buf[0*NET_LONG_LEN]);
y = pkg_glong(&buf[1*NET_LONG_LEN]);
@@ -340,7 +361,8 @@
(void)pkg_plong(&rbuf[0*NET_LONG_LEN], ret);
pkg_send(MSG_RETURN, rbuf, NET_LONG_LEN, pcp);
}
- if (buf) (void)free(buf);
+ if (buf)
+ (void)free(buf);
}
@@ -354,8 +376,10 @@
static unsigned char *scanbuf = NULL;
static size_t buflen = 0;
- if (buf == NULL) return;
- if (pcp == PKC_NULL) return;
+ if (buf == NULL)
+ return;
+ if (pcp == PKC_NULL)
+ return;
xmin = pkg_glong(&buf[0*NET_LONG_LEN]);
ymin = pkg_glong(&buf[1*NET_LONG_LEN]);
@@ -371,7 +395,8 @@
if ((scanbuf = (unsigned char *)malloc(buflen)) == NULL) {
fb_log("fb_bwreadrect: malloc failed!");
- if (buf) (void)free(buf);
+ if (buf)
+ (void)free(buf);
buflen = 0;
return;
}
@@ -382,7 +407,8 @@
/* sending a 0-length package indicates error */
pkg_send(MSG_RETURN, (char *)scanbuf, ret, pcp);
- if (buf) (void)free(buf);
+ if (buf)
+ (void)free(buf);
}
@@ -398,8 +424,10 @@
int ret;
int type;
- if (buf == NULL) return;
- if (pcp == PKC_NULL) return;
+ if (buf == NULL)
+ return;
+ if (pcp == PKC_NULL)
+ return;
x = pkg_glong(&buf[0*NET_LONG_LEN]);
y = pkg_glong(&buf[1*NET_LONG_LEN]);
@@ -416,9 +444,10 @@
} else {
/* No formal return code. Note errors locally */
if (ret < 0) fb_log("fb_server_fb_bwwriterect(%d, %d, %d, %d) error
%d\n",
- x, y, width, height, ret);
+ x, y, width, height, ret);
}
- if (buf) (void)free(buf);
+ if (buf)
+ (void)free(buf);
}
@@ -428,8 +457,10 @@
int mode, x, y;
char rbuf[NET_LONG_LEN+1];
- if (buf == NULL) return;
- if (pcp == PKC_NULL) return;
+ if (buf == NULL)
+ return;
+ if (pcp == PKC_NULL)
+ return;
mode = pkg_glong(&buf[0*NET_LONG_LEN]);
x = pkg_glong(&buf[1*NET_LONG_LEN]);
@@ -437,7 +468,8 @@
(void)pkg_plong(&rbuf[0], fb_cursor(fb_server_fbp, mode, x, y));
pkg_send(MSG_RETURN, rbuf, NET_LONG_LEN, pcp);
- if (buf) (void)free(buf);
+ if (buf)
+ (void)free(buf);
}
@@ -456,7 +488,8 @@
(void)pkg_plong(&rbuf[2*NET_LONG_LEN], x);
(void)pkg_plong(&rbuf[3*NET_LONG_LEN], y);
pkg_send(MSG_RETURN, rbuf, 4*NET_LONG_LEN, pcp);
- if (buf) (void)free(buf);
+ if (buf)
+ (void)free(buf);
}
@@ -468,7 +501,8 @@
int xbits, ybits;
int xorig, yorig;
- if (buf == NULL) return;
+ if (buf == NULL)
+ return;
if (pcp == PKC_NULL) return;
xbits = pkg_glong(&buf[0*NET_LONG_LEN]);
@@ -483,7 +517,8 @@
(void)pkg_plong(&rbuf[0*NET_LONG_LEN], ret);
pkg_send(MSG_RETURN, rbuf, NET_LONG_LEN, pcp);
}
- if (buf) (void)free(buf);
+ if (buf)
+ (void)free(buf);
}
@@ -496,8 +531,10 @@
int mode, x, y;
char rbuf[NET_LONG_LEN+1];
- if (buf == NULL) return;
- if (pcp == PKC_NULL) return;
+ if (buf == NULL)
+ return;
+ if (pcp == PKC_NULL)
+ return;
mode = pkg_glong(&buf[0*NET_LONG_LEN]);
x = pkg_glong(&buf[1*NET_LONG_LEN]);
@@ -505,7 +542,8 @@
(void)pkg_plong(&rbuf[0], fb_scursor(fb_server_fbp, mode, x, y));
pkg_send(MSG_RETURN, rbuf, NET_LONG_LEN, pcp);
- if (buf) (void)free(buf);
+ if (buf)
+ (void)free(buf);
}
@@ -518,8 +556,10 @@
int x, y;
char rbuf[NET_LONG_LEN+1];
- if (buf == NULL) return;
- if (pcp == PKC_NULL) return;
+ if (buf == NULL)
+ return;
+ if (pcp == PKC_NULL)
+ return;
x = pkg_glong(&buf[0*NET_LONG_LEN]);
y = pkg_glong(&buf[1*NET_LONG_LEN]);
@@ -526,7 +566,8 @@
(void)pkg_plong(&rbuf[0], fb_window(fb_server_fbp, x, y));
pkg_send(MSG_RETURN, rbuf, NET_LONG_LEN, pcp);
- if (buf) (void)free(buf);
+ if (buf)
+ (void)free(buf);
}
@@ -539,8 +580,10 @@
int x, y;
char rbuf[NET_LONG_LEN+1];
- if (buf == NULL) return;
- if (pcp == PKC_NULL) return;
+ if (buf == NULL)
+ return;
+ if (pcp == PKC_NULL)
+ return;
x = pkg_glong(&buf[0*NET_LONG_LEN]);
y = pkg_glong(&buf[1*NET_LONG_LEN]);
@@ -547,7 +590,8 @@
(void)pkg_plong(&rbuf[0], fb_zoom(fb_server_fbp, x, y));
pkg_send(MSG_RETURN, rbuf, NET_LONG_LEN, pcp);
- if (buf) (void)free(buf);
+ if (buf)
+ (void)free(buf);
}
@@ -558,8 +602,10 @@
int xcenter, ycenter, xzoom, yzoom;
char rbuf[NET_LONG_LEN+1];
- if (buf == NULL) return;
- if (pcp == PKC_NULL) return;
+ if (buf == NULL)
+ return;
+ if (pcp == PKC_NULL)
+ return;
xcenter = pkg_glong(&buf[0*NET_LONG_LEN]);
ycenter = pkg_glong(&buf[1*NET_LONG_LEN]);
@@ -569,7 +615,8 @@
ret = fb_view(fb_server_fbp, xcenter, ycenter, xzoom, yzoom);
(void)pkg_plong(&rbuf[0], ret);
pkg_send(MSG_RETURN, rbuf, NET_LONG_LEN, pcp);
- if (buf) (void)free(buf);
+ if (buf)
+ (void)free(buf);
}
@@ -589,7 +636,8 @@
(void)pkg_plong(&rbuf[3*NET_LONG_LEN], xzoom);
(void)pkg_plong(&rbuf[4*NET_LONG_LEN], yzoom);
pkg_send(MSG_RETURN, rbuf, 5*NET_LONG_LEN, pcp);
- if (buf) (void)free(buf);
+ if (buf)
+ (void)free(buf);
}
@@ -611,7 +659,8 @@
}
pkg_send(MSG_DATA, (char *)cm, sizeof(cm), pcp);
pkg_send(MSG_RETURN, rbuf, NET_LONG_LEN, pcp);
- if (buf) (void)free(buf);
+ if (buf)
+ (void)free(buf);
}
@@ -629,8 +678,10 @@
long ret;
ColorMap map;
- if (buf == NULL) return;
- if (pcp == PKC_NULL) return;
+ if (buf == NULL)
+ return;
+ if (pcp == PKC_NULL)
+ return;
if (pcp->pkc_len == 0)
ret = fb_wmap(fb_server_fbp, COLORMAP_NULL);
@@ -644,7 +695,8 @@
}
(void)pkg_plong(&rbuf[0], ret);
pkg_send(MSG_RETURN, rbuf, NET_LONG_LEN, pcp);
- if (buf) (void)free(buf);
+ if (buf)
+ (void)free(buf);
}
@@ -663,7 +715,8 @@
pkg_send(MSG_RETURN, rbuf, NET_LONG_LEN, pcp);
}
- if (buf) (void)free(buf);
+ if (buf)
+ (void)free(buf);
}
@@ -673,7 +726,8 @@
if (pcp == PKC_NULL) return;
(void)fb_poll(fb_server_fbp);
- if (buf) (void)free(buf);
+ if (buf)
+ (void)free(buf);
}
@@ -687,8 +741,10 @@
long ret;
char rbuf[NET_LONG_LEN+1];
- if (pcp == PKC_NULL) return;
- if (buf == NULL) return;
+ if (pcp == PKC_NULL)
+ return;
+ if (buf == NULL)
+ return;
(void)pkg_glong(&buf[0*NET_LONG_LEN]);
@@ -695,42 +751,42 @@
ret = fb_help(fb_server_fbp);
(void)pkg_plong(&rbuf[0], ret);
pkg_send(MSG_RETURN, rbuf, NET_LONG_LEN, pcp);
- if (buf) (void)free(buf);
+ if (buf)
+ (void)free(buf);
}
-
-const struct pkg_switch fb_server_pkg_switch[] = {
- { MSG_FBOPEN, fb_server_fb_open, "Open Framebuffer",
NULL },
- { MSG_FBCLOSE, fb_server_fb_close, "Close Framebuffer",
NULL },
- { MSG_FBCLEAR, fb_server_fb_clear, "Clear Framebuffer",
NULL },
- { MSG_FBREAD, fb_server_fb_read, "Read Pixels", NULL },
- { MSG_FBWRITE, fb_server_fb_write, "Write Pixels", NULL },
- { MSG_FBWRITE+MSG_NORETURN, fb_server_fb_write, "Asynch write",
NULL },
- { MSG_FBCURSOR, fb_server_fb_cursor, "Cursor", NULL },
- { MSG_FBGETCURSOR, fb_server_fb_getcursor, "Get Cursor", NULL },
/*NEW*/
- { MSG_FBSCURSOR, fb_server_fb_scursor, "Screen Cursor", NULL
}, /*OLD*/
- { MSG_FBWINDOW, fb_server_fb_window, "Window", NULL },
/*OLD*/
- { MSG_FBZOOM, fb_server_fb_zoom, "Zoom", NULL },
/*OLD*/
- { MSG_FBVIEW, fb_server_fb_view, "View", NULL },
/*NEW*/
- { MSG_FBGETVIEW, fb_server_fb_getview, "Get View", NULL },
/*NEW*/
- { MSG_FBRMAP, fb_server_fb_rmap, "R Map", NULL },
- { MSG_FBWMAP, fb_server_fb_wmap, "W Map", NULL },
- { MSG_FBHELP, fb_server_fb_help, "Help Request", NULL },
- { MSG_ERROR, fb_server_got_unknown, "Error Message", NULL },
- { MSG_CLOSE, fb_server_got_unknown, "Close Connection",
NULL },
- { MSG_FBREADRECT, fb_server_fb_readrect, "Read Rectangle", NULL
},
- { MSG_FBWRITERECT, fb_server_fb_writerect, "Write Rectangle", NULL
},
- { MSG_FBWRITERECT+MSG_NORETURN, fb_server_fb_writerect, "Write
Rectangle", NULL },
- { MSG_FBBWREADRECT, fb_server_fb_bwreadrect, "Read BW
Rectangle", NULL },
- { MSG_FBBWWRITERECT, fb_server_fb_bwwriterect, "Write BW
Rectangle", NULL },
- { MSG_FBBWWRITERECT+MSG_NORETURN, fb_server_fb_bwwriterect, "Write BW
Rectangle", NULL },
- { MSG_FBFLUSH, fb_server_fb_flush, "Flush Output",
NULL },
- { MSG_FBFLUSH + MSG_NORETURN, fb_server_fb_flush, "Flush Output",
NULL },
- { MSG_FBFREE, fb_server_fb_free, "Free
Resources", NULL },
- { MSG_FBPOLL, fb_server_fb_poll, "Handle
Events", NULL },
- { MSG_FBSETCURSOR, fb_server_fb_setcursor, "Set Cursor
Shape", NULL },
- { MSG_FBSETCURSOR + MSG_NORETURN, fb_server_fb_setcursor, "Set Cursor
Shape", NULL },
- { 0, NULL, NULL, NULL }
+const struct pkg_switch pkg_switch[] = {
+ { MSG_FBOPEN, fb_server_fb_open, "Open
Framebuffer", NULL },
+ { MSG_FBCLOSE, fb_server_fb_close, "Close
Framebuffer", NULL },
+ { MSG_FBCLEAR, fb_server_fb_clear, "Clear
Framebuffer", NULL },
+ { MSG_FBREAD, fb_server_fb_read, "Read
Pixels", NULL },
+ { MSG_FBWRITE, fb_server_fb_write, "Write
Pixels", NULL },
+ { MSG_FBWRITE + MSG_NORETURN, fb_server_fb_write, "Asynch
write", NULL },
+ { MSG_FBCURSOR, fb_server_fb_cursor, "Cursor",
NULL },
+ { MSG_FBGETCURSOR, fb_server_fb_getcursor, "Get
Cursor", NULL }, /*NEW*/
+ { MSG_FBSCURSOR, fb_server_fb_scursor, "Screen
Cursor", NULL }, /*OLD*/
+ { MSG_FBWINDOW, fb_server_fb_window, "Window",
NULL }, /*OLD*/
+ { MSG_FBZOOM, fb_server_fb_zoom, "Zoom", NULL
}, /*OLD*/
+ { MSG_FBVIEW, fb_server_fb_view, "View", NULL
}, /*NEW*/
+ { MSG_FBGETVIEW, fb_server_fb_getview, "Get View",
NULL }, /*NEW*/
+ { MSG_FBRMAP, fb_server_fb_rmap, "R Map",
NULL },
+ { MSG_FBWMAP, fb_server_fb_wmap, "W Map",
NULL },
+ { MSG_FBHELP, fb_server_fb_help, "Help
Request", NULL },
+ { MSG_ERROR, fb_server_fb_unknown, "Error
Message", NULL },
+ { MSG_CLOSE, fb_server_fb_unknown, "Close
Connection", NULL },
+ { MSG_FBREADRECT, fb_server_fb_readrect, "Read
Rectangle", NULL },
+ { MSG_FBWRITERECT, fb_server_fb_writerect, "Write
Rectangle", NULL },
+ { MSG_FBWRITERECT + MSG_NORETURN, fb_server_fb_writerect, "Write
Rectangle", NULL },
+ { MSG_FBBWREADRECT, fb_server_fb_bwreadrect, "Read BW
Rectangle", NULL },
+ { MSG_FBBWWRITERECT, fb_server_fb_bwwriterect, "Write BW
Rectangle", NULL },
+ { MSG_FBBWWRITERECT + MSG_NORETURN, fb_server_fb_bwwriterect, "Write BW
Rectangle", NULL },
+ { MSG_FBFLUSH, fb_server_fb_flush, "Flush
Output", NULL },
+ { MSG_FBFLUSH + MSG_NORETURN, fb_server_fb_flush, "Flush
Output", NULL },
+ { MSG_FBFREE, fb_server_fb_free, "Free
Resources", NULL },
+ { MSG_FBPOLL, fb_server_fb_poll, "Handle
Events", NULL },
+ { MSG_FBSETCURSOR, fb_server_fb_setcursor, "Set Cursor
Shape", NULL },
+ { MSG_FBSETCURSOR + MSG_NORETURN, fb_server_fb_setcursor, "Set Cursor
Shape", NULL },
+ { 0, NULL, NULL, NULL }
};
Index: brlcad/branches/RELEASE/src/libbu
===================================================================
--- brlcad/branches/RELEASE/src/libbu 2020-08-15 00:35:05 UTC (rev 76768)
+++ brlcad/branches/RELEASE/src/libbu 2020-08-15 01:05:57 UTC (rev 76769)
Property changes on: brlcad/branches/RELEASE/src/libbu
___________________________________________________________________
Modified: svn:mergeinfo
## -1,2 +1,2 ##
/brlcad/branches/bioh/src/libbu:75720-75728
-/brlcad/trunk/src/libbu:72518-74373,74376-75207,75729,76655
\ No newline at end of property
+/brlcad/trunk/src/libbu:72518-74373,74376-75207,75729,76645-76726
\ No newline at end of property
Modified: brlcad/branches/RELEASE/src/libdm/CMakeLists.txt
===================================================================
--- brlcad/branches/RELEASE/src/libdm/CMakeLists.txt 2020-08-15 00:35:05 UTC
(rev 76768)
+++ brlcad/branches/RELEASE/src/libdm/CMakeLists.txt 2020-08-15 01:05:57 UTC
(rev 76769)
@@ -18,43 +18,18 @@
BRLCAD_LIB_INCLUDE_DIRS(dm DM_INCLUDE_DIRS DM_LOCAL_INCLUDE_DIRS)
-if(BRLCAD_ENABLE_TCL)
- add_subdirectory(plot)
- add_subdirectory(postscript)
- add_subdirectory(txt)
-endif(BRLCAD_ENABLE_TCL)
+# Backend implementations
+add_subdirectory(X)
+add_subdirectory(glx)
+add_subdirectory(osgl)
+add_subdirectory(plot)
+add_subdirectory(postscript)
+add_subdirectory(qt)
+add_subdirectory(tk)
+add_subdirectory(txt)
+add_subdirectory(wgl)
-# We no longer use these in libdm, but MGED hasn't caught up yet...
-set(libdm_DEFINES "")
-
-if(BRLCAD_ENABLE_X11 AND BRLCAD_ENABLE_OPENGL AND BRLCAD_ENABLE_TK)
- add_subdirectory(glx)
- list(APPEND libdm_DEFINES DM_OGL IF_OGL)
-endif(BRLCAD_ENABLE_X11 AND BRLCAD_ENABLE_OPENGL AND BRLCAD_ENABLE_TK)
-if(BRLCAD_ENABLE_X11 AND BRLCAD_ENABLE_TK)
- add_subdirectory(X)
- list(APPEND libdm_DEFINES DM_X IF_X)
-endif(BRLCAD_ENABLE_X11 AND BRLCAD_ENABLE_TK)
-if(WIN32 AND BRLCAD_ENABLE_OPENGL)
- add_subdirectory(wgl)
- list(APPEND libdm_DEFINES DM_WGL IF_WGL)
-endif(WIN32 AND BRLCAD_ENABLE_OPENGL)
-if(BRLCAD_ENABLE_TK AND BRLCAD_ENABLE_DM_TK)
- add_subdirectory(tk)
- list(APPEND libdm_DEFINES DM_TK IF_TK)
-endif(BRLCAD_ENABLE_TK AND BRLCAD_ENABLE_DM_TK)
-if(BRLCAD_ENABLE_OSG AND BRLCAD_ENABLE_TK)
- add_subdirectory(osgl)
- list(APPEND libdm_DEFINES DM_OSGL IF_OSGL)
-endif(BRLCAD_ENABLE_OSG AND BRLCAD_ENABLE_TK)
-if(BRLCAD_ENABLE_QT)
- add_subdirectory(qt)
- list(APPEND libdm_DEFINES DM_QT IF_QT)
-endif(BRLCAD_ENABLE_QT)
-
-# put the defines where MGED's build can find them...
-set_property(GLOBAL PROPERTY libdm_DEFINES "${libdm_DEFINES}")
-
+# Main libdm library
set(LIBDM_SRCS
null/dm-Null.c
null/if_null.c
@@ -90,20 +65,6 @@
BRLCAD_ADDLIB(libdm "${LIBDM_SRCS}"
"librt;libicv;libbu;libpkg;${OPENGL_LIBRARIES};${PNG_LIBRARIES}")
set_target_properties(libdm PROPERTIES VERSION 20.0.1 SOVERSION 20)
-#if(BRLCAD_ENABLE_OSG)
-# BRLCAD_ADDEXEC(osg-test osgl/osg-test.cpp "librt;libbu;${OSG_LIBRARIES}"
NO_STRICT NO_INSTALL)
-# if(HIDE_INTERNAL_SYMBOLS)
-# if (TARGET osg OR HIDE_INTERNAL_SYMBOLS_EXT)
-# set_property(TARGET libdm APPEND PROPERTY COMPILE_DEFINITIONS
"FREETYPE_DLL_IMPORTS")
-# endif (TARGET osg OR HIDE_INTERNAL_SYMBOLS_EXT)
-# if(TARGET libdm-obj)
-# if (TARGET osg OR HIDE_INTERNAL_SYMBOLS_EXT)
-# set_property(TARGET libdm-obj APPEND PROPERTY COMPILE_DEFINITIONS
"FREETYPE_DLL_IMPORTS")
-# endif (TARGET osg OR HIDE_INTERNAL_SYMBOLS_EXT)
-# endif(TARGET libdm-obj)
-# endif(HIDE_INTERNAL_SYMBOLS)
-#endif(BRLCAD_ENABLE_OSG)
-
if (TARGET profont_ProFont_ttf_cp)
add_dependencies(libdm profont_ProFont_ttf_cp)
endif (TARGET profont_ProFont_ttf_cp)
@@ -114,55 +75,8 @@
CMakeLists.txt
README
TODO
- X/CMakeLists.txt
- X/color.c
- X/dm-X.c
- X/dm-X.h
- X/fb_X.h
- X/if_X24.c
- glx/CMakeLists.txt
- glx/dm-glx.h
- glx/dm-ogl.c
- glx/dm-ogl.h
- glx/fb_ogl.h
- glx/if_ogl.c
if_TEMPLATE.c
null/dm-Null.h
- osgl/CMakeLists.txt
- osgl/dm-osgl.cpp
- osgl/dm-osgl.h
- osgl/fb_osgl.h
- osgl/fontstash/LICENSE.fontstash
- osgl/fontstash/README.md
- osgl/fontstash/fontstash.h
- osgl/fontstash/glfontstash.h
- osgl/fontstash/stb_truetype.h
- osgl/if_osgl.cpp
- osgl/osg-test.cpp
- osgl/osg_bob.cpp
- osgl/osg_fb_manipulator.h
- plot/CMakeLists.txt
- plot/dm-plot.c
- plot/dm-plot.h
- postscript/CMakeLists.txt
- postscript/dm-ps.c
- postscript/dm-ps.h
- qt/CMakeLists.txt
- qt/dm-qt.cpp
- qt/dm-qt.h
- qt/fb_qt.h
- qt/if_qt.cpp
- tk/CMakeLists.txt
- tk/dm-tk.c
- tk/dm-tk.h
- tk/if_tk.c
- txt/CMakeLists.txt
- txt/dm-txt.c
- wgl/CMakeLists.txt
- wgl/dm-wgl.c
- wgl/dm-wgl.h
- wgl/fb_wgl.h
- wgl/if_wgl.c
include/private.h
include/calltable.h
)
Modified: brlcad/branches/RELEASE/src/libdm/X/CMakeLists.txt
===================================================================
--- brlcad/branches/RELEASE/src/libdm/X/CMakeLists.txt 2020-08-15 00:35:05 UTC
(rev 76768)
+++ brlcad/branches/RELEASE/src/libdm/X/CMakeLists.txt 2020-08-15 01:05:57 UTC
(rev 76769)
@@ -1,16 +1,3 @@
-
-find_package(X11)
-find_package(TCL)
-
-include_directories(
- ${CMAKE_CURRENT_SOURCE_DIR}
- ${BRLCAD_BINARY_DIR}/include
- ${BRLCAD_SOURCE_DIR}/include
- ${X11_INCLUDE_DIR}
- ${TCL_INCLUDE_PATH}
- ${TK_INCLUDE_PATH}
- )
-
set(X_SRCS
dm-X.c
color.c
@@ -17,21 +4,40 @@
if_X24.c
)
-set_property(SOURCE dm-X.c APPEND PROPERTY COMPILE_DEFINITIONS
FB_USE_INTERNAL_API)
-set_property(SOURCE if_X24.c APPEND PROPERTY COMPILE_DEFINITIONS
FB_USE_INTERNAL_API)
+if(BRLCAD_ENABLE_X11 AND BRLCAD_ENABLE_TK)
-add_definitions(-DDM_PLUGIN)
-add_definitions(-DDM_X -DIF_X)
+ find_package(X11)
+ find_package(TCL)
-add_library(dm-X SHARED ${X_SRCS})
-target_link_libraries(dm-X libdm libbu ${TCL_LIBRARY} ${TK_LIBRARY}
${X11_LIBRARIES})
-set_property(TARGET dm-X APPEND PROPERTY COMPILE_DEFINITIONS BRLCADBUILD
HAVE_CONFIG_H)
-VALIDATE_STYLE(dm-X "${X_SRCS}")
+ include_directories(
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${BRLCAD_BINARY_DIR}/include
+ ${BRLCAD_SOURCE_DIR}/include
+ ${X11_INCLUDE_DIR}
+ ${TCL_INCLUDE_PATH}
+ ${TK_INCLUDE_PATH}
+ )
-PLUGIN_SETUP(dm-X dm)
+ set_property(SOURCE dm-X.c APPEND PROPERTY COMPILE_DEFINITIONS
FB_USE_INTERNAL_API)
+ set_property(SOURCE if_X24.c APPEND PROPERTY COMPILE_DEFINITIONS
FB_USE_INTERNAL_API)
-CMAKEFILES(dm-X.h)
+ add_definitions(-DDM_PLUGIN)
+ add_library(dm-X SHARED ${X_SRCS})
+ target_link_libraries(dm-X libdm libbu ${TCL_LIBRARY} ${TK_LIBRARY}
${X11_LIBRARIES})
+ set_property(TARGET dm-X APPEND PROPERTY COMPILE_DEFINITIONS BRLCADBUILD
HAVE_CONFIG_H)
+ VALIDATE_STYLE(dm-X "${X_SRCS}")
+
+ PLUGIN_SETUP(dm-X dm)
+
+endif(BRLCAD_ENABLE_X11 AND BRLCAD_ENABLE_TK)
+
+CMAKEFILES(
+ CMakeLists.txt
+ ${X_SRCS}
+ dm-X.h
+ )
+
# Local Variables:
# tab-width: 8
# mode: cmake
Modified: brlcad/branches/RELEASE/src/libdm/X/dm-X.c
===================================================================
--- brlcad/branches/RELEASE/src/libdm/X/dm-X.c 2020-08-15 00:35:05 UTC (rev
76768)
+++ brlcad/branches/RELEASE/src/libdm/X/dm-X.c 2020-08-15 01:05:57 UTC (rev
76769)
@@ -157,6 +157,18 @@
return 0;
}
+HIDDEN int
+X_doevent(struct dm *dmp, void *UNUSED(vclientData), void *veventPtr)
+{
+ XEvent *eventPtr= (XEvent *)veventPtr;
+ if (eventPtr->type == Expose && eventPtr->xexpose.count == 0) {
+ dm_set_dirty(dmp, 1);
+ /* no further processing for this event */
+ return TCL_RETURN;
+ }
+ /* allow further processing of this event */
+ return TCL_OK;
+}
HIDDEN int
X_configureWin_guts(struct dm *dmp, int force)
@@ -2095,6 +2107,7 @@
X_getDisplayImage, /* display to image function */
X_reshape,
null_makeCurrent,
+ X_doevent,
X_openFb,
NULL,
NULL,
@@ -2107,15 +2120,18 @@
NULL,
NULL,
0,
+ 1, /* is graphical */
+ "Tk", /* uses Tk graphics system */
0, /* no displaylist */
- 0, /* no stereo */
+ 0, /* no stereo */
PLOTBOUND, /* zoom-in limit */
1, /* bound flag */
"X",
"X Window System (X11)",
- 1,
- 0,
- 0,
+ 1, /* top */
+ 0, /* width */
+ 0, /* height */
+ 0, /* dirty */
0, /* bytes per pixel */
0, /* bits per channel */
0,
Modified: brlcad/branches/RELEASE/src/libdm/X/dm-X.h
===================================================================
--- brlcad/branches/RELEASE/src/libdm/X/dm-X.h 2020-08-15 00:35:05 UTC (rev
76768)
+++ brlcad/branches/RELEASE/src/libdm/X/dm-X.h 2020-08-15 01:05:57 UTC (rev
76769)
@@ -41,6 +41,26 @@
#define INIT_XCOLOR(c) memset((c), 0, sizeof(XColor))
+#define DM_REVERSE_COLOR_BYTE_ORDER(_shift, _mask) { \
+ _shift = 24 - _shift; \
+ switch (_shift) { \
+ case 0: \
+ _mask >>= 24; \
+ break; \
+ case 8: \
+ _mask >>= 8; \
+ break; \
+ case 16: \
+ _mask <<= 8; \
+ break; \
+ case 24: \
+ _mask <<= 24; \
+ break; \
+ } \
+ }
+
+extern struct dm dm_X;
+
struct x_vars {
GC gc;
Pixmap pix;
Modified: brlcad/branches/RELEASE/src/libdm/X/fb_X.h
===================================================================
--- brlcad/branches/RELEASE/src/libdm/X/fb_X.h 2020-08-15 00:35:05 UTC (rev
76768)
+++ brlcad/branches/RELEASE/src/libdm/X/fb_X.h 2020-08-15 01:05:57 UTC (rev
76769)
@@ -30,7 +30,6 @@
/** @} */
#ifdef FB_USE_INTERNAL_API
-#ifdef IF_X
#include "common.h"
#include <X11/X.h>
@@ -42,7 +41,6 @@
XVisualInfo *vip;
GC gc;
};
-#endif /* IF_X */
#endif /* FB_USE_INTERNAL_API */
/*
Modified: brlcad/branches/RELEASE/src/libdm/dm-generic.c
===================================================================
--- brlcad/branches/RELEASE/src/libdm/dm-generic.c 2020-08-15 00:35:05 UTC
(rev 76768)
+++ brlcad/branches/RELEASE/src/libdm/dm-generic.c 2020-08-15 01:05:57 UTC
(rev 76769)
@@ -178,7 +178,7 @@
}
const char *
-dm_get_dm_name(struct dm *dmp)
+dm_get_dm_name(const struct dm *dmp)
{
if (UNLIKELY(!dmp)) return NULL;
return dmp->i->dm_name;
@@ -219,6 +219,12 @@
dmp->i->dm_height = height;
}
+int
+dm_graphical(const struct dm *dmp)
+{
+ if (UNLIKELY(!dmp)) return 0;
+ return dmp->i->dm_graphical;
+}
const char *
dm_get_type(struct dm *dmp)
@@ -304,6 +310,27 @@
return dmp->i->dm_makeCurrent(dmp);
}
+int
+dm_doevent(struct dm *dmp, void *clientData, void *eventPtr)
+{
+ if (UNLIKELY(!dmp)) return 0;
+ return dmp->i->dm_doevent(dmp, clientData, eventPtr);
+}
+
+int
+dm_get_dirty(struct dm *dmp)
+{
+ if (UNLIKELY(!dmp)) return 0;
+ return dmp->i->dm_dirty;
+}
+
+void
+dm_set_dirty(struct dm *dmp, int i)
+{
+ if (UNLIKELY(!dmp)) return;
+ dmp->i->dm_dirty = i;
+}
+
vect_t *
dm_get_clipmin(struct dm *dmp)
{
@@ -374,6 +401,13 @@
return &(dmp->i->dm_dName);
}
+const char *
+dm_get_graphics_system(const struct dm *dmp)
+{
+ if (UNLIKELY(!dmp)) return NULL;
+ return dmp->i->graphics_system;
+}
+
struct bu_vls *
dm_get_tkname(struct dm *dmp)
{
Modified: brlcad/branches/RELEASE/src/libdm/dm_plugins.cpp
===================================================================
--- brlcad/branches/RELEASE/src/libdm/dm_plugins.cpp 2020-08-15 00:35:05 UTC
(rev 76768)
+++ brlcad/branches/RELEASE/src/libdm/dm_plugins.cpp 2020-08-15 01:05:57 UTC
(rev 76769)
@@ -61,14 +61,48 @@
return dmp;
}
-extern "C" struct bu_vls *
-dm_list_types(const char *separator)
+extern "C" int
+dm_have_graphics()
{
- struct bu_vls *list;
- BU_GET(list, struct bu_vls);
- bu_vls_init(list);
- bu_vls_trunc(list, 0);
+ int ret = 0;
+ std::map<std::string, const struct dm *> *dmb = (std::map<std::string,
const struct dm *> *)dm_backends;
+ std::map<std::string, const struct dm *>::iterator d_it;
+ for (d_it = dmb->begin(); d_it != dmb->end(); d_it++) {
+ std::string key = d_it->first;
+ const struct dm *d = d_it->second;
+ if (dm_graphical(d)) {
+ ret = 1;
+ break;
+ }
+ }
+ return ret;
+}
+extern "C" const char *
+dm_graphics_system(const char *dmtype)
+{
+ const char *ret = NULL;
+ std::map<std::string, const struct dm *> *dmb = (std::map<std::string,
const struct dm *> *)dm_backends;
+ std::map<std::string, const struct dm *>::iterator d_it;
+ for (d_it = dmb->begin(); d_it != dmb->end(); d_it++) {
+ std::string key = d_it->first;
+ const struct dm *d = d_it->second;
+ const char *dname = dm_get_dm_name(d);
+ if (BU_STR_EQUIV(dmtype, dname)) {
+ ret = dm_get_graphics_system(d);
+ break;
+ }
+ }
+ return ret;
+}
+
+extern "C" void
+dm_list_types(struct bu_vls *list, const char *separator)
+{
+ if (!list) {
+ return;
+ }
+
// We've got something, and may need a separator
struct bu_vls sep = BU_VLS_INIT_ZERO;
if (!separator) {
@@ -118,7 +152,6 @@
b = priority_list[i];
}
#endif
- return list;
}
extern "C" int
Modified: brlcad/branches/RELEASE/src/libdm/glx/CMakeLists.txt
===================================================================
--- brlcad/branches/RELEASE/src/libdm/glx/CMakeLists.txt 2020-08-15
00:35:05 UTC (rev 76768)
+++ brlcad/branches/RELEASE/src/libdm/glx/CMakeLists.txt 2020-08-15
01:05:57 UTC (rev 76769)
@@ -1,39 +1,47 @@
-find_package(TCL)
-find_package(X11)
-find_package(GL)
-
-include_directories(
- ${CMAKE_CURRENT_SOURCE_DIR}
- ${BRLCAD_BINARY_DIR}/include
- ${BRLCAD_SOURCE_DIR}/include
- ${BU_INCLUDE_DIRS}
- ${X11_INCLUDE_DIR}
- ${OPENGL_INCLUDE_DIR_GL}
- ${OPENGL_INCLUDE_DIR_GLX}
- ${TCL_INCLUDE_PATH}
- ${TK_INCLUDE_PATH}
- )
-
set(OGL_SRCS
dm-ogl.c
if_ogl.c
)
-set_property(SOURCE dm-ogl.c APPEND PROPERTY COMPILE_DEFINITIONS
FB_USE_INTERNAL_API)
-set_property(SOURCE if_ogl.c APPEND PROPERTY COMPILE_DEFINITIONS
FB_USE_INTERNAL_API)
+if(BRLCAD_ENABLE_X11 AND BRLCAD_ENABLE_TK AND BRLCAD_ENABLE_OPENGL)
-add_definitions(-DDM_PLUGIN)
-add_definitions(-DDM_OGL -DIF_OGL)
+ find_package(TCL)
+ find_package(X11)
+ find_package(GL)
-add_library(dm-ogl SHARED ${OGL_SRCS})
-target_link_libraries(dm-ogl libdm libbu ${X11_LIBRARIES} ${OPENGL_LIBRARIES}
${TCL_LIBRARY} ${TK_LIBRARY})
-set_property(TARGET dm-ogl APPEND PROPERTY COMPILE_DEFINITIONS BRLCADBUILD
HAVE_CONFIG_H)
-VALIDATE_STYLE(dm-ogl "${OGL_SRCS}")
+ include_directories(
+ ${CMAKE_CURRENT_SOURCE_DIR}
+ ${BRLCAD_BINARY_DIR}/include
+ ${BRLCAD_SOURCE_DIR}/include
+ ${BU_INCLUDE_DIRS}
+ ${X11_INCLUDE_DIR}
+ ${OPENGL_INCLUDE_DIR_GL}
+ ${OPENGL_INCLUDE_DIR_GLX}
+ ${TCL_INCLUDE_PATH}
+ ${TK_INCLUDE_PATH}
+ )
-PLUGIN_SETUP(dm-ogl dm)
+ set_property(SOURCE dm-ogl.c APPEND PROPERTY COMPILE_DEFINITIONS
FB_USE_INTERNAL_API)
+ set_property(SOURCE if_ogl.c APPEND PROPERTY COMPILE_DEFINITIONS
FB_USE_INTERNAL_API)
-CMAKEFILES(dm-ogl.h)
+ add_definitions(-DDM_PLUGIN)
+
+ add_library(dm-ogl SHARED ${OGL_SRCS})
+ target_link_libraries(dm-ogl libdm libbu ${X11_LIBRARIES}
${OPENGL_LIBRARIES} ${TCL_LIBRARY} ${TK_LIBRARY})
+ set_property(TARGET dm-ogl APPEND PROPERTY COMPILE_DEFINITIONS BRLCADBUILD
HAVE_CONFIG_H)
+ VALIDATE_STYLE(dm-ogl "${OGL_SRCS}")
+
+ PLUGIN_SETUP(dm-ogl dm)
+
+endif(BRLCAD_ENABLE_X11 AND BRLCAD_ENABLE_TK AND BRLCAD_ENABLE_OPENGL)
+
+CMAKEFILES(
+ CMakeLists.txt
+ ${OGL_SRCS}
+ dm-ogl.h
+ )
+
# Local Variables:
# tab-width: 8
# mode: cmake
Modified: brlcad/branches/RELEASE/src/libdm/glx/dm-ogl.c
===================================================================
--- brlcad/branches/RELEASE/src/libdm/glx/dm-ogl.c 2020-08-15 00:35:05 UTC
(rev 76768)
+++ brlcad/branches/RELEASE/src/libdm/glx/dm-ogl.c 2020-08-15 01:05:57 UTC
(rev 76769)
@@ -416,6 +416,19 @@
return BRLCAD_OK;
}
+HIDDEN int
+ogl_doevent(struct dm *dmp, void *UNUSED(vclientData), void *veventPtr)
+{
+ XEvent *eventPtr= (XEvent *)veventPtr;
+ if (eventPtr->type == Expose && eventPtr->xexpose.count == 0) {
+ (void)dm_make_current(dmp);
+ glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
+ dm_set_dirty(dmp, 1);
+ return TCL_OK;
+ }
+ /* allow further processing of this event */
+ return TCL_OK;
+}
HIDDEN int
ogl_configureWin(struct dm *dmp, int force)
@@ -3032,6 +3045,7 @@
ogl_getDisplayImage, /* display to image function */
ogl_reshape,
ogl_makeCurrent,
+ ogl_doevent,
ogl_openFb,
ogl_get_internal,
ogl_put_internal,
@@ -3044,6 +3058,8 @@
ogl_fogHint,
ogl_share_dlist,
0,
+ 1, /* is graphical */
+ "Tk", /* uses Tk graphics system */
1, /* has displaylist */
0, /* no stereo by default */
1.0, /* zoom-in limit */
@@ -3050,9 +3066,10 @@
1, /* bound flag */
"ogl",
"X Windows with OpenGL graphics",
- 1,
- 0,
- 0,
+ 1, /* top */
+ 0, /* width */
+ 0, /* height */
+ 0, /* dirty */
0, /* bytes per pixel */
0, /* bits per channel */
0,
Modified: brlcad/branches/RELEASE/src/libdm/glx/dm-ogl.h
===================================================================
--- brlcad/branches/RELEASE/src/libdm/glx/dm-ogl.h 2020-08-15 00:35:05 UTC
(rev 76768)
+++ brlcad/branches/RELEASE/src/libdm/glx/dm-ogl.h 2020-08-15 01:05:57 UTC
(rev 76769)
@@ -48,7 +48,47 @@
/* Map +/-2048 GED space into -1.0..+1.0 :: x/2048*/
#define GED2IRIS(x) (((float)(x))*0.00048828125)
+#define DM_REVERSE_COLOR_BYTE_ORDER(_shift, _mask) { \
+ _shift = 24 - _shift; \
+ switch (_shift) { \
+ case 0: \
+ _mask >>= 24; \
+ break; \
+ case 8: \
+ _mask >>= 8; \
+ break; \
+ case 16: \
+ _mask <<= 8; \
+ break; \
+ case 24: \
+ _mask <<= 24; \
+ break; \
+ } \
+ }
+extern struct dm dm_ogl;
+
+#define Ogl_MV_O(_m) offsetof(struct modifiable_ogl_vars, _m)
+
+struct modifiable_ogl_vars {
+ struct dm *this_dm;
+ int cueing_on;
+ int zclipping_on;
+ int zbuffer_on;
+ int lighting_on;
+ int transparency_on;
+ int fastfog;
+ double fogdensity;
+ int zbuf;
+ int rgb;
+ int doublebuffer;
+ int depth;
+ int debug;
+ struct bu_vls log;
+ double bound;
+ int boundFlag;
+};
+
struct ogl_vars {
GLXContext glxc;
GLdouble faceplate_mat[16];
Modified: brlcad/branches/RELEASE/src/libdm/glx/fb_ogl.h
===================================================================
--- brlcad/branches/RELEASE/src/libdm/glx/fb_ogl.h 2020-08-15 00:35:05 UTC
(rev 76768)
+++ brlcad/branches/RELEASE/src/libdm/glx/fb_ogl.h 2020-08-15 01:05:57 UTC
(rev 76769)
@@ -30,7 +30,6 @@
/** @} */
#ifdef FB_USE_INTERNAL_API
-#ifdef IF_OGL
#include "common.h"
# ifdef HAVE_X11_XLIB_H
# include <X11/Xlib.h>
@@ -68,7 +67,6 @@
int double_buffer;
int soft_cmap;
};
-#endif /* IF_OGL */
#endif /* FB_USE_INTERNAL_API */
/*
Modified: brlcad/branches/RELEASE/src/libdm/glx/if_ogl.c
===================================================================
--- brlcad/branches/RELEASE/src/libdm/glx/if_ogl.c 2020-08-15 00:35:05 UTC
(rev 76768)
+++ brlcad/branches/RELEASE/src/libdm/glx/if_ogl.c 2020-08-15 01:05:57 UTC
(rev 76769)
@@ -36,8 +36,6 @@
#include "common.h"
-#ifdef IF_OGL
-
#ifdef HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif
@@ -2363,13 +2361,6 @@
* collisions until the end of this file */
#undef class
-#else
-
-/* quell empty-compilation unit warnings */
-static const int unused = 0;
-
-#endif /* IF_OGL */
-
/*
* Local Variables:
* mode: C
Modified: brlcad/branches/RELEASE/src/libdm/include/calltable.h
===================================================================
--- brlcad/branches/RELEASE/src/libdm/include/calltable.h 2020-08-15
00:35:05 UTC (rev 76768)
+++ brlcad/branches/RELEASE/src/libdm/include/calltable.h 2020-08-15
01:05:57 UTC (rev 76769)
@@ -99,6 +99,7 @@
int (*dm_getDisplayImage)(struct dm *dmp, unsigned char **image); /**<
@brief (0,0) is upper left pixel */
int (*dm_reshape)(struct dm *dmp, int width, int height);
int (*dm_makeCurrent)(struct dm *dmp);
+ int (*dm_doevent)(struct dm *dmp, void *clientData, void *eventPtr);
int (*dm_openFb)(struct dm *dmp);
int (*dm_get_internal)(struct dm *dmp);
int (*dm_put_internal)(struct dm *dmp);
@@ -111,6 +112,8 @@
void (*dm_fogHint)(struct dm *dmp, int fastfog);
int (*dm_share_dlist)(struct dm *dmp1, struct dm *dmp2);
unsigned long dm_id; /**< @brief window id */
+ int dm_graphical; /**< @brief !0 means device supports
interactive graphics */
+ const char *graphics_system; /**< @brief String identifying the drawing
layer assumed */
int dm_displaylist; /**< @brief !0 means device has
displaylist */
int dm_stereo; /**< @brief stereo flag */
double dm_bound; /**< @brief zoom-in limit */
@@ -120,6 +123,7 @@
int dm_top; /**< @brief !0 means toplevel window */
int dm_width;
int dm_height;
+ int dm_dirty;
int dm_bytes_per_pixel;
int dm_bits_per_channel; /* bits per color channel */
int dm_lineWidth;
Modified: brlcad/branches/RELEASE/src/libdm/include/private.h
===================================================================
--- brlcad/branches/RELEASE/src/libdm/include/private.h 2020-08-15 00:35:05 UTC
(rev 76768)
+++ brlcad/branches/RELEASE/src/libdm/include/private.h 2020-08-15 01:05:57 UTC
(rev 76769)
@@ -107,55 +107,7 @@
(_dr) == (_sr) &&\
(_dg) == (_sg) &&\
(_db) == (_sb))
-#if defined(DM_X) || defined(DM_OGL)
-#define DM_REVERSE_COLOR_BYTE_ORDER(_shift, _mask) { \
- _shift = 24 - _shift; \
- switch (_shift) { \
- case 0: \
- _mask >>= 24; \
- break; \
- case 8: \
- _mask >>= 8; \
- break; \
- case 16: \
- _mask <<= 8; \
- break; \
- case 24: \
- _mask <<= 24; \
- break; \
- } \
- }
-#else
-/* Do nothing */
-#define DM_REVERSE_COLOR_BYTE_ORDER(_shift, _mask)
-#endif
-
-
-#if defined(DM_OGL) || defined(DM_WGL)
-#define Ogl_MV_O(_m) offsetof(struct modifiable_ogl_vars, _m)
-
-struct modifiable_ogl_vars {
- struct dm *this_dm;
- int cueing_on;
- int zclipping_on;
- int zbuffer_on;
- int lighting_on;
- int transparency_on;
- int fastfog;
- double fogdensity;
- int zbuf;
- int rgb;
- int doublebuffer;
- int depth;
- int debug;
- struct bu_vls log;
- double bound;
- int boundFlag;
-};
-#endif
-
-
__BEGIN_DECLS
int
Modified: brlcad/branches/RELEASE/src/libdm/null/dm-Null.c
===================================================================
--- brlcad/branches/RELEASE/src/libdm/null/dm-Null.c 2020-08-15 00:35:05 UTC
(rev 76768)
+++ brlcad/branches/RELEASE/src/libdm/null/dm-Null.c 2020-08-15 01:05:57 UTC
(rev 76769)
@@ -293,6 +293,11 @@
return 0;
}
+int
+null_doevent(struct dm *UNUSED(dmp), void *UNUSED(clientData), void
*UNUSED(eventPtr))
+{
+ return 0;
+}
int
null_openFb(struct dm *UNUSED(dmp))
@@ -341,6 +346,7 @@
null_getDisplayImage,
null_reshape,
null_makeCurrent,
+ null_doevent,
null_openFb,
NULL,
NULL,
@@ -353,6 +359,8 @@
NULL,
NULL,
0,
+ 0, /* not graphical */
+ NULL, /* not graphical */
0, /* no displaylist */
0, /* no stereo */
0.0, /* zoom-in limit */
@@ -362,6 +370,7 @@
0,/* top */
0,/* width */
0,/* height */
+ 0,/* dirty */
0,/* bytes per pixel */
0,/* bits per channel */
0,
Modified: brlcad/branches/RELEASE/src/libdm/null/dm-Null.h
===================================================================
--- brlcad/branches/RELEASE/src/libdm/null/dm-Null.h 2020-08-15 00:35:05 UTC
(rev 76768)
@@ Diff output truncated at 100000 characters. @@
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