1 /* $XConsortium: fservestr.h,v 1.13 95/06/09 22:16:29 gildea Exp $ */
3 * Copyright 1990 Network Computing Devices
5 * Permission to use, copy, modify, distribute, and sell this software and
6 * its documentation for any purpose is hereby granted without fee, provided
7 * that the above copyright notice appear in all copies and that both that
8 * copyright notice and this permission notice appear in supporting
9 * documentation, and that the name of Network Computing Devices not be
10 * used in advertising or publicity pertaining to distribution of the
11 * software without specific, written prior permission. Network Computing
12 * Devices makes no representations about the suitability of this software
13 * for any purpose. It is provided "as is" without express or implied
16 * NETWORK COMPUTING DEVICES DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
17 * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS,
18 * IN NO EVENT SHALL NETWORK COMPUTING DEVICES BE LIABLE FOR ANY SPECIAL,
19 * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
20 * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
21 * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE
22 * OR PERFORMANCE OF THIS SOFTWARE.
24 * Author: Dave Lemke, Network Computing Devices, Inc
34 * font server data structures
37 * font server private storage
41 typedef struct _fs_font {
44 CharInfoPtr inkMetrics;
45 } FSFontRec, *FSFontPtr;
47 /* FS special data for the font */
48 typedef struct _fs_font_data {
50 int generation; /* FS generation when opened */
51 FontPathElementPtr fpe;
52 unsigned long glyphs_to_get; /* # glyphs remaining to be gotten */
54 /* Following data needed in case font needs to be reopened. */
57 fsBitmapFormat format;
58 fsBitmapFormatMask fmask;
61 typedef struct fs_clients_depending {
63 struct fs_clients_depending *next;
64 } FSClientsDependingRec, *FSClientsDependingPtr;
66 /* OpenFont specific data for blocked request */
67 typedef struct _fs_blocked_font {
70 int state; /* how many of the replies have landed */
73 fsBitmapFormat format;
74 FSClientsDependingPtr clients_depending;
77 /* LoadGlyphs data for blocked request */
78 typedef struct _fs_blocked_glyphs {
80 int num_expected_ranges;
81 fsRange *expected_ranges;
84 FSClientsDependingPtr clients_depending;
87 /* LoadExtents data for blocked request */
88 typedef struct _fs_blocked_extents {
90 fsRange *expected_ranges;
93 unsigned long nextents;
97 /* LoadBitmaps data for blocked request */
98 typedef struct _fs_blocked_bitmaps {
100 fsRange *expected_ranges;
104 unsigned long nglyphs;
107 } FSBlockedBitmapRec;
109 /* state for blocked ListFonts */
110 typedef struct _fs_blocked_list {
117 /* state for blocked ListFontsWithInfo */
118 typedef struct _fs_blocked_list_info {
125 } FSBlockedListInfoRec;
127 /* state for blocked request */
128 typedef struct _fs_block_data {
129 int type; /* Open Font, LoadGlyphs, ListFonts,
131 pointer client; /* who wants it */
132 int sequence_number;/* expected */
133 fsGenericReply header;
134 pointer data; /* type specific data */
135 struct _fs_block_data *depending; /* clients depending on this one */
136 struct _fs_block_data *next;
139 /* state for reconnected to dead font server */
140 typedef struct _fs_reconnect {
142 } FSReconnectRec, *FSReconnectPtr;
145 #if (defined(__STDC__) && !defined(UNIXCPP)) || defined(ANSICPP)
146 #define fsCat(x,y) x##_##y
148 #define fsCat(x,y) x/**/_/**/y
152 /* copy XCharInfo parts of a protocol reply into a xCharInfo */
154 #define fsUnpack_XCharInfo(packet, structure) \
155 (structure)->leftSideBearing = fsCat(packet,left); \
156 (structure)->rightSideBearing = fsCat(packet,right); \
157 (structure)->characterWidth = fsCat(packet,width); \
158 (structure)->ascent = fsCat(packet,ascent); \
159 (structure)->descent = fsCat(packet,descent); \
160 (structure)->attributes = fsCat(packet,attributes)
163 /* copy XFontInfoHeader parts of a protocol reply into a FontInfoRec */
165 #define fsUnpack_XFontInfoHeader(packet, structure) \
166 (structure)->allExist = ((packet)->font_header_flags & FontInfoAllCharsExist) != 0; \
167 (structure)->drawDirection = \
168 ((packet)->font_header_draw_direction == LeftToRightDrawDirection) ? \
169 LeftToRight : RightToLeft; \
170 (structure)->inkInside = ((packet)->font_header_flags & FontInfoInkInside) != 0; \
172 (structure)->firstRow = (packet)->font_hdr_char_range_min_char_high; \
173 (structure)->firstCol = (packet)->font_hdr_char_range_min_char_low; \
174 (structure)->lastRow = (packet)->font_hdr_char_range_max_char_high; \
175 (structure)->lastCol = (packet)->font_hdr_char_range_max_char_low; \
176 (structure)->defaultCh = (packet)->font_header_default_char_low \
177 + ((packet)->font_header_default_char_high << 8); \
179 (structure)->fontDescent = (packet)->font_header_font_descent; \
180 (structure)->fontAscent = (packet)->font_header_font_ascent; \
182 fsUnpack_XCharInfo((packet)->font_header_min_bounds, &(structure)->minbounds); \
183 fsUnpack_XCharInfo((packet)->font_header_min_bounds, &(structure)->ink_minbounds); \
184 fsUnpack_XCharInfo((packet)->font_header_max_bounds, &(structure)->maxbounds); \
185 fsUnpack_XCharInfo((packet)->font_header_max_bounds, &(structure)->ink_maxbounds)
188 #endif /* _FSERVESTR_H_ */