]> git.sesse.net Git - rdpsrv/blob - Xserver/lib/font/Speedo/spint.h
Support RDP5 logon packets.
[rdpsrv] / Xserver / lib / font / Speedo / spint.h
1 /* $XConsortium: spint.h /main/12 1996/09/28 16:47:40 rws $ */
2 /*
3  * Copyright 1990, 1991 Network Computing Devices;
4  * Portions Copyright 1987 by Digital Equipment Corporation
5  *
6  * Permission to use, copy, modify, distribute, and sell this software and
7  * its documentation for any purpose is hereby granted without fee, provided
8  * that the above copyright notice appear in all copies and that both that
9  * copyright notice and this permission notice appear in supporting
10  * documentation, and that the names of Network Computing Devices or Digital
11  * not be used in advertising or publicity pertaining to distribution of
12  * the software without specific, written prior permission.
13  *
14  * NETWORK COMPUTING DEVICES AND DIGITAL DISCLAIM ALL WARRANTIES WITH
15  * REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
16  * AND FITNESS, IN NO EVENT SHALL NETWORK COMPUTING DEVICES OR DIGITAL BE
17  * LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
18  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
19  * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
20  * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
21  */
22
23 /*
24
25 Copyright (c) 1987  X Consortium
26
27 Permission is hereby granted, free of charge, to any person obtaining
28 a copy of this software and associated documentation files (the
29 "Software"), to deal in the Software without restriction, including
30 without limitation the rights to use, copy, modify, merge, publish,
31 distribute, sublicense, and/or sell copies of the Software, and to
32 permit persons to whom the Software is furnished to do so, subject to
33 the following conditions:
34
35 The above copyright notice and this permission notice shall be included
36 in all copies or substantial portions of the Software.
37
38 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
39 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
40 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
41 IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR
42 OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
43 ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
44 OTHER DEALINGS IN THE SOFTWARE.
45
46 Except as contained in this notice, the name of the X Consortium shall
47 not be used in advertising or otherwise to promote the sale, use or
48 other dealings in this Software without prior written authorization
49 from the X Consortium.
50
51 */
52
53 #ifndef _SPINT_H_
54 #define _SPINT_H_
55
56 #include <stdio.h>
57 #include "fntfilst.h"
58 #include <X11/Xfuncproto.h>
59 #include "speedo.h"
60
61 #define SaveMetrics     0x1
62 #define ComputeBoundsOnly       0x2
63
64 #define GLWIDTHBYTESPADDED(bits,nbytes) \
65         ((nbytes) == 1 ? (((bits)+7)>>3)        /* pad to 1 byte */ \
66         :(nbytes) == 2 ? ((((bits)+15)>>3)&~1)  /* pad to 2 bytes */ \
67         :(nbytes) == 4 ? ((((bits)+31)>>3)&~3)  /* pad to 4 bytes */ \
68         :(nbytes) == 8 ? ((((bits)+63)>>3)&~7)  /* pad to 8 bytes */ \
69         : 0)
70
71 #define GLYPH_SIZE(ch, nbytes)          \
72         GLWIDTHBYTESPADDED((ch)->metrics.rightSideBearing - \
73                         (ch)->metrics.leftSideBearing, (nbytes))
74
75 #define mincharno(p) ((p).min_char_low + ((p).min_char_high << 8))
76 #define maxcharno(p) ((p).max_char_low + ((p).max_char_high << 8))
77
78 #define MasterFileOpen  0x1
79
80 typedef struct _sp_master {
81     FontEntryPtr    entry;      /* back pointer */
82     FILE       *fp;
83     char       *fname;
84     ufix8      *f_buffer;
85     ufix8      *c_buffer;
86     char       *copyright;
87     ufix8      *key;
88     buff_t      font;
89     buff_t      char_data;
90     ufix16      mincharsize;
91     int         first_char_id;
92     int         num_chars;
93     int         max_id;
94     int         state;          /* open, closed */
95     int         refcount;       /* number of instances */
96     int        *enc;
97     int         enc_size;
98 }           SpeedoMasterFontRec, *SpeedoMasterFontPtr;
99
100 typedef struct _cur_font_stats {
101     fsBitmapFormat format;
102     /* current glyph info */
103     ufix16      char_index;
104     ufix16      char_id;
105
106     fix15       bit_width,
107                 bit_height;
108     fix15       cur_y;
109     int         bpr;
110
111     /*
112      * since Speedo returns extents that are not identical to what it feeds to
113      * the bitmap builder, and we want to be able to use the extents for
114      * preformance reasons, some of the bitmaps require padding out.  the next
115      * two flags keep track of this.
116      */
117     fix15       last_y;
118     int         trunc;
119
120     pointer     bp;
121     int         scanpad;
122 }           CurrentFontValuesRec, *CurrentFontValuesPtr;
123
124
125 typedef struct _sp_font {
126     struct _sp_master *master;
127     specs_t     specs;
128
129     FontEntryPtr    entry;
130
131     FontScalableRec vals;
132
133     /* char & metric data */
134     CharInfoPtr encoding;
135     CharInfoPtr pDefault;
136     pointer     bitmaps;
137
138 #ifdef DEBUG
139     unsigned long bitmap_size;
140 #endif
141
142 }           SpeedoFontRec, *SpeedoFontPtr;
143
144 extern SpeedoFontPtr sp_fp_cur;
145
146 extern int  sp_open_font();
147 extern int  sp_open_master();
148 extern void sp_close_font();
149 extern void sp_close_master_font();
150 extern void sp_close_master_file();
151 extern void sp_reset_master();
152 #if NeedVarargsPrototypes
153 extern void SpeedoErr(char *fmt, ...);
154 #else
155 extern void SpeedoErr();
156 #endif
157
158 extern void sp_make_standard_props();
159 extern void sp_make_header();
160 extern void sp_compute_bounds();
161 extern void sp_compute_props();
162 extern int  sp_build_all_bitmaps();
163 extern unsigned long sp_compute_data_size();
164
165 extern int  sp_bics_map[];
166 extern int  sp_bics_map_size;
167
168 #ifdef EXTRAFONTS
169 extern int  adobe_map[];
170 extern int  adobe_map_size;
171
172 #endif
173
174 #endif                          /* _SPINT_H_ */