Merge from emacs--rel--22

Revision: emacs@sv.gnu.org/emacs--devo--0--patch-1112
This commit is contained in:
Miles Bader 2008-04-18 02:56:45 +00:00
commit d02fe47dd3
13 changed files with 6657 additions and 2516 deletions

View file

@ -3250,7 +3250,7 @@ Anything else means ask for each directory."
(defun dired-dnd-popup-notice ()
(message-box
"Recursive copies not enabled.\nSee variable dired-recursive-copies."))
"Dired recursive copies are currently disabled.\nSee the variable `dired-recursive-copies'."))
(defun dired-dnd-do-ask-action (uri)

View file

@ -728,13 +728,14 @@ definition, or nil if the language doesn't have any."
"define"))
(c-lang-defconst c-opt-cpp-macro-define-start
;; Regexp matching everything up to the macro body of a cpp define,
;; or the end of the logical line if there is none. Set if
;; c-opt-cpp-macro-define is.
;; Regexp matching everything up to the macro body of a cpp define, or the
;; end of the logical line if there is none. Submatch 1 is the name of the
;; macro. Set if c-opt-cpp-macro-define is.
t (if (c-lang-const c-opt-cpp-macro-define)
(concat (c-lang-const c-opt-cpp-prefix)
(c-lang-const c-opt-cpp-macro-define)
"[ \t]+\\(\\sw\\|_\\)+\\(\([^\)]*\)\\)?"
"[ \t]+\\(\\(\\sw\\|_\\)+\\)\\(\([^\)]*\)\\)?"
;; ^ ^ #defined name
"\\([ \t]\\|\\\\\n\\)*")))
(c-lang-defvar c-opt-cpp-macro-define-start
(c-lang-const c-opt-cpp-macro-define-start))

View file

@ -1,3 +1,162 @@
2008-04-06 YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
* Makefile.in (MAC_OBJ): Add mactoolbox.o.
(mactoolbox.o): New target.
* mac.c [MAC_OSX] (select_and_poll_event, sys_select):
Use mac_run_loop_run_once instead of CFRunLoopRunInMode.
* macfns.c (x_set_background_color, mac_window, x_create_tip_frame):
Use mac_set_frame_window_background instead of XSetWindowBackground.
(x_set_tool_bar_lines) [USE_MAC_TOOLBAR]:
Use mac_is_window_toolbar_visible instead of IsWindowToolbarVisible.
(x_set_name_internal) [TARGET_API_MAC_CARBON]: Use mac_set_window_title
instead of SetWindowTitleWithCFString.
(mac_update_proxy_icon) [TARGET_API_MAC_CARBON]: Remove BLOCK_INPUT.
Move function to mactoolbox.c.
(mac_update_title_bar) [TARGET_API_MAC_CARBON]:
Use mac_set_window_modified instead of SetWindowModified.
Add BLOCK_INPUT around mac_set_window_modified/mac_update_proxy_icon.
(mac_window, x_create_tip_frame): Use mac_create_frame_window.
(Fx_focus_frame): Use mac_front_non_floating_window instead of
FrontNonFloatingWindow. Use mac_activate_window instead of
ActivateWindow. Use mac_active_non_floating_window instead of
ActiveNonFloatingWindow.
(show_hourglass, hide_hourglass) [TARGET_API_MAC_CARBON]:
Use mac_show_hourglass and mac_hide_hourglass.
(compute_tip_xy) [TARGET_API_MAC_CARBON]: Use mac_get_global_mouse
instead of GetGlobalMouse.
(Fx_show_tip): Use mac_move_window/mac_size_window/mac_show_window
instead of MoveWindow/SizeWindow/ShowWindow, respectively.
Use mac_bring_window_to_front instead of BringToFront.
(Qfile_name_history) [TARGET_API_MAC_CARBON]: Move extern to
mactoolbox.c.
(Fx_file_dialog) [TARGET_API_MAC_CARBON]: Move function body to
mac_file_dialog in mactoolbox.c. Use mac_file_dialog.
(mac_nav_event_callback) [TARGET_API_MAC_CARBON]: Move function to
mactoolbox.c.
* macgui.h [!HAVE_CARBON]: Include Quickdraw.h instead of QuickDraw.h.
(XtPointer): Move typedef from macmenu.c.
(enum button_type): Move enum from macmenu.c.
(widget_value): Move typedef from macmenu.c.
(M_APPLE, I_ABOUT, EXTRA_STACK_ALLOC, ARGV_STRING_LIST_ID)
(DIALOG_LEFT_MARGIN, DIALOG_TOP_MARGIN, DIALOG_RIGHT_MARGIN)
(DIALOG_BOTTOM_MARGIN, DIALOG_MIN_INNER_WIDTH, DIALOG_MAX_INNER_WIDTH)
(DIALOG_BUTTON_BUTTON_HORIZONTAL_SPACE)
(DIALOG_BUTTON_BUTTON_VERTICAL_SPACE, DIALOG_BUTTON_MIN_WIDTH)
(DIALOG_TEXT_MIN_HEIGHT, DIALOG_TEXT_BUTTONS_VERTICAL_SPACE)
(DIALOG_ICON_WIDTH, DIALOG_ICON_HEIGHT, DIALOG_ICON_LEFT_MARGIN)
(DIALOG_ICON_TOP_MARGIN): Move defines from macmenu.c.
(Selection): Move typedef from macselect.c.
(RAM_TOO_LARGE_ALERT_ID, ABOUT_ALERT_ID) [MAC_OS8]: Move defines from
macterm.c.
(mac_set_window_title, mac_set_window_modified, mac_is_window_visible)
(mac_is_window_collapsed, mac_bring_window_to_front)
(mac_send_window_behind, mac_hide_window, mac_show_window)
(mac_collapse_window, mac_front_non_floating_window)
(mac_active_non_floating_window, mac_activate_window)
(mac_move_window_structure, mac_move_window, mac_size_window)
(mac_get_global_mouse, mac_is_window_toolbar_visible): New defines.
* macmenu.c [!TARGET_API_MAC_CARBON]: Move includes to mactoolbox.c.
(enum mac_menu_kind): Move enum to mactoolbox.c.
(min_menu_id): Move variable to mactoolbox.c.
(quit_dialog_event_loop) [TARGET_API_MAC_CARBON]: Likewise.
(DIALOG_WINDOW_RESOURCE): Move define to mactoolbox.c.
(DIALOG_BUTTON_COMMAND_ID_OFFSET, DIALOG_BUTTON_COMMAND_ID_P)
(DIALOG_BUTTON_COMMAND_ID_VALUE, DIALOG_BUTTON_MAKE_COMMAND_ID)
[TARGET_API_MAC_CARBON]: Likewise.
(XtPointer): Move typedef to macgui.h.
(enum button_type): Move enum to macgui.h.
(widget_value): Move typedef to macgui.h.
(DIALOG_LEFT_MARGIN, DIALOG_TOP_MARGIN, DIALOG_RIGHT_MARGIN)
(DIALOG_BOTTOM_MARGIN, DIALOG_MIN_INNER_WIDTH, DIALOG_MAX_INNER_WIDTH)
(DIALOG_BUTTON_BUTTON_HORIZONTAL_SPACE)
(DIALOG_BUTTON_BUTTON_VERTICAL_SPACE, DIALOG_BUTTON_MIN_WIDTH)
(DIALOG_TEXT_MIN_HEIGHT, DIALOG_TEXT_BUTTONS_VERTICAL_SPACE)
(DIALOG_ICON_WIDTH, DIALOG_ICON_HEIGHT, DIALOG_ICON_LEFT_MARGIN)
(DIALOG_ICON_TOP_MARGIN): Move defines to macgui.h.
(popup_activated_flag): Make variable non-static.
(x_activate_menubar, install_menu_quit_handler, pop_down_menu)
(add_menu_item, fill_menu, dispose_menus):
Move functions to mactoolbox.c.
(restore_show_help_function, menu_target_item_handler)
(install_menu_target_item_handler, mac_handle_dialog_event)
(install_dialog_event_handler, pop_down_dialog, create_and_show_dialog)
[TARGET_API_MAC_CARBON]: Likewise.
(menu_quit_handler) [MAC_OS_X_VERSION_MAX_ALLOWED >= 1030]: Likewise.
(mac_dialog) [!TARGET_API_MAC_CARBON]: Likewise.
(find_and_call_menu_selection, name_is_separator): Make function
non-static.
(Vshow_help_function, timer_check) [TARGET_API_MAC_CARBON]: Move extern
to mactoolbox.c.
(set_frame_menubar): Don't call install_menu_quit_handler.
(menu_item_selection): New variable.
(mac_menu_show): Use create_and_show_popup_menu.
(create_and_show_dialog) [TARGET_API_MAC_CARBON]: Don't return
selection but set variable menu_item_selection. All uses changed.
(mac_fill_menubar): Rename from fill_menubar. All uses changed.
Call install_menu_quit_handler. Move to mactoolbox.c.
* macselect.c [!TARGET_API_MAC_CARBON]: Don't include Scrap.h.
(Selection): Move typedef to macgui.h.
(Vselection_converter_alist, Qmac_scrap_name, Qmac_ostype)
(Vmac_apple_event_map, Qmac_apple_event_class, Qmac_apple_event_id):
Make variables non-static.
(Vmac_dnd_known_types) [TARGET_API_MAC_CARBON]: Likewise.
(mac_handle_apple_event, cleanup_all_suspended_apple_events):
Make functions non-static.
(Vmac_service_selection) [MAC_OSX]: Likewise.
(mac_get_selection_from_symbol, get_flavor_type_from_symbol)
(mac_valid_selection_target_p, mac_clear_selection)
(mac_get_selection_ownership_info, mac_valid_selection_value_p)
(mac_put_selection_value, mac_selection_has_target_p)
(mac_get_selection_value, mac_get_selection_target_list)
(init_apple_event_handler, install_drag_handler, remove_drag_handler):
Move functions to mactoolbox.c.
(mac_do_track_drag, mac_do_receive_drag) [TARGET_API_MAC_CARBON]:
Likewise.
(copy_scrap_flavor_data, mac_handle_service_event)
(install_service_handler) [MAC_OSX]: Likewise.
(syms_of_macselect) <Vmac_dnd_known_types>:
Use mac_dnd_default_known_types.
* macterm.h (FRAME_OUTER_TO_INNER_DIFF_X, FRAME_OUTER_TO_INNER_DIFF_Y):
Move to mactoolbox.c.
(HOURGLASS_WIDTH, HOURGLASS_HEIGHT): Change to 15.
(Fx_selection_owner_p): Add EXFUN.
(install_window_handler, remove_window_handler, XSetWindowBackground):
Remove externs.
(do_apple_menu) [!TARGET_API_MAC_CARBON]: Likewise.
(mac_prepare_for_quickdraw) [USE_CG_DRAWING]: Likewise.
(x_raise_frame, x_lower_frame, mac_alert_sound_play)
(install_application_handler, mac_get_frame_bounds, mac_get_frame_mouse)
(mac_convert_frame_point_to_global, mac_set_frame_window_background)
(mac_update_begin mac_update_end, mac_frame_up_to_date, x_flush)
(mac_create_frame_window, mac_dispose_frame_window, mac_begin_clip)
(mac_end_clip, mac_create_scroll_bar, mac_dispose_scroll_bar)
(mac_set_scroll_bar_bounds, mac_redraw_scroll_bar, mac_fill_menubar)
(create_and_show_popup_menu, mac_get_selection_from_symbol)
(mac_valid_selection_target_p, mac_clear_selection)
(mac_get_selection_ownership_info, mac_valid_selection_value_p)
(mac_put_selection_value, mac_selection_has_target_p)
(mac_get_selection_value, mac_get_selection_target_list): Add externs.
(mac_update_proxy_icon, mac_show_hourglass, mac_hide_hourglass)
(mac_reposition_hourglass, mac_file_dialog, create_and_show_dialog)
(mac_dnd_default_known_types) [TARGET_API_MAC_CARBON]: Likewise.
(mac_run_loop_run_once) [MAC_OSX]: Likewise.
(mac_dialog) [!TARGET_API_MAC_CARBON]: Likewise.
(mac_begin_cg_clip, mac_end_cg_clip) [USE_CG_DRAWING]: Likewise.
(x_set_toolkit_scroll_bar_thumb) [!USE_TOOLKIT_SCROLL_BARS]: Likewise.
(x_scroll_bar_set_handle) [!USE_TOOLKIT_SCROLL_BARS]: Likewise.
* mactoolbox.c: New file.
2008-03-31 Jason Rumney <jasonr@gnu.org>
* dired.c (Ffile_attributes) [WINDOWSNT]: Cast uid and gid to unsigned.
2008-04-18 Stefan Monnier <monnier@iro.umontreal.ca>
* fileio.c (Fexpand_file_name): Refine last fix so `nm' is only

View file

@ -549,7 +549,7 @@ CYGWIN_OBJ = sheap.o
#ifdef HAVE_CARBON
mac = $(dot)$(dot)/mac/
MAC_OBJ = mac.o macterm.o macfns.o macmenu.o macselect.o fontset.o fringe.o image.o
MAC_OBJ = mac.o macterm.o macfns.o macmenu.o macselect.o fontset.o fringe.o image.o mactoolbox.o
emacsapp = $(PWD)/$(mac)Emacs.app/
emacsappsrc = ${srcdir}/../mac/Emacs.app/
#endif
@ -1268,6 +1268,9 @@ macterm.o: blockinput.h atimer.h systime.h syssignal.h macterm.h macgui.h \
process.h coding.h $(config_h)
macselect.o: blockinput.h atimer.h systime.h macterm.h macgui.h frame.h \
keymap.h $(config_h)
mactoolbox.o: blockinput.h atimer.h systime.h macterm.h macgui.h frame.h \
charset.h coding.h ccl.h dispextern.h fontset.h termhooks.h buffer.h \
window.h keyboard.h $(config_h)
${emacsapp}Contents/Resources/English.lproj:
mkdir -p $@

View file

@ -979,8 +979,16 @@ Elements of the attribute list are:
shorter than an int (e.g., `short'), GCC whines about comparison
being always false due to limited range of data type. Fix by
copying s.st_uid and s.st_gid into int variables. */
#ifdef WINDOWSNT
/* Windows uses signed short for the uid and gid in the stat structure,
but we use an int for getuid (limited to the range 0-60000).
So users with uid > 32767 need their uid patched back here. */
uid = (unsigned short) s.st_uid;
gid = (unsigned short) s.st_gid;
#else
uid = s.st_uid;
gid = s.st_gid;
#endif
if (NILP (id_format) || EQ (id_format, Qinteger))
{
values[2] = make_fixnum_or_float (uid);

View file

@ -6055,8 +6055,8 @@ A non-nil CURRENT-ONLY argument means save only current buffer. */)
restore_message ();
}
else if (!auto_save_error_occurred)
/* Don't overwrite the error message if an error occurred. */
/* If we displayed a message and then restored a state
/* Don't overwrite the error message if an error occurred.
If we displayed a message and then restored a state
with no message, leave a "done" message on the screen. */
message1 ("Auto-saving...done");
}

