165 |
/* Where the mouse was last time we reported a mouse event. */ |
/* Where the mouse was last time we reported a mouse event. */ |
166 |
|
|
167 |
static Rect last_mouse_glyph; |
static Rect last_mouse_glyph; |
168 |
|
static FRAME_PTR last_mouse_glyph_frame; |
169 |
|
|
170 |
/* The scroll bar in which the last X motion event occurred. |
/* The scroll bar in which the last X motion event occurred. |
171 |
|
|
717 |
#ifndef WORDS_BIG_ENDIAN |
#ifndef WORDS_BIG_ENDIAN |
718 |
{ |
{ |
719 |
int i; |
int i; |
720 |
Unichar *text = (Unichar *)buf; |
UniChar *text = (UniChar *)buf; |
721 |
|
|
722 |
for (i = 0; i < nchars; i++) |
for (i = 0; i < nchars; i++) |
723 |
text[i] = buf[2*i] << 8 | buf[2*i+1]; |
text[i] = EndianU16_BtoN (text[i]); |
724 |
} |
} |
725 |
#endif |
#endif |
726 |
err = atsu_get_text_layout_with_text_ptr ((ConstUniCharArrayPtr)buf, |
err = atsu_get_text_layout_with_text_ptr ((ConstUniCharArrayPtr)buf, |
774 |
ATSUDrawText (text_layout, |
ATSUDrawText (text_layout, |
775 |
kATSUFromTextBeginning, kATSUToTextEnd, |
kATSUFromTextBeginning, kATSUToTextEnd, |
776 |
Long2Fix (x), Long2Fix (port_height - y)); |
Long2Fix (x), Long2Fix (port_height - y)); |
|
ATSUClearLayoutControls (text_layout, |
|
|
sizeof (tags) / sizeof (tags[0]), |
|
|
tags); |
|
777 |
CGContextSynchronize (context); |
CGContextSynchronize (context); |
778 |
QDEndCGContext (port, &context); |
QDEndCGContext (port, &context); |
779 |
|
#if 0 |
780 |
|
/* This doesn't work on Mac OS X 10.1. */ |
781 |
|
ATSUClearLayoutControls (text_layout, |
782 |
|
sizeof (tags) / sizeof (tags[0]), |
783 |
|
tags); |
784 |
|
#else |
785 |
|
ATSUSetLayoutControls (text_layout, |
786 |
|
sizeof (tags) / sizeof (tags[0]), |
787 |
|
tags, sizes, values); |
788 |
|
#endif |
789 |
} |
} |
790 |
#endif |
#endif |
791 |
} |
} |
1674 |
if (err == noErr) |
if (err == noErr) |
1675 |
err = ATSUGetGlyphBounds (text_layout, 0, 0, |
err = ATSUGetGlyphBounds (text_layout, 0, 0, |
1676 |
kATSUFromTextBeginning, kATSUToTextEnd, |
kATSUFromTextBeginning, kATSUToTextEnd, |
1677 |
kATSUseFractionalOrigins, 1, |
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1020 |
1678 |
&glyph_bounds, NULL); |
kATSUseFractionalOrigins, |
1679 |
|
#else |
1680 |
|
kATSUseDeviceOrigins, |
1681 |
|
#endif |
1682 |
|
1, &glyph_bounds, NULL); |
1683 |
UNBLOCK_INPUT; |
UNBLOCK_INPUT; |
1684 |
if (err != noErr) |
if (err != noErr) |
1685 |
pcm = NULL; |
pcm = NULL; |
3922 |
return 1; |
return 1; |
3923 |
} |
} |
3924 |
/* Has the mouse moved off the glyph it was on at the last sighting? */ |
/* Has the mouse moved off the glyph it was on at the last sighting? */ |
3925 |
if (!PtInRect (*pos, &last_mouse_glyph)) |
if (frame != last_mouse_glyph_frame |
3926 |
|
|| !PtInRect (*pos, &last_mouse_glyph)) |
3927 |
{ |
{ |
3928 |
frame->mouse_moved = 1; |
frame->mouse_moved = 1; |
3929 |
last_mouse_scroll_bar = Qnil; |
last_mouse_scroll_bar = Qnil; |
3930 |
note_mouse_highlight (frame, pos->h, pos->v); |
note_mouse_highlight (frame, pos->h, pos->v); |
3931 |
/* Remember which glyph we're now on. */ |
/* Remember which glyph we're now on. */ |
3932 |
remember_mouse_glyph (frame, pos->h, pos->v, &last_mouse_glyph); |
remember_mouse_glyph (frame, pos->h, pos->v, &last_mouse_glyph); |
3933 |
|
last_mouse_glyph_frame = frame; |
3934 |
return 1; |
return 1; |
3935 |
} |
} |
3936 |
|
|
4035 |
GetMouse (&mouse_pos); |
GetMouse (&mouse_pos); |
4036 |
remember_mouse_glyph (f1, mouse_pos.h, mouse_pos.v, |
remember_mouse_glyph (f1, mouse_pos.h, mouse_pos.v, |
4037 |
&last_mouse_glyph); |
&last_mouse_glyph); |
4038 |
|
last_mouse_glyph_frame = f1; |
4039 |
|
|
4040 |
*bar_window = Qnil; |
*bar_window = Qnil; |
4041 |
*part = 0; |
*part = 0; |
6587 |
|
|
6588 |
sprintf (xf, "%s-%c-normal--%d-%d-%d-%d-m-%d-%s", |
sprintf (xf, "%s-%c-normal--%d-%d-%d-%d-m-%d-%s", |
6589 |
style & bold ? "bold" : "medium", style & italic ? 'i' : 'r', |
style & bold ? "bold" : "medium", style & italic ? 'i' : 'r', |
6590 |
size, size * 10, size ? 75 : 0, size ? 75 : 0, size * 10, charset); |
size, size * 10, size ? 72 : 0, size ? 72 : 0, size * 10, charset); |
6591 |
|
|
6592 |
result = xmalloc (strlen (foundry) + strlen (family) + strlen (xf) + 3 + 1); |
result = xmalloc (strlen (foundry) + strlen (family) + strlen (xf) + 3 + 1); |
6593 |
sprintf (result, "-%s-%s-%s", foundry, family, xf); |
sprintf (result, "-%s-%s-%s", foundry, family, xf); |
7076 |
continue; |
continue; |
7077 |
memcpy (scaled, font_name_table[i], former_len); |
memcpy (scaled, font_name_table[i], former_len); |
7078 |
sprintf (scaled + former_len, |
sprintf (scaled + former_len, |
7079 |
"-%d-%d-75-75-m-%d-%s", |
"-%d-%d-72-72-m-%d-%s", |
7080 |
scl_val[XLFD_SCL_PIXEL_SIZE], |
scl_val[XLFD_SCL_PIXEL_SIZE], |
7081 |
scl_val[XLFD_SCL_POINT_SIZE], |
scl_val[XLFD_SCL_POINT_SIZE], |
7082 |
scl_val[XLFD_SCL_AVGWIDTH], |
scl_val[XLFD_SCL_AVGWIDTH], |
7424 |
if (err == noErr) |
if (err == noErr) |
7425 |
err = ATSUGetGlyphBounds (text_layout, 0, 0, |
err = ATSUGetGlyphBounds (text_layout, 0, 0, |
7426 |
kATSUFromTextBeginning, kATSUToTextEnd, |
kATSUFromTextBeginning, kATSUToTextEnd, |
7427 |
kATSUseFractionalOrigins, 1, |
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1020 |
7428 |
&glyph_bounds, NULL); |
kATSUseFractionalOrigins, |
7429 |
|
#else |
7430 |
|
kATSUseDeviceOrigins, |
7431 |
|
#endif |
7432 |
|
1, &glyph_bounds, NULL); |
7433 |
if (err == noErr) |
if (err == noErr) |
7434 |
{ |
{ |
7435 |
xassert (glyph_bounds.lowerRight.x - glyph_bounds.lowerLeft.x |
xassert (glyph_bounds.lowerRight.x - glyph_bounds.lowerLeft.x |
9520 |
!= eventNotHandledErr) |
!= eventNotHandledErr) |
9521 |
break; |
break; |
9522 |
#endif |
#endif |
9523 |
|
last_mouse_glyph_frame = 0; |
9524 |
|
|
9525 |
if (dpyinfo->grabbed && last_mouse_frame |
if (dpyinfo->grabbed && last_mouse_frame |
9526 |
&& FRAME_LIVE_P (last_mouse_frame)) |
&& FRAME_LIVE_P (last_mouse_frame)) |
10250 |
main_device_handle = LMGetMainDevice(); |
main_device_handle = LMGetMainDevice(); |
10251 |
|
|
10252 |
dpyinfo->reference_count = 0; |
dpyinfo->reference_count = 0; |
10253 |
dpyinfo->resx = 75.0; |
dpyinfo->resx = 72.0; |
10254 |
dpyinfo->resy = 75.0; |
dpyinfo->resy = 72.0; |
10255 |
dpyinfo->color_p = TestDeviceAttribute (main_device_handle, gdDevType); |
dpyinfo->color_p = TestDeviceAttribute (main_device_handle, gdDevType); |
10256 |
#ifdef MAC_OSX |
#ifdef MAC_OSX |
10257 |
/* HasDepth returns true if it is possible to have a 32 bit display, |
/* HasDepth returns true if it is possible to have a 32 bit display, |