aboutsummaryrefslogtreecommitdiffstats
path: root/src/macterm.c
diff options
context:
space:
mode:
authorKaroly Lorentey2007-01-29 22:21:19 +0000
committerKaroly Lorentey2007-01-29 22:21:19 +0000
commit93afd0f1d463bec0fc8d3127c1d34ccaa4dbe99b (patch)
tree6e4e3bec20b8c65eb1f78b0ad302fa6c1977d355 /src/macterm.c
parent38db5c8d522cc1faa8190e77dbc932a5560e6aad (diff)
parent5c4a60523827062803ab9a55b4325358225d66bf (diff)
downloademacs-93afd0f1d463bec0fc8d3127c1d34ccaa4dbe99b.tar.gz
emacs-93afd0f1d463bec0fc8d3127c1d34ccaa4dbe99b.zip
Merged from emacs@sv.gnu.org
Patches applied: * emacs@sv.gnu.org/emacs--devo--0--patch-599 Merge from erc--main--0 * emacs@sv.gnu.org/emacs--devo--0--patch-600 Merge from erc--main--0 * emacs@sv.gnu.org/emacs--devo--0--patch-601 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-602 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-603 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-604 Merge from gnus--rel--5.10 * emacs@sv.gnu.org/emacs--devo--0--patch-605 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-606 Merge from gnus--rel--5.10 * emacs@sv.gnu.org/emacs--devo--0--patch-607 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-608 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-609 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-610 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-611 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-612 Merge from gnus--rel--5.10 * emacs@sv.gnu.org/emacs--devo--0--patch-613 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-614 Make byte compiler correctly write circular constants * emacs@sv.gnu.org/emacs--devo--0--patch-615 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-616 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-617 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-618 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-192 Merge from emacs--devo--0 * emacs@sv.gnu.org/gnus--rel--5.10--patch-193 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-194 Merge from emacs--devo--0 * emacs@sv.gnu.org/gnus--rel--5.10--patch-195 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-196 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-594
Diffstat (limited to 'src/macterm.c')
-rw-r--r--src/macterm.c96
1 files changed, 36 insertions, 60 deletions
diff --git a/src/macterm.c b/src/macterm.c
index 1706da48cc3..8ba62f2308f 100644
--- a/src/macterm.c
+++ b/src/macterm.c
@@ -1,6 +1,6 @@
1/* Implementation of GUI terminal on the Mac OS. 1/* Implementation of GUI terminal on the Mac OS.
2 Copyright (C) 2000, 2001, 2002, 2003, 2004, 2 Copyright (C) 2000, 2001, 2002, 2003, 2004,
3 2005, 2006 Free Software Foundation, Inc. 3 2005, 2006, 2007 Free Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
6 6
@@ -6572,6 +6572,9 @@ x_free_frame_resources (f)
6572 if (wp != tip_window) 6572 if (wp != tip_window)
6573 remove_window_handler (wp); 6573 remove_window_handler (wp);
6574 6574
6575#if USE_CG_DRAWING
6576 mac_prepare_for_quickdraw (f);
6577#endif
6575 DisposeWindow (wp); 6578 DisposeWindow (wp);
6576 if (wp == tip_window) 6579 if (wp == tip_window)
6577 /* Neither WaitNextEvent nor ReceiveNextEvent receives `window 6580 /* Neither WaitNextEvent nor ReceiveNextEvent receives `window
@@ -9052,6 +9055,38 @@ mac_get_emulated_btn ( UInt32 modifiers )
9052 return result; 9055 return result;
9053} 9056}
9054 9057
9058#if TARGET_API_MAC_CARBON
9059/***** Code to handle C-g testing *****/
9060extern int quit_char;
9061extern int make_ctrl_char P_ ((int));
9062
9063int
9064mac_quit_char_key_p (modifiers, key_code)
9065 UInt32 modifiers, key_code;
9066{
9067 UInt32 char_code;
9068 unsigned long some_state = 0;
9069 Ptr kchr_ptr = (Ptr) GetScriptManagerVariable (smKCHRCache);
9070 int c, emacs_modifiers;
9071
9072 /* Mask off modifier keys that are mapped to some Emacs modifiers. */
9073 key_code |= (modifiers & ~(mac_mapped_modifiers (modifiers)));
9074 char_code = KeyTranslate (kchr_ptr, key_code, &some_state);
9075 if (char_code & ~0xff)
9076 return 0;
9077
9078 emacs_modifiers = mac_to_emacs_modifiers (modifiers);
9079 if (emacs_modifiers & ctrl_modifier)
9080 c = make_ctrl_char (char_code);
9081
9082 c |= (emacs_modifiers
9083 & (meta_modifier | alt_modifier
9084 | hyper_modifier | super_modifier));
9085
9086 return c == quit_char;
9087}
9088#endif
9089
9055#if USE_CARBON_EVENTS 9090#if USE_CARBON_EVENTS
9056/* Obtains the event modifiers from the event ref and then calls 9091/* Obtains the event modifiers from the event ref and then calls
9057 mac_to_emacs_modifiers. */ 9092 mac_to_emacs_modifiers. */
@@ -11607,35 +11642,6 @@ x_delete_display (dpyinfo)
11607 11642
11608#ifdef MAC_OSX 11643#ifdef MAC_OSX
11609void 11644void
11610mac_check_bundle()
11611{
11612 extern int inhibit_window_system;
11613 extern int noninteractive;
11614 CFBundleRef appsBundle;
11615
11616 /* No need to test if already -nw*/
11617 if (inhibit_window_system || noninteractive)
11618 return;
11619
11620 appsBundle = CFBundleGetMainBundle();
11621 if (appsBundle != NULL)
11622 {
11623 CFStringRef cfBI = CFSTR("CFBundleIdentifier");
11624 CFTypeRef res = CFBundleGetValueForInfoDictionaryKey(appsBundle, cfBI);
11625 /* We found the bundle identifier, now we know we are valid. */
11626 if (res != NULL)
11627 {
11628 CFRelease(res);
11629 return;
11630 }
11631 }
11632 /* MAC_TODO: Have this start the bundled executable */
11633
11634 /* For now, prevent the fatal error by bringing it up in the terminal */
11635 inhibit_window_system = 1;
11636}
11637
11638void
11639MakeMeTheFrontProcess () 11645MakeMeTheFrontProcess ()
11640{ 11646{
11641 ProcessSerialNumber psn; 11647 ProcessSerialNumber psn;
@@ -11645,36 +11651,6 @@ MakeMeTheFrontProcess ()
11645 if (err == noErr) 11651 if (err == noErr)
11646 (void) SetFrontProcess (&psn); 11652 (void) SetFrontProcess (&psn);
11647} 11653}
11648
11649/***** Code to handle C-g testing *****/
11650extern int quit_char;
11651extern int make_ctrl_char P_ ((int));
11652
11653int
11654mac_quit_char_key_p (modifiers, key_code)
11655 UInt32 modifiers, key_code;
11656{
11657 UInt32 char_code;
11658 unsigned long some_state = 0;
11659 Ptr kchr_ptr = (Ptr) GetScriptManagerVariable (smKCHRCache);
11660 int c, emacs_modifiers;
11661
11662 /* Mask off modifier keys that are mapped to some Emacs modifiers. */
11663 key_code |= (modifiers & ~(mac_mapped_modifiers (modifiers)));
11664 char_code = KeyTranslate (kchr_ptr, key_code, &some_state);
11665 if (char_code & ~0xff)
11666 return 0;
11667
11668 emacs_modifiers = mac_to_emacs_modifiers (modifiers);
11669 if (emacs_modifiers & ctrl_modifier)
11670 c = make_ctrl_char (char_code);
11671
11672 c |= (emacs_modifiers
11673 & (meta_modifier | alt_modifier
11674 | hyper_modifier | super_modifier));
11675
11676 return c == quit_char;
11677}
11678#endif /* MAC_OSX */ 11654#endif /* MAC_OSX */
11679 11655
11680static void 11656static void