(Not yet supported.) */
int x_use_underline_position_properties;
+/* Non-zero means to draw the underline at the same place as the descent line. */
+
+int x_underline_at_descent_line;
+
/* This is a chain of structures for all the X displays currently in
use. */
static void mac_focus_changed P_ ((int, struct mac_display_info *,
struct frame *, struct input_event *));
static void x_detect_focus_change P_ ((struct mac_display_info *,
- EventRecord *, struct input_event *));
+ const EventRecord *,
+ struct input_event *));
static void XTframe_rehighlight P_ ((struct frame *));
static void x_frame_rehighlight P_ ((struct x_display_info *));
static void x_draw_hollow_cursor P_ ((struct window *, struct glyph_row *));
static XCharStruct *mac_per_char_metric P_ ((XFontStruct *, XChar2b *, int));
static void XSetFont P_ ((Display *, GC, XFontStruct *));
-/* Defined in macmenu.h. */
-extern void menubar_selection_callback (FRAME_PTR, int);
-
#define GC_FORE_COLOR(gc) (&(gc)->fore_color)
#define GC_BACK_COLOR(gc) (&(gc)->back_color)
#define GC_FONT(gc) ((gc)->xgcv.font)
#define FRAME_NORMAL_GC(f) ((f)->output_data.mac->normal_gc)
-#define CG_SET_FILL_COLOR(context, color) \
+
+#define CG_SET_FILL_COLOR(context, color) \
CGContextSetRGBFillColor (context, \
RED_FROM_ULONG (color) / 255.0f, \
GREEN_FROM_ULONG (color) / 255.0f, \
BLUE_FROM_ULONG (color) / 255.0f, 1.0f)
-#define CG_SET_STROKE_COLOR(context, color) \
+#if USE_CG_DRAWING && MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
+#if MAC_OS_X_VERSION_MIN_REQUIRED == 1020
+#define CG_SET_FILL_COLOR_MAYBE_WITH_CGCOLOR(context, color, cg_color) \
+ do { \
+ if (CGColorGetTypeID != NULL) \
+ CGContextSetFillColorWithColor (context, cg_color); \
+ else \
+ CG_SET_FILL_COLOR (context, color); \
+ } while (0)
+#else
+#define CG_SET_FILL_COLOR_MAYBE_WITH_CGCOLOR(context, color, cg_color) \
+ CGContextSetFillColorWithColor (context, cg_color)
+#endif
+#else
+#define CG_SET_FILL_COLOR_MAYBE_WITH_CGCOLOR(context, color, cg_color) \
+ CG_SET_FILL_COLOR (context, color)
+#endif
+#define CG_SET_FILL_COLOR_WITH_GC_FOREGROUND(context, gc) \
+ CG_SET_FILL_COLOR_MAYBE_WITH_CGCOLOR (context, (gc)->xgcv.foreground, \
+ (gc)->cg_fore_color)
+#define CG_SET_FILL_COLOR_WITH_GC_BACKGROUND(context, gc) \
+ CG_SET_FILL_COLOR_MAYBE_WITH_CGCOLOR (context, (gc)->xgcv.background, \
+ (gc)->cg_back_color)
+
+
+#define CG_SET_STROKE_COLOR(context, color) \
CGContextSetRGBStrokeColor (context, \
RED_FROM_ULONG (color) / 255.0f, \
GREEN_FROM_ULONG (color) / 255.0f, \
BLUE_FROM_ULONG (color) / 255.0f, 1.0f)
+#if USE_CG_DRAWING && MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
+#if MAC_OS_X_VERSION_MIN_REQUIRED == 1020
+#define CG_SET_STROKE_COLOR_MAYBE_WITH_CGCOLOR(context, color, cg_color) \
+ do { \
+ if (CGColorGetTypeID != NULL) \
+ CGContextSetStrokeColorWithColor (context, cg_color); \
+ else \
+ CG_SET_STROKE_COLOR (context, color); \
+ } while (0)
+#else
+#define CG_SET_STROKE_COLOR_MAYBE_WITH_CGCOLOR(context, color, cg_color) \
+ CGContextSetStrokeColorWithColor (context, cg_color)
+#endif
+#else
+#define CG_SET_STROKE_COLOR_MAYBE_WITH_CGCOLOR(context, color, cg_color) \
+ CG_SET_STROKE_COLOR (context, color)
+#endif
+#define CG_SET_STROKE_COLOR_WITH_GC_FOREGROUND(context, gc) \
+ CG_SET_STROKE_COLOR_MAYBE_WITH_CGCOLOR (context, (gc)->xgcv.foreground, \
+ (gc)->cg_fore_color)
+
#if USE_CG_DRAWING
#define FRAME_CG_CONTEXT(f) ((f)->output_data.mac->cg_context)
static int max_fringe_bmp = 0;
static CGImageRef *fringe_bmp = 0;
+static CGColorSpaceRef mac_cg_color_space_rgb;
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
+static CGColorRef mac_cg_color_black;
+#endif
+
+static void
+init_cg_color ()
+{
+ mac_cg_color_space_rgb = CGColorSpaceCreateDeviceRGB ();
+#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
+#if MAC_OS_X_VERSION_MIN_REQUIRED == 1020
+ /* Don't check the availability of CGColorCreate; this symbol is
+ defined even in Mac OS X 10.1. */
+ if (CGColorGetTypeID != NULL)
+#endif
+ {
+ float rgba[] = {0.0f, 0.0f, 0.0f, 1.0f};
+
+ mac_cg_color_black = CGColorCreate (mac_cg_color_space_rgb, rgba);
+ }
+#endif
+}
+
static CGContextRef
mac_begin_cg_clip (f, gc)
struct frame *f;
gy1 += 0.5f, gy2 += 0.5f;
context = mac_begin_cg_clip (f, gc);
- CG_SET_STROKE_COLOR (context, gc->xgcv.foreground);
+ CG_SET_STROKE_COLOR_WITH_GC_FOREGROUND (context, gc);
CGContextBeginPath (context);
CGContextMoveToPoint (context, gx1, gy1);
CGContextAddLineToPoint (context, gx2, gy2);
CGContextRef context;
context = mac_begin_cg_clip (f, gc);
- CG_SET_FILL_COLOR (context, gc->xgcv.background);
+ CG_SET_FILL_COLOR_WITH_GC_BACKGROUND (context, gc);
CGContextFillRect (context, CGRectMake (x, y, width, height));
mac_end_cg_clip (f);
#else
GC gc = FRAME_NORMAL_GC (f);
context = mac_begin_cg_clip (f, NULL);
- CG_SET_FILL_COLOR (context, gc->xgcv.background);
+ CG_SET_FILL_COLOR_WITH_GC_BACKGROUND (context, gc);
CGContextFillRect (context, CGRectMake (0, 0, FRAME_PIXEL_WIDTH (f),
FRAME_PIXEL_HEIGHT (f)));
mac_end_cg_clip (f);
context = mac_begin_cg_clip (f, gc);
if (!overlay_p)
{
- CG_SET_FILL_COLOR (context, gc->xgcv.background);
+ CG_SET_FILL_COLOR_WITH_GC_BACKGROUND (context, gc);
CGContextFillRect (context, dest_rect);
}
CGContextClipToRect (context, dest_rect);
CGContextScaleCTM (context, 1, -1);
CGContextTranslateCTM (context, 0, -port_height);
if (CGImageIsMask (image))
- CG_SET_FILL_COLOR (context, gc->xgcv.foreground);
+ CG_SET_FILL_COLOR_WITH_GC_FOREGROUND (context, gc);
CGContextDrawImage (context,
CGRectMake (dest_x - src_x,
port_height - (dest_y - src_y
char *bits;
int w, h;
{
- static unsigned char swap_nibble[16]
+ static const unsigned char swap_nibble[16]
= { 0x0, 0x8, 0x4, 0xc, /* 0000 1000 0100 1100 */
0x2, 0xa, 0x6, 0xe, /* 0010 1010 0110 1110 */
0x1, 0x9, 0x5, 0xd, /* 0001 1001 0101 1101 */
CGContextRef context;
context = mac_begin_cg_clip (f, gc);
- CG_SET_FILL_COLOR (context, gc->xgcv.foreground);
+ CG_SET_FILL_COLOR_WITH_GC_FOREGROUND (context, gc);
CGContextFillRect (context, CGRectMake (x, y, width, height));
mac_end_cg_clip (f);
#else
CGContextRef context;
context = mac_begin_cg_clip (f, gc);
- CG_SET_STROKE_COLOR (context, gc->xgcv.foreground);
+ CG_SET_STROKE_COLOR_WITH_GC_FOREGROUND (context, gc);
CGContextStrokeRect (context,
CGRectMake (x + 0.5f, y + 0.5f, width, height));
mac_end_cg_clip (f);
if (saved_text_layout == NULL)
{
- UniCharCount lengths[] = {kATSUToTextEnd};
- ATSUAttributeTag tags[] = {kATSULineLayoutOptionsTag};
- ByteCount sizes[] = {sizeof (ATSLineLayoutOptions)};
+ static const UniCharCount lengths[] = {kATSUToTextEnd};
+ static const ATSUAttributeTag tags[] = {kATSULineLayoutOptionsTag};
+ static const ByteCount sizes[] = {sizeof (ATSLineLayoutOptions)};
static ATSLineLayoutOptions line_layout =
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1020
kATSLineDisableAllLayoutOperations | kATSLineUseDeviceMetrics
kATSLineIsDisplayOnly | kATSLineFractDisable
#endif
;
- ATSUAttributeValuePtr values[] = {&line_layout};
+ static const ATSUAttributeValuePtr values[] = {&line_layout};
err = ATSUCreateTextLayoutWithTextPtr (text,
kATSUFromTextBeginning,
static void
-mac_draw_string_common (f, gc, x, y, buf, nchars, bg_width, bytes_per_char)
+mac_draw_string_common (f, gc, x, y, buf, nchars, bg_width,
+ overstrike_p, bytes_per_char)
struct frame *f;
GC gc;
int x, y;
char *buf;
- int nchars, bg_width, bytes_per_char;
+ int nchars, bg_width, overstrike_p, bytes_per_char;
{
SetPortWindowPort (FRAME_MAC_WINDOW (f));
#if USE_ATSUI
if (GC_FONT (gc)->mac_style)
{
- OSErr err;
+ OSStatus err;
ATSUTextLayout text_layout;
xassert (bytes_per_char == 2);
ATSUDrawText (text_layout,
kATSUFromTextBeginning, kATSUToTextEnd,
kATSUUseGrafPortPenLoc, kATSUUseGrafPortPenLoc);
+ if (overstrike_p)
+ {
+ MoveTo (x + 1, y);
+ ATSUDrawText (text_layout,
+ kATSUFromTextBeginning, kATSUToTextEnd,
+ kATSUUseGrafPortPenLoc, kATSUUseGrafPortPenLoc);
+ }
mac_end_clip (gc);
#ifdef MAC_OSX
}
else
{
CGrafPtr port;
- CGContextRef context;
+ static CGContextRef context;
float port_height = FRAME_PIXEL_HEIGHT (f);
- ATSUAttributeTag tags[] = {kATSUCGContextTag};
- ByteCount sizes[] = {sizeof (CGContextRef)};
- ATSUAttributeValuePtr values[] = {&context};
+ static const ATSUAttributeTag tags[] = {kATSUCGContextTag};
+ static const ByteCount sizes[] = {sizeof (CGContextRef)};
+ static const ATSUAttributeValuePtr values[] = {&context};
#if USE_CG_DRAWING
context = mac_begin_cg_clip (f, gc);
#endif
if (bg_width)
{
- CG_SET_FILL_COLOR (context, gc->xgcv.background);
+ CG_SET_FILL_COLOR_WITH_GC_BACKGROUND (context, gc);
CGContextFillRect
(context,
CGRectMake (x, y - FONT_BASE (GC_FONT (gc)),
#if !USE_CG_DRAWING
}
#endif
- CG_SET_FILL_COLOR (context, gc->xgcv.foreground);
+ CG_SET_FILL_COLOR_WITH_GC_FOREGROUND (context, gc);
err = ATSUSetLayoutControls (text_layout,
sizeof (tags) / sizeof (tags[0]),
tags, sizes, values);
if (err == noErr)
- ATSUDrawText (text_layout,
- kATSUFromTextBeginning, kATSUToTextEnd,
- Long2Fix (x), Long2Fix (port_height - y));
+ {
+ ATSUDrawText (text_layout,
+ kATSUFromTextBeginning, kATSUToTextEnd,
+ Long2Fix (x), Long2Fix (port_height - y));
+ if (overstrike_p)
+ ATSUDrawText (text_layout,
+ kATSUFromTextBeginning, kATSUToTextEnd,
+ Long2Fix (x + 1), Long2Fix (port_height - y));
+ }
#if USE_CG_DRAWING
mac_end_cg_clip (f);
context = NULL;
TextFace (GC_FONT (gc)->mac_fontface);
MoveTo (x, y);
DrawText (buf, 0, nchars * bytes_per_char);
+ if (overstrike_p)
+ {
+ TextMode (srcOr);
+ MoveTo (x + 1, y);
+ DrawText (buf, 0, nchars * bytes_per_char);
+ }
if (bg_width)
RGBBackColor (GC_BACK_COLOR (FRAME_NORMAL_GC (f)));
mac_end_clip (gc);
}
-/* Mac replacement for XDrawString. */
-
-static void
-mac_draw_string (f, gc, x, y, buf, nchars)
- struct frame *f;
- GC gc;
- int x, y;
- char *buf;
- int nchars;
-{
- mac_draw_string_common (f, gc, x, y, buf, nchars, 0, 1);
-}
-
-
-/* Mac replacement for XDrawString16. */
-
-static void
-mac_draw_string_16 (f, gc, x, y, buf, nchars)
- struct frame *f;
- GC gc;
- int x, y;
- XChar2b *buf;
- int nchars;
-{
- mac_draw_string_common (f, gc, x, y, (char *) buf, nchars, 0, 2);
-}
-
-
/* Mac replacement for XDrawImageString. */
static void
-mac_draw_image_string (f, gc, x, y, buf, nchars, bg_width)
+mac_draw_image_string (f, gc, x, y, buf, nchars, bg_width, overstrike_p)
struct frame *f;
GC gc;
int x, y;
char *buf;
- int nchars, bg_width;
+ int nchars, bg_width, overstrike_p;
{
- mac_draw_string_common (f, gc, x, y, buf, nchars, bg_width, 1);
+ mac_draw_string_common (f, gc, x, y, buf, nchars, bg_width,
+ overstrike_p, 1);
}
-/* Mac replacement for XDrawString16. */
+/* Mac replacement for XDrawImageString16. */
static void
-mac_draw_image_string_16 (f, gc, x, y, buf, nchars, bg_width)
+mac_draw_image_string_16 (f, gc, x, y, buf, nchars, bg_width, overstrike_p)
struct frame *f;
GC gc;
int x, y;
XChar2b *buf;
- int nchars, bg_width;
+ int nchars, bg_width, overstrike_p;
{
- mac_draw_string_common (f, gc, x, y, (char *) buf, nchars, bg_width, 2);
+ mac_draw_string_common (f, gc, x, y, (char *) buf, nchars, bg_width,
+ overstrike_p, 2);
}
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)
void *cg_glyph;
#endif
{
- OSErr err = noErr;
+ OSStatus err = noErr;
int width;
Rect char_bounds;
UniChar ch = c;
err = atsu_get_text_layout_with_text_ptr (&ch, 1, style, &text_layout);
- if (err == noErr)
+ if (err == noErr
+ && (font_ascent_return || font_descent_return || overall_return))
{
ATSTrapezoid glyph_bounds;
#if USE_CG_TEXT_DRAWING
if (err == noErr && cg_glyph)
{
- OSErr err1;
+ OSStatus err1;
ATSUGlyphInfoArray glyph_info_array;
ByteCount count = sizeof (ATSUGlyphInfoArray);
err1 = ATSUGetGlyphInfo (text_layout, kATSUFromTextBeginning,
kATSUToTextEnd, &count,
&glyph_info_array);
- if (err1 == noErr)
+ if (err1 == noErr
+ /* Make sure that we don't have to make layout
+ adjustments. */
+ && glyph_info_array.glyphs[0].deltaY == 0.0f
+ && glyph_info_array.glyphs[0].idealX == 0.0f
+ && glyph_info_array.glyphs[0].screenX == 0)
{
xassert (glyph_info_array.glyphs[0].glyphID);
*cg_glyph = glyph_info_array.glyphs[0].glyphID;
}
static int
-mac_draw_image_string_cg (f, gc, x, y, buf, nchars, bg_width)
+mac_draw_image_string_cg (f, gc, x, y, buf, nchars, bg_width, overstrike_p)
struct frame *f;
GC gc;
int x, y;
XChar2b *buf;
- int nchars, bg_width;
+ int nchars, bg_width, overstrike_p;
{
CGrafPtr port;
float port_height, gx, gy;
#endif
if (bg_width)
{
- CG_SET_FILL_COLOR (context, gc->xgcv.background);
+ CG_SET_FILL_COLOR_WITH_GC_BACKGROUND (context, gc);
CGContextFillRect
(context,
CGRectMake (gx, y - FONT_BASE (GC_FONT (gc)),
#if !USE_CG_DRAWING
}
#endif
- CG_SET_FILL_COLOR (context, gc->xgcv.foreground);
+ CG_SET_FILL_COLOR_WITH_GC_FOREGROUND (context, gc);
CGContextSetFont (context, GC_FONT (gc)->cg_font);
CGContextSetFontSize (context, GC_FONT (gc)->mac_fontsize);
if (GC_FONT (gc)->mac_fontsize <= cg_text_anti_aliasing_threshold)
CGContextSetShouldAntialias (context, false);
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
- CGContextSetTextPosition (context, gx, gy);
- CGContextShowGlyphsWithAdvances (context, glyphs, advances, nchars);
-#else
- for (i = 0; i < nchars; i++)
+#if MAC_OS_X_VERSION_MIN_REQUIRED == 1020
+ if (CGContextShowGlyphsWithAdvances != NULL)
+#endif
{
- CGContextShowGlyphsAtPoint (context, gx, gy, glyphs + i, 1);
- gx += advances[i].width;
+ CGContextSetTextPosition (context, gx, gy);
+ CGContextShowGlyphsWithAdvances (context, glyphs, advances, nchars);
+ if (overstrike_p)
+ {
+ CGContextSetTextPosition (context, gx + 1.0f, gy);
+ CGContextShowGlyphsWithAdvances (context, glyphs, advances, nchars);
+ }
+ }
+#if MAC_OS_X_VERSION_MIN_REQUIRED == 1020
+ else
+#endif
+#endif /* MAC_OS_X_VERSION_MAX_ALLOWED >= 1030 */
+#if MAC_OS_X_VERSION_MAX_ALLOWED < 1030 || MAC_OS_X_VERSION_MIN_REQUIRED == 1020
+ {
+ for (i = 0; i < nchars; i++)
+ {
+ CGContextShowGlyphsAtPoint (context, gx, gy, glyphs + i, 1);
+ if (overstrike_p)
+ CGContextShowGlyphsAtPoint (context, gx + 1.0f, gy, glyphs + i, 1);
+ gx += advances[i].width;
+ }
}
#endif
#if USE_CG_DRAWING
GC gc = xmalloc (sizeof (*gc));
bzero (gc, sizeof (*gc));
+#if USE_CG_DRAWING && MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
+#if MAC_OS_X_VERSION_MIN_REQUIRED == 1020
+ if (CGColorGetTypeID != NULL)
+#endif
+ {
+ gc->cg_fore_color = gc->cg_back_color = mac_cg_color_black;
+ CGColorRetain (gc->cg_fore_color);
+ CGColorRetain (gc->cg_back_color);
+ }
+#endif
XChangeGC (display, gc, mask, xgcv);
return gc;
{
if (gc->clip_region)
DisposeRgn (gc->clip_region);
+#if USE_CG_DRAWING && MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
+ CGColorRelease (gc->cg_fore_color);
+ CGColorRelease (gc->cg_back_color);
+#endif
xfree (gc);
}
gc->fore_color.red = RED16_FROM_ULONG (color);
gc->fore_color.green = GREEN16_FROM_ULONG (color);
gc->fore_color.blue = BLUE16_FROM_ULONG (color);
+#if USE_CG_DRAWING && MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
+#if MAC_OS_X_VERSION_MIN_REQUIRED == 1020
+ if (CGColorGetTypeID != NULL)
+#endif
+ {
+ CGColorRelease (gc->cg_fore_color);
+ if (color == 0)
+ {
+ gc->cg_fore_color = mac_cg_color_black;
+ CGColorRetain (gc->cg_fore_color);
+ }
+ else
+ {
+ float rgba[4];
+
+ rgba[0] = gc->fore_color.red / 65535.0f;
+ rgba[1] = gc->fore_color.green / 65535.0f;
+ rgba[2] = gc->fore_color.blue / 65535.0f;
+ rgba[3] = 1.0f;
+ gc->cg_fore_color = CGColorCreate (mac_cg_color_space_rgb, rgba);
+ }
+ }
+#endif
}
}
gc->back_color.red = RED16_FROM_ULONG (color);
gc->back_color.green = GREEN16_FROM_ULONG (color);
gc->back_color.blue = BLUE16_FROM_ULONG (color);
+#if USE_CG_DRAWING && MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
+#if MAC_OS_X_VERSION_MIN_REQUIRED == 1020
+ if (CGColorGetTypeID != NULL)
+#endif
+ {
+ CGColorRelease (gc->cg_back_color);
+ if (color == 0)
+ {
+ gc->cg_back_color = mac_cg_color_black;
+ CGColorRetain (gc->cg_back_color);
+ }
+ else
+ {
+ float rgba[4];
+
+ rgba[0] = gc->back_color.red / 65535.0f;
+ rgba[1] = gc->back_color.green / 65535.0f;
+ rgba[2] = gc->back_color.blue / 65535.0f;
+ rgba[3] = 1.0f;
+ gc->cg_back_color = CGColorCreate (mac_cg_color_space_rgb, rgba);
+ }
+ }
+#endif
}
}
static enum pcm_status
pcm_get_status (pcm)
- XCharStruct *pcm;
+ const XCharStruct *pcm;
{
int height = pcm->ascent + pcm->descent;
Rect r;
MacFontStruct *font = s->font;
+#if USE_CG_DRAWING
+ mac_prepare_for_quickdraw (s->f);
+#endif
+ SetPortWindowPort (FRAME_MAC_WINDOW (s->f));
+
TextFont (font->mac_fontnum);
TextSize (font->mac_fontsize);
TextFace (font->mac_fontface);
#if USE_CG_TEXT_DRAWING
if (!s->two_byte_p
&& mac_draw_image_string_cg (s->f, s->gc, x, s->ybase - boff,
- s->char2b, s->nchars, bg_width))
+ s->char2b, s->nchars, bg_width,
+ s->face->overstrike))
;
else
#endif
mac_draw_image_string_16 (s->f, s->gc, x, s->ybase - boff,
- s->char2b, s->nchars, bg_width);
+ s->char2b, s->nchars, bg_width,
+ s->face->overstrike);
else
mac_draw_image_string (s->f, s->gc, x, s->ybase - boff,
- char1b, s->nchars, bg_width);
+ char1b, s->nchars, bg_width,
+ s->face->overstrike);
}
}
else
{
for (i = 0; i < s->nchars; i++, ++s->gidx)
- mac_draw_string_16 (s->f, s->gc,
- x + s->cmp->offsets[s->gidx * 2],
- s->ybase - s->cmp->offsets[s->gidx * 2 + 1],
- s->char2b + i, 1);
+ mac_draw_image_string_16 (s->f, s->gc,
+ x + s->cmp->offsets[s->gidx * 2],
+ s->ybase - s->cmp->offsets[s->gidx * 2 + 1],
+ s->char2b + i, 1, 0, s->face->overstrike);
}
}
int background_width = s->background_width;
int x = s->x, left_x = window_box_left_offset (s->w, TEXT_AREA);
- if (x < left_x)
+ /* Don't draw into left margin, fringe or scrollbar area
+ except for header line and mode line. */
+ if (x < left_x && !s->row->mode_line_p)
{
background_width -= left_x - x;
x = left_x;
/* Draw underline. */
if (s->face->underline_p)
{
- unsigned long h = 1;
- unsigned long dy = s->height - h;
+ unsigned long tem, h;
+ int y;
+
+#if 0
+ /* Get the underline thickness. Default is 1 pixel. */
+ if (!XGetFontProperty (s->font, XA_UNDERLINE_THICKNESS, &h))
+#endif
+ h = 1;
+
+ y = s->y + s->height - h;
+ if (!x_underline_at_descent_line)
+ {
+ /* Get the underline position. This is the recommended
+ vertical offset in pixels from the baseline to the top of
+ the underline. This is a signed value according to the
+ specs, and its default is
+
+ ROUND ((maximum descent) / 2), with
+ ROUND(x) = floor (x + 0.5) */
+
+#if 0
+ if (x_use_underline_position_properties
+ && XGetFontProperty (s->font, XA_UNDERLINE_POSITION, &tem))
+ y = s->ybase + (long) tem;
+ else
+#endif
+ if (s->face->font)
+ y = s->ybase + (s->face->font->max_bounds.descent + 1) / 2;
+ }
if (s->face->underline_defaulted_p)
- mac_fill_rectangle (s->f, s->gc, s->x, s->y + dy,
- s->width, h);
+ mac_fill_rectangle (s->f, s->gc, s->x, y,
+ s->background_width, h);
else
{
XGCValues xgcv;
XGetGCValues (s->display, s->gc, GCForeground, &xgcv);
XSetForeground (s->display, s->gc, s->face->underline_color);
- mac_fill_rectangle (s->f, s->gc, s->x, s->y + dy,
- s->width, h);
+ mac_fill_rectangle (s->f, s->gc, s->x, y,
+ s->background_width, h);
XSetForeground (s->display, s->gc, xgcv.foreground);
}
}
if (s->face->overline_color_defaulted_p)
mac_fill_rectangle (s->f, s->gc, s->x, s->y + dy,
- s->width, h);
+ s->background_width, h);
else
{
XGCValues xgcv;
XGetGCValues (s->display, s->gc, GCForeground, &xgcv);
XSetForeground (s->display, s->gc, s->face->overline_color);
mac_fill_rectangle (s->f, s->gc, s->x, s->y + dy,
- s->width, h);
+ s->background_width, h);
XSetForeground (s->display, s->gc, xgcv.foreground);
}
}
static void
x_detect_focus_change (dpyinfo, event, bufp)
struct mac_display_info *dpyinfo;
- EventRecord *event;
+ const EventRecord *event;
struct input_event *bufp;
{
struct frame *frame;
x_scroll_bar_handle_click (bar, part_code, er, bufp)
struct scroll_bar *bar;
ControlPartCode part_code;
- EventRecord *er;
+ const EventRecord *er;
struct input_event *bufp;
{
int win_y, top_range;
#endif /* not TARGET_API_MAC_CARBON */
}
+static void
+mac_handle_origin_change (f)
+ struct frame *f;
+{
+ x_real_positions (f, &f->left_pos, &f->top_pos);
+}
+
+static void
+mac_handle_size_change (f, pixelwidth, pixelheight)
+ struct frame *f;
+ int pixelwidth, pixelheight;
+{
+ int cols, rows;
+
+ cols = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (f, pixelwidth);
+ rows = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (f, pixelheight);
+
+ if (cols != FRAME_COLS (f)
+ || rows != FRAME_LINES (f)
+ || pixelwidth != FRAME_PIXEL_WIDTH (f)
+ || pixelheight != FRAME_PIXEL_HEIGHT (f))
+ {
+ /* We pass 1 for DELAY since we can't run Lisp code inside of
+ a BLOCK_INPUT. */
+ change_frame_size (f, rows, cols, 0, 1, 0);
+ FRAME_PIXEL_WIDTH (f) = pixelwidth;
+ FRAME_PIXEL_HEIGHT (f) = pixelheight;
+ SET_FRAME_GARBAGED (f);
+
+ /* If cursor was outside the new size, mark it as off. */
+ mark_window_cursors_off (XWINDOW (f->root_window));
+
+ /* Clear out any recollection of where the mouse highlighting
+ was, since it might be in a place that's outside the new
+ frame size. Actually checking whether it is outside is a
+ pain in the neck, so don't try--just let the highlighting be
+ done afresh with new size. */
+ cancel_mouse_face (f);
+
+#if TARGET_API_MAC_CARBON
+ if (f->output_data.mac->hourglass_control)
+ {
+#if USE_CG_DRAWING
+ mac_prepare_for_quickdraw (f);
+#endif
+ MoveControl (f->output_data.mac->hourglass_control,
+ pixelwidth - HOURGLASS_WIDTH, 0);
+ }
+#endif
+ }
+}
\f
/* Calculate the absolute position in frame F
ConstrainWindowToScreen (FRAME_MAC_WINDOW (f), kWindowTitleBarRgn,
kWindowConstrainMoveRegardlessOfFit
| kWindowConstrainAllowPartial, NULL, NULL);
- x_real_positions (f, &f->left_pos, &f->top_pos);
+#if USE_CARBON_EVENTS
+ if (!NILP (tip_frame) && XFRAME (tip_frame) == f)
+#endif
+ mac_handle_origin_change (f);
#else
{
Rect inner, outer, screen_rect, dummy;
x_wm_set_size_hint (f, (long) 0, 0);
SizeWindow (FRAME_MAC_WINDOW (f), pixelwidth, pixelheight, 0);
-#if TARGET_API_MAC_CARBON
- if (f->output_data.mac->hourglass_control)
- {
-#if USE_CG_DRAWING
- mac_prepare_for_quickdraw (f);
-#endif
- MoveControl (f->output_data.mac->hourglass_control,
- pixelwidth - HOURGLASS_WIDTH, 0);
- }
-#endif
- /* Now, strictly speaking, we can't be sure that this is accurate,
- but the window manager will get around to dealing with the size
- change request eventually, and we'll hear how it went when the
- ConfigureNotify event gets here.
-
- We could just not bother storing any of this information here,
- and let the ConfigureNotify event set everything up, but that
- might be kind of confusing to the Lisp code, since size changes
- wouldn't be reported in the frame parameters until some random
- point in the future when the ConfigureNotify event arrives.
-
- We pass 1 for DELAY since we can't run Lisp code inside of
- a BLOCK_INPUT. */
- change_frame_size (f, rows, cols, 0, 1, 0);
- FRAME_PIXEL_WIDTH (f) = pixelwidth;
- FRAME_PIXEL_HEIGHT (f) = pixelheight;
-
- /* We've set {FRAME,PIXEL}_{WIDTH,HEIGHT} to the values we hope to
- receive in the ConfigureNotify event; if we get what we asked
- for, then the event won't cause the screen to become garbaged, so
- we have to make sure to do it here. */
- SET_FRAME_GARBAGED (f);
-
- XFlush (FRAME_X_DISPLAY (f));
-
- /* If cursor was outside the new size, mark it as off. */
- mark_window_cursors_off (XWINDOW (f->root_window));
-
- /* Clear out any recollection of where the mouse highlighting was,
- since it might be in a place that's outside the new frame size.
- Actually checking whether it is outside is a pain in the neck,
- so don't try--just let the highlighting be done afresh with new size. */
- cancel_mouse_face (f);
+#if USE_CARBON_EVENTS
+ if (!NILP (tip_frame) && f == XFRAME (tip_frame))
+#endif
+ mac_handle_size_change (f, pixelwidth, pixelheight);
UNBLOCK_INPUT;
}
kWindowCascadeOnParentWindowScreen
#endif
);
- x_real_positions (f, &f->left_pos, &f->top_pos);
+#if USE_CARBON_EVENTS
+ if (!NILP (tip_frame) && f == XFRAME (tip_frame))
+#endif
+ mac_handle_origin_change (f);
}
else
#endif
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
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;
static struct xlfdpat *
xlfdpat_create (pattern)
- char *pattern;
+ const char *pattern;
{
struct xlfdpat *pat;
int nblocks, i, skip;
unsigned char last_char, *p, *q, *anychar_head;
+ const unsigned char *ptr;
struct xlfdpat_block *blk;
pat = xmalloc (sizeof (struct xlfdpat));
anychar_head = NULL;
q = pat->buf;
last_char = '\0';
- for (p = pattern; *p; p++)
+ for (ptr = pattern; *ptr; ptr++)
{
- unsigned char c = *p;
+ unsigned char c = *ptr;
if (c == '*')
if (last_char == '*')
that the pattern in *BLK matches with its prefix. Return NULL
there is no such strings. STRING must be lowered in advance. */
-static char *
+static const char *
xlfdpat_block_match_1 (blk, string, start_max)
struct xlfdpat_block *blk;
- unsigned char *string;
+ const unsigned char *string;
int start_max;
{
int start, infinity;
- unsigned char *p, *s;
+ unsigned char *p;
+ const unsigned char *s;
xassert (blk->len > 0);
xassert (start_max + blk->len <= strlen (string));
((b)->len == 1 ? memchr ((s), (b)->last_char, (m) + 1) \
: xlfdpat_block_match_1 (b, s, m))
-/* Check if XLFD pattern PAT, which is generated by `xfldpat_create',
+/* Check if XLFD pattern PAT, which is generated by `xlfdpat_create',
matches with STRING. STRING must be lowered in advance. */
static int
xlfdpat_match (pat, string)
struct xlfdpat *pat;
- unsigned char *string;
+ const unsigned char *string;
{
int str_len, nblocks, i, start_max;
struct xlfdpat_block *blk;
- unsigned char *s;
+ const unsigned char *s;
xassert (pat->nblocks > 0);
static Lisp_Object atsu_font_id_hash;
/* Alist linking Font Manager style to face attributes. */
static Lisp_Object fm_style_face_attributes_alist;
-static Lisp_Object Vmac_atsu_font_table;
extern Lisp_Object QCfamily, QCweight, QCslant, Qnormal, Qbold, Qitalic;
#endif
static char *
mac_to_x_fontname (name, size, style, charset)
- char *name;
+ const char *name;
int size;
Style style;
char *charset;
static int
parse_x_font_name (xf, family, size, style, charset)
- char *xf, *family;
+ const char *xf;
+ char *family;
int *size;
Style *style;
char *charset;
static void
add_mac_font_name (name, size, style, charset)
- char *name;
+ const char *name;
int size;
Style style;
- char *charset;
+ const char *charset;
{
if (size > 0)
add_font_name_table_entry (mac_to_x_fontname (name, size, style, charset));
}
#if USE_ATSUI
+static FMFontStyle
+fm_get_style_from_font (font)
+ FMFont font;
+{
+ OSStatus err;
+ FMFontStyle style = normal;
+ ByteCount len;
+ UInt16 mac_style;
+ FMFontFamily font_family;
+#define FONT_HEADER_MAC_STYLE_OFFSET (4*4 + 2*2 + 8*2 + 2*4)
+
+ /* FMGetFontFamilyInstanceFromFont returns `normal' as the style of
+ some font (e.g., Optima) even if it is `bold'. */
+ err = FMGetFontTable (font, 'head', FONT_HEADER_MAC_STYLE_OFFSET,
+ sizeof (mac_style), &mac_style, &len);
+ if (err == noErr
+ && len >= FONT_HEADER_MAC_STYLE_OFFSET + sizeof (mac_style))
+ style = EndianU16_BtoN (mac_style);
+ else
+ FMGetFontFamilyInstanceFromFont (font, &font_family, &style);
+
+ return style;
+}
+
+static ATSUFontID
+atsu_find_font_from_family_name (family)
+ const char *family;
+{
+ struct Lisp_Hash_Table *h = XHASH_TABLE (atsu_font_id_hash);
+ unsigned hash_code;
+ int i;
+ Lisp_Object rest, best;
+ FMFontStyle min_style, style;
+
+ i = hash_lookup (h, make_unibyte_string (family, strlen (family)),
+ &hash_code);
+ if (i < 0)
+ return kATSUInvalidFontID;
+
+ rest = HASH_VALUE (h, i);
+ if (INTEGERP (rest) || (CONSP (rest) && INTEGERP (XCDR (rest))))
+ return cons_to_long (rest);
+
+ rest = Fnreverse (rest);
+ best = XCAR (rest);
+ rest = XCDR (rest);
+ if (!NILP (rest)
+ && (min_style = fm_get_style_from_font (cons_to_long (best))) != normal)
+ do
+ {
+ style = fm_get_style_from_font (cons_to_long (XCAR (rest)));
+ if (style < min_style)
+ {
+ best = XCAR (rest);
+ if (style == normal)
+ break;
+ else
+ min_style = style;
+ }
+ rest = XCDR (rest);
+ }
+ while (!NILP (rest));
+
+ HASH_VALUE (h, i) = best;
+ return cons_to_long (best);
+}
+
static Lisp_Object
fm_style_to_face_attributes (fm_style)
FMFontStyle fm_style;
return tem;
}
+
+static Lisp_Object
+atsu_find_font_family_name (font_id)
+ ATSUFontID font_id;
+{
+ OSStatus err;
+ ByteCount len;
+ Lisp_Object family = Qnil;
+
+ err = ATSUFindFontName (font_id, kFontFamilyName,
+ kFontMacintoshPlatform, kFontNoScript,
+ kFontNoLanguage, 0, NULL, &len, NULL);
+ if (err == noErr)
+ {
+ family = make_uninit_string (len);
+ err = ATSUFindFontName (font_id, kFontFamilyName,
+ kFontMacintoshPlatform, kFontNoScript,
+ kFontNoLanguage, len, SDATA (family),
+ NULL, NULL);
+ }
+ if (err == noErr)
+ decode_mac_font_name (SDATA (family), len + 1, Qnil);
+
+ return family;
+}
+
+Lisp_Object
+mac_atsu_font_face_attributes (font_id)
+ ATSUFontID font_id;
+{
+ Lisp_Object family, style_attrs;
+
+ family = atsu_find_font_family_name (font_id);
+ if (NILP (family))
+ return Qnil;
+ style_attrs = fm_style_to_face_attributes (fm_get_style_from_font (font_id));
+ return Fcons (QCfamily, Fcons (family, style_attrs));
+}
#endif
/* Sets up the table font_name_table to contain the list of all fonts
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;
ATSUFontID *font_ids = NULL;
- Ptr name;
- ByteCount name_len;
- Lisp_Object family;
+ Lisp_Object prev_family = Qnil;
+ int j;
atsu_font_id_hash =
make_hash_table (Qequal, make_number (DEFAULT_HASH_SIZE),
if (err == noErr)
for (i = 0; i < nfonts; i++)
{
- err = ATSUFindFontName (font_ids[i], kFontFamilyName,
- kFontMacintoshPlatform, kFontNoScript,
- kFontNoLanguage, 0, NULL, &name_len, NULL);
- if (err != noErr)
+ Lisp_Object family;
+
+ family = atsu_find_font_family_name (font_ids[i]);
+ if (NILP (family) || SREF (family, 0) == '.')
continue;
- name = xmalloc (name_len + 1);
- name[name_len] = '\0';
- err = ATSUFindFontName (font_ids[i], kFontFamilyName,
- kFontMacintoshPlatform, kFontNoScript,
- kFontNoLanguage, name_len, name,
- NULL, NULL);
- if (err == noErr)
+ if (!NILP (Fequal (prev_family, family)))
+ family = prev_family;
+ else
+ j = hash_lookup (h, family, &hash_code);
+ if (j < 0)
{
- FMFontFamily ff;
- FMFontStyle style = normal;
-
- decode_mac_font_name (name, name_len + 1, Qnil);
- family = make_unibyte_string (name, name_len);
- FMGetFontFamilyInstanceFromFont (font_ids[i], &ff, &style);
- Fputhash ((font_ids[i] > MOST_POSITIVE_FIXNUM
- ? make_float (font_ids[i])
- : make_number (font_ids[i])),
- Fcons (QCfamily,
- Fcons (family,
- fm_style_to_face_attributes (style))),
- Vmac_atsu_font_table);
- if (*name != '.'
- && hash_lookup (h, family, &hash_code) < 0)
- {
- add_mac_font_name (name, 0, normal, "iso10646-1");
- hash_put (h, family, long_to_cons (font_ids[i]),
- hash_code);
- }
+ add_mac_font_name (SDATA (family), 0, normal, "iso10646-1");
+ j = hash_put (h, family, Fcons (long_to_cons (font_ids[i]),
+ Qnil), hash_code);
}
- xfree (name);
+ else if (EQ (prev_family, family))
+ HASH_VALUE (h, j) = Fcons (long_to_cons (font_ids[i]),
+ HASH_VALUE (h, j));
+ prev_family = family;
}
if (font_ids)
xfree (font_ids);
XLFD_SCL_LAST
};
-static int xlfd_scalable_fields[] =
+static const int xlfd_scalable_fields[] =
{
6, /* PIXEL_SIZE */
7, /* POINT_SIZE */
static Lisp_Object
mac_do_list_fonts (pattern, maxnames)
- char *pattern;
+ const char *pattern;
int maxnames;
{
int i, n_fonts = 0;
Lisp_Object font_list = Qnil;
struct xlfdpat *pat;
- char *scaled, *ptr;
- int scl_val[XLFD_SCL_LAST], *field, *val;
+ char *scaled;
+ const char *ptr;
+ int scl_val[XLFD_SCL_LAST], *val;
+ const int *field;
int exact;
if (font_name_table == NULL) /* Initialize when first used. */
fields are present, none is '*'. */
static int
-is_fully_specified_xlfd (char *p)
+is_fully_specified_xlfd (p)
+ const char *p;
{
int i;
char *q;
}
-/* XLoadQueryFont creates and returns an internal representation for a
- font in a MacFontStruct struct. There is really no concept
+/* mac_load_query_font creates and returns an internal representation
+ for a font in a MacFontStruct struct. There is really no concept
corresponding to "loading" a font on the Mac. But we check its
existence and find the font number and all other information for it
and store them in the returned MacFontStruct. */
static MacFontStruct *
-XLoadQueryFont (Display *dpy, char *fontname)
+mac_load_query_font (f, fontname)
+ struct frame *f;
+ char *fontname;
{
int size;
char *name;
#if USE_ATSUI
if (strcmp (charset, "iso10646-1") == 0) /* XXX */
{
- OSErr err;
- ATSUAttributeTag tags[] = {kATSUFontTag, kATSUSizeTag,
- kATSUQDBoldfaceTag, kATSUQDItalicTag};
- ByteCount sizes[] = {sizeof (ATSUFontID), sizeof (Fixed),
- sizeof (Boolean), sizeof (Boolean)};
+ OSStatus err;
+ static const ATSUAttributeTag tags[] =
+ {kATSUFontTag, kATSUSizeTag,
+ kATSUQDBoldfaceTag, kATSUQDItalicTag};
+ static const ByteCount sizes[] =
+ {sizeof (ATSUFontID), sizeof (Fixed),
+ sizeof (Boolean), sizeof (Boolean)};
static Fixed size_fixed;
static Boolean bold_p, italic_p;
- ATSUAttributeValuePtr values[] = {&font_id, &size_fixed,
- &bold_p, &italic_p};
- ATSUFontFeatureType types[] = {kAllTypographicFeaturesType,
- kDiacriticsType};
- ATSUFontFeatureSelector selectors[] = {kAllTypeFeaturesOffSelector,
- kDecomposeDiacriticsSelector};
- Lisp_Object font_id_cons;
+ static const ATSUAttributeValuePtr values[] =
+ {&font_id, &size_fixed,
+ &bold_p, &italic_p};
+ static const ATSUFontFeatureType types[] =
+ {kAllTypographicFeaturesType, kDiacriticsType};
+ static const ATSUFontFeatureSelector selectors[] =
+ {kAllTypeFeaturesOffSelector, kDecomposeDiacriticsSelector};
FMFontStyle style;
- font_id_cons = Fgethash (make_unibyte_string (family, strlen (family)),
- atsu_font_id_hash, Qnil);
- if (NILP (font_id_cons))
- return NULL;
- font_id = cons_to_long (font_id_cons);
+ font_id = atsu_find_font_from_family_name (family);
+ if (font_id == kATSUInvalidFontID)
+ return;
size_fixed = Long2Fix (size);
bold_p = (fontface & bold) != 0;
italic_p = (fontface & italic) != 0;
#if USE_ATSUI
if (font->mac_style)
{
- OSErr err;
+ OSStatus err;
UniChar c;
font->min_byte1 = 0;
NULL
#endif
);
- if (err != noErr)
+ if (err != noErr
+ || space_bounds->width <= 0 || FONT_HEIGHT (font) <= 0)
{
mac_unload_font (&one_mac_display_info, font);
return NULL;
continue;
else if (c == 0x7f)
{
- c = 0x9f;
- continue;
+#if USE_CG_TEXT_DRAWING
+ if (font->cg_glyphs)
+ {
+ c = 0x9f;
+ pcm = NULL;
+ continue;
+ }
+#endif
+ break;
}
- mac_query_char_extents (font->mac_style, c, NULL, NULL, pcm + c,
+ mac_query_char_extents (font->mac_style, c, NULL, NULL,
+ pcm ? pcm + c : NULL,
#if USE_CG_TEXT_DRAWING
(font->cg_glyphs ? font->cg_glyphs + c
: NULL)
font->cg_font = NULL;
xfree (font->cg_glyphs);
font->cg_glyphs = NULL;
+ if (pcm == NULL)
+ break;
}
#endif
}
else
#endif
{
- GrafPtr port;
- SInt16 old_fontnum, old_fontsize;
- Style old_fontface;
+ OSStatus err;
FontInfo the_fontinfo;
int is_two_byte_font;
- /* Save the current font number used. */
- GetPort (&port);
-#if TARGET_API_MAC_CARBON
- old_fontnum = GetPortTextFont (port);
- old_fontsize = GetPortTextSize (port);
- old_fontface = GetPortTextFace (port);
-#else
- old_fontnum = port->txFont;
- old_fontsize = port->txSize;
- old_fontface = port->txFace;
+#if USE_CG_DRAWING
+ mac_prepare_for_quickdraw (f);
#endif
+ SetPortWindowPort (FRAME_MAC_WINDOW (f));
TextFont (fontnum);
TextSize (size);
sizeof (XCharStruct) * (0xff - 0x20 + 1));
space_bounds = font->bounds.per_char;
- mac_query_char_extents (NULL, 0x20, &font->ascent, &font->descent,
- space_bounds, NULL);
+ err = mac_query_char_extents (NULL, 0x20, &font->ascent,
+ &font->descent, space_bounds, NULL);
+ if (err != noErr || space_bounds->width <= 0)
+ {
+ mac_unload_font (&one_mac_display_info, font);
+ return NULL;
+ }
for (c = 0x21, pcm = space_bounds + 1; c <= 0xff; c++, pcm++)
mac_query_char_extents (NULL, c, NULL, NULL, pcm, NULL);
}
-
- /* Restore previous font number, size and face. */
- TextFont (old_fontnum);
- TextSize (old_fontsize);
- TextFace (old_fontface);
}
if (space_bounds)
pcm->width);
font->min_bounds.ascent = min (font->min_bounds.ascent,
pcm->ascent);
+ font->min_bounds.descent = min (font->min_bounds.descent,
+ pcm->descent);
font->max_bounds.lbearing = max (font->max_bounds.lbearing,
pcm->lbearing);
pcm->width);
font->max_bounds.ascent = max (font->max_bounds.ascent,
pcm->ascent);
+ font->max_bounds.descent = max (font->max_bounds.descent,
+ pcm->descent);
}
if (
#if USE_ATSUI
fontname = (char *) SDATA (XCAR (font_names));
BLOCK_INPUT;
- font = (MacFontStruct *) XLoadQueryFont (FRAME_MAC_DISPLAY (f), fontname);
+ font = mac_load_query_font (f, fontname);
UNBLOCK_INPUT;
if (!font)
return NULL;
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;
}
#endif
#endif /* ! TARGET_API_MAC_CARBON */
-#define M_APPLE 128
+#define M_APPLE 234
#define I_ABOUT 1
#define WINDOW_RESOURCE 128
/* 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;
extern OSErr init_coercion_handler P_ ((void));
/* Drag and Drop */
-OSErr install_drag_handler P_ ((WindowRef));
-void remove_drag_handler P_ ((WindowRef));
+extern OSErr install_drag_handler P_ ((WindowRef));
+extern void remove_drag_handler P_ ((WindowRef));
+
+/* Showing help echo string during menu tracking */
+extern OSStatus install_menu_target_item_handler P_ ((WindowPtr));
#if USE_CARBON_EVENTS
#ifdef MAC_OSX
extern void init_service_handler ();
static Lisp_Object Qservice, Qpaste, Qperform;
#endif
+
/* Window Event Handler */
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 **);
except `clear' (-> <clear>) on the KeyPad, `enter' (-> <kp-enter>)
on the right of the Cmd key on laptops, and fn + `enter' (->
<linefeed>). */
-static unsigned char keycode_to_xkeysym_table[] = {
+static const unsigned char keycode_to_xkeysym_table[] = {
/*0x00*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
/*0x10*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
/*0x20*/ 0, 0, 0, 0, 0x0d /*return*/, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
keyboard, and they may not be the same on other types of keyboards.
If the destination is identical to the source (f1 ... f12), it
doesn't map `fn' key to a modifier. */
-static unsigned char fn_keycode_to_keycode_table[] = {
+static const unsigned char fn_keycode_to_keycode_table[] = {
/*0x00*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
/*0x10*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
/*0x20*/ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
}
#endif
-static void
+#if !TARGET_API_MAC_CARBON
+void
do_apple_menu (SInt16 menu_item)
{
-#if !TARGET_API_MAC_CARBON
Str255 item_name;
SInt16 da_driver_refnum;
GetMenuItemText (GetMenuHandle (M_APPLE), menu_item, item_name);
da_driver_refnum = OpenDeskAcc (item_name);
}
-#endif /* !TARGET_API_MAC_CARBON */
}
-
-void
-do_menu_choice (SInt32 menu_choice)
-{
- SInt16 menu_id, menu_item;
-
- menu_id = HiWord (menu_choice);
- menu_item = LoWord (menu_choice);
-
- switch (menu_id)
- {
- case 0:
- break;
-
- case M_APPLE:
- do_apple_menu (menu_item);
- break;
-
- default:
- {
- struct frame *f = mac_focus_frame (&one_mac_display_info);
- MenuHandle menu = GetMenuHandle (menu_id);
- if (menu)
- {
- UInt32 refcon;
-
- GetMenuItemRefCon (menu, menu_item, &refcon);
- menubar_selection_callback (f, refcon);
- }
- }
- }
-
- HiliteMenu (0);
-}
-
+#endif /* !TARGET_API_MAC_CARBON */
/* Handle drags in size box. Based on code contributed by Ben
Mesander and IM - Window Manager A. */
static void
-do_grow_window (WindowPtr w, EventRecord *e)
+do_grow_window (w, e)
+ WindowPtr w;
+ const EventRecord *e;
{
Rect limit_rect;
int rows, columns, width, height;
}
+#if TARGET_API_MAC_CARBON
+static Point
+mac_get_ideal_size (f)
+ struct frame *f;
+{
+ struct mac_display_info *dpyinfo = FRAME_MAC_DISPLAY_INFO (f);
+ WindowPtr w = FRAME_MAC_WINDOW (f);
+ Point ideal_size;
+ Rect standard_rect;
+ int height, width, columns, rows;
+
+ ideal_size.h = FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, DEFAULT_NUM_COLS);
+ ideal_size.v = dpyinfo->height;
+ IsWindowInStandardState (w, &ideal_size, &standard_rect);
+ /* Adjust the standard size according to character boundaries. */
+ width = standard_rect.right - standard_rect.left;
+ height = standard_rect.bottom - standard_rect.top;
+ columns = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (f, width);
+ rows = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (f, height);
+ ideal_size.h = FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, columns);
+ ideal_size.v = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, rows);
+
+ return ideal_size;
+}
+#endif
+
/* Handle clicks in zoom box. Calculation of "standard state" based
on code in IM - Window Manager A and code contributed by Ben
Mesander. The standard state of an Emacs window is 80-characters
do_zoom_window (WindowPtr w, int zoom_in_or_out)
{
Rect zoom_rect, port_rect;
- int columns, rows, width, height;
+ int width, height;
struct frame *f = mac_window_to_frame (w);
- struct mac_display_info *dpyinfo = FRAME_MAC_DISPLAY_INFO (f);
#if TARGET_API_MAC_CARBON
- Point standard_size;
+ Point ideal_size = mac_get_ideal_size (f);
- standard_size.h = FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, DEFAULT_NUM_COLS);
- standard_size.v = dpyinfo->height;
-
- if (IsWindowInStandardState (w, &standard_size, &zoom_rect))
+ GetWindowBounds (w, kWindowContentRgn, &port_rect);
+ if (IsWindowInStandardState (w, &ideal_size, &zoom_rect)
+ && port_rect.left == zoom_rect.left
+ && port_rect.top == zoom_rect.top)
zoom_in_or_out = inZoomIn;
else
- {
- /* Adjust the standard size according to character boundaries. */
-
- columns = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (f, zoom_rect.right - zoom_rect.left);
- rows = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (f, zoom_rect.bottom - zoom_rect.top);
- standard_size.h = FRAME_TEXT_COLS_TO_PIXEL_WIDTH (f, columns);
- standard_size.v = FRAME_TEXT_LINES_TO_PIXEL_HEIGHT (f, rows);
- GetWindowBounds (w, kWindowContentRgn, &port_rect);
- if (IsWindowInStandardState (w, &standard_size, &zoom_rect)
- && port_rect.left == zoom_rect.left
- && port_rect.top == zoom_rect.top)
- zoom_in_or_out = inZoomIn;
- else
- zoom_in_or_out = inZoomOut;
- }
+ zoom_in_or_out = inZoomOut;
- ZoomWindowIdeal (w, zoom_in_or_out, &standard_size);
+#ifdef MAC_OS8
+ mac_clear_window (f);
+#endif
+ ZoomWindowIdeal (w, zoom_in_or_out, &ideal_size);
#else /* not TARGET_API_MAC_CARBON */
GrafPtr save_port;
Point top_left;
- int w_title_height;
+ int w_title_height, rows;
+ struct mac_display_info *dpyinfo = FRAME_MAC_DISPLAY_INFO (f);
GetPort (&save_port);
SetPort (save_port);
#endif /* not TARGET_API_MAC_CARBON */
+#if !USE_CARBON_EVENTS
/* retrieve window size and update application values */
#if TARGET_API_MAC_CARBON
GetWindowPortBounds (w, &port_rect);
height = port_rect.bottom - port_rect.top;
width = port_rect.right - port_rect.left;
- if (width != FRAME_PIXEL_WIDTH (f)
- || height != FRAME_PIXEL_HEIGHT (f))
- {
- rows = FRAME_PIXEL_HEIGHT_TO_TEXT_LINES (f, height);
- columns = FRAME_PIXEL_WIDTH_TO_TEXT_COLS (f, width);
-
- change_frame_size (f, rows, columns, 0, 1, 0);
- SET_FRAME_GARBAGED (f);
- cancel_mouse_face (f);
-
- FRAME_PIXEL_WIDTH (f) = width;
- FRAME_PIXEL_HEIGHT (f) = height;
- }
- x_real_positions (f, &f->left_pos, &f->top_pos);
+ mac_handle_size_change (f, width, height);
+ mac_handle_origin_change (f);
+#endif
}
void
Lisp_Object class_key, id_key;
EventRef event;
UInt32 num_params;
- EventParamName *names;
- EventParamType *types;
+ const EventParamName *names;
+ const EventParamType *types;
{
OSStatus err = eventNotHandledErr;
Lisp_Object binding;
{
mac_store_apple_event (class_key, id_key, &apple_event);
AEDisposeDesc (&apple_event);
- /* Post a harmless event so as to wake up from
- ReceiveNextEvent. */
- mac_post_mouse_moved_event ();
+ mac_wakeup_from_rne ();
}
}
}
{
OSStatus result, err;
HICommand command;
- static EventParamName names[] = {kEventParamDirectObject,
- kEventParamKeyModifiers};
- static EventParamType types[] = {typeHICommand,
- typeUInt32};
+ static const EventParamName names[] =
+ {kEventParamDirectObject, kEventParamKeyModifiers};
+ static const EventParamType types[] =
+ {typeHICommand, typeUInt32};
int num_params = sizeof (names) / sizeof (names[0]);
result = CallNextEventHandler (next_handler, event);
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}};
+ static const EventTypeSpec specs[] =
+ {{kEventClassCommand, kEventCommandProcess}};
static EventHandlerUPP handle_command_eventUPP = NULL;
if (handle_command_eventUPP == NULL)
{
WindowPtr wp;
OSStatus result, err;
+ struct frame *f;
UInt32 attributes;
XSizeHints *size_hints;
if (err != noErr)
return eventNotHandledErr;
+ f = mac_window_to_frame (wp);
switch (GetEventKind (event))
{
case kEventWindowUpdate:
do_window_update (wp);
return noErr;
+ case kEventWindowGetIdealSize:
+ result = CallNextEventHandler (next_handler, event);
+ if (result != eventNotHandledErr)
+ return result;
+
+ {
+ Point ideal_size = mac_get_ideal_size (f);
+
+ err = SetEventParameter (event, kEventParamDimensions,
+ typeQDPoint, sizeof (Point), &ideal_size);
+ if (err == noErr)
+ return noErr;
+ }
+ break;
+
case kEventWindowBoundsChanging:
result = CallNextEventHandler (next_handler, event);
if (result != eventNotHandledErr)
if (err != noErr)
break;
- size_hints = FRAME_SIZE_HINTS (mac_window_to_frame (wp));
+ size_hints = FRAME_SIZE_HINTS (f);
if ((attributes & kWindowBoundsChangeUserResize)
&& ((size_hints->flags & (PResizeInc | PBaseSize | PMinSize))
== (PResizeInc | PBaseSize | PMinSize)))
}
break;
+ case kEventWindowBoundsChanged:
+ err = GetEventParameter (event, kEventParamAttributes, typeUInt32,
+ NULL, sizeof (UInt32), NULL, &attributes);
+ if (err != noErr)
+ break;
+
+ if (attributes & kWindowBoundsChangeSizeChanged)
+ {
+ Rect bounds;
+
+ err = GetEventParameter (event, kEventParamCurrentBounds,
+ typeQDRectangle, NULL, sizeof (Rect),
+ NULL, &bounds);
+ if (err == noErr)
+ {
+ int width, height;
+
+ width = bounds.right - bounds.left;
+ height = bounds.bottom - bounds.top;
+ mac_handle_size_change (f, width, height);
+ }
+ }
+
+ if (attributes & kWindowBoundsChangeOriginChanged)
+ mac_handle_origin_change (f);
+
+ return noErr;
+
case kEventWindowShown:
case kEventWindowHidden:
case kEventWindowExpanded:
case kEventWindowCollapsed:
result = CallNextEventHandler (next_handler, event);
- mac_handle_visibility_change (mac_window_to_frame (wp));
+ mac_handle_visibility_change (f);
return noErr;
break;
+ case kEventWindowClose:
+ result = CallNextEventHandler (next_handler, event);
+ {
+ struct input_event buf;
+
+ EVENT_INIT (buf);
+ buf.kind = DELETE_WINDOW_EVENT;
+ XSETFRAME (buf.frame_or_window, f);
+ buf.arg = Qnil;
+ kbd_buffer_store_event (&buf);
+ }
+ return noErr;
+
#ifdef MAC_OSX
case kEventWindowToolbarSwitchMode:
result = CallNextEventHandler (next_handler, event);
{
- static EventParamName names[] = {kEventParamDirectObject,
- kEventParamWindowMouseLocation,
- kEventParamKeyModifiers,
- kEventParamMouseButton,
- kEventParamClickCount,
- kEventParamMouseChord};
- static EventParamType types[] = {typeWindowRef,
- typeQDPoint,
- typeUInt32,
- typeMouseButton,
- typeUInt32,
- typeUInt32};
+ static const EventParamName names[] = {kEventParamDirectObject,
+ kEventParamWindowMouseLocation,
+ kEventParamKeyModifiers,
+ kEventParamMouseButton,
+ kEventParamClickCount,
+ kEventParamMouseChord};
+ static const EventParamType types[] = {typeWindowRef,
+ typeQDPoint,
+ typeUInt32,
+ typeMouseButton,
+ typeUInt32,
+ typeUInt32};
int num_params = sizeof (names) / sizeof (names[0]);
err = mac_store_event_ref_as_apple_event (0, 0,
OSStatus result, err;
Lisp_Object id_key;
int num_params;
- EventParamName *names;
- EventParamType *types;
- static EventParamName names_sel[] = {kEventParamATSUFontID,
- kEventParamATSUFontSize,
- kEventParamFMFontFamily,
- kEventParamFMFontSize,
- kEventParamFontColor};
- static EventParamType types_sel[] = {typeATSUFontID,
- typeATSUSize,
- typeFMFontFamily,
- typeFMFontSize,
- typeFontColor};
+ const EventParamName *names;
+ const EventParamType *types;
+ static const EventParamName names_sel[] = {kEventParamATSUFontID,
+ kEventParamATSUFontSize,
+ kEventParamFMFontFamily,
+ kEventParamFMFontSize,
+ kEventParamFontColor};
+ static const EventParamType types_sel[] = {typeATSUFontID,
+ typeATSUSize,
+ typeFMFontFamily,
+ typeFMFontSize,
+ typeFontColor};
result = CallNextEventHandler (next_handler, event);
if (result != eventNotHandledErr)
OSStatus result, err = noErr;
Lisp_Object id_key = Qnil;
int num_params;
- EventParamName *names;
- EventParamType *types;
+ const EventParamName *names;
+ const EventParamType *types;
static UInt32 seqno_uaia = 0;
- static EventParamName names_uaia[] =
+ static const EventParamName names_uaia[] =
{kEventParamTextInputSendComponentInstance,
kEventParamTextInputSendRefCon,
kEventParamTextInputSendSLRec,
kEventParamTextInputSendTextServiceEncoding,
kEventParamTextInputSendTextServiceMacEncoding,
EVENT_PARAM_TEXT_INPUT_SEQUENCE_NUMBER};
- static EventParamType types_uaia[] =
+ static const EventParamType types_uaia[] =
{typeComponentInstance,
typeLongInteger,
typeIntlWritingCode,
typeUInt32,
typeUInt32,
typeUInt32};
- static EventParamName names_ufke[] =
+ static const EventParamName names_ufke[] =
{kEventParamTextInputSendComponentInstance,
kEventParamTextInputSendRefCon,
kEventParamTextInputSendSLRec,
kEventParamTextInputSendText};
- static EventParamType types_ufke[] =
+ static const EventParamType types_ufke[] =
{typeComponentInstance,
typeLongInteger,
typeIntlWritingCode,
read_socket_inev->kind = ASCII_KEYSTROKE_EVENT;
read_socket_inev->code = code;
read_socket_inev->modifiers =
+ mac_to_emacs_modifiers (modifiers);
+ read_socket_inev->modifiers |=
(extra_keyboard_modifiers
& (meta_modifier | alt_modifier
| hyper_modifier | super_modifier));
OSStatus err;
Lisp_Object id_key;
int num_params;
- EventParamName *names;
- EventParamType *types;
- static EventParamName names_pfm[] = {kEventParamServiceMessageName,
- kEventParamServiceUserData};
- static EventParamType types_pfm[] = {typeCFStringRef,
- typeCFStringRef};
+ const EventParamName *names;
+ const EventParamType *types;
+ static const EventParamName names_pfm[] =
+ {kEventParamServiceMessageName, kEventParamServiceUserData};
+ static const EventParamType types_pfm[] =
+ {typeCFStringRef, typeCFStringRef};
switch (GetEventKind (event))
{
#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[] =
+ static const EventTypeSpec specs_window[] =
{{kEventClassWindow, kEventWindowUpdate},
+ {kEventClassWindow, kEventWindowGetIdealSize},
{kEventClassWindow, kEventWindowBoundsChanging},
+ {kEventClassWindow, kEventWindowBoundsChanged},
{kEventClassWindow, kEventWindowShown},
{kEventClassWindow, kEventWindowHidden},
{kEventClassWindow, kEventWindowExpanded},
{kEventClassWindow, kEventWindowCollapsed},
+ {kEventClassWindow, kEventWindowClose},
#ifdef MAC_OSX
{kEventClassWindow, kEventWindowToolbarSwitchMode},
#endif
{kEventClassWindow, kEventWindowFocusRelinquish},
#endif
};
- EventTypeSpec specs_mouse[] = {{kEventClassMouse, kEventMouseWheelMoved}};
+ static const EventTypeSpec specs_mouse[] =
+ {{kEventClassMouse, kEventMouseWheelMoved}};
static EventHandlerUPP handle_window_eventUPP = NULL;
static EventHandlerUPP handle_mouse_eventUPP = NULL;
#if USE_MAC_FONT_PANEL
- EventTypeSpec specs_font[] = {{kEventClassFont, kEventFontPanelClosed},
- {kEventClassFont, kEventFontSelection}};
+ static const EventTypeSpec specs_font[] =
+ {{kEventClassFont, kEventFontPanelClosed},
+ {kEventClassFont, kEventFontSelection}};
static EventHandlerUPP handle_font_eventUPP = NULL;
#endif
#if USE_MAC_TSM
- EventTypeSpec specs_text_input[] =
+ static const EventTypeSpec specs_text_input[] =
{{kEventClassTextInput, kEventTextInputUpdateActiveInputArea},
{kEventClassTextInput, kEventTextInputUnicodeForKeyEvent},
{kEventClassTextInput, kEventTextInputOffsetToPos}};
#endif
if (err == noErr)
err = install_drag_handler (window);
+ if (err == noErr)
+ err = install_menu_target_item_handler (window);
return err;
}
#if __MWERKS__
/* set creator and type for files created by MSL */
- _fcreator = 'EMAx';
+ _fcreator = MAC_EMACS_CREATOR_CODE;
_ftype = 'TEXT';
#endif
#else
FrontWindow ()
#endif
- != window_ptr)
+ != window_ptr
+ || (mac_window_to_frame (window_ptr)
+ != dpyinfo->x_focus_frame))
SelectWindow (window_ptr);
else
{
DragWindow (window_ptr, er.where, &qd.screenBits.bounds);
#endif /* not TARGET_API_MAC_CARBON */
/* Update the frame parameters. */
+#if !USE_CARBON_EVENTS
{
struct frame *f = mac_window_to_frame (window_ptr);
if (f && !f->async_iconified)
- x_real_positions (f, &f->left_pos, &f->top_pos);
+ mac_handle_origin_change (f);
}
+#endif
break;
case inGoAway:
else
{
/* Generate SELECT_WINDOW_EVENTs when needed. */
- if (mouse_autoselect_window)
+ if (!NILP (Vmouse_autoselect_window))
{
Lisp_Object window;
static XrmDatabase
mac_make_rdb (xrm_option)
- char *xrm_option;
+ const char *xrm_option;
{
XrmDatabase database;
init_menu_bar ()
{
#ifdef MAC_OSX
- OSErr err;
+ OSStatus err;
MenuRef menu;
MenuItemIndex menu_index;
#endif
#if USE_CG_DRAWING
+ init_cg_color ();
+
mac_init_fringe ();
#endif
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);
DEFVAR_BOOL ("x-use-underline-position-properties",
&x_use_underline_position_properties,
doc: /* *Non-nil means make use of UNDERLINE_POSITION font properties.
-nil means ignore them. If you encounter fonts with bogus
+A value of nil means ignore them. If you encounter fonts with bogus
UNDERLINE_POSITION font properties, for example 7x13 on XFree prior
to 4.1, set this to nil.
NOTE: Not supported on Mac yet. */);
x_use_underline_position_properties = 0;
+ DEFVAR_BOOL ("x-underline-at-descent-line",
+ &x_underline_at_descent_line,
+ doc: /* *Non-nil means to draw the underline at the same place as the descent line.
+A value of nil means to draw the underline according to the value of the
+variable `x-use-underline-position-properties', which is usually at the
+baseline level. The default value is nil. */);
+ x_underline_at_descent_line = 0;
+
DEFVAR_LISP ("x-toolkit-scroll-bars", &Vx_toolkit_scroll_bars,
doc: /* If not nil, Emacs uses toolkit scroll bars. */);
#ifdef USE_TOOLKIT_SCROLL_BARS
&Vmac_emulate_three_button_mouse,
doc: /* *Specify a way of three button mouse emulation.
The value can be nil, t, or the symbol `reverse'.
-nil means that no emulation should be done and the modifiers should be
-placed on the mouse-1 event.
+A value of nil means that no emulation should be done and the modifiers
+should be placed on the mouse-1 event.
t means that when the option-key is held down while pressing the mouse
button, the click will register as mouse-2 and while the command-key
is held down, the click will register as mouse-3.
Fcons (list3 (build_string ("mac-roman"),
make_number (smRoman), Qnil), Qnil);
-#if USE_ATSUI
- DEFVAR_LISP ("mac-atsu-font-table", &Vmac_atsu_font_table,
- doc: /* Hash table of ATSU font IDs vs plist of attributes and values. */);
- Vmac_atsu_font_table =
- make_hash_table (Qeql, make_number (DEFAULT_HASH_SIZE),
- make_float (DEFAULT_REHASH_SIZE),
- make_float (DEFAULT_REHASH_THRESHOLD),
- Qnil, Qnil, Qnil);
-#endif
#if USE_MAC_TSM
DEFVAR_LISP ("mac-ts-active-input-overlay", &Vmac_ts_active_input_overlay,
doc: /* Overlay used to display Mac TSM active input area. */);