]> git.sesse.net Git - rdpsrv/blob - Xserver/lib/font/fontfile/ffcheck.c
Support RDP5 logon packets.
[rdpsrv] / Xserver / lib / font / fontfile / ffcheck.c
1 /* $XConsortium: ffcheck.c /main/1 1996/09/28 16:48:58 rws $ */
2
3 /*
4
5 Copyright (c) 1991  X Consortium
6
7 Permission is hereby granted, free of charge, to any person obtaining a copy
8 of this software and associated documentation files (the "Software"), to deal
9 in the Software without restriction, including without limitation the rights
10 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11 copies of the Software, and to permit persons to whom the Software is
12 furnished to do so, subject to the following conditions:
13
14 The above copyright notice and this permission notice shall be included in
15 all copies or substantial portions of the Software.
16
17 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
20 X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
21 AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
22 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23
24 Except as contained in this notice, the name of the X Consortium shall not be
25 used in advertising or otherwise to promote the sale, use or other dealings
26 in this Software without prior written authorization from the X Consortium.
27
28 */
29
30 /*
31  * Author:  Keith Packard, MIT X Consortium
32  */
33 /* $NCDId: @(#)fontfile.c,v 1.6 1991/07/02 17:00:46 lemke Exp $ */
34
35 #include    "fntfilst.h"
36
37 /*
38  * Map FPE functions to renderer functions
39  */
40
41 extern int FontFileNameCheck();
42 extern int FontFileInitFPE();
43 extern int FontFileResetFPE();
44 extern int FontFileFreeFPE();
45 extern void FontFileCloseFont();
46
47
48 /* Here we must check the client to see if it has a context attached to
49  * it that allows us to access the printer fonts
50  */
51
52 int
53 FontFileCheckOpenFont (client, fpe, flags, name, namelen, format, fmask,
54                   id, pFont, aliasName, non_cachable_font)
55     pointer             client;
56     FontPathElementPtr  fpe;
57     int                 flags;
58     char                *name;
59     int                 namelen;
60     fsBitmapFormat      format;
61     fsBitmapFormatMask  fmask;
62     XID                 id;
63     FontPtr             *pFont;
64     char                **aliasName;
65     FontPtr             non_cachable_font;
66 {
67     if (XpClientIsBitmapClient(client))
68         return (FontFileOpenFont  (client, fpe, flags, name, namelen, format, 
69                 fmask, id, pFont, aliasName, non_cachable_font));
70     return BadFontName;
71 }
72
73 FontFileCheckListFonts (client, fpe, pat, len, max, names)
74     pointer     client;
75     FontPathElementPtr fpe;
76     char       *pat;
77     int         len;
78     int         max;
79     FontNamesPtr names;
80 {
81     if (XpClientIsBitmapClient(client))
82         return FontFileListFonts (client, fpe, pat, len, max, names);
83     return BadFontName;
84 }
85
86 FontFileCheckStartListFontsWithInfo(client, fpe, pat, len, max, privatep)
87     pointer     client;
88     FontPathElementPtr fpe;
89     char       *pat;
90     int         len;
91     int         max;
92     pointer    *privatep;
93 {
94     if (XpClientIsBitmapClient(client))
95         return FontFileStartListFontsWithInfo(client, fpe, pat, len, 
96                                 max, privatep);
97     return BadFontName;
98 }
99
100 FontFileCheckListNextFontWithInfo(client, fpe, namep, namelenp, pFontInfo,
101                              numFonts, private)
102     pointer             client;
103     FontPathElementPtr  fpe;
104     char                **namep;
105     int                 *namelenp;
106     FontInfoPtr         *pFontInfo;
107     int                 *numFonts;
108     pointer             private;
109 {
110     if (XpClientIsBitmapClient(client))
111         return FontFileListNextFontWithInfo(client, fpe, namep, namelenp, 
112                                 pFontInfo, numFonts, private);
113     return BadFontName;
114 }
115
116 FontFileCheckStartListFontsAndAliases(client, fpe, pat, len, max, privatep)
117     pointer     client;
118     FontPathElementPtr fpe;
119     char       *pat;
120     int         len;
121     int         max;
122     pointer    *privatep;
123 {
124     if (XpClientIsBitmapClient(client))
125         return FontFileStartListFontsAndAliases(client, fpe, pat, len, 
126                                 max, privatep);
127     return BadFontName;
128 }
129
130 int
131 FontFileCheckListNextFontOrAlias(client, fpe, namep, namelenp, resolvedp,
132                             resolvedlenp, private)
133     pointer             client;
134     FontPathElementPtr  fpe;
135     char                **namep;
136     int                 *namelenp;
137     char                **resolvedp;
138     int                 *resolvedlenp;
139     pointer             private;
140 {
141     if (XpClientIsBitmapClient(client))
142         return FontFileListNextFontOrAlias(client, fpe, namep, namelenp, 
143                                 resolvedp, resolvedlenp, private);
144     return BadFontName;
145 }
146
147 extern void FontFileEmptyBitmapSource();
148 typedef int (*IntFunc) ();
149 static int  font_file_check_type;
150
151 FontFileCheckRegisterFpeFunctions ()
152 {
153     BitmapRegisterFontFileFunctions ();
154 #ifndef CRAY
155     SpeedoRegisterFontFileFunctions ();
156     Type1RegisterFontFileFunctions();
157 #endif
158     RegisterFPEFunctions(FontFileNameCheck,
159                                   FontFileInitFPE,
160                                   FontFileFreeFPE,
161                                   FontFileResetFPE,
162                                   FontFileCheckOpenFont,
163                                   FontFileCloseFont,
164                                   FontFileCheckListFonts,
165                                   FontFileCheckStartListFontsWithInfo,
166                                   FontFileCheckListNextFontWithInfo,
167                                   (IntFunc) 0,
168                                   (IntFunc) 0,
169                                   (IntFunc) 0,
170                                   FontFileCheckStartListFontsAndAliases,
171                                   FontFileCheckListNextFontOrAlias,
172                                   FontFileEmptyBitmapSource);
173 }