Back to index

plt-scheme  4.2.1
xwBoard.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 <stdio.h>
00007 #include <X11/Shell.h>
00008 #include <ctype.h>
00009 #include <./xwBoardP.h>
00010 static void _resolve_inheritance(
00011 #if NeedFunctionPrototypes
00012 WidgetClass
00013 #endif
00014 );
00015 static Boolean  set_values(
00016 #if NeedFunctionPrototypes
00017 Widget ,Widget ,Widget,ArgList ,Cardinal *
00018 #endif
00019 );
00020 static void initialize(
00021 #if NeedFunctionPrototypes
00022 Widget ,Widget,ArgList ,Cardinal *
00023 #endif
00024 );
00025 static void set_abs_location(
00026 #if NeedFunctionPrototypes
00027 Widget,unsigned  int ,int ,int ,int ,int 
00028 #endif
00029 );
00030 static void resize(
00031 #if NeedFunctionPrototypes
00032 Widget
00033 #endif
00034 );
00035 static XtGeometryResult  query_geometry(
00036 #if NeedFunctionPrototypes
00037 Widget,XtWidgetGeometry *,XtWidgetGeometry *
00038 #endif
00039 );
00040 static XtGeometryResult  geometry_manager(
00041 #if NeedFunctionPrototypes
00042 Widget ,XtWidgetGeometry *,XtWidgetGeometry *
00043 #endif
00044 );
00045 static void change_managed(
00046 #if NeedFunctionPrototypes
00047 Widget
00048 #endif
00049 );
00050 #define ceil(r) (-(int )(-(r )))
00051 
00052 
00053 static void generate_location(
00054 #if NeedFunctionPrototypes
00055 Widget
00056 #endif
00057 );
00058 static void get_core_geometry(
00059 #if NeedFunctionPrototypes
00060 Widget,Position *,Position *,Dimension *,Dimension *
00061 #endif
00062 );
00063 static void set_location(
00064 #if NeedFunctionPrototypes
00065 Widget,unsigned  int 
00066 #endif
00067 );
00068 #define skip_blanks(s) while (isspace (*s ))s ++
00069 
00070 
00071 #define strtonum(t, n) do {\
00072         while ((*(t)) && !isdigit(*(t)) && *(t) != '.') (t)++;\
00073         for ((n) = 0; isdigit(*t); (t)++)\
00074             (n) = 10 * (n) + *(t) - '0';\
00075     }while (0 )
00076 
00077 
00078 #define strtofrac(t, n, factor) for ((factor )=1.0 ,(n )=0 ,(t )++;isdigit (*(t ));(t )++,(factor )/=10.0 )(n )=10 *(n )+*(t )-'0'
00079 
00080 
00081 static String  scan(
00082 #if NeedFunctionPrototypes
00083 String ,Position *,float *
00084 #endif
00085 );
00086 static void interpret_location(
00087 #if NeedFunctionPrototypes
00088 Widget
00089 #endif
00090 );
00091 /*ARGSUSED*/
00092 #if NeedFunctionPrototypes
00093 static void generate_location(Widget self)
00094 #else
00095 static void generate_location(self)Widget self;
00096 #endif
00097 {
00098     char tmp[100];
00099 
00100     (void) sprintf(tmp, "%d+%f %d+%f %d+%f %d+%f",
00101                    ((XfwfBoardWidget)self)->xfwfBoard.abs_x, ((XfwfBoardWidget)self)->xfwfBoard.rel_x, ((XfwfBoardWidget)self)->xfwfBoard.abs_y, ((XfwfBoardWidget)self)->xfwfBoard.rel_y, ((XfwfBoardWidget)self)->xfwfBoard.abs_width, ((XfwfBoardWidget)self)->xfwfBoard.rel_width,
00102                    ((XfwfBoardWidget)self)->xfwfBoard.abs_height, ((XfwfBoardWidget)self)->xfwfBoard.rel_height);
00103     XtFree(((XfwfBoardWidget)self)->xfwfBoard.location);
00104     ((XfwfBoardWidget)self)->xfwfBoard.location = XtNewString(tmp);
00105 }
00106 /*ARGSUSED*/
00107 #if NeedFunctionPrototypes
00108 static void get_core_geometry(Widget self,Position * x,Position * y,Dimension * width,Dimension * height)
00109 #else
00110 static void get_core_geometry(self,x,y,width,height)Widget self;Position * x;Position * y;Dimension * width;Dimension * height;
00111 #endif
00112 {
00113     Widget parent;
00114     Position px, py;
00115     int pw, ph, minsize;
00116     float h;
00117 
00118     parent = ((XfwfBoardWidget)self)->core.parent;
00119     if (XtIsSubclass(((XfwfBoardWidget)self)->core.parent, xfwfBoardWidgetClass))
00120         ((XfwfBoardWidgetClass)parent->core.widget_class)->xfwfCommon_class.compute_inside(parent, &px, &py, &pw, &ph);
00121     else {
00122         px = 0;
00123         py = 0;
00124         pw = ((XfwfBoardWidget)parent)->core.width;
00125         ph = ((XfwfBoardWidget)parent)->core.height;
00126     }
00127     pw = max(0, pw);
00128     ph = max(0, ph);
00129 
00130     *x = ceil(((XfwfBoardWidget)self)->xfwfBoard.rel_x * pw + ((XfwfBoardWidget)self)->xfwfBoard.abs_x * ((XfwfBoardWidget)self)->xfwfBoard.hunit) + px;
00131     *y = ceil(((XfwfBoardWidget)self)->xfwfBoard.rel_y * ph + ((XfwfBoardWidget)self)->xfwfBoard.abs_y * ((XfwfBoardWidget)self)->xfwfBoard.vunit) + py;
00132     minsize = 2 * ((XfwfBoardWidgetClass)self->core.widget_class)->xfwfCommon_class.total_frame_width(self);
00133     minsize = max(1, minsize);
00134     h = ceil(((XfwfBoardWidget)self)->xfwfBoard.rel_width * pw + ((XfwfBoardWidget)self)->xfwfBoard.abs_width * ((XfwfBoardWidget)self)->xfwfBoard.hunit);
00135     *width = h < minsize ? minsize : h;
00136     h = ceil(((XfwfBoardWidget)self)->xfwfBoard.rel_height * ph + ((XfwfBoardWidget)self)->xfwfBoard.abs_height * ((XfwfBoardWidget)self)->xfwfBoard.vunit);
00137     *height = h < minsize ? minsize : h;
00138 }
00139 /*ARGSUSED*/
00140 #if NeedFunctionPrototypes
00141 static void set_location(Widget self,unsigned  int  flags)
00142 #else
00143 static void set_location(self,flags)Widget self;unsigned  int  flags;
00144 #endif
00145 {
00146     Widget parent;
00147     Position px, py;
00148     int pw, ph;
00149 
00150     parent = ((XfwfBoardWidget)self)->core.parent;
00151     if (XtIsSubclass(((XfwfBoardWidget)self)->core.parent, xfwfBoardWidgetClass))
00152         ((XfwfBoardWidgetClass)parent->core.widget_class)->xfwfCommon_class.compute_inside(parent, &px, &py, &pw, &ph);
00153     else {
00154         px = 0;
00155         py = 0;
00156         pw = ((XfwfBoardWidget)parent)->core.width;
00157         ph = ((XfwfBoardWidget)parent)->core.height;
00158     }
00159     pw = max(0, pw);
00160     ph = max(0, ph);
00161     if (flags & CWX) {
00162         ((XfwfBoardWidget)self)->xfwfBoard.rel_x = 0.0;
00163         ((XfwfBoardWidget)self)->xfwfBoard.abs_x = ceil((((XfwfBoardWidget)self)->core.x - px)/((XfwfBoardWidget)self)->xfwfBoard.hunit);
00164     }
00165     if (flags & CWY) {
00166         ((XfwfBoardWidget)self)->xfwfBoard.rel_y = 0.0;
00167         ((XfwfBoardWidget)self)->xfwfBoard.abs_y = ceil((((XfwfBoardWidget)self)->core.y - py)/((XfwfBoardWidget)self)->xfwfBoard.vunit);
00168     }
00169     if (flags & CWWidth) {
00170         ((XfwfBoardWidget)self)->xfwfBoard.rel_width = 0.0;
00171         ((XfwfBoardWidget)self)->xfwfBoard.abs_width = ceil(((XfwfBoardWidget)self)->core.width/((XfwfBoardWidget)self)->xfwfBoard.hunit);
00172     }
00173     if (flags & CWHeight) {
00174         ((XfwfBoardWidget)self)->xfwfBoard.rel_height = 0.0;
00175         ((XfwfBoardWidget)self)->xfwfBoard.abs_height = ceil(((XfwfBoardWidget)self)->core.height/((XfwfBoardWidget)self)->xfwfBoard.vunit);
00176     }
00177 }
00178 /*ARGSUSED*/
00179 #if NeedFunctionPrototypes
00180 static String  scan(String  s,Position * absval,float * relval)
00181 #else
00182 static String  scan(s,absval,relval)String  s;Position * absval;float * relval;
00183 #endif
00184 {
00185     String p;
00186     char c;
00187     long n;
00188     float fract, factor;
00189 
00190     *absval = 0;
00191     *relval = 0.0;
00192     p = s;
00193     strtonum(p, n);
00194     if (*p != '.') {                            /* 1st number is integer */
00195         *absval = n;
00196         skip_blanks(p);
00197         c = *p;
00198         if (c != '+' && c != '-') return p;     /* No second number */
00199         s = p;
00200         strtonum(p, n);
00201         if (*p != '.') return s;                /* This is an error... */
00202         strtofrac(p, fract, factor);
00203         *relval = c == '-' ? -fract * factor - n : fract * factor + n;
00204         return p;
00205     } else {                                    /* 1st number is float */
00206         strtofrac(p, fract, factor);
00207         *relval = fract * factor + n;
00208         skip_blanks(p);
00209         c = *p;
00210         if (c != '+' && c != '-') return p;     /* No second number */
00211         strtonum(p, n);
00212         *absval = c == '-' ? -n : n;
00213         return p;
00214     }
00215 }
00216 /*ARGSUSED*/
00217 #if NeedFunctionPrototypes
00218 static void interpret_location(Widget self)
00219 #else
00220 static void interpret_location(self)Widget self;
00221 #endif
00222 {
00223     char *s;
00224 
00225     s = ((XfwfBoardWidget)self)->xfwfBoard.location;
00226     s = scan(s, &((XfwfBoardWidget)self)->xfwfBoard.abs_x, &((XfwfBoardWidget)self)->xfwfBoard.rel_x);
00227     s = scan(s, &((XfwfBoardWidget)self)->xfwfBoard.abs_y, &((XfwfBoardWidget)self)->xfwfBoard.rel_y);
00228     s = scan(s, &((XfwfBoardWidget)self)->xfwfBoard.abs_width, &((XfwfBoardWidget)self)->xfwfBoard.rel_width);
00229     s = scan(s, &((XfwfBoardWidget)self)->xfwfBoard.abs_height, &((XfwfBoardWidget)self)->xfwfBoard.rel_height);
00230 }
00231 
00232 static XtResource resources[] = {
00233 {XtNabs_x,XtCAbs_x,XtRPosition,sizeof(((XfwfBoardRec*)NULL)->xfwfBoard.abs_x),XtOffsetOf(XfwfBoardRec,xfwfBoard.abs_x),XtRImmediate,(XtPointer)0 },
00234 {XtNrel_x,XtCRel_x,XtRFloat,sizeof(((XfwfBoardRec*)NULL)->xfwfBoard.rel_x),XtOffsetOf(XfwfBoardRec,xfwfBoard.rel_x),XtRString,(XtPointer)"0.0"},
00235 {XtNabs_y,XtCAbs_y,XtRPosition,sizeof(((XfwfBoardRec*)NULL)->xfwfBoard.abs_y),XtOffsetOf(XfwfBoardRec,xfwfBoard.abs_y),XtRImmediate,(XtPointer)0 },
00236 {XtNrel_y,XtCRel_y,XtRFloat,sizeof(((XfwfBoardRec*)NULL)->xfwfBoard.rel_y),XtOffsetOf(XfwfBoardRec,xfwfBoard.rel_y),XtRString,(XtPointer)"0.0"},
00237 {XtNx,XtCX,XtRPosition,sizeof(((XfwfBoardRec*)NULL)->core.x),XtOffsetOf(XfwfBoardRec,core.x),XtRImmediate,(XtPointer)MAGICNUM },
00238 {XtNy,XtCY,XtRPosition,sizeof(((XfwfBoardRec*)NULL)->core.y),XtOffsetOf(XfwfBoardRec,core.y),XtRImmediate,(XtPointer)MAGICNUM },
00239 {XtNabs_width,XtCAbs_width,XtRPosition,sizeof(((XfwfBoardRec*)NULL)->xfwfBoard.abs_width),XtOffsetOf(XfwfBoardRec,xfwfBoard.abs_width),XtRImmediate,(XtPointer)0 },
00240 {XtNrel_width,XtCRel_width,XtRFloat,sizeof(((XfwfBoardRec*)NULL)->xfwfBoard.rel_width),XtOffsetOf(XfwfBoardRec,xfwfBoard.rel_width),XtRString,(XtPointer)"1.0"},
00241 {XtNabs_height,XtCAbs_height,XtRPosition,sizeof(((XfwfBoardRec*)NULL)->xfwfBoard.abs_height),XtOffsetOf(XfwfBoardRec,xfwfBoard.abs_height),XtRImmediate,(XtPointer)0 },
00242 {XtNrel_height,XtCRel_height,XtRFloat,sizeof(((XfwfBoardRec*)NULL)->xfwfBoard.rel_height),XtOffsetOf(XfwfBoardRec,xfwfBoard.rel_height),XtRString,(XtPointer)"1.0"},
00243 {XtNwidth,XtCWidth,XtRDimension,sizeof(((XfwfBoardRec*)NULL)->core.width),XtOffsetOf(XfwfBoardRec,core.width),XtRImmediate,(XtPointer)MAGICNUM },
00244 {XtNheight,XtCHeight,XtRDimension,sizeof(((XfwfBoardRec*)NULL)->core.height),XtOffsetOf(XfwfBoardRec,core.height),XtRImmediate,(XtPointer)MAGICNUM },
00245 {XtNhunit,XtCHunit,XtRFloat,sizeof(((XfwfBoardRec*)NULL)->xfwfBoard.hunit),XtOffsetOf(XfwfBoardRec,xfwfBoard.hunit),XtRString,(XtPointer)"1.0"},
00246 {XtNvunit,XtCVunit,XtRFloat,sizeof(((XfwfBoardRec*)NULL)->xfwfBoard.vunit),XtOffsetOf(XfwfBoardRec,xfwfBoard.vunit),XtRString,(XtPointer)"1.0"},
00247 {XtNlocation,XtCLocation,XtRString,sizeof(((XfwfBoardRec*)NULL)->xfwfBoard.location),XtOffsetOf(XfwfBoardRec,xfwfBoard.location),XtRImmediate,(XtPointer)NULL },
00248 };
00249 
00250 XfwfBoardClassRec xfwfBoardClassRec = {
00251 { /* core_class part */
00252 /* superclass        */  (WidgetClass) &xfwfFrameClassRec,
00253 /* class_name        */  "XfwfBoard",
00254 /* widget_size       */  sizeof(XfwfBoardRec),
00255 /* class_initialize  */  NULL,
00256 /* class_part_initialize*/  _resolve_inheritance,
00257 /* class_inited      */  FALSE,
00258 /* initialize        */  initialize,
00259 /* initialize_hook   */  NULL,
00260 /* realize           */  XtInheritRealize,
00261 /* actions           */  NULL,
00262 /* num_actions       */  0,
00263 /* resources         */  resources,
00264 /* num_resources     */  15,
00265 /* xrm_class         */  NULLQUARK,
00266 /* compres_motion    */  True ,
00267 /* compress_exposure        */  XtExposeCompressMultiple ,
00268 /* compress_enterleave      */  True ,
00269 /* visible_interest  */  False ,
00270 /* destroy           */  NULL,
00271 /* resize            */  resize,
00272 /* expose            */  XtInheritExpose,
00273 /* set_values        */  set_values,
00274 /* set_values_hook   */  NULL,
00275 /* set_values_almost        */  XtInheritSetValuesAlmost,
00276 /* get_values+hook   */  NULL,
00277 /* accept_focus      */  XtInheritAcceptFocus,
00278 /* version           */  XtVersion,
00279 /* callback_private  */  NULL,
00280 /* tm_table          */  NULL,
00281 /* query_geometry    */  query_geometry,
00282 /* display_acceleator       */  XtInheritDisplayAccelerator,
00283 /* extension         */  NULL 
00284 },
00285 { /* composite_class part */
00286 geometry_manager,
00287 change_managed,
00288 XtInheritInsertChild,
00289 XtInheritDeleteChild,
00290 NULL
00291 },
00292 { /* XfwfCommon_class part */
00293 XtInherit_compute_inside,
00294 XtInherit_total_frame_width,
00295 XtInherit__expose,
00296 XtInherit_highlight_border,
00297 XtInherit_unhighlight_border,
00298 XtInherit_hilite_callbacks,
00299 XtInherit_would_accept_focus,
00300 XtInherit_traverse,
00301 XtInherit_lighter_color,
00302 XtInherit_darker_color,
00303 XtInherit_set_color,
00304 /* traversal_trans */  NULL ,
00305 /* traversal_trans_small */  NULL ,
00306 /* travMode */  1 ,
00307 },
00308 { /* XfwfFrame_class part */
00309  /* dummy */  0
00310 },
00311 { /* XfwfBoard_class part */
00312 set_abs_location,
00313 },
00314 };
00315 WidgetClass xfwfBoardWidgetClass = (WidgetClass) &xfwfBoardClassRec;
00316 static void _resolve_inheritance(class)
00317 WidgetClass class;
00318 {
00319   XfwfBoardWidgetClass c = (XfwfBoardWidgetClass) class;
00320   XfwfBoardWidgetClass super;
00321   static CompositeClassExtensionRec extension_rec = {
00322     NULL, NULLQUARK, XtCompositeExtensionVersion,
00323     sizeof(CompositeClassExtensionRec), True};
00324   CompositeClassExtensionRec *ext;
00325   ext = (XtPointer)XtMalloc(sizeof(*ext));
00326   *ext = extension_rec;
00327   ext->next_extension = c->composite_class.extension;
00328   c->composite_class.extension = ext;
00329   if (class == xfwfBoardWidgetClass) return;
00330   super = (XfwfBoardWidgetClass)class->core_class.superclass;
00331   if (c->xfwfBoard_class.set_abs_location == XtInherit_set_abs_location)
00332     c->xfwfBoard_class.set_abs_location = super->xfwfBoard_class.set_abs_location;
00333 }
00334 /*ARGSUSED*/
00335 #if NeedFunctionPrototypes
00336 static Boolean  set_values(Widget  old,Widget  request,Widget self,ArgList  args,Cardinal * num_args)
00337 #else
00338 static Boolean  set_values(old,request,self,args,num_args)Widget  old;Widget  request;Widget self;ArgList  args;Cardinal * num_args;
00339 #endif
00340 {
00341     XtWidgetGeometry reply;
00342     int i;
00343 
00344     if (((XfwfBoardWidget)self)->xfwfBoard.location != ((XfwfBoardWidget)old)->xfwfBoard.location) {
00345         XtFree(((XfwfBoardWidget)old)->xfwfBoard.location);
00346         ((XfwfBoardWidget)self)->xfwfBoard.location = XtNewString(((XfwfBoardWidget)self)->xfwfBoard.location);
00347         interpret_location(self);
00348         get_core_geometry(self, &((XfwfBoardWidget)self)->core.x, &((XfwfBoardWidget)self)->core.y, &((XfwfBoardWidget)self)->core.width, &((XfwfBoardWidget)self)->core.height);
00349     } else if (ceil(((XfwfBoardWidget)self)->xfwfBoard.abs_x*((XfwfBoardWidget)self)->xfwfBoard.hunit) != ceil(((XfwfBoardWidget)old)->xfwfBoard.abs_x*((XfwfBoardWidget)old)->xfwfBoard.hunit)
00350                || ceil(((XfwfBoardWidget)self)->xfwfBoard.abs_width*((XfwfBoardWidget)self)->xfwfBoard.hunit) != ceil(((XfwfBoardWidget)old)->xfwfBoard.abs_width*((XfwfBoardWidget)old)->xfwfBoard.hunit)
00351                || ceil(((XfwfBoardWidget)self)->xfwfBoard.abs_y*((XfwfBoardWidget)self)->xfwfBoard.vunit) != ceil(((XfwfBoardWidget)old)->xfwfBoard.abs_y*((XfwfBoardWidget)old)->xfwfBoard.vunit)
00352                || ceil(((XfwfBoardWidget)self)->xfwfBoard.abs_height*((XfwfBoardWidget)self)->xfwfBoard.vunit) != ceil(((XfwfBoardWidget)old)->xfwfBoard.abs_height*((XfwfBoardWidget)old)->xfwfBoard.vunit)
00353                || ((XfwfBoardWidget)self)->xfwfBoard.rel_x != ((XfwfBoardWidget)old)->xfwfBoard.rel_x
00354                || ((XfwfBoardWidget)self)->xfwfBoard.rel_y != ((XfwfBoardWidget)old)->xfwfBoard.rel_y
00355                || ((XfwfBoardWidget)self)->xfwfBoard.rel_width != ((XfwfBoardWidget)old)->xfwfBoard.rel_width
00356                || ((XfwfBoardWidget)self)->xfwfBoard.rel_height != ((XfwfBoardWidget)old)->xfwfBoard.rel_height) {
00357         get_core_geometry(self, &((XfwfBoardWidget)self)->core.x, &((XfwfBoardWidget)self)->core.y, &((XfwfBoardWidget)self)->core.width, &((XfwfBoardWidget)self)->core.height);
00358         generate_location(self);
00359     } else if (((XfwfBoardWidget)self)->core.x != ((XfwfBoardWidget)old)->core.x
00360                || ((XfwfBoardWidget)self)->core.y != ((XfwfBoardWidget)old)->core.y
00361                || ((XfwfBoardWidget)self)->core.width != ((XfwfBoardWidget)old)->core.width
00362                || ((XfwfBoardWidget)self)->core.height != ((XfwfBoardWidget)old)->core.height) {
00363       set_location(self, (((((XfwfBoardWidget)self)->core.x != ((XfwfBoardWidget)old)->core.x) ? CWX : 0)
00364                      | ((((XfwfBoardWidget)self)->core.y != ((XfwfBoardWidget)old)->core.y) ? CWY : 0)
00365                      | ((((XfwfBoardWidget)self)->core.width != ((XfwfBoardWidget)old)->core.width) ? CWWidth : 0)
00366                      | ((((XfwfBoardWidget)self)->core.height != ((XfwfBoardWidget)old)->core.height) ? CWHeight : 0)));
00367       generate_location(self);
00368     }
00369     if (((XfwfBoardWidgetClass)self->core.widget_class)->xfwfCommon_class.total_frame_width(old) != ((XfwfBoardWidgetClass)self->core.widget_class)->xfwfCommon_class.total_frame_width(self)) {
00370         for (i = 0; i < ((XfwfBoardWidget)self)->composite.num_children; i++) {
00371             (void) XtQueryGeometry(((XfwfBoardWidget)self)->composite.children[i], NULL, &reply);
00372             XtConfigureWidget(((XfwfBoardWidget)self)->composite.children[i], reply.x, reply.y, reply.width,
00373                               reply.height, reply.border_width);
00374         }
00375     }
00376     return False;
00377 }
00378 /*ARGSUSED*/
00379 #if NeedFunctionPrototypes
00380 static void initialize(Widget  request,Widget self,ArgList  args,Cardinal * num_args)
00381 #else
00382 static void initialize(request,self,args,num_args)Widget  request;Widget self;ArgList  args;Cardinal * num_args;
00383 #endif
00384 {
00385     if (((XfwfBoardWidget)self)->xfwfBoard.location != NULL) {
00386         ((XfwfBoardWidget)self)->xfwfBoard.location = XtNewString(((XfwfBoardWidget)self)->xfwfBoard.location);
00387         interpret_location(self);
00388         get_core_geometry(self, &((XfwfBoardWidget)self)->core.x, &((XfwfBoardWidget)self)->core.y, &((XfwfBoardWidget)self)->core.width, &((XfwfBoardWidget)self)->core.height);
00389     } else if (((XfwfBoardWidget)self)->core.x != MAGICNUM || ((XfwfBoardWidget)self)->core.y != MAGICNUM
00390                || ((XfwfBoardWidget)self)->core.width != MAGICNUM || ((XfwfBoardWidget)self)->core.height != MAGICNUM) {
00391         set_location(self, CWX | CWY | CWWidth | CWHeight);
00392         generate_location(self);
00393     } else {
00394         generate_location(self);
00395         get_core_geometry(self, &((XfwfBoardWidget)self)->core.x, &((XfwfBoardWidget)self)->core.y, &((XfwfBoardWidget)self)->core.width, &((XfwfBoardWidget)self)->core.height);
00396     }
00397 }
00398 /*ARGSUSED*/
00399 #if NeedFunctionPrototypes
00400 static void set_abs_location(Widget self,unsigned  int  flags,int  x,int  y,int  w,int  h)
00401 #else
00402 static void set_abs_location(self,flags,x,y,w,h)Widget self;unsigned  int  flags;int  x;int  y;int  w;int  h;
00403 #endif
00404 {
00405     if ((flags & (CWX | CWY | CWWidth | CWHeight)) == 0) return;
00406     if (flags & CWX) ((XfwfBoardWidget)self)->core.x = x;
00407     if (flags & CWY) ((XfwfBoardWidget)self)->core.y = y;
00408     if (flags & CWWidth) ((XfwfBoardWidget)self)->core.width = max(1, w);
00409     if (flags & CWHeight) ((XfwfBoardWidget)self)->core.height = max(1, h);
00410     set_location(self, flags);
00411     generate_location(self);
00412 }
00413 /*ARGSUSED*/
00414 #if NeedFunctionPrototypes
00415 static void resize(Widget self)
00416 #else
00417 static void resize(self)Widget self;
00418 #endif
00419 {
00420     int i;
00421     XtWidgetGeometry reply;
00422     Widget child;
00423 
00424     for (i = 0; i < ((XfwfBoardWidget)self)->composite.num_children; i++) {
00425         child = ((XfwfBoardWidget)self)->composite.children[i];
00426         (void) XtQueryGeometry(child, NULL, &reply);
00427         XtConfigureWidget(child, reply.x, reply.y, reply.width,
00428                           reply.height, reply.border_width);
00429     }
00430 }
00431 /*ARGSUSED*/
00432 #if NeedFunctionPrototypes
00433 static XtGeometryResult  query_geometry(Widget self,XtWidgetGeometry * request,XtWidgetGeometry * reply)
00434 #else
00435 static XtGeometryResult  query_geometry(self,request,reply)Widget self;XtWidgetGeometry * request;XtWidgetGeometry * reply;
00436 #endif
00437 {
00438     reply->request_mode = CWX | CWY | CWWidth | CWHeight;
00439     get_core_geometry(self, &reply->x, &reply->y,
00440                       &reply->width, &reply->height);
00441     return XtGeometryAlmost;
00442 }
00443 /*ARGSUSED*/
00444 #if NeedFunctionPrototypes
00445 static XtGeometryResult  geometry_manager(Widget  child,XtWidgetGeometry * request,XtWidgetGeometry * reply)
00446 #else
00447 static XtGeometryResult  geometry_manager(child,request,reply)Widget  child;XtWidgetGeometry * request;XtWidgetGeometry * reply;
00448 #endif
00449 { Widget self = XtParent(child); {
00450     /* Widget $ = XtParent(child); */
00451     Dimension wd, ht, bw;
00452     Position x, y;
00453 
00454     /* Get complete geometry, from request or current value */
00455     x = request->request_mode & CWX ? request->x : ((XfwfBoardWidget)child)->core.x;
00456     y = request->request_mode & CWY ? request->y : ((XfwfBoardWidget)child)->core.y;
00457     wd = request->request_mode & CWWidth ? request->width : ((XfwfBoardWidget)child)->core.width;
00458     ht = request->request_mode & CWHeight ? request->height : ((XfwfBoardWidget)child)->core.height;
00459     bw = request->request_mode & CWBorderWidth ? request->border_width
00460         : ((XfwfBoardWidget)child)->core.border_width;
00461 
00462     if (wd <= 0) wd = 1; if (ht <= 0) ht = 1; /* MATTHEW: [5] */
00463     XtConfigureWidget(child, x, y, wd, ht, bw);
00464     return XtGeometryDone;
00465 }
00466 }
00467 /*ARGSUSED*/
00468 #if NeedFunctionPrototypes
00469 static void change_managed(Widget self)
00470 #else
00471 static void change_managed(self)Widget self;
00472 #endif
00473 {
00474 #if 1
00475     Widget top = self, w;
00476 
00477     while (!XtIsSubclass(top, shellWidgetClass)) top = XtParent(top) ;
00478     for (w = self; w != top; w = XtParent(w)) XtInstallAllAccelerators(w, top);
00479 #endif
00480 }