/* Generated by wbuild from "IconBox.w"
** (generator version $Revision: 1.17 $ of $Date: 92/12/07 19:32:00 $)
*/
#include <X11/IntrinsicP.h>
#include <X11/StringDefs.h>
#line 1108 "IconBox.w"
#include <X11/xpm.h>
#line 1109 "IconBox.w"
#include <Xfwf/Button.h>
#line 1110 "IconBox.w"
#include "default_icon.xpm"
#line 1111 "IconBox.w"
#include <stdio.h>
#line 1112 "IconBox.w"
#include <X11/Xatom.h>
#include <Xfwf/IconBoxP.h>
#line 287 "IconBox.w"
static void area_select(
#if NeedFunctionPrototypes
Widget,XEvent*,String*,Cardinal*
#endif
);
#line 328 "IconBox.w"
static void area_select_also(
#if NeedFunctionPrototypes
Widget,XEvent*,String*,Cardinal*
#endif
);
#line 365 "IconBox.w"
static void move_icons(
#if NeedFunctionPrototypes
Widget,XEvent*,String*,Cardinal*
#endif
);
#line 403 "IconBox.w"
static void select_also(
#if NeedFunctionPrototypes
Widget,XEvent*,String*,Cardinal*
#endif
);
#line 423 "IconBox.w"
static void activate_item(
#if NeedFunctionPrototypes
Widget,XEvent*,String*,Cardinal*
#endif
);
#line 437 "IconBox.w"
static void check_double_click(
#if NeedFunctionPrototypes
Widget,XEvent*,String*,Cardinal*
#endif
);
#line 470 "IconBox.w"
static void prepare_drag(
#if NeedFunctionPrototypes
Widget,XEvent*,String*,Cardinal*
#endif
);
#line 487 "IconBox.w"
static void drag(
#if NeedFunctionPrototypes
Widget,XEvent*,String*,Cardinal*
#endif
);
#line 542 "IconBox.w"
static void select_or_drop(
#if NeedFunctionPrototypes
Widget,XEvent*,String*,Cardinal*
#endif
);
#line 593 "IconBox.w"
static void handle_drop(
#if NeedFunctionPrototypes
Widget,XEvent*,String*,Cardinal*
#endif
);
#line 654 "IconBox.w"
static void drag_into(
#if NeedFunctionPrototypes
Widget,XEvent*,String*,Cardinal*
#endif
);
#line 671 "IconBox.w"
static void drag_out_of(
#if NeedFunctionPrototypes
Widget,XEvent*,String*,Cardinal*
#endif
);

static XtActionsRec actionsList[] = {
{"area_select", area_select},
{"area_select_also", area_select_also},
{"move_icons", move_icons},
{"select_also", select_also},
{"activate_item", activate_item},
{"check_double_click", check_double_click},
{"prepare_drag", prepare_drag},
{"drag", drag},
{"select_or_drop", select_or_drop},
{"handle_drop", handle_drop},
{"drag_into", drag_into},
{"drag_out_of", drag_out_of},
};

static char defaultTranslations[] = "\
Shift<Btn1Down>: area_select_also() \n\
<Btn1Down>: area_select() \n\
<Message>Drop: move_icons() \n\
";
static void _resolve_inheritance(
#if NeedFunctionPrototypes
WidgetClass
#endif
);
#line 691 "IconBox.w"
static void clean_up(
#if NeedFunctionPrototypes
Widget
#endif
);
#line 700 "IconBox.w"
static void canonical_order(
#if NeedFunctionPrototypes
Widget
#endif
);
#line 726 "IconBox.w"
static void class_initialize(
#if NeedFunctionPrototypes
void
#endif
);
#line 742 "IconBox.w"
static void initialize(
#if NeedFunctionPrototypes
Widget ,Widget,ArgList ,Cardinal *
#endif
);
#line 776 "IconBox.w"
static Boolean  set_values(
#if NeedFunctionPrototypes
Widget ,Widget ,Widget,ArgList ,Cardinal *
#endif
);
#line 799 "IconBox.w"
static void resize(
#if NeedFunctionPrototypes
Widget
#endif
);
#line 807 "IconBox.w"
#define ALLOC 1024 


#line 808 "IconBox.w"
#define new(p) p =(void *)XtMalloc (sizeof (*(p )))


#line 809 "IconBox.w"
#define myrealloc(p, size) (void *)XtRealloc ((void *)p ,(size +ALLOC -1 )/ALLOC *ALLOC )


#line 811 "IconBox.w"
#define mymalloc(size) (void *)XtMalloc (size )


#line 812 "IconBox.w"
#define myfree(p) XtFree ((void *)p )


#line 816 "IconBox.w"
static void deallocate_list(
#if NeedFunctionPrototypes
XfwfIconList 
#endif
);
#line 831 "IconBox.w"
static void copy_list(
#if NeedFunctionPrototypes
Widget
#endif
);
#line 854 "IconBox.w"
static void draw_outlines(
#if NeedFunctionPrototypes
Widget,int ,int ,int 
#endif
);
#line 874 "IconBox.w"
static void send_event(
#if NeedFunctionPrototypes
Widget
#endif
);
#line 903 "IconBox.w"
static void set_selection(
#if NeedFunctionPrototypes
Widget,int ,Time 
#endif
);
#line 942 "IconBox.w"
static Boolean  defaultIcon_created = False ;
#line 943 "IconBox.w"
static Icon  defaultIcon;
#line 954 "IconBox.w"
#define PRIME 211 


