BRL-CAD
if_qt.cpp File Reference
#include "common.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <ctype.h>
#include "fb.h"
#include "fb/fb_qt.h"
#include "bu/malloc.h"
#include "bu/file.h"
#include "bu/str.h"
Include dependency graph for if_qt.cpp:

Go to the source code of this file.

Data Structures

class  QMainWindow
 
struct  qtinfo
 
struct  modeflags
 

Macros

#define QI(ptr)   ((struct qtinfo *)((ptr)->u1.p))
 
#define QI_SET(ptr, val)   ((ptr)->u1.p) = (char *) val;
 
#define FLG_LINCMAP   0x10 /* We're using a linear colormap */
 
#define FLG_INIT   0x40 /* Display is fully initialized */
 
#define MODE1_MASK   (1<<1)
 
#define MODE1_TRANSIENT   (0<<1)
 
#define MODE1_LINGERING   (1<<1)
 
#define MODEV_MASK   (7<<1)
 
#define MODE10_MASK   (1<<10)
 
#define MODE10_MALLOC   (0<<10)
 
#define MODE10_SHARED   (1<<10)
 
#define MODE11_MASK   (1<<11)
 
#define MODE11_NORMAL   (0<<11)
 
#define MODE11_ZAP   (1<<11)
 

Functions

HIDDEN void qt_updstate (fb *ifp)
 
void qt_configureWindow (fb *ifp, int width, int height)
 
HIDDEN int qt_configure_window (fb *ifp, int width, int height)
 
HIDDEN int qt_refresh (fb *ifp, int x, int y, int w, int h)
 
int qt_close_existing (fb *ifp)
 
HIDDEN void qt_update (fb *ifp, int x1, int y1, int w, int h)
 
HIDDEN int qt_rmap (fb *ifp, ColorMap *cmp)
 
HIDDEN int qt_wmap (fb *ifp, const ColorMap *cmp)
 
HIDDEN int qt_setup (fb *ifp, int width, int height)
 
HIDDEN void qt_destroy (struct qtinfo *qi)
 
HIDDEN int qt_open (fb *ifp, const char *file, int width, int height)
 
HIDDEN struct fb_platform_specificqt_get_fbps (uint32_t magic)
 
HIDDEN void qt_put_fbps (struct fb_platform_specific *fbps)
 
int _qt_open_existing (fb *ifp, int width, int height, void *qapp, void *qwin, void *qpainter, void *draw, void **qimg)
 
HIDDEN int qt_open_existing (fb *ifp, int width, int height, struct fb_platform_specific *fb_p)
 
HIDDEN int qt_close (fb *ifp)
 
HIDDEN int qt_clear (fb *ifp, unsigned char *pp)
 
HIDDEN ssize_t qt_read (fb *ifp, int x, int y, unsigned char *pixelp, size_t count)
 
HIDDEN ssize_t qt_write (fb *ifp, int x, int y, const unsigned char *pixelp, size_t count)
 
HIDDEN int qt_view (fb *ifp, int xcenter, int ycenter, int xzoom, int yzoom)
 
HIDDEN int qt_getview (fb *ifp, int *xcenter, int *ycenter, int *xzoom, int *yzoom)
 
HIDDEN int qt_setcursor (fb *ifp, const unsigned char *bits, int xbits, int ybits, int xorig, int yorig)
 
HIDDEN int qt_cursor (fb *ifp, int mode, int x, int y)
 
HIDDEN int qt_getcursor (fb *ifp, int *mode, int *x, int *y)
 
HIDDEN int qt_readrect (fb *ifp, int xmin, int ymin, int width, int height, unsigned char *pp)
 
HIDDEN int qt_writerect (fb *ifp, int xmin, int ymin, int width, int height, const unsigned char *pp)
 
HIDDEN int qt_help (fb *ifp)
 
HIDDEN void qt_handle_event (fb *ifp, QEvent *event)
 
HIDDEN int qt_poll (fb *ifp)
 
HIDDEN int qt_flush (fb *ifp)
 
HIDDEN int qt_free (fb *ifp)
 

Variables

fb qt_interface
 

Detailed Description

A Qt Frame Buffer.

Definition in file if_qt.cpp.

Macro Definition Documentation

#define QI_SET (   ptr,
  val 
)    ((ptr)->u1.p) = (char *) val;

Definition at line 110 of file if_qt.cpp.

Referenced by _qt_open_existing(), and qt_open().

#define FLG_LINCMAP   0x10 /* We're using a linear colormap */

Definition at line 113 of file if_qt.cpp.

Referenced by qt_update(), and qt_wmap().

#define FLG_INIT   0x40 /* Display is fully initialized */

Definition at line 114 of file if_qt.cpp.

Referenced by _qt_open_existing(), qt_open(), and qt_wmap().

#define MODE1_MASK   (1<<1)

