XEmacs 21.2.27 "Hera".
[chise/xemacs-chise.git.1] / src / toolbar.c
index 64ff6ed..cff25ac 100644 (file)
@@ -57,19 +57,19 @@ Lisp_Object Qinit_toolbar_from_resources;
 
 \f
 static Lisp_Object
-mark_toolbar_button (Lisp_Object obj, void (*markobj) (Lisp_Object))
+mark_toolbar_button (Lisp_Object obj)
 {
   struct toolbar_button *data = XTOOLBAR_BUTTON (obj);
-  markobj (data->next);
-  markobj (data->frame);
-  markobj (data->up_glyph);
-  markobj (data->down_glyph);
-  markobj (data->disabled_glyph);
-  markobj (data->cap_up_glyph);
-  markobj (data->cap_down_glyph);
-  markobj (data->cap_disabled_glyph);
-  markobj (data->callback);
-  markobj (data->enabled_p);
+  mark_object (data->next);
+  mark_object (data->frame);
+  mark_object (data->up_glyph);
+  mark_object (data->down_glyph);
+  mark_object (data->disabled_glyph);
+  mark_object (data->cap_up_glyph);
+  mark_object (data->cap_down_glyph);
+  mark_object (data->cap_disabled_glyph);
+  mark_object (data->callback);
+  mark_object (data->enabled_p);
   return data->help_string;
 }
 
@@ -90,7 +90,7 @@ print_toolbar_button (Lisp_Object obj, Lisp_Object printcharfun,
 
 DEFINE_LRECORD_IMPLEMENTATION ("toolbar-button", toolbar_button,
                               mark_toolbar_button, print_toolbar_button,
-                              0, 0, 0,
+                              0, 0, 0, 0,
                               struct toolbar_button);
 
 DEFUN ("toolbar-button-p", Ftoolbar_button_p, 1, 1, 0, /*
@@ -1312,6 +1312,12 @@ specifier_type_create_toolbar (void)
 }
 
 void
+reinit_specifier_type_create_toolbar (void)
+{
+  REINITIALIZE_SPECIFIER_TYPE (toolbar);
+}
+
+void
 specifier_vars_of_toolbar (void)
 {
   Lisp_Object fb;
@@ -1428,8 +1434,7 @@ For the other vector formats (specifying blank areas of the toolbar):
      automatically knew about specifier fallbacks, so we didn't
      have to do it ourselves. */
   set_specifier_caching (Vdefault_toolbar,
-                        slot_offset (struct window,
-                                     default_toolbar),
+                        offsetof (struct window, default_toolbar),
                         default_toolbar_specs_changed,
                         0, 0);
 
@@ -1441,8 +1446,7 @@ See `default-toolbar' for a description of a valid toolbar instantiator.
 */ );
   Vtoolbar[TOP_TOOLBAR] = Fmake_specifier (Qtoolbar);
   set_specifier_caching (Vtoolbar[TOP_TOOLBAR],
-                        slot_offset (struct window,
-                                     toolbar[TOP_TOOLBAR]),
+                        offsetof (struct window, toolbar[TOP_TOOLBAR]),
                         toolbar_specs_changed,
                         0, 0);
 
@@ -1459,8 +1463,7 @@ displayed even if you provide a value for `bottom-toolbar'.
 */ );
   Vtoolbar[BOTTOM_TOOLBAR] = Fmake_specifier (Qtoolbar);
   set_specifier_caching (Vtoolbar[BOTTOM_TOOLBAR],
-                        slot_offset (struct window,
-                                     toolbar[BOTTOM_TOOLBAR]),
+                        offsetof (struct window, toolbar[BOTTOM_TOOLBAR]),
                         toolbar_specs_changed,
                         0, 0);
 
@@ -1477,8 +1480,7 @@ displayed even if you provide a value for `left-toolbar'.
 */ );
   Vtoolbar[LEFT_TOOLBAR] = Fmake_specifier (Qtoolbar);
   set_specifier_caching (Vtoolbar[LEFT_TOOLBAR],
-                        slot_offset (struct window,
-                                     toolbar[LEFT_TOOLBAR]),
+                        offsetof (struct window, toolbar[LEFT_TOOLBAR]),
                         toolbar_specs_changed,
                         0, 0);
 
@@ -1495,8 +1497,7 @@ displayed even if you provide a value for `right-toolbar'.
 */ );
   Vtoolbar[RIGHT_TOOLBAR] = Fmake_specifier (Qtoolbar);
   set_specifier_caching (Vtoolbar[RIGHT_TOOLBAR],
-                        slot_offset (struct window,
-                                     toolbar[RIGHT_TOOLBAR]),
+                        offsetof (struct window, toolbar[RIGHT_TOOLBAR]),
                         toolbar_specs_changed,
                         0, 0);
 