#line 956 "IconBox.w"
static int  hashcode(
#if NeedFunctionPrototypes
String 
#endif
);
#line 976 "IconBox.w"
static Boolean  lookup(
#if NeedFunctionPrototypes
Widget,String ,Icon *
#endif
);
#line 991 "IconBox.w"
static void read_icon(
#if NeedFunctionPrototypes
Widget,String ,Icon *
#endif
);
#line 1012 "IconBox.w"
static void get_icon(
#if NeedFunctionPrototypes
Widget,String ,Icon *
#endif
);
#line 1037 "IconBox.w"
static void create_icons(
#if NeedFunctionPrototypes
Widget
#endif
);
#line 1074 "IconBox.w"
static void rubberband_region(
#if NeedFunctionPrototypes
Widget,XEvent *,Region *
#endif
);
#line 816 "IconBox.w"
/*ARGSUSED*/static void deallocate_list(list)XfwfIconList  list;
{
    int i;

    if (list != NULL) {
	for (i = 0; list[i].flags != -1; i++) {
	    myfree(list[i].icon);
	    myfree(list[i].label);
	}
	myfree(list);
    }
}
#line 831 "IconBox.w"
/*ARGSUSED*/static void copy_list(self)Widget self;
{
    XfwfIconList list = NULL;
    int i, n;

    if (((XfwfIconBoxWidget)self)->xfwfIconBox.list != NULL) {
	for (n = 0; ((XfwfIconBoxWidget)self)->xfwfIconBox.list[n].flags != -1; n++) ; /* skip */
	list = mymalloc((n + 1) * sizeof(list[0]));
	for (i = 0; i < n; i++) {
	    list[i].icon = XtNewString(((XfwfIconBoxWidget)self)->xfwfIconBox.list[i].icon);
	    list[i].flags = ((XfwfIconBoxWidget)self)->xfwfIconBox.list[i].flags;
	    list[i].label = XtNewString(((XfwfIconBoxWidget)self)->xfwfIconBox.list[i].label);
	}
	list[n].flags = -1;
    }
    ((XfwfIconBoxWidget)self)->xfwfIconBox.list = list;
}
#line 854 "IconBox.w"
/*ARGSUSED*/static void draw_outlines(self,n,dx,dy)Widget self;int  n;int  dx;int  dy;
{
    Widget icon, label;
    Display *dpy = XtDisplay(self);
    Window root = RootWindowOfScreen(XtScreen(self));
    Position x, y;

    icon = ((XfwfIconBoxWidget)self)->xfwfIconBox.item_info[n].icon;
    XtTranslateCoords(self, ((XfwfIconBoxWidget)icon)->core.x + dx, ((XfwfIconBoxWidget)icon)->core.y + dy, &x, &y);
    XDrawRectangle(dpy, root, ((XfwfIconBoxWidget)self)->xfwfIconBox.xor_gc, x, y, ((XfwfIconBoxWidget)icon)->core.width, ((XfwfIconBoxWidget)icon)->core.height);

    label = ((XfwfIconBoxWidget)self)->xfwfIconBox.item_info[n].label;
    XtTranslateCoords(self, ((XfwfIconBoxWidget)label)->core.x + dx, ((XfwfIconBoxWidget)label)->core.y + dy, &x, &y);
    XDrawRectangle(dpy, root, ((XfwfIconBoxWidget)self)->xfwfIconBox.xor_gc, x, y, ((XfwfIconBoxWidget)label)->core.width, ((XfwfIconBoxWidget)label)->core.height);
}
#line 874 "IconBox.w"
/*ARGSUSED*/static void send_event(self)Widget self;
{
    static XClientMessageEvent ev;
    Display *dpy = XtDisplay(self);
    Window root, child, child0;
    int dummy1, dummy2, dummy3, dummy4;
    unsigned int dummy5;

    child = RootWindowOfScreen(XtScreen(self));
    while (XQueryPointer(dpy, child, &root, &child0, &dummy1, &dummy2,
			 &dummy3, &dummy4, &dummy5) && child0 != None)
	child = child0;

    ev.type = ClientMessage;
    ev.display = dpy;
    ev.message_type = ((XfwfIconBoxWidget)self)->xfwfIconBox.drop_atom;
    ev.format = 32;
    ev.data.l[0] = (long) XtWindow(self);
    ev.data.l[1] = (long) self;
    ev.window = child;
    ++ev.serial;
    XSendEvent(dpy, child, True, NoEventMask, (XEvent*)&ev);
}
#line 903 "IconBox.w"
/*ARGSUSED*/static void set_selection(self,n,time)Widget self;int  n;Time  time;
{
    Display *dpy = XtDisplay(self);
    Window win = RootWindowOfScreen(XtScreen(self));
    static int *data = NULL;
    int len, i, j, stat;

    XSetSelectionOwner(dpy, ((XfwfIconBoxWidget)self)->xfwfIconBox.drop_selection, win, time);
    if (XGetSelectionOwner(dpy, ((XfwfIconBoxWidget)self)->xfwfIconBox.drop_selection) != win)
	XtWarning("XGetSelectionOwner failed");
    else if (((XfwfIconBoxWidget)self)->xfwfIconBox.item_info[n].selected) {
	for (len = 0, i = ((XfwfIconBoxWidget)self)->xfwfIconBox.nitems - 1; i >= 0; i--)
	    if (((XfwfIconBoxWidget)self)->xfwfIconBox.item_info[i].selected) len++;
	/* fprintf(stderr, "set_selection len=%d: ", len); */
	myfree(data);
	data = mymalloc(len * sizeof(*data));
	for (j = 0, i = 0; i < ((XfwfIconBoxWidget)self)->xfwfIconBox.nitems; i++)
	    if (((XfwfIconBoxWidget)self)->xfwfIconBox.item_info[i].selected) {
		/* fprintf(stderr, " %d", i);  */
		data[j++] = i;
	    }
	/* fprintf(stderr, "\n"); */
    } else {
	myfree(data);
	data = mymalloc(sizeof(*data));
	data[0] = n;
	len = 1;
	/* fprintf(stderr, "set_selection len=1: %d\n", n); */
    }
    stat = XChangeProperty
	(dpy, win, ((XfwfIconBoxWidget)self)->xfwfIconBox.drop_selection, XA_INTEGER, sizeof(*data) * 8,
	 PropModeReplace, (unsigned char *) data, len);
    /* Test stat here? */
}
#line 956 "IconBox.w"
/*ARGSUSED*/static int  hashcode(name)String  name;
{
    String p;
    unsigned int h = 0, g;
    
    for (p = name; *p; p++) {
	h = (h << 4) + (*p);
	if (g = h & 0xf0000000) {
	    h = h ^ (g >> 24);
	    h = h ^ g;
	}
    }
    return h % PRIME;

}
#line 976 "IconBox.w"
/*ARGSUSED*/static Boolean  lookup(self,name,icon)Widget self;String  name;Icon * icon;
{
    Bucket b;

    for (b = ((XfwfIconBoxWidgetClass)self->core.widget_class)->xfwfIconBox_class.hashtable[hashcode(name)]; b != NULL; b = b->next)
	if (strcmp(b->name, name) == 0) {
	    *icon = b->icon;
	    return True;
	}
    return False;
}
#line 991 "IconBox.w"
/*ARGSUSED*/static void read_icon(self,name,icon)Widget self;String  name;Icon * icon;
{
    Display *dpy;
    int status;
    XtAppContext apc;

    dpy = XtDisplay(self);
    apc = XtDisplayToApplicationContext(dpy);
    icon->attributes.valuemask = XpmSize;
    status = XpmReadFileToPixmap(dpy, DefaultRootWindow(dpy), name,
				 &icon->pixmap, &icon->mask,
				 &icon->attributes);
    if (status != XpmSuccess && status != XpmColorError) {
	XtAppWarning(apc, "Failed to create an icon");
	*icon = defaultIcon;
    }
}
#line 1012 "IconBox.w"
/*ARGSUSED*/static void get_icon(self,name,icon)Widget self;String  name;Icon * icon;
{
    if (! lookup(self, name, icon)) {
        read_icon(self, name, icon);
        XfwfCacheIcon(self, name, *icon);
    }
}
#line 1037 "IconBox.w"
/*ARGSUSED*/static void create_icons(self)Widget self;
{
    int i, len;
    Icon *icon;
    String s;

    s = mymalloc((strlen(((XfwfIconBoxWidget)self)->xfwfIconBox.iconTranslations) + 50) * sizeof(char));
    for (i = 0; i < ((XfwfIconBoxWidget)self)->xfwfIconBox.nitems; i++) {
	XtDestroyWidget(((XfwfIconBoxWidget)self)->xfwfIconBox.item_info[i].icon);
	XtDestroyWidget(((XfwfIconBoxWidget)self)->xfwfIconBox.item_info[i].label);
    }
    if (((XfwfIconBoxWidget)self)->xfwfIconBox.list == NULL)
        ((XfwfIconBoxWidget)self)->xfwfIconBox.nitems = 0;
    else {
        for (i = 0; ((XfwfIconBoxWidget)self)->xfwfIconBox.list[i].flags != -1; i++) ; /* skip */
	((XfwfIconBoxWidget)self)->xfwfIconBox.nitems = i;
	((XfwfIconBoxWidget)self)->xfwfIconBox.item_info = mymalloc(i * sizeof(*((XfwfIconBoxWidget)self)->xfwfIconBox.item_info));
        for (i = 0; i < ((XfwfIconBoxWidget)self)->xfwfIconBox.nitems; i++) {
            new(icon);
            get_icon(self, ((XfwfIconBoxWidget)self)->xfwfIconBox.list[i].icon, icon);
            len = sprintf(s, ((XfwfIconBoxWidget)self)->xfwfIconBox.iconTranslations, i);
            ((XfwfIconBoxWidget)self)->xfwfIconBox.item_info[i].icon = XtVaCreateManagedWidget
		(((XfwfIconBoxWidget)self)->xfwfIconBox.list[i].icon, xfwfIconWidgetClass, self, XtVaTypedArg,
		 XtNtranslations, XtRString, s, len+1, XtNimage, icon,
		 XtNtraversalOn, False, NULL);
            ((XfwfIconBoxWidget)self)->xfwfIconBox.item_info[i].label = XtVaCreateManagedWidget
		(((XfwfIconBoxWidget)self)->xfwfIconBox.list[i].label, xfwfButtonWidgetClass, self,
		 XtVaTypedArg, XtNtranslations, XtRString, s, len+1,
		 XtNlabel, ((XfwfIconBoxWidget)self)->xfwfIconBox.list[i].label, XtNshrinkToFit, True,
		 XtNfont, ((XfwfIconBoxWidget)self)->xfwfIconBox.labelFont, NULL);
	    ((XfwfIconBoxWidget)self)->xfwfIconBox.item_info[i].selected = False;
        }
    }
    ((XfwfIconBoxWidgetClass)self->core.widget_class)->xfwfIconBox_class.canonical_order(self);
    myfree(s);
}
#line 1074 "IconBox.w"
/*ARGSUSED*/static void rubberband_region(self,event,reg)Widget self;XEvent * event;Region * reg;
{
    Display *dpy = XtDisplay(self);
    Window root, child, win = XtWindow(self);
    int minx, miny, wd, ht, x0, y0, rx, ry, x, y, l;
    Boolean wait_press;
    unsigned int mask, button;
    XRectangle rect;

    wait_press = (event->type == ButtonRelease);
    button = Button1Mask << (event->xbutton.button - 1);
    x0 = event->xbutton.x;  wd = 0;  minx = x0;
    y0 = event->xbutton.y;  ht = 0;  miny = y0;
    XDrawRectangle(dpy, win, ((XfwfIconBoxWidget)self)->xfwfIconBox.xor_gc, minx, miny, wd, ht);
    while (XQueryPointer(dpy, win, &root, &child, &rx, &ry, &x, &y, &mask)) {
	if (wait_press && (mask & button)) wait_press = False;
	else if (! wait_press && ! (mask & button)) break;
	if (minx != min(x, x0) || miny != min(y, y0)
	    || wd != abs(x - x0) || ht != abs(y - y0)) {
	    XDrawRectangle(dpy, win, ((XfwfIconBoxWidget)self)->xfwfIconBox.xor_gc, minx, miny, wd, ht);
	    minx = min(x, x0);  wd = abs(x - x0);
	    miny = min(y, y0);  ht = abs(y - y0);
	    XDrawRectangle(dpy, win, ((XfwfIconBoxWidget)self)->xfwfIconBox.xor_gc, minx, miny, wd, ht);
	}
    }
    XDrawRectangle(dpy, win, ((XfwfIconBoxWidget)self)->xfwfIconBox.xor_gc, minx, miny, wd, ht);

    rect.x = minx; rect.y = miny; rect.width = wd; rect.height = ht;
    *reg = XCreateRegion();
    XUnionRectWithRegion(&rect, *reg, *reg);
}

