279 |
static void x_draw_bar_cursor P_ ((struct window *, struct glyph_row *, int, |
static void x_draw_bar_cursor P_ ((struct window *, struct glyph_row *, int, |
280 |
enum text_cursor_kinds)); |
enum text_cursor_kinds)); |
281 |
|
|
282 |
static void x_clip_to_row P_ ((struct window *, struct glyph_row *, GC)); |
static void x_clip_to_row P_ ((struct window *, struct glyph_row *, int, GC)); |
283 |
static void x_flush P_ ((struct frame *f)); |
static void x_flush P_ ((struct frame *f)); |
284 |
static void x_update_begin P_ ((struct frame *)); |
static void x_update_begin P_ ((struct frame *)); |
285 |
static void x_update_window_begin P_ ((struct window *)); |
static void x_update_window_begin P_ ((struct window *)); |
567 |
Display *display; /* not used */ |
Display *display; /* not used */ |
568 |
WindowPtr w; |
WindowPtr w; |
569 |
unsigned int width, height; |
unsigned int width, height; |
570 |
unsigned int depth; /* not used */ |
unsigned int depth; |
571 |
{ |
{ |
572 |
Pixmap pixmap; |
Pixmap pixmap; |
573 |
Rect r; |
Rect r; |
643 |
} |
} |
644 |
|
|
645 |
|
|
646 |
|
#if 0 /* TODO: figure out if we need to do this on Mac. */ |
647 |
static void |
static void |
648 |
mac_fill_rectangle_to_pixmap (display, p, gc, x, y, width, height) |
mac_fill_rectangle_to_pixmap (display, p, gc, x, y, width, height) |
649 |
Display *display; |
Display *display; |
667 |
|
|
668 |
SetGWorld (old_port, old_gdh); |
SetGWorld (old_port, old_gdh); |
669 |
} |
} |
670 |
|
#endif |
671 |
|
|
672 |
|
|
673 |
/* Mac replacement for XDrawRectangle: dest is a window. */ |
/* Mac replacement for XDrawRectangle: dest is a window. */ |
691 |
} |
} |
692 |
|
|
693 |
|
|
694 |
|
#if 0 /* TODO: figure out if we need to do this on Mac. */ |
695 |
/* Mac replacement for XDrawRectangle: dest is a Pixmap. */ |
/* Mac replacement for XDrawRectangle: dest is a Pixmap. */ |
696 |
|
|
697 |
static void |
static void |
717 |
|
|
718 |
SetGWorld (old_port, old_gdh); |
SetGWorld (old_port, old_gdh); |
719 |
} |
} |
720 |
|
#endif |
721 |
|
|
722 |
|
|
723 |
static void |
static void |
912 |
int dest_x, dest_y; |
int dest_x, dest_y; |
913 |
{ |
{ |
914 |
#if TARGET_API_MAC_CARBON |
#if TARGET_API_MAC_CARBON |
915 |
Rect gw_r, src_r, dest_r; |
Rect src_r; |
916 |
|
RgnHandle dummy = NewRgn (); /* For avoiding update events. */ |
917 |
|
|
918 |
SetRect (&src_r, src_x, src_y, src_x + width, src_y + height); |
SetRect (&src_r, src_x, src_y, src_x + width, src_y + height); |
919 |
SetRect (&dest_r, dest_x, dest_y, dest_x + width, dest_y + height); |
ScrollWindowRect (w, &src_r, dest_x - src_x, dest_y - src_y, |
920 |
|
kScrollWindowNoOptions, dummy); |
921 |
SetPortWindowPort (w); |
DisposeRgn (dummy); |
|
|
|
|
ForeColor (blackColor); |
|
|
BackColor (whiteColor); |
|
|
|
|
|
LockPortBits (GetWindowPort (w)); |
|
|
{ |
|
|
const BitMap *bitmap = GetPortBitMapForCopyBits (GetWindowPort (w)); |
|
|
CopyBits (bitmap, bitmap, &src_r, &dest_r, srcCopy, 0); |
|
|
} |
|
|
UnlockPortBits (GetWindowPort (w)); |
|
|
|
|
|
mac_set_colors (gc); |
|
922 |
#else /* not TARGET_API_MAC_CARBON */ |
#else /* not TARGET_API_MAC_CARBON */ |
923 |
Rect src_r, dest_r; |
Rect src_r, dest_r; |
924 |
|
|
952 |
} |
} |
953 |
|
|
954 |
|
|
955 |
|
#if 0 /* TODO: figure out if we need to do this on Mac. */ |
956 |
/* Mac replacement for XCopyArea: dest must be Pixmap. */ |
/* Mac replacement for XCopyArea: dest must be Pixmap. */ |
957 |
|
|
958 |
static void |
static void |
1031 |
|
|
1032 |
SetGWorld (old_port, old_gdh); |
SetGWorld (old_port, old_gdh); |
1033 |
} |
} |
1034 |
|
#endif |
1035 |
|
|
1036 |
|
|
1037 |
/* Mac replacement for XChangeGC. */ |
/* Mac replacement for XChangeGC. */ |
1126 |
} |
} |
1127 |
|
|
1128 |
|
|
|
/* Remove calls to XFlush by defining XFlush to an empty replacement. |
|
|
Calls to XFlush should be unnecessary because the X output buffer |
|
|
is flushed automatically as needed by calls to XPending, |
|
|
XNextEvent, or XWindowEvent according to the XFlush man page. |
|
|
XTread_socket calls XPending. Removing XFlush improves |
|
|
performance. */ |
|
|
|
|
|
#if TARGET_API_MAC_CARBON |
|
|
#define XFlush(DISPLAY) QDFlushPortBuffer (GetQDGlobalsThePort (), NULL) |
|
|
#else |
|
|
#define XFlush(DISPLAY) (void) 0 |
|
|
#endif |
|
|
|
|
1129 |
/* Flush display of frame F, or of all frames if F is null. */ |
/* Flush display of frame F, or of all frames if F is null. */ |
1130 |
|
|
1131 |
void |
static void |
1132 |
x_flush (f) |
x_flush (f) |
1133 |
struct frame *f; |
struct frame *f; |
1134 |
{ |
{ |
1135 |
#if TARGET_API_MAC_CARBON |
#if TARGET_API_MAC_CARBON |
1136 |
BLOCK_INPUT; |
BLOCK_INPUT; |
1137 |
if (f == NULL) |
if (f) |
1138 |
{ |
QDFlushPortBuffer (GetWindowPort (FRAME_MAC_WINDOW (f)), NULL); |
1139 |
Lisp_Object rest, frame; |
else |
1140 |
FOR_EACH_FRAME (rest, frame) |
QDFlushPortBuffer (GetQDGlobalsThePort (), NULL); |
|
x_flush (XFRAME (frame)); |
|
|
} |
|
|
else if (FRAME_MAC_P (f)) |
|
|
XFlush (FRAME_MAC_DISPLAY (f)); |
|
1141 |
UNBLOCK_INPUT; |
UNBLOCK_INPUT; |
1142 |
#endif /* TARGET_API_MAC_CARBON */ |
#endif |
1143 |
} |
} |
1144 |
|
|
1145 |
|
|
1146 |
|
/* Remove calls to XFlush by defining XFlush to an empty replacement. |
1147 |
|
Calls to XFlush should be unnecessary because the X output buffer |
1148 |
|
is flushed automatically as needed by calls to XPending, |
1149 |
|
XNextEvent, or XWindowEvent according to the XFlush man page. |
1150 |
|
XTread_socket calls XPending. Removing XFlush improves |
1151 |
|
performance. */ |
1152 |
|
|
1153 |
|
#define XFlush(DISPLAY) (void) 0 |
1154 |
|
|
1155 |
|
|
1156 |
/* Return the struct mac_display_info corresponding to DPY. There's |
/* Return the struct mac_display_info corresponding to DPY. There's |
1157 |
only one. */ |
only one. */ |
1441 |
int oldVH = row->visible_height; |
int oldVH = row->visible_height; |
1442 |
row->visible_height = p->h; |
row->visible_height = p->h; |
1443 |
row->y -= rowY - p->y; |
row->y -= rowY - p->y; |
1444 |
x_clip_to_row (w, row, gc); |
x_clip_to_row (w, row, -1, gc); |
1445 |
row->y = oldY; |
row->y = oldY; |
1446 |
row->visible_height = oldVH; |
row->visible_height = oldVH; |
1447 |
} |
} |
1448 |
else |
else |
1449 |
x_clip_to_row (w, row, gc); |
x_clip_to_row (w, row, -1, gc); |
1450 |
|
|
1451 |
if (p->bx >= 0 && !p->overlay_p) |
if (p->bx >= 0 && !p->overlay_p) |
1452 |
{ |
{ |
1944 |
} |
} |
1945 |
|
|
1946 |
|
|
1947 |
|
/* We prefer not to use XDrawImageString (srcCopy text transfer mode) |
1948 |
|
on Mac OS X because: |
1949 |
|
- Screen is double-buffered. (In srcCopy mode, a text is drawn |
1950 |
|
into an offscreen graphics world first. So performance gain |
1951 |
|
cannot be expected.) |
1952 |
|
- It lowers rendering quality. |
1953 |
|
- Some fonts leave garbage on cursor movement. */ |
1954 |
|
|
1955 |
/* Draw the background of glyph_string S. If S->background_filled_p |
/* Draw the background of glyph_string S. If S->background_filled_p |
1956 |
is non-zero don't draw it. FORCE_P non-zero means draw the |
is non-zero don't draw it. FORCE_P non-zero means draw the |
1957 |
background even if it wouldn't be drawn normally. This is used |
background even if it wouldn't be drawn normally. This is used |
1983 |
} |
} |
1984 |
else |
else |
1985 |
#endif |
#endif |
1986 |
|
#if 0 /* defined(MAC_OS8)*/ |
1987 |
if (FONT_HEIGHT (s->font) < s->height - 2 * box_line_width |
if (FONT_HEIGHT (s->font) < s->height - 2 * box_line_width |
1988 |
|| s->font_not_found_p |
|| s->font_not_found_p |
1989 |
|| s->extends_to_end_of_line_p |
|| s->extends_to_end_of_line_p |
1990 |
|| force_p) |
|| force_p) |
1991 |
|
#endif |
1992 |
{ |
{ |
1993 |
x_clear_glyph_string_rect (s, s->x, s->y + box_line_width, |
x_clear_glyph_string_rect (s, s->x, s->y + box_line_width, |
1994 |
s->background_width, |
s->background_width, |
2041 |
for (i = 0; i < s->nchars; ++i) |
for (i = 0; i < s->nchars; ++i) |
2042 |
char1b[i] = s->char2b[i].byte2; |
char1b[i] = s->char2b[i].byte2; |
2043 |
|
|
2044 |
|
#if 0 /* defined(MAC_OS8) */ |
2045 |
/* Draw text with XDrawString if background has already been |
/* Draw text with XDrawString if background has already been |
2046 |
filled. Otherwise, use XDrawImageString. (Note that |
filled. Otherwise, use XDrawImageString. (Note that |
2047 |
XDrawImageString is usually faster than XDrawString.) Always |
XDrawImageString is usually faster than XDrawString.) Always |
2049 |
no chance that characters under a box cursor are invisible. */ |
no chance that characters under a box cursor are invisible. */ |
2050 |
if (s->for_overlaps_p |
if (s->for_overlaps_p |
2051 |
|| (s->background_filled_p && s->hl != DRAW_CURSOR)) |
|| (s->background_filled_p && s->hl != DRAW_CURSOR)) |
2052 |
|
#endif |
2053 |
{ |
{ |
2054 |
/* Draw characters with 16-bit or 8-bit functions. */ |
/* Draw characters with 16-bit or 8-bit functions. */ |
2055 |
if (s->two_byte_p) |
if (s->two_byte_p) |
2059 |
XDrawString (s->display, s->window, s->gc, x, |
XDrawString (s->display, s->window, s->gc, x, |
2060 |
s->ybase - boff, char1b, s->nchars); |
s->ybase - boff, char1b, s->nchars); |
2061 |
} |
} |
2062 |
|
#if 0 /* defined(MAC_OS8)*/ |
2063 |
else |
else |
2064 |
{ |
{ |
2065 |
if (s->two_byte_p) |
if (s->two_byte_p) |
2069 |
XDrawImageString (s->display, s->window, s->gc, x, |
XDrawImageString (s->display, s->window, s->gc, x, |
2070 |
s->ybase - boff, char1b, s->nchars); |
s->ybase - boff, char1b, s->nchars); |
2071 |
} |
} |
2072 |
|
#endif |
2073 |
} |
} |
2074 |
} |
} |
2075 |
|
|
2636 |
|
|
2637 |
if (s->img->pixmap) |
if (s->img->pixmap) |
2638 |
{ |
{ |
2639 |
if (s->img->mask) |
x_set_glyph_string_clipping (s); |
|
{ |
|
|
Rect nr; |
|
|
XRectangle clip_rect, image_rect, r; |
|
2640 |
|
|
2641 |
get_glyph_string_clip_rect (s, &nr); |
if (s->img->mask) |
2642 |
CONVERT_TO_XRECT (clip_rect, nr); |
mac_copy_area_with_mask (s->display, s->img->pixmap, s->img->mask, |
2643 |
image_rect.x = x; |
s->window, s->gc, s->slice.x, s->slice.y, |
2644 |
image_rect.y = y; |
s->slice.width, s->slice.height, x, y); |
|
image_rect.width = s->slice.width; |
|
|
image_rect.height = s->slice.height; |
|
|
if (x_intersect_rectangles (&clip_rect, &image_rect, &r)) |
|
|
mac_copy_area_with_mask (s->display, s->img->pixmap, s->img->mask, |
|
|
s->window, s->gc, |
|
|
s->slice.x + r.x - x, s->slice.y + r.y - y, |
|
|
r.width, r.height, r.x, r.y); |
|
|
} |
|
2645 |
else |
else |
2646 |
{ |
{ |
2647 |
Rect nr; |
mac_copy_area (s->display, s->img->pixmap, |
2648 |
XRectangle clip_rect, image_rect, r; |
s->window, s->gc, s->slice.x, s->slice.y, |
2649 |
|
s->slice.width, s->slice.height, x, y); |
|
get_glyph_string_clip_rect (s, &nr); |
|
|
CONVERT_TO_XRECT (clip_rect, nr); |
|
|
image_rect.x = x; |
|
|
image_rect.y = y; |
|
|
image_rect.width = s->slice.width; |
|
|
image_rect.height = s->slice.height; |
|
|
if (x_intersect_rectangles (&clip_rect, &image_rect, &r)) |
|
|
mac_copy_area (s->display, s->img->pixmap, s->window, s->gc, |
|
|
s->slice.x + r.x - x, s->slice.y + r.y - y, |
|
|
r.width, r.height, r.x, r.y); |
|
2650 |
|
|
2651 |
/* When the image has a mask, we can expect that at |
/* When the image has a mask, we can expect that at |
2652 |
least part of a mouse highlight or a block cursor will |
least part of a mouse highlight or a block cursor will |
2725 |
} |
} |
2726 |
|
|
2727 |
|
|
2728 |
|
#if 0 /* TODO: figure out if we need to do this on Mac. */ |
2729 |
/* Draw the foreground of image glyph string S to PIXMAP. */ |
/* Draw the foreground of image glyph string S to PIXMAP. */ |
2730 |
|
|
2731 |
static void |
static void |
2786 |
mac_draw_rectangle_to_pixmap (s->display, pixmap, s->gc, x, y, |
mac_draw_rectangle_to_pixmap (s->display, pixmap, s->gc, x, y, |
2787 |
s->slice.width - 1, s->slice.height - 1); |
s->slice.width - 1, s->slice.height - 1); |
2788 |
} |
} |
2789 |
|
#endif |
2790 |
|
|
2791 |
|
|
2792 |
/* Draw part of the background of glyph string S. X, Y, W, and H |
/* Draw part of the background of glyph string S. X, Y, W, and H |
2858 |
if (s->slice.y == 0) |
if (s->slice.y == 0) |
2859 |
y += box_line_vwidth; |
y += box_line_vwidth; |
2860 |
|
|
2861 |
|
#if 0 /* TODO: figure out if we need to do this on Mac. */ |
2862 |
if (s->img->mask) |
if (s->img->mask) |
2863 |
{ |
{ |
2864 |
/* Create a pixmap as large as the glyph string. Fill it |
/* Create a pixmap as large as the glyph string. Fill it |
2895 |
} |
} |
2896 |
} |
} |
2897 |
else |
else |
2898 |
|
#endif |
2899 |
x_draw_glyph_string_bg_rect (s, x, y, s->background_width, height); |
x_draw_glyph_string_bg_rect (s, x, y, s->background_width, height); |
2900 |
|
|
2901 |
s->background_filled_p = 1; |
s->background_filled_p = 1; |
2902 |
} |
} |
2903 |
|
|
2904 |
/* Draw the foreground. */ |
/* Draw the foreground. */ |
2905 |
|
#if 0 /* TODO: figure out if we need to do this on Mac. */ |
2906 |
if (pixmap != 0) |
if (pixmap != 0) |
2907 |
{ |
{ |
2908 |
x_draw_image_foreground_1 (s, pixmap); |
x_draw_image_foreground_1 (s, pixmap); |
2913 |
XFreePixmap (s->display, pixmap); |
XFreePixmap (s->display, pixmap); |
2914 |
} |
} |
2915 |
else |
else |
2916 |
|
#endif |
2917 |
x_draw_image_foreground (s); |
x_draw_image_foreground (s); |
2918 |
|
|
2919 |
/* If we must draw a relief around the image, do it. */ |
/* If we must draw a relief around the image, do it. */ |
4601 |
mode lines must be clipped to the whole window. */ |
mode lines must be clipped to the whole window. */ |
4602 |
|
|
4603 |
static void |
static void |
4604 |
x_clip_to_row (w, row, gc) |
x_clip_to_row (w, row, area, gc) |
4605 |
struct window *w; |
struct window *w; |
4606 |
struct glyph_row *row; |
struct glyph_row *row; |
4607 |
|
int area; |
4608 |
GC gc; |
GC gc; |
4609 |
{ |
{ |
4610 |
struct frame *f = XFRAME (WINDOW_FRAME (w)); |
struct frame *f = XFRAME (WINDOW_FRAME (w)); |
4611 |
Rect clip_rect; |
Rect clip_rect; |
4612 |
int window_y, window_width; |
int window_x, window_y, window_width; |
4613 |
|
|
4614 |
window_box (w, -1, 0, &window_y, &window_width, 0); |
window_box (w, area, &window_x, &window_y, &window_width, 0); |
4615 |
|
|
4616 |
clip_rect.left = WINDOW_TO_FRAME_PIXEL_X (w, 0); |
clip_rect.left = window_x; |
4617 |
clip_rect.top = WINDOW_TO_FRAME_PIXEL_Y (w, row->y); |
clip_rect.top = WINDOW_TO_FRAME_PIXEL_Y (w, row->y); |
4618 |
clip_rect.top = max (clip_rect.top, window_y); |
clip_rect.top = max (clip_rect.top, window_y); |
4619 |
clip_rect.right = clip_rect.left + window_width; |
clip_rect.right = clip_rect.left + window_width; |
4679 |
gc = dpyinfo->scratch_cursor_gc; |
gc = dpyinfo->scratch_cursor_gc; |
4680 |
|
|
4681 |
/* Set clipping, draw the rectangle, and reset clipping again. */ |
/* Set clipping, draw the rectangle, and reset clipping again. */ |
4682 |
x_clip_to_row (w, row, gc); |
x_clip_to_row (w, row, TEXT_AREA, gc); |
4683 |
mac_draw_rectangle (dpy, FRAME_MAC_WINDOW (f), gc, x, y, wd, h); |
mac_draw_rectangle (dpy, FRAME_MAC_WINDOW (f), gc, x, y, wd, h); |
4684 |
mac_reset_clipping (dpy, FRAME_MAC_WINDOW (f)); |
mac_reset_clipping (dpy, FRAME_MAC_WINDOW (f)); |
4685 |
} |
} |
4750 |
width = min (cursor_glyph->pixel_width, width); |
width = min (cursor_glyph->pixel_width, width); |
4751 |
|
|
4752 |
w->phys_cursor_width = width; |
w->phys_cursor_width = width; |
4753 |
x_clip_to_row (w, row, gc); |
x_clip_to_row (w, row, TEXT_AREA, gc); |
4754 |
|
|
4755 |
if (kind == BAR_CURSOR) |
if (kind == BAR_CURSOR) |
4756 |
XFillRectangle (dpy, window, gc, |
XFillRectangle (dpy, window, gc, |
5885 |
static Lisp_Object Qbig5, Qcn_gb, Qsjis, Qeuc_kr; |
static Lisp_Object Qbig5, Qcn_gb, Qsjis, Qeuc_kr; |
5886 |
|
|
5887 |
static void |
static void |
5888 |
decode_mac_font_name (char *name, int size, short scriptcode) |
decode_mac_font_name (name, size, scriptcode) |
5889 |
|
char *name; |
5890 |
|
int size; |
5891 |
|
#if TARGET_API_MAC_CARBON |
5892 |
|
int scriptcode; |
5893 |
|
#else |
5894 |
|
short scriptcode; |
5895 |
|
#endif |
5896 |
{ |
{ |
5897 |
Lisp_Object coding_system; |
Lisp_Object coding_system; |
5898 |
struct coding_system coding; |
struct coding_system coding; |
5930 |
|
|
5931 |
|
|
5932 |
static char * |
static char * |
5933 |
mac_to_x_fontname (char *name, int size, Style style, short scriptcode) |
mac_to_x_fontname (name, size, style, scriptcode, encoding_base) |
5934 |
|
char *name; |
5935 |
|
int size; |
5936 |
|
Style style; |
5937 |
|
#if TARGET_API_MAC_CARBON |
5938 |
|
int scriptcode; |
5939 |
|
#else |
5940 |
|
short scriptcode; |
5941 |
|
#endif |
5942 |
{ |
{ |
5943 |
char foundry[32], family[32], cs[32]; |
char foundry[32], family[32], cs[32]; |
5944 |
char xf[256], *result, *p; |
char xf[256], *result, *p; |
5950 |
|
|
5951 |
switch (scriptcode) |
switch (scriptcode) |
5952 |
{ |
{ |
5953 |
case smTradChinese: |
case smTradChinese: /* == kTextEncodingMacChineseTrad */ |
5954 |
strcpy(cs, "big5-0"); |
strcpy(cs, "big5-0"); |
5955 |
break; |
break; |
5956 |
case smSimpChinese: |
case smSimpChinese: /* == kTextEncodingMacChineseSimp */ |
5957 |
strcpy(cs, "gb2312.1980-0"); |
strcpy(cs, "gb2312.1980-0"); |
5958 |
break; |
break; |
5959 |
case smJapanese: |
case smJapanese: /* == kTextEncodingMacJapanese */ |
5960 |
strcpy(cs, "jisx0208.1983-sjis"); |
strcpy(cs, "jisx0208.1983-sjis"); |
5961 |
break; |
break; |
5962 |
case -smJapanese: |
case -smJapanese: |
5968 |
font is being built. */ |
font is being built. */ |
5969 |
strcpy(cs, "jisx0201.1976-0"); |
strcpy(cs, "jisx0201.1976-0"); |
5970 |
break; |
break; |
5971 |
case smKorean: |
case smKorean: /* == kTextEncodingMacKorean */ |
5972 |
strcpy(cs, "ksc5601.1989-0"); |
strcpy(cs, "ksc5601.1989-0"); |
5973 |
break; |
break; |
5974 |
|
#if TARGET_API_MAC_CARBON |
5975 |
|
case kTextEncodingMacCyrillic: |
5976 |
|
strcpy(cs, "mac-cyrillic"); |
5977 |
|
break; |
5978 |
|
case kTextEncodingMacCentralEurRoman: |
5979 |
|
strcpy(cs, "mac-centraleuropean"); |
5980 |
|
break; |
5981 |
|
case kTextEncodingMacSymbol: |
5982 |
|
case kTextEncodingMacDingbats: |
5983 |
|
strcpy(cs, "adobe-fontspecific"); |
5984 |
|
break; |
5985 |
|
#endif |
5986 |
default: |
default: |
5987 |
strcpy(cs, "mac-roman"); |
strcpy(cs, "mac-roman"); |
5988 |
break; |
break; |
5989 |
} |
} |
5990 |
} |
} |
5991 |
|
|
6032 |
coding_system = Qsjis; |
coding_system = Qsjis; |
6033 |
else if (strcmp (cs, "ksc5601.1989-0") == 0) |
else if (strcmp (cs, "ksc5601.1989-0") == 0) |
6034 |
coding_system = Qeuc_kr; |
coding_system = Qeuc_kr; |
6035 |
else if (strcmp (cs, "mac-roman") == 0) |
else if (strcmp (cs, "mac-roman") == 0 |
6036 |
|
|| strcmp (cs, "mac-cyrillic") == 0 |
6037 |
|
|| strcmp (cs, "mac-centraleuropean") == 0 |
6038 |
|
|| strcmp (cs, "adobe-fontspecific") == 0) |
6039 |
strcpy (mf, family); |
strcpy (mf, family); |
6040 |
else |
else |
6041 |
sprintf (mf, "%s-%s-%s", foundry, family, cs); |
sprintf (mf, "%s-%s-%s", foundry, family, cs); |
6107 |
FMFont font; |
FMFont font; |
6108 |
FMFontStyle style; |
FMFontStyle style; |
6109 |
FMFontSize size; |
FMFontSize size; |
6110 |
SInt16 sc; |
TextEncoding encoding; |
6111 |
|
TextEncodingBase sc; |
6112 |
|
|
6113 |
if (FMGetFontFamilyName (ff, name) != noErr) |
if (FMGetFontFamilyName (ff, name) != noErr) |
6114 |
break; |
break; |
6116 |
if (*name == '.') |
if (*name == '.') |
6117 |
continue; |
continue; |
6118 |
|
|
6119 |
sc = FontToScript (ff); |
if (FMGetFontFamilyTextEncoding (ff, &encoding) != noErr) |
6120 |
|
break; |
6121 |
|
sc = GetTextEncodingBase (encoding); |
6122 |
decode_mac_font_name (name, sizeof (name), sc); |
decode_mac_font_name (name, sizeof (name), sc); |
6123 |
|
|
6124 |
/* Point the instance iterator at the current font family. */ |
/* Point the instance iterator at the current font family. */ |
6125 |
if (FMResetFontFamilyInstanceIterator (ff, &ffii) != noErr) |
if (FMResetFontFamilyInstanceIterator (ff, &ffii) != noErr) |
6126 |
break; |
break; |
8638 |
{ |
{ |
8639 |
unsigned char ch = inev.code; |
unsigned char ch = inev.code; |
8640 |
ByteCount actual_input_length, actual_output_length; |
ByteCount actual_input_length, actual_output_length; |
8641 |
unsigned char outch; |
unsigned char outbuf[32]; |
8642 |
|
|
8643 |
convert_status = TECConvertText (converter, &ch, 1, |
convert_status = TECConvertText (converter, &ch, 1, |
8644 |
&actual_input_length, |
&actual_input_length, |
8645 |
&outch, 1, |
outbuf, 1, |
8646 |
&actual_output_length); |
&actual_output_length); |
8647 |
if (convert_status == noErr |
if (convert_status == noErr |
8648 |
&& actual_input_length == 1 |
&& actual_input_length == 1 |
8649 |
&& actual_output_length == 1) |
&& actual_output_length == 1) |
8650 |
inev.code = outch; |
inev.code = *outbuf; |
8651 |
} |
|
8652 |
|
/* Reset internal states of the converter object. |
8653 |
|
If it fails, create another one. */ |
8654 |
|
convert_status = TECFlushText (converter, outbuf, |
8655 |
|
sizeof (outbuf), |
8656 |
|
&actual_output_length); |
8657 |
|
if (convert_status != noErr) |
8658 |
|
{ |
8659 |
|
TECDisposeConverter (converter); |
8660 |
|
TECCreateConverter (&converter, |
8661 |
|
kTextEncodingMacRoman, |
8662 |
|
mac_keyboard_text_encoding); |
8663 |
|
} |
8664 |
|
} |
8665 |
} |
} |
8666 |
|
|
8667 |
#if USE_CARBON_EVENTS |
#if USE_CARBON_EVENTS |
9180 |
x_update_window_end, |
x_update_window_end, |
9181 |
x_cursor_to, |
x_cursor_to, |
9182 |
x_flush, |
x_flush, |
9183 |
x_flush, |
0, /* flush_display_optional */ |
9184 |
x_clear_window_mouse_face, |
x_clear_window_mouse_face, |
9185 |
x_get_glyph_overhangs, |
x_get_glyph_overhangs, |
9186 |
x_fix_overlapping_area, |
x_fix_overlapping_area, |