@@ -1550,11 +1551,9 @@ is not visible, so it is expanded to take up the slack.
 */ );
   Vdefault_toolbar_height = Fmake_specifier (Qnatnum);
   set_specifier_caching (Vdefault_toolbar_height,
-                        slot_offset (struct window,
-                                     default_toolbar_height),
+                        offsetof (struct window, default_toolbar_height),
                         default_toolbar_size_changed_in_window,
-                        slot_offset (struct frame,
-                                     default_toolbar_height),
+                        offsetof (struct frame, default_toolbar_height),
                         default_toolbar_size_changed_in_frame);
 
   DEFVAR_SPECIFIER ("default-toolbar-width", &Vdefault_toolbar_width /*
@@ -1565,11 +1564,9 @@ See `default-toolbar-height' for more information.
 */ );
   Vdefault_toolbar_width = Fmake_specifier (Qnatnum);
   set_specifier_caching (Vdefault_toolbar_width,
-                        slot_offset (struct window,
-                                     default_toolbar_width),
+                        offsetof (struct window, default_toolbar_width),
                         default_toolbar_size_changed_in_window,
-                        slot_offset (struct frame,
-                                     default_toolbar_width),
+                        offsetof (struct frame, default_toolbar_width),
                         default_toolbar_size_changed_in_frame);
 
   DEFVAR_SPECIFIER ("top-toolbar-height",
@@ -1581,11 +1578,9 @@ See `default-toolbar-height' for more information.
 */ );
   Vtoolbar_size[TOP_TOOLBAR] = Fmake_specifier (Qnatnum);
   set_specifier_caching (Vtoolbar_size[TOP_TOOLBAR],
-                        slot_offset (struct window,
-                                     toolbar_size[TOP_TOOLBAR]),
+                        offsetof (struct window, toolbar_size[TOP_TOOLBAR]),
                         toolbar_geometry_changed_in_window,
-                        slot_offset (struct frame,
-                                     toolbar_size[TOP_TOOLBAR]),
+                        offsetof (struct frame, toolbar_size[TOP_TOOLBAR]),
                         frame_size_slipped);
 
   DEFVAR_SPECIFIER ("bottom-toolbar-height",
@@ -1597,11 +1592,9 @@ See `default-toolbar-height' for more information.
 */ );
   Vtoolbar_size[BOTTOM_TOOLBAR] = Fmake_specifier (Qnatnum);
   set_specifier_caching (Vtoolbar_size[BOTTOM_TOOLBAR],
-                        slot_offset (struct window,
-                                     toolbar_size[BOTTOM_TOOLBAR]),
+                        offsetof (struct window, toolbar_size[BOTTOM_TOOLBAR]),
                         toolbar_geometry_changed_in_window,
-                        slot_offset (struct frame,
-                                     toolbar_size[BOTTOM_TOOLBAR]),
+                        offsetof (struct frame, toolbar_size[BOTTOM_TOOLBAR]),
                         frame_size_slipped);
 
   DEFVAR_SPECIFIER ("left-toolbar-width",
@@ -1613,11 +1606,9 @@ See `default-toolbar-height' for more information.
 */ );
   Vtoolbar_size[LEFT_TOOLBAR] = Fmake_specifier (Qnatnum);
   set_specifier_caching (Vtoolbar_size[LEFT_TOOLBAR],
-                        slot_offset (struct window,
-                                     toolbar_size[LEFT_TOOLBAR]),
+                        offsetof (struct window, toolbar_size[LEFT_TOOLBAR]),
                         toolbar_geometry_changed_in_window,
-                        slot_offset (struct frame,
-                                     toolbar_size[LEFT_TOOLBAR]),
+                        offsetof (struct frame, toolbar_size[LEFT_TOOLBAR]),
                         frame_size_slipped);
 
   DEFVAR_SPECIFIER ("right-toolbar-width",
@@ -1629,11 +1620,9 @@ See `default-toolbar-height' for more information.
 */ );
   Vtoolbar_size[RIGHT_TOOLBAR] = Fmake_specifier (Qnatnum);
   set_specifier_caching (Vtoolbar_size[RIGHT_TOOLBAR],
-                        slot_offset (struct window,
-                                     toolbar_size[RIGHT_TOOLBAR]),
+                        offsetof (struct window, toolbar_size[RIGHT_TOOLBAR]),
                         toolbar_geometry_changed_in_window,
-                        slot_offset (struct frame,
-                                     toolbar_size[RIGHT_TOOLBAR]),
+                        offsetof (struct frame, toolbar_size[RIGHT_TOOLBAR]),
                         frame_size_slipped);
 
   fb = Qnil;