static XtResource resources[] = {
#line 36 "IconBox.w"
{XtNlist,XtCList,XtRXFwfIconList,sizeof(((XfwfIconBoxRec*)NULL)->xfwfIconBox.list),XtOffsetOf(XfwfIconBoxRec,xfwfIconBox.list),XtRImmediate,(XtPointer)NULL },
#line 42 "IconBox.w"
{XtNhorizontalGrid,XtCHorizontalGrid,XtRDimension,sizeof(((XfwfIconBoxRec*)NULL)->xfwfIconBox.horizontalGrid),XtOffsetOf(XfwfIconBoxRec,xfwfIconBox.horizontalGrid),XtRImmediate,(XtPointer)100 },
#line 46 "IconBox.w"
{XtNverticalGrid,XtCVerticalGrid,XtRDimension,sizeof(((XfwfIconBoxRec*)NULL)->xfwfIconBox.verticalGrid),XtOffsetOf(XfwfIconBoxRec,xfwfIconBox.verticalGrid),XtRImmediate,(XtPointer)100 },
#line 51 "IconBox.w"
{XtNmargin,XtCMargin,XtRInt,sizeof(((XfwfIconBoxRec*)NULL)->xfwfIconBox.margin),XtOffsetOf(XfwfIconBoxRec,xfwfIconBox.margin),XtRImmediate,(XtPointer)3 },
#line 60 "IconBox.w"
{XtNitemSelect,XtCItemSelect,XtRCallback,sizeof(((XfwfIconBoxRec*)NULL)->xfwfIconBox.itemSelect),XtOffsetOf(XfwfIconBoxRec,xfwfIconBox.itemSelect),XtRImmediate,(XtPointer)NULL },
#line 65 "IconBox.w"
{XtNitemDeselect,XtCItemDeselect,XtRCallback,sizeof(((XfwfIconBoxRec*)NULL)->xfwfIconBox.itemDeselect),XtOffsetOf(XfwfIconBoxRec,xfwfIconBox.itemDeselect),XtRImmediate,(XtPointer)NULL },
#line 72 "IconBox.w"
{XtNitemActivate,XtCItemActivate,XtRCallback,sizeof(((XfwfIconBoxRec*)NULL)->xfwfIconBox.itemActivate),XtOffsetOf(XfwfIconBoxRec,xfwfIconBox.itemActivate),XtRImmediate,(XtPointer)NULL },
#line 80 "IconBox.w"
{XtNitemDrop,XtCItemDrop,XtRCallback,sizeof(((XfwfIconBoxRec*)NULL)->xfwfIconBox.itemDrop),XtOffsetOf(XfwfIconBoxRec,xfwfIconBox.itemDrop),XtRImmediate,(XtPointer)NULL },
#line 87 "IconBox.w"
{XtNlabelFont,XtCLabelFont,XtRFontStruct,sizeof(((XfwfIconBoxRec*)NULL)->xfwfIconBox.labelFont),XtOffsetOf(XfwfIconBoxRec,xfwfIconBox.labelFont),XtRString,(XtPointer)"fixed"},
#line 97 "IconBox.w"
{XtNiconTranslations,XtCIconTranslations,XtRString,sizeof(((XfwfIconBoxRec*)NULL)->xfwfIconBox.iconTranslations),XtOffsetOf(XfwfIconBoxRec,xfwfIconBox.iconTranslations),XtRImmediate,(XtPointer)"\
	    <Message>Drop: handle_drop(%1$d)\n\
	    Shift<Key>space: select_also(%1$d)\n\
	    <Key>space: select_or_drop(%1$d)\n\
	    <Key>Return: activate_item(%1$d)\n\
	    Shift<Btn1Up>: select_also(%1$d)\n\
	    <Btn1Up>: select_or_drop(%1$d)\n\
	    <Btn1Down>: prepare_drag(%1$d) check_double_click(%1$d)\n\
	    <Btn1Motion>: drag(%1$d)"},
#line 109 "IconBox.w"
{XtNdragCursor,XtCDragCursor,XtRCursor,sizeof(((XfwfIconBoxRec*)NULL)->xfwfIconBox.dragCursor),XtOffsetOf(XfwfIconBoxRec,xfwfIconBox.dragCursor),XtRString,(XtPointer)"crosshair"},
};

