1 | /* $Xorg: AttrValid.h,v 1.4 2001/03/14 18:43:40 pookie Exp $ */
|
---|
2 | /*
|
---|
3 | (c) Copyright 1996 Hewlett-Packard Company
|
---|
4 | (c) Copyright 1996 International Business Machines Corp.
|
---|
5 | (c) Copyright 1996 Sun Microsystems, Inc.
|
---|
6 | (c) Copyright 1996 Novell, Inc.
|
---|
7 | (c) Copyright 1996 Digital Equipment Corp.
|
---|
8 | (c) Copyright 1996 Fujitsu Limited
|
---|
9 | (c) Copyright 1996 Hitachi, Ltd.
|
---|
10 |
|
---|
11 | Permission is hereby granted, free of charge, to any person obtaining a copy
|
---|
12 | of this software and associated documentation files (the "Software"), to deal
|
---|
13 | in the Software without restriction, including without limitation the rights
|
---|
14 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
---|
15 | copies of the Software, and to permit persons to whom the Software is
|
---|
16 | furnished to do so, subject to the following conditions:
|
---|
17 |
|
---|
18 | The above copyright notice and this permission notice shall be included in
|
---|
19 | all copies or substantial portions of the Software.
|
---|
20 |
|
---|
21 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
---|
22 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
---|
23 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
---|
24 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
---|
25 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
---|
26 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
---|
27 |
|
---|
28 | Except as contained in this notice, the names of the copyright holders shall
|
---|
29 | not be used in advertising or otherwise to promote the sale, use or other
|
---|
30 | dealings in this Software without prior written authorization from said
|
---|
31 | copyright holders.
|
---|
32 | */
|
---|
33 |
|
---|
34 | #ifdef HAVE_DIX_CONFIG_H
|
---|
35 | #include <dix-config.h>
|
---|
36 | #endif
|
---|
37 |
|
---|
38 | #ifndef _Xp_AttrValid_h
|
---|
39 | #define _Xp_AttrValid_h
|
---|
40 |
|
---|
41 | #include <X11/extensions/Printstr.h>
|
---|
42 | #include "Oid.h"
|
---|
43 |
|
---|
44 | #define XpNumber(a) (sizeof(a) / sizeof(*(a)))
|
---|
45 |
|
---|
46 | /*
|
---|
47 | * Attribute pool validation valid values and defaults
|
---|
48 | */
|
---|
49 | typedef struct
|
---|
50 | {
|
---|
51 | XpOidList* valid_content_orientations_supported;
|
---|
52 | XpOidList* default_content_orientations_supported;
|
---|
53 |
|
---|
54 | XpOidDocFmtList* valid_document_formats_supported;
|
---|
55 | XpOidDocFmtList* default_document_formats_supported;
|
---|
56 |
|
---|
57 | XpOidList* valid_input_trays;
|
---|
58 | XpOidList* valid_medium_sizes;
|
---|
59 |
|
---|
60 | XpOidList* valid_plexes_supported;
|
---|
61 | XpOidList* default_plexes_supported;
|
---|
62 |
|
---|
63 | XpOidCardList* valid_printer_resolutions_supported;
|
---|
64 | XpOidCardList* default_printer_resolutions_supported;
|
---|
65 |
|
---|
66 | XpOidDocFmtList* valid_xp_embedded_formats_supported;
|
---|
67 | XpOidDocFmtList* default_xp_embedded_formats_supported;
|
---|
68 |
|
---|
69 | XpOidList* valid_xp_listfonts_modes_supported;
|
---|
70 | XpOidList* default_xp_listfonts_modes_supported;
|
---|
71 |
|
---|
72 | XpOidDocFmtList* valid_xp_raw_formats_supported;
|
---|
73 | XpOidDocFmtList* default_xp_raw_formats_supported;
|
---|
74 |
|
---|
75 | XpOidList* valid_xp_setup_proviso;
|
---|
76 |
|
---|
77 | XpOidDocFmt* default_document_format;
|
---|
78 | XpOidList* valid_available_compressions_supported;
|
---|
79 | XpOidList* default_available_compressions_supported;
|
---|
80 |
|
---|
81 | } XpValidatePoolsRec;
|
---|
82 |
|
---|
83 | /*
|
---|
84 | * XpOid resource access
|
---|
85 | */
|
---|
86 | #define XpGetStringAttr(pContext, pool, oid) \
|
---|
87 | (const char*)XpGetOneAttribute(pContext, pool, (char*)XpOidString(oid))
|
---|
88 | #define XpPutStringAttr(pContext, pool, oid, value) \
|
---|
89 | XpPutOneAttribute(pContext, pool, XpOidString(oid), value)
|
---|
90 |
|
---|
91 | #ifdef _XP_PRINT_SERVER_ /* needed for XpContextPtr in Printstr.h */
|
---|
92 |
|
---|
93 | /*
|
---|
94 | * XpOid-valued attribute access
|
---|
95 | */
|
---|
96 | XpOid XpGetOidAttr(XpContextPtr pContext,
|
---|
97 | XPAttributes pool,
|
---|
98 | XpOid oid,
|
---|
99 | const XpOidList* valid_oid_list);
|
---|
100 | void XpPutOidAttr(XpContextPtr pContext,
|
---|
101 | XPAttributes pool,
|
---|
102 | XpOid oid,
|
---|
103 | XpOid value_oid);
|
---|
104 | void XpValidateOidAttr(XpContextPtr pContext,
|
---|
105 | XPAttributes pool,
|
---|
106 | XpOid oid,
|
---|
107 | const XpOidList* valid_oids,
|
---|
108 | XpOid default_oid);
|
---|
109 | /*
|
---|
110 | * cardinal-valued attribute access
|
---|
111 | */
|
---|
112 | unsigned long XpGetCardAttr(XpContextPtr pContext,
|
---|
113 | XPAttributes pool,
|
---|
114 | XpOid oid,
|
---|
115 | const XpOidCardList* valid_card_list);
|
---|
116 | void XpPutCardAttr(XpContextPtr pContext,
|
---|
117 | XPAttributes pool,
|
---|
118 | XpOid oid,
|
---|
119 | unsigned long value_card);
|
---|
120 | void XpValidateCardAttr(XpContextPtr pContext,
|
---|
121 | XPAttributes pool,
|
---|
122 | XpOid oid,
|
---|
123 | const XpOidCardList* valid_cards,
|
---|
124 | unsigned long default_card);
|
---|
125 | /*
|
---|
126 | * XpOidList-valued attribute access
|
---|
127 | */
|
---|
128 | XpOidList* XpGetListAttr(XpContextPtr pContext,
|
---|
129 | XPAttributes pool,
|
---|
130 | XpOid oid,
|
---|
131 | const XpOidList* valid_oid_list);
|
---|
132 | void XpPutListAttr(XpContextPtr pContext,
|
---|
133 | XPAttributes pool,
|
---|
134 | XpOid oid,
|
---|
135 | const XpOidList* list);
|
---|
136 | void XpValidateListAttr(XpContextPtr pContext,
|
---|
137 | XPAttributes pool,
|
---|
138 | XpOid oid,
|
---|
139 | const XpOidList* valid_oids,
|
---|
140 | const XpOidList* default_oids);
|
---|
141 | /*
|
---|
142 | * XpOidCardList-valued attribute access
|
---|
143 | */
|
---|
144 | XpOidCardList* XpGetCardListAttr(XpContextPtr pContext,
|
---|
145 | XPAttributes pool,
|
---|
146 | XpOid oid,
|
---|
147 | const XpOidCardList* valid_card_list);
|
---|
148 | void XpPutCardListAttr(XpContextPtr pContext,
|
---|
149 | XPAttributes pool,
|
---|
150 | XpOid oid,
|
---|
151 | const XpOidCardList* list);
|
---|
152 | void XpValidateCardListAttr(XpContextPtr pContext,
|
---|
153 | XPAttributes pool,
|
---|
154 | XpOid oid,
|
---|
155 | const XpOidCardList* valid_cards,
|
---|
156 | const XpOidCardList* default_cards);
|
---|
157 | /*
|
---|
158 | * XpOidDocFmtList-valued attribute access
|
---|
159 | */
|
---|
160 | XpOidDocFmtList* XpGetDocFmtListAttr(XpContextPtr pContext,
|
---|
161 | XPAttributes pool,
|
---|
162 | XpOid oid,
|
---|
163 | const XpOidDocFmtList* valid_fmt_list);
|
---|
164 | void XpPutDocFmtListAttr(XpContextPtr pContext,
|
---|
165 | XPAttributes pool,
|
---|
166 | XpOid oid,
|
---|
167 | const XpOidDocFmtList* list);
|
---|
168 | void XpValidateDocFmtListAttr(XpContextPtr pContext,
|
---|
169 | XPAttributes pool,
|
---|
170 | XpOid oid,
|
---|
171 | const XpOidDocFmtList* valid_fmts,
|
---|
172 | const XpOidDocFmtList* default_fmts);
|
---|
173 | /*
|
---|
174 | * XpOidMediumSS-valued attribute access
|
---|
175 | */
|
---|
176 | XpOidMediumSS* XpGetMediumSSAttr(XpContextPtr pContext,
|
---|
177 | XPAttributes pool,
|
---|
178 | XpOid oid,
|
---|
179 | const XpOidList* valid_trays,
|
---|
180 | const XpOidList* valid_sizes);
|
---|
181 | void XpPutMediumSSAttr(XpContextPtr pContext,
|
---|
182 | XPAttributes pool,
|
---|
183 | XpOid oid,
|
---|
184 | const XpOidMediumSS* msss);
|
---|
185 | const XpOidMediumSS* XpGetDefaultMediumSS();
|
---|
186 |
|
---|
187 | /*
|
---|
188 | * XpOidTrayMediumList-valued attribute access
|
---|
189 | */
|
---|
190 | XpOidTrayMediumList* XpGetTrayMediumListAttr(XpContextPtr pContext,
|
---|
191 | XPAttributes pool,
|
---|
192 | XpOid oid,
|
---|
193 | const XpOidList* valid_trays,
|
---|
194 | const XpOidMediumSS* msss);
|
---|
195 | void XpPutTrayMediumListAttr(XpContextPtr pContext,
|
---|
196 | XPAttributes pool,
|
---|
197 | XpOid oid,
|
---|
198 | const XpOidTrayMediumList* tm);
|
---|
199 | /*
|
---|
200 | * Attribute pool validation
|
---|
201 | */
|
---|
202 | void XpValidateAttributePool(XpContextPtr pContext,
|
---|
203 | XPAttributes pool,
|
---|
204 | const XpValidatePoolsRec* vpr);
|
---|
205 | void XpValidatePrinterPool(XpContextPtr pContext,
|
---|
206 | const XpValidatePoolsRec* vpr);
|
---|
207 | void XpValidateJobPool(XpContextPtr pContext,
|
---|
208 | const XpValidatePoolsRec* vpr);
|
---|
209 | void XpValidateDocumentPool(XpContextPtr pContext,
|
---|
210 | const XpValidatePoolsRec* vpr);
|
---|
211 | void XpValidatePagePool(XpContextPtr pContext,
|
---|
212 | const XpValidatePoolsRec* vpr);
|
---|
213 |
|
---|
214 | #endif /* _XP_PRINT_SERVER_ */
|
---|
215 |
|
---|
216 | #endif /* _Xp_AttrValid_h - don't add anything after this line */
|
---|