aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorYAMAMOTO Mitsuharu2006-08-27 07:09:52 +0000
committerYAMAMOTO Mitsuharu2006-08-27 07:09:52 +0000
commit3e7424f76a790845e4972f77e936264d631cb706 (patch)
tree7a6fa78f4f3af86f1fc5475fc1ec6c1637ced43b /src
parent31f93085857c71413081acc06c4254cb1fca647f (diff)
downloademacs-3e7424f76a790845e4972f77e936264d631cb706.tar.gz
emacs-3e7424f76a790845e4972f77e936264d631cb706.zip
(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.
Diffstat (limited to 'src')
-rw-r--r--src/macterm.c45
1 files changed, 20 insertions, 25 deletions
diff --git a/src/macterm.c b/src/macterm.c
index 04b55d9fa80..a5369eb1667 100644
--- a/src/macterm.c
+++ b/src/macterm.c
@@ -902,7 +902,7 @@ mac_draw_string_common (f, gc, x, y, buf, nchars, bg_width, bytes_per_char)
902#if USE_ATSUI 902#if USE_ATSUI
903 if (GC_FONT (gc)->mac_style) 903 if (GC_FONT (gc)->mac_style)
904 { 904 {
905 OSErr err; 905 OSStatus err;
906 ATSUTextLayout text_layout; 906 ATSUTextLayout text_layout;
907 907
908 xassert (bytes_per_char == 2); 908 xassert (bytes_per_char == 2);
@@ -1129,7 +1129,7 @@ mac_draw_image_string_16 (f, gc, x, y, buf, nchars, bg_width)
1129 the font of the current graphics port. If CG_GLYPH is not NULL, 1129 the font of the current graphics port. If CG_GLYPH is not NULL,
1130 *CG_GLYPH is set to the glyph ID or 0 if it cannot be obtained. */ 1130 *CG_GLYPH is set to the glyph ID or 0 if it cannot be obtained. */
1131 1131
1132static OSErr 1132static OSStatus
1133mac_query_char_extents (style, c, 1133mac_query_char_extents (style, c,
1134 font_ascent_return, font_descent_return, 1134 font_ascent_return, font_descent_return,
1135 overall_return, cg_glyph) 1135 overall_return, cg_glyph)
@@ -1147,7 +1147,7 @@ mac_query_char_extents (style, c,
1147 void *cg_glyph; 1147 void *cg_glyph;
1148#endif 1148#endif
1149{ 1149{
1150 OSErr err = noErr; 1150 OSStatus err = noErr;
1151 int width; 1151 int width;
1152 Rect char_bounds; 1152 Rect char_bounds;
1153 1153
@@ -1193,7 +1193,7 @@ mac_query_char_extents (style, c,
1193#if USE_CG_TEXT_DRAWING 1193#if USE_CG_TEXT_DRAWING
1194 if (err == noErr && cg_glyph) 1194 if (err == noErr && cg_glyph)
1195 { 1195 {
1196 OSErr err1; 1196 OSStatus err1;
1197 ATSUGlyphInfoArray glyph_info_array; 1197 ATSUGlyphInfoArray glyph_info_array;
1198 ByteCount count = sizeof (ATSUGlyphInfoArray); 1198 ByteCount count = sizeof (ATSUGlyphInfoArray);
1199 1199
@@ -6314,7 +6314,7 @@ void
6314x_iconify_frame (f) 6314x_iconify_frame (f)
6315 struct frame *f; 6315 struct frame *f;
6316{ 6316{
6317 OSErr err; 6317 OSStatus err;
6318 6318
6319 /* A deactivate event does not occur when the last visible frame is 6319 /* A deactivate event does not occur when the last visible frame is
6320 iconified. So if we clear the highlight here, it will not be 6320 iconified. So if we clear the highlight here, it will not be
@@ -6378,11 +6378,6 @@ x_free_frame_resources (f)
6378 if (FRAME_SIZE_HINTS (f)) 6378 if (FRAME_SIZE_HINTS (f))
6379 xfree (FRAME_SIZE_HINTS (f)); 6379 xfree (FRAME_SIZE_HINTS (f));
6380 6380
6381#if TARGET_API_MAC_CARBON
6382 if (FRAME_FILE_NAME (f))
6383 xfree (FRAME_FILE_NAME (f));
6384#endif
6385
6386 xfree (f->output_data.mac); 6381 xfree (f->output_data.mac);
6387 f->output_data.mac = NULL; 6382 f->output_data.mac = NULL;
6388 6383
@@ -7200,7 +7195,7 @@ init_font_name_table ()
7200 if (!NILP (assq_no_quit (make_number (kTextEncodingMacUnicode), 7195 if (!NILP (assq_no_quit (make_number (kTextEncodingMacUnicode),
7201 text_encoding_info_alist))) 7196 text_encoding_info_alist)))
7202 { 7197 {
7203 OSErr err; 7198 OSStatus err;
7204 struct Lisp_Hash_Table *h; 7199 struct Lisp_Hash_Table *h;
7205 unsigned hash_code; 7200 unsigned hash_code;
7206 ItemCount nfonts, i; 7201 ItemCount nfonts, i;
@@ -7782,7 +7777,7 @@ XLoadQueryFont (Display *dpy, char *fontname)
7782#if USE_ATSUI 7777#if USE_ATSUI
7783 if (strcmp (charset, "iso10646-1") == 0) /* XXX */ 7778 if (strcmp (charset, "iso10646-1") == 0) /* XXX */
7784 { 7779 {
7785 OSErr err; 7780 OSStatus err;
7786 ATSUAttributeTag tags[] = {kATSUFontTag, kATSUSizeTag, 7781 ATSUAttributeTag tags[] = {kATSUFontTag, kATSUSizeTag,
7787 kATSUQDBoldfaceTag, kATSUQDItalicTag}; 7782 kATSUQDBoldfaceTag, kATSUQDItalicTag};
7788 ByteCount sizes[] = {sizeof (ATSUFontID), sizeof (Fixed), 7783 ByteCount sizes[] = {sizeof (ATSUFontID), sizeof (Fixed),
@@ -7865,7 +7860,7 @@ XLoadQueryFont (Display *dpy, char *fontname)
7865#if USE_ATSUI 7860#if USE_ATSUI
7866 if (font->mac_style) 7861 if (font->mac_style)
7867 { 7862 {
7868 OSErr err; 7863 OSStatus err;
7869 UniChar c; 7864 UniChar c;
7870 7865
7871 font->min_byte1 = 0; 7866 font->min_byte1 = 0;
@@ -8344,8 +8339,8 @@ x_query_font (f, fontname)
8344 8339
8345 for (i = 0; i < dpyinfo->n_fonts; i++) 8340 for (i = 0; i < dpyinfo->n_fonts; i++)
8346 if (dpyinfo->font_table[i].name 8341 if (dpyinfo->font_table[i].name
8347 && (!strcmp (dpyinfo->font_table[i].name, fontname) 8342 && (!xstricmp (dpyinfo->font_table[i].name, fontname)
8348 || !strcmp (dpyinfo->font_table[i].full_name, fontname))) 8343 || !xstricmp (dpyinfo->font_table[i].full_name, fontname)))
8349 return (dpyinfo->font_table + i); 8344 return (dpyinfo->font_table + i);
8350 return NULL; 8345 return NULL;
8351} 8346}
@@ -8539,7 +8534,7 @@ Point saved_menu_event_location;
8539 8534
8540/* Apple Events */ 8535/* Apple Events */
8541#if USE_CARBON_EVENTS 8536#if USE_CARBON_EVENTS
8542static Lisp_Object Qhicommand; 8537static Lisp_Object Qhi_command;
8543#ifdef MAC_OSX 8538#ifdef MAC_OSX
8544extern Lisp_Object Qwindow; 8539extern Lisp_Object Qwindow;
8545static Lisp_Object Qtoolbar_switch_mode; 8540static Lisp_Object Qtoolbar_switch_mode;
@@ -8581,7 +8576,7 @@ static Lisp_Object Qservice, Qpaste, Qperform;
8581static pascal OSStatus mac_handle_window_event (EventHandlerCallRef, 8576static pascal OSStatus mac_handle_window_event (EventHandlerCallRef,
8582 EventRef, void *); 8577 EventRef, void *);
8583#endif 8578#endif
8584OSErr install_window_handler (WindowPtr); 8579OSStatus install_window_handler (WindowPtr);
8585 8580
8586extern void init_emacs_passwd_dir (); 8581extern void init_emacs_passwd_dir ();
8587extern int emacs_main (int, char **, char **); 8582extern int emacs_main (int, char **, char **);
@@ -9382,15 +9377,15 @@ mac_handle_command_event (next_handler, event, data)
9382 if (err != noErr || command.commandID == 0) 9377 if (err != noErr || command.commandID == 0)
9383 return eventNotHandledErr; 9378 return eventNotHandledErr;
9384 9379
9385 /* A HICommand event is mapped to an Apple event whose event class 9380 /* A HI command event is mapped to an Apple event whose event class
9386 symbol is `hicommand' and event ID is its command ID. */ 9381 symbol is `hi-command' and event ID is its command ID. */
9387 err = mac_store_event_ref_as_apple_event (0, command.commandID, 9382 err = mac_store_event_ref_as_apple_event (0, command.commandID,
9388 Qhicommand, Qnil, 9383 Qhi_command, Qnil,
9389 event, num_params, names, types); 9384 event, num_params, names, types);
9390 return err == noErr ? noErr : eventNotHandledErr; 9385 return err == noErr ? noErr : eventNotHandledErr;
9391} 9386}
9392 9387
9393static OSErr 9388static OSStatus
9394init_command_handler () 9389init_command_handler ()
9395{ 9390{
9396 EventTypeSpec specs[] = {{kEventClassCommand, kEventCommandProcess}}; 9391 EventTypeSpec specs[] = {{kEventClassCommand, kEventCommandProcess}};
@@ -9891,11 +9886,11 @@ mac_store_service_event (event)
9891#endif /* USE_CARBON_EVENTS */ 9886#endif /* USE_CARBON_EVENTS */
9892 9887
9893 9888
9894OSErr 9889OSStatus
9895install_window_handler (window) 9890install_window_handler (window)
9896 WindowPtr window; 9891 WindowPtr window;
9897{ 9892{
9898 OSErr err = noErr; 9893 OSStatus err = noErr;
9899#if USE_CARBON_EVENTS 9894#if USE_CARBON_EVENTS
9900 EventTypeSpec specs_window[] = 9895 EventTypeSpec specs_window[] =
9901 {{kEventClassWindow, kEventWindowUpdate}, 9896 {{kEventClassWindow, kEventWindowUpdate},
@@ -11329,7 +11324,7 @@ static void
11329init_menu_bar () 11324init_menu_bar ()
11330{ 11325{
11331#ifdef MAC_OSX 11326#ifdef MAC_OSX
11332 OSErr err; 11327 OSStatus err;
11333 MenuRef menu; 11328 MenuRef menu;
11334 MenuItemIndex menu_index; 11329 MenuItemIndex menu_index;
11335 11330
@@ -11512,7 +11507,7 @@ syms_of_macterm ()
11512 Fput (Qsuper, Qmodifier_value, make_number (super_modifier)); 11507 Fput (Qsuper, Qmodifier_value, make_number (super_modifier));
11513 11508
11514#if USE_CARBON_EVENTS 11509#if USE_CARBON_EVENTS
11515 Qhicommand = intern ("hicommand"); staticpro (&Qhicommand); 11510 Qhi_command = intern ("hi-command"); staticpro (&Qhi_command);
11516#ifdef MAC_OSX 11511#ifdef MAC_OSX
11517 Qtoolbar_switch_mode = intern ("toolbar-switch-mode"); 11512 Qtoolbar_switch_mode = intern ("toolbar-switch-mode");
11518 staticpro (&Qtoolbar_switch_mode); 11513 staticpro (&Qtoolbar_switch_mode);