comparison src/macgui.h @ 90261:7beb78bc1f8e

Revision: miles@gnu.org--gnu-2005/emacs--unicode--0--patch-97 Merge from emacs--cvs-trunk--0 Patches applied: * emacs--cvs-trunk--0 (patch 616-696) - Add lisp/mh-e/.arch-inventory - Update from CVS - Merge from gnus--rel--5.10 - Update from CVS: lisp/smerge-mode.el: Add 'tools' to file keywords. - lisp/gnus/ChangeLog: Remove duplicate entry * gnus--rel--5.10 (patch 147-181) - Update from CVS - Merge from emacs--cvs-trunk--0 - Update from CVS: lisp/mml.el (mml-preview): Doc fix. - Update from CVS: texi/message.texi: Fix default values. - Update from CVS: texi/gnus.texi (RSS): Addition.
author Miles Bader <miles@gnu.org>
date Mon, 16 Jan 2006 08:37:27 +0000
parents 5e2d3828e89f caacdc1a999e
children c5406394f567
comparison
equal deleted inserted replaced
90260:0ca0d9181b5e 90261:7beb78bc1f8e
90 #if !TARGET_API_MAC_CARBON 90 #if !TARGET_API_MAC_CARBON
91 #define GetPixDepth(pmh) ((*(pmh))->pixelSize) 91 #define GetPixDepth(pmh) ((*(pmh))->pixelSize)
92 #endif 92 #endif
93 93
94 94
95 #ifndef USE_CG_TEXT_DRAWING
96 #if USE_ATSUI && MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
97 #define USE_CG_TEXT_DRAWING 1
98 #endif
99 #endif
100
95 /* Emulate XCharStruct. */ 101 /* Emulate XCharStruct. */
96 typedef struct _XCharStruct 102 typedef struct _XCharStruct
97 { 103 {
98 short lbearing; /* origin to left edge of raster */ 104 short lbearing; /* origin to left edge of raster */
99 short rbearing; /* origin to right edge of raster */ 105 short rbearing; /* origin to right edge of raster */
101 short ascent; /* baseline to top edge of raster */ 107 short ascent; /* baseline to top edge of raster */
102 short descent; /* baseline to bottom edge of raster */ 108 short descent; /* baseline to bottom edge of raster */
103 #if 0 109 #if 0
104 unsigned short attributes; /* per char flags (not predefined) */ 110 unsigned short attributes; /* per char flags (not predefined) */
105 #endif 111 #endif
106 unsigned valid_p : 1;
107 } XCharStruct; 112 } XCharStruct;
108 113
109 #define STORE_XCHARSTRUCT(xcs, w, bds) \ 114 #define STORE_XCHARSTRUCT(xcs, w, bds) \
110 ((xcs).width = (w), \ 115 ((xcs).width = (w), \
111 (xcs).lbearing = (bds).left, \ 116 (xcs).lbearing = (bds).left, \
112 (xcs).rbearing = (bds).right, \ 117 (xcs).rbearing = (bds).right, \
113 (xcs).ascent = -(bds).top, \ 118 (xcs).ascent = -(bds).top, \
114 (xcs).descent = (bds).bottom, \ 119 (xcs).descent = (bds).bottom)
115 (xcs).valid_p = 1) 120
121 typedef struct
122 {
123 char valid_bits[0x100 / 8];
124 XCharStruct per_char[0x100];
125 } XCharStructRow;
126
127 #define XCHARSTRUCTROW_CHAR_VALID_P(row, byte2) \
128 ((row)->valid_bits[(byte2) / 8] & (1 << (byte2) % 8))
129
130 #define XCHARSTRUCTROW_SET_CHAR_VALID(row, byte2) \
131 ((row)->valid_bits[(byte2) / 8] |= (1 << (byte2) % 8))
116 132
117 struct MacFontStruct { 133 struct MacFontStruct {
118 char *full_name; 134 char *full_name;
119 135
120 short mac_fontnum; /* font number of font used in this window */ 136 short mac_fontnum; /* font number of font used in this window */
125 #else 141 #else
126 short mac_scriptcode; /* Mac OS script code for font used */ 142 short mac_scriptcode; /* Mac OS script code for font used */
127 #endif 143 #endif
128 #if USE_ATSUI 144 #if USE_ATSUI
129 ATSUStyle mac_style; /* NULL if QuickDraw Text is used */ 145 ATSUStyle mac_style; /* NULL if QuickDraw Text is used */
146 #if USE_CG_TEXT_DRAWING
147 CGFontRef cg_font; /* NULL if ATSUI text drawing is used */
148 CGGlyph *cg_glyphs; /* Likewise */
149 #endif
130 #endif 150 #endif
131 151
132 /* from Xlib.h */ 152 /* from Xlib.h */
133 #if 0 153 #if 0
134 XExtData *ext_data; /* hook for extension to hang data */ 154 XExtData *ext_data; /* hook for extension to hang data */
145 int n_properties; /* how many properties there are */ 165 int n_properties; /* how many properties there are */
146 XFontProp *properties; /* pointer to array of additional properties */ 166 XFontProp *properties; /* pointer to array of additional properties */
147 #endif /* 0 */ 167 #endif /* 0 */
148 XCharStruct min_bounds; /* minimum bounds over all existing char */ 168 XCharStruct min_bounds; /* minimum bounds over all existing char */
149 XCharStruct max_bounds; /* maximum bounds over all existing char */ 169 XCharStruct max_bounds; /* maximum bounds over all existing char */
150 XCharStruct *per_char; /* first_char to last_char information */ 170 union {
171 XCharStruct *per_char; /* first_char to last_char information */
172 XCharStructRow **rows; /* first row to last row information */
173 } bounds;
151 int ascent; /* logical extent above baseline for spacing */ 174 int ascent; /* logical extent above baseline for spacing */
152 int descent; /* logical decent below baseline for spacing */ 175 int descent; /* logical decent below baseline for spacing */
153 }; 176 };
154 177
155 typedef struct MacFontStruct MacFontStruct; 178 typedef struct MacFontStruct MacFontStruct;