1 /* $XConsortium: closestr.h,v 1.10 95/05/19 19:18:55 dpw Exp $ */
2 /* $XFree86: xc/programs/Xserver/include/closestr.h,v 3.0 1996/04/15 11:34:23 dawes Exp $ */
3 /*
4 
5 Copyright (c) 1991  X Consortium
6 
7 Permission is hereby granted, free of charge, to any person obtaining
8 a copy of this software and associated documentation files (the
9 "Software"), to deal in the Software without restriction, including
10 without limitation the rights to use, copy, modify, merge, publish,
11 distribute, sublicense, and/or sell copies of the Software, and to
12 permit persons to whom the Software is furnished to do so, subject to
13 the following conditions:
14 
15 The above copyright notice and this permission notice shall be included
16 in all copies or substantial portions of the Software.
17 
18 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
19 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
21 IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR
22 OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
23 ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
24 OTHER DEALINGS IN THE SOFTWARE.
25 
26 Except as contained in this notice, the name of the X Consortium shall
27 not be used in advertising or otherwise to promote the sale, use or
28 other dealings in this Software without prior written authorization
29 from the X Consortium.
30 
31 */
32 
33 
34 #ifndef CLOSESTR_H
35 #define CLOSESTR_H
36 
37 #define	NEED_REPLIES
38 #include "Xproto.h"
39 #include "closure.h"
40 #include "dix.h"
41 #include "misc.h"
42 #include "gcstruct.h"
43 
44 /* closure structures */
45 
46 /* OpenFont */
47 
48 typedef struct _OFclosure {
49     ClientPtr   client;
50     short       current_fpe;
51     short       num_fpes;
52     FontPathElementPtr *fpe_list;
53     Mask        flags;
54     Bool        slept;
55 
56 /* XXX -- get these from request buffer instead? */
57     char       *origFontName;
58     int		origFontNameLen;
59     XID         fontid;
60     char       *fontname;
61     int         fnamelen;
62     FontPtr	non_cachable_font;
63 }           OFclosureRec;
64 
65 /* ListFontsWithInfo */
66 
67 typedef struct _LFWIstate {
68     char	pattern[256];  /* max len of font name */
69     int		patlen;
70     int		current_fpe;
71     int		max_names;
72     Bool	list_started;
73     pointer	private;
74 } LFWIstateRec, *LFWIstatePtr;
75 
76 typedef struct _LFWIclosure {
77     ClientPtr		client;
78     int			num_fpes;
79     FontPathElementPtr	*fpe_list;
80     xListFontsWithInfoReply *reply;
81     int			length;
82     LFWIstateRec	current;
83     LFWIstateRec	saved;
84     int			savedNumFonts;
85     Bool		haveSaved;
86     Bool		slept;
87     char		*savedName;
88 } LFWIclosureRec;
89 
90 /* ListFonts */
91 
92 typedef struct _LFclosure {
93     ClientPtr   client;
94     int         num_fpes;
95     FontPathElementPtr *fpe_list;
96     FontNamesPtr names;
97     LFWIstateRec current;
98     LFWIstateRec saved;
99     Bool        haveSaved;
100     Bool        slept;
101     char	*savedName;
102     int		savedNameLen;
103 }	LFclosureRec;
104 
105 /* PolyText */
106 
107 typedef
108     int			(* PolyTextPtr)(
109 #if NeedNestedPrototypes
110 			DrawablePtr /* pDraw */,
111 			GCPtr /* pGC */,
112 			int /* x */,
113 			int /* y */,
114 			int /* count */,
115 			void * /* chars or shorts */
116 #endif
117 			);
118 
119 typedef struct _PTclosure {
120     ClientPtr		client;
121     DrawablePtr		pDraw;
122     GC			*pGC;
123     unsigned char	*pElt;
124     unsigned char	*endReq;
125     unsigned char	*data;
126     int			xorg;
127     int			yorg;
128     CARD8		reqType;
129     PolyTextPtr		polyText;
130     int			itemSize;
131     XID			did;
132     int			err;
133     Bool		slept;
134 } PTclosureRec;
135 
136 /* ImageText */
137 
138 typedef
139     void		(* ImageTextPtr)(
140 #if NeedNestedPrototypes
141 			DrawablePtr /* pDraw */,
142 			GCPtr /* pGC */,
143 			int /* x */,
144 			int /* y */,
145 			int /* count */,
146 			void * /* chars or shorts */
147 #endif
148 			);
149 
150 typedef struct _ITclosure {
151     ClientPtr		client;
152     DrawablePtr		pDraw;
153     GC			*pGC;
154     BYTE		nChars;
155     unsigned char	*data;
156     int			xorg;
157     int			yorg;
158     CARD8		reqType;
159     ImageTextPtr	imageText;
160     int			itemSize;
161     XID			did;
162     Bool		slept;
163 } ITclosureRec;
164 #endif				/* CLOSESTR_H */
165