Back to index

plt-scheme  4.2.1
xwArrow.c
Go to the documentation of this file.
00001 /* Generated by wbuild
00002  * (generator version 3.2)
00003  */
00004 #include <X11/IntrinsicP.h>
00005 #include <X11/StringDefs.h>
00006 #include "xwGray.h"
00007 #include <stdio.h>
00008 #include <assert.h>
00009 #include <wxtimeout.h>
00010 #include "xwTools3d.h"
00011 #include "xwTabString.h"
00012 #include <./xwArrowP.h>
00013 static void activate_and_start_timer(
00014 #if NeedFunctionPrototypes
00015 Widget,XEvent*,String*,Cardinal*
00016 #endif
00017 );
00018 static void stop_timer(
00019 #if NeedFunctionPrototypes
00020 Widget,XEvent*,String*,Cardinal*
00021 #endif
00022 );
00023 static void push_up(
00024 #if NeedFunctionPrototypes
00025 Widget,XEvent*,String*,Cardinal*
00026 #endif
00027 );
00028 static void push_down(
00029 #if NeedFunctionPrototypes
00030 Widget,XEvent*,String*,Cardinal*
00031 #endif
00032 );
00033 
00034 static XtActionsRec actionsList[] = {
00035 {"activate_and_start_timer", activate_and_start_timer},
00036 {"stop_timer", stop_timer},
00037 {"push_up", push_up},
00038 {"push_down", push_down},
00039 };
00040 
00041 static char defaultTranslations[] = "\
00042 <Btn1Down>: push_down() activate_and_start_timer() \n\
00043 <Btn1Up>: push_up() stop_timer() \n\
00044 ";
00045 static void _resolve_inheritance(
00046 #if NeedFunctionPrototypes
00047 WidgetClass
00048 #endif
00049 );
00050 static void initialize(
00051 #if NeedFunctionPrototypes
00052 Widget ,Widget,ArgList ,Cardinal *
00053 #endif
00054 );
00055 static void destroy(
00056 #if NeedFunctionPrototypes
00057 Widget
00058 #endif
00059 );
00060 static Boolean  set_values(
00061 #if NeedFunctionPrototypes
00062 Widget ,Widget ,Widget,ArgList ,Cardinal *
00063 #endif
00064 );
00065 static void _expose(
00066 #if NeedFunctionPrototypes
00067 Widget,XEvent *,Region 
00068 #endif
00069 );
00070 static void  draw_arrow(
00071 #if NeedFunctionPrototypes
00072 Widget,int 
00073 #endif
00074 );
00075 static void timer_callback(
00076 #if NeedFunctionPrototypes
00077 XtPointer ,XtIntervalId *
00078 #endif
00079 );
00080 static void create_arrowgc(
00081 #if NeedFunctionPrototypes
00082 Widget
00083 #endif
00084 );
00085 static void create_arrowlightgc(
00086 #if NeedFunctionPrototypes
00087 Widget
00088 #endif
00089 );
00090 static void create_arrowdarkgc(
00091 #if NeedFunctionPrototypes
00092 Widget
00093 #endif
00094 );
00095 /*ARGSUSED*/
00096 #if NeedFunctionPrototypes
00097 static void timer_callback(XtPointer  client_data,XtIntervalId * timer)
00098 #else
00099 static void timer_callback(client_data,timer)XtPointer  client_data;XtIntervalId * timer;
00100 #endif
00101 {
00102     Widget self = (Widget) client_data;
00103 
00104     XtCallCallbackList(self, ((XfwfArrowWidget)self)->xfwfArrow.callback, NULL);
00105     if (((XfwfArrowWidget)self)->xfwfArrow.timer) { /* i.e., no stop issued by callback */
00106       if (((XfwfArrowWidget)self)->xfwfArrow.timer != 0x1)
00107         wxRemoveTimeOut(((XfwfArrowWidget)self)->xfwfArrow.timer);
00108       ((XfwfArrowWidget)self)->xfwfArrow.timer = wxAppAddTimeOut(XtWidgetToApplicationContext(self),
00109                                  ((XfwfArrowWidget)self)->xfwfArrow.repeatDelay, timer_callback, self, self);
00110     }
00111 }
00112 /*ARGSUSED*/
00113 #if NeedFunctionPrototypes
00114 static void create_arrowgc(Widget self)
00115 #else
00116 static void create_arrowgc(self)Widget self;
00117 #endif
00118 {
00119     XtGCMask mask;
00120     XGCValues values;
00121 
00122     if (((XfwfArrowWidget)self)->xfwfArrow.arrowgc != NULL) XtReleaseGC(self, ((XfwfArrowWidget)self)->xfwfArrow.arrowgc);
00123     mask = GCForeground;
00124     values.foreground = ((XfwfArrowWidget)self)->xfwfArrow.foreground;
00125     ((XfwfArrowWidget)self)->xfwfArrow.arrowgc = XtGetGC(self, mask, &values);
00126 }
00127 /*ARGSUSED*/
00128 #if NeedFunctionPrototypes
00129 static void create_arrowlightgc(Widget self)
00130 #else
00131 static void create_arrowlightgc(self)Widget self;
00132 #endif
00133 {
00134     XtGCMask mask=0;
00135     XGCValues values;
00136 
00137     if (((XfwfArrowWidget)self)->xfwfArrow.arrowlightgc != NULL) XtReleaseGC(self, ((XfwfArrowWidget)self)->xfwfArrow.arrowlightgc);
00138     switch (((XfwfArrowWidget)self)->xfwfFrame.shadowScheme) {
00139     case XfwfColor:
00140        mask = GCForeground;
00141        values.foreground = ((XfwfArrowWidget)self)->xfwfFrame.topShadowColor;
00142        break;
00143     case XfwfStipple:
00144        mask = GCFillStyle | GCStipple | GCForeground | GCBackground;
00145        values.fill_style = FillOpaqueStippled;
00146        values.background = ((XfwfArrowWidget)self)->core.background_pixel;
00147        values.stipple = ((XfwfArrowWidget)self)->xfwfFrame.topShadowStipple;
00148        values.foreground = WhitePixelOfScreen(XtScreen(self));
00149        break;
00150     case XfwfBlack:
00151     case XfwfAuto:
00152        if (DefaultDepthOfScreen(XtScreen(self)) > 4
00153            && ((XfwfArrowWidgetClass)self->core.widget_class)->xfwfCommon_class.lighter_color(self, ((XfwfArrowWidget)self)->core.background_pixel, &values.foreground)) {
00154            mask = GCForeground;
00155        } else {
00156            mask = GCFillStyle | GCBackground | GCForeground | GCStipple;
00157            values.fill_style = FillOpaqueStippled;
00158            /* values.background = $foreground; */
00159            values.background = BlackPixelOfScreen(XtScreen(self));
00160            values.foreground = WhitePixelOfScreen(XtScreen(self));
00161            values.stipple =
00162               XCreateBitmapFromData(XtDisplay(self),
00163                                   RootWindowOfScreen(XtScreen(self)),
00164                                   wx_gray_bits, wx_gray_width, wx_gray_height);
00165        }
00166        break;
00167     }
00168     ((XfwfArrowWidget)self)->xfwfArrow.arrowlightgc = XtGetGC(self, mask, &values);
00169 }
00170 /*ARGSUSED*/
00171 #if NeedFunctionPrototypes
00172 static void create_arrowdarkgc(Widget self)
00173 #else
00174 static void create_arrowdarkgc(self)Widget self;
00175 #endif
00176 {
00177     XtGCMask mask=0;
00178     XGCValues values;
00179 
00180     if (((XfwfArrowWidget)self)->xfwfArrow.arrowdarkgc != NULL) XtReleaseGC(self, ((XfwfArrowWidget)self)->xfwfArrow.arrowdarkgc);
00181     switch (((XfwfArrowWidget)self)->xfwfFrame.shadowScheme) {
00182     case XfwfColor:
00183        mask = GCForeground;
00184        values.foreground = ((XfwfArrowWidget)self)->xfwfFrame.bottomShadowColor;
00185        break;
00186     case XfwfStipple:
00187        mask = GCFillStyle | GCStipple | GCForeground | GCBackground;
00188        values.fill_style = FillOpaqueStippled;
00189        values.stipple = ((XfwfArrowWidget)self)->xfwfFrame.bottomShadowStipple;
00190        values.foreground = BlackPixelOfScreen(XtScreen(self));
00191        values.background = ((XfwfArrowWidget)self)->core.background_pixel;
00192        break;
00193     case XfwfBlack:
00194     case XfwfAuto:
00195        if (DefaultDepthOfScreen(XtScreen(self)) > 4
00196            && ((XfwfArrowWidgetClass)self->core.widget_class)->xfwfCommon_class.darker_color(self, ((XfwfArrowWidget)self)->core.background_pixel, &values.foreground)) {
00197            mask = GCForeground;
00198        } else {
00199            mask = GCFillStyle | GCBackground | GCForeground | GCStipple;
00200            values.fill_style = FillOpaqueStippled;
00201            /* values.background = $foreground; */
00202            values.background = BlackPixelOfScreen(XtScreen(self));
00203            values.foreground = WhitePixelOfScreen(XtScreen(self));
00204            values.stipple =
00205               XCreateBitmapFromData(XtDisplay(self),
00206                                   RootWindowOfScreen(XtScreen(self)),
00207                                   wx_gray_bits, wx_gray_width, wx_gray_height);
00208        }
00209        break;
00210     }
00211     ((XfwfArrowWidget)self)->xfwfArrow.arrowdarkgc = XtGetGC(self, mask, &values);
00212 }
00213 
00214 static XtResource resources[] = {
00215 {XtNdirection,XtCDirection,XtRAlignment,sizeof(((XfwfArrowRec*)NULL)->xfwfArrow.direction),XtOffsetOf(XfwfArrowRec,xfwfArrow.direction),XtRImmediate,(XtPointer)XfwfTop },
00216 {XtNforeground,XtCForeground,XtRPixel,sizeof(((XfwfArrowRec*)NULL)->xfwfArrow.foreground),XtOffsetOf(XfwfArrowRec,xfwfArrow.foreground),XtRString,(XtPointer)XtDefaultBackground },
00217 {XtNarrowShadow,XtCArrowShadow,XtRDimension,sizeof(((XfwfArrowRec*)NULL)->xfwfArrow.arrowShadow),XtOffsetOf(XfwfArrowRec,xfwfArrow.arrowShadow),XtRImmediate,(XtPointer)2 },
00218 {XtNrepeat,XtCRepeat,XtRBoolean,sizeof(((XfwfArrowRec*)NULL)->xfwfArrow.repeat),XtOffsetOf(XfwfArrowRec,xfwfArrow.repeat),XtRImmediate,(XtPointer)TRUE },
00219 {XtNinitialDelay,XtCInitialDelay,XtRCardinal,sizeof(((XfwfArrowRec*)NULL)->xfwfArrow.initialDelay),XtOffsetOf(XfwfArrowRec,xfwfArrow.initialDelay),XtRImmediate,(XtPointer)500 },
00220 {XtNrepeatDelay,XtCRepeatDelay,XtRCardinal,sizeof(((XfwfArrowRec*)NULL)->xfwfArrow.repeatDelay),XtOffsetOf(XfwfArrowRec,xfwfArrow.repeatDelay),XtRImmediate,(XtPointer)200 },
00221 {XtNcallback,XtCCallback,XtRCallback,sizeof(((XfwfArrowRec*)NULL)->xfwfArrow.callback),XtOffsetOf(XfwfArrowRec,xfwfArrow.callback),XtRImmediate,(XtPointer)NULL },
00222 {XtNdrawgrayArrow,XtCDrawgrayArrow,XtRBoolean,sizeof(((XfwfArrowRec*)NULL)->xfwfArrow.drawgrayArrow),XtOffsetOf(XfwfArrowRec,xfwfArrow.drawgrayArrow),XtRImmediate,(XtPointer)FALSE },
00223 };
00224 
00225 XfwfArrowClassRec xfwfArrowClassRec = {
00226 { /* core_class part */
00227 /* superclass        */  (WidgetClass) &xfwfBoardClassRec,
00228 /* class_name        */  "XfwfArrow",
00229 /* widget_size       */  sizeof(XfwfArrowRec),
00230 /* class_initialize  */  NULL,
00231 /* class_part_initialize*/  _resolve_inheritance,
00232 /* class_inited      */  FALSE,
00233 /* initialize        */  initialize,
00234 /* initialize_hook   */  NULL,
00235 /* realize           */  XtInheritRealize,
00236 /* actions           */  actionsList,
00237 /* num_actions       */  4,
00238 /* resources         */  resources,
00239 /* num_resources     */  8,
00240 /* xrm_class         */  NULLQUARK,
00241 /* compres_motion    */  True ,
00242 /* compress_exposure        */  XtExposeCompressMaximal ,
00243 /* compress_enterleave      */  True ,
00244 /* visible_interest  */  False ,
00245 /* destroy           */  destroy,
00246 /* resize            */  XtInheritResize,
00247 /* expose            */  XtInheritExpose,
00248 /* set_values        */  set_values,
00249 /* set_values_hook   */  NULL,
00250 /* set_values_almost        */  XtInheritSetValuesAlmost,
00251 /* get_values+hook   */  NULL,
00252 /* accept_focus      */  XtInheritAcceptFocus,
00253 /* version           */  XtVersion,
00254 /* callback_private  */  NULL,
00255 /* tm_table          */  defaultTranslations,
00256 /* query_geometry    */  XtInheritQueryGeometry,
00257 /* display_acceleator       */  XtInheritDisplayAccelerator,
00258 /* extension         */  NULL 
00259 },
00260 { /* composite_class part */
00261 XtInheritGeometryManager,
00262 XtInheritChangeManaged,
00263 XtInheritInsertChild,
00264 XtInheritDeleteChild,
00265 NULL
00266 },
00267 { /* XfwfCommon_class part */
00268 XtInherit_compute_inside,
00269 XtInherit_total_frame_width,
00270 _expose,
00271 XtInherit_highlight_border,
00272 XtInherit_unhighlight_border,
00273 XtInherit_hilite_callbacks,
00274 XtInherit_would_accept_focus,
00275 XtInherit_traverse,
00276 XtInherit_lighter_color,
00277 XtInherit_darker_color,
00278 XtInherit_set_color,
00279 /* traversal_trans */  NULL ,
00280 /* traversal_trans_small */  NULL ,
00281 /* travMode */  1 ,
00282 },
00283 { /* XfwfFrame_class part */
00284  /* dummy */  0
00285 },
00286 { /* XfwfBoard_class part */
00287 XtInherit_set_abs_location,
00288 },
00289 { /* XfwfArrow_class part */
00290 draw_arrow,
00291 },
00292 };
00293 WidgetClass xfwfArrowWidgetClass = (WidgetClass) &xfwfArrowClassRec;
00294 /*ARGSUSED*/
00295 static void activate_and_start_timer(self,event,params,num_params)Widget self;XEvent*event;String*params;Cardinal*num_params;
00296 {
00297     if (event->type != ButtonPress) {
00298         XtWarning("The Arrow activate action isn't bound to a BtnDown event");
00299        return;
00300     }
00301     stop_timer(self, event, params, num_params);
00302     ((XfwfArrowWidget)self)->xfwfArrow.timer = 0x1; /* During callback, a stop_timer may be evaluated */
00303     XtCallCallbackList(self, ((XfwfArrowWidget)self)->xfwfArrow.callback, NULL);
00304     if (((XfwfArrowWidget)self)->xfwfArrow.repeat) {
00305       if (((XfwfArrowWidget)self)->xfwfArrow.timer) {
00306         stop_timer(self, event, params, num_params);
00307        ((XfwfArrowWidget)self)->xfwfArrow.timer = wxAppAddTimeOut(XtWidgetToApplicationContext(self),
00308                              ((XfwfArrowWidget)self)->xfwfArrow.initialDelay, timer_callback, self, self);
00309       }
00310     } else
00311        push_up(self, event, params, num_params);
00312 }
00313 
00314 /*ARGSUSED*/
00315 static void stop_timer(self,event,params,num_params)Widget self;XEvent*event;String*params;Cardinal*num_params;
00316 {
00317     if (((XfwfArrowWidget)self)->xfwfArrow.timer && ((XfwfArrowWidget)self)->xfwfArrow.timer != 0x1)
00318        wxRemoveTimeOut(((XfwfArrowWidget)self)->xfwfArrow.timer);
00319     ((XfwfArrowWidget)self)->xfwfArrow.timer = 0;
00320 }
00321 
00322 /*ARGSUSED*/
00323 static void push_up(self,event,params,num_params)Widget self;XEvent*event;String*params;Cardinal*num_params;
00324 {
00325   draw_arrow(self, 0);
00326 }
00327 
00328 /*ARGSUSED*/
00329 static void push_down(self,event,params,num_params)Widget self;XEvent*event;String*params;Cardinal*num_params;
00330 {
00331   draw_arrow(self, 1);
00332 }
00333 
00334 static void _resolve_inheritance(class)
00335 WidgetClass class;
00336 {
00337   XfwfArrowWidgetClass c = (XfwfArrowWidgetClass) class;
00338   XfwfArrowWidgetClass super;
00339   static CompositeClassExtensionRec extension_rec = {
00340     NULL, NULLQUARK, XtCompositeExtensionVersion,
00341     sizeof(CompositeClassExtensionRec), True};
00342   CompositeClassExtensionRec *ext;
00343   ext = (XtPointer)XtMalloc(sizeof(*ext));
00344   *ext = extension_rec;
00345   ext->next_extension = c->composite_class.extension;
00346   c->composite_class.extension = ext;
00347   if (class == xfwfArrowWidgetClass) return;
00348   super = (XfwfArrowWidgetClass)class->core_class.superclass;
00349   if (c->xfwfArrow_class.draw_arrow == XtInherit_draw_arrow)
00350     c->xfwfArrow_class.draw_arrow = super->xfwfArrow_class.draw_arrow;
00351 }
00352 /*ARGSUSED*/
00353 #if NeedFunctionPrototypes
00354 static void initialize(Widget  request,Widget self,ArgList  args,Cardinal * num_args)
00355 #else
00356 static void initialize(request,self,args,num_args)Widget  request;Widget self;ArgList  args;Cardinal * num_args;
00357 #endif
00358 {
00359     if (((XfwfArrowWidget)self)->xfwfArrow.direction != XfwfTop && ((XfwfArrowWidget)self)->xfwfArrow.direction != XfwfLeft
00360        && ((XfwfArrowWidget)self)->xfwfArrow.direction != XfwfRight && ((XfwfArrowWidget)self)->xfwfArrow.direction != XfwfBottom) {
00361        XtWarning("direction of Arrow widget incorrect; set to `top'");
00362        ((XfwfArrowWidget)self)->xfwfArrow.direction = XfwfTop;
00363     }
00364     ((XfwfArrowWidget)self)->xfwfArrow.arrowgc = NULL; create_arrowgc(self);
00365     ((XfwfArrowWidget)self)->xfwfArrow.arrowlightgc = NULL; create_arrowlightgc(self);
00366     ((XfwfArrowWidget)self)->xfwfArrow.arrowdarkgc = NULL; create_arrowdarkgc(self);
00367     ((XfwfArrowWidget)self)->xfwfArrow.timer = 0;
00368 }
00369 /*ARGSUSED*/
00370 #if NeedFunctionPrototypes
00371 static void destroy(Widget self)
00372 #else
00373 static void destroy(self)Widget self;
00374 #endif
00375 {
00376    if (((XfwfArrowWidget)self)->xfwfArrow.timer) {
00377       if (((XfwfArrowWidget)self)->xfwfArrow.timer != 0x1)
00378         wxRemoveTimeOut(((XfwfArrowWidget)self)->xfwfArrow.timer);
00379       ((XfwfArrowWidget)self)->xfwfArrow.timer = 0;
00380    }
00381    if (((XfwfArrowWidget)self)->xfwfArrow.arrowgc) XtReleaseGC(self, ((XfwfArrowWidget)self)->xfwfArrow.arrowgc); ((XfwfArrowWidget)self)->xfwfArrow.arrowgc = NULL;
00382    if (((XfwfArrowWidget)self)->xfwfArrow.arrowlightgc) XtReleaseGC(self, ((XfwfArrowWidget)self)->xfwfArrow.arrowlightgc); ((XfwfArrowWidget)self)->xfwfArrow.arrowlightgc = NULL;
00383    if (((XfwfArrowWidget)self)->xfwfArrow.arrowdarkgc) XtReleaseGC(self, ((XfwfArrowWidget)self)->xfwfArrow.arrowdarkgc); ((XfwfArrowWidget)self)->xfwfArrow.arrowdarkgc = NULL;   
00384 }
00385 /*ARGSUSED*/
00386 #if NeedFunctionPrototypes
00387 static Boolean  set_values(Widget  old,Widget  request,Widget self,ArgList  args,Cardinal * num_args)
00388 #else
00389 static Boolean  set_values(old,request,self,args,num_args)Widget  old;Widget  request;Widget self;ArgList  args;Cardinal * num_args;
00390 #endif
00391 {
00392     Boolean need_redisplay = False;
00393 
00394     if (((XfwfArrowWidget)self)->xfwfArrow.direction != XfwfTop && ((XfwfArrowWidget)self)->xfwfArrow.direction != XfwfLeft
00395        && ((XfwfArrowWidget)self)->xfwfArrow.direction != XfwfRight && ((XfwfArrowWidget)self)->xfwfArrow.direction != XfwfBottom) {
00396        XtWarning("direction of Arrow widget incorrect; set to `top'");
00397        ((XfwfArrowWidget)self)->xfwfArrow.direction = XfwfTop;
00398     }
00399     if (((XfwfArrowWidget)old)->xfwfArrow.direction != ((XfwfArrowWidget)self)->xfwfArrow.direction)
00400        need_redisplay = True;
00401     if (((XfwfArrowWidget)old)->xfwfArrow.foreground != ((XfwfArrowWidget)self)->xfwfArrow.foreground) {
00402        create_arrowgc(self);
00403        need_redisplay = True;
00404     }
00405     if (((XfwfArrowWidget)old)->xfwfArrow.arrowShadow != ((XfwfArrowWidget)self)->xfwfArrow.arrowShadow)
00406        need_redisplay = True;
00407     if (((XfwfArrowWidget)self)->xfwfFrame.shadowScheme != ((XfwfArrowWidget)old)->xfwfFrame.shadowScheme) {
00408        create_arrowdarkgc(self);
00409        create_arrowlightgc(self);
00410        need_redisplay = True;
00411     } else if (((XfwfArrowWidget)self)->xfwfFrame.shadowScheme == XfwfColor) {
00412        if (((XfwfArrowWidget)self)->xfwfFrame.topShadowColor != ((XfwfArrowWidget)old)->xfwfFrame.topShadowColor) {
00413            create_arrowlightgc(self);
00414            need_redisplay = True;
00415        }
00416        if (((XfwfArrowWidget)self)->xfwfFrame.bottomShadowColor != ((XfwfArrowWidget)old)->xfwfFrame.bottomShadowColor) {
00417            create_arrowdarkgc(self);
00418            need_redisplay = True;
00419        }
00420     } else if (((XfwfArrowWidget)self)->xfwfFrame.shadowScheme == XfwfStipple) {
00421        if (((XfwfArrowWidget)self)->xfwfFrame.topShadowStipple != ((XfwfArrowWidget)old)->xfwfFrame.topShadowStipple) {
00422            create_arrowlightgc(self);
00423            need_redisplay = True;
00424        }
00425        if (((XfwfArrowWidget)self)->xfwfFrame.bottomShadowStipple != ((XfwfArrowWidget)old)->xfwfFrame.bottomShadowStipple) {
00426            create_arrowdarkgc(self);
00427            need_redisplay = True;
00428        }
00429     }
00430     if (((XfwfArrowWidget)old)->xfwfArrow.drawgrayArrow != ((XfwfArrowWidget)self)->xfwfArrow.drawgrayArrow) {
00431       need_redisplay = TRUE;
00432     }
00433     return need_redisplay;
00434 }
00435 /*ARGSUSED*/
00436 #if NeedFunctionPrototypes
00437 static void _expose(Widget self,XEvent * event,Region  region)
00438 #else
00439 static void _expose(self,event,region)Widget self;XEvent * event;Region  region;
00440 #endif
00441 {
00442     assert(((XfwfArrowWidget)self)->xfwfArrow.direction == XfwfTop || ((XfwfArrowWidget)self)->xfwfArrow.direction == XfwfLeft
00443           || ((XfwfArrowWidget)self)->xfwfArrow.direction == XfwfRight || ((XfwfArrowWidget)self)->xfwfArrow.direction == XfwfBottom);
00444 
00445     if (! XtIsRealized(self)) return;
00446 
00447     xfwfBoardClassRec.xfwfCommon_class._expose(self, event, region);
00448 
00449     if (region != NULL) {
00450        XSetRegion(XtDisplay(self), ((XfwfArrowWidget)self)->xfwfArrow.arrowgc, region);
00451        XSetRegion(XtDisplay(self), ((XfwfArrowWidget)self)->xfwfArrow.arrowlightgc, region);
00452        XSetRegion(XtDisplay(self), ((XfwfArrowWidget)self)->xfwfArrow.arrowdarkgc, region);
00453     }
00454        
00455     draw_arrow(self, 0);
00456 
00457     if (region != NULL) {
00458        XSetClipMask(XtDisplay(self), ((XfwfArrowWidget)self)->xfwfArrow.arrowgc, None);
00459        XSetClipMask(XtDisplay(self), ((XfwfArrowWidget)self)->xfwfArrow.arrowlightgc, None);
00460        XSetClipMask(XtDisplay(self), ((XfwfArrowWidget)self)->xfwfArrow.arrowdarkgc, None);
00461     }
00462 }
00463 /*ARGSUSED*/
00464 #if NeedFunctionPrototypes
00465 static void  draw_arrow(Widget self,int  on)
00466 #else
00467 static void  draw_arrow(self,on)Widget self;int  on;
00468 #endif
00469 {
00470     Position x, y;
00471     int  width, height, dir, grayed;
00472 
00473     ((XfwfArrowWidgetClass)self->core.widget_class)->xfwfCommon_class.compute_inside(self, &x, &y, &width, &height);
00474 
00475     if (((XfwfArrowWidget)self)->xfwfArrow.arrowShadow) {
00476       XDrawLine(XtDisplay(self), XtWindow(self),
00477               (on ? ((XfwfArrowWidget)self)->xfwfArrow.arrowdarkgc : ((XfwfArrowWidget)self)->xfwfArrow.arrowlightgc),
00478               x, y, x + width, y);
00479       XDrawLine(XtDisplay(self), XtWindow(self),
00480               (on ? ((XfwfArrowWidget)self)->xfwfArrow.arrowdarkgc : ((XfwfArrowWidget)self)->xfwfArrow.arrowlightgc),
00481               x, y, x, y + height);
00482       XDrawLine(XtDisplay(self), XtWindow(self),
00483               (on ? ((XfwfArrowWidget)self)->xfwfArrow.arrowlightgc : ((XfwfArrowWidget)self)->xfwfArrow.arrowdarkgc),
00484               x + width - 1, y, x + width - 1, y + height);
00485       XDrawLine(XtDisplay(self), XtWindow(self),
00486               (on ? ((XfwfArrowWidget)self)->xfwfArrow.arrowlightgc : ((XfwfArrowWidget)self)->xfwfArrow.arrowdarkgc),
00487               x, y + height - 1, x + width, y + height - 1);
00488       width--;
00489       height--;
00490     }
00491 
00492     switch (((XfwfArrowWidget)self)->xfwfArrow.direction) {
00493     case XfwfTop:
00494       dir = UP;
00495       --y;
00496       break;
00497     case XfwfBottom:
00498       dir = DOWN;
00499       y++;
00500       break;
00501     case XfwfLeft:
00502       dir = LEFT;
00503       break;
00504     default:
00505     case XfwfRight:
00506       dir = RIGHT;
00507       break;
00508     }
00509 
00510     x += ((XfwfArrowWidget)self)->xfwfArrow.arrowShadow;
00511     y += ((XfwfArrowWidget)self)->xfwfArrow.arrowShadow;
00512     width -= 2 * ((XfwfArrowWidget)self)->xfwfArrow.arrowShadow;
00513     height -= 2 * ((XfwfArrowWidget)self)->xfwfArrow.arrowShadow;
00514     width = max(1, width);
00515     height = max(1, height);
00516 
00517     grayed = ((!((XfwfArrowWidget)self)->core.sensitive || ((XfwfArrowWidget)self)->xfwfArrow.drawgrayArrow) && wx_enough_colors(XtScreen(self)));
00518 
00519     Xaw3dDrawArrow(XtDisplay(self), XtWindow(self),
00520                  ((XfwfArrowWidget)self)->xfwfArrow.arrowlightgc, ((XfwfArrowWidget)self)->xfwfArrow.arrowdarkgc,
00521                  (grayed ? ((XfwfArrowWidget)self)->xfwfArrow.arrowdarkgc : ((XfwfArrowWidget)self)->xfwfArrow.arrowgc), (grayed ? ((XfwfArrowWidget)self)->xfwfArrow.arrowdarkgc : ((XfwfArrowWidget)self)->xfwfArrow.arrowgc),
00522                  x, y, width, height,
00523                  0, dir, on);
00524 }