aboutsummaryrefslogtreecommitdiffstats
path: root/src/macterm.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/macterm.c')
-rw-r--r--src/macterm.c57
1 files changed, 27 insertions, 30 deletions
diff --git a/src/macterm.c b/src/macterm.c
index c0128b496d3..76efa80d606 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
@@ -3583,7 +3583,9 @@ x_draw_stretch_glyph_string (s)
3583 int background_width = s->background_width; 3583 int background_width = s->background_width;
3584 int x = s->x, left_x = window_box_left_offset (s->w, TEXT_AREA); 3584 int x = s->x, left_x = window_box_left_offset (s->w, TEXT_AREA);
3585 3585
3586 if (x < left_x) 3586 /* Don't draw into left margin, fringe or scrollbar area
3587 except for header line and mode line. */
3588 if (x < left_x && !s->row->mode_line_p)
3587 { 3589 {
3588 background_width -= left_x - x; 3590 background_width -= left_x - x;
3589 x = left_x; 3591 x = left_x;
@@ -3677,14 +3679,14 @@ x_draw_glyph_string (s)
3677 3679
3678 if (s->face->underline_defaulted_p) 3680 if (s->face->underline_defaulted_p)
3679 mac_fill_rectangle (s->f, s->gc, s->x, s->y + dy, 3681 mac_fill_rectangle (s->f, s->gc, s->x, s->y + dy,
3680 s->width, h); 3682 s->background_width, h);
3681 else 3683 else
3682 { 3684 {
3683 XGCValues xgcv; 3685 XGCValues xgcv;
3684 XGetGCValues (s->display, s->gc, GCForeground, &xgcv); 3686 XGetGCValues (s->display, s->gc, GCForeground, &xgcv);
3685 XSetForeground (s->display, s->gc, s->face->underline_color); 3687 XSetForeground (s->display, s->gc, s->face->underline_color);
3686 mac_fill_rectangle (s->f, s->gc, s->x, s->y + dy, 3688 mac_fill_rectangle (s->f, s->gc, s->x, s->y + dy,
3687 s->width, h); 3689 s->background_width, h);
3688 XSetForeground (s->display, s->gc, xgcv.foreground); 3690 XSetForeground (s->display, s->gc, xgcv.foreground);
3689 } 3691 }
3690 } 3692 }
@@ -3696,14 +3698,14 @@ x_draw_glyph_string (s)
3696 3698
3697 if (s->face->overline_color_defaulted_p) 3699 if (s->face->overline_color_defaulted_p)
3698 mac_fill_rectangle (s->f, s->gc, s->x, s->y + dy, 3700 mac_fill_rectangle (s->f, s->gc, s->x, s->y + dy,
3699 s->width, h); 3701 s->background_width, h);
3700 else 3702 else
3701 { 3703 {
3702 XGCValues xgcv; 3704 XGCValues xgcv;
3703 XGetGCValues (s->display, s->gc, GCForeground, &xgcv); 3705 XGetGCValues (s->display, s->gc, GCForeground, &xgcv);
3704 XSetForeground (s->display, s->gc, s->face->overline_color); 3706 XSetForeground (s->display, s->gc, s->face->overline_color);
3705 mac_fill_rectangle (s->f, s->gc, s->x, s->y + dy, 3707 mac_fill_rectangle (s->f, s->gc, s->x, s->y + dy,
3706 s->width, h); 3708 s->background_width, h);
3707 XSetForeground (s->display, s->gc, xgcv.foreground); 3709 XSetForeground (s->display, s->gc, xgcv.foreground);
3708 } 3710 }
3709 } 3711 }
@@ -6312,7 +6314,7 @@ void
6312x_iconify_frame (f) 6314x_iconify_frame (f)
6313 struct frame *f; 6315 struct frame *f;
6314{ 6316{
6315 OSErr err; 6317 OSStatus err;
6316 6318
6317 /* 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
6318 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
@@ -6376,11 +6378,6 @@ x_free_frame_resources (f)
6376 if (FRAME_SIZE_HINTS (f)) 6378 if (FRAME_SIZE_HINTS (f))
6377 xfree (FRAME_SIZE_HINTS (f)); 6379 xfree (FRAME_SIZE_HINTS (f));
6378 6380
6379#if TARGET_API_MAC_CARBON
6380 if (FRAME_FILE_NAME (f))
6381 xfree (FRAME_FILE_NAME (f));
6382#endif
6383
6384 xfree (f->output_data.mac); 6381 xfree (f->output_data.mac);
6385 f->output_data.mac = NULL; 6382 f->output_data.mac = NULL;
6386 6383
@@ -7198,7 +7195,7 @@ init_font_name_table ()
7198 if (!NILP (assq_no_quit (make_number (kTextEncodingMacUnicode), 7195 if (!NILP (assq_no_quit (make_number (kTextEncodingMacUnicode),
7199 text_encoding_info_alist))) 7196 text_encoding_info_alist)))
7200 { 7197 {
7201 OSErr err; 7198 OSStatus err;
7202 struct Lisp_Hash_Table *h; 7199 struct Lisp_Hash_Table *h;
7203 unsigned hash_code; 7200 unsigned hash_code;
7204 ItemCount nfonts, i; 7201 ItemCount nfonts, i;
@@ -7780,7 +7777,7 @@ XLoadQueryFont (Display *dpy, char *fontname)
7780#if USE_ATSUI 7777#if USE_ATSUI
7781 if (strcmp (charset, "iso10646-1") == 0) /* XXX */ 7778 if (strcmp (charset, "iso10646-1") == 0) /* XXX */
7782 { 7779 {
7783 OSErr err; 7780 OSStatus err;
7784 ATSUAttributeTag tags[] = {kATSUFontTag, kATSUSizeTag, 7781 ATSUAttributeTag tags[] = {kATSUFontTag, kATSUSizeTag,
7785 kATSUQDBoldfaceTag, kATSUQDItalicTag}; 7782 kATSUQDBoldfaceTag, kATSUQDItalicTag};
7786 ByteCount sizes[] = {sizeof (ATSUFontID), sizeof (Fixed), 7783 ByteCount sizes[] = {sizeof (ATSUFontID), sizeof (Fixed),
@@ -7863,7 +7860,7 @@ XLoadQueryFont (Display *dpy, char *fontname)
7863#if USE_ATSUI 7860#if USE_ATSUI
7864 if (font->mac_style) 7861 if (font->mac_style)
7865 { 7862 {
7866 OSErr err; 7863 OSStatus err;
7867 UniChar c; 7864 UniChar c;
7868 7865
7869 font->min_byte1 = 0; 7866 font->min_byte1 = 0;
@@ -8342,8 +8339,8 @@ x_query_font (f, fontname)
8342 8339
8343 for (i = 0; i < dpyinfo->n_fonts; i++) 8340 for (i = 0; i < dpyinfo->n_fonts; i++)
8344 if (dpyinfo->font_table[i].name 8341 if (dpyinfo->font_table[i].name
8345 && (!strcmp (dpyinfo->font_table[i].name, fontname) 8342 && (!xstricmp (dpyinfo->font_table[i].name, fontname)
8346 || !strcmp (dpyinfo->font_table[i].full_name, fontname))) 8343 || !xstricmp (dpyinfo->font_table[i].full_name, fontname)))
8347 return (dpyinfo->font_table + i); 8344 return (dpyinfo->font_table + i);
8348 return NULL; 8345 return NULL;
8349} 8346}
@@ -8537,7 +8534,7 @@ Point saved_menu_event_location;
8537 8534
8538/* Apple Events */ 8535/* Apple Events */
8539#if USE_CARBON_EVENTS 8536#if USE_CARBON_EVENTS
8540static Lisp_Object Qhicommand; 8537static Lisp_Object Qhi_command;
8541#ifdef MAC_OSX 8538#ifdef MAC_OSX
8542extern Lisp_Object Qwindow; 8539extern Lisp_Object Qwindow;
8543static Lisp_Object Qtoolbar_switch_mode; 8540static Lisp_Object Qtoolbar_switch_mode;
@@ -8579,7 +8576,7 @@ static Lisp_Object Qservice, Qpaste, Qperform;
8579static pascal OSStatus mac_handle_window_event (EventHandlerCallRef, 8576static pascal OSStatus mac_handle_window_event (EventHandlerCallRef,
8580 EventRef, void *); 8577 EventRef, void *);
8581#endif 8578#endif
8582OSErr install_window_handler (WindowPtr); 8579OSStatus install_window_handler (WindowPtr);
8583 8580
8584extern void init_emacs_passwd_dir (); 8581extern void init_emacs_passwd_dir ();
8585extern int emacs_main (int, char **, char **); 8582extern int emacs_main (int, char **, char **);
@@ -9380,15 +9377,15 @@ mac_handle_command_event (next_handler, event, data)
9380 if (err != noErr || command.commandID == 0) 9377 if (err != noErr || command.commandID == 0)
9381 return eventNotHandledErr; 9378 return eventNotHandledErr;
9382 9379
9383 /* 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
9384 symbol is `hicommand' and event ID is its command ID. */ 9381 symbol is `hi-command' and event ID is its command ID. */
9385 err = mac_store_event_ref_as_apple_event (0, command.commandID, 9382 err = mac_store_event_ref_as_apple_event (0, command.commandID,
9386 Qhicommand, Qnil, 9383 Qhi_command, Qnil,
9387 event, num_params, names, types); 9384 event, num_params, names, types);
9388 return err == noErr ? noErr : eventNotHandledErr; 9385 return err == noErr ? noErr : eventNotHandledErr;
9389} 9386}
9390 9387
9391static OSErr 9388static OSStatus
9392init_command_handler () 9389init_command_handler ()
9393{ 9390{
9394 EventTypeSpec specs[] = {{kEventClassCommand, kEventCommandProcess}}; 9391 EventTypeSpec specs[] = {{kEventClassCommand, kEventCommandProcess}};
@@ -9889,11 +9886,11 @@ mac_store_service_event (event)
9889#endif /* USE_CARBON_EVENTS */ 9886#endif /* USE_CARBON_EVENTS */
9890 9887
9891 9888
9892OSErr 9889OSStatus
9893install_window_handler (window) 9890install_window_handler (window)
9894 WindowPtr window; 9891 WindowPtr window;
9895{ 9892{
9896 OSErr err = noErr; 9893 OSStatus err = noErr;
9897#if USE_CARBON_EVENTS 9894#if USE_CARBON_EVENTS
9898 EventTypeSpec specs_window[] = 9895 EventTypeSpec specs_window[] =
9899 {{kEventClassWindow, kEventWindowUpdate}, 9896 {{kEventClassWindow, kEventWindowUpdate},
@@ -11327,7 +11324,7 @@ static void
11327init_menu_bar () 11324init_menu_bar ()
11328{ 11325{
11329#ifdef MAC_OSX 11326#ifdef MAC_OSX
11330 OSErr err; 11327 OSStatus err;
11331 MenuRef menu; 11328 MenuRef menu;
11332 MenuItemIndex menu_index; 11329 MenuItemIndex menu_index;
11333 11330
@@ -11511,7 +11508,7 @@ syms_of_macterm ()
11511 Fput (Qsuper, Qmodifier_value, make_number (super_modifier)); 11508 Fput (Qsuper, Qmodifier_value, make_number (super_modifier));
11512 11509
11513#if USE_CARBON_EVENTS 11510#if USE_CARBON_EVENTS
11514 Qhicommand = intern ("hicommand"); staticpro (&Qhicommand); 11511 Qhi_command = intern ("hi-command"); staticpro (&Qhi_command);
11515#ifdef MAC_OSX 11512#ifdef MAC_OSX
11516 Qtoolbar_switch_mode = intern ("toolbar-switch-mode"); 11513 Qtoolbar_switch_mode = intern ("toolbar-switch-mode");
11517 staticpro (&Qtoolbar_switch_mode); 11514 staticpro (&Qtoolbar_switch_mode);