XfwfIconBoxClassRec xfwfIconBoxClassRec = {
{ /* core_class part */
(WidgetClass) &xfwfBoardClassRec,
"XfwfIconBox",
sizeof(XfwfIconBoxRec),
class_initialize,
_resolve_inheritance,
FALSE,
initialize,
NULL,
XtInheritRealize,
actionsList,
12,
resources,
11,
NULLQUARK,
False ,
FALSE ,
False ,
False ,
NULL,
resize,
XtInheritExpose,
set_values,
NULL,
XtInheritSetValuesAlmost,
NULL,
XtInheritAcceptFocus,
XtVersion,
NULL,
defaultTranslations,
XtInheritQueryGeometry,
XtInheritDisplayAccelerator,
NULL 
},
{ /* composite_class part */
XtInheritGeometryManager,
XtInheritChangeManaged,
XtInheritInsertChild,
XtInheritDeleteChild,
NULL
},
{ /* XfwfCommon_class part */
XtInherit_compute_inside,
XtInherit_highlight_border,
XtInherit_unhighlight_border,
XtInherit_would_accept_focus,
XtInherit_traverse,
XtInherit_choose_color,
XtInherit_lighter_color,
XtInherit_darker_color,
NULL ,
},
{ /* XfwfFrame_class part */
0
},
{ /* XfwfBoard_class part */
XtInherit_set_abs_location,
},
{ /* XfwfIconBox_class part */
clean_up,
canonical_order,
NULL ,
},
};
WidgetClass xfwfIconBoxWidgetClass = (WidgetClass) &xfwfIconBoxClassRec;
/*ARGSUSED*/
#line 287 "IconBox.w"
static void area_select(self,event,params,num_params)Widget self;XEvent*event;String*params;Cardinal*num_params;
{
    Widget icon, label;
    int i, l;
    Region reg;

    if (event->type != ButtonPress && event->type != ButtonRelease) {
	XtWarning("area_select action is not bound to button press/release");
	return;
    }
    rubberband_region(self, event, &reg);

    for (i = 0; i < ((XfwfIconBoxWidget)self)->xfwfIconBox.nitems; i++) {
	icon = ((XfwfIconBoxWidget)self)->xfwfIconBox.item_info[i].icon;
	label = ((XfwfIconBoxWidget)self)->xfwfIconBox.item_info[i].label;
	if (XRectInRegion(reg, ((XfwfIconBoxWidget)icon)->core.x, ((XfwfIconBoxWidget)icon)->core.y, ((XfwfIconBoxWidget)icon)->core.width,
			  ((XfwfIconBoxWidget)icon)->core.height) == RectangleOut
	    && XRectInRegion(reg, ((XfwfIconBoxWidget)label)->core.x, ((XfwfIconBoxWidget)label)->core.y, ((XfwfIconBoxWidget)label)->core.width,
			  ((XfwfIconBoxWidget)label)->core.height) == RectangleOut) {
	    if (((XfwfIconBoxWidget)self)->xfwfIconBox.item_info[i].selected) {
		XtVaSetValues(((XfwfIconBoxWidget)self)->xfwfIconBox.item_info[i].label, XtNrvLength, 0, NULL);
		((XfwfIconBoxWidget)self)->xfwfIconBox.item_info[i].selected = False;
		XtCallCallbackList(self, ((XfwfIconBoxWidget)self)->xfwfIconBox.itemDeselect, (XtPointer) i);
	    }
	} else {
	    if (! ((XfwfIconBoxWidget)self)->xfwfIconBox.item_info[i].selected) {
		l = strlen(((XfwfIconBoxWidget)self)->xfwfIconBox.list[i].label);
		XtVaSetValues(((XfwfIconBoxWidget)self)->xfwfIconBox.item_info[i].label, XtNrvLength, l, NULL);
		((XfwfIconBoxWidget)self)->xfwfIconBox.item_info[i].selected = True;
		XtCallCallbackList(self, ((XfwfIconBoxWidget)self)->xfwfIconBox.itemSelect, (XtPointer) i);
	    }
	}
    }
}

