VirtualBox

source: vbox/trunk/src/VBox/Additions/x11/x11include/xorg-server-1.0.1/Oid.h@ 61386

最後變更 在這個檔案從61386是 51223,由 vboxsync 提交於 11 年 前

Additions/x11/x11include: added header files for X.Org Server 1.0 and 1.1.

  • 屬性 svn:eol-style 設為 native
檔案大小: 8.0 KB
 
1/* $Xorg: Oid.h,v 1.3 2000/08/17 19:48:06 cpqbld 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
11Permission is hereby granted, free of charge, to any person obtaining a copy
12of this software and associated documentation files (the "Software"), to deal
13in the Software without restriction, including without limitation the rights
14to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15copies of the Software, and to permit persons to whom the Software is
16furnished to do so, subject to the following conditions:
17
18The above copyright notice and this permission notice shall be included in
19all copies or substantial portions of the Software.
20
21THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
25IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
26CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
27
28Except as contained in this notice, the names of the copyright holders shall
29not be used in advertising or otherwise to promote the sale, use or other
30dealings in this Software without prior written authorization from said
31copyright holders.
32*/
33
34#ifdef HAVE_DIX_CONFIG_H
35#include <dix-config.h>
36#endif
37
38#ifndef _Xp_Oid_h
39#define _Xp_Oid_h
40
41#include <X11/Xproto.h>
42
43/*
44 * include the auto-generated XpOid enum definition
45 */
46#include "OidDefs.h"
47
48/*
49 * messages
50 */
51#define XPMSG_WARN_MSS "Syntax error parsing medium-source-sizes"
52#define XPMSG_WARN_ITM "Syntax error parsing input-trays-medium"
53#define XPMSG_WARN_DOC_FMT "Syntax error parsing document format"
54#define XPMSG_WARN_DOCFMT_LIST "Syntax error parsing document format list"
55#define XPMSG_WARN_CARD_LIST "Syntax error parsing cardinal list"
56
57/*
58 * macros for memory allocation
59 */
60#define XpOidMalloc(size) ((char*)Xalloc((unsigned long)(size)))
61#define XpOidCalloc(count, size) \
62 ((char*)Xcalloc((unsigned long)((count)*(size))))
63#define XpOidFree(mem) (Xfree((unsigned long*)(mem)))
64
65/*
66 * list of object identifiers
67 */
68typedef struct _XpOidList
69{
70 XpOid* list;
71 int count;
72} XpOidList;
73
74/*
75 * linked list of object identifiers
76 */
77typedef struct XpOidNodeStruct
78{
79 XpOid oid;
80 struct XpOidNodeStruct* next;
81} *XpOidNode;
82
83typedef struct _XpOidLinkedList
84{
85 XpOidNode head;
86 XpOidNode tail;
87 XpOidNode current;
88 int count;
89} XpOidLinkedList;
90
91/*
92 * XpOidMediumSourceSize and related definitions
93 */
94typedef struct
95{
96 float minimum_x;
97 float maximum_x;
98 float minimum_y;
99 float maximum_y;
100} XpOidArea;
101
102typedef struct
103{
104 float lower_bound;
105 float upper_bound;
106} XpOidRealRange;
107
108typedef struct
109{
110 XpOidRealRange range_across_feed;
111 float increment_across_feed;
112 XpOidRealRange range_in_feed;
113 float increment_in_feed;
114 BOOL long_edge_feeds;
115 XpOidArea assured_reproduction_area;
116} XpOidMediumContinuousSize;
117
118typedef struct
119{
120 XpOid page_size;
121 BOOL long_edge_feeds;
122 XpOidArea assured_reproduction_area;
123} XpOidMediumDiscreteSize;
124
125typedef struct
126{
127 XpOidMediumDiscreteSize* list;
128 int count;
129} XpOidMediumDiscreteSizeList;
130
131typedef struct
132{
133 XpOid input_tray; /* may be set to xpoid_none or xpoid_unspecified */
134 enum { XpOidMediumSS_DISCRETE, XpOidMediumSS_CONTINUOUS } mstag;
135 union
136 {
137 XpOidMediumDiscreteSizeList* discrete;
138 XpOidMediumContinuousSize* continuous_size;
139 } ms; /* "ms" is short for medium-size */
140
141} XpOidMediumSourceSize;
142
143typedef struct
144{
145 XpOidMediumSourceSize* mss;
146 int count;
147} XpOidMediumSS;
148
149
150typedef struct
151{
152 XpOid input_tray; /* may be set to xpoid_none */
153 XpOid medium;
154} XpOidTrayMedium;
155
156typedef struct
157{
158 XpOidTrayMedium* list;
159 int count;
160} XpOidTrayMediumList;
161
162typedef enum {
163 XPOID_NOTIFY_UNSUPPORTED,
164 XPOID_NOTIFY_NONE,
165 XPOID_NOTIFY_EMAIL
166} XpOidNotify;
167
168typedef struct
169{
170 unsigned long *list;
171 int count;
172} XpOidCardList;
173
174typedef struct
175{
176 char* format;
177 char* variant;
178 char* version;
179} XpOidDocFmt;
180
181typedef struct
182{
183 XpOidDocFmt* list;
184 int count;
185} XpOidDocFmtList;
186
187
188/*
189 * XpOid public methods
190 */
191const char* XpOidString(XpOid);
192int XpOidStringLength(XpOid);
193XpOid XpOidFromString(const char* value);
194BOOL XpOidTrayMediumListHasTray(const XpOidTrayMediumList* list, XpOid tray);
195
196/*
197 * XpOidList public methods
198 */
199XpOidList* XpOidListNew(const char* value_string,
200 const XpOidList* valid_oids);
201#define XpOidListInit(l, a, c) { (l)->list = (a); (l)->count = (c); }
202void XpOidListDelete(XpOidList*);
203#define XpOidListCount(l) ((l) ? (l)->count : 0)
204#define XpOidListGetOid(l, i) ((l) ? (l)->list[(i)] : xpoid_none)
205int XpOidListGetIndex(const XpOidList* list, XpOid oid);
206BOOL XpOidListHasOid(const XpOidList* list, XpOid oid);
207char* XpOidListString(const XpOidList*);
208
209
210/*
211 * XpOidLinkedList public methods
212 */
213XpOidLinkedList* XpOidLinkedListNew();
214void XpOidLinkedListDelete(XpOidLinkedList*);
215#define XpOidLinkedListCount(l) ((l) ? (l)->count : 0)
216XpOid XpOidLinkedListGetOid(XpOidLinkedList* list, int i);
217void XpOidLinkedListAddOid(XpOidLinkedList* list, XpOid oid);
218int XpOidLinkedListGetIndex(XpOidLinkedList* list, XpOid oid);
219BOOL XpOidLinkedListHasOid(XpOidLinkedList* list,
220 XpOid oid);
221XpOid XpOidLinkedListFirstOid(XpOidLinkedList* list);
222XpOid XpOidLinkedListNextOid(XpOidLinkedList* list);
223
224/*
225 * XpOidMediumSourceSize public methods
226 */
227XpOidMediumSS* XpOidMediumSSNew(const char* value_string,
228 const XpOidList* valid_trays,
229 const XpOidList* valid_medium_sizes);
230void XpOidMediumSSDelete(XpOidMediumSS*);
231#define XpOidMediumSSCount(me) ((me) ? (me)->count : 0)
232BOOL XpOidMediumSSHasSize(XpOidMediumSS*, XpOid medium_size);
233char* XpOidMediumSSString(const XpOidMediumSS*);
234
235/*
236 * XpOidTrayMediumList public methods
237 */
238XpOidTrayMediumList* XpOidTrayMediumListNew(const char* value_string,
239 const XpOidList* valid_trays,
240 const XpOidMediumSS* msss);
241void XpOidTrayMediumListDelete(XpOidTrayMediumList* me);
242#define XpOidTrayMediumListCount(me) ((me) ? (me)->count : 0)
243#define XpOidTrayMediumListTray(me, i) \
244 ((me) ? (me)->list[(i)].input_tray : xpoid_none)
245#define XpOidTrayMediumListMedium(me, i) \
246 ((me) ? (me)->list[(i)].medium : xpoid_none)
247char* XpOidTrayMediumListString(const XpOidTrayMediumList*);
248
249/*
250 * XpOidNotify public methods
251 */
252XpOidNotify XpOidNotifyParse(const char* value_string);
253const char* XpOidNotifyString(XpOidNotify notify);
254
255/*
256 * XpOidDocFmt public methods
257 */
258XpOidDocFmt* XpOidDocFmtNew(const char* value_string);
259void XpOidDocFmtDelete(XpOidDocFmt*);
260char* XpOidDocFmtString(XpOidDocFmt*);
261
262/*
263 * XpOidDocFmtList public methods
264 */
265XpOidDocFmtList* XpOidDocFmtListNew(const char* value_string,
266 const XpOidDocFmtList* valid_fmts);
267void XpOidDocFmtListDelete(XpOidDocFmtList*);
268char* XpOidDocFmtListString(const XpOidDocFmtList*);
269#define XpOidDocFmtListCount(me) ((me) ? (me)->count : 0)
270#define XpOidDocFmtListGetDocFmt(me, i) \
271 ((me) ? &(me)->list[(i)] : (XpDocFmt*)NULL)
272BOOL XpOidDocFmtListHasFmt(const XpOidDocFmtList* list,
273 const XpOidDocFmt* fmt);
274/*
275 * XpOidCardList public methods
276 */
277XpOidCardList* XpOidCardListNew(const char* value_string,
278 const XpOidCardList* valid_cards);
279#define XpOidCardListInit(l, a, c) { (l)->list = (a); (l)->count = (c); }
280void XpOidCardListDelete(XpOidCardList*);
281char* XpOidCardListString(const XpOidCardList*);
282#define XpOidCardListCount(me) ((me) ? (me)->count : 0)
283#define XpOidCardListGetCard(me, i) ((me) ? (me)->list[(i)] : 0)
284BOOL XpOidCardListHasCard(const XpOidCardList*, unsigned long);
285
286/*
287 * misc parsing functions
288 */
289BOOL XpOidParseUnsignedValue(const char* value_string,
290 const char** ptr_return,
291 unsigned long* unsigned_return);
292
293
294#endif /* _Xp_Oid_h - don't add anything after this line */
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette