/*ARGSUSED*/ static Boolean _XawCvtPixmapToString(Display *dpy, XrmValue *args, Cardinal *num_args, XrmValue *fromVal, XrmValue *toVal, XtPointer *converter_data) { XawPixmap *xaw_pixmap; Pixmap pixmap; Screen *screen; Colormap colormap; int depth; String buffer = NULL; Cardinal size; if (*num_args != 3) { XtAppWarningMsg(XtDisplayToApplicationContext(dpy), XtNwrongParameters, "cvtPixmapToString", XtCToolkitError, "Pixmap to String conversion needs screen, " "colormap, and depth arguments", NULL, NULL); return (False); } screen = *(Screen **)args[0].addr; colormap = *(Colormap *)args[1].addr; depth = *(int *)args[2].addr; pixmap = *(Pixmap *)(fromVal[0].addr); switch (pixmap) { case None: buffer = "None"; break; case ParentRelative: buffer = "ParentRelative"; break; case XtUnspecifiedPixmap: buffer = "XtUnspecifiedPixmap"; break; default: xaw_pixmap = XawPixmapFromXPixmap(pixmap, screen, colormap, depth); if (xaw_pixmap) buffer = xaw_pixmap->name; break; } if (!buffer) /* Bad Pixmap or Pixmap was not loaded by XawLoadPixmap() */ return (_XawCvtCARD32ToString(dpy, args, num_args, fromVal, toVal, converter_data)); size = strlen(buffer) + 1; string_done(buffer); }
/*ARGSUSED*/ static Boolean XawFormSetValues(Widget current, Widget request, Widget cnew, ArgList args, Cardinal *num_args) { #ifndef OLDXAW FormWidget f_old = (FormWidget)current; FormWidget f_new = (FormWidget)cnew; if (f_old->core.background_pixmap != f_new->core.background_pixmap) { XawPixmap *opix, *npix; opix = XawPixmapFromXPixmap(f_old->core.background_pixmap, XtScreen(f_old), f_old->core.colormap, f_old->core.depth); npix = XawPixmapFromXPixmap(f_new->core.background_pixmap, XtScreen(f_new), f_new->core.colormap, f_new->core.depth); if ((npix && npix->mask) || (opix && opix->mask)) XawReshapeWidget(cnew, npix); } #endif /* OLDXAW */ return (False); }
static void XawFormRealize(Widget w, Mask *mask, XSetWindowAttributes *attr) { XawPixmap *pixmap; (*formWidgetClass->core_class.superclass->core_class.realize)(w, mask, attr); 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); } }
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 }
/*ARGSUSED*/ static Boolean XawSimpleSetValues(Widget current, Widget request, Widget cnew, ArgList args, Cardinal *num_args) { SimpleWidget s_old = (SimpleWidget)current; SimpleWidget s_new = (SimpleWidget)cnew; Bool new_cursor = False; /* this disables user changes after creation */ s_new->simple.international = s_old->simple.international; if (XtIsSensitive(current) != XtIsSensitive(cnew)) (*((SimpleWidgetClass)XtClass(cnew))->simple_class.change_sensitive) (cnew); if (s_old->simple.cursor != s_new->simple.cursor) new_cursor = True; /* * We are not handling the string cursor_name correctly here */ if (s_old->simple.pointer_fg != s_new->simple.pointer_fg || s_old->simple.pointer_bg != s_new->simple.pointer_bg || s_old->simple.cursor_name != s_new->simple.cursor_name) { ConvertCursor(cnew); new_cursor = True; } if (new_cursor && XtIsRealized(cnew)) { if (s_new->simple.cursor != None) XDefineCursor(XtDisplay(cnew), XtWindow(cnew), s_new->simple.cursor); else XUndefineCursor(XtDisplay(cnew), XtWindow(cnew)); } #ifndef OLDXAW if (s_old->core.background_pixmap != s_new->core.background_pixmap) { XawPixmap *opix, *npix; opix = XawPixmapFromXPixmap(s_old->core.background_pixmap, XtScreen(s_old), s_old->core.colormap, s_old->core.depth); npix = XawPixmapFromXPixmap(s_new->core.background_pixmap, XtScreen(s_new), s_new->core.colormap, s_new->core.depth); if ((npix && npix->mask) || (opix && opix->mask)) XawReshapeWidget(cnew, npix); } if (s_old->simple.tip != s_new->simple.tip) { if (s_old->simple.tip) XtFree((XtPointer)s_old->simple.tip); if (s_new->simple.tip) s_new->simple.tip = XtNewString(s_new->simple.tip); } if (s_old->simple.tip && !s_new->simple.tip) XawTipDisable(cnew); else if (!s_old->simple.tip && s_new->simple.tip) XawTipEnable(cnew); if (s_old->simple.display_list != s_new->simple.display_list) return (True); #endif /* OLDXAW */ return (False); }