VirtualBox

source: vbox/trunk/src/VBox/Additions/x11/x11include/7.0/X11/Xresource.h@ 17234

最後變更 在這個檔案從17234是 17234,由 vboxsync 提交於 16 年 前

Additions/x11/x11include: blast! Corrected svn:keywords property on all files as per http://linserv.germany/vbox/wiki/SvnKeywords

  • 屬性 svn:eol-style 設為 native
檔案大小: 10.5 KB
 
1/* $Xorg: Xresource.h,v 1.7 2001/02/09 02:03:39 xorgcvs Exp $ */
2
3/***********************************************************
4
5Copyright 1987, 1988, 1998 The Open Group
6
7Permission to use, copy, modify, distribute, and sell this software and its
8documentation for any purpose is hereby granted without fee, provided that
9the above copyright notice appear in all copies and that both that
10copyright notice and this permission notice appear in supporting
11documentation.
12
13The above copyright notice and this permission notice shall be included in
14all copies or substantial portions of the Software.
15
16THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
20AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
23Except as contained in this notice, the name of The Open Group shall not be
24used in advertising or otherwise to promote the sale, use or other dealings
25in this Software without prior written authorization from The Open Group.
26
27
28Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts.
29
30 All Rights Reserved
31
32Permission to use, copy, modify, and distribute this software and its
33documentation for any purpose and without fee is hereby granted,
34provided that the above copyright notice appear in all copies and that
35both that copyright notice and this permission notice appear in
36supporting documentation, and that the name of Digital not be
37used in advertising or publicity pertaining to distribution of the
38software without specific, written prior permission.
39
40DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
41ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
42DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
43ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
44WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
45ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
46SOFTWARE.
47
48******************************************************************/
49/* $XFree86: xc/lib/X11/Xresource.h,v 3.8 2001/12/14 19:54:10 dawes Exp $ */
50
51#ifndef _XRESOURCE_H_
52#define _XRESOURCE_H_
53
54#ifndef _XP_PRINT_SERVER_
55#include <X11/Xlib.h>
56#endif
57
58/****************************************************************
59 ****************************************************************
60 *** ***
61 *** ***
62 *** X Resource Manager Intrinsics ***
63 *** ***
64 *** ***
65 ****************************************************************
66 ****************************************************************/
67
68_XFUNCPROTOBEGIN
69
70/****************************************************************
71 *
72 * Memory Management
73 *
74 ****************************************************************/
75
76extern char *Xpermalloc(
77 unsigned int /* size */
78);
79
80/****************************************************************
81 *
82 * Quark Management
83 *
84 ****************************************************************/
85
86typedef int XrmQuark, *XrmQuarkList;
87#define NULLQUARK ((XrmQuark) 0)
88
89typedef char *XrmString;
90#define NULLSTRING ((XrmString) 0)
91
92/* find quark for string, create new quark if none already exists */
93extern XrmQuark XrmStringToQuark(
94 _Xconst char* /* string */
95);
96
97extern XrmQuark XrmPermStringToQuark(
98 _Xconst char* /* string */
99);
100
101/* find string for quark */
102extern XrmString XrmQuarkToString(
103 XrmQuark /* quark */
104);
105
106extern XrmQuark XrmUniqueQuark(
107 void
108);
109
110#define XrmStringsEqual(a1, a2) (strcmp(a1, a2) == 0)
111
112
113/****************************************************************
114 *
115 * Conversion of Strings to Lists
116 *
117 ****************************************************************/
118
119typedef enum {XrmBindTightly, XrmBindLoosely} XrmBinding, *XrmBindingList;
120
121extern void XrmStringToQuarkList(
122 _Xconst char* /* string */,
123 XrmQuarkList /* quarks_return */
124);
125
126extern void XrmStringToBindingQuarkList(
127 _Xconst char* /* string */,
128 XrmBindingList /* bindings_return */,
129 XrmQuarkList /* quarks_return */
130);
131
132/****************************************************************
133 *
134 * Name and Class lists.
135 *
136 ****************************************************************/
137
138typedef XrmQuark XrmName;
139typedef XrmQuarkList XrmNameList;
140#define XrmNameToString(name) XrmQuarkToString(name)
141#define XrmStringToName(string) XrmStringToQuark(string)
142#define XrmStringToNameList(str, name) XrmStringToQuarkList(str, name)
143
144typedef XrmQuark XrmClass;
145typedef XrmQuarkList XrmClassList;
146#define XrmClassToString(c_class) XrmQuarkToString(c_class)
147#define XrmStringToClass(c_class) XrmStringToQuark(c_class)
148#define XrmStringToClassList(str,c_class) XrmStringToQuarkList(str, c_class)
149
150
151
152/****************************************************************
153 *
154 * Resource Representation Types and Values
155 *
156 ****************************************************************/
157
158typedef XrmQuark XrmRepresentation;
159#define XrmStringToRepresentation(string) XrmStringToQuark(string)
160#define XrmRepresentationToString(type) XrmQuarkToString(type)
161
162typedef struct {
163 unsigned int size;
164 XPointer addr;
165} XrmValue, *XrmValuePtr;
166
167
168/****************************************************************
169 *
170 * Resource Manager Functions
171 *
172 ****************************************************************/
173
174typedef struct _XrmHashBucketRec *XrmHashBucket;
175typedef XrmHashBucket *XrmHashTable;
176typedef XrmHashTable XrmSearchList[];
177typedef struct _XrmHashBucketRec *XrmDatabase;
178
179
180extern void XrmDestroyDatabase(
181 XrmDatabase /* database */
182);
183
184extern void XrmQPutResource(
185 XrmDatabase* /* database */,
186 XrmBindingList /* bindings */,
187 XrmQuarkList /* quarks */,
188 XrmRepresentation /* type */,
189 XrmValue* /* value */
190);
191
192extern void XrmPutResource(
193 XrmDatabase* /* database */,
194 _Xconst char* /* specifier */,
195 _Xconst char* /* type */,
196 XrmValue* /* value */
197);
198
199extern void XrmQPutStringResource(
200 XrmDatabase* /* database */,
201 XrmBindingList /* bindings */,
202 XrmQuarkList /* quarks */,
203 _Xconst char* /* value */
204);
205
206extern void XrmPutStringResource(
207 XrmDatabase* /* database */,
208 _Xconst char* /* specifier */,
209 _Xconst char* /* value */
210);
211
212extern void XrmPutLineResource(
213 XrmDatabase* /* database */,
214 _Xconst char* /* line */
215);
216
217extern Bool XrmQGetResource(
218 XrmDatabase /* database */,
219 XrmNameList /* quark_name */,
220 XrmClassList /* quark_class */,
221 XrmRepresentation* /* quark_type_return */,
222 XrmValue* /* value_return */
223);
224
225extern Bool XrmGetResource(
226 XrmDatabase /* database */,
227 _Xconst char* /* str_name */,
228 _Xconst char* /* str_class */,
229 char** /* str_type_return */,
230 XrmValue* /* value_return */
231);
232
233extern Bool XrmQGetSearchList(
234 XrmDatabase /* database */,
235 XrmNameList /* names */,
236 XrmClassList /* classes */,
237 XrmSearchList /* list_return */,
238 int /* list_length */
239);
240
241extern Bool XrmQGetSearchResource(
242 XrmSearchList /* list */,
243 XrmName /* name */,
244 XrmClass /* class */,
245 XrmRepresentation* /* type_return */,
246 XrmValue* /* value_return */
247);
248
249/****************************************************************
250 *
251 * Resource Database Management
252 *
253 ****************************************************************/
254
255#ifndef _XP_PRINT_SERVER_
256
257extern void XrmSetDatabase(
258 Display* /* display */,
259 XrmDatabase /* database */
260);
261
262extern XrmDatabase XrmGetDatabase(
263 Display* /* display */
264);
265
266#endif /* !_XP_PRINT_SERVER_ */
267
268extern XrmDatabase XrmGetFileDatabase(
269 _Xconst char* /* filename */
270);
271
272extern Status XrmCombineFileDatabase(
273 _Xconst char* /* filename */,
274 XrmDatabase* /* target */,
275 Bool /* override */
276);
277
278extern XrmDatabase XrmGetStringDatabase(
279 _Xconst char* /* data */ /* null terminated string */
280);
281
282extern void XrmPutFileDatabase(
283 XrmDatabase /* database */,
284 _Xconst char* /* filename */
285);
286
287extern void XrmMergeDatabases(
288 XrmDatabase /* source_db */,
289 XrmDatabase* /* target_db */
290);
291
292extern void XrmCombineDatabase(
293 XrmDatabase /* source_db */,
294 XrmDatabase* /* target_db */,
295 Bool /* override */
296);
297
298#define XrmEnumAllLevels 0
299#define XrmEnumOneLevel 1
300
301extern Bool XrmEnumerateDatabase(
302 XrmDatabase /* db */,
303 XrmNameList /* name_prefix */,
304 XrmClassList /* class_prefix */,
305 int /* mode */,
306 Bool (*)(
307 XrmDatabase* /* db */,
308 XrmBindingList /* bindings */,
309 XrmQuarkList /* quarks */,
310 XrmRepresentation* /* type */,
311 XrmValue* /* value */,
312 XPointer /* closure */
313 ) /* proc */,
314 XPointer /* closure */
315);
316
317extern const char *XrmLocaleOfDatabase(
318 XrmDatabase /* database */
319);
320
321
322/****************************************************************
323 *
324 * Command line option mapping to resource entries
325 *
326 ****************************************************************/
327
328typedef enum {
329 XrmoptionNoArg, /* Value is specified in OptionDescRec.value */
330 XrmoptionIsArg, /* Value is the option string itself */
331 XrmoptionStickyArg, /* Value is characters immediately following option */
332 XrmoptionSepArg, /* Value is next argument in argv */
333 XrmoptionResArg, /* Resource and value in next argument in argv */
334 XrmoptionSkipArg, /* Ignore this option and the next argument in argv */
335 XrmoptionSkipLine, /* Ignore this option and the rest of argv */
336 XrmoptionSkipNArgs /* Ignore this option and the next
337 OptionDescRes.value arguments in argv */
338} XrmOptionKind;
339
340typedef struct {
341 char *option; /* Option abbreviation in argv */
342 char *specifier; /* Resource specifier */
343 XrmOptionKind argKind; /* Which style of option it is */
344 XPointer value; /* Value to provide if XrmoptionNoArg */
345} XrmOptionDescRec, *XrmOptionDescList;
346
347
348extern void XrmParseCommand(
349 XrmDatabase* /* database */,
350 XrmOptionDescList /* table */,
351 int /* table_count */,
352 _Xconst char* /* name */,
353 int* /* argc_in_out */,
354 char** /* argv_in_out */
355);
356
357_XFUNCPROTOEND
358
359#endif /* _XRESOURCE_H_ */
360/* DON'T ADD STUFF AFTER THIS #endif */
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

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