/* Generated by wbuild
 * (generator version 3.2)
 */
#include <X11/IntrinsicP.h>
#include <X11/StringDefs.h>
#include <stdio.h>
#include <X11/Shell.h>
#include <ctype.h>
#include <./xwBoardP.h>
static void _resolve_inheritance(
#if NeedFunctionPrototypes
WidgetClass
#endif
);
static Boolean  set_values(
#if NeedFunctionPrototypes
Widget ,Widget ,Widget,ArgList ,Cardinal *
#endif
);
static void initialize(
#if NeedFunctionPrototypes
Widget ,Widget,ArgList ,Cardinal *
#endif
);
static void set_abs_location(
#if NeedFunctionPrototypes
Widget,unsigned  int ,int ,int ,int ,int 
#endif
);
static void resize(
#if NeedFunctionPrototypes
Widget
#endif
);
static XtGeometryResult  query_geometry(
#if NeedFunctionPrototypes
Widget,XtWidgetGeometry *,XtWidgetGeometry *
#endif
);
static XtGeometryResult  geometry_manager(
#if NeedFunctionPrototypes
Widget ,XtWidgetGeometry *,XtWidgetGeometry *
#endif
);
static void change_managed(
#if NeedFunctionPrototypes
Widget
#endif
);
#define ceil(r) (-(int )(-(r )))


static void generate_location(
#if NeedFunctionPrototypes
Widget
#endif
);
static void get_core_geometry(
#if NeedFunctionPrototypes
Widget,Position *,Position *,Dimension *,Dimension *
#endif
);
static void set_location(
#if NeedFunctionPrototypes
Widget,unsigned  int 
#endif
);
#define skip_blanks(s) while (isspace (*s ))s ++


#define strtonum(t, n) do {\
        while ((*(t)) && !isdigit(*(t)) && *(t) != '.') (t)++;\
        for ((n) = 0; isdigit(*t); (t)++)\
            (n) = 10 * (n) + *(t) - '0';\
    }while (0 )


#define strtofrac(t, n, factor) for ((factor )=1.0 ,(n )=0 ,(t )++;isdigit (*(t ));(t )++,(factor )/=10.0 )(n )=10 *(n )+*(t )-'0'


static String  scan(
#if NeedFunctionPrototypes
String ,Position *,float *
#endif
);
static void interpret_location(
#if NeedFunctionPrototypes
Widget
#endif
);
/*ARGSUSED*/
#if NeedFunctionPrototypes
static void generate_location(Widget self)
#else
static void generate_location(self)Widget self;
#endif
{
    char tmp[100];

    (void) sprintf(tmp, "%d+%f %d+%f %d+%f %d+%f",
                   ((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,
                   ((XfwfBoardWidget)self)->xfwfBoard.abs_height, ((XfwfBoardWidget)self)->xfwfBoard.rel_height);
    XtFree(((XfwfBoardWidget)self)->xfwfBoard.location);
    ((XfwfBoardWidget)self)->xfwfBoard.location = XtNewString(tmp);
}
/*ARGSUSED*/
#if NeedFunctionPrototypes
static void get_core_geometry(Widget self,Position * x,Position * y,Dimension * width,Dimension * height)
#else
static void get_core_geometry(self,x,y,width,height)Widget self;Position * x;Position * y;Dimension * width;Dimension * height;
#endif
{
    Widget parent;
    Position px, py;
    int pw, ph, minsize;
    float h;

    parent = ((XfwfBoardWidget)self)->core.parent;
    if (XtIsSubclass(((XfwfBoardWidget)self)->core.parent, xfwfBoardWidgetClass))
        ((XfwfBoardWidgetClass)parent->core.widget_class)->xfwfCommon_class.compute_inside(parent, &px, &py, &pw, &ph);
    else {
        px = 0;
        py = 0;
        pw = ((XfwfBoardWidget)parent)->core.width;
        ph = ((XfwfBoardWidget)parent)->core.height;
    }
    pw = max(0, pw);
    ph = max(0, ph);

    *x = ceil(((XfwfBoardWidget)self)->xfwfBoard.rel_x * pw + ((XfwfBoardWidget)self)->xfwfBoard.abs_x * ((XfwfBoardWidget)self)->xfwfBoard.hunit) + px;
    *y = ceil(((XfwfBoardWidget)self)->xfwfBoard.rel_y * ph + ((XfwfBoardWidget)self)->xfwfBoard.abs_y * ((XfwfBoardWidget)self)->xfwfBoard.vunit) + py;
    minsize = 2 * ((XfwfBoardWidgetClass)self->core.widget_class)->xfwfCommon_class.total_frame_width(self);
    minsize = max(1, minsize);
    h = ceil(((XfwfBoardWidget)self)->xfwfBoard.rel_width * pw + ((XfwfBoardWidget)self)->xfwfBoard.abs_width * ((XfwfBoardWidget)self)->xfwfBoard.hunit);
    *width = h < minsize ? minsize : h;
    h = ceil(((XfwfBoardWidget)self)->xfwfBoard.rel_height * ph + ((XfwfBoardWidget)self)->xfwfBoard.abs_height * ((XfwfBoardWidget)self)->xfwfBoard.vunit);
    *height = h < minsize ? minsize : h;
}
/*ARGSUSED*/
#if NeedFunctionPrototypes
static void set_location(Widget self,unsigned  int  flags)
#else
static void set_location(self,flags)Widget self;unsigned  int  flags;
#endif
{
    Widget parent;
    Position px, py;
    int pw, ph;

    parent = ((XfwfBoardWidget)self)->core.parent;
    if (XtIsSubclass(((XfwfBoardWidget)self)->core.parent, xfwfBoardWidgetClass))
        ((XfwfBoardWidgetClass)parent->core.widget_class)->xfwfCommon_class.compute_inside(parent, &px, &py, &pw, &ph);
    else {
        px = 0;
        py = 0;
        pw = ((XfwfBoardWidget)parent)->core.width;
        ph = ((XfwfBoardWidget)parent)->core.height;
    }
    pw = max(0, pw);
    ph = max(0, ph);
    if (flags & CWX) {
        ((XfwfBoardWidget)self)->xfwfBoard.rel_x = 0.0;
        ((XfwfBoardWidget)self)->xfwfBoard.abs_x = ceil((((XfwfBoardWidget)self)->core.x - px)/((XfwfBoardWidget)self)->xfwfBoard.hunit);
    }
    if (flags & CWY) {
        ((XfwfBoardWidget)self)->xfwfBoard.rel_y = 0.0;
        ((XfwfBoardWidget)self)->xfwfBoard.abs_y = ceil((((XfwfBoardWidget)self)->core.y - py)/((XfwfBoardWidget)self)->xfwfBoard.vunit);
    }
    if (flags & CWWidth) {
        ((XfwfBoardWidget)self)->xfwfBoard.rel_width = 0.0;
        ((XfwfBoardWidget)self)->xfwfBoard.abs_width = ceil(((XfwfBoardWidget)self)->core.width/((XfwfBoardWidget)self)->xfwfBoard.hunit);
    }
    if (flags & CWHeight) {
        ((XfwfBoardWidget)self)->xfwfBoard.rel_height = 0.0;
        ((XfwfBoardWidget)self)->xfwfBoard.abs_height = ceil(((XfwfBoardWidget)self)->core.height/((XfwfBoardWidget)self)->xfwfBoard.vunit);
    }
}
/*ARGSUSED*/
#if NeedFunctionPrototypes
static String  scan(String  s,Position * absval,float * relval)
#else
static String  scan(s,absval,relval)String  s;Position * absval;float * relval;
#endif
{
    String p;
    char c;
    long n;
    float fract, factor;

    *absval = 0;
    *relval = 0.0;
    p = s;
    strtonum(p, n);
    if (*p != '.') {                            /* 1st number is integer */
        *absval = n;
        skip_blanks(p);
        c = *p;
        if (c != '+' && c != '-') return p;     /* No second number */
        s = p;
        strtonum(p, n);
        if (*p != '.') return s;                /* This is an error... */
        strtofrac(p, fract, factor);
        *relval = c == '-' ? -fract * factor - n : fract * factor + n;
        return p;
    } else {                                    /* 1st number is float */
        strtofrac(p, fract, factor);
        *relval = fract * factor + n;
        skip_blanks(p);
        c = *p;
        if (c != '+' && c != '-') return p;     /* No second number */
        strtonum(p, n);
        *absval = c == '-' ? -n : n;
        return p;
    }
}
/*ARGSUSED*/
#if NeedFunctionPrototypes
static void interpret_location(Widget self)
#else
static void interpret_location(self)Widget self;
#endif
{
    char *s;

    s = ((XfwfBoardWidget)self)->xfwfBoard.location;
    s = scan(s, &((XfwfBoardWidget)self)->xfwfBoard.abs_x, &((XfwfBoardWidget)self)->xfwfBoard.rel_x);
    s = scan(s, &((XfwfBoardWidget)self)->xfwfBoard.abs_y, &((XfwfBoardWidget)self)->xfwfBoard.rel_y);
    s = scan(s, &((XfwfBoardWidget)self)->xfwfBoard.abs_width, &((XfwfBoardWidget)self)->xfwfBoard.rel_width);
    s = scan(s, &((XfwfBoardWidget)self)->xfwfBoard.abs_height, &((XfwfBoardWidget)self)->xfwfBoard.rel_height);
}

static XtResource resources[] = {
{XtNabs_x,XtCAbs_x,XtRPosition,sizeof(((XfwfBoardRec*)NULL)->xfwfBoard.abs_x),XtOffsetOf(XfwfBoardRec,xfwfBoard.abs_x),XtRImmediate,(XtPointer)0 },
{XtNrel_x,XtCRel_x,XtRFloat,sizeof(((XfwfBoardRec*)NULL)->xfwfBoard.rel_x),XtOffsetOf(XfwfBoardRec,xfwfBoard.rel_x),XtRString,(XtPointer)"0.0"},
{XtNabs_y,XtCAbs_y,XtRPosition,sizeof(((XfwfBoardRec*)NULL)->xfwfBoard.abs_y),XtOffsetOf(XfwfBoardRec,xfwfBoard.abs_y),XtRImmediate,(XtPointer)0 },
{XtNrel_y,XtCRel_y,XtRFloat,sizeof(((XfwfBoardRec*)NULL)->xfwfBoard.rel_y),XtOffsetOf(XfwfBoardRec,xfwfBoard.rel_y),XtRString,(XtPointer)"0.0"},
{XtNx,XtCX,XtRPosition,sizeof(((XfwfBoardRec*)NULL)->core.x),XtOffsetOf(XfwfBoardRec,core.x),XtRImmediate,(XtPointer)MAGICNUM },
{XtNy,XtCY,XtRPosition,sizeof(((XfwfBoardRec*)NULL)->core.y),XtOffsetOf(XfwfBoardRec,core.y),XtRImmediate,(XtPointer)MAGICNUM },
{XtNabs_width,XtCAbs_width,XtRPosition,sizeof(((XfwfBoardRec*)NULL)->xfwfBoard.abs_width),XtOffsetOf(XfwfBoardRec,xfwfBoard.abs_width),XtRImmediate,(XtPointer)0 },
{XtNrel_width,XtCRel_width,XtRFloat,sizeof(((XfwfBoardRec*)NULL)->xfwfBoard.rel_width),XtOffsetOf(XfwfBoardRec,xfwfBoard.rel_width),XtRString,(XtPointer)"1.0"},
{XtNabs_height,XtCAbs_height,XtRPosition,sizeof(((XfwfBoardRec*)NULL)->xfwfBoard.abs_height),XtOffsetOf(XfwfBoardRec,xfwfBoard.abs_height),XtRImmediate,(XtPointer)0 },
{XtNrel_height,XtCRel_height,XtRFloat,sizeof(((XfwfBoardRec*)NULL)->xfwfBoard.rel_height),XtOffsetOf(XfwfBoardRec,xfwfBoard.rel_height),XtRString,(XtPointer)"1.0"},
{XtNwidth,XtCWidth,XtRDimension,sizeof(((XfwfBoardRec*)NULL)->core.width),XtOffsetOf(XfwfBoardRec,core.width),XtRImmediate,(XtPointer)MAGICNUM },
{XtNheight,XtCHeight,XtRDimension,sizeof(((XfwfBoardRec*)NULL)->core.height),XtOffsetOf(XfwfBoardRec,core.height),XtRImmediate,(XtPointer)MAGICNUM },
{XtNhunit,XtCHunit,XtRFloat,sizeof(((XfwfBoardRec*)NULL)->xfwfBoard.hunit),XtOffsetOf(XfwfBoardRec,xfwfBoard.hunit),XtRString,(XtPointer)"1.0"},
{XtNvunit,XtCVunit,XtRFloat,sizeof(((XfwfBoardRec*)NULL)->xfwfBoard.vunit),XtOffsetOf(XfwfBoardRec,xfwfBoard.vunit),XtRString,(XtPointer)"1.0"},
{XtNlocation,XtCLocation,XtRString,sizeof(((XfwfBoardRec*)NULL)->xfwfBoard.location),XtOffsetOf(XfwfBoardRec,xfwfBoard.location),XtRImmediate,(XtPointer)NULL },
};

XfwfBoardClassRec xfwfBoardClassRec = {
{ /* core_class part */
/* superclass   	*/  (WidgetClass) &xfwfFrameClassRec,
/* class_name   	*/  "XfwfBoard",
/* widget_size  	*/  sizeof(XfwfBoardRec),
/* class_initialize 	*/  NULL,
/* class_part_initialize*/  _resolve_inheritance,
/* class_inited 	*/  FALSE,
/* initialize   	*/  initialize,
/* initialize_hook 	*/  NULL,
/* realize      	*/  XtInheritRealize,
/* actions      	*/  NULL,
/* num_actions  	*/  0,
/* resources    	*/  resources,
/* num_resources 	*/  15,
/* xrm_class    	*/  NULLQUARK,
/* compres_motion 	*/  True ,
/* compress_exposure 	*/  XtExposeCompressMultiple ,
/* compress_enterleave 	*/  True ,
/* visible_interest 	*/  False ,
/* destroy      	*/  NULL,
/* resize       	*/  resize,
/* expose       	*/  XtInheritExpose,
/* set_values   	*/  set_values,
/* set_values_hook 	*/  NULL,
/* set_values_almost 	*/  XtInheritSetValuesAlmost,
/* get_values+hook 	*/  NULL,
/* accept_focus 	*/  XtInheritAcceptFocus,
/* version      	*/  XtVersion,
/* callback_private 	*/  NULL,
/* tm_table      	*/  NULL,
/* query_geometry 	*/  query_geometry,
/* display_acceleator 	*/  XtInheritDisplayAccelerator,
/* extension    	*/  NULL 
},
{ /* composite_class part */
geometry_manager,
change_managed,
XtInheritInsertChild,
XtInheritDeleteChild,
NULL
},
{ /* XfwfCommon_class part */
XtInherit_compute_inside,
XtInherit_total_frame_width,
XtInherit__expose,
XtInherit_highlight_border,
XtInherit_unhighlight_border,
XtInherit_hilite_callbacks,
XtInherit_would_accept_focus,
XtInherit_traverse,
XtInherit_lighter_color,
XtInherit_darker_color,
XtInherit_set_color,
/* traversal_trans */  NULL ,
/* traversal_trans_small */  NULL ,
/* travMode */  1 ,
},
{ /* XfwfFrame_class part */
 /* dummy */  0
},
{ /* XfwfBoard_class part */
set_abs_location,
},
};
WidgetClass xfwfBoardWidgetClass = (WidgetClass) &xfwfBoardClassRec;
static void _resolve_inheritance(class)
WidgetClass class;
{
  XfwfBoardWidgetClass c = (XfwfBoardWidgetClass) class;
  XfwfBoardWidgetClass super;
  static CompositeClassExtensionRec extension_rec = {
    NULL, NULLQUARK, XtCompositeExtensionVersion,
    sizeof(CompositeClassExtensionRec), True};
  CompositeClassExtensionRec *ext;
  ext = (XtPointer)XtMalloc(sizeof(*ext));
  *ext = extension_rec;
  ext->next_extension = c->composite_class.extension;
  c->composite_class.extension = ext;
  if (class == xfwfBoardWidgetClass) return;
  super = (XfwfBoardWidgetClass)class->core_class.superclass;
  if (c->xfwfBoard_class.set_abs_location == XtInherit_set_abs_location)
    c->xfwfBoard_class.set_abs_location = super->xfwfBoard_class.set_abs_location;
}
/*ARGSUSED*/
#if NeedFunctionPrototypes
static Boolean  set_values(Widget  old,Widget  request,Widget self,ArgList  args,Cardinal * num_args)
#else
static Boolean  set_values(old,request,self,args,num_args)Widget  old;Widget  request;Widget self;ArgList  args;Cardinal * num_args;
#endif
{
    XtWidgetGeometry reply;
    int i;

    if (((XfwfBoardWidget)self)->xfwfBoard.location != ((XfwfBoardWidget)old)->xfwfBoard.location) {
        XtFree(((XfwfBoardWidget)old)->xfwfBoard.location);
        ((XfwfBoardWidget)self)->xfwfBoard.location = XtNewString(((XfwfBoardWidget)self)->xfwfBoard.location);
        interpret_location(self);
        get_core_geometry(self, &((XfwfBoardWidget)self)->core.x, &((XfwfBoardWidget)self)->core.y, &((XfwfBoardWidget)self)->core.width, &((XfwfBoardWidget)self)->core.height);
    } else if (ceil(((XfwfBoardWidget)self)->xfwfBoard.abs_x*((XfwfBoardWidget)self)->xfwfBoard.hunit) != ceil(((XfwfBoardWidget)old)->xfwfBoard.abs_x*((XfwfBoardWidget)old)->xfwfBoard.hunit)
               || ceil(((XfwfBoardWidget)self)->xfwfBoard.abs_width*((XfwfBoardWidget)self)->xfwfBoard.hunit) != ceil(((XfwfBoardWidget)old)->xfwfBoard.abs_width*((XfwfBoardWidget)old)->xfwfBoard.hunit)
               || ceil(((XfwfBoardWidget)self)->xfwfBoard.abs_y*((XfwfBoardWidget)self)->xfwfBoard.vunit) != ceil(((XfwfBoardWidget)old)->xfwfBoard.abs_y*((XfwfBoardWidget)old)->xfwfBoard.vunit)
               || ceil(((XfwfBoardWidget)self)->xfwfBoard.abs_height*((XfwfBoardWidget)self)->xfwfBoard.vunit) != ceil(((XfwfBoardWidget)old)->xfwfBoard.abs_height*((XfwfBoardWidget)old)->xfwfBoard.vunit)
               || ((XfwfBoardWidget)self)->xfwfBoard.rel_x != ((XfwfBoardWidget)old)->xfwfBoard.rel_x
               || ((XfwfBoardWidget)self)->xfwfBoard.rel_y != ((XfwfBoardWidget)old)->xfwfBoard.rel_y
               || ((XfwfBoardWidget)self)->xfwfBoard.rel_width != ((XfwfBoardWidget)old)->xfwfBoard.rel_width
               || ((XfwfBoardWidget)self)->xfwfBoard.rel_height != ((XfwfBoardWidget)old)->xfwfBoard.rel_height) {
        get_core_geometry(self, &((XfwfBoardWidget)self)->core.x, &((XfwfBoardWidget)self)->core.y, &((XfwfBoardWidget)self)->core.width, &((XfwfBoardWidget)self)->core.height);
        generate_location(self);
    } else if (((XfwfBoardWidget)self)->core.x != ((XfwfBoardWidget)old)->core.x
               || ((XfwfBoardWidget)self)->core.y != ((XfwfBoardWidget)old)->core.y
               || ((XfwfBoardWidget)self)->core.width != ((XfwfBoardWidget)old)->core.width
               || ((XfwfBoardWidget)self)->core.height != ((XfwfBoardWidget)old)->core.height) {
      set_location(self, (((((XfwfBoardWidget)self)->core.x != ((XfwfBoardWidget)old)->core.x) ? CWX : 0)
		       | ((((XfwfBoardWidget)self)->core.y != ((XfwfBoardWidget)old)->core.y) ? CWY : 0)
		       | ((((XfwfBoardWidget)self)->core.width != ((XfwfBoardWidget)old)->core.width) ? CWWidth : 0)
		       | ((((XfwfBoardWidget)self)->core.height != ((XfwfBoardWidget)old)->core.height) ? CWHeight : 0)));
      generate_location(self);
    }
    if (((XfwfBoardWidgetClass)self->core.widget_class)->xfwfCommon_class.total_frame_width(old) != ((XfwfBoardWidgetClass)self->core.widget_class)->xfwfCommon_class.total_frame_width(self)) {
        for (i = 0; i < ((XfwfBoardWidget)self)->composite.num_children; i++) {
            (void) XtQueryGeometry(((XfwfBoardWidget)self)->composite.children[i], NULL, &reply);
            XtConfigureWidget(((XfwfBoardWidget)self)->composite.children[i], reply.x, reply.y, reply.width,
                              reply.height, reply.border_width);
        }
    }
    return False;
}
/*ARGSUSED*/
#if NeedFunctionPrototypes
static void initialize(Widget  request,Widget self,ArgList  args,Cardinal * num_args)
#else
static void initialize(request,self,args,num_args)Widget  request;Widget self;ArgList  args;Cardinal * num_args;
#endif
{
    if (((XfwfBoardWidget)self)->xfwfBoard.location != NULL) {
        ((XfwfBoardWidget)self)->xfwfBoard.location = XtNewString(((XfwfBoardWidget)self)->xfwfBoard.location);
        interpret_location(self);
        get_core_geometry(self, &((XfwfBoardWidget)self)->core.x, &((XfwfBoardWidget)self)->core.y, &((XfwfBoardWidget)self)->core.width, &((XfwfBoardWidget)self)->core.height);
    } else if (((XfwfBoardWidget)self)->core.x != MAGICNUM || ((XfwfBoardWidget)self)->core.y != MAGICNUM
               || ((XfwfBoardWidget)self)->core.width != MAGICNUM || ((XfwfBoardWidget)self)->core.height != MAGICNUM) {
        set_location(self, CWX | CWY | CWWidth | CWHeight);
        generate_location(self);
    } else {
        generate_location(self);
        get_core_geometry(self, &((XfwfBoardWidget)self)->core.x, &((XfwfBoardWidget)self)->core.y, &((XfwfBoardWidget)self)->core.width, &((XfwfBoardWidget)self)->core.height);
    }
}
/*ARGSUSED*/
#if NeedFunctionPrototypes
static void set_abs_location(Widget self,unsigned  int  flags,int  x,int  y,int  w,int  h)
#else
static void set_abs_location(self,flags,x,y,w,h)Widget self;unsigned  int  flags;int  x;int  y;int  w;int  h;
#endif
{
    if ((flags & (CWX | CWY | CWWidth | CWHeight)) == 0) return;
    if (flags & CWX) ((XfwfBoardWidget)self)->core.x = x;
    if (flags & CWY) ((XfwfBoardWidget)self)->core.y = y;
    if (flags & CWWidth) ((XfwfBoardWidget)self)->core.width = max(1, w);
    if (flags & CWHeight) ((XfwfBoardWidget)self)->core.height = max(1, h);
    set_location(self, flags);
    generate_location(self);
}
/*ARGSUSED*/
#if NeedFunctionPrototypes
static void resize(Widget self)
#else
static void resize(self)Widget self;
#endif
{
    int i;
    XtWidgetGeometry reply;
    Widget child;

    for (i = 0; i < ((XfwfBoardWidget)self)->composite.num_children; i++) {
        child = ((XfwfBoardWidget)self)->composite.children[i];
        (void) XtQueryGeometry(child, NULL, &reply);
        XtConfigureWidget(child, reply.x, reply.y, reply.width,
                          reply.height, reply.border_width);
    }
}
/*ARGSUSED*/
#if NeedFunctionPrototypes
static XtGeometryResult  query_geometry(Widget self,XtWidgetGeometry * request,XtWidgetGeometry * reply)
#else
static XtGeometryResult  query_geometry(self,request,reply)Widget self;XtWidgetGeometry * request;XtWidgetGeometry * reply;
#endif
{
    reply->request_mode = CWX | CWY | CWWidth | CWHeight;
    get_core_geometry(self, &reply->x, &reply->y,
                      &reply->width, &reply->height);
    return XtGeometryAlmost;
}
/*ARGSUSED*/
#if NeedFunctionPrototypes
static XtGeometryResult  geometry_manager(Widget  child,XtWidgetGeometry * request,XtWidgetGeometry * reply)
#else
static XtGeometryResult  geometry_manager(child,request,reply)Widget  child;XtWidgetGeometry * request;XtWidgetGeometry * reply;
#endif
{ Widget self = XtParent(child); {
    /* Widget $ = XtParent(child); */
    Dimension wd, ht, bw;
    Position x, y;

    /* Get complete geometry, from request or current value */
    x = request->request_mode & CWX ? request->x : ((XfwfBoardWidget)child)->core.x;
    y = request->request_mode & CWY ? request->y : ((XfwfBoardWidget)child)->core.y;
    wd = request->request_mode & CWWidth ? request->width : ((XfwfBoardWidget)child)->core.width;
    ht = request->request_mode & CWHeight ? request->height : ((XfwfBoardWidget)child)->core.height;
    bw = request->request_mode & CWBorderWidth ? request->border_width
        : ((XfwfBoardWidget)child)->core.border_width;

    if (wd <= 0) wd = 1; if (ht <= 0) ht = 1; /* MATTHEW: [5] */
    XtConfigureWidget(child, x, y, wd, ht, bw);
    return XtGeometryDone;
}
}
/*ARGSUSED*/
#if NeedFunctionPrototypes
static void change_managed(Widget self)
#else
static void change_managed(self)Widget self;
#endif
{
#if 1
    Widget top = self, w;

    while (!XtIsSubclass(top, shellWidgetClass)) top = XtParent(top) ;
    for (w = self; w != top; w = XtParent(w)) XtInstallAllAccelerators(w, top);
#endif
}
