Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Private Attributes
xtbin Class Reference

#include <xlibxtbin.h>

Collaboration diagram for xtbin:
Collaboration graph

List of all members.

Public Member Functions

 xtbin ()
 ~xtbin ()
void xtbin_init ()
void xtbin_realize ()
void xtbin_new (Window aParent)
void xtbin_destroy ()
void xtbin_resize (int aX, int aY, int aWidth, int aHeight)
Window xtbin_xtwindow ()
int xtbin_initialized ()
void sync ()

Private Attributes

int initialized
XlibRgbHandle * mXlibRgbHandle
Window xtwindow
XtAppContext app_context
Window parent_window
Widget xtwidget
Window window
Window oldwindow
int x
int y
int width
int height

Detailed Description

Definition at line 101 of file xlibxtbin.h.

Constructor & Destructor Documentation

Definition at line 53 of file xlibxtbin.cpp.

  initialized = False;
  xtwindow    = None;

Definition at line 58 of file xlibxtbin.cpp.


Member Function Documentation

Definition at line 164 of file xlibxtbin.cpp.

  /* is this really all ? */
  XSync(xtdisplay, False);

Here is the caller graph for this function:

Definition at line 169 of file xlibxtbin.cpp.

  XtUnregisterDrawable(xtdisplay, xtwindow);
  xtwidget->core.window = oldwindow;
  initialized = False;

Here is the call graph for this function:

Definition at line 61 of file xlibxtbin.cpp.

Here is the call graph for this function:

Definition at line 185 of file xlibxtbin.cpp.

  return initialized;
void xtbin::xtbin_new ( Window  aParent)

Definition at line 160 of file xlibxtbin.cpp.

  parent_window = aParent;

Definition at line 70 of file xlibxtbin.cpp.

  Arg args[2];
  int n;
  Widget top_widget;
  Widget embedded;
  XSetWindowAttributes attr;
  unsigned long mask;

  attr.bit_gravity = NorthWestGravity;
  attr.event_mask = 
    ButtonMotionMask |
    ButtonPressMask |
    ButtonReleaseMask |
    EnterWindowMask |
    ExposureMask |
    KeyPressMask |
    KeyReleaseMask |
    LeaveWindowMask |
    PointerMotionMask |
    StructureNotifyMask |
    VisibilityChangeMask |

  attr.colormap         = xxlib_rgb_get_cmap(mXlibRgbHandle);
  attr.background_pixel = xxlib_rgb_xpixel_from_rgb(mXlibRgbHandle, 0xFFC0C0C0);
  attr.border_pixel     = xxlib_rgb_xpixel_from_rgb(mXlibRgbHandle, 0xFF646464);

#ifdef DEBUG  
  printf("attr.background_pixel = %lx, attr.border_pixel = %lx, parent_window = %x\n", 
         (long)attr.border_pixel, (int)parent_window);
#endif /* DEBUG */
  mask = CWBitGravity | CWEventMask | CWBorderPixel | CWBackPixel;

  if (attr.colormap)
    mask |= CWColormap;

  window = XCreateWindow(xtdisplay, parent_window,
                         x, y, width, height, 0, 
                         InputOutput, xxlib_rgb_get_visual(mXlibRgbHandle),
                         mask, &attr);
  XSetWindowBackgroundPixmap(xtdisplay, window, None);
  XSelectInput(xtdisplay, window, ExposureMask);

  XMapWindow(xtdisplay, window);

  top_widget = XtAppCreateShell("drawingArea", "Wrapper",
                                applicationShellWidgetClass, xtdisplay,
                                NULL, 0);

  xtwidget = top_widget;

  n = 0;
  XtSetArg(args[n], XtNheight, height); n++;
  XtSetArg(args[n], XtNwidth,  width);  n++;
  XtSetValues(top_widget, args, n);

  embedded = XtVaCreateWidget("form", compositeWidgetClass, top_widget, NULL);

  n = 0;
  XtSetArg(args[n], XtNheight, height); n++;
  XtSetArg(args[n], XtNwidth,  width);  n++;
  XtSetValues(embedded, args, n);

  oldwindow = top_widget->core.window;
  top_widget->core.window = window;

  XtRegisterDrawable(xtdisplay, window, top_widget);


  /* Now fill out the xtbin info */
  xtwindow = XtWindow(embedded);

  /* Suppress background refresh flashing */
  XSetWindowBackgroundPixmap(xtdisplay, XtWindow(top_widget), None);
  XSetWindowBackgroundPixmap(xtdisplay, XtWindow(embedded),   None);

  /* Listen to all Xt events */
  XSelectInput(xtdisplay, XtWindow(top_widget), 0x0fffff);
  XSelectInput(xtdisplay, XtWindow(embedded),   0x0fffff);


Here is the call graph for this function:

void xtbin::xtbin_resize ( int  aX,
int  aY,
int  aWidth,
int  aHeight 

Definition at line 178 of file xlibxtbin.cpp.

  x = aX;
  y = aY;
  width = aWidth;
  height = aHeight;
Window xtbin::xtbin_xtwindow ( ) [inline]

Definition at line 111 of file xlibxtbin.h.

{ return xtwindow; }

Member Data Documentation

XtAppContext xtbin::app_context [private]

Definition at line 120 of file xlibxtbin.h.

int xtbin::height [private]

Definition at line 125 of file xlibxtbin.h.

Definition at line 116 of file xlibxtbin.h.

XlibRgbHandle* xtbin::mXlibRgbHandle [private]

Definition at line 117 of file xlibxtbin.h.

Window xtbin::oldwindow [private]

Definition at line 124 of file xlibxtbin.h.

Window xtbin::parent_window [private]

Definition at line 121 of file xlibxtbin.h.

int xtbin::width [private]

Definition at line 125 of file xlibxtbin.h.

Window xtbin::window [private]

Definition at line 123 of file xlibxtbin.h.

int xtbin::x [private]

Definition at line 125 of file xlibxtbin.h.

Definition at line 118 of file xlibxtbin.h.

Widget xtbin::xtwidget [private]

Definition at line 122 of file xlibxtbin.h.

Window xtbin::xtwindow [private]

Definition at line 119 of file xlibxtbin.h.

int xtbin::y [private]

Definition at line 125 of file xlibxtbin.h.

The documentation for this class was generated from the following files: