Exemplo n.º 1
0
static void 
Realize(
        register Widget w,
        XtValueMask *p_valueMask,
        XSetWindowAttributes *attributes )
{
	XmDisplay   dd = (XmDisplay) XmGetXmDisplay(XtDisplay(w));
	Cursor SashCursor = 
		((XmDisplayInfo *)(dd->display.displayInfo))->SashCursor;
	
	if (0L == SashCursor)
		{
		/* create some data shared among all instances on this 
		** display; the first one along can create it, and 
		** any one can remove it; note no reference count
		*/
        	SashCursor = 
		((XmDisplayInfo *)(dd->display.displayInfo))->SashCursor = 
			XCreateFontCursor(XtDisplay(w), XC_crosshair);
		XtAddCallback((Widget)dd, XtNdestroyCallback, 
			SashDisplayDestroyCallback, (XtPointer) NULL);
		}

	attributes->cursor = SashCursor;
	XtCreateWindow (w, InputOutput, CopyFromParent, 
		*p_valueMask | CWCursor, attributes);
}
Exemplo n.º 2
0
Arquivo: Core.c Projeto: aosm/X11libs
static void CoreRealize(
    Widget		 widget,
    XtValueMask		 *value_mask,
    XSetWindowAttributes *attributes)
{
    XtCreateWindow(widget, (unsigned int) InputOutput,
	(Visual *) CopyFromParent, *value_mask, attributes);
} /* CoreRealize */
Exemplo n.º 3
0
static void
Realize (Widget w, Mask *valueMask, XSetWindowAttributes *attributes)
{
  attributes->bit_gravity = NorthWestGravity;
  *valueMask |= CWBitGravity;

  XtCreateWindow (w, (unsigned) InputOutput, (Visual *) CopyFromParent,
		  *valueMask, attributes);
}
Exemplo n.º 4
0
static void Realize(Widget w,Mask *valueMask,XSetWindowAttributes *attributes) {
    register GLwDrawingAreaWidget glw=(GLwDrawingAreaWidget)w;
    GLwDrawingAreaCallbackStruct cb;
    Widget parentShell;
    Status status;
    Window windows[2],*windowsReturn,*windowList;
    int countReturn,i;

    /* if we haven't requested that the background be both installed and
     * allocated, don't install it.
     */
    if(!(glw->glwDrawingArea.installBackground && glw->glwDrawingArea.allocateBackground)) {
        *valueMask&=~CWBackPixel;
    }

    XtCreateWindow(w,(unsigned int)InputOutput,glw->glwDrawingArea.visualInfo->visual,*valueMask,attributes);

    /* if appropriate, call XSetWMColormapWindows to install the colormap */
    if(glw->glwDrawingArea.installColormap) {

        /* Get parent shell */
        for(parentShell=XtParent(w); parentShell&&!XtIsShell(parentShell); parentShell=XtParent(parentShell));

        if(parentShell && XtWindow(parentShell)) {

            /* check to see if there is already a property */
            status=XGetWMColormapWindows(XtDisplay(parentShell),XtWindow(parentShell),&windowsReturn,&countReturn);

            /* if no property, just create one */
            if(!status) {
                windows[0]=XtWindow(w);
                windows[1]=XtWindow(parentShell);
                XSetWMColormapWindows(XtDisplay(parentShell),XtWindow(parentShell),windows,2);
            }

            /* there was a property, add myself to the beginning */
            else {
                windowList=(Window *)XtMalloc((sizeof(Window))*(countReturn+1));
                windowList[0]=XtWindow(w);
                for(i=0; i<countReturn; i++) windowList[i+1]=windowsReturn[i];
                XSetWMColormapWindows(XtDisplay(parentShell),XtWindow(parentShell),windowList,countReturn+1);
                XtFree((char*)windowList);
                XtFree((char*)windowsReturn);
            }
        }
        else {
            warning(w,"Could not set colormap property on parent shell");
        }
    }

    /* Invoke callbacks */
    cb.reason=GLwCR_GINIT;
    cb.event=NULL;
    cb.width=glw->core.width;
    cb.height=glw->core.height;
    XtCallCallbackList((Widget)glw,glw->glwDrawingArea.ginitCallback,&cb);
}
Exemplo n.º 5
0
static void
Realize (Widget w, XtValueMask *valueMask, XSetWindowAttributes *attrs)
{
	DviWidget	dw = (DviWidget) w;
	XGCValues	values;

	if (dw->dvi.backing_store != Always + WhenMapped + NotUseful) {
		attrs->backing_store = dw->dvi.backing_store;
		*valueMask |= CWBackingStore;
	}
	XtCreateWindow (w, (unsigned)InputOutput, (Visual *) CopyFromParent,
			*valueMask, attrs);
	values.foreground = dw->dvi.foreground;
	values.cap_style = CapRound;
	values.join_style = JoinRound;
	values.line_width = dw->dvi.line_width;
	dw->dvi.normal_GC = XCreateGC (XtDisplay (w), XtWindow (w),
				       GCForeground|GCCapStyle|GCJoinStyle
				       |GCLineWidth,
				       &values);
	dw->dvi.gray[0] = XCreateBitmapFromData(XtDisplay (w), XtWindow (w),
					     gray1_bits,
					     gray1_width, gray1_height);
	dw->dvi.gray[1] = XCreateBitmapFromData(XtDisplay (w), XtWindow (w),
					     gray2_bits,
					     gray2_width, gray2_height);
	dw->dvi.gray[2] = XCreateBitmapFromData(XtDisplay (w), XtWindow (w),
					     gray3_bits,
					     gray3_width, gray3_height);
	dw->dvi.gray[3] = XCreateBitmapFromData(XtDisplay (w), XtWindow (w),
					     gray4_bits,
					     gray4_width, gray4_height);
	dw->dvi.gray[4] = XCreateBitmapFromData(XtDisplay (w), XtWindow (w),
					     gray5_bits,
					     gray5_width, gray5_height);
	dw->dvi.gray[5] = XCreateBitmapFromData(XtDisplay (w), XtWindow (w),
					     gray6_bits,
					     gray6_width, gray6_height);
	dw->dvi.gray[6] = XCreateBitmapFromData(XtDisplay (w), XtWindow (w),
					     gray7_bits,
					     gray7_width, gray7_height);
	dw->dvi.gray[7] = XCreateBitmapFromData(XtDisplay (w), XtWindow (w),
					     gray8_bits,
					     gray8_width, gray8_height);
	values.background = dw->dvi.background;
	values.stipple = dw->dvi.gray[5];
	dw->dvi.fill_GC = XCreateGC (XtDisplay (w), XtWindow (w),
				     GCForeground|GCBackground|GCStipple,
				     &values);

	dw->dvi.fill_type = 9;

	if (dw->dvi.file)
		OpenFile (dw);
	ParseFontMap (dw);
}
Exemplo n.º 6
0
int
main(
  int argc,
  char ** argv )
{

  XtAppContext app_context;
  Widget TheWindow = XtVaAppInitialize( &app_context,
				        "Full Screen Test",
				        NULL, 0,
				        &argc, argv,
				        NULL,
				        NULL );

  if (TheWindow == NULL) exit(1);

  Display *display=XOpenDisplay(NULL);

  int screen = DefaultScreen(display);

  // Destroy the window asociated to the widget
  XtUnrealizeWidget( TheWindow );

  // Put some values in the size, otherwise the window creation will complain
  XtConfigureWidget( TheWindow, 0, 0, 10, 10, 0 );

  // Now set the attributes for the new window
  XSetWindowAttributes attr;

  // We'll handle it; make the Window manager leave us alone
  attr.override_redirect = true;

  Visual *visual =  DefaultVisual(display,screen);

  // Create a window with our attributes
  XtCreateWindow( TheWindow, InputOutput, visual, CWOverrideRedirect, &attr );

  SoXt::init( TheWindow );

  SoXtExaminerViewer *Viewer =
    new SoXtExaminerViewer(TheWindow, "My Examiner Viewer");

  Viewer->setDecoration(FALSE);
  Viewer->setBorder(FALSE);

  SoXt::show(TheWindow);

  // Set size and position; no border
  XtConfigureWidget( TheWindow, 0, 0,
		     DisplayWidth( display, DefaultScreen( display ) ),
		     DisplayHeight( display, DefaultScreen( display ) ), 0 );


  SoXt::mainLoop();

}
Exemplo n.º 7
0
static void
Realize(Widget w, XtValueMask *valueMask, XSetWindowAttributes *attributes)
{
    XbaeClipWidget cw = (XbaeClipWidget)w;
  /*
   * Don't call our superclasses realize method, because Primitive sets
   * bit_gravity and do_not_propagate
   */
    XtCreateWindow((Widget)cw, InputOutput, CopyFromParent,
      *valueMask, attributes);
}
Exemplo n.º 8
0
Arquivo: gwin.c Projeto: deadpixi/sam
static void
Realize(Widget w, XtValueMask *valueMask, XSetWindowAttributes *attrs)
{
    *valueMask |= CWBackingStore;
    attrs->backing_store = Always;

    XtCreateWindow(w, InputOutput, (Visual *)0, *valueMask, attrs);
    XtSetKeyboardFocus(w->core.parent, w);
    if ((modmap = XGetModifierMapping(XtDisplay(w))))
        keypermod = modmap->max_keypermod;

    Resize(w);
}
Exemplo n.º 9
0
Arquivo: Simple.c Projeto: aosm/X11
static void
XawSimpleRealize(Widget w, Mask *valueMask, XSetWindowAttributes *attributes)
{
#ifndef OLDXAW
    XawPixmap *pixmap;
#endif
    Pixmap border_pixmap = CopyFromParent;

  if (!XtIsSensitive(w))
    {
	/* change border to gray; have to remember the old one,
	 * so XtDestroyWidget deletes the proper one */
	if (((SimpleWidget)w)->simple.insensitive_border == None)
	    ((SimpleWidget)w)->simple.insensitive_border =
		XmuCreateStippledPixmap(XtScreen(w),
					w->core.border_pixel, 
					w->core.background_pixel,
					w->core.depth);
        border_pixmap = w->core.border_pixmap;
	attributes->border_pixmap =
	  w->core.border_pixmap = ((SimpleWidget)w)->simple.insensitive_border;

	*valueMask |= CWBorderPixmap;
	*valueMask &= ~CWBorderPixel;
    }

    ConvertCursor(w);

    if ((attributes->cursor = ((SimpleWidget)w)->simple.cursor) != None)
	*valueMask |= CWCursor;

  XtCreateWindow(w, InputOutput, (Visual *)CopyFromParent,
		 *valueMask, attributes);

    if (!XtIsSensitive(w))
	w->core.border_pixmap = border_pixmap;

#ifndef OLDXAW
    if (w->core.background_pixmap > XtUnspecifiedPixmap) {
	pixmap = XawPixmapFromXPixmap(w->core.background_pixmap, XtScreen(w),
				      w->core.colormap, w->core.depth);
	if (pixmap && pixmap->mask)
	    XawReshapeWidget(w, pixmap);
    }

    if (((SimpleWidget)w)->simple.tip)
	XawTipEnable(w);
#endif
}
Exemplo n.º 10
0
Arquivo: Eyes.c Projeto: aosm/X11
static void Realize (
     Widget gw,
     XtValueMask *valueMask,
     XSetWindowAttributes *attrs)
{
    EyesWidget	w = (EyesWidget)gw;

    if (w->eyes.backing_store != Always + WhenMapped + NotUseful) {
     	attrs->backing_store = w->eyes.backing_store;
	*valueMask |= CWBackingStore;
    }
    XtCreateWindow( gw, (unsigned)InputOutput, (Visual *)CopyFromParent,
		     *valueMask, attrs );
    Resize (gw);
    w->eyes.interval_id =
	XtAppAddTimeOut(XtWidgetToApplicationContext(gw),
			delays[w->eyes.update], draw_it, (XtPointer)gw);
}
Exemplo n.º 11
0
/*****
* Name:			Realize
* Return Type:	void
* Description:	XmBalloon realize class method
* In:
*	w:			XmBalloon Widget id;
*	valueMask:	mask to use for window creation;
*	attrs:		window attributes as set by parent classes
* Returns:
*	nothing.
*****/
static void
Realize(Widget w, XtValueMask *valueMask, XSetWindowAttributes *attrs)
{
	BALLOON = (XmBalloonWidget)w;

	if(ATTR(backing_store) != Always + WhenMapped + NotUseful)
	{
		attrs->backing_store |= ATTR(backing_store);
		*valueMask |= CWBackingStore;
	}

	if(ATTR(transparent))
	{
		attrs->background_pixel = ATTR(foreground);
		*valueMask |= CWBackPixel;
		*valueMask &= ~CWBackPixmap;
	}
	XtCreateWindow(w, (unsigned int)InputOutput, (Visual*)CopyFromParent,
		*valueMask, attrs);
}
Exemplo n.º 12
0
static void Realize (Widget gw, XtValueMask *valueMask,
		     XSetWindowAttributes *attrs)
{
     ClockWidget	w = (ClockWidget)gw;

    if (w->clock.backing_store != Always + WhenMapped + NotUseful) {
     	attrs->backing_store = w->clock.backing_store;
	*valueMask |= CWBackingStore;
    }
    if (w->clock.transparent)
    {
	attrs->background_pixel = w->clock.minute;
	*valueMask |= CWBackPixel;
	*valueMask &= ~CWBackPixmap;
    }
    XtCreateWindow( gw, (unsigned)InputOutput, (Visual *)CopyFromParent,
		     *valueMask, attrs );
    if (!w->clock.transparent)
	Resize (gw);
    new_time ((XtPointer) gw, NULL);
}
Exemplo n.º 13
0
static void 
Realize(Widget w, Mask *valueMask, XSetWindowAttributes *attributes)
{
    XtCreateWindow (w, InputOutput, CopyFromParent, *valueMask, attributes);
}
Exemplo n.º 14
0
static void Realize (
     Widget gw,
     XtValueMask *valueMask,
     XSetWindowAttributes *attrs)
{
#ifdef XPM
    LoginWidget	w = (LoginWidget) gw;
    Cursor cursor;
#endif /* XPM */
    XtCreateWindow( gw, (unsigned)InputOutput, (Visual *)CopyFromParent,
		     *valueMask, attrs );
    InitI18N(gw);
#ifdef XPM
    cursor = XCreateFontCursor(XtDisplay(gw), XC_left_ptr);
    XDefineCursor(XtDisplay(gw), XtWindow(gw), cursor);

    /* 
     * Check if Pixmap was valid
     */
    if (True == w->login.logoValid)
    {
        /*
         * Create pixmap window 
         */
        {
            unsigned long valueMask = CWBackPixel | CWBackPixmap;
            XSetWindowAttributes windowAttributes = { 0 };

            windowAttributes.background_pixel = w->core.background_pixel;
            windowAttributes.background_pixmap = None;

            w->login.logoWindow = XCreateWindow(XtDisplay(w),
                XtWindow(w),
                w->core.width - w->login.outframewidth -
                    w->login.logoWidth - w->login.logoPadding,
                (w->core.height - w->login.logoHeight) /2,
                w->login.logoWidth, w->login.logoHeight, 0,
                CopyFromParent, InputOutput, CopyFromParent,
                valueMask, &windowAttributes);
        }

        /*
         * check if we can use shape extension
         */
        if (True == w->login.useShape)
        {
            int foo, bar;

            if (XShapeQueryExtension(XtDisplay(w), &foo, &bar) == TRUE)
            {
                XShapeCombineMask(XtDisplay(w), w->login.logoWindow,
                    ShapeBounding, w->login.logoX, w->login.logoY,
                    w->login.logoMask, ShapeSet);
            }
        }

        XSetWindowBackgroundPixmap(XtDisplay(w), w->login.logoWindow,
            w->login.logoPixmap);
        XMapWindow(XtDisplay(w), w->login.logoWindow);
    }
#endif /* XPM */
}
Exemplo n.º 15
0
static void CanvasRealize(Widget widget, XtValueMask *value_mask, XSetWindowAttributes *attributes)
{
    CanvasWidget cw = (CanvasWidget)widget;
    XtCreateWindow(widget, (unsigned int)InputOutput, (Visual *)cw->canvas.visual, *value_mask, attributes);
} /* CoreRealize */