@@ -1694,11 +1683,9 @@ the value in a window domain will not.
 */ );
   Vdefault_toolbar_border_width = Fmake_specifier (Qnatnum);
   set_specifier_caching (Vdefault_toolbar_border_width,
-                        slot_offset (struct window,
-                                     default_toolbar_border_width),
+                        offsetof (struct window, default_toolbar_border_width),
                         default_toolbar_border_width_changed_in_window,
-                        slot_offset (struct frame,
-                                     default_toolbar_border_width),
+                        offsetof (struct frame, default_toolbar_border_width),
                         default_toolbar_border_width_changed_in_frame);
 
   DEFVAR_SPECIFIER ("top-toolbar-border-width",
@@ -1710,11 +1697,11 @@ See `default-toolbar-height' for more information.
 */ );
   Vtoolbar_border_width[TOP_TOOLBAR] = Fmake_specifier (Qnatnum);
   set_specifier_caching (Vtoolbar_border_width[TOP_TOOLBAR],
-                        slot_offset (struct window,
-                                     toolbar_border_width[TOP_TOOLBAR]),
+                        offsetof (struct window,
+                                  toolbar_border_width[TOP_TOOLBAR]),
                         toolbar_geometry_changed_in_window,
-                        slot_offset (struct frame,
-                                     toolbar_border_width[TOP_TOOLBAR]),
+                        offsetof (struct frame,
+                                  toolbar_border_width[TOP_TOOLBAR]),
                         frame_size_slipped);
 
   DEFVAR_SPECIFIER ("bottom-toolbar-border-width",
@@ -1726,11 +1713,11 @@ See `default-toolbar-height' for more information.
 */ );
   Vtoolbar_border_width[BOTTOM_TOOLBAR] = Fmake_specifier (Qnatnum);
   set_specifier_caching (Vtoolbar_border_width[BOTTOM_TOOLBAR],
-                        slot_offset (struct window,
-                                     toolbar_border_width[BOTTOM_TOOLBAR]),
+                        offsetof (struct window,
+                                  toolbar_border_width[BOTTOM_TOOLBAR]),
                         toolbar_geometry_changed_in_window,
-                        slot_offset (struct frame,
-                                     toolbar_border_width[BOTTOM_TOOLBAR]),
+                        offsetof (struct frame,
+                                  toolbar_border_width[BOTTOM_TOOLBAR]),
                         frame_size_slipped);
 
   DEFVAR_SPECIFIER ("left-toolbar-border-width",
@@ -1742,11 +1729,11 @@ See `default-toolbar-height' for more information.
 */ );
   Vtoolbar_border_width[LEFT_TOOLBAR] = Fmake_specifier (Qnatnum);
   set_specifier_caching (Vtoolbar_border_width[LEFT_TOOLBAR],
-                        slot_offset (struct window,
-                                     toolbar_border_width[LEFT_TOOLBAR]),
+                        offsetof (struct window,
+                                  toolbar_border_width[LEFT_TOOLBAR]),
                         toolbar_geometry_changed_in_window,
-                        slot_offset (struct frame,
-                                     toolbar_border_width[LEFT_TOOLBAR]),
+                        offsetof (struct frame,
+                                  toolbar_border_width[LEFT_TOOLBAR]),
                         frame_size_slipped);
 
   DEFVAR_SPECIFIER ("right-toolbar-border-width",
@@ -1758,11 +1745,11 @@ See `default-toolbar-height' for more information.
 */ );
   Vtoolbar_border_width[RIGHT_TOOLBAR] = Fmake_specifier (Qnatnum);
   set_specifier_caching (Vtoolbar_border_width[RIGHT_TOOLBAR],
-                        slot_offset (struct window,
-                                     toolbar_border_width[RIGHT_TOOLBAR]),
+                        offsetof (struct window,
+                                  toolbar_border_width[RIGHT_TOOLBAR]),
                         toolbar_geometry_changed_in_window,
-                        slot_offset (struct frame,
-                                     toolbar_border_width[RIGHT_TOOLBAR]),
+                        offsetof (struct frame,
+                                  toolbar_border_width[RIGHT_TOOLBAR]),
                         frame_size_slipped);
 
   fb = Qnil;