/*ARGSUSED*/
#line 328 "IconBox.w"
static void area_select_also(self,event,params,num_params)Widget self;XEvent*event;String*params;Cardinal*num_params;
{
    Widget icon, label;
    int i, l;
    Region reg;

    if (event->type != ButtonPress && event->type != ButtonRelease) {
	XtWarning("area_select action is not bound to button press/release");
	return;
    }
    rubberband_region(self, event, &reg);

    for (i = 0; i < ((XfwfIconBoxWidget)self)->xfwfIconBox.nitems; i++) {
	icon = ((XfwfIconBoxWidget)self)->xfwfIconBox.item_info[i].icon;
	label = ((XfwfIconBoxWidget)self)->xfwfIconBox.item_info[i].label;
	if (XRectInRegion(reg, ((XfwfIconBoxWidget)icon)->core.x, ((XfwfIconBoxWidget)icon)->core.y, ((XfwfIconBoxWidget)icon)->core.width,
			  ((XfwfIconBoxWidget)icon)->core.height) == RectangleOut
	    && XRectInRegion(reg, ((XfwfIconBoxWidget)label)->core.x, ((XfwfIconBoxWidget)label)->core.y, ((XfwfIconBoxWidget)label)->core.width,
			  ((XfwfIconBoxWidget)label)->core.height) == RectangleOut) {
	    ; /* Outside the rectangle, no change */
	} else {
	    if (! ((XfwfIconBoxWidget)self)->xfwfIconBox.item_info[i].selected) {
		l = strlen(((XfwfIconBoxWidget)self)->xfwfIconBox.list[i].label);
		XtVaSetValues(((XfwfIconBoxWidget)self)->xfwfIconBox.item_info[i].label, XtNrvLength, l, NULL);
		((XfwfIconBoxWidget)self)->xfwfIconBox.item_info[i].selected = True;
		XtCallCallbackList(self, ((XfwfIconBoxWidget)self)->xfwfIconBox.itemSelect, (XtPointer) i);
	    }
	}
    }
}

/*ARGSUSED*/
#line 365 "IconBox.w"
static void move_icons(self,event,params,num_params)Widget self;XEvent*event;String*params;Cardinal*num_params;
{
    Display *dpy = XtDisplay(self);
    Window root = RootWindowOfScreen(XtScreen(self));
    int stat, i, dx, dy, format;
    int *data;
    Atom type;
    unsigned long len, leftover;
    Widget icon, label;

    if (event->type != ClientMessage
	|| event->xclient.message_type != ((XfwfIconBoxWidget)self)->xfwfIconBox.drop_atom
	|| event->xclient.data.l[0] != (long) XtWindow(self)) return;

    stat = XGetWindowProperty
	(dpy, root, ((XfwfIconBoxWidget)self)->xfwfIconBox.drop_selection, 0L, 100000L, False,
	 AnyPropertyType, &type, &format, &len, &leftover,
	 (unsigned char **) &data);
    /* Should check type, format and leftover here... */
    dx = ((XfwfIconBoxWidget)self)->xfwfIconBox.dragxprev - ((XfwfIconBoxWidget)self)->xfwfIconBox.dragx0;
    dy = ((XfwfIconBoxWidget)self)->xfwfIconBox.dragyprev - ((XfwfIconBoxWidget)self)->xfwfIconBox.dragy0;
    for (i = 0; i < len; i++) {
	icon = ((XfwfIconBoxWidget)self)->xfwfIconBox.item_info[data[i]].icon;
	label = ((XfwfIconBoxWidget)self)->xfwfIconBox.item_info[data[i]].label;
	XtMoveWidget(icon, ((XfwfIconBoxWidget)icon)->core.x + dx, ((XfwfIconBoxWidget)icon)->core.y + dy);
	XtMoveWidget(label, ((XfwfIconBoxWidget)label)->core.x + dx, ((XfwfIconBoxWidget)label)->core.y + dy);
    }
}

/*ARGSUSED*/
#line 403 "IconBox.w"
static void select_also(self,event,params,num_params)Widget self;XEvent*event;String*params;Cardinal*num_params;
{
    int n, l;
    Widget iconbox = XtParent(self);

    n = atoi(params[0]);
    /* fprintf(stderr, "select_also for: %s\n", $iconbox$list[n].label); */
    if (! ((XfwfIconBoxWidget)iconbox)->xfwfIconBox.item_info[n].selected) {
	((XfwfIconBoxWidget)iconbox)->xfwfIconBox.item_info[n].selected = True;
	l = strlen(((XfwfIconBoxWidget)iconbox)->xfwfIconBox.list[n].label);
	XtVaSetValues(((XfwfIconBoxWidget)iconbox)->xfwfIconBox.item_info[n].label, XtNrvLength, l, NULL);
	XtCallCallbackList(iconbox, ((XfwfIconBoxWidget)iconbox)->xfwfIconBox.itemSelect, (XtPointer) n);
    }
}

/*ARGSUSED*/
#line 423 "IconBox.w"
static void activate_item(self,event,params,num_params)Widget self;XEvent*event;String*params;Cardinal*num_params;
{
    int n;
    Widget iconbox = XtParent(self);

    n = atoi(params[0]);
    /* fprintf(stderr, "activate_item for: %s\n", $iconbox$list[n].label); */
    XtCallCallbackList(iconbox, ((XfwfIconBoxWidget)iconbox)->xfwfIconBox.itemActivate, (XtPointer) n);
}

/*ARGSUSED*/
#line 437 "IconBox.w"
static void check_double_click(self,event,params,num_params)Widget self;XEvent*event;String*params;Cardinal*num_params;
{
    static Widget prev_widget = NULL;
    static Time prev_time;
    int n, multiclick;
    Widget iconbox;

    if (self == prev_widget) {
	multiclick = XtGetMultiClickTime(XtDisplay(self));
	if (event->xbutton.time - prev_time <= multiclick) {
	    n = atoi(params[0]);
	    iconbox = XtParent(self);
	    XtCallCallbackList(iconbox, ((XfwfIconBoxWidget)iconbox)->xfwfIconBox.itemActivate, (XtPointer) n);
	}
    }
    prev_widget = self;
    prev_time = event->xbutton.time;
}

