Revision: 76210
http://sourceforge.net/p/brlcad/code/76210
Author: starseeker
Date: 2020-06-26 01:03:34 +0000 (Fri, 26 Jun 2020)
Log Message:
-----------
Turn off and update until this compiles. It was never finished, and as things
are now developing we should look at making this a full fledged Qt-only dm/fb
rather than trying to mix Tk and Qt.
Modified Paths:
--------------
brlcad/trunk/src/libdm/qt/dm-qt.cpp
brlcad/trunk/src/libdm/qt/dm-qt.h
brlcad/trunk/src/libdm/qt/if_qt.cpp
Modified: brlcad/trunk/src/libdm/qt/dm-qt.cpp
===================================================================
--- brlcad/trunk/src/libdm/qt/dm-qt.cpp 2020-06-25 22:35:48 UTC (rev 76209)
+++ brlcad/trunk/src/libdm/qt/dm-qt.cpp 2020-06-26 01:03:34 UTC (rev 76210)
@@ -21,12 +21,15 @@
*
*/
#include "common.h"
+
+#include "./fb_qt.h"
+#include "./dm-qt.h"
+
#include <locale.h>
#ifdef HAVE_SYS_TIME_H
# include <sys/time.h>
#endif
-
#include "tcl.h"
#include "tk.h"
#include "bu/log.h"
@@ -34,10 +37,9 @@
#include "bu/parse.h"
#include "dm.h"
#include "private.h"
-#include "dm-Null.h"
-#include "./fb_qt.h"
-#include "./dm-qt.h"
+#include "../null/dm-Null.h"
+
#define DM_QT_DEFAULT_POINT_SIZE 1.0
@@ -268,11 +270,11 @@
while (qt_bindings[index].name != NULL) {
char *tk_event = qt_bindings[index].bind_function(ev);
if (tk_event != NULL) {
- struct bu_vls str = BU_VLS_INIT_ZERO;
- bu_vls_printf(&str, "event generate %s %s", bu_vls_addr(&((struct
dm *)dmp)->dm_pathName), tk_event);
- if (Tcl_Eval(((struct dm *)dmp)->dm_interp, bu_vls_addr(&str)) ==
TCL_ERROR) {
- bu_log("error generate event %s\n", tk_event);
- }
+ //struct bu_vls str = BU_VLS_INIT_ZERO;
+ //bu_vls_printf(&str, "event generate %s %s", bu_vls_addr(&((struct
dm *)dmp)->dm_pathName), tk_event);
+ //if (Tcl_Eval(((struct dm *)dmp)->dm_interp, bu_vls_addr(&str)) ==
TCL_ERROR) {
+ // bu_log("error generate event %s\n", tk_event);
+ // }
return true;
}
index++;
@@ -317,11 +319,11 @@
*
*/
extern "C" struct dm *
-qt_open(void *vinterp, int argc, char **argv)
+qt_open(void *vinterp, int argc, const char **argv)
{
Tcl_Interp *interp = (Tcl_Interp *)vinterp;
static int count = 0;
- int make_square = -1;
+ //int make_square = -1;
struct dm *dmp = (struct dm *)NULL;
struct bu_vls init_proc_vls = BU_VLS_INIT_ZERO;
struct bu_vls str = BU_VLS_INIT_ZERO;
@@ -379,38 +381,36 @@
if (dmp->i->dm_top) {
/* 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));
- pubvars->top = pubvars->xtkwin;
+ //pubvars->xtkwin = Tk_CreateWindowFromPath(interp, tkwin,
bu_vls_addr(&dmp->i->dm_pathName), bu_vls_addr(&dmp->i->dm_dName));
+ //pubvars->top = pubvars->xtkwin;
} else {
char *cp;
cp = strrchr(bu_vls_addr(&dmp->i->dm_pathName), (int)'.');
if (cp == bu_vls_addr(&dmp->i->dm_pathName)) {
- pubvars->top = tkwin;
+ //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));
- pubvars->top = Tk_NameToWindow(interp, bu_vls_addr(&top_vls),
tkwin);
+ //pubvars->top = Tk_NameToWindow(interp, bu_vls_addr(&top_vls),
tkwin);
bu_vls_free(&top_vls);
}
/* Make xtkwin an embedded window */
- pubvars->xtkwin =
- Tk_CreateWindow(interp, pubvars->top,
- cp + 1, (char *)NULL);
+ //pubvars->xtkwin = Tk_CreateWindow(interp, pubvars->top, cp + 1,
(char *)NULL);
}
+#if 0
if (pubvars->xtkwin == NULL) {
bu_log("qt_open: Failed to open %s\n",
bu_vls_addr(&dmp->i->dm_pathName));
- (void)qt_close(dmp);
+ //(void)qt_close(dmp);
return DM_NULL;
}
+#endif
- bu_vls_printf(&dmp->i->dm_tkName, "%s", (char *)Tk_Name(pubvars->xtkwin));
+ //bu_vls_printf(&dmp->i->dm_tkName, "%s", (char
*)Tk_Name(pubvars->xtkwin));
if (bu_vls_strlen(&init_proc_vls) > 0) {
bu_vls_printf(&str, "%s %s\n", bu_vls_addr(&init_proc_vls),
bu_vls_addr(&dmp->i->dm_pathName));
@@ -419,7 +419,7 @@
bu_log("qt_open: dm init failed\n");
bu_vls_free(&init_proc_vls);
bu_vls_free(&str);
- (void)qt_close(dmp);
+ //(void)qt_close(dmp);
return DM_NULL;
}
}
@@ -427,8 +427,9 @@
bu_vls_free(&init_proc_vls);
bu_vls_free(&str);
- pubvars->dpy = Tk_Display(pubvars->top);
+ //pubvars->dpy = Tk_Display(pubvars->top);
+#if 0
/* make sure there really is a display before proceeding. */
if (!pubvars->dpy) {
bu_log("qt_open: Unable to attach to display (%s)\n",
bu_vls_addr(&dmp->i->dm_pathName));
@@ -465,10 +466,12 @@
Tk_SetWindowBackground(pubvars->xtkwin, 0);
Tk_MapWindow(pubvars->xtkwin);
- privars->qapp = new QApplication(argc, argv);
- privars->parent = QWindow::fromWinId(pubvars->win);
+#endif
+ privars->qapp = new QApplication(argc, (char **)argv);
+ //privars->parent = QWindow::fromWinId(pubvars->win);
+
privars->pix = new QPixmap(dmp->i->dm_width, dmp->i->dm_height);
privars->win = new QTkMainWindow(privars->pix, privars->parent, dmp);
@@ -478,10 +481,10 @@
privars->font = NULL;
privars->painter = new QPainter(privars->pix);
- qt_setFGColor(dmp, 1, 0, 0, 0, 0);
- qt_setBGColor(dmp, 0, 0, 0);
+ //qt_setFGColor(dmp, 1, 0, 0, 0, 0);
+ //qt_setBGColor(dmp, 0, 0, 0);
- qt_configureWin(dmp, 1);
+ //qt_configureWin(dmp, 1);
MAT_IDN(privars->mod_mat);
MAT_IDN(privars->disp_mat);
@@ -490,12 +493,13 @@
/* inputs and outputs assume POSIX/C locale settings */
setlocale(LC_ALL, "POSIX");
+#if 0
/* Make Tcl_DoOneEvent call QApplication::processEvents */
Tcl_CreateEventSource(NULL, processQtEvents, NULL);
/* Try to process Qt events when idle */
Tcl_DoWhenIdle(IdleCall, NULL);
-
+#endif
return dmp;
}
@@ -505,7 +509,7 @@
HIDDEN int
qt_close(struct dm *dmp)
{
- struct dm_qtvars *pubvars = (struct dm_qtvars *)dmp->i->dm_vars.pub_vars;
+ //struct dm_qtvars *pubvars = (struct dm_qtvars *)dmp->i->dm_vars.pub_vars;
struct qt_vars *privars = (struct qt_vars *)dmp->i->dm_vars.priv_vars;
if (dmp->i->dm_debugLevel) {
@@ -519,7 +523,7 @@
delete privars->parent;
privars->qapp->quit();
- Tk_DestroyWindow(pubvars->xtkwin);
+ //Tk_DestroyWindow(pubvars->xtkwin);
bu_vls_free(&dmp->i->dm_pathName);
bu_vls_free(&dmp->i->dm_tkName);
@@ -1023,11 +1027,11 @@
HIDDEN int
qt_configureWin(struct dm *dmp, int force)
{
- struct dm_qtvars *pubvars = (struct dm_qtvars *)dmp->i->dm_vars.pub_vars;
+ //struct dm_qtvars *pubvars = (struct dm_qtvars *)dmp->i->dm_vars.pub_vars;
struct qt_vars *privars = (struct qt_vars *)dmp->i->dm_vars.priv_vars;
- int width = Tk_Width(pubvars->xtkwin);
- int height = Tk_Height(pubvars->xtkwin);
+ int width = 0;
+ int height = 0;
if (!force &&
dmp->i->dm_height == height &&
@@ -1250,10 +1254,10 @@
int
-qt_geometry_request(struct dm *dmp, int width, int height)
+qt_geometry_request(struct dm *dmp, int UNUSED(width), int UNUSED(height))
{
if (!dmp) return -1;
- Tk_GeometryRequest(((struct dm_qtvars *)dmp->i->dm_vars.pub_vars)->xtkwin,
width, height);
+ //Tk_GeometryRequest(((struct dm_qtvars
*)dmp->i->dm_vars.pub_vars)->xtkwin, width, height);
return 0;
}
@@ -1260,12 +1264,6 @@
#define QTVARS_MV_O(_m) offsetof(struct dm_qtvars, _m)
struct bu_structparse dm_qtvars_vparse[] = {
- {"%x", 1, "dpy", QTVARS_MV_O(dpy),
BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
- {"%x", 1, "win", QTVARS_MV_O(win),
BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
- {"%x", 1, "top", QTVARS_MV_O(top),
BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
- {"%x", 1, "tkwin", QTVARS_MV_O(xtkwin),
BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
- {"%d", 1, "depth", QTVARS_MV_O(depth),
BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
- {"%x", 1, "cmap", QTVARS_MV_O(cmap),
BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
{"%d", 1, "devmotionnotify", QTVARS_MV_O(devmotionnotify),
BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
{"%d", 1, "devbuttonpress", QTVARS_MV_O(devbuttonpress),
BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
{"%d", 1, "devbuttonrelease", QTVARS_MV_O(devbuttonrelease),
BU_STRUCTPARSE_FUNC_NULL, NULL, NULL },
@@ -1279,7 +1277,7 @@
if (!key) {
// Print all current vars
bu_vls_struct_print2(result, "dm internal Qt variables",
dm_qtvars_vparse, (const char *)dmp->i->dm_vars.pub_vars);
- return;
+ return 0;
}
// Print specific var
bu_vls_struct_item_named(result, dm_qtvars_vparse, key, (const char
*)dmp->i->dm_vars.pub_vars, ',');
@@ -1357,7 +1355,6 @@
NULL,
NULL,
NULL,
- NULL,
qt_event_cmp,
NULL,
NULL,
Modified: brlcad/trunk/src/libdm/qt/dm-qt.h
===================================================================
--- brlcad/trunk/src/libdm/qt/dm-qt.h 2020-06-25 22:35:48 UTC (rev 76209)
+++ brlcad/trunk/src/libdm/qt/dm-qt.h 2020-06-26 01:03:34 UTC (rev 76210)
@@ -79,13 +79,7 @@
const char *name;
};
-struct qt_xvars {
- Display *dpy;
- Window win;
- Tk_Window top;
- Tk_Window xtkwin;
- int depth;
- Colormap cmap;
+struct dm_qtvars {
int devmotionnotify;
int devbuttonpress;
int devbuttonrelease;
Modified: brlcad/trunk/src/libdm/qt/if_qt.cpp
===================================================================
--- brlcad/trunk/src/libdm/qt/if_qt.cpp 2020-06-25 22:35:48 UTC (rev 76209)
+++ brlcad/trunk/src/libdm/qt/if_qt.cpp 2020-06-26 01:03:34 UTC (rev 76210)
@@ -27,6 +27,7 @@
/** @} */
#include "common.h"
+#include "./fb_qt.h"
#include <stdio.h>
#include <stdlib.h>
@@ -36,7 +37,6 @@
#include "dm.h"
#include "private.h"
-#include "./fb_qt.h"
#include "bu/malloc.h"
#include "bu/file.h"
#include "bu/str.h"
@@ -166,15 +166,15 @@
* Set ?wp to the number of whole zoomed image pixels we could display
* in the window.
*/
- xwp = qi->qi_qwidth / ifp->if_xzoom;
- ywp = qi->qi_qheight / ifp->if_yzoom;
+ xwp = qi->qi_qwidth / ifp->i->if_xzoom;
+ ywp = qi->qi_qheight / ifp->i->if_yzoom;
/*
* Set ?rp to the number of leftover pixels we have, after displaying
* wp whole zoomed image pixels.
*/
- xrp = qi->qi_qwidth % ifp->if_xzoom;
- yrp = qi->qi_qheight % ifp->if_yzoom;
+ xrp = qi->qi_qwidth % ifp->i->if_xzoom;
+ yrp = qi->qi_qheight % ifp->i->if_yzoom;
/*
* Force ?wp to be the same as the window width (mod 2). This
@@ -183,12 +183,12 @@
*/
if (xwp && (xwp ^ qi->qi_qwidth) & 1) {
xwp--;
- xrp += ifp->if_xzoom;
+ xrp += ifp->i->if_xzoom;
}
if (ywp && (ywp ^ qi->qi_qheight) & 1) {
ywp--;
- yrp += ifp->if_yzoom;
+ yrp += ifp->i->if_yzoom;
}
/*
@@ -200,13 +200,13 @@
*/
switch (xrp) {
case 0:
- lf_w = ifp->if_xzoom;
- rt_w = ifp->if_xzoom;
+ lf_w = ifp->i->if_xzoom;
+ rt_w = ifp->i->if_xzoom;
break;
case 1:
lf_w = 1;
- rt_w = ifp->if_xzoom;
+ rt_w = ifp->i->if_xzoom;
xwp += 1;
break;
@@ -219,13 +219,13 @@
switch (yrp) {
case 0:
- tp_h = ifp->if_yzoom;
- bt_h = ifp->if_yzoom;
+ tp_h = ifp->i->if_yzoom;
+ bt_h = ifp->i->if_yzoom;
break;
case 1:
tp_h = 1;
- bt_h = ifp->if_yzoom;
+ bt_h = ifp->i->if_yzoom;
ywp += 1;
break;
@@ -254,7 +254,7 @@
* pixels available on the left half. We use this information to
* calculate the remaining parameters as noted.
*/
- want = ifp->if_xcenter;
+ want = ifp->i->if_xcenter;
avail = xwp/2;
if (want >= avail) {
/*
@@ -281,13 +281,13 @@
* - the leftmost image pixel displayed will have a zero
* x coordinate.
*/
- qi->qi_xlf = lf_w + (avail - want - 1) * ifp->if_xzoom;
- qi->qi_ilf_w = ifp->if_xzoom;
+ qi->qi_xlf = lf_w + (avail - want - 1) * ifp->i->if_xzoom;
+ qi->qi_ilf_w = ifp->i->if_xzoom;
qi->qi_ilf = 0;
}
/* Calculation for bottom edge. */
- want = ifp->if_ycenter;
+ want = ifp->i->if_ycenter;
avail = ywp/2;
if (want >= avail) {
/*
@@ -316,13 +316,13 @@
* y coordinate.
*/
qi->qi_xbt = qi->qi_qheight - (bt_h + (avail - want - 1) *
- ifp->if_yzoom) - 1;
- qi->qi_ibt_h = ifp->if_yzoom;
+ ifp->i->if_yzoom) - 1;
+ qi->qi_ibt_h = ifp->i->if_yzoom;
qi->qi_ibt = 0;
}
/* Calculation for right edge. */
- want = qi->qi_iwidth - ifp->if_xcenter;
+ want = qi->qi_iwidth - ifp->i->if_xcenter;
avail = xwp - xwp/2;
if (want >= avail) {
/*
@@ -338,7 +338,7 @@
*/
qi->qi_xrt = qi->qi_qwidth - 1;
qi->qi_irt_w = rt_w;
- qi->qi_irt = ifp->if_xcenter + avail - 1;
+ qi->qi_irt = ifp->i->if_xcenter + avail - 1;
} else {
/*
* Not enough image pixels to fill the area. We'll be
@@ -352,13 +352,13 @@
* coordinate equal to the width of the image minus 1.
*/
qi->qi_xrt = qi->qi_qwidth - (rt_w + (avail - want - 1) *
- ifp->if_xzoom) - 1;
- qi->qi_irt_w = ifp->if_xzoom;
+ ifp->i->if_xzoom) - 1;
+ qi->qi_irt_w = ifp->i->if_xzoom;
qi->qi_irt = qi->qi_iwidth - 1;
}
/* Calculation for top edge. */
- want = qi->qi_iheight - ifp->if_ycenter;
+ want = qi->qi_iheight - ifp->i->if_ycenter;
avail = ywp - ywp/2;
if (want >= avail) {
/*
@@ -373,7 +373,7 @@
*/
qi->qi_xtp = 0;
qi->qi_itp_h = tp_h;
- qi->qi_itp = ifp->if_ycenter + avail - 1;
+ qi->qi_itp = ifp->i->if_ycenter + avail - 1;
} else {
/*
* Not enough image pixels to fill the area. We'll be
@@ -385,8 +385,8 @@
* - the topmost image pixel displayed will have a y
* coordinate equal to the height of the image minus 1.
*/
- qi->qi_xtp = tp_h + (avail - want - 1) * ifp->if_yzoom;
- qi->qi_itp_h = ifp->if_yzoom;
+ qi->qi_xtp = tp_h + (avail - want - 1) * ifp->i->if_yzoom;
+ qi->qi_itp_h = ifp->i->if_yzoom;
qi->qi_itp = qi->qi_iheight - 1;
}
}
@@ -408,14 +408,14 @@
return;
}
- ifp->if_width = width;
- ifp->if_height = height;
+ ifp->i->if_width = width;
+ ifp->i->if_height = height;
qi->qi_qwidth = qi->qi_iwidth = width;
qi->qi_qheight = qi->qi_iheight = height;
- ifp->if_xcenter = width/2;
- ifp->if_ycenter = height/2;
+ ifp->i->if_xcenter = width/2;
+ ifp->i->if_ycenter = height/2;
/* destroy old image struct and image buffers */
delete qi->qi_image;
@@ -491,15 +491,15 @@
/*
* Figure out sizes of outermost image pixels
*/
- x1wd = (x1 == qi->qi_ilf) ? qi->qi_ilf_w : ifp->if_xzoom;
- x2wd = (x2 == qi->qi_irt) ? qi->qi_irt_w : ifp->if_xzoom;
- y1ht = (y1 == qi->qi_ibt) ? qi->qi_ibt_h : ifp->if_yzoom;
- y2ht = (y2 == qi->qi_itp) ? qi->qi_itp_h : ifp->if_yzoom;
+ x1wd = (x1 == qi->qi_ilf) ? qi->qi_ilf_w : ifp->i->if_xzoom;
+ x2wd = (x2 == qi->qi_irt) ? qi->qi_irt_w : ifp->i->if_xzoom;
+ y1ht = (y1 == qi->qi_ibt) ? qi->qi_ibt_h : ifp->i->if_yzoom;
+ y2ht = (y2 == qi->qi_itp) ? qi->qi_itp_h : ifp->i->if_yzoom;
/* Compute ox: offset from left edge of window to left pixel */
xdel = x1 - qi->qi_ilf;
if (xdel) {
- ox = x1wd + ((xdel - 1) * ifp->if_xzoom) + qi->qi_xlf;
+ ox = x1wd + ((xdel - 1) * ifp->i->if_xzoom) + qi->qi_xlf;
} else {
ox = qi->qi_xlf;
}
@@ -507,7 +507,7 @@
/* Compute oy: offset from top edge of window to bottom pixel */
ydel = y1 - qi->qi_ibt;
if (ydel) {
- oy = qi->qi_xbt - (y1ht + ((ydel - 1) * ifp->if_yzoom));
+ oy = qi->qi_xbt - (y1ht + ((ydel - 1) * ifp->i->if_yzoom));
} else {
oy = qi->qi_xbt;
}
@@ -515,13 +515,13 @@
if (x2 == x1) {
xwd = x1wd;
} else {
- xwd = x1wd + x2wd + ifp->if_xzoom * (x2 - x1 - 1);
+ xwd = x1wd + x2wd + ifp->i->if_xzoom * (x2 - x1 - 1);
}
if (y2 == y1) {
xht = y1ht;
} else {
- xht = y1ht + y2ht + ifp->if_yzoom * (y2 - y1 - 1);
+ xht = y1ht + y2ht + ifp->i->if_yzoom * (y2 - y1 - 1);
}
/*
@@ -551,7 +551,7 @@
} else if (x == x2) {
pxwd = x2wd;
} else {
- pxwd = ifp->if_xzoom;
+ pxwd = ifp->i->if_xzoom;
}
/*
@@ -738,7 +738,7 @@
int alpha;
struct modeflags *mfp;
- if (bu_strncmp(file, ifp->if_name, strlen(ifp->if_name))) {
+ if (bu_strncmp(file, ifp->i->if_name, strlen(ifp->i->if_name))) {
mode = 0;
} else {
alpha = 0;
@@ -769,21 +769,21 @@
}
if (width <= 0)
- width = ifp->if_width;
+ width = ifp->i->if_width;
if(height <= 0)
- height = ifp->if_height;
- if (width > ifp->if_max_width)
- width = ifp->if_max_width;
- if (height > ifp->if_max_height)
- height = ifp->if_max_height;
+ height = ifp->i->if_height;
+ if (width > ifp->i->if_max_width)
+ width = ifp->i->if_max_width;
+ if (height > ifp->i->if_max_height)
+ height = ifp->i->if_max_height;
- ifp->if_width = width;
- ifp->if_height = height;
+ ifp->i->if_width = width;
+ ifp->i->if_height = height;
- ifp->if_xzoom = 1;
- ifp->if_yzoom = 1;
- ifp->if_xcenter = width/2;
- ifp->if_ycenter = height/2;
+ ifp->i->if_xzoom = 1;
+ ifp->i->if_yzoom = 1;
+ ifp->i->if_xcenter = width/2;
+ ifp->i->if_ycenter = height/2;
if ((qi = (struct qtinfo *)calloc(1, sizeof(struct qtinfo))) ==
NULL) {
@@ -797,7 +797,7 @@
qi->qi_iheight = height;
/* allocate backing store */
- size = ifp->if_max_height * ifp->if_max_width * sizeof(RGBpixel) + sizeof
(*qi->qi_rgb_cmap);;
+ size = ifp->i->if_max_height * ifp->i->if_max_width * sizeof(RGBpixel) +
sizeof (*qi->qi_rgb_cmap);;
if ((mem = (unsigned char *)malloc(size)) == 0) {
fb_log("if_qt: Unable to allocate %zu bytes of backing \
store\n Run shell command 'limit datasize unlimited' and try
again.\n", size);
@@ -870,21 +870,21 @@
mode = MODE1_LINGERING;
if (width <= 0)
- width = ifp->if_width;
+ width = ifp->i->if_width;
if(height <= 0)
- height = ifp->if_height;
- if (width > ifp->if_max_width)
- width = ifp->if_max_width;
- if (height > ifp->if_max_height)
- height = ifp->if_max_height;
+ height = ifp->i->if_height;
+ if (width > ifp->i->if_max_width)
+ width = ifp->i->if_max_width;
+ if (height > ifp->i->if_max_height)
+ height = ifp->i->if_max_height;
- ifp->if_width = width;
- ifp->if_height = height;
+ ifp->i->if_width = width;
+ ifp->i->if_height = height;
- ifp->if_xzoom = 1;
- ifp->if_yzoom = 1;
- ifp->if_xcenter = width/2;
- ifp->if_ycenter = height/2;
+ ifp->i->if_xzoom = 1;
+ ifp->i->if_yzoom = 1;
+ ifp->i->if_xcenter = width/2;
+ ifp->i->if_ycenter = height/2;
if ((qi = (struct qtinfo *)calloc(1, sizeof(struct qtinfo))) ==
NULL) {
@@ -898,7 +898,7 @@
qi->qi_iheight = height;
/* allocate backing store */
- size = ifp->if_max_height * ifp->if_max_width * sizeof(RGBpixel) + sizeof
(*qi->qi_rgb_cmap);;
+ size = ifp->i->if_max_height * ifp->i->if_max_width * sizeof(RGBpixel) +
sizeof (*qi->qi_rgb_cmap);;
if ((mem = (unsigned char *)malloc(size)) == 0) {
fb_log("if_qt: Unable to allocate %zu bytes of backing \
store\n Run shell command 'limit datasize unlimited' and try
again.\n", size);
@@ -1084,8 +1084,8 @@
FB_CK_FB(ifp->i);
/* bypass if no change */
- if (ifp->if_xcenter == xcenter && ifp->if_ycenter == ycenter
- && ifp->if_xzoom == xcenter && ifp->if_yzoom == ycenter)
+ if (ifp->i->if_xcenter == xcenter && ifp->i->if_ycenter == ycenter
+ && ifp->i->if_xzoom == xcenter && ifp->i->if_yzoom == ycenter)
return 0;
/* check bounds */
@@ -1096,10 +1096,10 @@
|| yzoom <= 0 || yzoom >= qi->qi_iheight/2)
return -1;
- ifp->if_xcenter = xcenter;
- ifp->if_ycenter = ycenter;
- ifp->if_xzoom = xzoom;
- ifp->if_yzoom = yzoom;
+ ifp->i->if_xcenter = xcenter;
+ ifp->i->if_ycenter = ycenter;
+ ifp->i->if_xzoom = xzoom;
+ ifp->i->if_yzoom = yzoom;
qt_updstate(ifp);
qt_update(ifp, 0, 0, qi->qi_iwidth, qi->qi_iheight);
@@ -1113,10 +1113,10 @@
{
FB_CK_FB(ifp->i);
- *xcenter = ifp->if_xcenter;
- *ycenter = ifp->if_ycenter;
- *xzoom = ifp->if_xzoom;
- *yzoom = ifp->if_yzoom;
+ *xcenter = ifp->i->if_xcenter;
+ *ycenter = ifp->i->if_ycenter;
+ *xzoom = ifp->i->if_xzoom;
+ *yzoom = ifp->i->if_yzoom;
return 0;
}
@@ -1232,14 +1232,14 @@
HIDDEN int
qt_help(struct fb *ifp)
{
- fb_log("Description: %s\n", qt_interface.if_type);
- fb_log("Device: %s\n", ifp->if_name);
+ fb_log("Description: %s\n", qt_interface.i->if_type);
+ fb_log("Device: %s\n", ifp->i->if_name);
fb_log("Max width/height: %d %d\n",
- qt_interface.if_max_width,
- qt_interface.if_max_height);
+ qt_interface.i->if_max_width,
+ qt_interface.i->if_max_height);
fb_log("Default width/height: %d %d\n",
- qt_interface.if_width,
- qt_interface.if_height);
+ qt_interface.i->if_width,
+ qt_interface.i->if_height);
fb_log("Useful for Benchmarking/Debugging\n");
return 0;
}
@@ -1279,12 +1279,12 @@
if (x < qi->qi_ilf_w)
ix = qi->qi_ilf;
else
- ix = qi->qi_ilf + (x - qi->qi_ilf_w +
ifp->if_xzoom - 1) / ifp->if_xzoom;
+ ix = qi->qi_ilf + (x - qi->qi_ilf_w +
ifp->i->if_xzoom - 1) / ifp->i->if_xzoom;
if (sy < qi->qi_ibt_h)
isy = qi->qi_ibt;
else
- isy = qi->qi_ibt + (sy - qi->qi_ibt_h +
ifp->if_yzoom - 1) / ifp->if_yzoom;
+ isy = qi->qi_ibt + (sy - qi->qi_ibt_h +
ifp->i->if_yzoom - 1) / ifp->i->if_yzoom;
if (ix >= qi->qi_iwidth || isy >= qi->qi_iheight) {
fb_log("No RGB (outside image) 2\n");
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