@@ -1806,11 +1793,9 @@ visibility specifiers have a fallback value of true.
 */ );
   Vdefault_toolbar_visible_p = Fmake_specifier (Qboolean);
   set_specifier_caching (Vdefault_toolbar_visible_p,
-                        slot_offset (struct window,
-                                     default_toolbar_visible_p),
+                        offsetof (struct window, default_toolbar_visible_p),
                         default_toolbar_visible_p_changed_in_window,
-                        slot_offset (struct frame,
-                                     default_toolbar_visible_p),
+                        offsetof (struct frame, default_toolbar_visible_p),
                         default_toolbar_visible_p_changed_in_frame);
 
   DEFVAR_SPECIFIER ("top-toolbar-visible-p",
@@ -1822,11 +1807,11 @@ See `default-toolbar-visible-p' for more information.
 */ );
   Vtoolbar_visible_p[TOP_TOOLBAR] = Fmake_specifier (Qboolean);
   set_specifier_caching (Vtoolbar_visible_p[TOP_TOOLBAR],
-                        slot_offset (struct window,
-                                     toolbar_visible_p[TOP_TOOLBAR]),
+                        offsetof (struct window,
+                                  toolbar_visible_p[TOP_TOOLBAR]),
                         toolbar_geometry_changed_in_window,
-                        slot_offset (struct frame,
-                                     toolbar_visible_p[TOP_TOOLBAR]),
+                        offsetof (struct frame,
+                                  toolbar_visible_p[TOP_TOOLBAR]),
                         frame_size_slipped);
 
   DEFVAR_SPECIFIER ("bottom-toolbar-visible-p",
@@ -1838,11 +1823,11 @@ See `default-toolbar-visible-p' for more information.
 */ );
   Vtoolbar_visible_p[BOTTOM_TOOLBAR] = Fmake_specifier (Qboolean);
   set_specifier_caching (Vtoolbar_visible_p[BOTTOM_TOOLBAR],
-                        slot_offset (struct window,
-                                     toolbar_visible_p[BOTTOM_TOOLBAR]),
+                        offsetof (struct window,
+                                  toolbar_visible_p[BOTTOM_TOOLBAR]),
                         toolbar_geometry_changed_in_window,
-                        slot_offset (struct frame,
-                                     toolbar_visible_p[BOTTOM_TOOLBAR]),
+                        offsetof (struct frame,
+                                  toolbar_visible_p[BOTTOM_TOOLBAR]),
                         frame_size_slipped);
 
   DEFVAR_SPECIFIER ("left-toolbar-visible-p",
@@ -1854,11 +1839,11 @@ See `default-toolbar-visible-p' for more information.
 */ );
   Vtoolbar_visible_p[LEFT_TOOLBAR] = Fmake_specifier (Qboolean);
   set_specifier_caching (Vtoolbar_visible_p[LEFT_TOOLBAR],
-                        slot_offset (struct window,
-                                     toolbar_visible_p[LEFT_TOOLBAR]),
+                        offsetof (struct window,
+                                  toolbar_visible_p[LEFT_TOOLBAR]),
                         toolbar_geometry_changed_in_window,
-                        slot_offset (struct frame,
-                                     toolbar_visible_p[LEFT_TOOLBAR]),
+                        offsetof (struct frame,
+                                  toolbar_visible_p[LEFT_TOOLBAR]),
                         frame_size_slipped);
 
   DEFVAR_SPECIFIER ("right-toolbar-visible-p",
@@ -1870,11 +1855,11 @@ See `default-toolbar-visible-p' for more information.
 */ );
   Vtoolbar_visible_p[RIGHT_TOOLBAR] = Fmake_specifier (Qboolean);
   set_specifier_caching (Vtoolbar_visible_p[RIGHT_TOOLBAR],
-                        slot_offset (struct window,
-                                     toolbar_visible_p[RIGHT_TOOLBAR]),
+                        offsetof (struct window,
+                                  toolbar_visible_p[RIGHT_TOOLBAR]),
                         toolbar_geometry_changed_in_window,
-                        slot_offset (struct frame,
-                                     toolbar_visible_p[RIGHT_TOOLBAR]),
+                        offsetof (struct frame,
+                                  toolbar_visible_p[RIGHT_TOOLBAR]),
                         frame_size_slipped);
 
   /* initially, top inherits from default; this can be
@@ -1896,8 +1881,7 @@ This is a specifier; use `set-specifier' to change it.
 */ );
   Vtoolbar_buttons_captioned_p = Fmake_specifier (Qboolean);
   set_specifier_caching (Vtoolbar_buttons_captioned_p,
-                        slot_offset (struct window,
-                                     toolbar_buttons_captioned_p),
+                        offsetof (struct window, toolbar_buttons_captioned_p),
                         toolbar_buttons_captioned_p_changed,
                         0, 0);
   set_specifier_fallback (Vtoolbar_buttons_captioned_p,