Replace MenuHandle and GetMenuHandle with MenuRef and
GetMenuRef, respectively. Replace WindowPtr with WindowRef.
Replace ControlHandle with ControlRef.
(USE_CARBON_EVENTS): Remove. Use TARGET_API_MAC_CARBON instead.
[MAC_OS8] (do_get_menus): Rename variable `menu_handle' to `menu'.
(mac_begin_cg_clip): New arg F. Call SetPortWindowPort. All callers
changed so as not to call SetPortWindowPort.
(mac_begin_cg_clip) [USE_CG_DRAWING]: Call mac_prepare_for_quickdraw.
(mac_draw_image_string_atsui) [USE_ATSUI]: New function created from
mac_draw_string_common.
(mac_draw_image_string_qd): Likewise.
(mac_draw_string_common): Use them. Add INLINE.
(XTmouse_position, x_scroll_bar_report_motion) [TARGET_API_MAC_CARBON]:
Use FRAME_OUTER_TO_INNER_DIFF_X, FRAME_OUTER_TO_INNER_DIFF_Y, and
GetGlobalMouse.
(x_set_mouse_pixel_position) [MAC_OSX]: Use FRAME_OUTER_TO_INNER_DIFF_X
and FRAME_OUTER_TO_INNER_DIFF_Y.
[TARGET_API_MAC_CARBON] (mac_handle_mouse_event): Likewise.
[USE_MAC_TSM] (mac_handle_text_input_event): Likewise.
(x_make_frame_visible) [TARGET_API_MAC_CARBON]: Move code for
repositioning window to mac_handle_window_event.
(x_make_frame_invisible) [TARGET_API_MAC_CARBON]: Move code for
saving window location to mac_handle_window_event
[USE_MAC_FONT_PANEL] (mac_show_hide_font_panel): Install handler here.
(install_menu_target_item_handler): Remove argument in extern.
[TARGET_API_MAC_CARBON] (mac_event_to_emacs_modifiers):
Also accept command events.
(do_keystroke): New function created from XTread_socket.
(init_command_handler): Remove functions.
[TARGET_API_MAC_CARBON] (mac_handle_window_event): Reposition window
and save window location by kEventWindowShowing and kEventWindowHiding
handlers here. Don't call next handler for window state change and
focus events.
(mac_handle_keyboard_event) [TARGET_API_MAC_CARBON]: New function.
(install_window_handler) [TARGET_API_MAC_CARBON]: Register handlers for
kEventWindowShowing and kEventWindowHiding events. Move installation
of mouse, font, text input and menu target item handlers to
install_application_handler.
(install_application_handler) [TARGET_API_MAC_CARBON]: New function.
(mac_handle_cg_display_reconfig) [MAC_OS_X_VERSION_MAX_ALLOWED >= 1030]:
New function.
(init_dm_notification_handler) [MAC_OS_X_VERSION_MAX_ALLOWED >= 1030]:
Register it.
(XTread_socket) [TARGET_API_MAC_CARBON]:
Consolidate SendEventToEventTarget calls.
Use FRAME_OUTER_TO_INNER_DIFF_X and FRAME_OUTER_TO_INNER_DIFF_Y.
Move keyboard handler to mac_handle_keyboard_event.
(XTread_socket) [!TARGET_API_MAC_CARBON]: Use do_keystroke.
(mac_initialize) [TARGET_API_MAC_CARBON]: Don't call
init_command_handler. Call install_application_handler.
(x_draw_fringe_bitmap) [MAC_OSX]: Extend fringe background to scroll
bar gap.
(x_scroll_bar_create) [MAC_OSX]: Set bar->fringe_extended_p.
(XTset_vertical_scroll_bar) [MAC_OSX]: Put leftmost/rightmost
scroll bars on frame edge. Check fringe background extension.
Don't clear extended fringe background area.
(TOOLBAR_IDENTIFIER, TOOLBAR_ICON_ITEM_IDENTIFIER)
(TOOLBAR_ITEM_COMMAND_ID_OFFSET, TOOLBAR_ITEM_COMMAND_ID_P)
(TOOLBAR_ITEM_COMMAND_ID_VALUE, TOOLBAR_ITEM_MAKE_COMMAND_ID):
[USE_MAC_TOOLBAR]: New macros.
(mac_move_window_with_gravity, mac_get_window_origin_with_gravity)
(mac_handle_toolbar_event, mac_image_spec_to_cg_image)
(mac_create_frame_tool_bar, update_frame_tool_bar, free_frame_tool_bar)
(mac_tool_bar_note_mouse_movement, mac_handle_toolbar_command_event)
[USE_MAC_TOOLBAR]: New functions.
(mac_handle_window_event) [USE_MAC_TOOLBAR]: Reposition window
manually if previous repositioning has failed.
(mac_handle_keyboard_event): Use precomputed event kind.
(XTread_socket) [USE_MAC_TOOLBAR]: Handle click in structure region
as tool bar item click. Handle mouse movement over tool bar items.
(frame_highlight, frame_unhighlight): Don't call
ActivateControl/DeactivateControl here.
[USE_MAC_TOOLBAR] (free_frame_tool_bar): Suppress animation when
frame-notice-user-settings is non-nil.
[USE_MAC_FONT_PANEL] (mac_handle_font_event): Also record parameter
for kEventParamFMFontStyle.
[TARGET_API_MAC_CARBON] (mac_handle_keyboard_event): Don't check
mac_pass_command_to_system and mac_pass_control_to_system here.
(XTread_socket): Call ActivateControl/DeactivateControl here.
(XTread_socket) [TARGET_API_MAC_CARBON]:
Check mac_pass_command_to_system and mac_pass_control_to_system here.
[TARGET_API_MAC_CARBON] (mac_handle_window_event): Don't use invisible
frame as parent window for repositioning.