static void find_and_call_menu_selection P_ ((FRAME_PTR, int, Lisp_Object,
void *));
-static int fill_menu P_ ((MenuHandle, widget_value *, enum mac_menu_kind, int));
+static int fill_menu P_ ((MenuRef, widget_value *, enum mac_menu_kind, int));
static void fill_menubar P_ ((widget_value *, int));
static void dispose_menus P_ ((enum mac_menu_kind, int));
#endif
if (menu_id)
{
- MenuHandle menu = GetMenuHandle (menu_id);
+ MenuRef menu = GetMenuRef (menu_id);
if (menu)
{
OSStatus
install_menu_target_item_handler (window)
- WindowPtr window;
+ WindowRef window;
{
OSStatus err = noErr;
#if TARGET_API_MAC_CARBON
}
#endif /* MAC_OS_X_VERSION_MAX_ALLOWED >= 1030 */
-/* Add event handler to all menus that belong to KIND so we can detect C-g.
- MENU_HANDLE is the root menu of the tracking session to dismiss
- when C-g is detected. NULL means the menu bar.
- If CancelMenuTracking isn't available, do nothing. */
+/* Add event handler to all menus that belong to KIND so we can detect
+ C-g. ROOT_MENU is the root menu of the tracking session to dismiss
+ when C-g is detected. NULL means the menu bar. If
+ CancelMenuTracking isn't available, do nothing. */
static void
-install_menu_quit_handler (kind, menu_handle)
+install_menu_quit_handler (kind, root_menu)
enum mac_menu_kind kind;
- MenuHandle menu_handle;
+ MenuRef root_menu;
{
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
static const EventTypeSpec typesList[] =
#endif
for (id = min_menu_id[kind]; id < min_menu_id[kind + 1]; id++)
{
- MenuHandle menu = GetMenuHandle (id);
+ MenuRef menu = GetMenuRef (id);
if (menu == NULL)
break;
InstallMenuEventHandler (menu, menu_quit_handler,
GetEventTypeCount (typesList),
- typesList, menu_handle, NULL);
+ typesList, root_menu, NULL);
}
#endif /* MAC_OS_X_VERSION_MAX_ALLOWED >= 1030 */
}
{
struct Lisp_Save_Value *p = XSAVE_VALUE (arg);
FRAME_PTR f = p->pointer;
- MenuHandle menu = GetMenuHandle (min_menu_id[MAC_MENU_POPUP]);
+ MenuRef menu = GetMenuRef (min_menu_id[MAC_MENU_POPUP]);
BLOCK_INPUT;
int i;
int menu_item_choice;
UInt32 menu_item_selection;
- MenuHandle menu;
+ MenuRef menu;
Point pos;
widget_value *wv, *save_wv = 0, *first_wv = 0, *prev_wv = 0;
widget_value **submenu_stack
/* Get the refcon to find the correct item */
if (menu_item_choice)
{
- MenuHandle sel_menu = GetMenuHandle (HiWord (menu_item_choice));
+ MenuRef sel_menu = GetMenuRef (HiWord (menu_item_choice));
if (sel_menu)
GetMenuItemRefCon (sel_menu, LoWord (menu_item_choice),
int i;
int dialog_width;
Rect rect;
- WindowPtr window_ptr;
- ControlHandle ch;
+ WindowRef window_ptr;
+ ControlRef ch;
int left;
EventRecord event_record;
SInt16 part_code;
wv = wv->next;
}
- window_ptr = GetNewCWindow (DIALOG_WINDOW_RESOURCE, NULL, (WindowPtr) -1);
+ window_ptr = GetNewCWindow (DIALOG_WINDOW_RESOURCE, NULL, (WindowRef) -1);
SetPortWindowPort (window_ptr);
static void
add_menu_item (menu, pos, wv)
- MenuHandle menu;
+ MenuRef menu;
int pos;
widget_value *wv;
{
static int
fill_menu (menu, wv, kind, submenu_id)
- MenuHandle menu;
+ MenuRef menu;
widget_value *wv;
enum mac_menu_kind kind;
int submenu_id;
add_menu_item (menu, pos, wv);
if (wv->contents && submenu_id < min_menu_id[kind + 1])
{
- MenuHandle submenu = NewMenu (submenu_id, "\pX");
+ MenuRef submenu = NewMenu (submenu_id, "\pX");
InsertMenu (submenu, -1);
SetMenuItemHierarchicalID (menu, pos, submenu_id);
int deep_p;
{
int id, submenu_id;
- MenuHandle menu;
+ MenuRef menu;
Str255 title;
#if !TARGET_API_MAC_CARBON
int title_changed_p = 0;
title[255] = '\0';
c2pstr (title);
- menu = GetMenuHandle (id);
+ menu = GetMenuRef (id);
if (menu)
{
#if TARGET_API_MAC_CARBON
DeleteMenu (id);
DisposeMenu (menu);
menu = NewMenu (id, title);
- InsertMenu (menu, GetMenuHandle (id + 1) ? id + 1 : 0);
+ InsertMenu (menu, GetMenuRef (id + 1) ? id + 1 : 0);
title_changed_p = 1;
}
#endif /* !TARGET_API_MAC_CARBON */
submenu_id);
}
- if (id < min_menu_id[MAC_MENU_MENU_BAR + 1] && GetMenuHandle (id))
+ if (id < min_menu_id[MAC_MENU_MENU_BAR + 1] && GetMenuRef (id))
{
dispose_menus (MAC_MENU_MENU_BAR, id);
#if !TARGET_API_MAC_CARBON
{
for (id = max (id, min_menu_id[kind]); id < min_menu_id[kind + 1]; id++)
{
- MenuHandle menu = GetMenuHandle (id);
+ MenuRef menu = GetMenuRef (id);
if (menu == NULL)
break;