mouse_syms = larger_vector (mouse_syms, incr, -1);
}
- start_pos_ptr = &AREF (button_down_location, button);
+ start_pos_ptr = aref_addr (button_down_location, button);
start_pos = *start_pos_ptr;
*start_pos_ptr = Qnil;
mouse_syms = larger_vector (mouse_syms, incr, -1);
}
- start_pos_ptr = &AREF (button_down_location, button);
+ start_pos_ptr = aref_addr (button_down_location, button);
start_pos = *start_pos_ptr;
position = make_lispy_position (f, event->x, event->y,
tem2 = AREF (menu_bar_items_vector, i + 2);
tem3 = AREF (menu_bar_items_vector, i + 3);
if (end > i + 4)
- memmove (&AREF (menu_bar_items_vector, i),
- &AREF (menu_bar_items_vector, i + 4),
+ memmove (aref_addr (menu_bar_items_vector, i),
+ aref_addr (menu_bar_items_vector, i + 4),
(end - i - 4) * sizeof (Lisp_Object));
ASET (menu_bar_items_vector, end - 4, tem0);
ASET (menu_bar_items_vector, end - 3, tem1);
if (EQ (key, AREF (menu_bar_items_vector, i)))
{
if (menu_bar_items_index > i + 4)
- memmove (&AREF (menu_bar_items_vector, i),
- &AREF (menu_bar_items_vector, i + 4),
+ memmove (aref_addr (menu_bar_items_vector, i),
+ aref_addr (menu_bar_items_vector, i + 4),
(menu_bar_items_index - i - 4) * sizeof (Lisp_Object));
menu_bar_items_index -= 4;
}
UNGCPRO;
}
+/* Access slot with index IDX of vector tool_bar_item_properties. */
+#define PROP(IDX) AREF (tool_bar_item_properties, (IDX))
+static inline void
+set_prop (ptrdiff_t idx, Lisp_Object val)
+{
+ ASET (tool_bar_item_properties, idx, val);
+}
+
/* Parse a tool bar item specification ITEM for key KEY and return the
result in tool_bar_item_properties. Value is zero if ITEM is
static int
parse_tool_bar_item (Lisp_Object key, Lisp_Object item)
{
- /* Access slot with index IDX of vector tool_bar_item_properties. */
-#define PROP(IDX) AREF (tool_bar_item_properties, (IDX))
-
Lisp_Object filter = Qnil;
Lisp_Object caption;
int i, have_label = 0;
if (VECTORP (tool_bar_item_properties))
{
for (i = 0; i < TOOL_BAR_ITEM_NSLOTS; ++i)
- PROP (i) = Qnil;
+ set_prop (i, Qnil);
}
else
tool_bar_item_properties
= Fmake_vector (make_number (TOOL_BAR_ITEM_NSLOTS), Qnil);
/* Set defaults. */
- PROP (TOOL_BAR_ITEM_KEY) = key;
- PROP (TOOL_BAR_ITEM_ENABLED_P) = Qt;
+ set_prop (TOOL_BAR_ITEM_KEY, key);
+ set_prop (TOOL_BAR_ITEM_ENABLED_P, Qt);
/* Get the caption of the item. If the caption is not a string,
evaluate it to get a string. If we don't get a string, skip this
if (!STRINGP (caption))
return 0;
}
- PROP (TOOL_BAR_ITEM_CAPTION) = caption;
+ set_prop (TOOL_BAR_ITEM_CAPTION, caption);
/* If the rest following the caption is not a list, the menu item is
either a separator, or invalid. */
{
if (menu_separator_name_p (SSDATA (caption)))
{
- PROP (TOOL_BAR_ITEM_TYPE) = Qt;
+ set_prop (TOOL_BAR_ITEM_TYPE, Qt);
#if !defined (USE_GTK) && !defined (HAVE_NS)
/* If we use build_desired_tool_bar_string to render the
tool bar, the separator is rendered as an image. */
}
/* Store the binding. */
- PROP (TOOL_BAR_ITEM_BINDING) = XCAR (item);
+ set_prop (TOOL_BAR_ITEM_BINDING, XCAR (item));
item = XCDR (item);
/* Ignore cached key binding, if any. */
{
/* `:enable FORM'. */
if (!NILP (Venable_disabled_menus_and_buttons))
- PROP (TOOL_BAR_ITEM_ENABLED_P) = Qt;
+ set_prop (TOOL_BAR_ITEM_ENABLED_P, Qt);
else
- PROP (TOOL_BAR_ITEM_ENABLED_P) = value;
+ set_prop (TOOL_BAR_ITEM_ENABLED_P, value);
}
else if (EQ (ikey, QCvisible))
{
}
else if (EQ (ikey, QChelp))
/* `:help HELP-STRING'. */
- PROP (TOOL_BAR_ITEM_HELP) = value;
+ set_prop (TOOL_BAR_ITEM_HELP, value);
else if (EQ (ikey, QCvert_only))
/* `:vert-only t/nil'. */
- PROP (TOOL_BAR_ITEM_VERT_ONLY) = value;
+ set_prop (TOOL_BAR_ITEM_VERT_ONLY, value);
else if (EQ (ikey, QClabel))
{
const char *bad_label = "!!?GARBLED ITEM?!!";
/* `:label LABEL-STRING'. */
- PROP (TOOL_BAR_ITEM_LABEL) = STRINGP (value)
- ? value
- : build_string (bad_label);
+ set_prop (TOOL_BAR_ITEM_LABEL,
+ STRINGP (value) ? value : build_string (bad_label));
have_label = 1;
}
else if (EQ (ikey, QCfilter))
selected = XCDR (value);
if (EQ (type, QCtoggle) || EQ (type, QCradio))
{
- PROP (TOOL_BAR_ITEM_SELECTED_P) = selected;
- PROP (TOOL_BAR_ITEM_TYPE) = type;
+ set_prop (TOOL_BAR_ITEM_SELECTED_P, selected);
+ set_prop (TOOL_BAR_ITEM_TYPE, type);
}
}
else if (EQ (ikey, QCimage)
|| (VECTORP (value) && ASIZE (value) == 4)))
/* Value is either a single image specification or a vector
of 4 such specifications for the different button states. */
- PROP (TOOL_BAR_ITEM_IMAGES) = value;
+ set_prop (TOOL_BAR_ITEM_IMAGES, value);
else if (EQ (ikey, QCrtl))
/* ':rtl STRING' */
- PROP (TOOL_BAR_ITEM_RTL_IMAGE) = value;
+ set_prop (TOOL_BAR_ITEM_RTL_IMAGE, value);
}
new_lbl = Fupcase_initials (build_string (label));
if (SCHARS (new_lbl) <= tool_bar_max_label_size)
- PROP (TOOL_BAR_ITEM_LABEL) = new_lbl;
+ set_prop (TOOL_BAR_ITEM_LABEL, new_lbl);
else
- PROP (TOOL_BAR_ITEM_LABEL) = empty_unibyte_string;
+ set_prop (TOOL_BAR_ITEM_LABEL, empty_unibyte_string);
xfree (buf);
}
/* If got a filter apply it on binding. */
if (!NILP (filter))
- PROP (TOOL_BAR_ITEM_BINDING)
- = menu_item_eval_property (list2 (filter,
- list2 (Qquote,
- PROP (TOOL_BAR_ITEM_BINDING))));
+ set_prop (TOOL_BAR_ITEM_BINDING,
+ (menu_item_eval_property
+ (list2 (filter,
+ list2 (Qquote,
+ PROP (TOOL_BAR_ITEM_BINDING))))));
/* See if the binding is a keymap. Give up if it is. */
if (CONSP (get_keymap (PROP (TOOL_BAR_ITEM_BINDING), 0, 1)))
/* Enable or disable selection of item. */
if (!EQ (PROP (TOOL_BAR_ITEM_ENABLED_P), Qt))
- PROP (TOOL_BAR_ITEM_ENABLED_P)
- = menu_item_eval_property (PROP (TOOL_BAR_ITEM_ENABLED_P));
+ set_prop (TOOL_BAR_ITEM_ENABLED_P,
+ menu_item_eval_property (PROP (TOOL_BAR_ITEM_ENABLED_P)));
/* Handle radio buttons or toggle boxes. */
if (!NILP (PROP (TOOL_BAR_ITEM_SELECTED_P)))
- PROP (TOOL_BAR_ITEM_SELECTED_P)
- = menu_item_eval_property (PROP (TOOL_BAR_ITEM_SELECTED_P));
+ set_prop (TOOL_BAR_ITEM_SELECTED_P,
+ menu_item_eval_property (PROP (TOOL_BAR_ITEM_SELECTED_P)));
return 1;