View file

@ -4989,8 +4989,8 @@ extern int noninteractive;
SELECT_TIMEOUT_THRESHOLD_RUNLOOP seconds).
-> Create CFSocket for each socket and add it into the current
event RunLoop so that the current event loop gets quit when
the socket becomes ready. Then CFRunLoopRunInMode can wait
for both kinds of inputs.
the socket becomes ready. Then mac_run_loop_run_once can
wait for both kinds of inputs.
4. Otherwise.
-> Periodically poll the window input channel while repeatedly
executing `select' with a short timeout
@ -5045,7 +5045,7 @@ select_and_poll_event (nfds, rfds, wfds, efds, timeout)
if (efds) oefds = *efds;
}
/* Try detect_input_pending before CFRunLoopRunInMode in the same
/* Try detect_input_pending before mac_run_loop_run_once in the same
BLOCK_INPUT block, in case that some input has already been read
asynchronously. */
BLOCK_INPUT;
@ -5062,15 +5062,7 @@ select_and_poll_event (nfds, rfds, wfds, efds, timeout)
if (timeoutval == 0.0)
timedout_p = 1;
else
{
#if USE_CG_DRAWING
mac_prepare_for_quickdraw (NULL);
#endif
if (CFRunLoopRunInMode (kCFRunLoopDefaultMode,
timeoutval >= 0 ? timeoutval : 100000, true)
== kCFRunLoopRunTimedOut)
timedout_p = 1;
}
timedout_p = mac_run_loop_run_once (timeoutval);
if (timeout == NULL && timedout_p)
{
@ -5193,7 +5185,7 @@ sys_select (nfds, rfds, wfds, efds, timeout)
if (timeoutval > 0 && timeoutval <= SELECT_TIMEOUT_THRESHOLD_RUNLOOP)
goto poll_periodically;
/* Try detect_input_pending before CFRunLoopRunInMode in the
/* Try detect_input_pending before mac_run_loop_run_once in the
same BLOCK_INPUT block, in case that some input has already
been read asynchronously. */
BLOCK_INPUT;
@ -5246,13 +5238,7 @@ sys_select (nfds, rfds, wfds, efds, timeout)
CFRunLoopAddSource (runloop, source, kCFRunLoopDefaultMode);
}
#if USE_CG_DRAWING
mac_prepare_for_quickdraw (NULL);
#endif
if (CFRunLoopRunInMode (kCFRunLoopDefaultMode,
timeoutval >= 0 ? timeoutval : 100000, true)
== kCFRunLoopRunTimedOut)
timedout_p = 1;
timedout_p = mac_run_loop_run_once (timeoutval);
for (fd = minfd; fd < nfds; fd++)
if (FD_ISSET (fd, rfds) || (wfds && FD_ISSET (fd, wfds)))

View file

@ -1346,7 +1346,7 @@ x_set_background_color (f, arg, oldval)
BLOCK_INPUT;
XSetBackground (dpy, mac->normal_gc, bg);
XSetForeground (dpy, mac->reverse_gc, bg);
XSetWindowBackground (dpy, FRAME_MAC_WINDOW (f), bg);
mac_set_frame_window_background (f, bg);
XSetForeground (dpy, mac->cursor_gc, bg);
UNBLOCK_INPUT;
@ -1686,7 +1686,8 @@ x_set_tool_bar_lines (f, value, oldval)
if (nlines)
{
FRAME_EXTERNAL_TOOL_BAR (f) = 1;
if (FRAME_MAC_P (f) && !IsWindowToolbarVisible (FRAME_MAC_WINDOW (f)))
if (FRAME_MAC_P (f)
&& !mac_is_window_toolbar_visible (FRAME_MAC_WINDOW (f)))
/* Make sure next redisplay shows the tool bar. */
XWINDOW (FRAME_SELECTED_WINDOW (f))->update_mode_line = Qt;
}
@ -1770,7 +1771,7 @@ x_set_name_internal (f, name)
CFStringRef windowTitle =
cfstring_create_with_utf8_cstring (SDATA (name));
SetWindowTitleWithCFString (FRAME_MAC_WINDOW (f), windowTitle);
mac_set_window_title (FRAME_MAC_WINDOW (f), windowTitle);
CFRelease (windowTitle);
#else
Str255 windowTitle;
@ -1935,98 +1936,6 @@ mac_set_font (f, arg, oldval)
#endif
}
#if TARGET_API_MAC_CARBON
static void
mac_update_proxy_icon (f)
struct frame *f;
{
OSStatus err;
Lisp_Object file_name =
XBUFFER (XWINDOW (FRAME_SELECTED_WINDOW (f))->buffer)->filename;
Window w = FRAME_MAC_WINDOW (f);
AliasHandle alias = NULL;
BLOCK_INPUT;
err = GetWindowProxyAlias (w, &alias);
if (err == errWindowDoesNotHaveProxy && !STRINGP (file_name))
goto out;
if (STRINGP (file_name))
{
AEDesc desc;
#ifdef MAC_OSX
FSRef fref, fref_proxy;
#else
FSSpec fss, fss_proxy;
#endif
Boolean changed;
Lisp_Object encoded_file_name = ENCODE_FILE (file_name);
#ifdef MAC_OSX
err = AECoercePtr (TYPE_FILE_NAME, SDATA (encoded_file_name),
SBYTES (encoded_file_name), typeFSRef, &desc);
#else
SetPortWindowPort (w);
err = AECoercePtr (TYPE_FILE_NAME, SDATA (encoded_file_name),
SBYTES (encoded_file_name), typeFSS, &desc);
#endif
if (err == noErr)
{
#ifdef MAC_OSX
err = AEGetDescData (&desc, &fref, sizeof (FSRef));
#else
err = AEGetDescData (&desc, &fss, sizeof (FSSpec));
#endif
AEDisposeDesc (&desc);
}
if (err == noErr)
{
if (alias)
{
/* (FS)ResolveAlias never sets `changed' to true if
`alias' is minimal. */
#ifdef MAC_OSX
err = FSResolveAlias (NULL, alias, &fref_proxy, &changed);
if (err == noErr)
err = FSCompareFSRefs (&fref, &fref_proxy);
#else
err = ResolveAlias (NULL, alias, &fss_proxy, &changed);
if (err == noErr)
err = !(fss.vRefNum == fss_proxy.vRefNum
&& fss.parID == fss_proxy.parID
&& EqualString (fss.name, fss_proxy.name,
false, true));
#endif
}
if (err != noErr || alias == NULL)
{
if (alias)
DisposeHandle ((Handle) alias);
#ifdef MAC_OSX
err = FSNewAliasMinimal (&fref, &alias);
#else
err = NewAliasMinimal (&fss, &alias);
#endif
changed = true;
}
}
if (err == noErr)
if (changed)
err = SetWindowProxyAlias (w, alias);
}
if (alias)
DisposeHandle ((Handle) alias);
if (err != noErr || !STRINGP (file_name))
RemoveWindowProxy (w);
out:
UNBLOCK_INPUT;
}
#endif
void
mac_update_title_bar (f, save_match_data)
struct frame *f;
@ -2048,9 +1957,11 @@ mac_update_title_bar (f, save_match_data)
|| (!MINI_WINDOW_P (w)
&& (modified_p != !NILP (w->last_had_star))))
{
SetWindowModified (FRAME_MAC_WINDOW (f),
!MINI_WINDOW_P (w) && modified_p);
BLOCK_INPUT;
mac_set_window_modified (FRAME_MAC_WINDOW (f),
!MINI_WINDOW_P (w) && modified_p);
mac_update_proxy_icon (f);
UNBLOCK_INPUT;
}
#endif
}
@ -2247,52 +2158,12 @@ mac_window (f, window_prompting, minibuffer_only)
long window_prompting;
int minibuffer_only;
{
Rect r;
BLOCK_INPUT;
SetRect (&r, f->left_pos, f->top_pos,
f->left_pos + FRAME_PIXEL_WIDTH (f),
f->top_pos + FRAME_PIXEL_HEIGHT (f));
#if TARGET_API_MAC_CARBON
CreateNewWindow (kDocumentWindowClass,
kWindowStandardDocumentAttributes
#ifdef MAC_OSX
| kWindowToolbarButtonAttribute
#endif
, &r, &FRAME_MAC_WINDOW (f));
if (FRAME_MAC_WINDOW (f))
{
SetWRefCon (FRAME_MAC_WINDOW (f), (long) f->output_data.mac);
if (install_window_handler (FRAME_MAC_WINDOW (f)) != noErr)
{
DisposeWindow (FRAME_MAC_WINDOW (f));
FRAME_MAC_WINDOW (f) = NULL;
}
}
#else /* !TARGET_API_MAC_CARBON */
FRAME_MAC_WINDOW (f)
= NewCWindow (NULL, &r, "\p", false, zoomDocProc,
(WindowRef) -1, 1, (long) f->output_data.mac);
#endif /* !TARGET_API_MAC_CARBON */
/* so that update events can find this mac_output struct */
f->output_data.mac->mFP = f; /* point back to emacs frame */
mac_create_frame_window (f, 0);
#ifndef MAC_OSX
if (FRAME_MAC_WINDOW (f))
{
ControlRef root_control;
if (CreateRootControl (FRAME_MAC_WINDOW (f), &root_control) != noErr)
{
DisposeWindow (FRAME_MAC_WINDOW (f));
FRAME_MAC_WINDOW (f) = NULL;
}
}
#endif
if (FRAME_MAC_WINDOW (f))
XSetWindowBackground (FRAME_MAC_DISPLAY(f), FRAME_MAC_WINDOW (f),
FRAME_BACKGROUND_PIXEL (f));
mac_set_frame_window_background (f, FRAME_BACKGROUND_PIXEL (f));
#if USE_MAC_TOOLBAR
/* At the moment, the size of the tool bar is not yet known. We
@ -2875,7 +2746,7 @@ FRAME nil means use the selected frame. */)
if (!front_p)
{
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1020
if (FrontNonFloatingWindow () == FRAME_MAC_WINDOW (f))
if (mac_front_non_floating_window () == FRAME_MAC_WINDOW (f))
SetFrontProcessWithOptions (&current_psn,
kSetFrontProcessFrontWindowOnly);
else
@ -2884,8 +2755,8 @@ FRAME nil means use the selected frame. */)
}
#ifdef MAC_OSX
ActivateWindow (ActiveNonFloatingWindow (), false);
ActivateWindow (FRAME_MAC_WINDOW (f), true);
mac_activate_window (mac_active_non_floating_window (), false);
mac_activate_window (FRAME_MAC_WINDOW (f), true);
#else
#if !TARGET_API_MAC_CARBON
/* SelectWindow (Non-Carbon) does not issue deactivate events if the
@ -3663,26 +3534,7 @@ show_hourglass (timer)
if (FRAME_LIVE_P (f) && FRAME_MAC_P (f)
&& FRAME_MAC_WINDOW (f) != tip_window)
{
#if USE_CG_DRAWING
mac_prepare_for_quickdraw (f);
#endif
if (!f->output_data.mac->hourglass_control)
{
Window w = FRAME_MAC_WINDOW (f);
Rect r;
ControlRef c;
GetWindowPortBounds (w, &r);
r.left = r.right - HOURGLASS_WIDTH;
r.bottom = r.top + HOURGLASS_HEIGHT;
if (CreateChasingArrowsControl (w, &r, &c) == noErr)
f->output_data.mac->hourglass_control = c;
}
if (f->output_data.mac->hourglass_control)
ShowControl (f->output_data.mac->hourglass_control);
}
mac_show_hourglass (f);
}
hourglass_shown_p = 1;
@ -3708,15 +3560,8 @@ hide_hourglass ()
{
struct frame *f = XFRAME (frame);
if (FRAME_MAC_P (f)
/* Watch out for newly created frames. */
&& f->output_data.mac->hourglass_control)
{
#if USE_CG_DRAWING
mac_prepare_for_quickdraw (f);
#endif
HideControl (f->output_data.mac->hourglass_control);
}
if (FRAME_MAC_P (f))
mac_hide_hourglass (f);
}
hourglass_shown_p = 0;
@ -3953,33 +3798,17 @@ x_create_tip_frame (dpyinfo, parms, text)
window_prompting = x_figure_window_size (f, parms, 0);
{
Rect r;
BLOCK_INPUT;
BLOCK_INPUT;
SetRect (&r, 0, 0, 1, 1);
#if TARGET_API_MAC_CARBON
if (CreateNewWindow (kHelpWindowClass,
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1020
kWindowIgnoreClicksAttribute |
#endif
kWindowNoUpdatesAttribute |
kWindowNoActivatesAttribute,
&r, &tip_window) == noErr)
#else
if (tip_window = NewCWindow (NULL, &r, "\p", false, plainDBox,
NULL, false, 0L))
#endif
{
FRAME_MAC_WINDOW (f) = tip_window;
XSetWindowBackground (FRAME_MAC_DISPLAY(f), tip_window,
FRAME_BACKGROUND_PIXEL (f));
SetWRefCon (tip_window, (long) f->output_data.mac);
/* so that update events can find this mac_output struct */
f->output_data.mac->mFP = f;
}
UNBLOCK_INPUT;
}
mac_create_frame_window (f, 1);
if (FRAME_MAC_WINDOW (f))
{
mac_set_frame_window_background (f, FRAME_BACKGROUND_PIXEL (f));
tip_window = FRAME_MAC_WINDOW (f);
}
UNBLOCK_INPUT;
x_make_gc (f);
@ -4076,7 +3905,7 @@ compute_tip_xy (f, parms, dx, dy, width, height, root_x, root_y)
BLOCK_INPUT;
#if TARGET_API_MAC_CARBON
GetGlobalMouse (&mouse_pos);
mac_get_global_mouse (&mouse_pos);
#else
GetMouse (&mouse_pos);
LocalToGlobal (&mouse_pos);
@ -4200,7 +4029,7 @@ Text larger than the specified size is clipped. */)
BLOCK_INPUT;
compute_tip_xy (f, parms, dx, dy, FRAME_PIXEL_WIDTH (f),
FRAME_PIXEL_HEIGHT (f), &root_x, &root_y);
MoveWindow (FRAME_MAC_WINDOW (f), root_x, root_y, false);
mac_move_window (FRAME_MAC_WINDOW (f), root_x, root_y, false);
UNBLOCK_INPUT;
goto start_timer;
}
@ -4302,10 +4131,10 @@ Text larger than the specified size is clipped. */)
compute_tip_xy (f, parms, dx, dy, width, height, &root_x, &root_y);
BLOCK_INPUT;
MoveWindow (FRAME_MAC_WINDOW (f), root_x, root_y, false);
SizeWindow (FRAME_MAC_WINDOW (f), width, height, true);
ShowWindow (FRAME_MAC_WINDOW (f));
BringToFront (FRAME_MAC_WINDOW (f));
mac_move_window (FRAME_MAC_WINDOW (f), root_x, root_y, false);
mac_size_window (FRAME_MAC_WINDOW (f), width, height, true);
mac_show_window (FRAME_MAC_WINDOW (f));
mac_bring_window_to_front (FRAME_MAC_WINDOW (f));
UNBLOCK_INPUT;
FRAME_PIXEL_WIDTH (f) = width;
@ -4366,25 +4195,11 @@ Value is t if tooltip was open, nil otherwise. */)
#if TARGET_API_MAC_CARBON
/***********************************************************************
File selection dialog
***********************************************************************/
static pascal void mac_nav_event_callback P_ ((NavEventCallbackMessage,
NavCBRecPtr, void *));
/**
There is a relatively standard way to do this using applescript to run
a (choose file) method. However, this doesn't do "the right thing"
by working only if the find-file occurred during a menu or toolbar
click. So we must do the file dialog by hand, using the navigation
manager. This also has more flexibility in determining the default
directory and whether or not we are going to choose a file.
**/
extern Lisp_Object Qfile_name_history;
#if TARGET_API_MAC_CARBON
DEFUN ("x-file-dialog", Fx_file_dialog, Sx_file_dialog, 2, 5, 0,
doc: /* Read file name, prompting with PROMPT in directory DIR.
Use a file selection dialog.
@ -4394,182 +4209,10 @@ If ONLY-DIR-P is non-nil, the user can only select directories. */)
(prompt, dir, default_filename, mustmatch, only_dir_p)
Lisp_Object prompt, dir, default_filename, mustmatch, only_dir_p;
{
Lisp_Object file = Qnil;
int count = SPECPDL_INDEX ();
struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5, gcpro6;
char filename[MAXPATHLEN];
static NavEventUPP mac_nav_event_callbackUPP = NULL;
check_mac ();
GCPRO6 (prompt, dir, default_filename, mustmatch, file, only_dir_p);
CHECK_STRING (prompt);
CHECK_STRING (dir);
/* Create the dialog with PROMPT as title, using DIR as initial
directory and using "*" as pattern. */
dir = Fexpand_file_name (dir, Qnil);
{
OSStatus status;
NavDialogCreationOptions options;
NavDialogRef dialogRef;
NavTypeListHandle fileTypes = NULL;
NavUserAction userAction;
CFStringRef message=NULL, saveName = NULL;
BLOCK_INPUT;
/* No need for a callback function because we are modal */
NavGetDefaultDialogCreationOptions(&options);
options.modality = kWindowModalityAppModal;
options.location.h = options.location.v = -1;
options.optionFlags = kNavDefaultNavDlogOptions;
options.optionFlags |= kNavAllFilesInPopup; /* All files allowed */
options.optionFlags |= kNavSelectAllReadableItem;
options.optionFlags &= ~kNavAllowMultipleFiles;
if (!NILP(prompt))
{
message = cfstring_create_with_string (prompt);
options.message = message;
}
/* Don't set the application, let it use default.
options.clientName = CFSTR ("Emacs");
*/
if (mac_nav_event_callbackUPP == NULL)
mac_nav_event_callbackUPP = NewNavEventUPP (mac_nav_event_callback);
if (!NILP (only_dir_p))
status = NavCreateChooseFolderDialog(&options, mac_nav_event_callbackUPP,
NULL, NULL, &dialogRef);
else if (NILP (mustmatch))
{
/* This is a save dialog */
options.optionFlags |= kNavDontConfirmReplacement;
options.actionButtonLabel = CFSTR ("Ok");
options.windowTitle = CFSTR ("Enter name");
if (STRINGP (default_filename))
{
Lisp_Object utf8 = ENCODE_UTF_8 (default_filename);
char *begPtr = SDATA(utf8);
char *filePtr = begPtr + SBYTES(utf8);
while (filePtr != begPtr && !IS_DIRECTORY_SEP(filePtr[-1]))
filePtr--;
saveName = cfstring_create_with_utf8_cstring (filePtr);
options.saveFileName = saveName;
options.optionFlags |= kNavSelectDefaultLocation;
}
status = NavCreatePutFileDialog(&options,
'TEXT', kNavGenericSignature,
mac_nav_event_callbackUPP, NULL,
&dialogRef);
}
else
{
/* This is an open dialog*/
status = NavCreateChooseFileDialog(&options, fileTypes,
mac_nav_event_callbackUPP, NULL,
NULL, NULL, &dialogRef);
}
/* Set the default location and continue*/
if (status == noErr)
{
Lisp_Object encoded_dir = ENCODE_FILE (dir);
AEDesc defLocAed;
status = AECreateDesc (TYPE_FILE_NAME, SDATA (encoded_dir),
SBYTES (encoded_dir), &defLocAed);
if (status == noErr)
{
NavCustomControl(dialogRef, kNavCtlSetLocation, (void*) &defLocAed);
AEDisposeDesc(&defLocAed);
}
status = NavDialogRun(dialogRef);
}
if (saveName) CFRelease(saveName);
if (message) CFRelease(message);
if (status == noErr) {
userAction = NavDialogGetUserAction(dialogRef);
switch (userAction)
{
case kNavUserActionNone:
case kNavUserActionCancel:
break; /* Treat cancel like C-g */
case kNavUserActionOpen:
case kNavUserActionChoose:
case kNavUserActionSaveAs:
{
NavReplyRecord reply;
Size len;
status = NavDialogGetReply(dialogRef, &reply);
if (status != noErr)
break;
status = AEGetNthPtr (&reply.selection, 1, TYPE_FILE_NAME,
NULL, NULL, filename,
sizeof (filename) - 1, &len);
if (status == noErr)
{
len = min (len, sizeof (filename) - 1);
filename[len] = '\0';
if (reply.saveFileName)
{
/* If it was a saved file, we need to add the file name */
if (len && len < sizeof (filename) - 1
&& filename[len-1] != '/')
filename[len++] = '/';
CFStringGetCString(reply.saveFileName, filename+len,
sizeof (filename) - len,
#ifdef MAC_OSX
kCFStringEncodingUTF8
#else
CFStringGetSystemEncoding ()
#endif
);
}
file = DECODE_FILE (make_unibyte_string (filename,
strlen (filename)));
}
NavDisposeReply(&reply);
}
break;
}
NavDialogDispose(dialogRef);
UNBLOCK_INPUT;
}
else {
UNBLOCK_INPUT;
/* Fall back on minibuffer if there was a problem */
file = Fcompleting_read (prompt, intern ("read-file-name-internal"),
dir, mustmatch, dir, Qfile_name_history,
default_filename, Qnil);
}
}
UNGCPRO;
/* Make "Cancel" equivalent to C-g. */
if (NILP (file))
Fsignal (Qquit, Qnil);
return unbind_to (count, file);
}
/* Need to register some event callback function for enabling drag and
drop in Navigation Service dialogs. */
static pascal void
mac_nav_event_callback (selector, parms, data)
NavEventCallbackMessage selector;
NavCBRecPtr parms;
void *data ;
{
return mac_file_dialog (prompt, dir, default_filename, mustmatch, only_dir_p);
}
#endif
/***********************************************************************
Fonts

View file

@ -71,7 +71,7 @@ typedef unsigned long Time;
#undef Z
#define Z (current_buffer->text->z)
#else /* not HAVE_CARBON */
#include <QuickDraw.h> /* for WindowRef */
#include <Quickdraw.h> /* for WindowRef */
#include <QDOffscreen.h> /* for GWorldPtr */
#include <Appearance.h> /* for ThemeCursor */
#include <Windows.h>
@ -127,6 +127,28 @@ typedef unsigned long Time;
#endif
typedef WindowRef Window;
#if TARGET_API_MAC_CARBON
typedef ScrapRef Selection;
#else
typedef int Selection;
#endif
#define mac_set_window_title SetWindowTitleWithCFString
#define mac_set_window_modified SetWindowModified
#define mac_is_window_visible IsWindowVisible
#define mac_is_window_collapsed IsWindowCollapsed
#define mac_bring_window_to_front BringToFront
#define mac_send_window_behind SendBehind
#define mac_hide_window HideWindow
#define mac_show_window ShowWindow
#define mac_collapse_window CollapseWindow
#define mac_front_non_floating_window FrontNonFloatingWindow
#define mac_active_non_floating_window ActiveNonFloatingWindow
#define mac_activate_window ActivateWindow
#define mac_move_window_structure MoveWindowStructure
#define mac_move_window MoveWindow
#define mac_size_window SizeWindow
#define mac_get_global_mouse GetGlobalMouse
#define mac_is_window_toolbar_visible IsWindowToolbarVisible
typedef GWorldPtr Pixmap;
#define Cursor ThemeCursor
@ -363,6 +385,97 @@ typedef struct {
(nr).right = ((nr).left + (width)), \
(nr).bottom = ((nr).top + (height)))
/* Definitions copied from lwlib.h */
typedef void * XtPointer;
enum button_type
{
BUTTON_TYPE_NONE,
BUTTON_TYPE_TOGGLE,
BUTTON_TYPE_RADIO
};
/* This structure is based on the one in ../lwlib/lwlib.h, modified
for Mac OS. */
typedef struct _widget_value
{
/* name of widget */
Lisp_Object lname;
char* name;
/* value (meaning depend on widget type) */
char* value;
/* keyboard equivalent. no implications for XtTranslations */
Lisp_Object lkey;
char* key;
/* Help string or nil if none.
GC finds this string through the frame's menu_bar_vector
or through menu_items. */
Lisp_Object help;
/* true if enabled */
Boolean enabled;
/* true if selected */
Boolean selected;
/* The type of a button. */
enum button_type button_type;
/* true if menu title */
Boolean title;
#if 0
/* true if was edited (maintained by get_value) */
Boolean edited;
/* true if has changed (maintained by lw library) */
change_type change;
/* true if this widget itself has changed,
but not counting the other widgets found in the `next' field. */
change_type this_one_change;
#endif
/* Contents of the sub-widgets, also selected slot for checkbox */
struct _widget_value* contents;
/* data passed to callback */
XtPointer call_data;
/* next one in the list */
struct _widget_value* next;
#if 0
/* slot for the toolkit dependent part. Always initialize to NULL. */
void* toolkit_data;
/* tell us if we should free the toolkit data slot when freeing the
widget_value itself. */
Boolean free_toolkit_data;
/* we resource the widget_value structures; this points to the next
one on the free list if this one has been deallocated.
*/
struct _widget_value *free_list;
#endif
} widget_value;
#if MAC_OS8
#define M_APPLE 234
#define I_ABOUT 1
#define EXTRA_STACK_ALLOC (256 * 1024)
#define ARGV_STRING_LIST_ID 129
#define RAM_TOO_LARGE_ALERT_ID 129
#define ABOUT_ALERT_ID 128
#endif
#define DIALOG_LEFT_MARGIN (112)
#define DIALOG_TOP_MARGIN (24)
#define DIALOG_RIGHT_MARGIN (24)
#define DIALOG_BOTTOM_MARGIN (20)
#define DIALOG_MIN_INNER_WIDTH (338)
#define DIALOG_MAX_INNER_WIDTH (564)
#define DIALOG_BUTTON_BUTTON_HORIZONTAL_SPACE (12)
#define DIALOG_BUTTON_BUTTON_VERTICAL_SPACE (12)
#define DIALOG_BUTTON_MIN_WIDTH (68)
#define DIALOG_TEXT_MIN_HEIGHT (50)
#define DIALOG_TEXT_BUTTONS_VERTICAL_SPACE (10)
#define DIALOG_ICON_WIDTH (64)
#define DIALOG_ICON_HEIGHT (64)
#define DIALOG_ICON_LEFT_MARGIN (24)
#define DIALOG_ICON_TOP_MARGIN (15)
#endif /* EMACS_MACGUI_H */
/* arch-tag: 5a0da49a-35e2-418b-a58c-8a55778ae849

File diff suppressed because it is too large Load diff

View file

@ -25,38 +25,15 @@ Boston, MA 02110-1301, USA. */
#include "blockinput.h"
#include "keymap.h"
#if TARGET_API_MAC_CARBON
typedef ScrapRef Selection;
#else /* !TARGET_API_MAC_CARBON */
#include <Scrap.h>
#if !TARGET_API_MAC_CARBON
#include <Endian.h>
typedef int Selection;
#endif /* !TARGET_API_MAC_CARBON */
#endif
static OSStatus mac_get_selection_from_symbol P_ ((Lisp_Object, int,
Selection *));
static ScrapFlavorType get_flavor_type_from_symbol P_ ((Lisp_Object,
Selection));
static int mac_valid_selection_target_p P_ ((Lisp_Object));
static OSStatus mac_clear_selection P_ ((Selection *));
static Lisp_Object mac_get_selection_ownership_info P_ ((Selection));
static int mac_valid_selection_value_p P_ ((Lisp_Object, Lisp_Object));
static OSStatus mac_put_selection_value P_ ((Selection, Lisp_Object,
Lisp_Object));
static int mac_selection_has_target_p P_ ((Selection, Lisp_Object));
static Lisp_Object mac_get_selection_value P_ ((Selection, Lisp_Object));
static Lisp_Object mac_get_selection_target_list P_ ((Selection));
static void x_own_selection P_ ((Lisp_Object, Lisp_Object));
static Lisp_Object x_get_local_selection P_ ((Lisp_Object, Lisp_Object, int));
static Lisp_Object x_get_foreign_selection P_ ((Lisp_Object,
Lisp_Object,
Lisp_Object));
EXFUN (Fx_selection_owner_p, 1);
#ifdef MAC_OSX
static OSStatus mac_handle_service_event P_ ((EventHandlerCallRef,
EventRef, void *));
void init_service_handler P_ ((void));
#endif
Lisp_Object QPRIMARY, QSECONDARY, QTIMESTAMP, QTARGETS;
@ -98,302 +75,13 @@ static Lisp_Object Vselection_alist;
selection value to a string representing the given selection type.
This is for Lisp-level extension of the emacs selection
handling. */
static Lisp_Object Vselection_converter_alist;
Lisp_Object Vselection_converter_alist;
/* A selection name (represented as a Lisp symbol) can be associated
with a named scrap via `mac-scrap-name' property. Likewise for a
selection type with a scrap flavor type via `mac-ostype'. */
static Lisp_Object Qmac_scrap_name, Qmac_ostype;
Lisp_Object Qmac_scrap_name, Qmac_ostype;
#ifdef MAC_OSX
/* Selection name for communication via Services menu. */
static Lisp_Object Vmac_service_selection;
#endif
/* Get a reference to the selection corresponding to the symbol SYM.
The reference is set to *SEL, and it becomes NULL if there's no
corresponding selection. Clear the selection if CLEAR_P is
non-zero. */
static OSStatus
mac_get_selection_from_symbol (sym, clear_p, sel)
Lisp_Object sym;
int clear_p;
Selection *sel;
{
OSStatus err = noErr;
Lisp_Object str = Fget (sym, Qmac_scrap_name);
if (!STRINGP (str))
*sel = NULL;
else
{
#if TARGET_API_MAC_CARBON
#ifdef MAC_OSX
CFStringRef scrap_name = cfstring_create_with_string (str);
OptionBits options = (clear_p ? kScrapClearNamedScrap
: kScrapGetNamedScrap);
err = GetScrapByName (scrap_name, options, sel);
CFRelease (scrap_name);
#else /* !MAC_OSX */
if (clear_p)
err = ClearCurrentScrap ();
if (err == noErr)
err = GetCurrentScrap (sel);
#endif /* !MAC_OSX */
#else /* !TARGET_API_MAC_CARBON */
if (clear_p)
err = ZeroScrap ();
if (err == noErr)
*sel = 1;
#endif /* !TARGET_API_MAC_CARBON */
}
return err;
}
/* Get a scrap flavor type from the symbol SYM. Return 0 if no
corresponding flavor type. If SEL is non-zero, the return value is
non-zero only when the SEL has the flavor type. */
static ScrapFlavorType
get_flavor_type_from_symbol (sym, sel)
Lisp_Object sym;
Selection sel;
{
Lisp_Object str = Fget (sym, Qmac_ostype);
ScrapFlavorType flavor_type;
if (STRINGP (str) && SBYTES (str) == 4)
flavor_type = EndianU32_BtoN (*((UInt32 *) SDATA (str)));
else
flavor_type = 0;
if (flavor_type && sel)
{
#if TARGET_API_MAC_CARBON
OSStatus err;
ScrapFlavorFlags flags;
err = GetScrapFlavorFlags (sel, flavor_type, &flags);
if (err != noErr)
flavor_type = 0;
#else /* !TARGET_API_MAC_CARBON */
SInt32 size, offset;
size = GetScrap (NULL, flavor_type, &offset);
if (size < 0)
flavor_type = 0;
#endif /* !TARGET_API_MAC_CARBON */
}
return flavor_type;
}
/* Check if the symbol SYM has a corresponding selection target type. */
static int
mac_valid_selection_target_p (sym)
Lisp_Object sym;
{
return get_flavor_type_from_symbol (sym, 0) != 0;
}
/* Clear the selection whose reference is *SEL. */
static OSStatus
mac_clear_selection (sel)
Selection *sel;
{
#if TARGET_API_MAC_CARBON
#ifdef MAC_OSX
return ClearScrap (sel);
#else
OSStatus err;
err = ClearCurrentScrap ();
if (err == noErr)
err = GetCurrentScrap (sel);
return err;
#endif
#else /* !TARGET_API_MAC_CARBON */
return ZeroScrap ();
#endif /* !TARGET_API_MAC_CARBON */
}
/* Get ownership information for SEL. Emacs can detect a change of
the ownership by comparing saved and current values of the
ownership information. */
static Lisp_Object
mac_get_selection_ownership_info (sel)
Selection sel;
{
#if TARGET_API_MAC_CARBON
return long_to_cons ((unsigned long) sel);
#else /* !TARGET_API_MAC_CARBON */
ScrapStuffPtr scrap_info = InfoScrap ();
return make_number (scrap_info->scrapCount);
#endif /* !TARGET_API_MAC_CARBON */
}
/* Return non-zero if VALUE is a valid selection value for TARGET. */
static int
mac_valid_selection_value_p (value, target)
Lisp_Object value, target;
{
return STRINGP (value);
}
/* Put Lisp Object VALUE to the selection SEL. The target type is
specified by TARGET. */
static OSStatus
mac_put_selection_value (sel, target, value)
Selection sel;
Lisp_Object target, value;
{
ScrapFlavorType flavor_type = get_flavor_type_from_symbol (target, 0);
if (flavor_type == 0 || !STRINGP (value))
return noTypeErr;
#if TARGET_API_MAC_CARBON
return PutScrapFlavor (sel, flavor_type, kScrapFlavorMaskNone,
SBYTES (value), SDATA (value));
#else /* !TARGET_API_MAC_CARBON */
return PutScrap (SBYTES (value), flavor_type, SDATA (value));
#endif /* !TARGET_API_MAC_CARBON */
}
/* Check if data for the target type TARGET is available in SEL. */
static int
mac_selection_has_target_p (sel, target)
Selection sel;
Lisp_Object target;
{
return get_flavor_type_from_symbol (target, sel) != 0;
}
/* Get data for the target type TARGET from SEL and create a Lisp
string. Return nil if failed to get data. */
static Lisp_Object
mac_get_selection_value (sel, target)
Selection sel;
Lisp_Object target;
{
OSStatus err;
Lisp_Object result = Qnil;
ScrapFlavorType flavor_type = get_flavor_type_from_symbol (target, sel);
#if TARGET_API_MAC_CARBON
Size size;
if (flavor_type)
{
err = GetScrapFlavorSize (sel, flavor_type, &size);
if (err == noErr)
{
do
{
result = make_uninit_string (size);
err = GetScrapFlavorData (sel, flavor_type,
&size, SDATA (result));
if (err != noErr)
result = Qnil;
else if (size < SBYTES (result))
result = make_unibyte_string (SDATA (result), size);
}
while (STRINGP (result) && size > SBYTES (result));
}
}
#else
Handle handle;
SInt32 size, offset;
if (flavor_type)
size = GetScrap (NULL, flavor_type, &offset);
if (size >= 0)
{
handle = NewHandle (size);
HLock (handle);
size = GetScrap (handle, flavor_type, &offset);
if (size >= 0)
result = make_unibyte_string (*handle, size);
DisposeHandle (handle);
}
#endif
return result;
}
/* Get the list of target types in SEL. The return value is a list of
target type symbols possibly followed by scrap flavor type
strings. */
static Lisp_Object
mac_get_selection_target_list (sel)
Selection sel;
{
Lisp_Object result = Qnil, rest, target;
#if TARGET_API_MAC_CARBON
OSStatus err;
UInt32 count, i, type;
ScrapFlavorInfo *flavor_info = NULL;
Lisp_Object strings = Qnil;
err = GetScrapFlavorCount (sel, &count);
if (err == noErr)
flavor_info = xmalloc (sizeof (ScrapFlavorInfo) * count);
err = GetScrapFlavorInfoList (sel, &count, flavor_info);
if (err != noErr)
{
xfree (flavor_info);
flavor_info = NULL;
}
if (flavor_info == NULL)
count = 0;
#endif
for (rest = Vselection_converter_alist; CONSP (rest); rest = XCDR (rest))
{
ScrapFlavorType flavor_type = 0;
if (CONSP (XCAR (rest))
&& (target = XCAR (XCAR (rest)),
SYMBOLP (target))
&& (flavor_type = get_flavor_type_from_symbol (target, sel)))
{
result = Fcons (target, result);
#if TARGET_API_MAC_CARBON
for (i = 0; i < count; i++)
if (flavor_info[i].flavorType == flavor_type)
{
flavor_info[i].flavorType = 0;
break;
}
#endif
}
}
#if TARGET_API_MAC_CARBON
if (flavor_info)
{
for (i = 0; i < count; i++)
if (flavor_info[i].flavorType)
{
type = EndianU32_NtoB (flavor_info[i].flavorType);
strings = Fcons (make_unibyte_string ((char *) &type, 4), strings);
}
result = nconc2 (result, strings);
xfree (flavor_info);
}
#endif
return result;
}
/* Do protocol to assert ourself as a selection owner.
Update the Vselection_alist so that we can reply to later requests for
@ -892,8 +580,8 @@ and t is the same as `SECONDARY'. */)
Apple event support
***********************************************************************/
int mac_ready_for_apple_events = 0;
static Lisp_Object Vmac_apple_event_map;
static Lisp_Object Qmac_apple_event_class, Qmac_apple_event_id;
Lisp_Object Vmac_apple_event_map;
Lisp_Object Qmac_apple_event_class, Qmac_apple_event_id;
static Lisp_Object Qemacs_suspension_id;
extern Lisp_Object Qundefined;
extern void mac_store_apple_event P_ ((Lisp_Object, Lisp_Object,
@ -1095,7 +783,7 @@ mac_handle_apple_event_1 (class, id, apple_event, reply)
return err;
}
static pascal OSErr
pascal OSErr
mac_handle_apple_event (apple_event, reply, refcon)
const AppleEvent *apple_event;
AppleEvent *reply;
@ -1173,40 +861,13 @@ cleanup_suspended_apple_events (head, all_p)
return nresumed;
}
static void
void
cleanup_all_suspended_apple_events ()
{
cleanup_suspended_apple_events (&deferred_apple_events, 1);
cleanup_suspended_apple_events (&suspended_apple_events, 1);
}
void
init_apple_event_handler ()
{
OSErr err;
long result;
/* Make sure we have Apple events before starting. */
err = Gestalt (gestaltAppleEventsAttr, &result);
if (err != noErr)
abort ();
if (!(result & (1 << gestaltAppleEventsPresent)))
abort ();
err = AEInstallEventHandler (typeWildCard, typeWildCard,
#if TARGET_API_MAC_CARBON
NewAEEventHandlerUPP (mac_handle_apple_event),
#else
NewAEEventHandlerProc (mac_handle_apple_event),
#endif
0L, false);
if (err != noErr)
abort ();
atexit (cleanup_all_suspended_apple_events);
}
static UInt32
get_suspension_id (apple_event)
Lisp_Object apple_event;
@ -1399,419 +1060,18 @@ nil, which means the event is already resumed or expired. */)
Drag and drop support
***********************************************************************/
#if TARGET_API_MAC_CARBON
static Lisp_Object Vmac_dnd_known_types;
static pascal OSErr mac_do_track_drag P_ ((DragTrackingMessage, WindowRef,
void *, DragRef));
static pascal OSErr mac_do_receive_drag P_ ((WindowRef, void *, DragRef));
static DragTrackingHandlerUPP mac_do_track_dragUPP = NULL;
static DragReceiveHandlerUPP mac_do_receive_dragUPP = NULL;
extern void mac_store_drag_event P_ ((WindowRef, Point, SInt16,
const AEDesc *));
static pascal OSErr
mac_do_track_drag (message, window, refcon, drag)
DragTrackingMessage message;
WindowRef window;
void *refcon;
DragRef drag;
{
OSErr err = noErr;
static int can_accept;
UInt16 num_items, index;
if (GetFrontWindowOfClass (kMovableModalWindowClass, false))
return dragNotAcceptedErr;
switch (message)
{
case kDragTrackingEnterHandler:
err = CountDragItems (drag, &num_items);
if (err != noErr)
break;
can_accept = 0;
for (index = 1; index <= num_items; index++)
{
ItemReference item;
FlavorFlags flags;
Lisp_Object rest;
err = GetDragItemReferenceNumber (drag, index, &item);
if (err != noErr)
continue;
for (rest = Vmac_dnd_known_types; CONSP (rest); rest = XCDR (rest))
{
Lisp_Object str;
FlavorType type;
str = XCAR (rest);
if (!(STRINGP (str) && SBYTES (str) == 4))
continue;
type = EndianU32_BtoN (*((UInt32 *) SDATA (str)));
err = GetFlavorFlags (drag, item, type, &flags);
if (err == noErr)
{
can_accept = 1;
break;
}
}
}
break;
case kDragTrackingEnterWindow:
if (can_accept)
{
RgnHandle hilite_rgn = NewRgn ();
if (hilite_rgn)
{
Rect r;
GetWindowPortBounds (window, &r);
OffsetRect (&r, -r.left, -r.top);
RectRgn (hilite_rgn, &r);
ShowDragHilite (drag, hilite_rgn, true);
DisposeRgn (hilite_rgn);
}
SetThemeCursor (kThemeCopyArrowCursor);
}
break;
case kDragTrackingInWindow:
break;
case kDragTrackingLeaveWindow:
if (can_accept)
{
HideDragHilite (drag);
SetThemeCursor (kThemeArrowCursor);
}
break;
case kDragTrackingLeaveHandler:
break;
}
if (err != noErr)
return dragNotAcceptedErr;
return noErr;
}
static pascal OSErr
mac_do_receive_drag (window, refcon, drag)
WindowRef window;
void *refcon;
DragRef drag;
{
OSErr err;
int num_types, i;
Lisp_Object rest, str;
FlavorType *types;
AppleEvent apple_event;
Point mouse_pos;
SInt16 modifiers;
if (GetFrontWindowOfClass (kMovableModalWindowClass, false))
return dragNotAcceptedErr;
num_types = 0;
for (rest = Vmac_dnd_known_types; CONSP (rest); rest = XCDR (rest))
{
str = XCAR (rest);
if (STRINGP (str) && SBYTES (str) == 4)
num_types++;
}
types = xmalloc (sizeof (FlavorType) * num_types);
i = 0;
for (rest = Vmac_dnd_known_types; CONSP (rest); rest = XCDR (rest))
{
str = XCAR (rest);
if (STRINGP (str) && SBYTES (str) == 4)
types[i++] = EndianU32_BtoN (*((UInt32 *) SDATA (str)));
}
err = create_apple_event_from_drag_ref (drag, num_types, types,
&apple_event);
xfree (types);
if (err == noErr)
err = GetDragMouse (drag, &mouse_pos, NULL);
if (err == noErr)
{
GlobalToLocal (&mouse_pos);
err = GetDragModifiers (drag, NULL, NULL, &modifiers);
}
if (err == noErr)
{
UInt32 key_modifiers = modifiers;
err = AEPutParamPtr (&apple_event, kEventParamKeyModifiers,
typeUInt32, &key_modifiers, sizeof (UInt32));
}
if (err == noErr)
{
mac_store_drag_event (window, mouse_pos, 0, &apple_event);
AEDisposeDesc (&apple_event);
mac_wakeup_from_rne ();
return noErr;
}
else
return dragNotAcceptedErr;
}
Lisp_Object Vmac_dnd_known_types;
#endif /* TARGET_API_MAC_CARBON */
OSErr
install_drag_handler (window)
WindowRef window;
{
OSErr err = noErr;
#if TARGET_API_MAC_CARBON
if (mac_do_track_dragUPP == NULL)
mac_do_track_dragUPP = NewDragTrackingHandlerUPP (mac_do_track_drag);
if (mac_do_receive_dragUPP == NULL)
mac_do_receive_dragUPP = NewDragReceiveHandlerUPP (mac_do_receive_drag);
err = InstallTrackingHandler (mac_do_track_dragUPP, window, NULL);
if (err == noErr)
err = InstallReceiveHandler (mac_do_receive_dragUPP, window, NULL);
#endif
return err;
}
void
remove_drag_handler (window)
WindowRef window;
{
#if TARGET_API_MAC_CARBON
if (mac_do_track_dragUPP)
RemoveTrackingHandler (mac_do_track_dragUPP, window);
if (mac_do_receive_dragUPP)
RemoveReceiveHandler (mac_do_receive_dragUPP, window);
#endif
}
/***********************************************************************
Services menu support
***********************************************************************/
#ifdef MAC_OSX
OSStatus
install_service_handler ()
{
static const EventTypeSpec specs[] =
{{kEventClassService, kEventServiceGetTypes},
{kEventClassService, kEventServiceCopy},
{kEventClassService, kEventServicePaste},
{kEventClassService, kEventServicePerform}};
return InstallApplicationEventHandler (NewEventHandlerUPP
(mac_handle_service_event),
GetEventTypeCount (specs),
specs, NULL, NULL);
}
extern OSStatus mac_store_service_event P_ ((EventRef));
static OSStatus
copy_scrap_flavor_data (from_scrap, to_scrap, flavor_type)
ScrapRef from_scrap, to_scrap;
ScrapFlavorType flavor_type;
{
OSStatus err;
Size size, size_allocated;
char *buf = NULL;
err = GetScrapFlavorSize (from_scrap, flavor_type, &size);
if (err == noErr)
buf = xmalloc (size);
while (buf)
{
size_allocated = size;
err = GetScrapFlavorData (from_scrap, flavor_type, &size, buf);
if (err != noErr)
{
xfree (buf);
buf = NULL;
}
else if (size_allocated < size)
buf = xrealloc (buf, size);
else
break;
}
if (err == noErr)
{
if (buf == NULL)
err = memFullErr;
else
{
err = PutScrapFlavor (to_scrap, flavor_type, kScrapFlavorMaskNone,
size, buf);
xfree (buf);
}
}
return err;
}
static OSStatus
mac_handle_service_event (call_ref, event, data)
EventHandlerCallRef call_ref;
EventRef event;
void *data;
{
OSStatus err = noErr;
ScrapRef cur_scrap, specific_scrap;
UInt32 event_kind = GetEventKind (event);
CFMutableArrayRef copy_types, paste_types;
CFStringRef type;
Lisp_Object rest;
ScrapFlavorType flavor_type;
/* Check if Vmac_service_selection is a valid selection that has a
corresponding scrap. */
if (!SYMBOLP (Vmac_service_selection))
err = eventNotHandledErr;
else
err = mac_get_selection_from_symbol (Vmac_service_selection, 0, &cur_scrap);
if (!(err == noErr && cur_scrap))
return eventNotHandledErr;
switch (event_kind)
{
case kEventServiceGetTypes:
/* Set paste types. */
err = GetEventParameter (event, kEventParamServicePasteTypes,
typeCFMutableArrayRef, NULL,
sizeof (CFMutableArrayRef), NULL,
&paste_types);
if (err != noErr)
break;
for (rest = Vselection_converter_alist; CONSP (rest);
rest = XCDR (rest))
if (CONSP (XCAR (rest)) && SYMBOLP (XCAR (XCAR (rest)))
&& (flavor_type =
get_flavor_type_from_symbol (XCAR (XCAR (rest)), 0)))
{
type = CreateTypeStringWithOSType (flavor_type);
if (type)
{
CFArrayAppendValue (paste_types, type);
CFRelease (type);
}
}
/* Set copy types. */
err = GetEventParameter (event, kEventParamServiceCopyTypes,
typeCFMutableArrayRef, NULL,
sizeof (CFMutableArrayRef), NULL,
&copy_types);
if (err != noErr)
break;
if (NILP (Fx_selection_owner_p (Vmac_service_selection)))
break;
else
goto copy_all_flavors;
case kEventServiceCopy:
err = GetEventParameter (event, kEventParamScrapRef,
typeScrapRef, NULL,
sizeof (ScrapRef), NULL, &specific_scrap);
if (err != noErr
|| NILP (Fx_selection_owner_p (Vmac_service_selection)))
{
err = eventNotHandledErr;
break;
}
copy_all_flavors:
{
UInt32 count, i;
ScrapFlavorInfo *flavor_info = NULL;
ScrapFlavorFlags flags;
err = GetScrapFlavorCount (cur_scrap, &count);
if (err == noErr)
flavor_info = xmalloc (sizeof (ScrapFlavorInfo) * count);
err = GetScrapFlavorInfoList (cur_scrap, &count, flavor_info);
if (err != noErr)
{
xfree (flavor_info);
flavor_info = NULL;
}
if (flavor_info == NULL)
break;
for (i = 0; i < count; i++)
{
flavor_type = flavor_info[i].flavorType;
err = GetScrapFlavorFlags (cur_scrap, flavor_type, &flags);
if (err == noErr && !(flags & kScrapFlavorMaskSenderOnly))
{
if (event_kind == kEventServiceCopy)
err = copy_scrap_flavor_data (cur_scrap, specific_scrap,
flavor_type);
else /* event_kind == kEventServiceGetTypes */
{
type = CreateTypeStringWithOSType (flavor_type);
if (type)
{
CFArrayAppendValue (copy_types, type);
CFRelease (type);
}
}
}
}
xfree (flavor_info);
}
break;
case kEventServicePaste:
case kEventServicePerform:
{
int data_exists_p = 0;
err = GetEventParameter (event, kEventParamScrapRef, typeScrapRef,
NULL, sizeof (ScrapRef), NULL,
&specific_scrap);
if (err == noErr)
err = mac_clear_selection (&cur_scrap);
if (err == noErr)
for (rest = Vselection_converter_alist; CONSP (rest);
rest = XCDR (rest))
{
if (! (CONSP (XCAR (rest)) && SYMBOLP (XCAR (XCAR (rest)))))
continue;
flavor_type = get_flavor_type_from_symbol (XCAR (XCAR (rest)),
specific_scrap);
if (flavor_type == 0)
continue;
err = copy_scrap_flavor_data (specific_scrap, cur_scrap,
flavor_type);
if (err == noErr)
data_exists_p = 1;
}
if (!data_exists_p)
err = eventNotHandledErr;
else
err = mac_store_service_event (event);
}
break;
}
if (err != noErr)
err = eventNotHandledErr;
return err;
}
/* Selection name for communication via Services menu. */
Lisp_Object Vmac_service_selection;
#endif
void
syms_of_macselect ()
{
@ -1870,11 +1130,7 @@ set to nil. */);
DEFVAR_LISP ("mac-dnd-known-types", &Vmac_dnd_known_types,
doc: /* The types accepted by default for dropped data.
The types are chosen in the order they appear in the list. */);
Vmac_dnd_known_types = list4 (build_string ("hfs "), build_string ("utxt"),
build_string ("TEXT"), build_string ("TIFF"));
#ifdef MAC_OSX
Vmac_dnd_known_types = Fcons (build_string ("furl"), Vmac_dnd_known_types);
#endif
Vmac_dnd_known_types = mac_dnd_default_known_types ();
#endif
#ifdef MAC_OSX

