]> code.delx.au - gnu-emacs/blobdiff - src/macgui.h
Revision: miles@gnu.org--gnu-2005/emacs--unicode--0--patch-99
[gnu-emacs] / src / macgui.h
index fc777de03ba627416de8af94e1022ec772b6025e..74c64bfb41d0f852747e29f2312d91236f8f3d5f 100644 (file)
@@ -92,6 +92,12 @@ typedef GWorldPtr Pixmap;
 #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
 {
@@ -112,6 +118,18 @@ 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;
 
@@ -123,19 +141,13 @@ struct MacFontStruct {
 #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
@@ -155,7 +167,10 @@ struct MacFontStruct {
 #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 */
 };
@@ -200,6 +215,19 @@ typedef struct _XGC
 
   /* 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)