/*----------------------------------------------------------------------*/ static Boolean WidgetDisplayRect(Widget w,XRectangle *rect) { rect->x = _XfeRectX(w); rect->y = _XfeRectY(w); rect->height = _XfeRectHeight(w); rect->width = _XfeRectWidth(w); return (rect->width && rect->height); }
/*----------------------------------------------------------------------*/ void _XfePrimitiveDrawEverything(Widget w,XEvent * event,Region region) { static XRectangle rect; /* Clear the buffer background if needed */ if (_XfeBufferType(w) != XmBUFFER_NONE) { _XfePrimitiveClearBackground(w); } /* Draw Background */ XfeRectSet(&rect, _XfeRectX(w) - _XfeMarginLeft(w), _XfeRectY(w) - _XfeMarginTop(w), _XfeRectWidth(w) + _XfeMarginLeft(w) + _XfeMarginRight(w), _XfeRectHeight(w) + _XfeMarginTop(w) + _XfeMarginBottom(w)); _XfePrimitiveDrawBackground(w,event,region,&rect); /* Draw -or Erase the Widget's highlight if needed */ if (_XfeHighlighted(w) && _XfeHighlightThickness(w)) { _XfePrimitiveBorderHighlight(w); } else { _XfePrimitiveBorderUnhighlight(w); } /* Draw Shadow */ _XfePrimitiveDrawShadow(w,event,region,&_XfeWidgetRect(w)); /* Draw Components */ _XfePrimitiveDrawComponents(w,event,region,&_XfeWidgetRect(w)); }
/*----------------------------------------------------------------------*/ static void DrawArrow(Widget w,XEvent *event,Region region,XRectangle * clip_rect) { XfeArrowPart * ap = _XfeArrowPart(w); XfeButtonPart * bp = _XfeButtonPart(w); Dimension width = XfeMin(ap->arrow_width,_XfeRectWidth(w)); Dimension height = XfeMin(ap->arrow_height,_XfeRectHeight(w)); Position x = (_XfeWidth(w) - width) / 2; Position y = (_XfeHeight(w) - height) / 2; /* Draw the arrow as an XmArrowButton would */ if (bp->emulate_motif) { GC gc = _XfeBackgroundGC(w); if (bp->raised) { if (bp->raise_on_enter && bp->raised) { gc = bp->label_raised_GC; } } else if (bp->armed) { if (bp->fill_on_arm && bp->armed) { gc = bp->armed_GC; } } XfeDrawMotifArrow(XtDisplay(w), _XfePrimitiveDrawable(w), _XfeTopShadowGC(w), _XfeBottomShadowGC(w), gc, x, y, width, height, ap->arrow_direction, 2, /* hard coded to be compatible with Motif */ bp->armed); } /* Draw the arrow as an XfeButton would */ else { #if 1 XfeDrawArrow(XtDisplay(w), _XfePrimitiveDrawable(w), ARROW_GC(w,ap), x,y, width,height, ap->arrow_direction); #else XfeDrawMotifArrow(XtDisplay(w), _XfePrimitiveDrawable(w), NULL, NULL, ARROW_GC(w,ap), x,y, width,height, ap->arrow_direction, 0, False); #endif } }