View file

@ -376,12 +376,6 @@ typedef struct mac_output mac_output;
/* This is the 'font_info *' which frame F has. */
#define FRAME_MAC_FONT_TABLE(f) (FRAME_MAC_DISPLAY_INFO (f)->font_table)
/* The difference in pixels between the top left corner of the
Emacs window (including possible window manager decorations)
and FRAME_MAC_WINDOW (f). */
#define FRAME_OUTER_TO_INNER_DIFF_X(f) ((f)->x_pixels_diff)
#define FRAME_OUTER_TO_INNER_DIFF_Y(f) ((f)->y_pixels_diff)
/* Value is the smallest width of any character in any font on frame F. */
#define FRAME_SMALLEST_CHAR_WIDTH(F) \
@ -549,8 +543,8 @@ struct scroll_bar {
#define MAC_AQUA_SMALL_VERTICAL_SCROLL_BAR_WIDTH (11)
/* Size of hourglass controls */
#define HOURGLASS_WIDTH (16)
#define HOURGLASS_HEIGHT (16)
#define HOURGLASS_WIDTH (15)
#define HOURGLASS_HEIGHT (15)
/* Some constants that are used locally. */
/* Creator code for Emacs on Mac OS. */
@ -624,6 +618,8 @@ extern int XParseGeometry P_ ((char *, int *, int *, unsigned int *,
extern void x_set_window_size P_ ((struct frame *, int, int, int));
extern void x_set_mouse_position P_ ((struct frame *, int, int));
extern void x_set_mouse_pixel_position P_ ((struct frame *, int, int));
extern void x_raise_frame P_ ((struct frame *));
extern void x_lower_frame P_ ((struct frame *));
extern void x_make_frame_visible P_ ((struct frame *));
extern void x_make_frame_invisible P_ ((struct frame *));
extern void x_iconify_frame P_ ((struct frame *));
@ -643,29 +639,12 @@ extern GC XCreateGC P_ ((Display *, void *, unsigned long, XGCValues *));
extern void XFreeGC P_ ((Display *, GC));
extern void XSetForeground P_ ((Display *, GC, unsigned long));
extern void XSetBackground P_ ((Display *, GC, unsigned long));
extern void XSetWindowBackground P_ ((Display *, WindowRef, unsigned long));
extern void XDrawLine P_ ((Display *, Pixmap, GC, int, int, int, int));
extern void mac_clear_area P_ ((struct frame *, int, int,
unsigned int, unsigned int));
extern void mac_unload_font P_ ((struct mac_display_info *, XFontStruct *));
extern int mac_font_panel_visible_p P_ ((void));
extern OSStatus mac_show_hide_font_panel P_ ((void));
extern OSStatus mac_set_font_info_for_selection P_ ((struct frame *, int, int));
extern OSStatus install_window_handler P_ ((WindowRef));
extern void remove_window_handler P_ ((WindowRef));
extern OSStatus mac_post_mouse_moved_event P_ ((void));
#if !TARGET_API_MAC_CARBON
extern void do_apple_menu P_ ((SInt16));
#endif
#if USE_CG_DRAWING
extern void mac_prepare_for_quickdraw P_ ((struct frame *));
#endif
extern void mac_get_window_bounds P_ ((struct frame *, Rect *, Rect *));
extern int mac_quit_char_key_p P_ ((UInt32, UInt32));
#if USE_MAC_TOOLBAR
extern void update_frame_tool_bar P_ ((FRAME_PTR f));
extern void free_frame_tool_bar P_ ((FRAME_PTR f));
#endif
#define FONT_TYPE_FOR_UNIBYTE(font, ch) 0
#define FONT_TYPE_FOR_MULTIBYTE(font, ch) 0
@ -673,6 +652,7 @@ extern void free_frame_tool_bar P_ ((FRAME_PTR f));
/* Defined in macselect.c */
extern void x_clear_frame_selections P_ ((struct frame *));
EXFUN (Fx_selection_owner_p, 1);
/* Defined in macfns.c */
@ -687,11 +667,6 @@ extern void x_set_tool_bar_lines P_ ((struct frame *, Lisp_Object, Lisp_Object))
extern void mac_update_title_bar P_ ((struct frame *, int));
extern Lisp_Object x_get_focus_frame P_ ((struct frame *));
/* Defined in macmenu.c */
extern void x_activate_menubar P_ ((struct frame *));
extern void free_frame_menubar P_ ((struct frame *));
/* Defined in mac.c. */
extern void mac_clear_font_name_table P_ ((void));
@ -723,5 +698,86 @@ extern Lisp_Object xrm_get_resource P_ ((XrmDatabase, const char *,
extern XrmDatabase xrm_get_preference_database P_ ((const char *));
EXFUN (Fmac_get_preference, 4);
/* Defined in mactoolbox.c. */
extern void mac_alert_sound_play P_ ((void));
extern OSStatus install_application_handler P_ ((void));
extern void mac_get_window_bounds P_ ((struct frame *, Rect *, Rect *));
extern Rect *mac_get_frame_bounds P_ ((struct frame *, Rect *));
extern void mac_get_frame_mouse P_ ((struct frame *, Point *));
extern void mac_convert_frame_point_to_global P_ ((struct frame *, int *,
int *));
#if TARGET_API_MAC_CARBON
extern void mac_update_proxy_icon P_ ((struct frame *));
#endif
extern void mac_set_frame_window_background P_ ((struct frame *,
unsigned long));
extern void mac_update_begin P_ ((struct frame *));
extern void mac_update_end P_ ((struct frame *));
extern void mac_frame_up_to_date P_ ((struct frame *));
extern void x_flush P_ ((struct frame *));
extern void mac_create_frame_window P_ ((struct frame *, int));
extern void mac_dispose_frame_window P_ ((struct frame *));
#if USE_CG_DRAWING
extern CGContextRef mac_begin_cg_clip P_ ((struct frame *, GC));
extern void mac_end_cg_clip P_ ((struct frame *));
#endif
extern void mac_begin_clip P_ ((struct frame *, GC));
extern void mac_end_clip P_ ((struct frame *, GC));
extern void mac_create_scroll_bar P_ ((struct scroll_bar *, const Rect *,
Boolean));
extern void mac_dispose_scroll_bar P_ ((struct scroll_bar *));
extern void mac_set_scroll_bar_bounds P_ ((struct scroll_bar *, const Rect *));
extern void mac_redraw_scroll_bar P_ ((struct scroll_bar *));
#ifdef USE_TOOLKIT_SCROLL_BARS
extern void x_set_toolkit_scroll_bar_thumb P_ ((struct scroll_bar *,
int, int, int));
#else
extern void x_scroll_bar_set_handle P_ ((scroll_bar *, int, int, int));
#endif
#if USE_MAC_FONT_PANEL
extern int mac_font_panel_visible_p P_ ((void));
extern OSStatus mac_show_hide_font_panel P_ ((void));
extern OSStatus mac_set_font_info_for_selection P_ ((struct frame *, int, int));
#endif
#ifdef MAC_OSX
extern Boolean mac_run_loop_run_once P_ ((EventTimeout));
#endif
#if USE_MAC_TOOLBAR
extern void update_frame_tool_bar P_ ((FRAME_PTR f));
extern void free_frame_tool_bar P_ ((FRAME_PTR f));
#endif
#if TARGET_API_MAC_CARBON
extern void mac_show_hourglass P_ ((struct frame *));
extern void mac_hide_hourglass P_ ((struct frame *));
extern void mac_reposition_hourglass P_ ((struct frame *));
extern Lisp_Object mac_file_dialog P_ ((Lisp_Object, Lisp_Object, Lisp_Object,
Lisp_Object, Lisp_Object));
#endif
extern void x_activate_menubar P_ ((struct frame *));
extern void free_frame_menubar P_ ((struct frame *));
extern void mac_fill_menubar P_ ((widget_value *, int));
extern void create_and_show_popup_menu P_ ((FRAME_PTR, widget_value *,
int, int, int));
#if TARGET_API_MAC_CARBON
extern void create_and_show_dialog P_ ((FRAME_PTR, widget_value *));
#else
extern int mac_dialog P_ ((widget_value *));
#endif
extern OSStatus mac_get_selection_from_symbol P_ ((Lisp_Object, int,
Selection *));
extern int mac_valid_selection_target_p P_ ((Lisp_Object));
extern OSStatus mac_clear_selection P_ ((Selection *));
extern Lisp_Object mac_get_selection_ownership_info P_ ((Selection));
extern int mac_valid_selection_value_p P_ ((Lisp_Object, Lisp_Object));
extern OSStatus mac_put_selection_value P_ ((Selection, Lisp_Object,
Lisp_Object));
extern int mac_selection_has_target_p P_ ((Selection, Lisp_Object));
extern Lisp_Object mac_get_selection_value P_ ((Selection, Lisp_Object));
extern Lisp_Object mac_get_selection_target_list P_ ((Selection));
#if TARGET_API_MAC_CARBON
extern Lisp_Object mac_dnd_default_known_types P_ ((void));
#endif
/* arch-tag: 6b4ca125-5bef-476d-8ee8-31ed808b7e79
(do not change this comment) */

6211
src/mactoolbox.c Normal file

File diff suppressed because it is too large Load diff