changeset 75200:659905f1c3a4

(x_free_frame_resources) [USE_CG_DRAWING]: Call mac_prepare_for_quickdraw. (quit_char, make_ctrl_char) [TARGET_API_MAC_CARBON]: Move externs outside #ifdef MAC_OSX. (mac_quit_char_key_p) [TARGET_API_MAC_CARBON]: Move function outside #ifdef MAC_OSX. (mac_check_bundle) [MAC_OSX]: Remove unused function.
author YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
date Fri, 12 Jan 2007 09:00:24 +0000
parents 6f528fee9d6d
children 7303ce23430c
files src/macterm.c
diffstat 1 files changed, 35 insertions(+), 59 deletions(-) [+]
line wrap: on
line diff
--- a/src/macterm.c	Fri Jan 12 09:00:16 2007 +0000
+++ b/src/macterm.c	Fri Jan 12 09:00:24 2007 +0000
@@ -6572,6 +6572,9 @@
   if (wp != tip_window)
     remove_window_handler (wp);
 
+#if USE_CG_DRAWING
+  mac_prepare_for_quickdraw (f);
+#endif
   DisposeWindow (wp);
   if (wp == tip_window)
     /* Neither WaitNextEvent nor ReceiveNextEvent receives `window
@@ -9052,6 +9055,38 @@
   return result;
 }
 
+#if TARGET_API_MAC_CARBON
+/***** Code to handle C-g testing  *****/
+extern int quit_char;
+extern int make_ctrl_char P_ ((int));
+
+int
+mac_quit_char_key_p (modifiers, key_code)
+     UInt32 modifiers, key_code;
+{
+  UInt32 char_code;
+  unsigned long some_state = 0;
+  Ptr kchr_ptr = (Ptr) GetScriptManagerVariable (smKCHRCache);
+  int c, emacs_modifiers;
+
+  /* Mask off modifier keys that are mapped to some Emacs modifiers.  */
+  key_code |= (modifiers & ~(mac_mapped_modifiers (modifiers)));
+  char_code = KeyTranslate (kchr_ptr, key_code, &some_state);
+  if (char_code & ~0xff)
+    return 0;
+
+  emacs_modifiers = mac_to_emacs_modifiers (modifiers);
+  if (emacs_modifiers & ctrl_modifier)
+    c = make_ctrl_char (char_code);
+
+  c |= (emacs_modifiers
+	& (meta_modifier | alt_modifier
+	   | hyper_modifier | super_modifier));
+
+  return c == quit_char;
+}
+#endif
+
 #if USE_CARBON_EVENTS
 /* Obtains the event modifiers from the event ref and then calls
    mac_to_emacs_modifiers.  */
@@ -11607,35 +11642,6 @@
 
 #ifdef MAC_OSX
 void
-mac_check_bundle()
-{
-  extern int inhibit_window_system;
-  extern int noninteractive;
-  CFBundleRef appsBundle;
-
-  /* No need to test if already -nw*/
-  if (inhibit_window_system || noninteractive)
-    return;
-
-  appsBundle = CFBundleGetMainBundle();
-  if (appsBundle != NULL)
-    {
-      CFStringRef cfBI = CFSTR("CFBundleIdentifier");
-      CFTypeRef res = CFBundleGetValueForInfoDictionaryKey(appsBundle, cfBI);
-      /* We found the bundle identifier, now we know we are valid. */
-      if (res != NULL)
-	{
-	  CFRelease(res);
-	  return;
-	}
-    }
-  /* MAC_TODO:  Have this start the bundled executable */
-
-  /* For now, prevent the fatal error by bringing it up in the terminal */
-  inhibit_window_system = 1;
-}
-
-void
 MakeMeTheFrontProcess ()
 {
   ProcessSerialNumber psn;
@@ -11645,36 +11651,6 @@
   if (err == noErr)
     (void) SetFrontProcess (&psn);
 }
-
-/***** Code to handle C-g testing  *****/
-extern int quit_char;
-extern int make_ctrl_char P_ ((int));
-
-int
-mac_quit_char_key_p (modifiers, key_code)
-     UInt32 modifiers, key_code;
-{
-  UInt32 char_code;
-  unsigned long some_state = 0;
-  Ptr kchr_ptr = (Ptr) GetScriptManagerVariable (smKCHRCache);
-  int c, emacs_modifiers;
-
-  /* Mask off modifier keys that are mapped to some Emacs modifiers.  */
-  key_code |= (modifiers & ~(mac_mapped_modifiers (modifiers)));
-  char_code = KeyTranslate (kchr_ptr, key_code, &some_state);
-  if (char_code & ~0xff)
-    return 0;
-
-  emacs_modifiers = mac_to_emacs_modifiers (modifiers);
-  if (emacs_modifiers & ctrl_modifier)
-    c = make_ctrl_char (char_code);
-
-  c |= (emacs_modifiers
-	& (meta_modifier | alt_modifier
-	   | hyper_modifier | super_modifier));
-
-  return c == quit_char;
-}
 #endif	/* MAC_OSX */
 
 static void