comparison src/macgui.h @ 83514:d9f8d2a65d18

Merged from emacs@sv.gnu.org Patches applied: * emacs@sv.gnu.org/emacs--devo--0--patch-252 Merge from gnus--rel--5.10 * emacs@sv.gnu.org/emacs--devo--0--patch-253 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-254 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-255 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-256 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-257 Merge from gnus--rel--5.10 * emacs@sv.gnu.org/emacs--devo--0--patch-258 Clean up lisp/gnus/ChangeLog a bit * emacs@sv.gnu.org/emacs--devo--0--patch-259 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-260 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-261 lisp/replace.el (occur-engine): Bind `inhibit-field-text-motion' to t * emacs@sv.gnu.org/emacs--devo--0--patch-262 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-96 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-97 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-98 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-554
author Karoly Lorentey <lorentey@elte.hu>
date Wed, 03 May 2006 11:56:53 +0000
parents d7f3a82edf0a
children 6d9fbe4cfce7 2ecafc6d5db7
comparison
equal deleted inserted replaced
83513:966a40e7fb54 83514:d9f8d2a65d18
77 #include <Windows.h> 77 #include <Windows.h>
78 #include <Controls.h> 78 #include <Controls.h>
79 #include <Gestalt.h> 79 #include <Gestalt.h>
80 #endif /* not HAVE_CARBON */ 80 #endif /* not HAVE_CARBON */
81 81
82 /* Whether to use ATSUI (Apple Type Services for Unicode Imaging) for
83 text drawing. */
84 #ifndef USE_ATSUI
85 #ifdef MAC_OSX
86 #define USE_ATSUI 1
87 #endif
88 #endif
89
90 /* Whether to use low-level Quartz 2D (aka Core Graphics) text drawing
91 in preference to ATSUI for ASCII and Latin-1 characters. */
82 #ifndef USE_CG_TEXT_DRAWING 92 #ifndef USE_CG_TEXT_DRAWING
83 #if USE_ATSUI && MAC_OS_X_VERSION_MAX_ALLOWED >= 1030 93 #if USE_ATSUI && MAC_OS_X_VERSION_MAX_ALLOWED >= 1030
84 #define USE_CG_TEXT_DRAWING 1 94 #define USE_CG_TEXT_DRAWING 1
85 #endif 95 #endif
86 #endif 96 #endif
87 97
98 /* Whether to use Quartz 2D routines for drawing operations other than
99 texts. */
88 #ifndef USE_CG_DRAWING 100 #ifndef USE_CG_DRAWING
89 #if USE_ATSUI && defined (MAC_OSX) 101 #if USE_ATSUI && MAC_OS_X_VERSION_MAX_ALLOWED >= 1020
90 #define USE_CG_DRAWING 1 102 #define USE_CG_DRAWING 1
91 #endif 103 #endif
92 #endif 104 #endif
93 105
94 typedef WindowPtr Window; 106 typedef WindowPtr Window;
103 #define GetPixDepth(pmh) ((*(pmh))->pixelSize) 115 #define GetPixDepth(pmh) ((*(pmh))->pixelSize)
104 #endif 116 #endif
105 117
106 118
107 /* Emulate XCharStruct. */ 119 /* Emulate XCharStruct. */
120 /* If the sum of ascent and descent is negative, that means some
121 special status specified by enum pcm_status. */
108 typedef struct _XCharStruct 122 typedef struct _XCharStruct
109 { 123 {
110 short lbearing; /* origin to left edge of raster */ 124 short lbearing; /* origin to left edge of raster */
111 short rbearing; /* origin to right edge of raster */ 125 short rbearing; /* origin to right edge of raster */
112 short width; /* advance to next char's origin */ 126 short width; /* advance to next char's origin */
115 #if 0 129 #if 0
116 unsigned short attributes; /* per char flags (not predefined) */ 130 unsigned short attributes; /* per char flags (not predefined) */
117 #endif 131 #endif
118 } XCharStruct; 132 } XCharStruct;
119 133
134 enum pcm_status
135 {
136 PCM_VALID = 0, /* pcm data is valid */
137 PCM_INVALID = -1, /* pcm data is invalid */
138 };
139
120 #define STORE_XCHARSTRUCT(xcs, w, bds) \ 140 #define STORE_XCHARSTRUCT(xcs, w, bds) \
121 ((xcs).width = (w), \ 141 ((xcs).width = (w), \
122 (xcs).lbearing = (bds).left, \ 142 (xcs).lbearing = (bds).left, \
123 (xcs).rbearing = (bds).right, \ 143 (xcs).rbearing = (bds).right, \
124 (xcs).ascent = -(bds).top, \ 144 (xcs).ascent = -(bds).top, \
125 (xcs).descent = (bds).bottom) 145 (xcs).descent = (bds).bottom)
126
127 typedef struct
128 {
129 char valid_bits[0x100 / 8];
130 XCharStruct per_char[0x100];
131 } XCharStructRow;
132
133 #define XCHARSTRUCTROW_CHAR_VALID_P(row, byte2) \
134 ((row)->valid_bits[(byte2) / 8] & (1 << (byte2) % 8))
135
136 #define XCHARSTRUCTROW_SET_CHAR_VALID(row, byte2) \
137 ((row)->valid_bits[(byte2) / 8] |= (1 << (byte2) % 8))
138 146
139 struct MacFontStruct { 147 struct MacFontStruct {
140 char *full_name; 148 char *full_name;
141 149
142 short mac_fontnum; /* font number of font used in this window */ 150 short mac_fontnum; /* font number of font used in this window */
173 #endif /* 0 */ 181 #endif /* 0 */
174 XCharStruct min_bounds; /* minimum bounds over all existing char */ 182 XCharStruct min_bounds; /* minimum bounds over all existing char */
175 XCharStruct max_bounds; /* maximum bounds over all existing char */ 183 XCharStruct max_bounds; /* maximum bounds over all existing char */
176 union { 184 union {
177 XCharStruct *per_char; /* first_char to last_char information */ 185 XCharStruct *per_char; /* first_char to last_char information */
178 XCharStructRow **rows; /* first row to last row information */ 186 XCharStruct **rows; /* first row to last row information */
179 } bounds; 187 } bounds;
180 int ascent; /* logical extent above baseline for spacing */ 188 int ascent; /* logical extent above baseline for spacing */
181 int descent; /* logical decent below baseline for spacing */ 189 int descent; /* logical decent below baseline for spacing */
182 }; 190 };
183 191
227 int n_clip_rects; 235 int n_clip_rects;
228 236
229 /* QuickDraw clipping region. Ignored if n_clip_rects == 0. */ 237 /* QuickDraw clipping region. Ignored if n_clip_rects == 0. */
230 RgnHandle clip_region; 238 RgnHandle clip_region;
231 239
232 #if defined (MAC_OSX) && USE_ATSUI 240 #if defined (MAC_OSX) && (USE_ATSUI || USE_CG_DRAWING)
233 /* Clipping rectangles used in Quartz 2D drawing. The y-coordinate 241 /* Clipping rectangles used in Quartz 2D drawing. The y-coordinate
234 is in QuickDraw's. */ 242 is in QuickDraw's. */
235 CGRect clip_rects[MAX_CLIP_RECTS]; 243 CGRect clip_rects[MAX_CLIP_RECTS];
236 #endif 244 #endif
237 } *GC; 245 } *GC;