VirtualBox

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

最後變更 在這個檔案從77662是 54163,由 vboxsync 提交於 10 年 前

Additions/x11/vboxvideo: support X.Org Server 1.17 (still untested).

  • 屬性 svn:eol-style 設為 native
檔案大小: 14.9 KB
 
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 * This file contains the external interfaces for the XFree86 configuration
57 * file parser.
58 */
59#ifdef HAVE_XORG_CONFIG_H
60#include <xorg-config.h>
61#endif
62
63#ifndef _xf86Parser_h_
64#define _xf86Parser_h_
65
66#include <X11/Xdefs.h>
67#include "xf86Optrec.h"
68#include "list.h"
69
70#define HAVE_PARSER_DECLS
71
72typedef struct {
73 char *file_logfile;
74 char *file_modulepath;
75 char *file_fontpath;
76 char *file_comment;
77 char *file_xkbdir;
78} XF86ConfFilesRec, *XF86ConfFilesPtr;
79
80/* Values for load_type */
81#define XF86_LOAD_MODULE 0
82#define XF86_LOAD_DRIVER 1
83#define XF86_DISABLE_MODULE 2
84
85typedef struct {
86 GenericListRec list;
87 int load_type;
88 const char *load_name;
89 XF86OptionPtr load_opt;
90 char *load_comment;
91 int ignore;
92} XF86LoadRec, *XF86LoadPtr;
93
94typedef struct {
95 XF86LoadPtr mod_load_lst;
96 XF86LoadPtr mod_disable_lst;
97 char *mod_comment;
98} XF86ConfModuleRec, *XF86ConfModulePtr;
99
100#define CONF_IMPLICIT_KEYBOARD "Implicit Core Keyboard"
101
102#define CONF_IMPLICIT_POINTER "Implicit Core Pointer"
103
104#define XF86CONF_PHSYNC 0x0001
105#define XF86CONF_NHSYNC 0x0002
106#define XF86CONF_PVSYNC 0x0004
107#define XF86CONF_NVSYNC 0x0008
108#define XF86CONF_INTERLACE 0x0010
109#define XF86CONF_DBLSCAN 0x0020
110#define XF86CONF_CSYNC 0x0040
111#define XF86CONF_PCSYNC 0x0080
112#define XF86CONF_NCSYNC 0x0100
113#define XF86CONF_HSKEW 0x0200 /* hskew provided */
114#define XF86CONF_BCAST 0x0400
115#define XF86CONF_VSCAN 0x1000
116
117typedef struct {
118 GenericListRec list;
119 const char *ml_identifier;
120 int ml_clock;
121 int ml_hdisplay;
122 int ml_hsyncstart;
123 int ml_hsyncend;
124 int ml_htotal;
125 int ml_vdisplay;
126 int ml_vsyncstart;
127 int ml_vsyncend;
128 int ml_vtotal;
129 int ml_vscan;
130 int ml_flags;
131 int ml_hskew;
132 char *ml_comment;
133} XF86ConfModeLineRec, *XF86ConfModeLinePtr;
134
135typedef struct {
136 GenericListRec list;
137 const char *vp_identifier;
138 XF86OptionPtr vp_option_lst;
139 char *vp_comment;
140} XF86ConfVideoPortRec, *XF86ConfVideoPortPtr;
141
142typedef struct {
143 GenericListRec list;
144 const char *va_identifier;
145 const char *va_vendor;
146 const char *va_board;
147 const char *va_busid;
148 const char *va_driver;
149 XF86OptionPtr va_option_lst;
150 XF86ConfVideoPortPtr va_port_lst;
151 const char *va_fwdref;
152 char *va_comment;
153} XF86ConfVideoAdaptorRec, *XF86ConfVideoAdaptorPtr;
154
155#define CONF_MAX_HSYNC 8
156#define CONF_MAX_VREFRESH 8
157
158typedef struct {
159 float hi, lo;
160} parser_range;
161
162typedef struct {
163 int red, green, blue;
164} parser_rgb;
165
166typedef struct {
167 GenericListRec list;
168 const char *modes_identifier;
169 XF86ConfModeLinePtr mon_modeline_lst;
170 char *modes_comment;
171} XF86ConfModesRec, *XF86ConfModesPtr;
172
173typedef struct {
174 GenericListRec list;
175 const char *ml_modes_str;
176 XF86ConfModesPtr ml_modes;
177} XF86ConfModesLinkRec, *XF86ConfModesLinkPtr;
178
179typedef struct {
180 GenericListRec list;
181 const char *mon_identifier;
182 const char *mon_vendor;
183 char *mon_modelname;
184 int mon_width; /* in mm */
185 int mon_height; /* in mm */
186 XF86ConfModeLinePtr mon_modeline_lst;
187 int mon_n_hsync;
188 parser_range mon_hsync[CONF_MAX_HSYNC];
189 int mon_n_vrefresh;
190 parser_range mon_vrefresh[CONF_MAX_VREFRESH];
191 float mon_gamma_red;
192 float mon_gamma_green;
193 float mon_gamma_blue;
194 XF86OptionPtr mon_option_lst;
195 XF86ConfModesLinkPtr mon_modes_sect_lst;
196 char *mon_comment;
197} XF86ConfMonitorRec, *XF86ConfMonitorPtr;
198
199#define CONF_MAXDACSPEEDS 4
200#define CONF_MAXCLOCKS 128
201
202typedef struct {
203 GenericListRec list;
204 const char *dev_identifier;
205 const char *dev_vendor;
206 const char *dev_board;
207 const char *dev_chipset;
208 const char *dev_busid;
209 const char *dev_card;
210 const char *dev_driver;
211 const char *dev_ramdac;
212 int dev_dacSpeeds[CONF_MAXDACSPEEDS];
213 int dev_videoram;
214 unsigned long dev_bios_base;
215 unsigned long dev_mem_base;
216 unsigned long dev_io_base;
217 const char *dev_clockchip;
218 int dev_clocks;
219 int dev_clock[CONF_MAXCLOCKS];
220 int dev_chipid;
221 int dev_chiprev;
222 int dev_irq;
223 int dev_screen;
224 XF86OptionPtr dev_option_lst;
225 char *dev_comment;
226 char *match_seat;
227} XF86ConfDeviceRec, *XF86ConfDevicePtr;
228
229typedef struct {
230 GenericListRec list;
231 const char *mode_name;
232} XF86ModeRec, *XF86ModePtr;
233
234typedef struct {
235 GenericListRec list;
236 int disp_frameX0;
237 int disp_frameY0;
238 int disp_virtualX;
239 int disp_virtualY;
240 int disp_depth;
241 int disp_bpp;
242 const char *disp_visual;
243 parser_rgb disp_weight;
244 parser_rgb disp_black;
245 parser_rgb disp_white;
246 XF86ModePtr disp_mode_lst;
247 XF86OptionPtr disp_option_lst;
248 char *disp_comment;
249} XF86ConfDisplayRec, *XF86ConfDisplayPtr;
250
251typedef struct {
252 XF86OptionPtr flg_option_lst;
253 char *flg_comment;
254} XF86ConfFlagsRec, *XF86ConfFlagsPtr;
255
256typedef struct {
257 GenericListRec list;
258 const char *al_adaptor_str;
259 XF86ConfVideoAdaptorPtr al_adaptor;
260} XF86ConfAdaptorLinkRec, *XF86ConfAdaptorLinkPtr;
261
262typedef struct {
263 GenericListRec list;
264 const char *scrn_identifier;
265 const char *scrn_obso_driver;
266 int scrn_defaultdepth;
267 int scrn_defaultbpp;
268 int scrn_defaultfbbpp;
269 const char *scrn_monitor_str;
270 XF86ConfMonitorPtr scrn_monitor;
271 const char *scrn_device_str;
272 XF86ConfDevicePtr scrn_device;
273 XF86ConfAdaptorLinkPtr scrn_adaptor_lst;
274 XF86ConfDisplayPtr scrn_display_lst;
275 XF86OptionPtr scrn_option_lst;
276 char *scrn_comment;
277 int scrn_virtualX, scrn_virtualY;
278 char *match_seat;
279} XF86ConfScreenRec, *XF86ConfScreenPtr;
280
281typedef struct {
282 GenericListRec list;
283 char *inp_identifier;
284 char *inp_driver;
285 XF86OptionPtr inp_option_lst;
286 char *inp_comment;
287} XF86ConfInputRec, *XF86ConfInputPtr;
288
289typedef struct {
290 GenericListRec list;
291 XF86ConfInputPtr iref_inputdev;
292 char *iref_inputdev_str;
293 XF86OptionPtr iref_option_lst;
294} XF86ConfInputrefRec, *XF86ConfInputrefPtr;
295
296typedef struct {
297 Bool set;
298 Bool val;
299} xf86TriState;
300
301typedef struct {
302 struct xorg_list entry;
303 char **values;
304} xf86MatchGroup;
305
306typedef struct {
307 GenericListRec list;
308 char *identifier;
309 char *driver;
310 struct xorg_list match_product;
311 struct xorg_list match_vendor;
312 struct xorg_list match_device;
313 struct xorg_list match_os;
314 struct xorg_list match_pnpid;
315 struct xorg_list match_usbid;
316 struct xorg_list match_driver;
317 struct xorg_list match_tag;
318 struct xorg_list match_layout;
319 xf86TriState is_keyboard;
320 xf86TriState is_pointer;
321 xf86TriState is_joystick;
322 xf86TriState is_tablet;
323 xf86TriState is_touchpad;
324 xf86TriState is_touchscreen;
325 XF86OptionPtr option_lst;
326 char *comment;
327} XF86ConfInputClassRec, *XF86ConfInputClassPtr;
328
329typedef struct {
330 GenericListRec list;
331 char *identifier;
332 char *driver;
333 struct xorg_list match_driver;
334 char *comment;
335} XF86ConfOutputClassRec, *XF86ConfOutputClassPtr;
336
337/* Values for adj_where */
338#define CONF_ADJ_OBSOLETE -1
339#define CONF_ADJ_ABSOLUTE 0
340#define CONF_ADJ_RIGHTOF 1
341#define CONF_ADJ_LEFTOF 2
342#define CONF_ADJ_ABOVE 3
343#define CONF_ADJ_BELOW 4
344#define CONF_ADJ_RELATIVE 5
345
346typedef struct {
347 GenericListRec list;
348 int adj_scrnum;
349 XF86ConfScreenPtr adj_screen;
350 const char *adj_screen_str;
351 XF86ConfScreenPtr adj_top;
352 const char *adj_top_str;
353 XF86ConfScreenPtr adj_bottom;
354 const char *adj_bottom_str;
355 XF86ConfScreenPtr adj_left;
356 const char *adj_left_str;
357 XF86ConfScreenPtr adj_right;
358 const char *adj_right_str;
359 int adj_where;
360 int adj_x;
361 int adj_y;
362 const char *adj_refscreen;
363} XF86ConfAdjacencyRec, *XF86ConfAdjacencyPtr;
364
365typedef struct {
366 GenericListRec list;
367 const char *inactive_device_str;
368 XF86ConfDevicePtr inactive_device;
369} XF86ConfInactiveRec, *XF86ConfInactivePtr;
370
371typedef struct {
372 GenericListRec list;
373 const char *lay_identifier;
374 XF86ConfAdjacencyPtr lay_adjacency_lst;
375 XF86ConfInactivePtr lay_inactive_lst;
376 XF86ConfInputrefPtr lay_input_lst;
377 XF86OptionPtr lay_option_lst;
378 char *match_seat;
379 char *lay_comment;
380} XF86ConfLayoutRec, *XF86ConfLayoutPtr;
381
382typedef struct {
383 GenericListRec list;
384 const char *vs_name;
385 const char *vs_identifier;
386 XF86OptionPtr vs_option_lst;
387 char *vs_comment;
388} XF86ConfVendSubRec, *XF86ConfVendSubPtr;
389
390typedef struct {
391 GenericListRec list;
392 const char *vnd_identifier;
393 XF86OptionPtr vnd_option_lst;
394 XF86ConfVendSubPtr vnd_sub_lst;
395 char *vnd_comment;
396} XF86ConfVendorRec, *XF86ConfVendorPtr;
397
398typedef struct {
399 const char *dri_group_name;
400 int dri_group;
401 int dri_mode;
402 char *dri_comment;
403} XF86ConfDRIRec, *XF86ConfDRIPtr;
404
405typedef struct {
406 XF86OptionPtr ext_option_lst;
407 char *extensions_comment;
408} XF86ConfExtensionsRec, *XF86ConfExtensionsPtr;
409
410typedef struct {
411 XF86ConfFilesPtr conf_files;
412 XF86ConfModulePtr conf_modules;
413 XF86ConfFlagsPtr conf_flags;
414 XF86ConfVideoAdaptorPtr conf_videoadaptor_lst;
415 XF86ConfModesPtr conf_modes_lst;
416 XF86ConfMonitorPtr conf_monitor_lst;
417 XF86ConfDevicePtr conf_device_lst;
418 XF86ConfScreenPtr conf_screen_lst;
419 XF86ConfInputPtr conf_input_lst;
420 XF86ConfInputClassPtr conf_inputclass_lst;
421 XF86ConfOutputClassPtr conf_outputclass_lst;
422 XF86ConfLayoutPtr conf_layout_lst;
423 XF86ConfVendorPtr conf_vendor_lst;
424 XF86ConfDRIPtr conf_dri;
425 XF86ConfExtensionsPtr conf_extensions;
426 char *conf_comment;
427} XF86ConfigRec, *XF86ConfigPtr;
428
429typedef struct {
430 int token; /* id of the token */
431 const char *name; /* pointer to the LOWERCASED name */
432} xf86ConfigSymTabRec, *xf86ConfigSymTabPtr;
433
434/*
435 * prototypes for public functions
436 */
437extern void xf86initConfigFiles(void);
438extern char *xf86openConfigFile(const char *path, const char *cmdline,
439 const char *projroot);
440extern char *xf86openConfigDirFiles(const char *path, const char *cmdline,
441 const char *projroot);
442extern void xf86setBuiltinConfig(const char *config[]);
443extern XF86ConfigPtr xf86readConfigFile(void);
444extern void xf86closeConfigFile(void);
445extern void xf86freeConfig(XF86ConfigPtr p);
446extern int xf86writeConfigFile(const char *, XF86ConfigPtr);
447extern _X_EXPORT XF86ConfDevicePtr xf86findDevice(const char *ident,
448 XF86ConfDevicePtr p);
449extern _X_EXPORT XF86ConfLayoutPtr xf86findLayout(const char *name,
450 XF86ConfLayoutPtr list);
451extern _X_EXPORT XF86ConfMonitorPtr xf86findMonitor(const char *ident,
452 XF86ConfMonitorPtr p);
453extern _X_EXPORT XF86ConfModesPtr xf86findModes(const char *ident,
454 XF86ConfModesPtr p);
455extern _X_EXPORT XF86ConfModeLinePtr xf86findModeLine(const char *ident,
456 XF86ConfModeLinePtr p);
457extern _X_EXPORT XF86ConfScreenPtr xf86findScreen(const char *ident,
458 XF86ConfScreenPtr p);
459extern _X_EXPORT XF86ConfInputPtr xf86findInput(const char *ident,
460 XF86ConfInputPtr p);
461extern _X_EXPORT XF86ConfInputPtr xf86findInputByDriver(const char *driver,
462 XF86ConfInputPtr p);
463extern _X_EXPORT XF86ConfVideoAdaptorPtr xf86findVideoAdaptor(const char *ident,
464 XF86ConfVideoAdaptorPtr
465 p);
466extern int xf86layoutAddInputDevices(XF86ConfigPtr config,
467 XF86ConfLayoutPtr layout);
468
469extern _X_EXPORT GenericListPtr xf86addListItem(GenericListPtr head,
470 GenericListPtr c_new);
471extern _X_EXPORT int xf86itemNotSublist(GenericListPtr list_1,
472 GenericListPtr list_2);
473
474extern _X_EXPORT int xf86pathIsAbsolute(const char *path);
475extern _X_EXPORT int xf86pathIsSafe(const char *path);
476extern _X_EXPORT char *xf86addComment(char *cur, const char *add);
477extern _X_EXPORT Bool xf86getBoolValue(Bool *val, const char *str);
478
479#endif /* _xf86Parser_h_ */
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

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