aboutsummaryrefslogtreecommitdiffstats
path: root/src/macgui.h
diff options
context:
space:
mode:
authorKaroly Lorentey2006-05-03 11:56:53 +0000
committerKaroly Lorentey2006-05-03 11:56:53 +0000
commitc044516d384ff70e820686d4e995dcc23ee22e6f (patch)
tree4a9b52cf3e7da73040903b719dfca8113a765884 /src/macgui.h
parentb33c71f58623306001d4d4fe4f7354d8c360edaa (diff)
parent9d6bb9e0af2671a4deca1509f4a2d5655400f67a (diff)
downloademacs-c044516d384ff70e820686d4e995dcc23ee22e6f.tar.gz
emacs-c044516d384ff70e820686d4e995dcc23ee22e6f.zip
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
Diffstat (limited to 'src/macgui.h')
-rw-r--r--src/macgui.h38
1 files changed, 23 insertions, 15 deletions
diff --git a/src/macgui.h b/src/macgui.h
index 7eb6c9942ab..579ae2b7663 100644
--- a/src/macgui.h
+++ b/src/macgui.h
@@ -79,14 +79,26 @@ typedef unsigned long Time;
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
@@ -105,6 +117,8 @@ typedef GWorldPtr Pixmap;
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. */
108typedef struct _XCharStruct 122typedef struct _XCharStruct
109{ 123{
110 short lbearing; /* origin to left edge of raster */ 124 short lbearing; /* origin to left edge of raster */
@@ -117,6 +131,12 @@ typedef struct _XCharStruct
117#endif 131#endif
118} XCharStruct; 132} XCharStruct;
119 133
134enum 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, \
@@ -124,18 +144,6 @@ typedef struct _XCharStruct
124 (xcs).ascent = -(bds).top, \ 144 (xcs).ascent = -(bds).top, \
125 (xcs).descent = (bds).bottom) 145 (xcs).descent = (bds).bottom)
126 146
127typedef 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
139struct MacFontStruct { 147struct MacFontStruct {
140 char *full_name; 148 char *full_name;
141 149
@@ -175,7 +183,7 @@ struct MacFontStruct {
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 */
@@ -229,7 +237,7 @@ typedef struct _XGC
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];