/*ARGSUSED*/
#line 470 "IconBox.w"
static void prepare_drag(self,event,params,num_params)Widget self;XEvent*event;String*params;Cardinal*num_params;
{
    Widget iconbox = XtParent(self);
    Display *dpy = XtDisplay(self);
    int n;

    n = atoi(params[0]);
    ((XfwfIconBoxWidget)iconbox)->xfwfIconBox.dragx0 = event->xmotion.x_root;
    ((XfwfIconBoxWidget)iconbox)->xfwfIconBox.dragy0 = event->xmotion.y_root;
    /* fprintf(stderr, "prepare_drag for: %s\n", $iconbox$list[n].label); */
}

/*ARGSUSED*/
#line 487 "IconBox.w"
static void drag(self,event,params,num_params)Widget self;XEvent*event;String*params;Cardinal*num_params;
{
    Widget iconbox = XtParent(self);
    Display *dpy = XtDisplay(self);
    int n, dx, dy, i;

    n = atoi(params[0]);
    dx = ((XfwfIconBoxWidget)iconbox)->xfwfIconBox.dragxprev - ((XfwfIconBoxWidget)iconbox)->xfwfIconBox.dragx0;
    dy = ((XfwfIconBoxWidget)iconbox)->xfwfIconBox.dragyprev - ((XfwfIconBoxWidget)iconbox)->xfwfIconBox.dragy0;

    if (! ((XfwfIconBoxWidget)iconbox)->xfwfIconBox.drag_in_progress) {
	/*
	XChangeActivePointerGrab
	    (dpy, ButtonMotionMask | ButtonPressMask | ButtonReleaseMask |
	     EnterWindowMask | LeaveWindowMask,
	     $iconbox$dragCursor, event->xmotion.time); 
	     */
	XGrabServer(dpy);
	/*
	XGrabPointer(dpy, XtWindow(iconbox), True, ButtonMotionMask |
		     ButtonPressMask | ButtonReleaseMask | EnterWindowMask |
		     LeaveWindowMask, GrabModeAsync, GrabModeAsync, None,
		     $iconbox$dragCursor, event->xmotion.time);
		     */
	((XfwfIconBoxWidget)iconbox)->xfwfIconBox.drag_in_progress = True;
    } else if (((XfwfIconBoxWidget)iconbox)->xfwfIconBox.item_info[n].selected) {
	for (i = ((XfwfIconBoxWidget)iconbox)->xfwfIconBox.nitems - 1; i >= 0; i--)
	    if (((XfwfIconBoxWidget)iconbox)->xfwfIconBox.item_info[i].selected)
		draw_outlines(iconbox, i, dx, dy);
    } else {
	draw_outlines(iconbox, n, dx, dy);
    }

    ((XfwfIconBoxWidget)iconbox)->xfwfIconBox.dragxprev = event->xmotion.x_root;
    ((XfwfIconBoxWidget)iconbox)->xfwfIconBox.dragyprev = event->xmotion.y_root;
    dx = ((XfwfIconBoxWidget)iconbox)->xfwfIconBox.dragxprev - ((XfwfIconBoxWidget)iconbox)->xfwfIconBox.dragx0;
    dy = ((XfwfIconBoxWidget)iconbox)->xfwfIconBox.dragyprev - ((XfwfIconBoxWidget)iconbox)->xfwfIconBox.dragy0;

    if (((XfwfIconBoxWidget)iconbox)->xfwfIconBox.item_info[n].selected) {
	for (i = ((XfwfIconBoxWidget)iconbox)->xfwfIconBox.nitems - 1; i >= 0; i--)
	    if (((XfwfIconBoxWidget)iconbox)->xfwfIconBox.item_info[i].selected)
		draw_outlines(iconbox, i, dx, dy);
    } else {
	draw_outlines(iconbox, n, dx, dy);
    }
}

/*ARGSUSED*/
#line 542 "IconBox.w"
static void select_or_drop(self,event,params,num_params)Widget self;XEvent*event;String*params;Cardinal*num_params;
{
    Widget iconbox = XtParent(self);
    int n, dx, dy, i, l;

    n = atoi(params[0]);
    /*
      fprintf(stderr, "... select_or_drop for: %s\n", $iconbox$list[n].label);
      */
    if (((XfwfIconBoxWidget)iconbox)->xfwfIconBox.drag_in_progress) {
	dx = ((XfwfIconBoxWidget)iconbox)->xfwfIconBox.dragxprev - ((XfwfIconBoxWidget)iconbox)->xfwfIconBox.dragx0;
	dy = ((XfwfIconBoxWidget)iconbox)->xfwfIconBox.dragyprev - ((XfwfIconBoxWidget)iconbox)->xfwfIconBox.dragy0;
	if (((XfwfIconBoxWidget)iconbox)->xfwfIconBox.item_info[n].selected) {
	    for (i = ((XfwfIconBoxWidget)iconbox)->xfwfIconBox.nitems - 1; i >= 0; i--)
		if (((XfwfIconBoxWidget)iconbox)->xfwfIconBox.item_info[i].selected)
		    draw_outlines(iconbox, i, dx, dy);
	} else {
	    draw_outlines(iconbox, n, dx, dy);
	}
	XFlush(XtDisplay(self));
	XUngrabServer(XtDisplay(self));
	set_selection(iconbox, n, event->xbutton.time);
	send_event(iconbox);
	((XfwfIconBoxWidget)iconbox)->xfwfIconBox.drag_in_progress = False;
    } else {
	for (i = 0; i < ((XfwfIconBoxWidget)iconbox)->xfwfIconBox.nitems; i++) {
	    if (i != n && ((XfwfIconBoxWidget)iconbox)->xfwfIconBox.item_info[i].selected) {
		XtVaSetValues(((XfwfIconBoxWidget)iconbox)->xfwfIconBox.item_info[i].label, XtNrvLength,
			      0, NULL);
		((XfwfIconBoxWidget)iconbox)->xfwfIconBox.item_info[i].selected = False;
		XtCallCallbackList(iconbox, ((XfwfIconBoxWidget)iconbox)->xfwfIconBox.itemDeselect,
				   (XtPointer) i);
	    }
	}
	if (! ((XfwfIconBoxWidget)iconbox)->xfwfIconBox.item_info[n].selected) {
	    ((XfwfIconBoxWidget)iconbox)->xfwfIconBox.item_info[n].selected = True;
	    l = strlen(((XfwfIconBoxWidget)iconbox)->xfwfIconBox.list[n].label);
	    XtVaSetValues(((XfwfIconBoxWidget)iconbox)->xfwfIconBox.item_info[n].label, XtNrvLength, l, NULL);
	    XtCallCallbackList(iconbox, ((XfwfIconBoxWidget)iconbox)->xfwfIconBox.itemSelect, (XtPointer) i);
	}
    }
}

