changeset 72545:171c891be45d

(mac_draw_string_common, mac_query_char_extents) (x_iconify_frame, XLoadQueryFont, install_window_handler) (mac_handle_command_event, init_command_handler, init_menu_bar): Use OSStatus instead of OSErr. (x_free_frame_resources) [TARGET_API_MAC_CARBON]: Don't use FRAME_FILE_NAME. (x_query_font): Apply 2006-08-04 change for xterm.c. (Qhi_command): Rename from Qhicommand. All uses changed.
author YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
date Sun, 27 Aug 2006 07:09:52 +0000
parents f8ade754466c
children 5786b9967afa
files src/macterm.c
diffstat 1 files changed, 20 insertions(+), 25 deletions(-) [+]
line wrap: on
line diff
--- a/src/macterm.c	Sun Aug 27 07:09:41 2006 +0000
+++ b/src/macterm.c	Sun Aug 27 07:09:52 2006 +0000
@@ -902,7 +902,7 @@
 #if USE_ATSUI
   if (GC_FONT (gc)->mac_style)
     {
-      OSErr err;
+      OSStatus err;
       ATSUTextLayout text_layout;
 
       xassert (bytes_per_char == 2);
@@ -1129,7 +1129,7 @@
    the font of the current graphics port.  If CG_GLYPH is not NULL,
    *CG_GLYPH is set to the glyph ID or 0 if it cannot be obtained.  */
 
-static OSErr
+static OSStatus
 mac_query_char_extents (style, c,
 			font_ascent_return, font_descent_return,
 			overall_return, cg_glyph)
@@ -1147,7 +1147,7 @@
      void *cg_glyph;
 #endif
 {
-  OSErr err = noErr;
+  OSStatus err = noErr;
   int width;
   Rect char_bounds;
 
@@ -1193,7 +1193,7 @@
 #if USE_CG_TEXT_DRAWING
 	  if (err == noErr && cg_glyph)
 	    {
-	      OSErr err1;
+	      OSStatus err1;
 	      ATSUGlyphInfoArray glyph_info_array;
 	      ByteCount count = sizeof (ATSUGlyphInfoArray);
 
@@ -6314,7 +6314,7 @@
 x_iconify_frame (f)
      struct frame *f;
 {
-  OSErr err;
+  OSStatus err;
 
   /* A deactivate event does not occur when the last visible frame is
      iconified.  So if we clear the highlight here, it will not be
@@ -6378,11 +6378,6 @@
   if (FRAME_SIZE_HINTS (f))
     xfree (FRAME_SIZE_HINTS (f));
 
-#if TARGET_API_MAC_CARBON
-  if (FRAME_FILE_NAME (f))
-    xfree (FRAME_FILE_NAME (f));
-#endif
-
   xfree (f->output_data.mac);
   f->output_data.mac = NULL;
 
@@ -7200,7 +7195,7 @@
   if (!NILP (assq_no_quit (make_number (kTextEncodingMacUnicode),
 			   text_encoding_info_alist)))
     {
-      OSErr err;
+      OSStatus err;
       struct Lisp_Hash_Table *h;
       unsigned hash_code;
       ItemCount nfonts, i;
@@ -7782,7 +7777,7 @@
 #if USE_ATSUI
   if (strcmp (charset, "iso10646-1") == 0) /* XXX */
     {
-      OSErr err;
+      OSStatus err;
       ATSUAttributeTag tags[] = {kATSUFontTag, kATSUSizeTag,
 				 kATSUQDBoldfaceTag, kATSUQDItalicTag};
       ByteCount sizes[] = {sizeof (ATSUFontID), sizeof (Fixed),
@@ -7865,7 +7860,7 @@
 #if USE_ATSUI
   if (font->mac_style)
     {
-      OSErr err;
+      OSStatus err;
       UniChar c;
 
       font->min_byte1 = 0;
@@ -8344,8 +8339,8 @@
 
   for (i = 0; i < dpyinfo->n_fonts; i++)
     if (dpyinfo->font_table[i].name
-	&& (!strcmp (dpyinfo->font_table[i].name, fontname)
-	    || !strcmp (dpyinfo->font_table[i].full_name, fontname)))
+	&& (!xstricmp (dpyinfo->font_table[i].name, fontname)
+	    || !xstricmp (dpyinfo->font_table[i].full_name, fontname)))
       return (dpyinfo->font_table + i);
   return NULL;
 }
@@ -8539,7 +8534,7 @@
 
 /* Apple Events */
 #if USE_CARBON_EVENTS
-static Lisp_Object Qhicommand;
+static Lisp_Object Qhi_command;
 #ifdef MAC_OSX
 extern Lisp_Object Qwindow;
 static Lisp_Object Qtoolbar_switch_mode;
@@ -8581,7 +8576,7 @@
 static pascal OSStatus mac_handle_window_event (EventHandlerCallRef,
 						EventRef, void *);
 #endif
-OSErr install_window_handler (WindowPtr);
+OSStatus install_window_handler (WindowPtr);
 
 extern void init_emacs_passwd_dir ();
 extern int emacs_main (int, char **, char **);
@@ -9382,15 +9377,15 @@
   if (err != noErr || command.commandID == 0)
     return eventNotHandledErr;
 
-  /* A HICommand event is mapped to an Apple event whose event class
-     symbol is `hicommand' and event ID is its command ID.  */
+  /* A HI command event is mapped to an Apple event whose event class
+     symbol is `hi-command' and event ID is its command ID.  */
   err = mac_store_event_ref_as_apple_event (0, command.commandID,
-					    Qhicommand, Qnil,
+					    Qhi_command, Qnil,
 					    event, num_params, names, types);
   return err == noErr ? noErr : eventNotHandledErr;
 }
 
-static OSErr
+static OSStatus
 init_command_handler ()
 {
   EventTypeSpec specs[] = {{kEventClassCommand, kEventCommandProcess}};
@@ -9891,11 +9886,11 @@
 #endif	/* USE_CARBON_EVENTS */
 
 
-OSErr
+OSStatus
 install_window_handler (window)
      WindowPtr window;
 {
-  OSErr err = noErr;
+  OSStatus err = noErr;
 #if USE_CARBON_EVENTS
   EventTypeSpec specs_window[] =
     {{kEventClassWindow, kEventWindowUpdate},
@@ -11329,7 +11324,7 @@
 init_menu_bar ()
 {
 #ifdef MAC_OSX
-  OSErr err;
+  OSStatus err;
   MenuRef menu;
   MenuItemIndex menu_index;
 
@@ -11512,7 +11507,7 @@
   Fput (Qsuper,   Qmodifier_value, make_number (super_modifier));
 
 #if USE_CARBON_EVENTS
-  Qhicommand   = intern ("hicommand");    staticpro (&Qhicommand);
+  Qhi_command   = intern ("hi-command");    staticpro (&Qhi_command);
 #ifdef MAC_OSX
   Qtoolbar_switch_mode = intern ("toolbar-switch-mode");
   staticpro (&Qtoolbar_switch_mode);