\f
#ifdef USE_X_TOOLKIT
-static int next_menubar_widget_id;
+static LWLIB_ID next_menubar_widget_id;
/* Return the frame whose ->output_data.x->id equals ID, or 0 if none. */
/* We need a unique id for each widget handled by the Lucid Widget
library.
- For the main windows, and popup menus, we use this counter,
- which we increment each time after use. This starts from 1<<16.
+ For the main windows, and popup menus, we use this counter, which we
+ increment each time after use. This starts from WIDGET_ID_TICK_START.
For menu bars, we use numbers starting at 0, counted in
next_menubar_widget_id. */
menu_item_selection = client_data;
}
-/* ARG is the LWLIB ID of the dialog box, represented
- as a Lisp object as (HIGHPART . LOWPART). */
+/* ID is the LWLIB ID of the dialog box. */
static void
-pop_down_menu (Lisp_Object arg)
+pop_down_menu (int id)
{
- LWLIB_ID id = (XINT (XCAR (arg)) << 4 * sizeof (LWLIB_ID)
- | XINT (XCDR (arg)));
-
block_input ();
- lw_destroy_all_widgets (id);
+ lw_destroy_all_widgets ((LWLIB_ID) id);
unblock_input ();
popup_activated_flag = 0;
}
x_activate_timeout_atimer ();
{
- int fact = 4 * sizeof (LWLIB_ID);
ptrdiff_t specpdl_count = SPECPDL_INDEX ();
- record_unwind_protect (pop_down_menu,
- Fcons (make_number (menu_id >> (fact)),
- make_number (menu_id & ~(-1 << (fact)))));
+
+ record_unwind_protect_int (pop_down_menu, (int) menu_id);
/* Process events that apply to the menu. */
popup_get_selection (0, FRAME_DISPLAY_INFO (f), menu_id, 1);
Also handle timers. */
{
ptrdiff_t count = SPECPDL_INDEX ();
- int fact = 4 * sizeof (LWLIB_ID);
/* xdialog_show_unwind is responsible for popping the dialog box down. */
- record_unwind_protect (pop_down_menu,
- Fcons (make_number (dialog_id >> (fact)),
- make_number (dialog_id & ~(-1 << (fact)))));
+
+ record_unwind_protect_int (pop_down_menu, (int) dialog_id);
popup_get_selection (0, FRAME_DISPLAY_INFO (f), dialog_id, 1);
void
syms_of_xmenu (void)
{
- DEFSYM (Qdebug_on_next_call, "debug-on-next-call");
-
#ifdef USE_X_TOOLKIT
- widget_id_tick = (1<<16);
+ enum { WIDGET_ID_TICK_START = 1 << 16 };
+ widget_id_tick = WIDGET_ID_TICK_START;
next_menubar_widget_id = 1;
#endif
+ DEFSYM (Qdebug_on_next_call, "debug-on-next-call");
defsubr (&Smenu_or_popup_active_p);
#if defined (USE_GTK) || defined (USE_X_TOOLKIT)