Revision: 75438
http://sourceforge.net/p/brlcad/code/75438
Author: starseeker
Date: 2020-04-17 16:46:07 +0000 (Fri, 17 Apr 2020)
Log Message:
-----------
Put back the libdm/libfb API in trunk. Work will proceed in the branch, and
after discussing with Sean we want to do a release with Tcl/Tk 8.6 first before
taking on the rollout of the libdm/libfb rework.
Modified Paths:
--------------
brlcad/trunk/include/CMakeLists.txt
brlcad/trunk/include/dm/CMakeLists.txt
brlcad/trunk/include/dm.h
brlcad/trunk/include/fb/CMakeLists.txt
brlcad/trunk/include/fb.h
brlcad/trunk/include/tclcad.h
brlcad/trunk/src/adrt/isst.c
brlcad/trunk/src/burst/extern.h
brlcad/trunk/src/burst/glob.c
brlcad/trunk/src/fb/bw-fb.c
brlcad/trunk/src/fb/fb-bw.c
brlcad/trunk/src/fb/fb-fb.c
brlcad/trunk/src/fb/fb-pix.c
brlcad/trunk/src/fb/fb-png.c
brlcad/trunk/src/fb/fbcbars.c
brlcad/trunk/src/fb/fbclear.c
brlcad/trunk/src/fb/fbcmap.c
brlcad/trunk/src/fb/fbcolor.c
brlcad/trunk/src/fb/fbfade.c
brlcad/trunk/src/fb/fbframe.c
brlcad/trunk/src/fb/fbfree.c
brlcad/trunk/src/fb/fbgamma.c
brlcad/trunk/src/fb/fbgrid.c
brlcad/trunk/src/fb/fbhelp.c
brlcad/trunk/src/fb/fblabel.c
brlcad/trunk/src/fb/fbline.c
brlcad/trunk/src/fb/fbpoint.c
brlcad/trunk/src/fb/fbstretch.c
brlcad/trunk/src/fb/fbzoom.c
brlcad/trunk/src/fb/gif-fb.c
brlcad/trunk/src/fb/gif2fb.c
brlcad/trunk/src/fb/ioutil.c
brlcad/trunk/src/fb/pix-fb.c
brlcad/trunk/src/fb/plot3-fb.c
brlcad/trunk/src/fb/png-fb.c
brlcad/trunk/src/fb/spm-fb.c
brlcad/trunk/src/fb/tests/fbthreadtest.c
brlcad/trunk/src/fbserv/fbserv.c
brlcad/trunk/src/fbserv/server.c
brlcad/trunk/src/libdm/CMakeLists.txt
brlcad/trunk/src/libdm/adc.c
brlcad/trunk/src/libdm/axes.c
brlcad/trunk/src/libdm/clip.c
brlcad/trunk/src/libdm/color.c
brlcad/trunk/src/libdm/dm-Null.c
brlcad/trunk/src/libdm/dm-Null.h
brlcad/trunk/src/libdm/dm-X.c
brlcad/trunk/src/libdm/dm-X.h
brlcad/trunk/src/libdm/dm-generic.c
brlcad/trunk/src/libdm/dm-glx.h
brlcad/trunk/src/libdm/dm-ogl.c
brlcad/trunk/src/libdm/dm-ogl.h
brlcad/trunk/src/libdm/dm-osgl.cpp
brlcad/trunk/src/libdm/dm-osgl.h
brlcad/trunk/src/libdm/dm-plot.c
brlcad/trunk/src/libdm/dm-plot.h
brlcad/trunk/src/libdm/dm-ps.c
brlcad/trunk/src/libdm/dm-ps.h
brlcad/trunk/src/libdm/dm-qt.cpp
brlcad/trunk/src/libdm/dm-qt.h
brlcad/trunk/src/libdm/dm-tk.c
brlcad/trunk/src/libdm/dm-tk.h
brlcad/trunk/src/libdm/dm-txt.c
brlcad/trunk/src/libdm/dm-wgl.c
brlcad/trunk/src/libdm/dm-wgl.h
brlcad/trunk/src/libdm/dm_obj.c
brlcad/trunk/src/libdm/dm_private.h
brlcad/trunk/src/libdm/dm_util.c
brlcad/trunk/src/libdm/grid.c
brlcad/trunk/src/libdm/labels.c
brlcad/trunk/src/libdm/options.c
brlcad/trunk/src/libdm/osg_bob.cpp
brlcad/trunk/src/libdm/query.c
brlcad/trunk/src/libdm/rect.c
brlcad/trunk/src/libdm/scale.c
brlcad/trunk/src/libfb/CMakeLists.txt
brlcad/trunk/src/libfb/asize.c
brlcad/trunk/src/libfb/fb_generic.c
brlcad/trunk/src/libfb/fb_log.c
brlcad/trunk/src/libfb/fb_obj.c
brlcad/trunk/src/libfb/fb_paged_io.c
brlcad/trunk/src/libfb/fb_private.h
brlcad/trunk/src/libfb/fb_rect.c
brlcad/trunk/src/libfb/fb_util.c
brlcad/trunk/src/libfb/fbserv_obj.c
brlcad/trunk/src/libfb/if_TEMPLATE.c
brlcad/trunk/src/libfb/if_X24.c
brlcad/trunk/src/libfb/if_debug.c
brlcad/trunk/src/libfb/if_disk.c
brlcad/trunk/src/libfb/if_mem.c
brlcad/trunk/src/libfb/if_null.c
brlcad/trunk/src/libfb/if_ogl.c
brlcad/trunk/src/libfb/if_osgl.cpp
brlcad/trunk/src/libfb/if_qt.cpp
brlcad/trunk/src/libfb/if_remote.c
brlcad/trunk/src/libfb/if_stack.c
brlcad/trunk/src/libfb/if_tk.c
brlcad/trunk/src/libfb/if_wgl.c
brlcad/trunk/src/libfb/osg_fb_manipulator.h
brlcad/trunk/src/libfb/tcl.c
brlcad/trunk/src/libtclcad/tclcad.c
brlcad/trunk/src/libtclcad/tclcad_init.c
brlcad/trunk/src/libtclcad/tclcad_obj.c
brlcad/trunk/src/mged/attach.c
brlcad/trunk/src/mged/cmd.c
brlcad/trunk/src/mged/dm-generic.c
brlcad/trunk/src/mged/doevent.c
brlcad/trunk/src/mged/dozoom.c
brlcad/trunk/src/mged/edsol.c
brlcad/trunk/src/mged/facedef.c
brlcad/trunk/src/mged/mged.h
brlcad/trunk/src/mged/mged_dm.h
brlcad/trunk/src/mged/set.c
brlcad/trunk/src/mged/share.c
brlcad/trunk/src/remrt/remrt.c
brlcad/trunk/src/remrt/rtsrv.c
brlcad/trunk/src/rt/do.c
brlcad/trunk/src/rt/ext.h
brlcad/trunk/src/rt/heatgraph.c
brlcad/trunk/src/rt/libfb-dummy.c
brlcad/trunk/src/rt/main.c
brlcad/trunk/src/rt/view.c
brlcad/trunk/src/rt/viewedge.c
brlcad/trunk/src/rt/viewxray.c
brlcad/trunk/src/sig/ddisp.c
brlcad/trunk/src/util/bwhist.c
brlcad/trunk/src/util/pixhist.c
brlcad/trunk/src/util/pixhist3d.c
brlcad/trunk/src/util/plot3-dm.c
Added Paths:
-----------
brlcad/trunk/include/dm/dm_xvars.h
Removed Paths:
-------------
brlcad/trunk/include/fb/defines.h
brlcad/trunk/src/libdm/dm_xvars.h
brlcad/trunk/src/libdm/include/
brlcad/trunk/src/libfb/include/
Modified: brlcad/trunk/include/CMakeLists.txt
===================================================================
--- brlcad/trunk/include/CMakeLists.txt 2020-04-17 16:14:01 UTC (rev 75437)
+++ brlcad/trunk/include/CMakeLists.txt 2020-04-17 16:46:07 UTC (rev 75438)
@@ -10,6 +10,7 @@
add_subdirectory(nmg)
add_subdirectory(optical)
add_subdirectory(rt)
+add_subdirectory(fb)
set(public_hdrs
RtServerImpl.h
Modified: brlcad/trunk/include/dm/CMakeLists.txt
===================================================================
--- brlcad/trunk/include/dm/CMakeLists.txt 2020-04-17 16:14:01 UTC (rev
75437)
+++ brlcad/trunk/include/dm/CMakeLists.txt 2020-04-17 16:46:07 UTC (rev
75438)
@@ -1,6 +1,7 @@
set(dm_headers
bview.h
defines.h
+ dm_xvars.h
)
BRLCAD_MANAGE_FILES(dm_headers ${INCLUDE_DIR}/brlcad/dm)
Copied: brlcad/trunk/include/dm/dm_xvars.h (from rev 75325,
brlcad/trunk/include/dm/dm_xvars.h)
===================================================================
--- brlcad/trunk/include/dm/dm_xvars.h (rev 0)
+++ brlcad/trunk/include/dm/dm_xvars.h 2020-04-17 16:46:07 UTC (rev 75438)
@@ -0,0 +1,96 @@
+/* D M _ X V A R S . H
+ * BRL-CAD
+ *
+ * Copyright (c) 1993-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.
+ */
+/** @addtogroup libdm */
+/** @{ */
+/** @file dm_xvars.h
+ *
+ */
+#ifndef DM_DM_XVARS_H
+#define DM_DM_XVARS_H
+
+#include "common.h"
+
+#ifdef HAVE_X11_XLIB_H
+# include <X11/Xlib.h>
+# include <X11/Xutil.h>
+#endif
+
+#ifdef HAVE_TK
+# include "tk.h"
+# define HAVE_X11_TYPES 1
+#endif
+#ifdef IF_WGL
+#include "tkWinInt.h"
+#endif
+
+#if !defined(HAVE_TK) && !defined(TK_WINDOW_TYPEDEF)
+typedef void *Tk_Window;
+# define TK_WINDOW_TYPEDEF 1
+#endif
+
+#if !defined(HAVE_X11_TYPES) && !defined(HAVE_X11_XLIB_H)
+typedef long Display;
+typedef long Window;
+typedef long Colormap;
+#endif
+
+#define XVARS_MV_O(_m) offsetof(struct dm_xvars, _m)
+
+#define INIT_XCOLOR(c) memset((c), 0, sizeof(XColor))
+
+/* FIXME: this structure really should not be variable-width and it
+ * does not allow multiple interfaces to be simultaneously compiled.
+ */
+struct dm_xvars {
+ Display *dpy;
+ Window win;
+ Tk_Window top;
+ Tk_Window xtkwin;
+ int depth;
+ Colormap cmap;
+#ifdef IF_WGL
+ PIXELFORMATDESCRIPTOR *vip;
+ HFONT fontstruct;
+ HDC hdc; /* device context of device that OpenGL calls are to be
drawn on */
+#endif
+#if defined(DM_X) || defined (DM_OGL) || defined (DM_RTGL)
+ XVisualInfo *vip;
+ XFontStruct *fontstruct;
+#endif
+#ifdef DM_TK
+ int tkfontset;
+ Tk_Font tkfontstruct;
+#endif
+ int devmotionnotify;
+ int devbuttonpress;
+ int devbuttonrelease;
+};
+
+#endif /* DM_DM_XVARS_H */
+/** @} */
+/*
+ * Local Variables:
+ * mode: C
+ * tab-width: 8
+ * indent-tabs-mode: t
+ * c-file-style: "stroustrup"
+ * End:
+ * ex: shiftwidth=4 tabstop=8
+ */
Modified: brlcad/trunk/include/dm.h
===================================================================
--- brlcad/trunk/include/dm.h 2020-04-17 16:14:01 UTC (rev 75437)
+++ brlcad/trunk/include/dm.h 2020-04-17 16:46:07 UTC (rev 75438)
@@ -35,13 +35,56 @@
#include "./dm/defines.h"
-__BEGIN_DECLS
-
/* Use fbserv */
#define USE_FBSERV 1
-#define DM_NULL (struct dm *)NULL
+#define DM_NULL (dm *)NULL
+#define DM_MIN (-2048)
+#define DM_MAX (2047)
+#define DM_O(_m) offsetof(dm, _m)
+
+#define GED_MAX 2047.0
+#define GED_MIN -2048.0
+#define GED_RANGE 4095.0
+#define INV_GED 0.00048828125
+#define INV_4096 0.000244140625
+
+/*
+ * Display coordinate conversion:
+ * GED is using -2048..+2048,
+ * X is 0..width, 0..height
+ */
+#define DIVBY4096(x) (((double)(x))*INV_4096)
+#define GED_TO_Xx(_dmp, x) ((int)((DIVBY4096(x)+0.5)*_dmp->dm_width))
+#define GED_TO_Xy(_dmp, x) ((int)((0.5-DIVBY4096(x))*_dmp->dm_height))
+#define Xx_TO_GED(_dmp, x) ((int)(((x)/(double)_dmp->dm_width - 0.5) *
GED_RANGE))
+#define Xy_TO_GED(_dmp, x) ((int)((0.5 - (x)/(double)_dmp->dm_height) *
GED_RANGE))
+
+/* +-2048 to +-1 */
+#define GED_TO_PM1(x) (((fastf_t)(x))*INV_GED)
+
+#ifdef IR_KNOBS
+# define NOISE 16 /* Size of dead spot on knob */
+#endif
+
+/* the font used depends on the size of the window opened */
+#define FONTBACK "-adobe-courier-medium-r-normal--10-100-75-75-m-60-iso8859-1"
+#define FONT5 "5x7"
+#define FONT6 "6x10"
+#define FONT7 "7x13"
+#define FONT8 "8x13"
+#define FONT9 "9x15"
+#define FONT10 "10x20"
+#define FONT12 "12x24"
+
+#if defined(_WIN32) && !defined(__CYGWIN__)
+# define DM_VALID_FONT_SIZE(_size) (14 <= (_size) && (_size) <= 29)
+#else
+# define DM_VALID_FONT_SIZE(_size) (5 <= (_size) && (_size) <= 12 && (_size)
!= 11)
+# define DM_FONT_SIZE_TO_NAME(_size) (((_size) == 5) ? FONT5 : (((_size) ==
6) ? FONT6 : (((_size) == 7) ? FONT7 : (((_size) == 8) ? FONT8 : (((_size) ==
9) ? FONT9 : (((_size) == 10) ? FONT10 : FONT12))))))
+#endif
+
/* Display Manager Types */
#define DM_TYPE_BAD -1
#define DM_TYPE_NULL 0
@@ -59,6 +102,10 @@
#define DM_TYPE_OSG 12
#define DM_TYPE_OSGL 13
+/* Line Styles */
+#define DM_SOLID_LINE 0
+#define DM_DASHED_LINE 1
+
#define IS_DM_TYPE_NULL(_t) ((_t) == DM_TYPE_NULL)
#define IS_DM_TYPE_PLOT(_t) ((_t) == DM_TYPE_PLOT)
#define IS_DM_TYPE_PS(_t) ((_t) == DM_TYPE_PS)
@@ -74,23 +121,89 @@
#define IS_DM_TYPE_OSG(_t) ((_t) == DM_TYPE_OSG)
#define IS_DM_TYPE_OSGL(_t) ((_t) == DM_TYPE_OSGL)
-/* the font used depends on the size of the window opened */
-#define FONTBACK "-adobe-courier-medium-r-normal--10-100-75-75-m-60-iso8859-1"
-#define FONT5 "5x7"
-#define FONT6 "6x10"
-#define FONT7 "7x13"
-#define FONT8 "8x13"
-#define FONT9 "9x15"
-#define FONT10 "10x20"
-#define FONT12 "12x24"
+#define GET_DM(p, structure, w, hp) { \
+ register struct structure *tp; \
+ for (BU_LIST_FOR(tp, structure, hp)) { \
+ if (w == tp->win) { \
+ (p) = tp; \
+ break; \
+ } \
+ } \
+ \
+ if (BU_LIST_IS_HEAD(tp, hp)) \
+ p = (struct structure *)NULL; \
+ }
-#if defined(_WIN32) && !defined(__CYGWIN__)
-# define DM_VALID_FONT_SIZE(_size) (14 <= (_size) && (_size) <= 29)
+
+/* Colors */
+#define DM_COLOR_HI ((short)230)
+#define DM_COLOR_LOW ((short)0)
+#define DM_BLACK_R DM_COLOR_LOW
+#define DM_BLACK_G DM_COLOR_LOW
+#define DM_BLACK_B DM_COLOR_LOW
+#define DM_RED_R DM_COLOR_HI
+#define DM_RED_G DM_COLOR_LOW
+#define DM_RED_B DM_COLOR_LOW
+#define DM_BLUE_R DM_COLOR_LOW
+#define DM_BLUE_G DM_COLOR_LOW
+#define DM_BLUE_B DM_COLOR_HI
+#define DM_YELLOW_R DM_COLOR_HI
+#define DM_YELLOW_G DM_COLOR_HI
+#define DM_YELLOW_B DM_COLOR_LOW
+#define DM_WHITE_R DM_COLOR_HI
+#define DM_WHITE_G DM_COLOR_HI
+#define DM_WHITE_B DM_COLOR_HI
+#define DM_BLACK DM_BLACK_R, DM_BLACK_G, DM_BLACK_B
+#define DM_RED DM_RED_R, DM_RED_G, DM_RED_B
+#define DM_BLUE DM_BLUE_R, DM_BLUE_G, DM_BLUE_B
+#define DM_YELLOW DM_YELLOW_R, DM_YELLOW_G, DM_YELLOW_B
+#define DM_WHITE DM_WHITE_R, DM_WHITE_G, DM_WHITE_B
+#define DM_COPY_COLOR(_dr, _dg, _db, _sr, _sg, _sb) {\
+ (_dr) = (_sr);\
+ (_dg) = (_sg);\
+ (_db) = (_sb); }
+#define DM_SAME_COLOR(_dr, _dg, _db, _sr, _sg, _sb)(\
+ (_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
-# define DM_VALID_FONT_SIZE(_size) (5 <= (_size) && (_size) <= 12 && (_size)
!= 11)
-# define DM_FONT_SIZE_TO_NAME(_size) (((_size) == 5) ? FONT5 : (((_size) ==
6) ? FONT6 : (((_size) == 7) ? FONT7 : (((_size) == 8) ? FONT8 : (((_size) ==
9) ? FONT9 : (((_size) == 10) ? FONT10 : FONT12))))))
+/* Do nothing */
+#define DM_REVERSE_COLOR_BYTE_ORDER(_shift, _mask)
#endif
+/* Command parameter to dmr_viewchange() */
+#define DM_CHGV_REDO 0 /* Display has changed substantially */
+#define DM_CHGV_ADD 1 /* Add an object to the display */
+#define DM_CHGV_DEL 2 /* Delete an object from the display */
+#define DM_CHGV_REPL 3 /* Replace an object */
+#define DM_CHGV_ILLUM 4 /* Make new object the illuminated object */
+
+/*
+ * Definitions for dealing with the buttons and lights.
+ * BV are for viewing, and BE are for editing functions.
+ */
+#define LIGHT_OFF 0
+#define LIGHT_ON 1
+#define LIGHT_RESET 2 /* all lights out */
+
/* This is how a parent application can pass a generic
* hook function in when setting dm variables. The dm_hook_data
* container holds the bu_structparse hook function and data
@@ -107,58 +220,59 @@
void *dmh_data;
};
-/* The internals of the dm structure are hidden using the PImpl pattern*/
-struct dm_impl;
-struct dm {
- struct dm_impl *i;
-};
+/* Hide the dm structure behind a typedef */
+typedef struct dm_internal dm;
-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_rtgl;
-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;
+#define DM_OPEN(_interp, _type, _argc, _argv) dm_open(_interp, _type, _argc,
_argv)
+__BEGIN_DECLS
+
+DM_EXPORT extern dm dm_ogl;
+DM_EXPORT extern dm dm_plot;
+DM_EXPORT extern dm dm_ps;
+DM_EXPORT extern dm dm_rtgl;
+DM_EXPORT extern dm dm_tk;
+DM_EXPORT extern dm dm_wgl;
+DM_EXPORT extern dm dm_X;
+DM_EXPORT extern dm dm_txt;
+DM_EXPORT extern dm dm_qt;
+DM_EXPORT extern dm dm_osgl;
+
DM_EXPORT extern int Dm_Init(void *interp);
-DM_EXPORT extern struct dm *dm_open(void *interp,
+DM_EXPORT extern dm *dm_open(Tcl_Interp *interp,
int type,
int argc,
const char *argv[]);
-DM_EXPORT extern void *dm_interp(struct dm *dmp);
-DM_EXPORT extern int dm_share_dlist(struct dm *dmp1,
- struct dm *dmp2);
-DM_EXPORT extern fastf_t dm_Xx2Normal(struct dm *dmp,
+DM_EXPORT extern void *dm_interp(dm *dmp);
+DM_EXPORT extern int dm_share_dlist(dm *dmp1,
+ dm *dmp2);
+DM_EXPORT extern fastf_t dm_Xx2Normal(dm *dmp,
int x);
-DM_EXPORT extern int dm_Normal2Xx(struct dm *dmp,
+DM_EXPORT extern int dm_Normal2Xx(dm *dmp,
fastf_t f);
-DM_EXPORT extern fastf_t dm_Xy2Normal(struct dm *dmp,
+DM_EXPORT extern fastf_t dm_Xy2Normal(dm *dmp,
int y,
int use_aspect);
-DM_EXPORT extern int dm_Normal2Xy(struct dm *dmp,
+DM_EXPORT extern int dm_Normal2Xy(dm *dmp,
fastf_t f,
int use_aspect);
-DM_EXPORT extern void dm_fogHint(struct dm *dmp,
+DM_EXPORT extern void dm_fogHint(dm *dmp,
int fastfog);
-DM_EXPORT extern int dm_processOptions(struct dm *dmp, struct bu_vls
*init_proc_vls, int argc, char **argv);
+DM_EXPORT extern int dm_processOptions(dm *dmp, struct bu_vls *init_proc_vls,
int argc, char **argv);
DM_EXPORT extern int dm_limit(int i);
DM_EXPORT extern int dm_unlimit(int i);
DM_EXPORT extern fastf_t dm_wrap(fastf_t f);
/* adc.c */
-DM_EXPORT extern void dm_draw_adc(struct dm *dmp,
+DM_EXPORT extern void dm_draw_adc(dm *dmp,
struct bview_adc_state *adcp, mat_t
view2model, mat_t model2view);
/* axes.c */
-DM_EXPORT extern void dm_draw_data_axes(struct dm *dmp,
+DM_EXPORT extern void dm_draw_data_axes(dm *dmp,
fastf_t viewSize,
struct bview_data_axes_state *bndasp);
-DM_EXPORT extern void dm_draw_axes(struct dm *dmp,
+DM_EXPORT extern void dm_draw_axes(dm *dmp,
fastf_t viewSize,
const mat_t rmat,
struct bview_axes_state *bnasp);
@@ -174,7 +288,7 @@
fastf_t *);
/* grid.c */
-DM_EXPORT extern void dm_draw_grid(struct dm *dmp,
+DM_EXPORT extern void dm_draw_grid(dm *dmp,
struct bview_grid_state *ggsp,
fastf_t scale,
mat_t model2view,
@@ -181,22 +295,22 @@
fastf_t base2local);
/* labels.c */
-DM_EXPORT extern int dm_draw_labels(struct dm *dmp,
+DM_EXPORT extern int dm_draw_labels(dm *dmp,
struct rt_wdb *wdbp,
const char *name,
mat_t viewmat,
int *labelsColor,
- int (*labelsHook)(struct dm *dmp_arg,
struct rt_wdb *wdbp_arg,
+ int (*labelsHook)(dm *dmp_arg, struct
rt_wdb *wdbp_arg,
const char *name_arg,
mat_t viewmat_arg,
int *labelsColor_arg,
ClientData labelsHookClientdata_arg),
ClientData labelsHookClientdata);
/* rect.c */
-DM_EXPORT extern void dm_draw_rect(struct dm *dmp,
+DM_EXPORT extern void dm_draw_rect(dm *dmp,
struct bview_interactive_rect_state *grsp);
/* scale.c */
-DM_EXPORT extern void dm_draw_scale(struct dm *dmp,
+DM_EXPORT extern void dm_draw_scale(dm *dmp,
fastf_t viewSize,
int *lineColor,
int *textColor);
@@ -209,99 +323,100 @@
/* functions to make a dm struct hideable - will need to
* sort these out later */
-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_lname(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);
-DM_EXPORT extern void dm_set_height(struct dm *dmp, int height);
-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_get_type(struct dm *dmp);
+DM_EXPORT extern dm *dm_get();
+DM_EXPORT extern void dm_put(dm *dmp);
+DM_EXPORT extern void dm_set_null(dm *dmp); /* TODO - HACK, need general set
mechanism */
+DM_EXPORT extern const char *dm_get_dm_name(dm *dmp);
+DM_EXPORT extern const char *dm_get_dm_lname(dm *dmp);
+DM_EXPORT extern int dm_get_width(dm *dmp);
+DM_EXPORT extern int dm_get_height(dm *dmp);
+DM_EXPORT extern void dm_set_width(dm *dmp, int width);
+DM_EXPORT extern void dm_set_height(dm *dmp, int height);
+DM_EXPORT extern fastf_t dm_get_aspect(dm *dmp);
+DM_EXPORT extern int dm_get_type(dm *dmp);
+DM_EXPORT void *dm_get_xvars(dm *dmp);
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 unsigned long dm_get_id(struct dm *dmp);
-DM_EXPORT extern void dm_set_id(struct dm *dmp, unsigned long new_id);
-DM_EXPORT extern int dm_get_displaylist(struct dm *dmp);
-DM_EXPORT extern int dm_close(struct dm *dmp);
-DM_EXPORT extern unsigned char *dm_get_bg(struct dm *dmp);
-DM_EXPORT extern int dm_set_bg(struct dm *dmp, unsigned char r, unsigned char
g, unsigned char b);
-DM_EXPORT extern unsigned char *dm_get_fg(struct dm *dmp);
-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 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);
-DM_EXPORT extern void dm_set_bound(struct dm *dmp, fastf_t val);
-DM_EXPORT extern int dm_get_stereo(struct dm *dmp);
-DM_EXPORT extern int dm_set_win_bounds(struct dm *dmp, fastf_t *w);
-DM_EXPORT extern int dm_configure_win(struct dm *dmp, int force);
-DM_EXPORT extern struct bu_vls *dm_get_pathname(struct dm *dmp);
-DM_EXPORT extern struct bu_vls *dm_get_dname(struct dm *dmp);
-DM_EXPORT extern struct bu_vls *dm_get_tkname(struct dm *dmp);
-DM_EXPORT extern int dm_get_fontsize(struct dm *dmp);
-DM_EXPORT extern void dm_set_fontsize(struct dm *dmp, int size);
-DM_EXPORT extern int dm_get_light_flag(struct dm *dmp);
-DM_EXPORT extern void dm_set_light_flag(struct dm *dmp, int size);
-DM_EXPORT extern int dm_set_light(struct dm *dmp, int light);
-DM_EXPORT extern int dm_get_transparency(struct dm *dmp);
-DM_EXPORT extern int dm_set_transparency(struct dm *dmp, int transparency);
-DM_EXPORT extern int dm_get_zbuffer(struct dm *dmp);
-DM_EXPORT extern int dm_set_zbuffer(struct dm *dmp, int zbuffer);
-DM_EXPORT extern int dm_get_linewidth(struct dm *dmp);
-DM_EXPORT extern void dm_set_linewidth(struct dm *dmp, int linewidth);
-DM_EXPORT extern int dm_get_linestyle(struct dm *dmp);
-DM_EXPORT extern void dm_set_linestyle(struct dm *dmp, int linestyle);
-DM_EXPORT extern int dm_get_zclip(struct dm *dmp);
-DM_EXPORT extern void dm_set_zclip(struct dm *dmp, int zclip);
-DM_EXPORT extern int dm_get_perspective(struct dm *dmp);
-DM_EXPORT extern void dm_set_perspective(struct dm *dmp, fastf_t perspective);
-DM_EXPORT extern int dm_get_display_image(struct dm *dmp, unsigned char
**image);
-DM_EXPORT extern int dm_gen_dlists(struct dm *dmp, size_t range);
-DM_EXPORT extern int dm_begin_dlist(struct dm *dmp, unsigned int list);
-DM_EXPORT extern int dm_draw_dlist(struct dm *dmp, unsigned int list);
-DM_EXPORT extern int dm_end_dlist(struct dm *dmp);
-DM_EXPORT extern int dm_free_dlists(struct dm *dmp, unsigned int list, int
range);
-DM_EXPORT extern int dm_draw_vlist(struct dm *dmp, struct bn_vlist *vp);
-DM_EXPORT extern int dm_draw_vlist_hidden_line(struct dm *dmp, struct bn_vlist
*vp);
-DM_EXPORT extern int dm_set_line_attr(struct dm *dmp, int width, int style);
-DM_EXPORT extern int dm_draw_begin(struct dm *dmp);
-DM_EXPORT extern int dm_draw_end(struct dm *dmp);
-DM_EXPORT extern int dm_normal(struct dm *dmp);
-DM_EXPORT extern int dm_loadmatrix(struct dm *dmp, fastf_t *mat, int eye);
-DM_EXPORT extern int dm_loadpmatrix(struct dm *dmp, fastf_t *mat);
-DM_EXPORT extern int dm_draw_string_2d(struct dm *dmp, const char *str,
fastf_t x, fastf_t y, int size, int use_aspect);
-DM_EXPORT extern int dm_draw_line_2d(struct dm *dmp, fastf_t x1, fastf_t
y1_2d, fastf_t x2, fastf_t y2);
-DM_EXPORT extern int dm_draw_line_3d(struct dm *dmp, point_t pt1, point_t pt2);
-DM_EXPORT extern int dm_draw_lines_3d(struct dm *dmp, int npoints, point_t
*points, int sflag);
-DM_EXPORT extern int dm_draw_point_2d(struct dm *dmp, fastf_t x, fastf_t y);
-DM_EXPORT extern int dm_draw_point_3d(struct dm *dmp, point_t pt);
-DM_EXPORT extern int dm_draw_points_3d(struct dm *dmp, int npoints, point_t
*points);
-DM_EXPORT extern int dm_draw(struct dm *dmp, struct bn_vlist *(*callback)(void
*), void **data);
-DM_EXPORT extern int dm_draw_obj(struct dm *dmp, struct display_list *obj);
-DM_EXPORT extern int dm_set_depth_mask(struct dm *dmp, int d_on);
-DM_EXPORT extern int dm_debug(struct dm *dmp, int lvl);
-DM_EXPORT extern int dm_logfile(struct dm *dmp, const char *filename);
-DM_EXPORT extern struct fb *dm_get_fb(struct dm *dmp);
-DM_EXPORT extern int dm_get_fb_visible(struct dm *dmp);
-DM_EXPORT extern int dm_set_fb_visible(struct dm *dmp, int is_fb_visible);
+DM_EXPORT extern unsigned long dm_get_id(dm *dmp);
+DM_EXPORT extern void dm_set_id(dm *dmp, unsigned long new_id);
+DM_EXPORT extern int dm_get_displaylist(dm *dmp);
+DM_EXPORT extern int dm_close(dm *dmp);
+DM_EXPORT extern unsigned char *dm_get_bg(dm *dmp);
+DM_EXPORT extern int dm_set_bg(dm *dmp, unsigned char r, unsigned char g,
unsigned char b);
+DM_EXPORT extern unsigned char *dm_get_fg(dm *dmp);
+DM_EXPORT extern int dm_set_fg(dm *dmp, unsigned char r, unsigned char g,
unsigned char b, int strict, fastf_t transparency);
+DM_EXPORT extern int dm_reshape(dm *dmp, int width, int height);
+DM_EXPORT extern int dm_make_current(dm *dmp);
+DM_EXPORT extern vect_t *dm_get_clipmin(dm *dmp);
+DM_EXPORT extern vect_t *dm_get_clipmax(dm *dmp);
+DM_EXPORT extern int dm_get_bound_flag(dm *dmp);
+DM_EXPORT extern void dm_set_bound(dm *dmp, fastf_t val);
+DM_EXPORT extern int dm_get_stereo(dm *dmp);
+DM_EXPORT extern int dm_set_win_bounds(dm *dmp, fastf_t *w);
+DM_EXPORT extern int dm_configure_win(dm *dmp, int force);
+DM_EXPORT extern struct bu_vls *dm_get_pathname(dm *dmp);
+DM_EXPORT extern struct bu_vls *dm_get_dname(dm *dmp);
+DM_EXPORT extern struct bu_vls *dm_get_tkname(dm *dmp);
+DM_EXPORT extern int dm_get_fontsize(dm *dmp);
+DM_EXPORT extern void dm_set_fontsize(dm *dmp, int size);
+DM_EXPORT extern int dm_get_light_flag(dm *dmp);
+DM_EXPORT extern void dm_set_light_flag(dm *dmp, int size);
+DM_EXPORT extern int dm_set_light(dm *dmp, int light);
+DM_EXPORT extern void *dm_get_public_vars(dm *dmp);
+DM_EXPORT extern void *dm_get_private_vars(dm *dmp);
+DM_EXPORT extern int dm_get_transparency(dm *dmp);
+DM_EXPORT extern int dm_set_transparency(dm *dmp, int transparency);
+DM_EXPORT extern int dm_get_zbuffer(dm *dmp);
+DM_EXPORT extern int dm_set_zbuffer(dm *dmp, int zbuffer);
+DM_EXPORT extern int dm_get_linewidth(dm *dmp);
+DM_EXPORT extern void dm_set_linewidth(dm *dmp, int linewidth);
+DM_EXPORT extern int dm_get_linestyle(dm *dmp);
+DM_EXPORT extern void dm_set_linestyle(dm *dmp, int linestyle);
+DM_EXPORT extern int dm_get_zclip(dm *dmp);
+DM_EXPORT extern void dm_set_zclip(dm *dmp, int zclip);
+DM_EXPORT extern int dm_get_perspective(dm *dmp);
+DM_EXPORT extern void dm_set_perspective(dm *dmp, fastf_t perspective);
+DM_EXPORT extern int dm_get_display_image(dm *dmp, unsigned char **image);
+DM_EXPORT extern int dm_gen_dlists(dm *dmp, size_t range);
+DM_EXPORT extern int dm_begin_dlist(dm *dmp, unsigned int list);
+DM_EXPORT extern int dm_draw_dlist(dm *dmp, unsigned int list);
+DM_EXPORT extern int dm_end_dlist(dm *dmp);
+DM_EXPORT extern int dm_free_dlists(dm *dmp, unsigned int list, int range);
+DM_EXPORT extern int dm_draw_vlist(dm *dmp, struct bn_vlist *vp);
+DM_EXPORT extern int dm_draw_vlist_hidden_line(dm *dmp, struct bn_vlist *vp);
+DM_EXPORT extern int dm_set_line_attr(dm *dmp, int width, int style);
+DM_EXPORT extern int dm_draw_begin(dm *dmp);
+DM_EXPORT extern int dm_draw_end(dm *dmp);
+DM_EXPORT extern int dm_normal(dm *dmp);
+DM_EXPORT extern int dm_loadmatrix(dm *dmp, fastf_t *mat, int eye);
+DM_EXPORT extern int dm_loadpmatrix(dm *dmp, fastf_t *mat);
+DM_EXPORT extern int dm_draw_string_2d(dm *dmp, const char *str, fastf_t x,
fastf_t y, int size, int use_aspect);
+DM_EXPORT extern int dm_draw_line_2d(dm *dmp, fastf_t x1, fastf_t y1_2d,
fastf_t x2, fastf_t y2);
+DM_EXPORT extern int dm_draw_line_3d(dm *dmp, point_t pt1, point_t pt2);
+DM_EXPORT extern int dm_draw_lines_3d(dm *dmp, int npoints, point_t *points,
int sflag);
+DM_EXPORT extern int dm_draw_point_2d(dm *dmp, fastf_t x, fastf_t y);
+DM_EXPORT extern int dm_draw_point_3d(dm *dmp, point_t pt);
+DM_EXPORT extern int dm_draw_points_3d(dm *dmp, int npoints, point_t *points);
+DM_EXPORT extern int dm_draw(dm *dmp, struct bn_vlist *(*callback)(void *),
void **data);
+DM_EXPORT extern int dm_draw_obj(dm *dmp, struct display_list *obj);
+DM_EXPORT extern int dm_set_depth_mask(dm *dmp, int d_on);
+DM_EXPORT extern int dm_debug(dm *dmp, int lvl);
+DM_EXPORT extern int dm_logfile(dm *dmp, const char *filename);
+DM_EXPORT extern fb *dm_get_fb(dm *dmp);
+DM_EXPORT extern int dm_get_fb_visible(dm *dmp);
+DM_EXPORT extern int dm_set_fb_visible(dm *dmp, int is_fb_visible);
/* TODO - dm_vp is supposed to go away, but until we figure it out
* expose it here to allow dm hiding */
-DM_EXPORT extern fastf_t *dm_get_vp(struct dm *dmp);
-DM_EXPORT extern void dm_set_vp(struct dm *dmp, fastf_t *vp);
+DM_EXPORT extern fastf_t *dm_get_vp(dm *dmp);
+DM_EXPORT extern void dm_set_vp(dm *dmp, fastf_t *vp);
DM_EXPORT extern int dm_set_hook(const struct bu_structparse_map *map,
const char *key, void *data, struct
dm_hook_data *hook);
-DM_EXPORT extern struct bu_structparse *dm_get_vparse(struct dm *dmp);
-DM_EXPORT extern void *dm_get_mvars(struct dm *dmp);
+DM_EXPORT extern struct bu_structparse *dm_get_vparse(dm *dmp);
+DM_EXPORT extern void *dm_get_mvars(dm *dmp);
-DM_EXPORT extern int dm_draw_display_list(struct dm *dmp,
+DM_EXPORT extern int dm_draw_display_list(dm *dmp,
struct bu_list *dl,
fastf_t transparency_threshold,
fastf_t inv_viewsize,
@@ -316,6 +431,47 @@
DM_EXPORT extern int dm_default_type();
+/* For backwards compatibility, define macros and expose struct dm */
+#ifdef EXPOSE_DM_HEADER
+# include "../src/libdm/dm_private.h"
+#endif
+
+#define DM_OPEN(_interp, _type, _argc, _argv) dm_open(_interp, _type, _argc,
_argv)
+#define DM_CLOSE(_dmp) _dmp->dm_close(_dmp)
+#define DM_DRAW_BEGIN(_dmp) _dmp->dm_drawBegin(_dmp)
+#define DM_DRAW_END(_dmp) _dmp->dm_drawEnd(_dmp)
+#define DM_NORMAL(_dmp) _dmp->dm_normal(_dmp)
+#define DM_LOADMATRIX(_dmp, _mat, _eye) _dmp->dm_loadMatrix(_dmp, _mat, _eye)
+#define DM_LOADPMATRIX(_dmp, _mat) _dmp->dm_loadPMatrix(_dmp, _mat)
+#define DM_DRAW_STRING_2D(_dmp, _str, _x, _y, _size, _use_aspect)
_dmp->dm_drawString2D(_dmp, _str, _x, _y, _size, _use_aspect)
+#define DM_DRAW_LINE_2D(_dmp, _x1, _y1, _x2, _y2) _dmp->dm_drawLine2D(_dmp,
_x1, _y1, _x2, _y2)
+#define DM_DRAW_LINE_3D(_dmp, _pt1, _pt2) _dmp->dm_drawLine3D(_dmp, _pt1, _pt2)
+#define DM_DRAW_LINES_3D(_dmp, _npoints, _points, _sflag)
_dmp->dm_drawLines3D(_dmp, _npoints, _points, _sflag)
+#define DM_DRAW_POINT_2D(_dmp, _x, _y) _dmp->dm_drawPoint2D(_dmp, _x, _y)
+#define DM_DRAW_POINT_3D(_dmp, _pt) _dmp->dm_drawPoint3D(_dmp, _pt)
+#define DM_DRAW_POINTS_3D(_dmp, _npoints, _points) _dmp->dm_drawPoints3D(_dmp,
_npoints, _points)
+#define DM_DRAW_VLIST(_dmp, _vlist) _dmp->dm_drawVList(_dmp, _vlist)
+#define DM_DRAW_VLIST_HIDDEN_LINE(_dmp, _vlist)
_dmp->dm_drawVListHiddenLine(_dmp, _vlist)
+#define DM_DRAW(_dmp, _callback, _data) _dmp->dm_draw(_dmp, _callback, _data)
+#define DM_SET_FGCOLOR(_dmp, _r, _g, _b, _strict, _transparency)
_dmp->dm_setFGColor(_dmp, _r, _g, _b, _strict, _transparency)
+#define DM_SET_BGCOLOR(_dmp, _r, _g, _b) _dmp->dm_setBGColor(_dmp, _r, _g, _b)
+#define DM_SET_LINE_ATTR(_dmp, _width, _dashed) _dmp->dm_setLineAttr(_dmp,
_width, _dashed)
+#define DM_CONFIGURE_WIN(_dmp, _force) _dmp->dm_configureWin((_dmp), (_force))
+#define DM_SET_WIN_BOUNDS(_dmp, _w) _dmp->dm_setWinBounds(_dmp, _w)
+#define DM_SET_LIGHT(_dmp, _on) _dmp->dm_setLight(_dmp, _on)
+#define DM_SET_TRANSPARENCY(_dmp, _on) _dmp->dm_setTransparency(_dmp, _on)
+#define DM_SET_DEPTH_MASK(_dmp, _on) _dmp->dm_setDepthMask(_dmp, _on)
+#define DM_SET_ZBUFFER(_dmp, _on) _dmp->dm_setZBuffer(_dmp, _on)
+#define DM_DEBUG(_dmp, _lvl) _dmp->dm_debug(_dmp, _lvl)
+#define DM_LOGFILE(_dmp, _lvl) _dmp->dm_logfile(_dmp, _lvl)
+#define DM_BEGINDLIST(_dmp, _list) _dmp->dm_beginDList(_dmp, _list)
+#define DM_ENDDLIST(_dmp) _dmp->dm_endDList(_dmp)
+#define DM_DRAWDLIST(_dmp, _list) _dmp->dm_drawDList(_list)
+#define DM_FREEDLISTS(_dmp, _list, _range) _dmp->dm_freeDLists(_dmp, _list,
_range)
+#define DM_GEN_DLISTS(_dmp, _range) _dmp->dm_genDLists(_dmp, _range)
+#define DM_GET_DISPLAY_IMAGE(_dmp, _image) _dmp->dm_getDisplayImage(_dmp,
_image)
+#define DM_MAKE_CURRENT(_dmp) _dmp->dm_makeCurrent(_dmp)
+
__END_DECLS
#endif /* DM_H */
Modified: brlcad/trunk/include/fb/CMakeLists.txt
===================================================================
--- brlcad/trunk/include/fb/CMakeLists.txt 2020-04-17 16:14:01 UTC (rev
75437)
+++ brlcad/trunk/include/fb/CMakeLists.txt 2020-04-17 16:46:07 UTC (rev
75438)
@@ -1,9 +1,3 @@
-set(fb_headers
- defines.h
- )
-BRLCAD_MANAGE_FILES(fb_headers ${INCLUDE_DIR}/brlcad/fb)
-
-# For libdm
set(fb_noinstall_headers
fb_ogl.h
fb_osgl.h
Deleted: brlcad/trunk/include/fb/defines.h
===================================================================
--- brlcad/trunk/include/fb/defines.h 2020-04-17 16:14:01 UTC (rev 75437)
+++ brlcad/trunk/include/fb/defines.h 2020-04-17 16:46:07 UTC (rev 75438)
@@ -1,54 +0,0 @@
-/* D E F I N E S . H
- * BRL-CAD
- *
- * Copyright (c) 2004-2020 United States Government as represented by
- * the U.S. Army Research Laboratory.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public License
- * version 2.1 as published by the Free Software Foundation.
- *
- * This library is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this file; see the file named COPYING for more
- * information.
- */
-/** @addtogroup libfb */
-/** @{ */
-/** @file fb/defines.h
- *
- * "Generic" Framebuffer Library Interface Defines.
- *
- */
-
-#ifndef FB_DEFINES_H
-#define FB_DEFINES_H
-
-#ifndef FB_EXPORT
-# if defined(FB_DLL_EXPORTS) && defined(FB_DLL_IMPORTS)
-# error "Only FB_DLL_EXPORTS or FB_DLL_IMPORTS can be defined, not both."
-# elif defined(FB_DLL_EXPORTS)
-# define FB_EXPORT __declspec(dllexport)
-# elif defined(FB_DLL_IMPORTS)
-# define FB_EXPORT __declspec(dllimport)
-# else
-# define FB_EXPORT
-# endif
-#endif
-
-#endif /* FB_DEFINES_H */
-
-/** @} */
-/*
- * Local Variables:
- * mode: C
- * tab-width: 8
- * indent-tabs-mode: t
- * c-file-style: "stroustrup"
- * End:
- * ex: shiftwidth=4 tabstop=8
- */
Modified: brlcad/trunk/include/fb.h
===================================================================
--- brlcad/trunk/include/fb.h 2020-04-17 16:14:01 UTC (rev 75437)
+++ brlcad/trunk/include/fb.h 2020-04-17 16:46:07 UTC (rev 75438)
@@ -28,10 +28,18 @@
#ifndef FB_H
#define FB_H
-#include "common.h"
+#ifndef FB_EXPORT
+# if defined(FB_DLL_EXPORTS) && defined(FB_DLL_IMPORTS)
+# error "Only FB_DLL_EXPORTS or FB_DLL_IMPORTS can be defined, not both."
+# elif defined(FB_DLL_EXPORTS)
+# define FB_EXPORT __declspec(dllexport)
+# elif defined(FB_DLL_IMPORTS)
+# define FB_EXPORT __declspec(dllimport)
+# else
+# define FB_EXPORT
+# endif
+#endif
-#include "./fb/defines.h"
-
/*
* Needed for fd_set, avoid including sys/select.h outright since it
* conflicts on some systems (e.g. freebsd4).
@@ -39,6 +47,7 @@
* FIXME: would be nice to decouple this interface from fd_set as it's
* only used in one place right now.
*/
+#include "common.h"
#if defined(HAVE_SYS_TYPES_H)
# include <sys/types.h>
#endif
@@ -81,12 +90,9 @@
#define RGBPIXEL_NULL (unsigned char *) 0
#define COLORMAP_NULL (ColorMap *) 0
-/* The internals of the framebuffer structure are hidden using the PImpl
pattern */
-struct fb_impl;
-struct fb {
- struct fb_impl *i;
-};
-#define FB_NULL (struct fb *) 0
+/* Use a typedef to hide the details of the framebuffer structure */
+typedef struct fb_internal fb;
+#define FB_NULL (fb *) 0
/**
* assert the integrity of a framebuffer struct.
@@ -97,71 +103,71 @@
/* Library entry points */
-FB_EXPORT struct fb *fb_get();
-FB_EXPORT void fb_put(struct fb *ifp);
-FB_EXPORT extern char *fb_gettype(struct fb *ifp);
-FB_EXPORT extern int fb_get_max_width(struct fb *ifp);
-FB_EXPORT extern int fb_get_max_height(struct fb *ifp);
-FB_EXPORT extern int fb_getwidth(struct fb *ifp);
-FB_EXPORT extern int fb_getheight(struct fb *ifp);
-FB_EXPORT extern int fb_poll(struct fb *ifp);
+FB_EXPORT fb *fb_get();
+FB_EXPORT void fb_put(fb *ifp);
+FB_EXPORT extern char *fb_gettype(fb *ifp);
+FB_EXPORT extern int fb_get_max_width(fb *ifp);
+FB_EXPORT extern int fb_get_max_height(fb *ifp);
+FB_EXPORT extern int fb_getwidth(fb *ifp);
+FB_EXPORT extern int fb_getheight(fb *ifp);
+FB_EXPORT extern int fb_poll(fb *ifp);
/* Returns in microseconds the maximum recommended amount of time to linger
* before polling for updates for a specific framebuffer instance (can be
* implementation dependent.) Zero means the fb_poll process does nothing
* (for example, the NULL fb). */
-FB_EXPORT extern long fb_poll_rate(struct fb *ifp);
-FB_EXPORT extern int fb_help(struct fb *ifp);
-FB_EXPORT extern int fb_free(struct fb *ifp);
-FB_EXPORT extern int fb_clear(struct fb *ifp, unsigned char *pp);
-FB_EXPORT extern ssize_t fb_read(struct fb *ifp, int x, int y, unsigned char
*pp, size_t count);
-FB_EXPORT extern ssize_t fb_write(struct fb *ifp, int x, int y, const unsigned
char *pp, size_t count);
-FB_EXPORT extern int fb_rmap(struct fb *ifp, ColorMap *cmap);
-FB_EXPORT extern int fb_wmap(struct fb *ifp, const ColorMap *cmap);
-FB_EXPORT extern int fb_view(struct fb *ifp, int xcenter, int ycenter, int
xzoom, int yzoom);
-FB_EXPORT extern int fb_getview(struct fb *ifp, int *xcenter, int *ycenter,
int *xzoom, int *yzoom);
-FB_EXPORT extern int fb_setcursor(struct fb *ifp, const unsigned char *bits,
int xb, int yb, int xo, int yo);
-FB_EXPORT extern int fb_cursor(struct fb *ifp, int mode, int x, int y);
-FB_EXPORT extern int fb_getcursor(struct fb *ifp, int *mode, int *x, int *y);
-FB_EXPORT extern int fb_readrect(struct fb *ifp, int xmin, int ymin, int
width, int height, unsigned char *pp);
-FB_EXPORT extern int fb_writerect(struct fb *ifp, int xmin, int ymin, int
width, int height, const unsigned char *pp);
-FB_EXPORT extern int fb_bwreadrect(struct fb *ifp, int xmin, int ymin, int
width, int height, unsigned char *pp);
-FB_EXPORT extern int fb_bwwriterect(struct fb *ifp, int xmin, int ymin, int
width, int height, const unsigned char *pp);
+FB_EXPORT extern long fb_poll_rate(fb *ifp);
+FB_EXPORT extern int fb_help(fb *ifp);
+FB_EXPORT extern int fb_free(fb *ifp);
+FB_EXPORT extern int fb_clear(fb *ifp, unsigned char *pp);
+FB_EXPORT extern ssize_t fb_read(fb *ifp, int x, int y, unsigned char *pp,
size_t count);
+FB_EXPORT extern ssize_t fb_write(fb *ifp, int x, int y, const unsigned char
*pp, size_t count);
+FB_EXPORT extern int fb_rmap(fb *ifp, ColorMap *cmap);
+FB_EXPORT extern int fb_wmap(fb *ifp, const ColorMap *cmap);
+FB_EXPORT extern int fb_view(fb *ifp, int xcenter, int ycenter, int xzoom, int
yzoom);
+FB_EXPORT extern int fb_getview(fb *ifp, int *xcenter, int *ycenter, int
*xzoom, int *yzoom);
+FB_EXPORT extern int fb_setcursor(fb *ifp, const unsigned char *bits, int xb,
int yb, int xo, int yo);
+FB_EXPORT extern int fb_cursor(fb *ifp, int mode, int x, int y);
+FB_EXPORT extern int fb_getcursor(fb *ifp, int *mode, int *x, int *y);
+FB_EXPORT extern int fb_readrect(fb *ifp, int xmin, int ymin, int width, int
height, unsigned char *pp);
+FB_EXPORT extern int fb_writerect(fb *ifp, int xmin, int ymin, int width, int
height, const unsigned char *pp);
+FB_EXPORT extern int fb_bwreadrect(fb *ifp, int xmin, int ymin, int width, int
height, unsigned char *pp);
+FB_EXPORT extern int fb_bwwriterect(fb *ifp, int xmin, int ymin, int width,
int height, const unsigned char *pp);
-FB_EXPORT extern struct fb *fb_open(const char *file, int _width, int _height);
-FB_EXPORT extern int fb_close(struct fb *ifp);
-FB_EXPORT extern int fb_close_existing(struct fb *ifp);
+FB_EXPORT extern fb *fb_open(const char *file, int _width, int _height);
+FB_EXPORT extern int fb_close(fb *ifp);
+FB_EXPORT extern int fb_close_existing(fb *ifp);
FB_EXPORT extern int fb_genhelp(void);
-FB_EXPORT extern int fb_ioinit(struct fb *ifp);
-FB_EXPORT extern int fb_seek(struct fb *ifp, int x, int y);
-FB_EXPORT extern int fb_tell(struct fb *ifp, int *xp, int *yp);
-FB_EXPORT extern int fb_rpixel(struct fb *ifp, unsigned char *pp);
-FB_EXPORT extern int fb_wpixel(struct fb *ifp, unsigned char *pp);
-FB_EXPORT extern int fb_flush(struct fb *ifp);
-FB_EXPORT extern int fb_configure_window(struct fb *, int, int);
-FB_EXPORT extern int fb_refresh(struct fb *ifp, int x, int y, int w, int h);
+FB_EXPORT extern int fb_ioinit(fb *ifp);
+FB_EXPORT extern int fb_seek(fb *ifp, int x, int y);
+FB_EXPORT extern int fb_tell(fb *ifp, int *xp, int *yp);
+FB_EXPORT extern int fb_rpixel(fb *ifp, unsigned char *pp);
+FB_EXPORT extern int fb_wpixel(fb *ifp, unsigned char *pp);
+FB_EXPORT extern int fb_flush(fb *ifp);
+FB_EXPORT extern int fb_configure_window(fb *, int, int);
+FB_EXPORT extern int fb_refresh(fb *ifp, int x, int y, int w, int h);
#if !defined(_WIN32) || defined(__CYGWIN__)
FB_EXPORT extern void fb_log(const char *fmt, ...) _BU_ATTR_PRINTF12;
#endif
-FB_EXPORT extern int fb_null(struct fb *ifp);
-FB_EXPORT extern int fb_null_setcursor(struct fb *ifp, const unsigned char
*bits, int xbits, int ybits, int xorig, int yorig);
+FB_EXPORT extern int fb_null(fb *ifp);
+FB_EXPORT extern int fb_null_setcursor(fb *ifp, const unsigned char *bits, int
xbits, int ybits, int xorig, int yorig);
/* utility functions */
FB_EXPORT extern int fb_common_file_size(size_t *widthp, size_t *heightp,
const char *filename, int pixel_size);
FB_EXPORT extern int fb_common_image_size(size_t *widthp, size_t *heightp,
size_t npixels);
FB_EXPORT extern int fb_common_name_size(size_t *widthp, size_t *heightp,
const char *name);
-FB_EXPORT extern int fb_write_fp(struct fb *ifp, FILE *fp, int req_width, int
req_height, int crunch, int inverse, struct bu_vls *result);
-FB_EXPORT extern int fb_read_fd(struct fb *ifp, int fd, int file_width, int
file_height, int file_xoff, int file_yoff, int scr_width, int scr_height, int
scr_xoff, int scr_yoff, int fileinput, char *file_name, int one_line_only, int
multiple_lines, int autosize, int inverse, int clear, int zoom, struct bu_vls
*result);
-FB_EXPORT extern int fb_read_png(struct fb *ifp, FILE *fp, int file_xoff, int
file_yoff, int scr_xoff, int scr_yoff, int clear, int zoom, int inverse, int
one_line_only, int multiple_lines, int verbose, int header_only, double
def_screen_gamma, struct bu_vls *result);
+FB_EXPORT extern int fb_write_fp(fb *ifp, FILE *fp, int req_width, int
req_height, int crunch, int inverse, struct bu_vls *result);
+FB_EXPORT extern int fb_read_fd(fb *ifp, int fd, int file_width, int
file_height, int file_xoff, int file_yoff, int scr_width, int scr_height, int
scr_xoff, int scr_yoff, int fileinput, char *file_name, int one_line_only, int
multiple_lines, int autosize, int inverse, int clear, int zoom, struct bu_vls
*result);
+FB_EXPORT extern int fb_read_png(fb *ifp, FILE *fp, int file_xoff, int
file_yoff, int scr_xoff, int scr_yoff, int clear, int zoom, int inverse, int
one_line_only, int multiple_lines, int verbose, int header_only, double
def_screen_gamma, struct bu_vls *result);
-FB_EXPORT extern void fb_set_interface(struct fb *ifp, const char
*interface_type);
-FB_EXPORT extern void fb_set_name(struct fb *ifp, const char *name);
-FB_EXPORT extern char *fb_get_name(struct fb *ifp);
-FB_EXPORT extern void fb_set_magic(struct fb *ifp, uint32_t magic);
-FB_EXPORT extern long fb_get_pagebuffer_pixel_size(struct fb *ifp);
+FB_EXPORT extern void fb_set_interface(fb *ifp, const char *interface_type);
+FB_EXPORT extern void fb_set_name(fb *ifp, const char *name);
+FB_EXPORT extern char *fb_get_name(fb *ifp);
+FB_EXPORT extern void fb_set_magic(fb *ifp, uint32_t magic);
+FB_EXPORT extern long fb_get_pagebuffer_pixel_size(fb *ifp);
-FB_EXPORT extern int fb_is_set_fd(struct fb *ifp, fd_set *infds);
-FB_EXPORT extern int fb_set_fd(struct fb *ifp, fd_set *select_list);
-FB_EXPORT extern int fb_clear_fd(struct fb *ifp, fd_set *select_list);
+FB_EXPORT extern int fb_is_set_fd(fb *ifp, fd_set *infds);
+FB_EXPORT extern int fb_set_fd(fb *ifp, fd_set *select_list);
+FB_EXPORT extern int fb_clear_fd(fb *ifp, fd_set *select_list);
/* color mapping */
FB_EXPORT extern int fb_is_linear_cmap(const ColorMap *cmap);
@@ -171,14 +177,14 @@
struct fb_platform_specific {uint32_t magic; void *data;};
FB_EXPORT extern struct fb_platform_specific
*fb_get_platform_specific(uint32_t magic);
FB_EXPORT extern void fb_put_platform_specific(struct fb_platform_specific
*fb_p);
-FB_EXPORT extern struct fb *fb_open_existing(const char *file, int _width, int
_height, struct fb_platform_specific *fb_p);
+FB_EXPORT extern fb *fb_open_existing(const char *file, int _width, int
_height, struct fb_platform_specific *fb_p);
/* backward compatibility hacks */
-FB_EXPORT extern int fb_reset(struct fb *ifp);
-FB_EXPORT extern int fb_viewport(struct fb *ifp, int left, int top, int right,
int bottom);
-FB_EXPORT extern int fb_window(struct fb *ifp, int xcenter, int ycenter);
-FB_EXPORT extern int fb_zoom(struct fb *ifp, int xzoom, int yzoom);
-FB_EXPORT extern int fb_scursor(struct fb *ifp, int mode, int x, int y);
+FB_EXPORT extern int fb_reset(fb *ifp);
+FB_EXPORT extern int fb_viewport(fb *ifp, int left, int top, int right, int
bottom);
+FB_EXPORT extern int fb_window(fb *ifp, int xcenter, int ycenter);
+FB_EXPORT extern int fb_zoom(fb *ifp, int xzoom, int yzoom);
+FB_EXPORT extern int fb_scursor(fb *ifp, int mode, int x, int y);
/*
* Copy one RGB pixel to another.
@@ -280,7 +286,7 @@
struct fbserv_obj {
- struct fb *fbs_fbp; /**< @brief framebuffer pointer
*/
+ fb *fbs_fbp; /**< @brief framebuffer pointer */
Tcl_Interp *fbs_interp; /**< @brief tcl interpreter */
struct fbserv_listener fbs_listener; /**< @brief data for
listening */
struct fbserv_client fbs_clients[MAX_CLIENTS]; /**< @brief connected
clients */
Modified: brlcad/trunk/include/tclcad.h
===================================================================
--- brlcad/trunk/include/tclcad.h 2020-04-17 16:14:01 UTC (rev 75437)
+++ brlcad/trunk/include/tclcad.h 2020-04-17 16:46:07 UTC (rev 75438)
@@ -94,7 +94,7 @@
struct bu_vls gdv_edit_motion_delta_callback;
struct bu_vls gdv_name;
struct bview *gdv_view;
- struct dm *gdv_dmp;
+ dm *gdv_dmp;
struct fbserv_obj gdv_fbs;
struct ged_obj *gdv_gop;
int gdv_hide_view;
Modified: brlcad/trunk/src/adrt/isst.c
===================================================================
--- brlcad/trunk/src/adrt/isst.c 2020-04-17 16:14:01 UTC (rev 75437)
+++ brlcad/trunk/src/adrt/isst.c 2020-04-17 16:46:07 UTC (rev 75438)
@@ -49,7 +49,7 @@
#include <string.h>
#endif
-static struct dm *dmp;
+static dm *dmp;
struct isst_s {
struct tie_s *tie;
@@ -547,7 +547,7 @@
{
char *av[] = { "Ogl_open", "-t", "0", "-n", ".w0", "-W", "800", "-N",
"600", NULL };
- dmp = dm_open((void *)interp, dm_default_type(),
sizeof(av)/sizeof(void*)-1, (const char **)av);
+ dmp = dm_open(interp, dm_default_type(), sizeof(av)/sizeof(void*)-1,
(const char **)av);
if (dmp == DM_NULL) {
printf("dm failed?\n");
Modified: brlcad/trunk/src/burst/extern.h
===================================================================
--- brlcad/trunk/src/burst/extern.h 2020-04-17 16:14:01 UTC (rev 75437)
+++ brlcad/trunk/src/burst/extern.h 2020-04-17 16:46:07 UTC (rev 75438)
@@ -113,7 +113,7 @@
extern int roundToInt(fastf_t f);
extern Colors colorids;
-extern struct fb *fbiop;
+extern fb *fbiop;
extern FILE *burstfp;
extern FILE *gridfp;
extern FILE *histfp;
Modified: brlcad/trunk/src/burst/glob.c
===================================================================
--- brlcad/trunk/src/burst/glob.c 2020-04-17 16:14:01 UTC (rev 75437)
+++ brlcad/trunk/src/burst/glob.c 2020-04-17 16:46:07 UTC (rev 75438)
@@ -35,7 +35,7 @@
Colors colorids; /* ident range to color mappings for plots */
-struct fb *fbiop = NULL; /* frame buffer specific access from libfb */
+fb *fbiop = NULL; /* frame buffer specific access from libfb */
FILE *burstfp = NULL; /* input stream for burst point locations */
FILE *gridfp = NULL; /* grid file output stream (2-d shots) */
FILE *histfp = NULL; /* histogram output stream (statistics) */
Modified: brlcad/trunk/src/fb/bw-fb.c
===================================================================
--- brlcad/trunk/src/fb/bw-fb.c 2020-04-17 16:14:01 UTC (rev 75437)
+++ brlcad/trunk/src/fb/bw-fb.c 2020-04-17 16:46:07 UTC (rev 75438)
@@ -72,7 +72,7 @@
static char *framebuffer = NULL;
static char *file_name;
static int infd;
-static struct fb *fbp;
+static fb *fbp;
static char usage[] = "\
Usage: bw-fb [-a -i -c -z -R -G -B] [-F framebuffer]\n\
Modified: brlcad/trunk/src/fb/fb-bw.c
===================================================================
--- brlcad/trunk/src/fb/fb-bw.c 2020-04-17 16:14:01 UTC (rev 75437)
+++ brlcad/trunk/src/fb/fb-bw.c 2020-04-17 16:46:07 UTC (rev 75438)
@@ -111,7 +111,7 @@
int
main(int argc, char **argv)
{
- struct fb *fbp;
+ fb *fbp;
int x, y;
int xin, yin; /* number of screen output lines */
Modified: brlcad/trunk/src/fb/fb-fb.c
===================================================================
--- brlcad/trunk/src/fb/fb-fb.c 2020-04-17 16:14:01 UTC (rev 75437)
+++ brlcad/trunk/src/fb/fb-fb.c 2020-04-17 16:46:07 UTC (rev 75438)
@@ -87,7 +87,7 @@
main(int argc, char **argv)
{
int y;
- struct fb *in_fbp, *out_fbp;
+ fb *in_fbp, *out_fbp;
int n, m;
int height;
Modified: brlcad/trunk/src/fb/fb-pix.c
===================================================================
--- brlcad/trunk/src/fb/fb-pix.c 2020-04-17 16:14:01 UTC (rev 75437)
+++ brlcad/trunk/src/fb/fb-pix.c 2020-04-17 16:46:07 UTC (rev 75438)
@@ -109,7 +109,7 @@
int
main(int argc, char **argv)
{
- struct fb *fbp;
+ fb *fbp;
int y;
unsigned char *scanline; /* 1 scanline pixel buffer */
Modified: brlcad/trunk/src/fb/fb-png.c
===================================================================
--- brlcad/trunk/src/fb/fb-png.c 2020-04-17 16:14:01 UTC (rev 75437)
+++ brlcad/trunk/src/fb/fb-png.c 2020-04-17 16:46:07 UTC (rev 75438)
@@ -126,7 +126,7 @@
static int scanpix; /* # of pixels of scanline */
static ColorMap cmap; /* libfb color map */
- struct fb *fbp;
+ fb *fbp;
int y;
int got;
png_structp png_p;
Modified: brlcad/trunk/src/fb/fbcbars.c
===================================================================
--- brlcad/trunk/src/fb/fbcbars.c 2020-04-17 16:14:01 UTC (rev 75437)
+++ brlcad/trunk/src/fb/fbcbars.c 2020-04-17 16:46:07 UTC (rev 75438)
@@ -217,7 +217,7 @@
main(int argc, char **argv)
{
int x, y;
- struct fb *fbp;
+ fb *fbp;
if (argc == 1 && isatty(fileno(stdin)) && isatty(fileno(stdout)))
printusage();
Modified: brlcad/trunk/src/fb/fbclear.c
===================================================================
--- brlcad/trunk/src/fb/fbclear.c 2020-04-17 16:14:01 UTC (rev 75437)
+++ brlcad/trunk/src/fb/fbclear.c 2020-04-17 16:46:07 UTC (rev 75438)
@@ -41,7 +41,7 @@
static char *framebuffer = NULL;
-static struct fb *fbp;
+static fb *fbp;
static int scr_width = 0; /* use default size */
static int scr_height = 0;
static int clear_and_reset = 0;
Modified: brlcad/trunk/src/fb/fbcmap.c
===================================================================
--- brlcad/trunk/src/fb/fbcmap.c 2020-04-17 16:14:01 UTC (rev 75437)
+++ brlcad/trunk/src/fb/fbcmap.c 2020-04-17 16:46:07 UTC (rev 75438)
@@ -652,7 +652,7 @@
int fudge;
ColorMap cmap;
ColorMap *cp = &cmap;
- struct fb *fbp;
+ fb *fbp;
bu_log("DEPRECATION WARNING: This command is scheduled for removal.
Please contact the developers if you use this command.\n\n");
bu_snooze(BU_SEC2USEC(1));
Modified: brlcad/trunk/src/fb/fbcolor.c
===================================================================
--- brlcad/trunk/src/fb/fbcolor.c 2020-04-17 16:14:01 UTC (rev 75437)
+++ brlcad/trunk/src/fb/fbcolor.c 2020-04-17 16:46:07 UTC (rev 75438)
@@ -48,7 +48,7 @@
ColorMap cm;
static char *framebuffer = NULL;
-static struct fb *fbp;
+static fb *fbp;
static int scr_height;
static int scr_width;
Modified: brlcad/trunk/src/fb/fbfade.c
===================================================================
--- brlcad/trunk/src/fb/fbfade.c 2020-04-17 16:14:01 UTC (rev 75437)
+++ brlcad/trunk/src/fb/fbfade.c 2020-04-17 16:46:07 UTC (rev 75438)
@@ -75,7 +75,7 @@
static bool_t hires = 0; /* set for 1024x1024; clear for 512x512
*/
static char *in_fb_file = NULL; /* input image name */
static char *out_fb_file = NULL; /* output frame buffer name */
-static struct fb *fbp = FB_NULL; /* libfb input/output handle */
+static fb *fbp = FB_NULL; /* libfb input/output handle */
static int src_width = 0; /* input image width */
static int src_height = 0; /* input image height */
static int dst_width = 0; /* output frame buffer size */
@@ -85,7 +85,7 @@
/* in ioutil.c */
extern void Message(const char *format, ...);
-extern void Fatal(struct fb *fbiop, const char *format, ...);
+extern void Fatal(fb *fbiop, const char *format, ...);
static void
Modified: brlcad/trunk/src/fb/fbframe.c
===================================================================
--- brlcad/trunk/src/fb/fbframe.c 2020-04-17 16:14:01 UTC (rev 75437)
+++ brlcad/trunk/src/fb/fbframe.c 2020-04-17 16:46:07 UTC (rev 75438)
@@ -44,7 +44,7 @@
{
int c;
int x;
- struct fb *fbp;
+ fb *fbp;
int xsize, ysize;
int len;
char *framebuffer = (char *)NULL;
Modified: brlcad/trunk/src/fb/fbfree.c
===================================================================
--- brlcad/trunk/src/fb/fbfree.c 2020-04-17 16:14:01 UTC (rev 75437)
+++ brlcad/trunk/src/fb/fbfree.c 2020-04-17 16:46:07 UTC (rev 75438)
@@ -42,7 +42,7 @@
main(int argc, char **argv)
{
int c;
- struct fb *fbp;
+ fb *fbp;
while ((c = bu_getopt(argc, argv, "F:h?")) != -1) {
switch (c) {
Modified: brlcad/trunk/src/fb/fbgamma.c
===================================================================
--- brlcad/trunk/src/fb/fbgamma.c 2020-04-17 16:14:01 UTC (rev 75437)
+++ brlcad/trunk/src/fb/fbgamma.c 2020-04-17 16:46:07 UTC (rev 75438)
@@ -50,7 +50,7 @@
static char usage[] = "\
Usage: fbgamma [-H -o -i] [-F framebuffer] val [gval bval]\n";
-void mk_ramp(struct fb *fb_i, int r, int g, int b, int n)
+void mk_ramp(fb *fb_i, int r, int g, int b, int n)
{
/* grey ramp */
@@ -81,7 +81,7 @@
}
-void disp_image(struct fb *fb_i)
+void disp_image(fb *fb_i)
{
scr_width = fb_getwidth(fb_i);
@@ -116,7 +116,7 @@
double gamr = 0, gamg = 0, gamb = 0; /* gamma's */
double f;
ColorMap cm;
- struct fb *fbp;
+ fb *fbp;
onegamma = 0;
Modified: brlcad/trunk/src/fb/fbgrid.c
===================================================================
--- brlcad/trunk/src/fb/fbgrid.c 2020-04-17 16:14:01 UTC (rev 75437)
+++ brlcad/trunk/src/fb/fbgrid.c 2020-04-17 16:46:07 UTC (rev 75438)
@@ -33,7 +33,7 @@
static unsigned char *white_line, *grey_line, *dark_line;
-static struct fb *fbp;
+static fb *fbp;
static char *framebuffer = NULL;
#define OLD 0
@@ -45,7 +45,7 @@
static int flavor = DECIMAL;
static int clear = 0;
-void grid(struct fb *fbiop, unsigned char *line, int spacing), oldflavor(void);
+void grid(fb *fbiop, unsigned char *line, int spacing), oldflavor(void);
static char usage[] = "\
Usage: fbgrid [-c] [-b | -d | -o] [-F framebuffer]\n\
@@ -157,7 +157,7 @@
void
-grid(struct fb *fbiop, unsigned char *line, int spacing)
+grid(fb *fbiop, unsigned char *line, int spacing)
{
int x, y;
@@ -172,7 +172,7 @@
void
oldflavor(void)
{
- struct fb *fbiop;
+ fb *fbiop;
int x, y;
int middle;
int mask;
Modified: brlcad/trunk/src/fb/fbhelp.c
===================================================================
--- brlcad/trunk/src/fb/fbhelp.c 2020-04-17 16:14:01 UTC (rev 75437)
+++ brlcad/trunk/src/fb/fbhelp.c 2020-04-17 16:46:07 UTC (rev 75438)
@@ -42,7 +42,7 @@
main(int argc, char **argv)
{
int c;
- struct fb *fbp;
+ fb *fbp;
while ((c = bu_getopt(argc, argv, "F:h?")) != -1) {
switch (c) {
Modified: brlcad/trunk/src/fb/fblabel.c
===================================================================
--- brlcad/trunk/src/fb/fblabel.c 2020-04-17 16:14:01 UTC (rev 75437)
+++ brlcad/trunk/src/fb/fblabel.c 2020-04-17 16:46:07 UTC (rev 75438)
@@ -44,7 +44,7 @@
static char *framebuffer = NULL;
static char *font1 = NULL;
-struct fb *fbp;
+fb *fbp;
static char usage[] = "\
Usage: fblabel [-c -a] [-F framebuffer] [-C r/g/b]\n\
Modified: brlcad/trunk/src/fb/fbline.c
===================================================================
--- brlcad/trunk/src/fb/fbline.c 2020-04-17 16:14:01 UTC (rev 75437)
+++ brlcad/trunk/src/fb/fbline.c 2020-04-17 16:46:07 UTC (rev 75438)
@@ -59,7 +59,7 @@
}; /* rasterization descriptor */
static char *framebuffer = NULL;
-struct fb *fbp; /* Current framebuffer */
+fb *fbp; /* Current framebuffer */
static int screen_width = 512; /* default input width */
static int screen_height = 512; /* default input height */
Modified: brlcad/trunk/src/fb/fbpoint.c
===================================================================
--- brlcad/trunk/src/fb/fbpoint.c 2020-04-17 16:14:01 UTC (rev 75437)
+++ brlcad/trunk/src/fb/fbpoint.c 2020-04-17 16:46:07 UTC (rev 75438)
@@ -38,7 +38,7 @@
#include "libtermio.h"
-struct fb *fbp;
+fb *fbp;
int JumpSpeed; /* # pixels skipped with fast commands. */
Modified: brlcad/trunk/src/fb/fbstretch.c
===================================================================
--- brlcad/trunk/src/fb/fbstretch.c 2020-04-17 16:14:01 UTC (rev 75437)
+++ brlcad/trunk/src/fb/fbstretch.c 2020-04-17 16:46:07 UTC (rev 75438)
@@ -100,9 +100,9 @@
static bool_t x_compress; /* set if compressing horizontally */
static bool_t y_compress; /* set if compressing vertically */
static char *src_file = NULL; /* source frame buffer name */
-static struct fb *src_fbp = FB_NULL; /* source frame buffer handle */
+static fb *src_fbp = FB_NULL; /* source frame buffer handle */
static char *dst_file = NULL; /* destination frame buffer name */
-static struct fb *dst_fbp = FB_NULL; /* destination frame buffer handle */
+static fb *dst_fbp = FB_NULL; /* destination frame buffer handle */
static int src_width = 512;
static int src_height = 512; /* source image size */
static int dst_width = 0;
@@ -112,7 +112,7 @@
/* in ioutil.c */
extern void Message(const char *format, ...);
-extern void Fatal(struct fb *fbiop, const char *format, ...);
+extern void Fatal(fb *fbiop, const char *format, ...);
static void
@@ -188,11 +188,11 @@
sample = 1;
break;
- case 'f': /* -f in_struct fb */
+ case 'f': /* -f in_fb */
src_file = bu_optarg;
break;
- case 'F': /* -F out_struct fb */
+ case 'F': /* -F out_fb */
dst_file = bu_optarg;
break;
Modified: brlcad/trunk/src/fb/fbzoom.c
===================================================================
--- brlcad/trunk/src/fb/fbzoom.c 2020-04-17 16:14:01 UTC (rev 75437)
+++ brlcad/trunk/src/fb/fbzoom.c 2020-04-17 16:46:07 UTC (rev 75438)
@@ -61,7 +61,7 @@
static int scr_height = 512;
static int toggle_pan = 0; /* Reverse sense of pan commands? */
static char *framebuffer = NULL;
-static struct fb *fbp;
+static fb *fbp;
static char usage[] = "\
Usage: fbzoom [-T] [-F framebuffer]\n\
Modified: brlcad/trunk/src/fb/gif-fb.c
===================================================================
--- brlcad/trunk/src/fb/gif-fb.c 2020-04-17 16:14:01 UTC (rev 75437)
+++ brlcad/trunk/src/fb/gif-fb.c 2020-04-17 16:46:07 UTC (rev 75438)
@@ -94,7 +94,7 @@
static char *gif_file = NULL; /* GIF file name */
static FILE *gfp = NULL; /* GIF input stream handle */
static char *fb_file = NULL; /* frame buffer name */
-static struct fb *fbp = FB_NULL; /* frame buffer handle */
+static fb *fbp = FB_NULL; /* frame buffer handle */
static int ht; /* virtual frame buffer height */
static int width, height; /* overall "screen" size */
static int write_width; /* used width of screen, <= width */
@@ -117,7 +117,7 @@
/* in ioutil.c */
void Message(const char *format, ...);
-void Fatal(struct fb *fbiop, const char *format, ...);
+void Fatal(fb *fbiop, const char *format, ...);
static void
Modified: brlcad/trunk/src/fb/gif2fb.c
===================================================================
--- brlcad/trunk/src/fb/gif2fb.c 2020-04-17 16:14:01 UTC (rev 75437)
+++ brlcad/trunk/src/fb/gif2fb.c 2020-04-17 16:46:07 UTC (rev 75438)
@@ -126,7 +126,7 @@
static int lace[4] = {8, 8, 4, 2};
static int offs[4] = {0, 4, 2, 1};
- struct fb *fbp;
+ fb *fbp;
FILE *fp;
while ((code = bu_getopt(argc, argv, "HvFh?")) != -1) {
Modified: brlcad/trunk/src/fb/ioutil.c
===================================================================
--- brlcad/trunk/src/fb/ioutil.c 2020-04-17 16:14:01 UTC (rev 75437)
+++ brlcad/trunk/src/fb/ioutil.c 2020-04-17 16:46:07 UTC (rev 75438)
@@ -62,7 +62,7 @@
void
-Fatal(struct fb *fbp, const char *format, ...)
+Fatal(fb *fbp, const char *format, ...)
{
va_list ap;
Modified: brlcad/trunk/src/fb/pix-fb.c
===================================================================
--- brlcad/trunk/src/fb/pix-fb.c 2020-04-17 16:14:01 UTC (rev 75437)
+++ brlcad/trunk/src/fb/pix-fb.c 2020-04-17 16:46:07 UTC (rev 75438)
@@ -211,7 +211,7 @@
main(int argc, char **argv)
{
int y;
- struct fb *fbp;
+ fb *fbp;
int xout, yout, n, m, xstart, xskip;
if (!get_args(argc, argv)) {
Modified: brlcad/trunk/src/fb/plot3-fb.c
===================================================================
--- brlcad/trunk/src/fb/plot3-fb.c 2020-04-17 16:14:01 UTC (rev 75437)
+++ brlcad/trunk/src/fb/plot3-fb.c 2020-04-17 16:46:07 UTC (rev 75438)
@@ -317,7 +317,7 @@
static FILE *pfin; /* input file FIO block ptr */
-struct fb *fbp; /* Current framebuffer */
+fb *fbp; /* Current framebuffer */
/*
Modified: brlcad/trunk/src/fb/png-fb.c
===================================================================
--- brlcad/trunk/src/fb/png-fb.c 2020-04-17 16:14:01 UTC (rev 75437)
+++ brlcad/trunk/src/fb/png-fb.c 2020-04-17 16:46:07 UTC (rev 75438)
@@ -161,7 +161,7 @@
main(int argc, char **argv)
{
int y;
- struct fb *fbp;
+ fb *fbp;
int i;
int xout, yout, m, xstart;
png_structp png_p;
Modified: brlcad/trunk/src/fb/spm-fb.c
===================================================================
--- brlcad/trunk/src/fb/spm-fb.c 2020-04-17 16:14:01 UTC (rev 75437)
+++ brlcad/trunk/src/fb/spm-fb.c 2020-04-17 16:46:07 UTC (rev 75438)
@@ -33,7 +33,7 @@
#include "bn/spm.h"
-static struct fb *fbp;
+static fb *fbp;
static char *framebuffer = NULL;
static int scr_width = 0;
Modified: brlcad/trunk/src/fb/tests/fbthreadtest.c
===================================================================
--- brlcad/trunk/src/fb/tests/fbthreadtest.c 2020-04-17 16:14:01 UTC (rev
75437)
+++ brlcad/trunk/src/fb/tests/fbthreadtest.c 2020-04-17 16:46:07 UTC (rev
75438)
@@ -191,8 +191,8 @@
bu_exit(1, NULL);
}
- struct fb *ifp;
- ifp = (struct fb *) calloc(sizeof(struct fb), 1);
+ fb *ifp;
+ ifp = (fb *) calloc(sizeof(fb), 1);
ifp->if_name = "/dev/tk";
ifp->if_magic = FB_MAGIC;
char *fbname = "/dev/tk";
Modified: brlcad/trunk/src/fbserv/fbserv.c
===================================================================
--- brlcad/trunk/src/fbserv/fbserv.c 2020-04-17 16:14:01 UTC (rev 75437)
+++ brlcad/trunk/src/fbserv/fbserv.c 2020-04-17 16:46:07 UTC (rev 75438)
@@ -109,7 +109,7 @@
/* from server.c */
extern const struct pkg_switch fb_server_pkg_switch[];
-extern struct fb *fb_server_fbp;
+extern fb *fb_server_fbp;
extern fd_set *fb_server_select_list;
extern int *fb_server_max_fd;
extern int fb_server_got_fb_free; /* !0 => we have received an fb_free */
Modified: brlcad/trunk/src/fbserv/server.c
===================================================================
--- brlcad/trunk/src/fbserv/server.c 2020-04-17 16:14:01 UTC (rev 75437)
+++ brlcad/trunk/src/fbserv/server.c 2020-04-17 16:46:07 UTC (rev 75438)
@@ -48,7 +48,7 @@
* These are the only symbols intended for export to LIBFB users.
*/
-struct fb *fb_server_fbp = FB_NULL;
+fb *fb_server_fbp = FB_NULL;
fd_set *fb_server_select_list;
int *fb_server_max_fd = (int *)NULL;
int fb_server_got_fb_free = 0; /* !0 => we have received an fb_free */
Modified: brlcad/trunk/src/libdm/CMakeLists.txt
===================================================================
--- brlcad/trunk/src/libdm/CMakeLists.txt 2020-04-17 16:14:01 UTC (rev
75437)
+++ brlcad/trunk/src/libdm/CMakeLists.txt 2020-04-17 16:46:07 UTC (rev
75438)
@@ -88,6 +88,7 @@
${dmw32_srcs}
${dmogl_srcs}
${dmosg_srcs}
+ ${dmrtgl_srcs}
${dmtk_srcs}
${dmqt_srcs}
adc.c
@@ -149,7 +150,6 @@
dm-wgl.c
dm-wgl.h
dm_private.h
- dm_xvars.h
fontstash/LICENSE.fontstash
fontstash/README.md
fontstash/fontstash.h
@@ -157,7 +157,6 @@
fontstash/stb_truetype.h
osg-test.cpp
osg_bob.cpp
- include/calltable.h
)
CMAKEFILES(${libdm_ignore_files})
CMAKEFILES(dm_private.h)
Modified: brlcad/trunk/src/libdm/adc.c
===================================================================
--- brlcad/trunk/src/libdm/adc.c 2020-04-17 16:14:01 UTC (rev 75437)
+++ brlcad/trunk/src/libdm/adc.c 2020-04-17 16:46:07 UTC (rev 75438)
@@ -34,7 +34,7 @@
#include "dm_private.h"
static void
-dm_draw_ticks(struct dm *dmp, struct bview_adc_state *adcp, fastf_t angle)
+dm_draw_ticks(dm *dmp, struct bview_adc_state *adcp, fastf_t angle)
{
fastf_t c_tdist;
fastf_t d1, d2;
@@ -61,8 +61,8 @@
y2 = adcp->dv_y + d2 + t2;
if (bn_lseg_clip(&x1, &Y1, &x2, &y2, DM_MIN, DM_MAX) == 0) {
dm_draw_line_2d(dmp,
- GED_TO_PM1(x1), GED_TO_PM1(Y1) * dmp->i->dm_aspect,
- GED_TO_PM1(x2), GED_TO_PM1(y2) * dmp->i->dm_aspect);
+ GED_TO_PM1(x1), GED_TO_PM1(Y1) * dmp->dm_aspect,
+ GED_TO_PM1(x2), GED_TO_PM1(y2) * dmp->dm_aspect);
}
/* Quadrant 2 */
@@ -72,8 +72,8 @@
y2 = adcp->dv_y + d1 - t1;
if (bn_lseg_clip(&x1, &Y1, &x2, &y2, DM_MIN, DM_MAX) == 0) {
dm_draw_line_2d(dmp,
- GED_TO_PM1(x1), GED_TO_PM1(Y1) * dmp->i->dm_aspect,
- GED_TO_PM1(x2), GED_TO_PM1(y2) * dmp->i->dm_aspect);
+ GED_TO_PM1(x1), GED_TO_PM1(Y1) * dmp->dm_aspect,
+ GED_TO_PM1(x2), GED_TO_PM1(y2) * dmp->dm_aspect);
}
/* Quadrant 3 */
@@ -83,8 +83,8 @@
y2 = adcp->dv_y - d2 - t2;
if (bn_lseg_clip(&x1, &Y1, &x2, &y2, DM_MIN, DM_MAX) == 0) {
dm_draw_line_2d(dmp,
- GED_TO_PM1(x1), GED_TO_PM1(Y1) * dmp->i->dm_aspect,
- GED_TO_PM1(x2), GED_TO_PM1(y2) * dmp->i->dm_aspect);
+ GED_TO_PM1(x1), GED_TO_PM1(Y1) * dmp->dm_aspect,
+ GED_TO_PM1(x2), GED_TO_PM1(y2) * dmp->dm_aspect);
}
/* Quadrant 4 */
@@ -94,8 +94,8 @@
y2 = adcp->dv_y - d1 + t1;
if (bn_lseg_clip(&x1, &Y1, &x2, &y2, DM_MIN, DM_MAX) == 0) {
dm_draw_line_2d(dmp,
- GED_TO_PM1(x1), GED_TO_PM1(Y1) * dmp->i->dm_aspect,
- GED_TO_PM1(x2), GED_TO_PM1(y2) * dmp->i->dm_aspect);
+ GED_TO_PM1(x1), GED_TO_PM1(Y1) * dmp->dm_aspect,
+ GED_TO_PM1(x2), GED_TO_PM1(y2) * dmp->dm_aspect);
}
}
@@ -104,7 +104,7 @@
* Compute and display the angle/distance cursor.
*/
void
-dm_draw_adc(struct dm *dmp, struct bview_adc_state *adcp, mat_t view2model,
mat_t model2view)
+dm_draw_adc(dm *dmp, struct bview_adc_state *adcp, mat_t view2model, mat_t
model2view)
{
fastf_t x1, Y1; /* not "y1", due to conflict with math lib */
fastf_t x2, y2;
@@ -175,8 +175,8 @@
/* Horizontal */
dm_draw_line_2d(dmp,
- GED_TO_PM1(GED_MIN), GED_TO_PM1(adcp->dv_y) *
dmp->i->dm_aspect,
- GED_TO_PM1(GED_MAX), GED_TO_PM1(adcp->dv_y) *
dmp->i->dm_aspect);
+ GED_TO_PM1(GED_MIN), GED_TO_PM1(adcp->dv_y) *
dmp->dm_aspect,
+ GED_TO_PM1(GED_MAX), GED_TO_PM1(adcp->dv_y) *
dmp->dm_aspect);
/* Vertical */
dm_draw_line_2d(dmp,
@@ -200,11 +200,11 @@
y4 = adcp->dv_y + d1;
dm_draw_line_2d(dmp,
- GED_TO_PM1(x1), GED_TO_PM1(Y1) * dmp->i->dm_aspect,
- GED_TO_PM1(x2), GED_TO_PM1(y2) * dmp->i->dm_aspect);
+ GED_TO_PM1(x1), GED_TO_PM1(Y1) * dmp->dm_aspect,
+ GED_TO_PM1(x2), GED_TO_PM1(y2) * dmp->dm_aspect);
dm_draw_line_2d(dmp,
- GED_TO_PM1(x3), GED_TO_PM1(y3) * dmp->i->dm_aspect,
- GED_TO_PM1(x4), GED_TO_PM1(y4) * dmp->i->dm_aspect);
+ GED_TO_PM1(x3), GED_TO_PM1(y3) * dmp->dm_aspect,
+ GED_TO_PM1(x4), GED_TO_PM1(y4) * dmp->dm_aspect);
d1 = cos(angle2) * 8000.0;
d2 = sin(angle2) * 8000.0;
@@ -220,11 +220,11 @@
dm_set_line_attr(dmp, adcp->line_width, 1);
dm_draw_line_2d(dmp,
- GED_TO_PM1(x1), GED_TO_PM1(Y1) * dmp->i->dm_aspect,
- GED_TO_PM1(x2), GED_TO_PM1(y2) * dmp->i->dm_aspect);
+ GED_TO_PM1(x1), GED_TO_PM1(Y1) * dmp->dm_aspect,
+ GED_TO_PM1(x2), GED_TO_PM1(y2) * dmp->dm_aspect);
dm_draw_line_2d(dmp,
- GED_TO_PM1(x3), GED_TO_PM1(y3) * dmp->i->dm_aspect,
- GED_TO_PM1(x4), GED_TO_PM1(y4) * dmp->i->dm_aspect);
+ GED_TO_PM1(x3), GED_TO_PM1(y3) * dmp->dm_aspect,
+ GED_TO_PM1(x4), GED_TO_PM1(y4) * dmp->dm_aspect);
dm_set_line_attr(dmp, adcp->line_width, 0);
dm_set_fg(dmp,
Modified: brlcad/trunk/src/libdm/axes.c
===================================================================
--- brlcad/trunk/src/libdm/axes.c 2020-04-17 16:14:01 UTC (rev 75437)
+++ brlcad/trunk/src/libdm/axes.c 2020-04-17 16:46:07 UTC (rev 75438)
@@ -43,7 +43,7 @@
#endif
void
-dm_draw_data_axes(struct dm *dmp,
+dm_draw_data_axes(dm *dmp,
fastf_t sf,
struct bview_data_axes_state *bndasp)
{
@@ -53,8 +53,8 @@
int npoints = bndasp->num_points * 6;
point_t *points;
/* Save the line attributes */
- int saveLineWidth = dmp->i->dm_lineWidth;
- int saveLineStyle = dmp->i->dm_lineStyle;
+ int saveLineWidth = dmp->dm_lineWidth;
+ int saveLineStyle = dmp->dm_lineStyle;
if (npoints < 1)
return;
@@ -64,7 +64,7 @@
#if defined(IF_OGL) || defined(IF_WGL)
if (bndasp->draw > 1) {
- if (dmp->i->dm_light)
+ if (dmp->dm_light)
glDisable(GL_LIGHTING);
glPointSize(bndasp->size);
@@ -71,7 +71,7 @@
dm_draw_points_3d(dmp, bndasp->num_points, bndasp->points);
glPointSize(1);
- if (dmp->i->dm_light)
+ if (dmp->dm_light)
glEnable(GL_LIGHTING);
return;
@@ -118,7 +118,7 @@
}
void
-dm_draw_axes(struct dm *dmp,
+dm_draw_axes(dm *dmp,
fastf_t viewSize, /* in mm */
const mat_t rmat, /* view rotation matrix */
struct bview_axes_state *bnasp)
@@ -134,8 +134,8 @@
point_t rzv1, rzv2;
point_t o_rv2;
/* Save the line attributes */
- int saveLineWidth = dmp->i->dm_lineWidth;
- int saveLineStyle = dmp->i->dm_lineStyle;
+ int saveLineWidth = dmp->dm_lineWidth;
+ int saveLineStyle = dmp->dm_lineStyle;
halfAxesSize = bnasp->axes_size * 0.5;
@@ -170,8 +170,8 @@
dm_set_fg(dmp, bnasp->axes_color[0], bnasp->axes_color[1],
bnasp->axes_color[2], 1, 1.0);
/* draw X axis with x/y offsets */
- dm_draw_line_2d(dmp, rxv1[X] + bnasp->axes_pos[X], (rxv1[Y] +
bnasp->axes_pos[Y]) * dmp->i->dm_aspect,
- rxv2[X] + bnasp->axes_pos[X], (rxv2[Y] +
bnasp->axes_pos[Y]) * dmp->i->dm_aspect);
+ dm_draw_line_2d(dmp, rxv1[X] + bnasp->axes_pos[X], (rxv1[Y] +
bnasp->axes_pos[Y]) * dmp->dm_aspect,
+ rxv2[X] + bnasp->axes_pos[X], (rxv2[Y] +
bnasp->axes_pos[Y]) * dmp->dm_aspect);
/* build Y axis about view center */
VSET(v2, 0.0, halfAxesSize, 0.0);
@@ -199,8 +199,8 @@
}
/* draw Y axis with x/y offsets */
- dm_draw_line_2d(dmp, ryv1[X] + bnasp->axes_pos[X], (ryv1[Y] +
bnasp->axes_pos[Y]) * dmp->i->dm_aspect,
- ryv2[X] + bnasp->axes_pos[X], (ryv2[Y] +
bnasp->axes_pos[Y]) * dmp->i->dm_aspect);
+ dm_draw_line_2d(dmp, ryv1[X] + bnasp->axes_pos[X], (ryv1[Y] +
bnasp->axes_pos[Y]) * dmp->dm_aspect,
+ ryv2[X] + bnasp->axes_pos[X], (ryv2[Y] +
bnasp->axes_pos[Y]) * dmp->dm_aspect);
/* build Z axis about view center */
VSET(v2, 0.0, 0.0, halfAxesSize);
@@ -228,8 +228,8 @@
}
/* draw Z axis with x/y offsets */
- dm_draw_line_2d(dmp, rzv1[X] + bnasp->axes_pos[X], (rzv1[Y] +
bnasp->axes_pos[Y]) * dmp->i->dm_aspect,
- rzv2[X] + bnasp->axes_pos[X], (rzv2[Y] +
bnasp->axes_pos[Y]) * dmp->i->dm_aspect);
+ dm_draw_line_2d(dmp, rzv1[X] + bnasp->axes_pos[X], (rzv1[Y] +
bnasp->axes_pos[Y]) * dmp->dm_aspect,
+ rzv2[X] + bnasp->axes_pos[X], (rzv2[Y] +
bnasp->axes_pos[Y]) * dmp->dm_aspect);
if (!bnasp->triple_color) {
/* set axes string color */
@@ -260,10 +260,10 @@
vect_t maj_yend1, maj_yend2;
vect_t maj_zend1, maj_zend2;
- if (dmp->i->dm_width <= numTicks / halfAxesSize * bnasp->tick_threshold
* 2) {
+ if (dmp->dm_width <= numTicks / halfAxesSize * bnasp->tick_threshold *
2) {
int numMajorTicks = numTicks / bnasp->ticks_per_major;
- if (dmp->i->dm_width <= numMajorTicks / halfAxesSize *
bnasp->tick_threshold * 2) {
+ if (dmp->dm_width <= numMajorTicks / halfAxesSize *
bnasp->tick_threshold * 2) {
/* Restore the line attributes */
dm_set_line_attr(dmp, saveLineWidth, saveLineStyle);
return;
@@ -276,10 +276,10 @@
interval = bnasp->tick_interval / viewSize * 2.0;
/* convert tick length in pixels to view space */
- tlen = bnasp->tick_length / (fastf_t)dmp->i->dm_width * 2.0;
+ tlen = bnasp->tick_length / (fastf_t)dmp->dm_width * 2.0;
/* convert major tick length in pixels to view space */
- maj_tlen = bnasp->tick_major_length / (fastf_t)dmp->i->dm_width * 2.0;
+ maj_tlen = bnasp->tick_major_length / (fastf_t)dmp->dm_width * 2.0;
if (!doMajorOnly) {
/* calculate end points for x ticks */
@@ -360,8 +360,8 @@
VADD2(t1, maj_yend1, tvec);
VADD2(t2, maj_yend2, tvec);
}
- dm_draw_line_2d(dmp, t1[X] + bnasp->axes_pos[X], (t1[Y] +
bnasp->axes_pos[Y]) * dmp->i->dm_aspect,
- t2[X] + bnasp->axes_pos[X], (t2[Y] +
bnasp->axes_pos[Y]) * dmp->i->dm_aspect);
+ dm_draw_line_2d(dmp, t1[X] + bnasp->axes_pos[X], (t1[Y] +
bnasp->axes_pos[Y]) * dmp->dm_aspect,
+ t2[X] + bnasp->axes_pos[X], (t2[Y] +
bnasp->axes_pos[Y]) * dmp->dm_aspect);
/* draw tick in XZ plane */
if (notMajor) {
@@ -371,8 +371,8 @@
VADD2(t1, maj_zend1, tvec);
VADD2(t2, maj_zend2, tvec);
}
- dm_draw_line_2d(dmp, t1[X] + bnasp->axes_pos[X], (t1[Y] +
bnasp->axes_pos[Y]) * dmp->i->dm_aspect,
- t2[X] + bnasp->axes_pos[X], (t2[Y] +
bnasp->axes_pos[Y]) * dmp->i->dm_aspect);
+ dm_draw_line_2d(dmp, t1[X] + bnasp->axes_pos[X], (t1[Y] +
bnasp->axes_pos[Y]) * dmp->dm_aspect,
+ t2[X] + bnasp->axes_pos[X], (t2[Y] +
bnasp->axes_pos[Y]) * dmp->dm_aspect);
if (!bnasp->pos_only) {
/* negative X direction */
@@ -386,8 +386,8 @@
VADD2(t1, maj_yend1, tvec);
VADD2(t2, maj_yend2, tvec);
}
- dm_draw_line_2d(dmp, t1[X] + bnasp->axes_pos[X], (t1[Y] +
bnasp->axes_pos[Y]) * dmp->i->dm_aspect,
- t2[X] + bnasp->axes_pos[X], (t2[Y] +
bnasp->axes_pos[Y]) * dmp->i->dm_aspect);
+ dm_draw_line_2d(dmp, t1[X] + bnasp->axes_pos[X], (t1[Y] +
bnasp->axes_pos[Y]) * dmp->dm_aspect,
+ t2[X] + bnasp->axes_pos[X], (t2[Y] +
bnasp->axes_pos[Y]) * dmp->dm_aspect);
/* draw tick in XZ plane */
if (notMajor) {
@@ -397,8 +397,8 @@
VADD2(t1, maj_zend1, tvec);
VADD2(t2, maj_zend2, tvec);
}
- dm_draw_line_2d(dmp, t1[X] + bnasp->axes_pos[X], (t1[Y] +
bnasp->axes_pos[Y]) * dmp->i->dm_aspect,
- t2[X] + bnasp->axes_pos[X], (t2[Y] +
bnasp->axes_pos[Y]) * dmp->i->dm_aspect);
+ dm_draw_line_2d(dmp, t1[X] + bnasp->axes_pos[X], (t1[Y] +
bnasp->axes_pos[Y]) * dmp->dm_aspect,
+ t2[X] + bnasp->axes_pos[X], (t2[Y] +
bnasp->axes_pos[Y]) * dmp->dm_aspect);
}
/********* draw ticks along Y *********/
@@ -413,8 +413,8 @@
VADD2(t1, maj_xend1, tvec);
VADD2(t2, maj_xend2, tvec);
}
- dm_draw_line_2d(dmp, t1[X] + bnasp->axes_pos[X], (t1[Y] +
bnasp->axes_pos[Y]) * dmp->i->dm_aspect,
- t2[X] + bnasp->axes_pos[X], (t2[Y] +
bnasp->axes_pos[Y]) * dmp->i->dm_aspect);
+ dm_draw_line_2d(dmp, t1[X] + bnasp->axes_pos[X], (t1[Y] +
bnasp->axes_pos[Y]) * dmp->dm_aspect,
+ t2[X] + bnasp->axes_pos[X], (t2[Y] +
bnasp->axes_pos[Y]) * dmp->dm_aspect);
/* draw tick in YZ plane */
if (notMajor) {
@@ -424,8 +424,8 @@
VADD2(t1, maj_zend1, tvec);
VADD2(t2, maj_zend2, tvec);
}
- dm_draw_line_2d(dmp, t1[X] + bnasp->axes_pos[X], (t1[Y] +
bnasp->axes_pos[Y]) * dmp->i->dm_aspect,
- t2[X] + bnasp->axes_pos[X], (t2[Y] +
bnasp->axes_pos[Y]) * dmp->i->dm_aspect);
+ dm_draw_line_2d(dmp, t1[X] + bnasp->axes_pos[X], (t1[Y] +
bnasp->axes_pos[Y]) * dmp->dm_aspect,
+ t2[X] + bnasp->axes_pos[X], (t2[Y] +
bnasp->axes_pos[Y]) * dmp->dm_aspect);
if (!bnasp->pos_only) {
/* negative Y direction */
@@ -439,8 +439,8 @@
VADD2(t1, maj_xend1, tvec);
VADD2(t2, maj_xend2, tvec);
}
- dm_draw_line_2d(dmp, t1[X] + bnasp->axes_pos[X], (t1[Y] +
bnasp->axes_pos[Y]) * dmp->i->dm_aspect,
- t2[X] + bnasp->axes_pos[X], (t2[Y] +
bnasp->axes_pos[Y]) * dmp->i->dm_aspect);
+ dm_draw_line_2d(dmp, t1[X] + bnasp->axes_pos[X], (t1[Y] +
bnasp->axes_pos[Y]) * dmp->dm_aspect,
+ t2[X] + bnasp->axes_pos[X], (t2[Y] +
bnasp->axes_pos[Y]) * dmp->dm_aspect);
/* draw tick in XZ plane */
if (notMajor) {
@@ -450,8 +450,8 @@
VADD2(t1, maj_zend1, tvec);
VADD2(t2, maj_zend2, tvec);
}
- dm_draw_line_2d(dmp, t1[X] + bnasp->axes_pos[X], (t1[Y] +
bnasp->axes_pos[Y]) * dmp->i->dm_aspect,
- t2[X] + bnasp->axes_pos[X], (t2[Y] +
bnasp->axes_pos[Y]) * dmp->i->dm_aspect);
+ dm_draw_line_2d(dmp, t1[X] + bnasp->axes_pos[X], (t1[Y] +
bnasp->axes_pos[Y]) * dmp->dm_aspect,
+ t2[X] + bnasp->axes_pos[X], (t2[Y] +
bnasp->axes_pos[Y]) * dmp->dm_aspect);
}
/********* draw ticks along Z *********/
@@ -466,8 +466,8 @@
VADD2(t1, maj_xend1, tvec);
VADD2(t2, maj_xend2, tvec);
}
- dm_draw_line_2d(dmp, t1[X] + bnasp->axes_pos[X], (t1[Y] +
bnasp->axes_pos[Y]) * dmp->i->dm_aspect,
- t2[X] + bnasp->axes_pos[X], (t2[Y] +
bnasp->axes_pos[Y]) * dmp->i->dm_aspect);
+ dm_draw_line_2d(dmp, t1[X] + bnasp->axes_pos[X], (t1[Y] +
bnasp->axes_pos[Y]) * dmp->dm_aspect,
+ t2[X] + bnasp->axes_pos[X], (t2[Y] +
bnasp->axes_pos[Y]) * dmp->dm_aspect);
/* draw tick in ZY plane */
if (notMajor) {
@@ -477,8 +477,8 @@
VADD2(t1, maj_yend1, tvec);
VADD2(t2, maj_yend2, tvec);
}
- dm_draw_line_2d(dmp, t1[X] + bnasp->axes_pos[X], (t1[Y] +
bnasp->axes_pos[Y]) * dmp->i->dm_aspect,
- t2[X] + bnasp->axes_pos[X], (t2[Y] +
bnasp->axes_pos[Y]) * dmp->i->dm_aspect);
+ dm_draw_line_2d(dmp, t1[X] + bnasp->axes_pos[X], (t1[Y] +
bnasp->axes_pos[Y]) * dmp->dm_aspect,
+ t2[X] + bnasp->axes_pos[X], (t2[Y] +
bnasp->axes_pos[Y]) * dmp->dm_aspect);
if (!bnasp->pos_only) {
/* negative Z direction */
@@ -492,8 +492,8 @@
VADD2(t1, maj_xend1, tvec);
VADD2(t2, maj_xend2, tvec);
}
- dm_draw_line_2d(dmp, t1[X] + bnasp->axes_pos[X], (t1[Y] +
bnasp->axes_pos[Y]) * dmp->i->dm_aspect,
- t2[X] + bnasp->axes_pos[X], (t2[Y] +
bnasp->axes_pos[Y]) * dmp->i->dm_aspect);
+ dm_draw_line_2d(dmp, t1[X] + bnasp->axes_pos[X], (t1[Y] +
bnasp->axes_pos[Y]) * dmp->dm_aspect,
+ t2[X] + bnasp->axes_pos[X], (t2[Y] +
bnasp->axes_pos[Y]) * dmp->dm_aspect);
/* draw tick in ZY plane */
if (notMajor) {
@@ -503,8 +503,8 @@
VADD2(t1, maj_yend1, tvec);
VADD2(t2, maj_yend2, tvec);
}
- dm_draw_line_2d(dmp, t1[X] + bnasp->axes_pos[X], (t1[Y] +
bnasp->axes_pos[Y]) * dmp->i->dm_aspect,
- t2[X] + bnasp->axes_pos[X], (t2[Y] +
bnasp->axes_pos[Y]) * dmp->i->dm_aspect);
+ dm_draw_line_2d(dmp, t1[X] + bnasp->axes_pos[X], (t1[Y] +
bnasp->axes_pos[Y]) * dmp->dm_aspect,
+ t2[X] + bnasp->axes_pos[X], (t2[Y] +
bnasp->axes_pos[Y]) * dmp->dm_aspect);
}
}
}
Modified: brlcad/trunk/src/libdm/clip.c
===================================================================
--- brlcad/trunk/src/libdm/clip.c 2020-04-17 16:14:01 UTC (rev 75437)
+++ brlcad/trunk/src/libdm/clip.c 2020-04-17 16:46:07 UTC (rev 75438)
@@ -30,7 +30,6 @@
#include "vmath.h"
#include "dm.h"
-#include "dm_private.h"
/* XXX need to test more thoroughly
#define ANGLE_EPSILON 0.0001
Modified: brlcad/trunk/src/libdm/color.c
===================================================================
--- brlcad/trunk/src/libdm/color.c 2020-04-17 16:14:01 UTC (rev 75437)
+++ brlcad/trunk/src/libdm/color.c 2020-04-17 16:46:07 UTC (rev 75438)
@@ -34,7 +34,7 @@
#include "vmath.h"
#include "bu/malloc.h"
-#include "./dm_xvars.h"
+#include "dm/dm_xvars.h"
/* Return the allocated pixel value that most closely represents
Modified: brlcad/trunk/src/libdm/dm-Null.c
===================================================================
--- brlcad/trunk/src/libdm/dm-Null.c 2020-04-17 16:14:01 UTC (rev 75437)
+++ brlcad/trunk/src/libdm/dm-Null.c 2020-04-17 16:46:07 UTC (rev 75438)
@@ -35,7 +35,7 @@
int
-null_close(struct dm *UNUSED(dmp))
+null_close(struct dm_internal *UNUSED(dmp))
{
return 0;
}
@@ -42,7 +42,7 @@
int
-null_drawBegin(struct dm *UNUSED(dmp))
+null_drawBegin(struct dm_internal *UNUSED(dmp))
{
return 0;
}
@@ -49,7 +49,7 @@
int
-null_drawEnd(struct dm *UNUSED(dmp))
+null_drawEnd(struct dm_internal *UNUSED(dmp))
{
return 0;
}
@@ -56,7 +56,7 @@
int
-null_normal(struct dm *UNUSED(dmp))
+null_normal(struct dm_internal *UNUSED(dmp))
{
return 0;
}
@@ -63,7 +63,7 @@
int
-null_loadMatrix(struct dm *UNUSED(dmp), fastf_t *UNUSED(mat), int
UNUSED(which_eye))
+null_loadMatrix(struct dm_internal *UNUSED(dmp), fastf_t *UNUSED(mat), int
UNUSED(which_eye))
{
return 0;
}
@@ -70,7 +70,7 @@
int
-null_loadPMatrix(struct dm *UNUSED(dmp), fastf_t *UNUSED(mat))
+null_loadPMatrix(struct dm_internal *UNUSED(dmp), fastf_t *UNUSED(mat))
{
return 0;
}
@@ -77,7 +77,7 @@
int
-null_drawString2D(struct dm *UNUSED(dmp), const char *UNUSED(str), fastf_t
UNUSED(x), fastf_t UNUSED(y), int UNUSED(size), int UNUSED(use_aspect))
+null_drawString2D(struct dm_internal *UNUSED(dmp), const char *UNUSED(str),
fastf_t UNUSED(x), fastf_t UNUSED(y), int UNUSED(size), int UNUSED(use_aspect))
{
return 0;
}
@@ -84,7 +84,7 @@
int
-null_drawLine2D(struct dm *UNUSED(dmp), fastf_t UNUSED(x_1), fastf_t
UNUSED(y_1), fastf_t UNUSED(x_2), fastf_t UNUSED(y_2))
+null_drawLine2D(struct dm_internal *UNUSED(dmp), fastf_t UNUSED(x_1), fastf_t
UNUSED(y_1), fastf_t UNUSED(x_2), fastf_t UNUSED(y_2))
{
return 0;
}
@@ -91,7 +91,7 @@
int
-null_drawLine3D(struct dm *UNUSED(dmp), point_t UNUSED(pt1), point_t
UNUSED(pt2))
+null_drawLine3D(struct dm_internal *UNUSED(dmp), point_t UNUSED(pt1), point_t
UNUSED(pt2))
{
return 0;
}
@@ -98,7 +98,7 @@
int
-null_drawLines3D(struct dm *UNUSED(dmp), int UNUSED(npoints), point_t
*UNUSED(points), int UNUSED(sflag))
+null_drawLines3D(struct dm_internal *UNUSED(dmp), int UNUSED(npoints), point_t
*UNUSED(points), int UNUSED(sflag))
{
return 0;
}
@@ -105,7 +105,7 @@
int
-null_drawPoint2D(struct dm *UNUSED(dmp), fastf_t UNUSED(x), fastf_t UNUSED(y))
+null_drawPoint2D(struct dm_internal *UNUSED(dmp), fastf_t UNUSED(x), fastf_t
UNUSED(y))
{
return 0;
}
@@ -112,7 +112,7 @@
int
-null_drawPoint3D(struct dm *UNUSED(dmp), point_t UNUSED(point))
+null_drawPoint3D(struct dm_internal *UNUSED(dmp), point_t UNUSED(point))
{
return 0;
}
@@ -119,7 +119,7 @@
int
-null_drawPoints3D(struct dm *UNUSED(dmp), int UNUSED(npoints), point_t
*UNUSED(points))
+null_drawPoints3D(struct dm_internal *UNUSED(dmp), int UNUSED(npoints),
point_t *UNUSED(points))
{
return 0;
}
@@ -126,7 +126,7 @@
int
-null_drawVList(struct dm *UNUSED(dmp), struct bn_vlist *UNUSED(vp))
+null_drawVList(struct dm_internal *UNUSED(dmp), struct bn_vlist *UNUSED(vp))
{
return 0;
}
@@ -133,7 +133,7 @@
int
-null_drawVListHiddenLine(struct dm *UNUSED(dmp), struct bn_vlist *UNUSED(vp))
+null_drawVListHiddenLine(struct dm_internal *UNUSED(dmp), struct bn_vlist
*UNUSED(vp))
{
return 0;
}
@@ -140,7 +140,7 @@
int
-null_draw(struct dm *dmp, struct bn_vlist *(*callback_function)(void *), void
**data)
+null_draw(struct dm_internal *dmp, struct bn_vlist *(*callback_function)(void
*), void **data)
{
return dmp == NULL && callback_function == NULL && data == NULL;
}
@@ -147,7 +147,7 @@
int
-null_setFGColor(struct dm *UNUSED(dmp), unsigned char UNUSED(r), unsigned char
UNUSED(g), unsigned char UNUSED(b), int UNUSED(strict), fastf_t
UNUSED(transparency))
+null_setFGColor(struct dm_internal *UNUSED(dmp), unsigned char UNUSED(r),
unsigned char UNUSED(g), unsigned char UNUSED(b), int UNUSED(strict), fastf_t
UNUSED(transparency))
{
return 0;
}
@@ -154,7 +154,7 @@
int
-null_setBGColor(struct dm *UNUSED(dmp), unsigned char UNUSED(r), unsigned char
UNUSED(g), unsigned char UNUSED(b))
+null_setBGColor(struct dm_internal *UNUSED(dmp), unsigned char UNUSED(r),
unsigned char UNUSED(g), unsigned char UNUSED(b))
{
return 0;
}
@@ -161,7 +161,7 @@
int
-null_setLineAttr(struct dm *UNUSED(dmp), int UNUSED(width), int UNUSED(style))
+null_setLineAttr(struct dm_internal *UNUSED(dmp), int UNUSED(width), int
UNUSED(style))
{
return 0;
}
@@ -168,7 +168,7 @@
int
-null_configureWin(struct dm *UNUSED(dmp), int UNUSED(force))
+null_configureWin(struct dm_internal *UNUSED(dmp), int UNUSED(force))
{
return 0;
}
@@ -175,7 +175,7 @@
int
-null_setWinBounds(struct dm *UNUSED(dmp), fastf_t *UNUSED(w))
+null_setWinBounds(struct dm_internal *UNUSED(dmp), fastf_t *UNUSED(w))
{
return 0;
}
@@ -182,7 +182,7 @@
int
-null_setLight(struct dm *UNUSED(dmp), int UNUSED(light_on))
+null_setLight(struct dm_internal *UNUSED(dmp), int UNUSED(light_on))
{
return 0;
}
@@ -189,7 +189,7 @@
int
-null_setTransparency(struct dm *UNUSED(dmp), int UNUSED(transparency))
+null_setTransparency(struct dm_internal *UNUSED(dmp), int UNUSED(transparency))
{
return 0;
}
@@ -196,7 +196,7 @@
int
-null_setDepthMask(struct dm *UNUSED(dmp), int UNUSED(mask))
+null_setDepthMask(struct dm_internal *UNUSED(dmp), int UNUSED(mask))
{
return 0;
}
@@ -203,7 +203,7 @@
int
-null_setZBuffer(struct dm *UNUSED(dmp), int UNUSED(zbuffer_on))
+null_setZBuffer(struct dm_internal *UNUSED(dmp), int UNUSED(zbuffer_on))
{
return 0;
}
@@ -210,19 +210,19 @@
int
-null_debug(struct dm *UNUSED(dmp), int UNUSED(lvl))
+null_debug(struct dm_internal *UNUSED(dmp), int UNUSED(lvl))
{
return 0;
}
int
-null_logfile(struct dm *UNUSED(dmp), const char *UNUSED(filename))
+null_logfile(struct dm_internal *UNUSED(dmp), const char *UNUSED(filename))
{
return 0;
}
int
-null_beginDList(struct dm *UNUSED(dmp), unsigned int UNUSED(list))
+null_beginDList(struct dm_internal *UNUSED(dmp), unsigned int UNUSED(list))
{
return 0;
}
@@ -229,7 +229,7 @@
int
-null_endDList(struct dm *UNUSED(dmp))
+null_endDList(struct dm_internal *UNUSED(dmp))
{
return 0;
}
@@ -243,7 +243,7 @@
int
-null_freeDLists(struct dm *UNUSED(dmp), unsigned int UNUSED(list), int
UNUSED(range))
+null_freeDLists(struct dm_internal *UNUSED(dmp), unsigned int UNUSED(list),
int UNUSED(range))
{
return 0;
}
@@ -250,7 +250,7 @@
int
-null_genDLists(struct dm *UNUSED(dmp), size_t UNUSED(range))
+null_genDLists(struct dm_internal *UNUSED(dmp), size_t UNUSED(range))
{
return 0;
}
@@ -257,7 +257,7 @@
int
-null_getDisplayImage(struct dm *UNUSED(dmp), unsigned char **UNUSED(image))
+null_getDisplayImage(struct dm_internal *UNUSED(dmp), unsigned char
**UNUSED(image))
{
return 0;
}
@@ -264,7 +264,7 @@
int
-null_reshape(struct dm *UNUSED(dmp), int UNUSED(width), int UNUSED(height))
+null_reshape(struct dm_internal *UNUSED(dmp), int UNUSED(width), int
UNUSED(height))
{
return 0;
}
@@ -271,7 +271,7 @@
int
-null_makeCurrent(struct dm *UNUSED(dmp))
+null_makeCurrent(struct dm_internal *UNUSED(dmp))
{
return 0;
}
@@ -278,13 +278,13 @@
int
-null_openFb(struct dm *UNUSED(dmp))
+null_openFb(struct dm_internal *UNUSED(dmp))
{
return 0;
}
-struct dm_impl dm_null_impl = {
+struct dm_internal dm_null = {
null_close,
null_drawBegin,
null_drawEnd,
@@ -366,7 +366,6 @@
0 /* Tcl interpreter */
};
-struct dm dm_null = { &dm_null_impl };
/*
* Local Variables:
Modified: brlcad/trunk/src/libdm/dm-Null.h
===================================================================
--- brlcad/trunk/src/libdm/dm-Null.h 2020-04-17 16:14:01 UTC (rev 75437)
+++ brlcad/trunk/src/libdm/dm-Null.h 2020-04-17 16:46:07 UTC (rev 75438)
@@ -17,7 +17,7 @@
* License along with this file; see the file named COPYING for more
* information.
*/
-/** @addtogroup libstruct dm */
+/** @addtogroup libdm */
/** @{ */
/** @file dm-Null.h
*
@@ -31,119 +31,119 @@
__BEGIN_DECLS
-DM_EXPORT extern struct dm dm_null;
+DM_EXPORT extern dm dm_null;
DM_EXPORT extern int
-null_close(struct dm *dmp);
+null_close(dm *dmp);
DM_EXPORT extern int
-null_drawBegin(struct dm *dmp);
+null_drawBegin(dm *dmp);
DM_EXPORT extern int
-null_drawEnd(struct dm *dmp);
+null_drawEnd(dm *dmp);
DM_EXPORT extern int
-null_normal(struct dm *dmp);
+null_normal(dm *dmp);
DM_EXPORT extern int
-null_loadMatrix(struct dm *dmp, fastf_t *mat, int which_eye);
+null_loadMatrix(dm *dmp, fastf_t *mat, int which_eye);
DM_EXPORT extern int
-null_loadPMatrix(struct dm *dmp, fastf_t *mat);
+null_loadPMatrix(dm *dmp, fastf_t *mat);
DM_EXPORT extern int
-null_drawString2D(struct dm *dmp, const char *str, fastf_t x, fastf_t y, int
size, int use_aspect);
+null_drawString2D(dm *dmp, const char *str, fastf_t x, fastf_t y, int size,
int use_aspect);
DM_EXPORT extern int
-null_drawLine2D(struct dm *dmp, fastf_t x_1, fastf_t y_1, fastf_t x_2, fastf_t
y_2);
+null_drawLine2D(dm *dmp, fastf_t x_1, fastf_t y_1, fastf_t x_2, fastf_t y_2);
DM_EXPORT extern int
-null_drawLine3D(struct dm *dmp, point_t pt1, point_t pt2);
+null_drawLine3D(dm *dmp, point_t pt1, point_t pt2);
DM_EXPORT extern int
-null_drawLines3D(struct dm *dmp, int npoints, point_t *points, int sflag);
+null_drawLines3D(dm *dmp, int npoints, point_t *points, int sflag);
DM_EXPORT extern int
-null_drawPoint2D(struct dm *dmp, fastf_t x, fastf_t y);
+null_drawPoint2D(dm *dmp, fastf_t x, fastf_t y);
DM_EXPORT extern int
-null_drawPoint3D(struct dm *dmp, point_t point);
+null_drawPoint3D(dm *dmp, point_t point);
DM_EXPORT extern int
-null_drawPoints3D(struct dm *dmp, int npoints, point_t *points);
+null_drawPoints3D(dm *dmp, int npoints, point_t *points);
DM_EXPORT extern int
-null_drawVList(struct dm *dmp, struct bn_vlist *vp);
+null_drawVList(dm *dmp, struct bn_vlist *vp);
DM_EXPORT extern int
-null_drawVListHiddenLine(struct dm *dmp, struct bn_vlist *vp);
+null_drawVListHiddenLine(dm *dmp, struct bn_vlist *vp);
DM_EXPORT extern int
-null_draw(struct dm *dmp, struct bn_vlist *(*callback_function)(void *), void
**data);
+null_draw(dm *dmp, struct bn_vlist *(*callback_function)(void *), void **data);
DM_EXPORT extern int
-null_setFGColor(struct dm *dmp, unsigned char r, unsigned char g, unsigned
char b, int strict, fastf_t transparency);
+null_setFGColor(dm *dmp, unsigned char r, unsigned char g, unsigned char b,
int strict, fastf_t transparency);
DM_EXPORT extern int
-null_setBGColor(struct dm *dmp, unsigned char r, unsigned char g, unsigned
char b);
+null_setBGColor(dm *dmp, unsigned char r, unsigned char g, unsigned char b);
DM_EXPORT extern int
-null_setLineAttr(struct dm *dmp, int width, int style);
+null_setLineAttr(dm *dmp, int width, int style);
DM_EXPORT extern int
-null_configureWin(struct dm *dmp, int force);
+null_configureWin(dm *dmp, int force);
DM_EXPORT extern int
-null_setWinBounds(struct dm *dmp, fastf_t *w);
+null_setWinBounds(dm *dmp, fastf_t *w);
DM_EXPORT extern int
-null_setLight(struct dm *dmp, int light_on);
+null_setLight(dm *dmp, int light_on);
DM_EXPORT extern int
-null_setTransparency(struct dm *dmp, int transparency);
+null_setTransparency(dm *dmp, int transparency);
DM_EXPORT extern int
-null_setDepthMask(struct dm *dmp, int mask);
+null_setDepthMask(dm *dmp, int mask);
DM_EXPORT extern int
-null_setZBuffer(struct dm *dmp, int zbuffer_on);
+null_setZBuffer(dm *dmp, int zbuffer_on);
DM_EXPORT extern int
-null_debug(struct dm *dmp, int lvl);
+null_debug(dm *dmp, int lvl);
DM_EXPORT extern int
-null_beginDList(struct dm *dmp, unsigned int list);
+null_beginDList(dm *dmp, unsigned int list);
DM_EXPORT extern int
-null_endDList(struct dm *dmp);
+null_endDList(dm *dmp);
DM_EXPORT extern int
@@ -151,43 +151,43 @@
DM_EXPORT extern int
-null_freeDLists(struct dm *dmp, unsigned int list, int range);
+null_freeDLists(dm *dmp, unsigned int list, int range);
DM_EXPORT extern int
-null_genDLists(struct dm *dmp, size_t range);
+null_genDLists(dm *dmp, size_t range);
DM_EXPORT extern int
-null_getDisplayImage(struct dm *dmp, unsigned char **image);
+null_getDisplayImage(dm *dmp, unsigned char **image);
DM_EXPORT extern int
-null_draw(struct dm *dmp, struct bn_vlist *(*callback_function)(void *), void
**data);
+null_draw(dm *dmp, struct bn_vlist *(*callback_function)(void *), void **data);
DM_EXPORT extern int
-null_fg(struct dm *dmp, unsigned char r, unsigned char g, unsigned char b, int
strict, fastf_t transparency);
+null_fg(dm *dmp, unsigned char r, unsigned char g, unsigned char b, int
strict, fastf_t transparency);
DM_EXPORT extern int
-null_bg(struct dm *dmp, unsigned char r, unsigned char g, unsigned char b);
+null_bg(dm *dmp, unsigned char r, unsigned char g, unsigned char b);
DM_EXPORT extern int
-null_reshape(struct dm *dmp, int width, int height);
+null_reshape(dm *dmp, int width, int height);
DM_EXPORT extern int
-null_makeCurrent(struct dm *dmp);
+null_makeCurrent(dm *dmp);
DM_EXPORT extern void
-null_processEvents(struct dm *dmp);
+null_processEvents(dm *dmp);
DM_EXPORT extern int
-null_openFb(struct dm *dmp);
+null_openFb(dm *dmp);
__END_DECLS
Modified: brlcad/trunk/src/libdm/dm-X.c
===================================================================
--- brlcad/trunk/src/libdm/dm-X.c 2020-04-17 16:14:01 UTC (rev 75437)
+++ brlcad/trunk/src/libdm/dm-X.c 2020-04-17 16:46:07 UTC (rev 75438)
@@ -61,7 +61,7 @@
#include "dm.h"
#include "dm-X.h"
#include "dm-Null.h"
-#include "./dm_xvars.h"
+#include "dm/dm_xvars.h"
#include "fb.h"
#include "fb/fb_X.h"
@@ -142,16 +142,16 @@
HIDDEN int
-X_reshape(struct dm *dmp, int width, int height)
+X_reshape(struct dm_internal *dmp, int width, int height)
{
- struct x_vars *privars = (struct x_vars *)dmp->i->dm_vars.priv_vars;
+ struct x_vars *privars = (struct x_vars *)dmp->dm_vars.priv_vars;
- dmp->i->dm_height = height;
- dmp->i->dm_width = width;
- dmp->i->dm_aspect = (fastf_t)dmp->i->dm_width / (fastf_t)dmp->i->dm_height;
+ dmp->dm_height = height;
+ dmp->dm_width = width;
+ dmp->dm_aspect = (fastf_t)dmp->dm_width / (fastf_t)dmp->dm_height;
- privars->disp_mat[0] = 2. * privars->ppmm_x / dmp->i->dm_width;
- privars->disp_mat[5] = 2. * privars->ppmm_y / dmp->i->dm_width;
+ privars->disp_mat[0] = 2. * privars->ppmm_x / dmp->dm_width;
+ privars->disp_mat[5] = 2. * privars->ppmm_y / dmp->dm_width;
return 0;
}
@@ -158,13 +158,13 @@
HIDDEN int
-X_configureWin_guts(struct dm *dmp, int force)
+X_configureWin_guts(struct dm_internal *dmp, int force)
{
XWindowAttributes xwa;
XFontStruct *newfontstruct;
XGCValues gcv;
- struct dm_xvars *pubvars = (struct dm_xvars *)dmp->i->dm_vars.pub_vars;
- struct x_vars *privars = (struct x_vars *)dmp->i->dm_vars.priv_vars;
+ struct dm_xvars *pubvars = (struct dm_xvars *)dmp->dm_vars.pub_vars;
+ struct x_vars *privars = (struct x_vars *)dmp->dm_vars.priv_vars;
XGetWindowAttributes(pubvars->dpy,
pubvars->win, &xwa);
@@ -171,15 +171,15 @@
/* nothing to do */
if (!force &&
- dmp->i->dm_height == xwa.height &&
- dmp->i->dm_width == xwa.width)
+ dmp->dm_height == xwa.height &&
+ dmp->dm_width == xwa.width)
return BRLCAD_OK;
X_reshape(dmp, xwa.width, xwa.height);
- if (dmp->i->dm_debugLevel) {
+ if (dmp->dm_debugLevel) {
bu_log("X_configureWin_guts()\n");
- bu_log("width = %d, height = %d\n", dmp->i->dm_width,
dmp->i->dm_height);
+ bu_log("width = %d, height = %d\n", dmp->dm_width, dmp->dm_height);
}
#ifdef HAVE_TK
@@ -188,8 +188,8 @@
privars->pix =
Tk_GetPixmap(pubvars->dpy,
DefaultRootWindow(pubvars->dpy),
- dmp->i->dm_width,
- dmp->i->dm_height,
+ dmp->dm_width,
+ dmp->dm_height,
Tk_Depth(pubvars->xtkwin));
#endif
@@ -213,7 +213,7 @@
/* Always try to choose a the font that best fits the window size.
*/
- if (dmp->i->dm_width < 582) {
+ if (dmp->dm_width < 582) {
if (pubvars->fontstruct->per_char->width != 5) {
if ((newfontstruct = XLoadQueryFont(pubvars->dpy,
FONT5)) != NULL) {
@@ -225,7 +225,7 @@
privars->gc, GCFont, &gcv);
}
}
- } else if (dmp->i->dm_width < 679) {
+ } else if (dmp->dm_width < 679) {
if (pubvars->fontstruct->per_char->width != 6) {
if ((newfontstruct = XLoadQueryFont(pubvars->dpy,
FONT6)) != NULL) {
@@ -237,7 +237,7 @@
privars->gc, GCFont, &gcv);
}
}
- } else if (dmp->i->dm_width < 776) {
+ } else if (dmp->dm_width < 776) {
if (pubvars->fontstruct->per_char->width != 7) {
if ((newfontstruct = XLoadQueryFont(pubvars->dpy,
FONT7)) != NULL) {
@@ -249,7 +249,7 @@
privars->gc, GCFont, &gcv);
}
}
- } else if (dmp->i->dm_width < 873) {
+ } else if (dmp->dm_width < 873) {
if (pubvars->fontstruct->per_char->width != 8) {
if ((newfontstruct = XLoadQueryFont(pubvars->dpy,
FONT8)) != NULL) {
@@ -280,7 +280,7 @@
HIDDEN XVisualInfo *
-X_choose_visual(struct dm *dmp)
+X_choose_visual(struct dm_internal *dmp)
{
XVisualInfo *vip, vitemp, *vibase, *maxvip;
int num, i, j;
@@ -289,11 +289,11 @@
int min_depth = 8;
int *good = NULL;
int screen;
- struct dm_xvars *pubvars = (struct dm_xvars *)dmp->i->dm_vars.pub_vars;
- struct x_vars *privars = (struct x_vars *)dmp->i->dm_vars.priv_vars;
+ struct dm_xvars *pubvars = (struct dm_xvars *)dmp->dm_vars.pub_vars;
+ struct x_vars *privars = (struct x_vars *)dmp->dm_vars.priv_vars;
vibase = XGetVisualInfo(pubvars->dpy, 0, &vitemp, &num);
- screen = DefaultScreen(((struct dm_xvars *)dmp->i->dm_vars.pub_vars)->dpy);
+ screen = DefaultScreen(((struct dm_xvars *)dmp->dm_vars.pub_vars)->dpy);
good = (int *)bu_malloc(sizeof(int)*num, "alloc good visuals");
@@ -376,10 +376,10 @@
* Gracefully release the display.
*/
HIDDEN int
-X_close(struct dm *dmp)
+X_close(struct dm_internal *dmp)
{
- struct dm_xvars *pubvars = (struct dm_xvars *)dmp->i->dm_vars.pub_vars;
- struct x_vars *privars = (struct x_vars *)dmp->i->dm_vars.priv_vars;
+ struct dm_xvars *pubvars = (struct dm_xvars *)dmp->dm_vars.pub_vars;
+ struct x_vars *privars = (struct x_vars *)dmp->dm_vars.priv_vars;
if (pubvars->dpy) {
if (privars->gc)
@@ -404,12 +404,11 @@
}
- bu_vls_free(&dmp->i->dm_pathName);
- bu_vls_free(&dmp->i->dm_tkName);
- bu_vls_free(&dmp->i->dm_dName);
- bu_free((void *)dmp->i->dm_vars.priv_vars, "X_close: x_vars");
- bu_free((void *)dmp->i->dm_vars.pub_vars, "X_close: dm_xvars");
- bu_free((void *)dmp->i, "X_close: dmp->i");
+ bu_vls_free(&dmp->dm_pathName);
+ bu_vls_free(&dmp->dm_tkName);
+ bu_vls_free(&dmp->dm_dName);
+ bu_free((void *)dmp->dm_vars.priv_vars, "X_close: x_vars");
+ bu_free((void *)dmp->dm_vars.pub_vars, "X_close: dm_xvars");
bu_free((void *)dmp, "X_close: dmp");
return BRLCAD_OK;
@@ -420,7 +419,7 @@
* Fire up the display manager, and the display processor.
*
*/
-struct dm *
+struct dm_internal *
X_open_dm(Tcl_Interp *interp, int argc, char **argv)
{
static int count = 0;
@@ -438,8 +437,7 @@
#endif
struct bu_vls str = BU_VLS_INIT_ZERO;
struct bu_vls init_proc_vls = BU_VLS_INIT_ZERO;
- struct dm *dmp = NULL;
- struct dm_impl *dmpi = NULL;
+ struct dm_internal *dmp = (struct dm_internal *)NULL;
Tk_Window tkwin = (Tk_Window)NULL;
Screen *screen = (Screen *)NULL;
@@ -452,37 +450,35 @@
}
#endif
- BU_ALLOC(dmp, struct dm);
- BU_ALLOC(dmpi, struct dm_impl);
+ BU_ALLOC(dmp, struct dm_internal);
- *dmpi = *dm_X.i; /* struct copy */
- dmp->i = dmpi;
- dmp->i->dm_interp = interp;
+ *dmp = dm_X; /* struct copy */
+ dmp->dm_interp = interp;
- BU_ALLOC(dmp->i->dm_vars.pub_vars, struct dm_xvars);
- pubvars = (struct dm_xvars *)dmp->i->dm_vars.pub_vars;
+ BU_ALLOC(dmp->dm_vars.pub_vars, struct dm_xvars);
+ pubvars = (struct dm_xvars *)dmp->dm_vars.pub_vars;
- BU_ALLOC(dmp->i->dm_vars.priv_vars, struct x_vars);
- privars = (struct x_vars *)dmp->i->dm_vars.priv_vars;
+ BU_ALLOC(dmp->dm_vars.priv_vars, struct x_vars);
+ privars = (struct x_vars *)dmp->dm_vars.priv_vars;
- bu_vls_init(&dmp->i->dm_pathName);
- bu_vls_init(&dmp->i->dm_tkName);
- bu_vls_init(&dmp->i->dm_dName);
+ bu_vls_init(&dmp->dm_pathName);
+ bu_vls_init(&dmp->dm_tkName);
+ bu_vls_init(&dmp->dm_dName);
dm_processOptions(dmp, &init_proc_vls, --argc, ++argv);
- if (bu_vls_strlen(&dmp->i->dm_pathName) == 0)
- bu_vls_printf(&dmp->i->dm_pathName, ".dm_X%d", count);
+ if (bu_vls_strlen(&dmp->dm_pathName) == 0)
+ bu_vls_printf(&dmp->dm_pathName, ".dm_X%d", count);
++count;
- if (bu_vls_strlen(&dmp->i->dm_dName) == 0) {
+ if (bu_vls_strlen(&dmp->dm_dName) == 0) {
char *dp;
dp = getenv("DISPLAY");
if (dp)
- bu_vls_strcpy(&dmp->i->dm_dName, dp);
+ bu_vls_strcpy(&dmp->dm_dName, dp);
else
- bu_vls_strcpy(&dmp->i->dm_dName, ":0.0");
+ bu_vls_strcpy(&dmp->dm_dName, ":0.0");
}
if (bu_vls_strlen(&init_proc_vls) == 0)
bu_vls_strcpy(&init_proc_vls, "bind_dm");
@@ -491,28 +487,28 @@
pubvars->devmotionnotify = LASTEvent;
pubvars->devbuttonpress = LASTEvent;
pubvars->devbuttonrelease = LASTEvent;
- dmp->i->dm_aspect = 1.0;
+ dmp->dm_aspect = 1.0;
pubvars->fontstruct = NULL;
- if (dmp->i->dm_top) {
+ if (dmp->dm_top) {
#ifdef HAVE_TK
/* Make xtkwin a toplevel window */
pubvars->xtkwin = Tk_CreateWindowFromPath(interp, tkwin,
-
bu_vls_addr(&dmp->i->dm_pathName),
-
bu_vls_addr(&dmp->i->dm_dName));
+
bu_vls_addr(&dmp->dm_pathName),
+ bu_vls_addr(&dmp->dm_dName));
pubvars->top = pubvars->xtkwin;
#endif
} else {
char *cp;
- cp = strrchr(bu_vls_addr(&dmp->i->dm_pathName), (int)'.');
- if (cp == bu_vls_addr(&dmp->i->dm_pathName)) {
+ cp = strrchr(bu_vls_addr(&dmp->dm_pathName), (int)'.');
+ if (cp == bu_vls_addr(&dmp->dm_pathName)) {
pubvars->top = tkwin;
} else {
struct bu_vls top_vls = BU_VLS_INIT_ZERO;
- bu_vls_strncpy(&top_vls, (const char
*)bu_vls_addr(&dmp->i->dm_pathName), cp - bu_vls_addr(&dmp->i->dm_pathName));
+ bu_vls_strncpy(&top_vls, (const char
*)bu_vls_addr(&dmp->dm_pathName), cp - bu_vls_addr(&dmp->dm_pathName));
#ifdef HAVE_TK
pubvars->top =
@@ -530,19 +526,19 @@
}
if (pubvars->xtkwin == NULL) {
- bu_log("X_open_dm: Failed to open %s\n",
bu_vls_addr(&dmp->i->dm_pathName));
+ bu_log("X_open_dm: Failed to open %s\n",
bu_vls_addr(&dmp->dm_pathName));
(void)X_close(dmp);
return DM_NULL;
}
#ifdef HAVE_TK
- bu_vls_printf(&dmp->i->dm_tkName, "%s",
+ bu_vls_printf(&dmp->dm_tkName, "%s",
(char *)Tk_Name(pubvars->xtkwin));
#endif
bu_vls_printf(&str, "_init_dm %s %s\n",
bu_vls_addr(&init_proc_vls),
- bu_vls_addr(&dmp->i->dm_pathName));
+ bu_vls_addr(&dmp->dm_pathName));
if (Tcl_Eval(interp, bu_vls_addr(&str)) == BRLCAD_ERROR) {
bu_vls_free(&str);
@@ -560,7 +556,7 @@
/* make sure there really is a display before proceeding. */
if (!pubvars->dpy) {
- bu_log("ERROR: Unable to attach to display (%s)\n",
bu_vls_addr(&dmp->i->dm_pathName));
+ bu_log("ERROR: Unable to attach to display (%s)\n",
bu_vls_addr(&dmp->dm_pathName));
(void)X_close(dmp);
return DM_NULL;
}
@@ -576,7 +572,7 @@
/* make sure there really is a screen before processing. */
if (!screen) {
- bu_log("ERROR: Unable to attach to screen (%s)\n",
bu_vls_addr(&dmp->i->dm_pathName));
+ bu_log("ERROR: Unable to attach to screen (%s)\n",
bu_vls_addr(&dmp->dm_pathName));
(void)X_close(dmp);
return DM_NULL;
}
@@ -590,15 +586,15 @@
privars->ppmm_x = screen->width / screen->mwidth;
privars->ppmm_y = screen->height / screen->mheight;
- if (dmp->i->dm_width == 0) {
- dmp->i->dm_width =
+ if (dmp->dm_width == 0) {
+ dmp->dm_width =
DisplayWidth(pubvars->dpy,
DefaultScreen(pubvars->dpy)) - 30;
++make_square;
}
- if (dmp->i->dm_height == 0) {
- dmp->i->dm_height =
+ if (dmp->dm_height == 0) {
+ dmp->dm_height =
DisplayHeight(pubvars->dpy,
DefaultScreen(pubvars->dpy)) - 30;
++make_square;
@@ -606,17 +602,17 @@
if (make_square > 0) {
/* Make window square */
- if (dmp->i->dm_height <
- dmp->i->dm_width)
- dmp->i->dm_width = dmp->i->dm_height;
+ if (dmp->dm_height <
+ dmp->dm_width)
+ dmp->dm_width = dmp->dm_height;
else
- dmp->i->dm_height = dmp->i->dm_width;
+ dmp->dm_height = dmp->dm_width;
}
#ifdef HAVE_TK
Tk_GeometryRequest(pubvars->xtkwin,
- dmp->i->dm_width,
- dmp->i->dm_height);
+ dmp->dm_width,
+ dmp->dm_height);
#endif
/* must do this before MakeExist */
@@ -629,12 +625,12 @@
#ifdef HAVE_TK
Tk_MakeWindowExist(pubvars->xtkwin);
pubvars->win = Tk_WindowId(pubvars->xtkwin);
- dmp->i->dm_id = pubvars->win;
+ dmp->dm_id = pubvars->win;
privars->pix =
Tk_GetPixmap(pubvars->dpy,
pubvars->win,
- dmp->i->dm_width,
- dmp->i->dm_height,
+ dmp->dm_width,
+ dmp->dm_height,
Tk_Depth(pubvars->xtkwin));
#endif
@@ -766,13 +762,13 @@
HIDDEN int
-X_drawBegin(struct dm *dmp)
+X_drawBegin(struct dm_internal *dmp)
{
XGCValues gcv;
@@ 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