aboutsummaryrefslogtreecommitdiffstats
path: root/src/macmenu.c
diff options
context:
space:
mode:
authorYAMAMOTO Mitsuharu2007-06-06 08:33:01 +0000
committerYAMAMOTO Mitsuharu2007-06-06 08:33:01 +0000
commit477f75a567d9b316bee3bae0edb4e8df8a630223 (patch)
tree7f5e6eb781754a58f01370a8352473da5c637ec1 /src/macmenu.c
parent1c2c66d5d4af7d349a6e1aa517d47521b3508566 (diff)
downloademacs-477f75a567d9b316bee3bae0edb4e8df8a630223.tar.gz
emacs-477f75a567d9b316bee3bae0edb4e8df8a630223.zip
Replace MenuHandle and GetMenuHandle with MenuRef and
GetMenuRef, respectively. Replace WindowPtr with WindowRef. Replace ControlHandle with ControlRef. (install_menu_quit_handler): Rename arg MENU_HANDLE to ROOT_MENU.
Diffstat (limited to 'src/macmenu.c')
-rw-r--r--src/macmenu.c50
1 files changed, 25 insertions, 25 deletions
diff --git a/src/macmenu.c b/src/macmenu.c
index a5196a156eb..098457a3f36 100644
--- a/src/macmenu.c
+++ b/src/macmenu.c
@@ -200,7 +200,7 @@ static void list_of_items P_ ((Lisp_Object));
200 200
201static void find_and_call_menu_selection P_ ((FRAME_PTR, int, Lisp_Object, 201static void find_and_call_menu_selection P_ ((FRAME_PTR, int, Lisp_Object,
202 void *)); 202 void *));
203static int fill_menu P_ ((MenuHandle, widget_value *, enum mac_menu_kind, int)); 203static int fill_menu P_ ((MenuRef, widget_value *, enum mac_menu_kind, int));
204static void fill_menubar P_ ((widget_value *, int)); 204static void fill_menubar P_ ((widget_value *, int));
205static void dispose_menus P_ ((enum mac_menu_kind, int)); 205static void dispose_menus P_ ((enum mac_menu_kind, int));
206 206
@@ -1162,7 +1162,7 @@ x_activate_menubar (f)
1162#endif 1162#endif
1163 if (menu_id) 1163 if (menu_id)
1164 { 1164 {
1165 MenuHandle menu = GetMenuHandle (menu_id); 1165 MenuRef menu = GetMenuRef (menu_id);
1166 1166
1167 if (menu) 1167 if (menu)
1168 { 1168 {
@@ -1632,7 +1632,7 @@ menu_target_item_handler (next_handler, event, data)
1632 1632
1633OSStatus 1633OSStatus
1634install_menu_target_item_handler (window) 1634install_menu_target_item_handler (window)
1635 WindowPtr window; 1635 WindowRef window;
1636{ 1636{
1637 OSStatus err = noErr; 1637 OSStatus err = noErr;
1638#if TARGET_API_MAC_CARBON 1638#if TARGET_API_MAC_CARBON
@@ -1687,15 +1687,15 @@ menu_quit_handler (nextHandler, theEvent, userData)
1687} 1687}
1688#endif /* MAC_OS_X_VERSION_MAX_ALLOWED >= 1030 */ 1688#endif /* MAC_OS_X_VERSION_MAX_ALLOWED >= 1030 */
1689 1689
1690/* Add event handler to all menus that belong to KIND so we can detect C-g. 1690/* Add event handler to all menus that belong to KIND so we can detect
1691 MENU_HANDLE is the root menu of the tracking session to dismiss 1691 C-g. ROOT_MENU is the root menu of the tracking session to dismiss
1692 when C-g is detected. NULL means the menu bar. 1692 when C-g is detected. NULL means the menu bar. If
1693 If CancelMenuTracking isn't available, do nothing. */ 1693 CancelMenuTracking isn't available, do nothing. */
1694 1694
1695static void 1695static void
1696install_menu_quit_handler (kind, menu_handle) 1696install_menu_quit_handler (kind, root_menu)
1697 enum mac_menu_kind kind; 1697 enum mac_menu_kind kind;
1698 MenuHandle menu_handle; 1698 MenuRef root_menu;
1699{ 1699{
1700#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030 1700#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
1701 static const EventTypeSpec typesList[] = 1701 static const EventTypeSpec typesList[] =
@@ -1708,13 +1708,13 @@ install_menu_quit_handler (kind, menu_handle)
1708#endif 1708#endif
1709 for (id = min_menu_id[kind]; id < min_menu_id[kind + 1]; id++) 1709 for (id = min_menu_id[kind]; id < min_menu_id[kind + 1]; id++)
1710 { 1710 {
1711 MenuHandle menu = GetMenuHandle (id); 1711 MenuRef menu = GetMenuRef (id);
1712 1712
1713 if (menu == NULL) 1713 if (menu == NULL)
1714 break; 1714 break;
1715 InstallMenuEventHandler (menu, menu_quit_handler, 1715 InstallMenuEventHandler (menu, menu_quit_handler,
1716 GetEventTypeCount (typesList), 1716 GetEventTypeCount (typesList),
1717 typesList, menu_handle, NULL); 1717 typesList, root_menu, NULL);
1718 } 1718 }
1719#endif /* MAC_OS_X_VERSION_MAX_ALLOWED >= 1030 */ 1719#endif /* MAC_OS_X_VERSION_MAX_ALLOWED >= 1030 */
1720} 1720}
@@ -1978,7 +1978,7 @@ pop_down_menu (arg)
1978{ 1978{
1979 struct Lisp_Save_Value *p = XSAVE_VALUE (arg); 1979 struct Lisp_Save_Value *p = XSAVE_VALUE (arg);
1980 FRAME_PTR f = p->pointer; 1980 FRAME_PTR f = p->pointer;
1981 MenuHandle menu = GetMenuHandle (min_menu_id[MAC_MENU_POPUP]); 1981 MenuRef menu = GetMenuRef (min_menu_id[MAC_MENU_POPUP]);
1982 1982
1983 BLOCK_INPUT; 1983 BLOCK_INPUT;
1984 1984
@@ -2024,7 +2024,7 @@ mac_menu_show (f, x, y, for_click, keymaps, title, error)
2024 int i; 2024 int i;
2025 int menu_item_choice; 2025 int menu_item_choice;
2026 UInt32 menu_item_selection; 2026 UInt32 menu_item_selection;
2027 MenuHandle menu; 2027 MenuRef menu;
2028 Point pos; 2028 Point pos;
2029 widget_value *wv, *save_wv = 0, *first_wv = 0, *prev_wv = 0; 2029 widget_value *wv, *save_wv = 0, *first_wv = 0, *prev_wv = 0;
2030 widget_value **submenu_stack 2030 widget_value **submenu_stack
@@ -2254,7 +2254,7 @@ mac_menu_show (f, x, y, for_click, keymaps, title, error)
2254 /* Get the refcon to find the correct item */ 2254 /* Get the refcon to find the correct item */
2255 if (menu_item_choice) 2255 if (menu_item_choice)
2256 { 2256 {
2257 MenuHandle sel_menu = GetMenuHandle (HiWord (menu_item_choice)); 2257 MenuRef sel_menu = GetMenuRef (HiWord (menu_item_choice));
2258 2258
2259 if (sel_menu) 2259 if (sel_menu)
2260 GetMenuItemRefCon (sel_menu, LoWord (menu_item_choice), 2260 GetMenuItemRefCon (sel_menu, LoWord (menu_item_choice),
@@ -2724,8 +2724,8 @@ mac_dialog (widget_value *wv)
2724 int i; 2724 int i;
2725 int dialog_width; 2725 int dialog_width;
2726 Rect rect; 2726 Rect rect;
2727 WindowPtr window_ptr; 2727 WindowRef window_ptr;
2728 ControlHandle ch; 2728 ControlRef ch;
2729 int left; 2729 int left;
2730 EventRecord event_record; 2730 EventRecord event_record;
2731 SInt16 part_code; 2731 SInt16 part_code;
@@ -2754,7 +2754,7 @@ mac_dialog (widget_value *wv)
2754 wv = wv->next; 2754 wv = wv->next;
2755 } 2755 }
2756 2756
2757 window_ptr = GetNewCWindow (DIALOG_WINDOW_RESOURCE, NULL, (WindowPtr) -1); 2757 window_ptr = GetNewCWindow (DIALOG_WINDOW_RESOURCE, NULL, (WindowRef) -1);
2758 2758
2759 SetPortWindowPort (window_ptr); 2759 SetPortWindowPort (window_ptr);
2760 2760
@@ -3031,7 +3031,7 @@ name_is_separator (name)
3031 3031
3032static void 3032static void
3033add_menu_item (menu, pos, wv) 3033add_menu_item (menu, pos, wv)
3034 MenuHandle menu; 3034 MenuRef menu;
3035 int pos; 3035 int pos;
3036 widget_value *wv; 3036 widget_value *wv;
3037{ 3037{
@@ -3108,7 +3108,7 @@ add_menu_item (menu, pos, wv)
3108 3108
3109static int 3109static int
3110fill_menu (menu, wv, kind, submenu_id) 3110fill_menu (menu, wv, kind, submenu_id)
3111 MenuHandle menu; 3111 MenuRef menu;
3112 widget_value *wv; 3112 widget_value *wv;
3113 enum mac_menu_kind kind; 3113 enum mac_menu_kind kind;
3114 int submenu_id; 3114 int submenu_id;
@@ -3120,7 +3120,7 @@ fill_menu (menu, wv, kind, submenu_id)
3120 add_menu_item (menu, pos, wv); 3120 add_menu_item (menu, pos, wv);
3121 if (wv->contents && submenu_id < min_menu_id[kind + 1]) 3121 if (wv->contents && submenu_id < min_menu_id[kind + 1])
3122 { 3122 {
3123 MenuHandle submenu = NewMenu (submenu_id, "\pX"); 3123 MenuRef submenu = NewMenu (submenu_id, "\pX");
3124 3124
3125 InsertMenu (submenu, -1); 3125 InsertMenu (submenu, -1);
3126 SetMenuItemHierarchicalID (menu, pos, submenu_id); 3126 SetMenuItemHierarchicalID (menu, pos, submenu_id);
@@ -3139,7 +3139,7 @@ fill_menubar (wv, deep_p)
3139 int deep_p; 3139 int deep_p;
3140{ 3140{
3141 int id, submenu_id; 3141 int id, submenu_id;
3142 MenuHandle menu; 3142 MenuRef menu;
3143 Str255 title; 3143 Str255 title;
3144#if !TARGET_API_MAC_CARBON 3144#if !TARGET_API_MAC_CARBON
3145 int title_changed_p = 0; 3145 int title_changed_p = 0;
@@ -3166,7 +3166,7 @@ fill_menubar (wv, deep_p)
3166 title[255] = '\0'; 3166 title[255] = '\0';
3167 c2pstr (title); 3167 c2pstr (title);
3168 3168
3169 menu = GetMenuHandle (id); 3169 menu = GetMenuRef (id);
3170 if (menu) 3170 if (menu)
3171 { 3171 {
3172#if TARGET_API_MAC_CARBON 3172#if TARGET_API_MAC_CARBON
@@ -3181,7 +3181,7 @@ fill_menubar (wv, deep_p)
3181 DeleteMenu (id); 3181 DeleteMenu (id);
3182 DisposeMenu (menu); 3182 DisposeMenu (menu);
3183 menu = NewMenu (id, title); 3183 menu = NewMenu (id, title);
3184 InsertMenu (menu, GetMenuHandle (id + 1) ? id + 1 : 0); 3184 InsertMenu (menu, GetMenuRef (id + 1) ? id + 1 : 0);
3185 title_changed_p = 1; 3185 title_changed_p = 1;
3186 } 3186 }
3187#endif /* !TARGET_API_MAC_CARBON */ 3187#endif /* !TARGET_API_MAC_CARBON */
@@ -3200,7 +3200,7 @@ fill_menubar (wv, deep_p)
3200 submenu_id); 3200 submenu_id);
3201 } 3201 }
3202 3202
3203 if (id < min_menu_id[MAC_MENU_MENU_BAR + 1] && GetMenuHandle (id)) 3203 if (id < min_menu_id[MAC_MENU_MENU_BAR + 1] && GetMenuRef (id))
3204 { 3204 {
3205 dispose_menus (MAC_MENU_MENU_BAR, id); 3205 dispose_menus (MAC_MENU_MENU_BAR, id);
3206#if !TARGET_API_MAC_CARBON 3206#if !TARGET_API_MAC_CARBON
@@ -3224,7 +3224,7 @@ dispose_menus (kind, id)
3224{ 3224{
3225 for (id = max (id, min_menu_id[kind]); id < min_menu_id[kind + 1]; id++) 3225 for (id = max (id, min_menu_id[kind]); id < min_menu_id[kind + 1]; id++)
3226 { 3226 {
3227 MenuHandle menu = GetMenuHandle (id); 3227 MenuRef menu = GetMenuRef (id);
3228 3228
3229 if (menu == NULL) 3229 if (menu == NULL)
3230 break; 3230 break;