Lisp_Object Qdebug_on_next_call;
-void set_frame_menubar (FRAME_PTR, bool, bool);
+void set_frame_menubar (struct frame *, bool, bool);
#ifdef HAVE_DIALOGS
-static Lisp_Object w32_dialog_show (FRAME_PTR, int, Lisp_Object, char**);
+static Lisp_Object w32_dialog_show (struct frame *, int, Lisp_Object, char**);
#else
static int is_simple_dialog (Lisp_Object);
-static Lisp_Object simple_dialog_show (FRAME_PTR, Lisp_Object, Lisp_Object);
+static Lisp_Object simple_dialog_show (struct frame *, Lisp_Object, Lisp_Object);
#endif
static void utf8to16 (unsigned char *, int, WCHAR *);
otherwise it is "Question". */)
(Lisp_Object position, Lisp_Object contents, Lisp_Object header)
{
- FRAME_PTR f = NULL;
+ struct frame *f = NULL;
Lisp_Object window;
/* Decode the first argument: find the window or frame to use. */
{
#if 0 /* Using the frame the mouse is on may not be right. */
/* Use the mouse's current position. */
- FRAME_PTR new_f = SELECTED_FRAME ();
+ struct frame *new_f = SELECTED_FRAME ();
Lisp_Object bar_window;
enum scroll_bar_part part;
Time time;
in the middle of frame F. */
Lisp_Object x, y, frame, newpos;
XSETFRAME (frame, f);
- XSETINT (x, x_pixel_width (f) / 2);
- XSETINT (y, x_pixel_height (f) / 2);
+ XSETINT (x, FRAME_PIXEL_WIDTH (f) / 2);
+ XSETINT (y, FRAME_PIXEL_HEIGHT (f) / 2);
newpos = Fcons (Fcons (x, Fcons (y, Qnil)), Fcons (frame, Qnil));
return Fx_popup_menu (newpos,
Fcons (Fcar (contents), Fcons (contents, Qnil)));
unblock_input ();
discard_menu_items ();
- FRAME_X_DISPLAY_INFO (f)->grabbed = 0;
+ FRAME_DISPLAY_INFO (f)->grabbed = 0;
if (error_name) error (error_name);
return selection;
This way we can safely execute Lisp code. */
void
-x_activate_menubar (FRAME_PTR f)
+x_activate_menubar (struct frame *f)
{
set_frame_menubar (f, 0, 1);
and put the appropriate events into the keyboard buffer. */
void
-menubar_selection_callback (FRAME_PTR f, void * client_data)
+menubar_selection_callback (struct frame *f, void * client_data)
{
Lisp_Object prefix, entry;
Lisp_Object vector;
it is set the first time this is called, from initialize_frame_menubar. */
void
-set_frame_menubar (FRAME_PTR f, bool first_time, bool deep_p)
+set_frame_menubar (struct frame *f, bool first_time, bool deep_p)
{
HMENU menubar_widget = f->output_data.w32->menubar_widget;
Lisp_Object items;
/* Save the frame's previous menu bar contents data. */
if (previous_menu_items_used)
- memcpy (previous_items, XVECTOR (f->menu_bar_vector)->contents,
+ memcpy (previous_items, XVECTOR (f->menu_bar_vector)->u.contents,
previous_menu_items_used * word_size);
/* Fill in menu_items with the current menu bar contents.
is visible. */
void
-initialize_frame_menubar (FRAME_PTR f)
+initialize_frame_menubar (struct frame *f)
{
/* This function is called before the first chance to redisplay
the frame. It has to be, so the frame will have the right size. */
This is used when deleting a frame, and when turning off the menu bar. */
void
-free_frame_menubar (FRAME_PTR f)
+free_frame_menubar (struct frame *f)
{
block_input ();
(We return nil on failure, but the value doesn't actually matter.) */
Lisp_Object
-w32_menu_show (FRAME_PTR f, int x, int y, int for_click, int keymaps,
+w32_menu_show (struct frame *f, int x, int y, int for_click, int keymaps,
Lisp_Object title, const char **error)
{
int i;
return Qnil;
}
+ block_input ();
+
/* Create a tree of widget_value objects
representing the panes and their items. */
wv = xmalloc_widget_value ();
/* Clean up extraneous mouse events which might have been generated
during the call. */
discard_mouse_events ();
- FRAME_X_DISPLAY_INFO (f)->grabbed = 0;
+ FRAME_DISPLAY_INFO (f)->grabbed = 0;
/* Free the widget_value objects we used to specify the contents. */
free_menubar_widget_value_tree (first_wv);
if (!NILP (subprefix_stack[j]))
entry = Fcons (subprefix_stack[j], entry);
}
+ unblock_input ();
return entry;
}
i += MENU_ITEMS_ITEM_LENGTH;
}
}
else if (!for_click)
- /* Make "Cancel" equivalent to C-g. */
- Fsignal (Qquit, Qnil);
+ {
+ unblock_input ();
+ /* Make "Cancel" equivalent to C-g. */
+ Fsignal (Qquit, Qnil);
+ }
+ unblock_input ();
return Qnil;
}
\f
"button6", "button7", "button8", "button9", "button10" };
static Lisp_Object
-w32_dialog_show (FRAME_PTR f, int keymaps,
+w32_dialog_show (struct frame *f, int keymaps,
Lisp_Object title, Lisp_Object header,
char **error)
{
lw_pop_up_all_widgets (dialog_id);
/* Process events that apply to the menu. */
- popup_get_selection ((XEvent *) 0, FRAME_X_DISPLAY_INFO (f), dialog_id);
+ popup_get_selection ((XEvent *) 0, FRAME_DISPLAY_INFO (f), dialog_id);
lw_destroy_all_widgets (dialog_id);
}
static Lisp_Object
-simple_dialog_show (FRAME_PTR f, Lisp_Object contents, Lisp_Object header)
+simple_dialog_show (struct frame *f, Lisp_Object contents, Lisp_Object header)
{
int answer;
UINT type;
(void)
{
#ifdef HAVE_MENUS
- FRAME_PTR f;
+ struct frame *f;
f = SELECTED_FRAME ();
return (f->output_data.w32->menubar_active > 0) ? Qt : Qnil;
#else