/*ARGSUSED*/
#line 593 "IconBox.w"
static void handle_drop(self,event,params,num_params)Widget self;XEvent*event;String*params;Cardinal*num_params;
{
    Display *dpy = XtDisplay(self);
    Widget icon, label, iconbox, sender;
    Window root = RootWindowOfScreen(XtScreen(self));
    int n, stat, format, i, dx, dy;
    unsigned long len, leftover;
    Atom type;
    XfwfItemDropInfo info;

    n = atoi(params[0]);
    iconbox = XtParent(self);
    if (event->type != ClientMessage
	|| event->xclient.message_type != ((XfwfIconBoxWidget)iconbox)->xfwfIconBox.drop_atom) return;

    /*
      if (event->xclient.data.l[0] != (long) XtWindow(iconbox)) {
       XtWarning("Received drop from another IconBox!");
       return;
      }
    */
    sender = info.sender = (Widget) event->xclient.data.l[1];
    if (! XtIsSubclass(sender, xfwfIconBoxWidgetClass)) {
	XtWarning("Cannot handle drop from anything other than IconBox");
	return;
    }
    info.target = n;
    stat = XGetWindowProperty
	(dpy, root, ((XfwfIconBoxWidget)iconbox)->xfwfIconBox.drop_selection, 0L, 100000L, False,
	 AnyPropertyType, &type, &format, &len, &leftover,
	 (unsigned char **) &info.droplings);
    info.n = len;
    /* Should check type, format and leftover here... */
    if (((XfwfIconBoxWidget)iconbox)->xfwfIconBox.list[n].flags & 1) {
	icon = ((XfwfIconBoxWidget)iconbox)->xfwfIconBox.item_info[n].icon;
	label = ((XfwfIconBoxWidget)iconbox)->xfwfIconBox.item_info[n].label;
	((XfwfIconBoxWidgetClass)icon->core.widget_class)->xfwfCommon_class.unhighlight_border(icon);
	((XfwfIconBoxWidgetClass)label->core.widget_class)->xfwfCommon_class.unhighlight_border(label);
	XtCallCallbackList(iconbox, ((XfwfIconBoxWidget)iconbox)->xfwfIconBox.itemDrop, &info);
    } else if (event->xclient.data.l[0] == (long) XtWindow(iconbox)) {
	dx = ((XfwfIconBoxWidget)iconbox)->xfwfIconBox.dragxprev - ((XfwfIconBoxWidget)iconbox)->xfwfIconBox.dragx0;
	dy = ((XfwfIconBoxWidget)iconbox)->xfwfIconBox.dragyprev - ((XfwfIconBoxWidget)iconbox)->xfwfIconBox.dragy0;
	for (i = 0; i < info.n; i++) {
	    icon = ((XfwfIconBoxWidget)iconbox)->xfwfIconBox.item_info[info.droplings[i]].icon;
	    label = ((XfwfIconBoxWidget)iconbox)->xfwfIconBox.item_info[info.droplings[i]].label;
	    XtMoveWidget(icon, ((XfwfIconBoxWidget)icon)->core.x + dx, ((XfwfIconBoxWidget)icon)->core.y + dy);
	    XtMoveWidget(label, ((XfwfIconBoxWidget)label)->core.x + dx, ((XfwfIconBoxWidget)label)->core.y + dy);
	}
    } else {
	/*
	 * Dropped from different iconbox on an item that is not
	 * sensitive to dropping; do nothing.
	 */
    }
}

/*ARGSUSED*/
#line 654 "IconBox.w"
static void drag_into(self,event,params,num_params)Widget self;XEvent*event;String*params;Cardinal*num_params;
{
    Widget icon, label, iconbox = XtParent(self);
    int n;

    n = atoi(params[0]);
    if (((XfwfIconBoxWidget)iconbox)->xfwfIconBox.drag_in_progress && (((XfwfIconBoxWidget)iconbox)->xfwfIconBox.list[n].flags & 1)) {
	icon = ((XfwfIconBoxWidget)iconbox)->xfwfIconBox.item_info[n].icon;
	label = ((XfwfIconBoxWidget)iconbox)->xfwfIconBox.item_info[n].label;
	((XfwfIconBoxWidgetClass)icon->core.widget_class)->xfwfCommon_class.highlight_border(icon);
	((XfwfIconBoxWidgetClass)label->core.widget_class)->xfwfCommon_class.highlight_border(label);
    }
}

/*ARGSUSED*/
#line 671 "IconBox.w"
static void drag_out_of(self,event,params,num_params)Widget self;XEvent*event;String*params;Cardinal*num_params;
{
    Widget icon, label, iconbox = XtParent(self);
    int n;

    n = atoi(params[0]);
    if (((XfwfIconBoxWidget)iconbox)->xfwfIconBox.drag_in_progress && (((XfwfIconBoxWidget)iconbox)->xfwfIconBox.list[n].flags & 1)) {
	icon = ((XfwfIconBoxWidget)iconbox)->xfwfIconBox.item_info[n].icon;
	label = ((XfwfIconBoxWidget)iconbox)->xfwfIconBox.item_info[n].label;
	((XfwfIconBoxWidgetClass)icon->core.widget_class)->xfwfCommon_class.unhighlight_border(icon);
	((XfwfIconBoxWidgetClass)label->core.widget_class)->xfwfCommon_class.unhighlight_border(label);
    }
}

