#endif
+#ifndef USE_CG_TEXT_DRAWING
+#if USE_ATSUI && MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
+#define USE_CG_TEXT_DRAWING 1
+#endif
+#endif
+
/* Emulate XCharStruct. */
typedef struct _XCharStruct
{
(xcs).ascent = -(bds).top, \
(xcs).descent = (bds).bottom)
+typedef struct
+{
+ char valid_bits[0x100 / 8];
+ XCharStruct per_char[0x100];
+} XCharStructRow;
+
+#define XCHARSTRUCTROW_CHAR_VALID_P(row, byte2) \
+ ((row)->valid_bits[(byte2) / 8] & (1 << (byte2) % 8))
+
+#define XCHARSTRUCTROW_SET_CHAR_VALID(row, byte2) \
+ ((row)->valid_bits[(byte2) / 8] |= (1 << (byte2) % 8))
+
struct MacFontStruct {
char *full_name;
#else
short mac_scriptcode; /* Mac OS script code for font used */
#endif
-
-#if 0
- SInt16 mFontNum; /* font number of font used in this window */
- short mScriptCode; /* Mac OS script code for font used */
- int mFontSize; /* size of font */
- Style mFontFace; /* plain, bold, italics, etc. */
- int mHeight; /* height of one line of text in pixels */
- int mWidth; /* width of one character in pixels */
- int mAscent;
- int mDescent;
- int mLeading;
- char mTwoByte; /* true for two-byte font */
-#endif /* 0 */
+#if USE_ATSUI
+ ATSUStyle mac_style; /* NULL if QuickDraw Text is used */
+#if USE_CG_TEXT_DRAWING
+ CGFontRef cg_font; /* NULL if ATSUI text drawing is used */
+ CGGlyph *cg_glyphs; /* Likewise */
+#endif
+#endif
/* from Xlib.h */
#if 0
#endif /* 0 */
XCharStruct min_bounds; /* minimum bounds over all existing char */
XCharStruct max_bounds; /* maximum bounds over all existing char */
- XCharStruct *per_char; /* first_char to last_char information */
+ union {
+ XCharStruct *per_char; /* first_char to last_char information */
+ XCharStructRow **rows; /* first row to last row information */
+ } bounds;
int ascent; /* logical extent above baseline for spacing */
int descent; /* logical decent below baseline for spacing */
};
/* QuickDraw background color. */
RGBColor back_color;
+
+#define MAX_CLIP_RECTS 2
+ /* QuickDraw clipping region. */
+ RgnHandle clip_region;
+
+#if defined (MAC_OSX) && USE_ATSUI
+ /* Number of clipping rectangles used in Quartz 2D drawing. */
+ int n_clip_rects;
+
+ /* Clipping rectangles used in Quartz 2D drawing. The y-coordinate
+ is in QuickDraw's. */
+ CGRect clip_rects[MAX_CLIP_RECTS];
+#endif
} *GC;
#define GCForeground (1L<<2)