Definition at line 117 of file if_qt.cpp.

#define MODE1_TRANSIENT   (0<<1)

Definition at line 118 of file if_qt.cpp.

#define MODE1_LINGERING   (1<<1)

Definition at line 119 of file if_qt.cpp.

Referenced by _qt_open_existing(), and qt_open().

#define MODEV_MASK   (7<<1)

Definition at line 121 of file if_qt.cpp.

#define MODE10_MASK   (1<<10)

Definition at line 123 of file if_qt.cpp.

#define MODE10_MALLOC   (0<<10)

Definition at line 124 of file if_qt.cpp.

#define MODE10_SHARED   (1<<10)

Definition at line 125 of file if_qt.cpp.

#define MODE11_MASK   (1<<11)

Definition at line 127 of file if_qt.cpp.

#define MODE11_NORMAL   (0<<11)

Definition at line 128 of file if_qt.cpp.

#define MODE11_ZAP   (1<<11)

Definition at line 129 of file if_qt.cpp.

Function Documentation

void qt_configureWindow ( fb ifp,
int  width,
int  height 
)

Definition at line 394 of file if_qt.cpp.

References FB_CK_FB, fb_log(), fb_internal::if_height, fb_internal::if_width, fb_internal::if_xcenter, fb_internal::if_ycenter, QI, qtinfo::qi_iheight, qtinfo::qi_image, qtinfo::qi_iwidth, qtinfo::qi_parent_img, qtinfo::qi_pix, qtinfo::qi_qheight, qtinfo::qi_qwidth, qt_updstate(), and OSL::Strings::width.

Referenced by qt_configure_window().

Here is the call graph for this function:

HIDDEN int qt_configure_window ( fb ifp,
int  width,
int  height 
)

Definition at line 433 of file if_qt.cpp.

References qt_configureWindow().

Here is the call graph for this function:

HIDDEN int qt_refresh ( fb ifp,
int  x,
int  y,
int  w,
int  h 
)

Definition at line 440 of file if_qt.cpp.

int qt_close_existing ( fb ifp)

Definition at line 446 of file if_qt.cpp.

References FB_CK_FB, QI, and qtinfo::qi_image.

HIDDEN int qt_rmap ( fb ifp,
ColorMap cmp 
)

Definition at line 599 of file if_qt.cpp.

References FB_CK_FB, QI, and qtinfo::qi_rgb_cmap.

HIDDEN int qt_wmap ( fb ifp,
const ColorMap cmp 
)

Definition at line 611 of file if_qt.cpp.

References ColorMap::cm_blue, ColorMap::cm_green, ColorMap::cm_red, FB_CK_FB, fb_make_linear_cmap(), FLG_INIT, FLG_LINCMAP, QI, qtinfo::qi_blumap, qtinfo::qi_flags, qtinfo::qi_grnmap, qtinfo::qi_iheight, qtinfo::qi_iwidth, qtinfo::qi_redmap, qtinfo::qi_rgb_cmap, and qt_update().

Referenced by _qt_open_existing(), and qt_open().

Here is the call graph for this function:

HIDDEN int qt_setup ( fb ifp,
int  width,
int  height 
)

Definition at line 680 of file if_qt.cpp.

References FB_CK_FB, fb_log(), HIDDEN, qtinfo::qapp, QI, qtinfo::qi_image, qtinfo::qi_pix, qtinfo::qi_qheight, qtinfo::qi_qwidth, OSL::Strings::width, and qtinfo::win.

Referenced by qt_open().

Here is the call graph for this function:

HIDDEN void qt_destroy ( struct qtinfo qi)

Definition at line 712 of file if_qt.cpp.

Referenced by qt_close(), and qt_open().

HIDDEN struct fb_platform_specific* qt_get_fbps ( uint32_t  magic)

Definition at line 835 of file if_qt.cpp.

References BU_GET, data, fb_platform_specific::data, fb_platform_specific::magic, and magic.

HIDDEN void qt_put_fbps ( struct fb_platform_specific fbps)

Definition at line 848 of file if_qt.cpp.

References BU_CKMAG, BU_PUT, fb_platform_specific::data, and FB_QT_MAGIC.

int _qt_open_existing ( fb ifp,
int  width,
int  height,
void *  qapp,
void *  qwin,
void *  qpainter,
void *  draw,
void **  qimg 
)
HIDDEN int qt_open_existing ( fb ifp,
int  width,
int  height,
struct fb_platform_specific fb_p 
)

Definition at line 947 of file if_qt.cpp.

References _qt_open_existing(), BU_CKMAG, fb_platform_specific::data, and FB_QT_MAGIC.

Here is the call graph for this function:

HIDDEN int qt_close ( fb ifp)

Definition at line 957 of file if_qt.cpp.

References qtinfo::alive, qtinfo::qapp, QI, and qt_destroy().

