/*----------------------------------------------------------------------*/ static Boolean SetValues(Widget ow,Widget rw,Widget nw,ArgList args,Cardinal *nargs) { XfeArrowPart * np = _XfeArrowPart(nw); XfeArrowPart * op = _XfeArrowPart(ow); /* arrow_direction */ if (np->arrow_direction != op->arrow_direction) { /* Make sure arrow direction is ok */ XfeRepTypeCheck(nw,XmRArrowDirection,&np->arrow_direction, XmARROW_DOWN); _XfeConfigFlags(nw) |= XfeConfigExpose; } /* arrow_width */ if ((np->arrow_width != op->arrow_width) || (np->arrow_height != op->arrow_height)) { _XfeConfigFlags(nw) |= XfeConfigGLE; } /* foreground or background */ if ((_XfeForeground(nw) != _XfeForeground(ow)) || (_XfeBackgroundPixel(nw) != _XfeBackgroundPixel(ow))) { XtReleaseGC(nw,np->arrow_insens_GC); np->arrow_insens_GC = XfeAllocateColorGc(nw,_XfeForeground(nw),_XfeBackgroundPixel(nw),False); } return _XfePrimitiveChainSetValues(ow,rw,nw,xfeArrowWidgetClass); }
/*----------------------------------------------------------------------*/ static void Initialize(Widget rw,Widget nw,ArgList args,Cardinal *nargs) { XfeArrowPart * ap = _XfeArrowPart(nw); /* Make sure rep types are ok */ XfeRepTypeCheck(nw,XmRArrowDirection,&ap->arrow_direction,XmARROW_DOWN); /* Allocate the insensitve GC */ ap->arrow_insens_GC = XfeAllocateColorGc(nw,_XfeForeground(nw),_XfeBackgroundPixel(nw),False); /* Finish of initialization */ _XfePrimitiveChainInitialize(rw,nw,xfeArrowWidgetClass); }
/*----------------------------------------------------------------------*/ void _XfePrimitiveAllocateBackgroundGC(Widget w) { /* Make sure the background gc gets allocated only once */ if (_XfeBackgroundGC(w)) { return; } if (_XfePixmapGood(_XfeBackgroundPixmap(w))) { _XfeBackgroundGC(w) = XfeAllocateTileGc(w,_XfeBackgroundPixmap(w)); } else { _XfeBackgroundGC(w) = XfeAllocateColorGc(w,_XfeBackgroundPixel(w), None,True); } }