Commits

Michele Bini  committed 7b61429

Tweaked accessor macros for gtkutil.h

  • Participants
  • Parent commits 97bbcef

Comments (0)

Files changed (1)

File src/gtkutil.h

    detachable menus.  The data in the frame structure is only valid while
    the menu is popped up.  This structure is kept around as long as
    the menu is.  */
+
+
 typedef struct xg_menu_cb_data_
 {
   struct vectorlike_header header;
 #define XMENUCBDATA(a) ((xg_menu_cb_data *)XPNTR_OR_NULL(a))
 #define XSETMENUCBDATA(a, b) XSETPSEUDOVECTOR(a, b, PVEC_OTHER)
 
-  Lisp_Object   ___next, ___prev;
-#define XMENUCBNEXT(cbdata)           AREF(cbdata, PSEUDOVECSIZE(xg_menu_cb_data, ___next))
-#define XSETMENUCBNEXT(cbdata, x)     ASET(cbdata, PSEUDOVECSIZE(xg_menu_cb_data, ___next), x)
-#define XMENUCBPREV(cbdata)           AREF(cbdata, PSEUDOVECSIZE(xg_menu_cb_data, ___prev))
-#define XSETMENUCBPREV(cbdata, x)     ASET(cbdata, PSEUDOVECSIZE(xg_menu_cb_data, ___prev), x)
-
-  Lisp_Object   ___menu_bar_vector;
-#define XMENUBARVECTOR(cbdata)        AREF(cbdata, PSEUDOVECSIZE(xg_menu_cb_data, ___menu_bar_vector))
-#define XSETMENUBARVECTOR(cbdata, x)  ASET(cbdata, PSEUDOVECSIZE(xg_menu_cb_data, ___menu_bar_vector), x)
+#define MENUCBDATA_FIELD(n) n##__menucbdata_field
+#define MENUCBDATA_DECLARE(n) Lisp_Object MENUCBDATA_FIELD(n)
+#define MENUCBDATA_GET(s, n)     AREF((s), PSEUDOVECSIZE(xg_menu_cb_data, MENUCBDATA_FIELD(n)))
+#define MENUCBDATA_SET(s, n, v)  ASET((s), PSEUDOVECSIZE(xg_menu_cb_data, MENUCBDATA_FIELD(n)), (v))
+  MENUCBDATA_DECLARE(next);
+  MENUCBDATA_DECLARE(prev);
+#define XMENUCBNEXT(cbdata)           MENUCBDATA_GET(cbdata, next)
+#define XSETMENUCBNEXT(cbdata, x)     MENUCBDATA_SET(cbdata, next, x)
+#define XMENUCBPREV(cbdata)           MENUCBDATA_GET(cbdata, prev)
+#define XSETMENUCBPREV(cbdata, x)     MENUCBDATA_SET(cbdata, prev, x)
+
+  MENUCBDATA_DECLARE(menu_bar_vector);
+#define XMENUBARVECTOR(cbdata)        MENUCBDATA_GET(cbdata, menu_bar_vector)
+#define XSETMENUBARVECTOR(cbdata, x)  MENUCBDATA_SET(cbdata, menu_bar_vector, x)
 
 #define ALLOCATE_MENUCBDATA()				\
   ALLOCATE_PSEUDOVECTOR(xg_menu_cb_data,		\
 #define XMENUITEMCBDATA(a) ((xg_menu_item_cb_data *)XPNTR_OR_NULL(a))
 #define XSETMENUITEMCBDATA(a, b) XSETPSEUDOVECTOR(a, b, PVEC_OTHER)
 
-  Lisp_Object   next, prev;
-  Lisp_Object   ___help;
-#define XMENUITEMHELP(cbdata)        AREF(cbdata, PSEUDOVECSIZE(xg_menu_item_cb_data, ___help))
-#define XSETMENUITEMHELP(cbdata, x)  ASET(cbdata, PSEUDOVECSIZE(xg_menu_item_cb_data, ___help), x)
-  Lisp_Object   ___menu;
-#define XMENUITEMMENU(cbdata)        AREF(cbdata, PSEUDOVECSIZE(xg_menu_item_cb_data, ___menu))
-#define XSETMENUITEMMENU(cbdata, x)  ASET(cbdata, PSEUDOVECSIZE(xg_menu_item_cb_data, ___menu), x)
+#define MENUITEMCBDATA_FIELD(n) n##__menuitemcbdata_field
+#define MENUITEMCBDATA_DECLARE(n) Lisp_Object MENUITEMCBDATA_FIELD(n)
+#define MENUITEMCBDATA_GET(s, n)     AREF((s), PSEUDOVECSIZE(xg_menu_item_cb_data, MENUITEMCBDATA_FIELD(n)))
+#define MENUITEMCBDATA_SET(s, n, v)  ASET((s), PSEUDOVECSIZE(xg_menu_item_cb_data, MENUITEMCBDATA_FIELD(n)), (v))
+  MENUITEMCBDATA_DECLARE(next);
+  MENUITEMCBDATA_DECLARE(prev);
+  
+  MENUITEMCBDATA_DECLARE(help);
+#define XMENUITEMHELP(cbdata)        MENUITEMCBDATA_GET(cbdata, help)
+#define XSETMENUITEMHELP(cbdata, x)  MENUITEMCBDATA_SET(cbdata, help, x)
+
+  MENUITEMCBDATA_DECLARE(menu);
+#define XMENUITEMMENU(cbdata)        MENUITEMCBDATA_GET(cbdata, menu)
+#define XSETMENUITEMMENU(cbdata, x)  MENUITEMCBDATA_SET(cbdata, menu, x)
 
 #define ALLOCATE_MENUITEMCBDATA()			\
   ALLOCATE_PSEUDOVECTOR(xg_menu_item_cb_data,		\