/* Platform-independent code for terminal communications.
-Copyright (C) 1986, 1988, 1993-1994, 1996, 1999-2012
- Free Software Foundation, Inc.
+Copyright (C) 1986, 1988, 1993-1994, 1996, 1999-2013 Free Software
+Foundation, Inc.
This file is part of GNU Emacs.
{
}
-Lisp_Object
-unuse_menu_items (Lisp_Object dummy)
+void
+unuse_menu_items (void)
{
- return menu_items_inuse = Qnil;
+ menu_items_inuse = Qnil;
}
/* Call when finished using the data for the current menu
eassert (NILP (menu_items_inuse));
}
-#ifdef HAVE_NS
-static Lisp_Object
-cleanup_popup_menu (Lisp_Object arg)
-{
- discard_menu_items ();
- return Qnil;
-}
-#endif
-
/* This undoes save_menu_items, and it is called by the specpdl unwind
mechanism. */
-static Lisp_Object
+static void
restore_menu_items (Lisp_Object saved)
{
menu_items = XCAR (saved);
menu_items_n_panes = XINT (XCAR (saved));
saved = XCDR (saved);
menu_items_submenu_depth = XINT (XCAR (saved));
- return Qnil;
}
/* Push the whole state of menu_items processing onto the specpdl.
ensure_menu_items (int items)
{
int incr = items - (menu_items_allocated - menu_items_used);
- if (0 < incr)
+ if (incr > 0)
{
menu_items = larger_vector (menu_items, incr, INT_MAX);
menu_items_allocated = ASIZE (menu_items);
VECTOR is an array of menu events for the whole menu. */
void
-find_and_call_menu_selection (FRAME_PTR f, int menu_bar_items_used, Lisp_Object vector, void *client_data)
+find_and_call_menu_selection (struct frame *f, int menu_bar_items_used,
+ Lisp_Object vector, void *client_data)
{
Lisp_Object prefix, entry;
Lisp_Object *subprefix_stack;
/* As above, but return the menu selection instead of storing in kb buffer.
If KEYMAPS, return full prefixes to selection. */
Lisp_Object
-find_and_return_menu_selection (FRAME_PTR f, bool keymaps, void *client_data)
+find_and_return_menu_selection (struct frame *f, bool keymaps, void *client_data)
{
Lisp_Object prefix, entry;
int i;
{
int j;
- entry = Fcons (entry, Qnil);
+ entry = list1 (entry);
if (!NILP (prefix))
entry = Fcons (prefix, entry);
for (j = submenu_depth - 1; j >= 0; j--)
Lisp_Object title;
const char *error_name = NULL;
Lisp_Object selection = Qnil;
- FRAME_PTR f = NULL;
+ struct frame *f = NULL;
Lisp_Object x, y, window;
bool keymaps = 0;
bool for_click = 0;
#ifdef HAVE_MENUS
{
bool get_current_pos_p = 0;
- /* FIXME!! check_w32 (); or check_x (); or check_ns (); */
+
+ check_window_system (SELECTED_FRAME ());
/* Decode the first argument: find the window and the coordinates. */
if (EQ (position, Qt)
if (get_current_pos_p)
{
/* Use the mouse's current position. */
- FRAME_PTR new_f = SELECTED_FRAME ();
+ struct frame *new_f = SELECTED_FRAME ();
#ifdef HAVE_X_WINDOWS
/* Can't use mouse_position_hook for X since it returns
coordinates relative to the window the mouse is in,
#endif /* HAVE_MENUS */
/* Now parse the lisp menus. */
- record_unwind_protect (unuse_menu_items, Qnil);
+ record_unwind_protect_void (unuse_menu_items);
title = Qnil;
GCPRO1 (title);
if (current_popup_menu)
{
discard_menu_items ();
- FRAME_X_DISPLAY_INFO (f)->grabbed = 0;
+ FRAME_DISPLAY_INFO (f)->grabbed = 0;
UNGCPRO;
return Qnil;
}
#endif
#ifdef HAVE_NS /* FIXME: ns-specific, why? --Stef */
- record_unwind_protect (cleanup_popup_menu, Qnil);
+ record_unwind_protect_void (discard_menu_items);
#endif
/* Display them in a menu. */
#endif
#ifdef HAVE_NTGUI /* FIXME: Is it really w32-specific? --Stef */
- FRAME_X_DISPLAY_INFO (f)->grabbed = 0;
+ FRAME_DISPLAY_INFO (f)->grabbed = 0;
#endif
#endif /* HAVE_MENUS */