Here is the call graph for this function:

HIDDEN int qt_clear ( fb ifp,
unsigned char *  pp 
)

Definition at line 973 of file if_qt.cpp.

References FB_CK_FB, memset(), QI, qtinfo::qi_iheight, qtinfo::qi_iwidth, qtinfo::qi_mem, qtinfo::qi_qheight, and qt_update().

Here is the call graph for this function:

HIDDEN ssize_t qt_read ( fb ifp,
int  x,
int  y,
unsigned char *  pixelp,
size_t  count 
)

Definition at line 1014 of file if_qt.cpp.

References FB_CK_FB, QI, qtinfo::qi_iheight, qtinfo::qi_iwidth, and qtinfo::qi_mem.

HIDDEN ssize_t qt_write ( fb ifp,
int  x,
int  y,
const unsigned char *  pixelp,
size_t  count 
)

Definition at line 1037 of file if_qt.cpp.

References qtinfo::alive, qtinfo::drawFb, FB_CK_FB, QI, qtinfo::qi_iheight, qtinfo::qi_iwidth, qtinfo::qi_mem, and qt_update().

Here is the call graph for this function:

HIDDEN int qt_view ( fb ifp,
int  xcenter,
int  ycenter,
int  xzoom,
int  yzoom 
)

Definition at line 1077 of file if_qt.cpp.

References FB_CK_FB, fb_internal::if_xcenter, fb_internal::if_xzoom, fb_internal::if_ycenter, fb_internal::if_yzoom, QI, qtinfo::qi_iheight, qtinfo::qi_iwidth, qt_update(), and qt_updstate().

Here is the call graph for this function:

HIDDEN int qt_getview ( fb ifp,
int *  xcenter,
int *  ycenter,
int *  xzoom,
int *  yzoom 
)
HIDDEN int qt_setcursor ( fb ifp,
const unsigned char *  bits,
int  xbits,
int  ybits,
int  xorig,
int  yorig 
)

Definition at line 1123 of file if_qt.cpp.

References fb_log().

Here is the call graph for this function:

HIDDEN int qt_cursor ( fb ifp,
int  mode,
int  x,
int  y 
)

Definition at line 1132 of file if_qt.cpp.

References fb_log().

Here is the call graph for this function:

HIDDEN int qt_getcursor ( fb ifp,
int *  mode,
int *  x,
int *  y 
)

Definition at line 1141 of file if_qt.cpp.

References fb_log().

Here is the call graph for this function:

HIDDEN int qt_readrect ( fb ifp,
int  xmin,
int  ymin,
int  width,
int  height,
unsigned char *  pp 
)

Definition at line 1150 of file if_qt.cpp.

References FB_CK_FB, QI, qtinfo::qi_iheight, qtinfo::qi_iwidth, and qtinfo::qi_mem.

HIDDEN int qt_writerect ( fb ifp,
int  xmin,
int  ymin,
int  width,
int  height,
const unsigned char *  pp 
)

Definition at line 1189 of file if_qt.cpp.

References FB_CK_FB, QI, qtinfo::qi_iheight, qtinfo::qi_iwidth, qtinfo::qi_mem, and qt_update().

Here is the call graph for this function:

HIDDEN int qt_help ( fb ifp)

Definition at line 1230 of file if_qt.cpp.

References fb_log(), fb_internal::if_height, fb_internal::if_max_height, fb_internal::if_max_width, fb_internal::if_name, fb_internal::if_type, fb_internal::if_width, and qt_interface.

Referenced by qt_handle_event().

Here is the call graph for this function:

HIDDEN void qt_handle_event ( fb ifp,
QEvent *  event 
)

Definition at line 1246 of file if_qt.cpp.

References FB_CK_FB, fb_log(), if(), fb_internal::if_xzoom, fb_internal::if_yzoom, qtinfo::qapp, QI, qtinfo::qi_ibt, qtinfo::qi_ibt_h, qtinfo::qi_iheight, qtinfo::qi_ilf, qtinfo::qi_ilf_w, qtinfo::qi_iwidth, qtinfo::qi_mem, qtinfo::qi_qheight, qtinfo::qi_xbt, qtinfo::qi_xlf, and qt_help().

Referenced by QMainWindow::event().

Here is the call graph for this function:

HIDDEN int qt_poll ( fb ifp)

Definition at line 1319 of file if_qt.cpp.

References fb_log().

Here is the call graph for this function:

HIDDEN int qt_flush ( fb ifp)

Definition at line 1328 of file if_qt.cpp.

References qtinfo::qapp, and QI.

HIDDEN int qt_free ( fb ifp)

Definition at line 1339 of file if_qt.cpp.

References fb_log().

Here is the call graph for this function:

Variable Documentation

fb qt_interface

Definition at line 1347 of file if_qt.cpp.

Referenced by qt_help().