X-Git-Url: http://git.hcoop.net/bpt/emacs.git/blobdiff_plain/ba13e6168a07a085c0ca8e67c91640b84ee0c1fd..cb5b02667a8dcfc00d990103b2fb3236259bd627:/src/nsmenu.m diff --git a/src/nsmenu.m b/src/nsmenu.m index 3057f4f6a2..b60cc005c5 100644 --- a/src/nsmenu.m +++ b/src/nsmenu.m @@ -115,13 +115,13 @@ popup_activated (void) /* -------------------------------------------------------------------------- Update menubar. Three cases: - 1) deep_p = 0, submenu = nil: Fresh switch onto a frame -- either set up + 1) ! deep_p, submenu = nil: Fresh switch onto a frame -- either set up just top-level menu strings (OS X), or goto case (2) (GNUstep). - 2) deep_p = 1, submenu = nil: Recompute all submenus. - 3) deep_p = 1, submenu = non-nil: Update contents of a single submenu. + 2) deep_p, submenu = nil: Recompute all submenus. + 3) deep_p, submenu = non-nil: Update contents of a single submenu. -------------------------------------------------------------------------- */ void -ns_update_menubar (struct frame *f, int deep_p, EmacsMenu *submenu) +ns_update_menubar (struct frame *f, bool deep_p, EmacsMenu *submenu) { NSAutoreleasePool *pool; id menu = [NSApp mainMenu]; @@ -146,7 +146,7 @@ ns_update_menubar (struct frame *f, int deep_p, EmacsMenu *submenu) XSETFRAME (Vmenu_updating_frame, f); /*fprintf (stderr, "ns_update_menubar: frame: %p\tdeep: %d\tsub: %p\n", f, deep_p, submenu); */ - BLOCK_INPUT; + block_input (); pool = [[NSAutoreleasePool alloc] init]; /* Menu may have been created automatically; if so, discard it. */ @@ -271,7 +271,7 @@ ns_update_menubar (struct frame *f, int deep_p, EmacsMenu *submenu) discard_menu_items (); unbind_to (specpdl_count, Qnil); [pool release]; - UNBLOCK_INPUT; + unblock_input (); return; } @@ -333,7 +333,7 @@ ns_update_menubar (struct frame *f, int deep_p, EmacsMenu *submenu) discard_menu_items (); unbind_to (specpdl_count, Qnil); [pool release]; - UNBLOCK_INPUT; + unblock_input (); return; } } @@ -404,7 +404,7 @@ ns_update_menubar (struct frame *f, int deep_p, EmacsMenu *submenu) { free_menubar_widget_value_tree (first_wv); [pool release]; - UNBLOCK_INPUT; + unblock_input (); return; } @@ -435,7 +435,7 @@ ns_update_menubar (struct frame *f, int deep_p, EmacsMenu *submenu) { free_menubar_widget_value_tree (first_wv); [pool release]; - UNBLOCK_INPUT; + unblock_input (); return; } } @@ -498,7 +498,7 @@ ns_update_menubar (struct frame *f, int deep_p, EmacsMenu *submenu) [NSApp setMainMenu: menu]; [pool release]; - UNBLOCK_INPUT; + unblock_input (); } @@ -507,7 +507,7 @@ ns_update_menubar (struct frame *f, int deep_p, EmacsMenu *submenu) frame's menus have changed, and the *step representation should be updated from Lisp. */ void -set_frame_menubar (struct frame *f, int first_time, int deep_p) +set_frame_menubar (struct frame *f, bool first_time, bool deep_p) { ns_update_menubar (f, deep_p, nil); } @@ -588,10 +588,7 @@ extern NSString *NSMenuDidBeginTrackingNotification; From 10.6 on, we could also use -[NSMenu propertiesToUpdate]: In the key press case, NSMenuPropertyItemImage (e.g.) won't be set. */ - if (trackingMenu == 0 - /* Also, don't try this if from an event picked up asynchronously, - as lots of lisp evaluation happens in ns_update_menubar. */ - || handling_signal != 0) + if (trackingMenu == 0) return; /*fprintf (stderr, "Updating menu '%s'\n", [[self title] UTF8String]); NSLog (@"%@\n", event); */ ns_update_menubar (frame, 1, self); @@ -1015,10 +1012,10 @@ free_frame_tool_bar (FRAME_PTR f) Under NS we just hide the toolbar until it might be needed again. -------------------------------------------------------------------------- */ { - BLOCK_INPUT; + block_input (); [[FRAME_NS_VIEW (f) toolbar] setVisible: NO]; FRAME_TOOLBAR_HEIGHT (f) = 0; - UNBLOCK_INPUT; + unblock_input (); } void @@ -1032,7 +1029,7 @@ update_frame_tool_bar (FRAME_PTR f) NSWindow *window = [view window]; EmacsToolbar *toolbar = [view toolbar]; - BLOCK_INPUT; + block_input (); [toolbar clearActive]; /* update EmacsToolbar as in GtkUtils, build items list */ @@ -1118,7 +1115,7 @@ update_frame_tool_bar (FRAME_PTR f) FRAME_TOOLBAR_HEIGHT (f) = NSHeight ([window frameRectForContentRect: NSMakeRect (0, 0, 0, 0)]) - FRAME_NS_TITLEBAR_HEIGHT (f); - UNBLOCK_INPUT; + unblock_input (); } @@ -1358,7 +1355,7 @@ pop_down_menu (Lisp_Object arg) struct Lisp_Save_Value *p = XSAVE_VALUE (arg); struct Popdown_data *unwind_data = (struct Popdown_data *) p->pointer; - BLOCK_INPUT; + block_input (); if (popup_activated_flag) { EmacsDialogPanel *panel = unwind_data->dialog; @@ -1369,7 +1366,7 @@ pop_down_menu (Lisp_Object arg) } xfree (unwind_data); - UNBLOCK_INPUT; + unblock_input (); return Qnil; } @@ -1437,7 +1434,7 @@ ns_popup_dialog (Lisp_Object position, Lisp_Object contents, Lisp_Object header) the dialog. */ contents = Fcons (title, Fcons (Fcons (build_string ("Ok"), Qt), Qnil)); - BLOCK_INPUT; + block_input (); pool = [[NSAutoreleasePool alloc] init]; dialog = [[EmacsDialogPanel alloc] initFromContents: contents isQuestion: isQ]; @@ -1455,7 +1452,7 @@ ns_popup_dialog (Lisp_Object position, Lisp_Object contents, Lisp_Object header) unbind_to (specpdl_count, Qnil); /* calls pop_down_menu */ } - UNBLOCK_INPUT; + unblock_input (); return tem; } @@ -1769,7 +1766,7 @@ ns_popup_dialog (Lisp_Object position, Lisp_Object contents, Lisp_Object header) } - + - (void)timeout_handler: (NSTimer *)timedEntry { NSEvent *nxev = [NSEvent otherEventWithType: NSApplicationDefined