+static Lisp_Object
+mark_gui_item (Lisp_Object obj, void (*markobj) (Lisp_Object))
+{
+ struct Lisp_Gui_Item *p = XGUI_ITEM (obj);
+
+ markobj (p->name);
+ markobj (p->callback);
+ markobj (p->config);
+ markobj (p->suffix);
+ markobj (p->active);
+ markobj (p->included);
+ markobj (p->config);
+ markobj (p->filter);
+ markobj (p->style);
+ markobj (p->selected);
+ markobj (p->keys);
+ markobj (p->accelerator);
+
+ return Qnil;
+}
+
+static unsigned long
+gui_item_hash (Lisp_Object obj, int depth)
+{
+ struct Lisp_Gui_Item *p = XGUI_ITEM (obj);
+
+ return HASH2 (HASH5 (internal_hash (p->name, depth + 1),
+ internal_hash (p->callback, depth + 1),
+ internal_hash (p->suffix, depth + 1),
+ internal_hash (p->active, depth + 1),
+ internal_hash (p->included, depth + 1)),
+ HASH5 (internal_hash (p->config, depth + 1),
+ internal_hash (p->filter, depth + 1),
+ internal_hash (p->style, depth + 1),
+ internal_hash (p->selected, depth + 1),
+ internal_hash (p->keys, depth + 1)));
+}
+
+int
+gui_item_id_hash (Lisp_Object hashtable, Lisp_Object gitem, int slot)
+{
+ int hashid = gui_item_hash (gitem, 0);
+ int id = GUI_ITEM_ID_BITS (hashid, slot);
+ while (!NILP (Fgethash (make_int (id),
+ hashtable, Qnil)))
+ {
+ id = GUI_ITEM_ID_BITS (id + 1, slot);
+ }
+ return id;
+}
+
+static int
+gui_item_equal (Lisp_Object obj1, Lisp_Object obj2, int depth)
+{
+ struct Lisp_Gui_Item *p1 = XGUI_ITEM (obj1);
+ struct Lisp_Gui_Item *p2 = XGUI_ITEM (obj2);
+
+ if (!(internal_equal (p1->name, p2->name, depth + 1)
+ &&
+ internal_equal (p1->callback, p2->callback, depth + 1)
+ &&
+ EQ (p1->suffix, p2->suffix)
+ &&
+ EQ (p1->active, p2->active)
+ &&
+ EQ (p1->included, p2->included)
+ &&
+ EQ (p1->config, p2->config)
+ &&
+ EQ (p1->filter, p2->filter)
+ &&
+ EQ (p1->style, p2->style)
+ &&
+ EQ (p1->selected, p2->selected)
+ &&
+ EQ (p1->accelerator, p2->accelerator)
+ &&
+ EQ (p1->keys, p2->keys)))
+ return 0;
+ return 1;
+}
+
+static void
+print_gui_item (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag)
+{
+ struct Lisp_Gui_Item *g = XGUI_ITEM (obj);
+ char buf[20];
+
+ if (print_readably)
+ error ("printing unreadable object #<gui-item 0x%x>", g->header.uid);
+
+ write_c_string ("#<gui-item ", printcharfun);
+ sprintf (buf, "0x%x>", g->header.uid);
+ write_c_string (buf, printcharfun);
+}
+
+DEFINE_LRECORD_IMPLEMENTATION ("gui-item", gui_item,
+ mark_gui_item, print_gui_item,
+ 0, gui_item_equal,
+ gui_item_hash,
+ 0,
+ struct Lisp_Gui_Item);