aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorYAMAMOTO Mitsuharu2006-11-14 08:22:04 +0000
committerYAMAMOTO Mitsuharu2006-11-14 08:22:04 +0000
commit74e537fb6901a1514514bcdc20582ad0ffb538a2 (patch)
treedda6bd260168621e3c936a223700ad9132b8a588 /src
parent3e2d41ea6666e1eefde27c0b1edd75c13ba377d1 (diff)
downloademacs-74e537fb6901a1514514bcdc20582ad0ffb538a2.tar.gz
emacs-74e537fb6901a1514514bcdc20582ad0ffb538a2.zip
(menu_quit_handler, install_menu_quit_handler):
Replace `#ifdef HAVE_CANCELMENUTRACKING' with `#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030'. (install_menu_quit_handler) [MAC_OS_X_VERSION_MAX_ALLOWED >= 1030 && MAC_OS_X_VERSION_MIN_REQUIRED == 1020]: Check if CancelMenuTracking is available.
Diffstat (limited to 'src')
-rw-r--r--src/macmenu.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/macmenu.c b/src/macmenu.c
index d8303dbdc25..14bfe92cb25 100644
--- a/src/macmenu.c
+++ b/src/macmenu.c
@@ -319,7 +319,7 @@ restore_menu_items (saved)
319 menu_items_used = XINT (XCAR (saved)); 319 menu_items_used = XINT (XCAR (saved));
320 saved = XCDR (saved); 320 saved = XCDR (saved);
321 menu_items_n_panes = XINT (XCAR (saved)); 321 menu_items_n_panes = XINT (XCAR (saved));
322 saved = XCDR (saved); 322 saved = XCDR (saved);
323 menu_items_submenu_depth = XINT (XCAR (saved)); 323 menu_items_submenu_depth = XINT (XCAR (saved));
324 return Qnil; 324 return Qnil;
325} 325}
@@ -1453,7 +1453,7 @@ update_submenu_strings (first_wv)
1453/* Event handler function that pops down a menu on C-g. We can only pop 1453/* Event handler function that pops down a menu on C-g. We can only pop
1454 down menus if CancelMenuTracking is present (OSX 10.3 or later). */ 1454 down menus if CancelMenuTracking is present (OSX 10.3 or later). */
1455 1455
1456#ifdef HAVE_CANCELMENUTRACKING 1456#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
1457static pascal OSStatus 1457static pascal OSStatus
1458menu_quit_handler (nextHandler, theEvent, userData) 1458menu_quit_handler (nextHandler, theEvent, userData)
1459 EventHandlerCallRef nextHandler; 1459 EventHandlerCallRef nextHandler;
@@ -1487,7 +1487,7 @@ menu_quit_handler (nextHandler, theEvent, userData)
1487 1487
1488 return CallNextEventHandler (nextHandler, theEvent); 1488 return CallNextEventHandler (nextHandler, theEvent);
1489} 1489}
1490#endif /* HAVE_CANCELMENUTRACKING */ 1490#endif /* MAC_OS_X_VERSION_MAX_ALLOWED >= 1030 */
1491 1491
1492/* Add event handler to all menus that belong to KIND so we can detect C-g. 1492/* Add event handler to all menus that belong to KIND so we can detect C-g.
1493 MENU_HANDLE is the root menu of the tracking session to dismiss 1493 MENU_HANDLE is the root menu of the tracking session to dismiss
@@ -1499,11 +1499,15 @@ install_menu_quit_handler (kind, menu_handle)
1499 enum mac_menu_kind kind; 1499 enum mac_menu_kind kind;
1500 MenuHandle menu_handle; 1500 MenuHandle menu_handle;
1501{ 1501{
1502#ifdef HAVE_CANCELMENUTRACKING 1502#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
1503 static const EventTypeSpec typesList[] = 1503 static const EventTypeSpec typesList[] =
1504 {{kEventClassKeyboard, kEventRawKeyDown}}; 1504 {{kEventClassKeyboard, kEventRawKeyDown}};
1505 int id; 1505 int id;
1506 1506
1507#if MAC_OS_X_VERSION_MIN_REQUIRED == 1020
1508 if (CancelMenuTracking == NULL)
1509 return;
1510#endif
1507 for (id = min_menu_id[kind]; id < min_menu_id[kind + 1]; id++) 1511 for (id = min_menu_id[kind]; id < min_menu_id[kind + 1]; id++)
1508 { 1512 {
1509 MenuHandle menu = GetMenuHandle (id); 1513 MenuHandle menu = GetMenuHandle (id);
@@ -1512,9 +1516,9 @@ install_menu_quit_handler (kind, menu_handle)
1512 break; 1516 break;
1513 InstallMenuEventHandler (menu, menu_quit_handler, 1517 InstallMenuEventHandler (menu, menu_quit_handler,
1514 GetEventTypeCount (typesList), 1518 GetEventTypeCount (typesList),
1515 typesList, menu_handle, NULL); 1519 typesList, menu_handle, NULL);
1516 } 1520 }
1517#endif /* HAVE_CANCELMENUTRACKING */ 1521#endif /* MAC_OS_X_VERSION_MAX_ALLOWED >= 1030 */
1518} 1522}
1519 1523
1520/* Set the contents of the menubar widgets of frame F. 1524/* Set the contents of the menubar widgets of frame F.