comparison src/gui.h @ 269:b2472a1930f2 r20-5b33

Import from CVS: tag r20-5b33
author cvs
date Mon, 13 Aug 2007 10:27:19 +0200
parents 677f6a0ee643
children c5d627a313b1
comparison
equal deleted inserted replaced
268:6ced69ccd85f 269:b2472a1930f2
48 }; 48 };
49 #define GUI_ITEM_LAST_GCPROED keys 49 #define GUI_ITEM_LAST_GCPROED keys
50 #define GUI_ITEM_GCPRO_COUNT \ 50 #define GUI_ITEM_GCPRO_COUNT \
51 (slot_offset(struct gui_item, GUI_ITEM_LAST_GCPROED) / sizeof(Lisp_Object) + 1) 51 (slot_offset(struct gui_item, GUI_ITEM_LAST_GCPROED) / sizeof(Lisp_Object) + 1)
52 52
53 /*
54 * gui_item is a struct containing a bunch of Lisp_Object
55 * members. We need to GC-protect all the member slots.
56 * Rather than build a long chain of individual gcpro structs
57 * that protect the slots individually, we protect all the
58 * member slots by pretending the struct is an array. ANSI C
59 * requires tihs hack to work, ugly though it is.
60 */
61 #define GCPRO_GUI_ITEM(pgui_item) \
62 do { \
63 Lisp_Object *gui_item_array = (Lisp_Object *) pgui_item; \
64 GCPRO1 (gui_item_array[0]); \
65 gcpro1.nvars = GUI_ITEM_GCPRO_COUNT; \
66 } while (0);
67
53 void gui_item_init (struct gui_item *pgui_item); 68 void gui_item_init (struct gui_item *pgui_item);
54 void gui_item_add_keyval_pair (struct gui_item *pgui_item, 69 void gui_item_add_keyval_pair (struct gui_item *pgui_item,
55 Lisp_Object key, Lisp_Object val); 70 Lisp_Object key, Lisp_Object val);
56 void gui_parse_item_keywords (Lisp_Object item, struct gui_item *pgui_item); 71 void gui_parse_item_keywords (Lisp_Object item, struct gui_item *pgui_item);
57 int gui_item_active_p (CONST struct gui_item *pgui_item); 72 int gui_item_active_p (CONST struct gui_item *pgui_item);