static void _resolve_inheritance(class)
WidgetClass class;
{
  XfwfIconBoxWidgetClass c = (XfwfIconBoxWidgetClass) class;
  XfwfIconBoxWidgetClass super;
  if (class == xfwfIconBoxWidgetClass) return;
  super = (XfwfIconBoxWidgetClass) c->core_class.superclass;
  if (c->xfwfIconBox_class.clean_up == XtInherit_clean_up)
    c->xfwfIconBox_class.clean_up = super->xfwfIconBox_class.clean_up;
  if (c->xfwfIconBox_class.canonical_order == XtInherit_canonical_order)
    c->xfwfIconBox_class.canonical_order = super->xfwfIconBox_class.canonical_order;
}
#line 691 "IconBox.w"
/*ARGSUSED*/static void clean_up(self)Widget self;
{
    /* not implemented yet */
}
#line 700 "IconBox.w"
/*ARGSUSED*/static void canonical_order(self)Widget self;
{
    int i, x, y, w;
    Widget icon, label;

    x = ((XfwfIconBoxWidget)self)->xfwfIconBox.horizontalGrid/2;
    y = ((XfwfIconBoxWidget)self)->xfwfIconBox.margin;
    w = ((XfwfIconBoxWidget)self)->core.width - ((XfwfIconBoxWidget)self)->xfwfIconBox.horizontalGrid/2;
    for (i = 0; i < ((XfwfIconBoxWidget)self)->xfwfIconBox.nitems; i++) {
	icon = ((XfwfIconBoxWidget)self)->xfwfIconBox.item_info[i].icon;
	label = ((XfwfIconBoxWidget)self)->xfwfIconBox.item_info[i].label;
	XtMoveWidget(icon, x - ((XfwfIconBoxWidget)icon)->core.width/2, y);
	XtMoveWidget(label, x - ((XfwfIconBoxWidget)label)->core.width/2, y + ((XfwfIconBoxWidget)icon)->core.height);
	x += ((XfwfIconBoxWidget)self)->xfwfIconBox.horizontalGrid;
	if (x >= w) {
	    x = ((XfwfIconBoxWidget)self)->xfwfIconBox.horizontalGrid/2;
	    y += ((XfwfIconBoxWidget)self)->xfwfIconBox.verticalGrid;
	}
    }
}
#line 726 "IconBox.w"
/*ARGSUSED*/static void class_initialize()
{
    int i;

    xfwfIconBoxClassRec.xfwfIconBox_class.hashtable =
	mymalloc(PRIME * sizeof(Bucket));
    for (i = 0; i < PRIME; i++)
	xfwfIconBoxClassRec.xfwfIconBox_class.hashtable[i] = NULL;
    /* Install a type converter for XfwfItemList here */
}
#line 742 "IconBox.w"
/*ARGSUSED*/static void initialize(request,self,args,num_args)Widget  request;Widget self;ArgList  args;Cardinal * num_args;
{
    XtGCMask mask = GCFunction | GCForeground | GCSubwindowMode;
    XGCValues values;
    Widget icon;

    if (! defaultIcon_created) {
	defaultIcon.attributes.valuemask = XpmSize;
	(void) XpmCreatePixmapFromData
	    (XtDisplay(self), RootWindowOfScreen(XtScreen(self)),
	     default_icon, &defaultIcon.pixmap,
	     &defaultIcon.mask, &defaultIcon.attributes);
	defaultIcon_created = True;
    }
    ((XfwfIconBoxWidget)self)->xfwfIconBox.drop_atom = XInternAtom(XtDisplay(self), "Drop", False);
    ((XfwfIconBoxWidget)self)->xfwfIconBox.drop_selection = XInternAtom(XtDisplay(self), "DropSelection", False);
    ((XfwfIconBoxWidget)self)->xfwfIconBox.drag_in_progress = False;
    values.function = GXxor;
    values.foreground = 1;
    values.subwindow_mode = IncludeInferiors;
    ((XfwfIconBoxWidget)self)->xfwfIconBox.xor_gc = XtGetGC(self, mask, &values);
    ((XfwfIconBoxWidget)self)->xfwfIconBox.nitems = 0;
    ((XfwfIconBoxWidget)self)->xfwfIconBox.item_info = NULL;
    copy_list(self);
    create_icons(self);
    if (((XfwfIconBoxWidget)self)->xfwfIconBox.nitems > 0) {
	icon = ((XfwfIconBoxWidget)self)->xfwfIconBox.item_info[((XfwfIconBoxWidget)self)->xfwfIconBox.nitems-1].icon;
	((XfwfIconBoxWidgetClass)self->core.widget_class)->xfwfBoard_class.set_abs_location(self, CWHeight, 0, 0, 0, ((XfwfIconBoxWidget)icon)->core.y + ((XfwfIconBoxWidget)self)->xfwfIconBox.verticalGrid);
    }
}
#line 776 "IconBox.w"
/*ARGSUSED*/static Boolean  set_values(old,request,self,args,num_args)Widget  old;Widget  request;Widget self;ArgList  args;Cardinal * num_args;
{
    Boolean recreate = False;
    int i;
    Widget icon;

    if (((XfwfIconBoxWidget)old)->xfwfIconBox.list != ((XfwfIconBoxWidget)self)->xfwfIconBox.list) {
	deallocate_list(((XfwfIconBoxWidget)old)->xfwfIconBox.list);
	copy_list(self);
	create_icons(self);
	if (((XfwfIconBoxWidget)self)->xfwfIconBox.nitems > 0) {
	    icon = ((XfwfIconBoxWidget)self)->xfwfIconBox.item_info[((XfwfIconBoxWidget)self)->xfwfIconBox.nitems-1].icon;
	    ((XfwfIconBoxWidgetClass)self->core.widget_class)->xfwfBoard_class.set_abs_location(self, CWHeight, 0, 0, 0, ((XfwfIconBoxWidget)icon)->core.y + ((XfwfIconBoxWidget)self)->xfwfIconBox.verticalGrid);
	}
    }
    return False;
}
#line 799 "IconBox.w"
/*ARGSUSED*/static void resize(self)Widget self;
{
    /* skip */
}
#line 117 "IconBox.w"
#line 128 "IconBox.w"
#line 133 "IconBox.w"
#line 140 "IconBox.w"
#line 151 "IconBox.w"
/*ARGSUSED*/void XfwfCleanUp(self)Widget self;
{
    if (XtIsSubclass(self, xfwfIconBoxWidgetClass)) ((XfwfIconBoxWidgetClass)self->core.widget_class)->xfwfIconBox_class.clean_up(self);
}
#line 161 "IconBox.w"
/*ARGSUSED*/void XfwfCanonicalOrder(self)Widget self;
{
    if (XtIsSubclass(self, xfwfIconBoxWidgetClass)) ((XfwfIconBoxWidgetClass)self->core.widget_class)->xfwfIconBox_class.canonical_order(self);
}
#line 179 "IconBox.w"
/*ARGSUSED*/void XfwfCacheIcon(self,name,icon)Widget self;String  name;Icon  icon;
{
    int h;
    Bucket b;

    h = hashcode(name);
    new(b);
    b->name = XtNewString(name);
    b->icon = icon;
    b->next = ((XfwfIconBoxWidgetClass)self->core.widget_class)->xfwfIconBox_class.hashtable[h];
    ((XfwfIconBoxWidgetClass)self->core.widget_class)->xfwfIconBox_class.hashtable[h] = b;
}
