/*----------------------------------------------------------------------*/ void _XfePrimitiveDrawBuffer(Widget w,XEvent * event,Region region) { XCopyArea(XtDisplay(w), _XfePrimitiveDrawable(w), _XfeWindow(w), _XfeBackgroundGC(w), _XfeHighlightThickness(w),_XfeHighlightThickness(w), _XfeWidth(w) - 2 * _XfeHighlightThickness(w), _XfeHeight(w) - 2 * _XfeHighlightThickness(w), _XfeHighlightThickness(w),_XfeHighlightThickness(w)); }
/*----------------------------------------------------------------------*/ static void DrawShadow(Widget w,XEvent * event,Region region,XRectangle * clip_rect) { /* Draw the shadow */ _XmDrawShadows(XtDisplay(w), _XfePrimitiveDrawable(w), _XfeTopShadowGC(w),_XfeBottomShadowGC(w), _XfeHighlightThickness(w), _XfeHighlightThickness(w), _XfeWidth(w) - 2 * _XfeHighlightThickness(w), _XfeHeight(w) - 2 * _XfeHighlightThickness(w), _XfeShadowThickness(w), _XfeShadowType(w)); }
/*----------------------------------------------------------------------*/ static void DrawBackground(Widget w,XEvent *event,Region region,XRectangle * clip_rect) { XfeArrowPart * ap = _XfeArrowPart(w); XfeButtonPart * bp = _XfeButtonPart(w); if (bp->emulate_motif) { return; } #if 0 (*xfeButtonClassRec.xfe_primitive_class.draw_background)(w, event, region, clip_rect); #else /* Fill the background if needed */ if (bp->fill_on_arm && bp->armed) { XFillRectangle(XtDisplay(w), _XfePrimitiveDrawable(w), bp->armed_GC, 0,0, _XfeWidth(w),_XfeHeight(w)); } else if (bp->fill_on_enter && (bp->raised || _XfePointerInside(w))) { XFillRectangle(XtDisplay(w), _XfePrimitiveDrawable(w), bp->label_raised_GC, 0,0, _XfeWidth(w),_XfeHeight(w)); } #endif }
/*----------------------------------------------------------------------*/ void _XfePrimitiveClearBackground(Widget w) { /* Clear the widget background including margins */ if (_XfeBufferType(w) == XmBUFFER_NONE) { XClearArea(XtDisplay(w),_XfeWindow(w), _XfeHighlightThickness(w),_XfeHighlightThickness(w), _XfeWidth(w) - 2 * _XfeHighlightThickness(w), _XfeHeight(w) - 2 * _XfeHighlightThickness(w), False); /*XClearWindow(XtDisplay(w),_XfeWindow(w));*/ } else { XFillRectangle(XtDisplay(w), _XfePrimitiveDrawable(w), _XfeBackgroundGC(w), 0,0, _XfeWidth(w),_XfeHeight(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 } }