VirtualBox

source: vbox/trunk/src/VBox/Additions/x11/x11include/xorg-server-1.3.0.0/xf86Parser.h@ 33428

Last change on this file since 33428 was 25078, checked in by vboxsync, 15 years ago

Additions/x11/x11include: exported and set eol-style on new headers

  • Property svn:eol-style set to native
File size: 11.9 KB
Line 
1/*
2 *
3 * Copyright (c) 1997 Metro Link Incorporated
4 *
5 * Permission is hereby granted, free of charge, to any person obtaining a
6 * copy of this software and associated documentation files (the "Software"),
7 * to deal in the Software without restriction, including without limitation
8 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9 * and/or sell copies of the Software, and to permit persons to whom the
10 * Software is furnished to do so, subject to the following conditions:
11 *
12 * The above copyright notice and this permission notice shall be included in
13 * all copies or substantial portions of the Software.
14 *
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 * THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
19 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
20 * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 * SOFTWARE.
22 *
23 * Except as contained in this notice, the name of the Metro Link shall not be
24 * used in advertising or otherwise to promote the sale, use or other dealings
25 * in this Software without prior written authorization from Metro Link.
26 *
27 */
28/*
29 * Copyright (c) 1997-2003 by The XFree86 Project, Inc.
30 *
31 * Permission is hereby granted, free of charge, to any person obtaining a
32 * copy of this software and associated documentation files (the "Software"),
33 * to deal in the Software without restriction, including without limitation
34 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
35 * and/or sell copies of the Software, and to permit persons to whom the
36 * Software is furnished to do so, subject to the following conditions:
37 *
38 * The above copyright notice and this permission notice shall be included in
39 * all copies or substantial portions of the Software.
40 *
41 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
42 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
43 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
44 * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
45 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
46 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
47 * OTHER DEALINGS IN THE SOFTWARE.
48 *
49 * Except as contained in this notice, the name of the copyright holder(s)
50 * and author(s) shall not be used in advertising or otherwise to promote
51 * the sale, use or other dealings in this Software without prior written
52 * authorization from the copyright holder(s) and author(s).
53 */
54
55
56/*
57 * This file contains the external interfaces for the XFree86 configuration
58 * file parser.
59 */
60#ifdef HAVE_XORG_CONFIG_H
61#include <xorg-config.h>
62#endif
63
64#ifndef _xf86Parser_h_
65#define _xf86Parser_h_
66
67#include "xf86Optrec.h"
68
69#define HAVE_PARSER_DECLS
70
71typedef struct
72{
73 char *file_logfile;
74 char *file_rgbpath;
75 char *file_modulepath;
76 char *file_inputdevs;
77 char *file_fontpath;
78 char *file_comment;
79}
80XF86ConfFilesRec, *XF86ConfFilesPtr;
81
82/* Values for load_type */
83#define XF86_LOAD_MODULE 0
84#define XF86_LOAD_DRIVER 1
85
86typedef struct
87{
88 GenericListRec list;
89 int load_type;
90 char *load_name;
91 XF86OptionPtr load_opt;
92 char *load_comment;
93 int ignore;
94}
95XF86LoadRec, *XF86LoadPtr;
96
97typedef struct
98{
99 XF86LoadPtr mod_load_lst;
100 char *mod_comment;
101}
102XF86ConfModuleRec, *XF86ConfModulePtr;
103
104#define CONF_IMPLICIT_KEYBOARD "Implicit Core Keyboard"
105
106#define CONF_IMPLICIT_POINTER "Implicit Core Pointer"
107
108#define XF86CONF_PHSYNC 0x0001
109#define XF86CONF_NHSYNC 0x0002
110#define XF86CONF_PVSYNC 0x0004
111#define XF86CONF_NVSYNC 0x0008
112#define XF86CONF_INTERLACE 0x0010
113#define XF86CONF_DBLSCAN 0x0020
114#define XF86CONF_CSYNC 0x0040
115#define XF86CONF_PCSYNC 0x0080
116#define XF86CONF_NCSYNC 0x0100
117#define XF86CONF_HSKEW 0x0200 /* hskew provided */
118#define XF86CONF_BCAST 0x0400
119#define XF86CONF_CUSTOM 0x0800 /* timing numbers customized by editor */
120#define XF86CONF_VSCAN 0x1000
121
122typedef struct
123{
124 GenericListRec list;
125 char *ml_identifier;
126 int ml_clock;
127 int ml_hdisplay;
128 int ml_hsyncstart;
129 int ml_hsyncend;
130 int ml_htotal;
131 int ml_vdisplay;
132 int ml_vsyncstart;
133 int ml_vsyncend;
134 int ml_vtotal;
135 int ml_vscan;
136 int ml_flags;
137 int ml_hskew;
138 char *ml_comment;
139}
140XF86ConfModeLineRec, *XF86ConfModeLinePtr;
141
142typedef struct
143{
144 GenericListRec list;
145 char *vp_identifier;
146 XF86OptionPtr vp_option_lst;
147 char *vp_comment;
148}
149XF86ConfVideoPortRec, *XF86ConfVideoPortPtr;
150
151typedef struct
152{
153 GenericListRec list;
154 char *va_identifier;
155 char *va_vendor;
156 char *va_board;
157 char *va_busid;
158 char *va_driver;
159 XF86OptionPtr va_option_lst;
160 XF86ConfVideoPortPtr va_port_lst;
161 char *va_fwdref;
162 char *va_comment;
163}
164XF86ConfVideoAdaptorRec, *XF86ConfVideoAdaptorPtr;
165
166#define CONF_MAX_HSYNC 8
167#define CONF_MAX_VREFRESH 8
168
169typedef struct
170{
171 float hi, lo;
172}
173parser_range;
174
175typedef struct
176{
177 int red, green, blue;
178}
179parser_rgb;
180
181typedef struct
182{
183 GenericListRec list;
184 char *modes_identifier;
185 XF86ConfModeLinePtr mon_modeline_lst;
186 char *modes_comment;
187}
188XF86ConfModesRec, *XF86ConfModesPtr;
189
190typedef struct
191{
192 GenericListRec list;
193 char *ml_modes_str;
194 XF86ConfModesPtr ml_modes;
195}
196XF86ConfModesLinkRec, *XF86ConfModesLinkPtr;
197
198typedef struct
199{
200 GenericListRec list;
201 char *mon_identifier;
202 char *mon_vendor;
203 char *mon_modelname;
204 int mon_width; /* in mm */
205 int mon_height; /* in mm */
206 XF86ConfModeLinePtr mon_modeline_lst;
207 int mon_n_hsync;
208 parser_range mon_hsync[CONF_MAX_HSYNC];
209 int mon_n_vrefresh;
210 parser_range mon_vrefresh[CONF_MAX_VREFRESH];
211 float mon_gamma_red;
212 float mon_gamma_green;
213 float mon_gamma_blue;
214 XF86OptionPtr mon_option_lst;
215 XF86ConfModesLinkPtr mon_modes_sect_lst;
216 char *mon_comment;
217}
218XF86ConfMonitorRec, *XF86ConfMonitorPtr;
219
220#define CONF_MAXDACSPEEDS 4
221#define CONF_MAXCLOCKS 128
222
223typedef struct
224{
225 GenericListRec list;
226 char *dev_identifier;
227 char *dev_vendor;
228 char *dev_board;
229 char *dev_chipset;
230 char *dev_busid;
231 char *dev_card;
232 char *dev_driver;
233 char *dev_ramdac;
234 int dev_dacSpeeds[CONF_MAXDACSPEEDS];
235 int dev_videoram;
236 int dev_textclockfreq;
237 unsigned long dev_bios_base;
238 unsigned long dev_mem_base;
239 unsigned long dev_io_base;
240 char *dev_clockchip;
241 int dev_clocks;
242 int dev_clock[CONF_MAXCLOCKS];
243 int dev_chipid;
244 int dev_chiprev;
245 int dev_irq;
246 int dev_screen;
247 XF86OptionPtr dev_option_lst;
248 char *dev_comment;
249}
250XF86ConfDeviceRec, *XF86ConfDevicePtr;
251
252typedef struct
253{
254 GenericListRec list;
255 char *mode_name;
256}
257XF86ModeRec, *XF86ModePtr;
258
259typedef struct
260{
261 GenericListRec list;
262 int disp_frameX0;
263 int disp_frameY0;
264 int disp_virtualX;
265 int disp_virtualY;
266 int disp_depth;
267 int disp_bpp;
268 char *disp_visual;
269 parser_rgb disp_weight;
270 parser_rgb disp_black;
271 parser_rgb disp_white;
272 XF86ModePtr disp_mode_lst;
273 XF86OptionPtr disp_option_lst;
274 char *disp_comment;
275}
276XF86ConfDisplayRec, *XF86ConfDisplayPtr;
277
278typedef struct
279{
280 XF86OptionPtr flg_option_lst;
281 char *flg_comment;
282}
283XF86ConfFlagsRec, *XF86ConfFlagsPtr;
284
285typedef struct
286{
287 GenericListRec list;
288 char *al_adaptor_str;
289 XF86ConfVideoAdaptorPtr al_adaptor;
290}
291XF86ConfAdaptorLinkRec, *XF86ConfAdaptorLinkPtr;
292
293typedef struct
294{
295 GenericListRec list;
296 char *scrn_identifier;
297 char *scrn_obso_driver;
298 int scrn_defaultdepth;
299 int scrn_defaultbpp;
300 int scrn_defaultfbbpp;
301 char *scrn_monitor_str;
302 XF86ConfMonitorPtr scrn_monitor;
303 char *scrn_device_str;
304 XF86ConfDevicePtr scrn_device;
305 XF86ConfAdaptorLinkPtr scrn_adaptor_lst;
306 XF86ConfDisplayPtr scrn_display_lst;
307 XF86OptionPtr scrn_option_lst;
308 char *scrn_comment;
309}
310XF86ConfScreenRec, *XF86ConfScreenPtr;
311
312typedef struct
313{
314 GenericListRec list;
315 char *inp_identifier;
316 char *inp_driver;
317 XF86OptionPtr inp_option_lst;
318 char *inp_comment;
319}
320XF86ConfInputRec, *XF86ConfInputPtr;
321
322typedef struct
323{
324 GenericListRec list;
325 XF86ConfInputPtr iref_inputdev;
326 char *iref_inputdev_str;
327 XF86OptionPtr iref_option_lst;
328}
329XF86ConfInputrefRec, *XF86ConfInputrefPtr;
330
331/* Values for adj_where */
332#define CONF_ADJ_OBSOLETE -1
333#define CONF_ADJ_ABSOLUTE 0
334#define CONF_ADJ_RIGHTOF 1
335#define CONF_ADJ_LEFTOF 2
336#define CONF_ADJ_ABOVE 3
337#define CONF_ADJ_BELOW 4
338#define CONF_ADJ_RELATIVE 5
339
340typedef struct
341{
342 GenericListRec list;
343 int adj_scrnum;
344 XF86ConfScreenPtr adj_screen;
345 char *adj_screen_str;
346 XF86ConfScreenPtr adj_top;
347 char *adj_top_str;
348 XF86ConfScreenPtr adj_bottom;
349 char *adj_bottom_str;
350 XF86ConfScreenPtr adj_left;
351 char *adj_left_str;
352 XF86ConfScreenPtr adj_right;
353 char *adj_right_str;
354 int adj_where;
355 int adj_x;
356 int adj_y;
357 char *adj_refscreen;
358}
359XF86ConfAdjacencyRec, *XF86ConfAdjacencyPtr;
360
361typedef struct
362{
363 GenericListRec list;
364 char *inactive_device_str;
365 XF86ConfDevicePtr inactive_device;
366}
367XF86ConfInactiveRec, *XF86ConfInactivePtr;
368
369typedef struct
370{
371 GenericListRec list;
372 char *lay_identifier;
373 XF86ConfAdjacencyPtr lay_adjacency_lst;
374 XF86ConfInactivePtr lay_inactive_lst;
375 XF86ConfInputrefPtr lay_input_lst;
376 XF86OptionPtr lay_option_lst;
377 char *lay_comment;
378}
379XF86ConfLayoutRec, *XF86ConfLayoutPtr;
380
381typedef struct
382{
383 GenericListRec list;
384 char *vs_name;
385 char *vs_identifier;
386 XF86OptionPtr vs_option_lst;
387 char *vs_comment;
388}
389XF86ConfVendSubRec, *XF86ConfVendSubPtr;
390
391typedef struct
392{
393 GenericListRec list;
394 char *vnd_identifier;
395 XF86OptionPtr vnd_option_lst;
396 XF86ConfVendSubPtr vnd_sub_lst;
397 char *vnd_comment;
398}
399XF86ConfVendorRec, *XF86ConfVendorPtr;
400
401typedef struct
402{
403 GenericListRec list;
404 int buf_count;
405 int buf_size;
406 char *buf_flags;
407 char *buf_comment;
408}
409XF86ConfBuffersRec, *XF86ConfBuffersPtr;
410
411typedef struct
412{
413 char *dri_group_name;
414 int dri_group;
415 int dri_mode;
416 XF86ConfBuffersPtr dri_buffers_lst;
417 char *dri_comment;
418}
419XF86ConfDRIRec, *XF86ConfDRIPtr;
420
421typedef struct
422{
423 XF86OptionPtr ext_option_lst;
424 char *extensions_comment;
425}
426XF86ConfExtensionsRec, *XF86ConfExtensionsPtr;
427
428typedef struct
429{
430 XF86ConfFilesPtr conf_files;
431 XF86ConfModulePtr conf_modules;
432 XF86ConfFlagsPtr conf_flags;
433 XF86ConfVideoAdaptorPtr conf_videoadaptor_lst;
434 XF86ConfModesPtr conf_modes_lst;
435 XF86ConfMonitorPtr conf_monitor_lst;
436 XF86ConfDevicePtr conf_device_lst;
437 XF86ConfScreenPtr conf_screen_lst;
438 XF86ConfInputPtr conf_input_lst;
439 XF86ConfLayoutPtr conf_layout_lst;
440 XF86ConfVendorPtr conf_vendor_lst;
441 XF86ConfDRIPtr conf_dri;
442 XF86ConfExtensionsPtr conf_extensions;
443 char *conf_comment;
444}
445XF86ConfigRec, *XF86ConfigPtr;
446
447typedef struct
448{
449 int token; /* id of the token */
450 char *name; /* pointer to the LOWERCASED name */
451}
452xf86ConfigSymTabRec, *xf86ConfigSymTabPtr;
453
454/*
455 * prototypes for public functions
456 */
457extern const char *xf86openConfigFile (const char *, const char *,
458 const char *);
459extern void xf86setBuiltinConfig(const char *config[]);
460extern XF86ConfigPtr xf86readConfigFile (void);
461extern void xf86closeConfigFile (void);
462extern void xf86freeConfig (XF86ConfigPtr p);
463extern int xf86writeConfigFile (const char *, XF86ConfigPtr);
464XF86ConfDevicePtr xf86findDevice(const char *ident, XF86ConfDevicePtr p);
465XF86ConfLayoutPtr xf86findLayout(const char *name, XF86ConfLayoutPtr list);
466XF86ConfMonitorPtr xf86findMonitor(const char *ident, XF86ConfMonitorPtr p);
467XF86ConfModesPtr xf86findModes(const char *ident, XF86ConfModesPtr p);
468XF86ConfModeLinePtr xf86findModeLine(const char *ident, XF86ConfModeLinePtr p);
469XF86ConfScreenPtr xf86findScreen(const char *ident, XF86ConfScreenPtr p);
470XF86ConfInputPtr xf86findInput(const char *ident, XF86ConfInputPtr p);
471XF86ConfInputPtr xf86findInputByDriver(const char *driver, XF86ConfInputPtr p);
472XF86ConfVendorPtr xf86findVendor(const char *name, XF86ConfVendorPtr list);
473XF86ConfVideoAdaptorPtr xf86findVideoAdaptor(const char *ident,
474 XF86ConfVideoAdaptorPtr p);
475
476GenericListPtr xf86addListItem(GenericListPtr head, GenericListPtr c_new);
477int xf86itemNotSublist(GenericListPtr list_1, GenericListPtr list_2);
478
479int xf86pathIsAbsolute(const char *path);
480int xf86pathIsSafe(const char *path);
481char *xf86addComment(char *cur, char *add);
482
483#endif /* _xf86Parser_h_ */
Note: See TracBrowser for help on using the repository browser.

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