First import
[xorg_rtime.git] / xorg-server-1.4 / hw / xwin / winconfig.h
blob8fd9841d7c57d71dc7d06bd33be88a7eeeda8956
1 #ifndef __WIN_CONFIG_H__
2 #define __WIN_CONFIG_H__
3 /*
4 *Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved.
6 *Permission is hereby granted, free of charge, to any person obtaining
7 * a copy of this software and associated documentation files (the
8 *"Software"), to deal in the Software without restriction, including
9 *without limitation the rights to use, copy, modify, merge, publish,
10 *distribute, sublicense, and/or sell copies of the Software, and to
11 *permit persons to whom the Software is furnished to do so, subject to
12 *the following conditions:
14 *The above copyright notice and this permission notice shall be
15 *included in all copies or substantial portions of the Software.
17 *THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
18 *EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19 *MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
20 *NONINFRINGEMENT. IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE FOR
21 *ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
22 *CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
23 *WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25 *Except as contained in this notice, the name of the XFree86 Project
26 *shall not be used in advertising or otherwise to promote the sale, use
27 *or other dealings in this Software without prior written authorization
28 *from the XFree86 Project.
30 * Authors: Alexander Gottwald
33 #include "win.h"
34 #ifdef XWIN_XF86CONFIG
35 #include "../xfree86/parser/xf86Parser.h"
36 #endif
39 /* These are taken from hw/xfree86/common/xf86str.h */
41 typedef struct
43 CARD32 red, green, blue;
45 rgb;
48 typedef struct
50 float red, green, blue;
52 Gamma;
55 typedef struct
57 char *identifier;
58 char *vendor;
59 char *board;
60 char *chipset;
61 char *ramdac;
62 char *driver;
63 struct _confscreenrec *myScreenSection;
64 Bool claimed;
65 Bool active;
66 Bool inUse;
67 int videoRam;
68 int textClockFreq;
69 pointer options;
70 int screen; /* For multi-CRTC cards */
72 GDevRec, *GDevPtr;
75 typedef struct
77 char *identifier;
78 char *driver;
79 pointer commonOptions;
80 pointer extraOptions;
82 IDevRec, *IDevPtr;
85 typedef struct
87 int frameX0;
88 int frameY0;
89 int virtualX;
90 int virtualY;
91 int depth;
92 int fbbpp;
93 rgb weight;
94 rgb blackColour;
95 rgb whiteColour;
96 int defaultVisual;
97 char **modes;
98 pointer options;
100 DispRec, *DispPtr;
103 typedef struct _confxvportrec
105 char *identifier;
106 pointer options;
108 confXvPortRec, *confXvPortPtr;
111 typedef struct _confxvadaptrec
113 char *identifier;
114 int numports;
115 confXvPortPtr ports;
116 pointer options;
118 confXvAdaptorRec, *confXvAdaptorPtr;
121 typedef struct _confscreenrec
123 char *id;
124 int screennum;
125 int defaultdepth;
126 int defaultbpp;
127 int defaultfbbpp;
128 GDevPtr device;
129 int numdisplays;
130 DispPtr displays;
131 int numxvadaptors;
132 confXvAdaptorPtr xvadaptors;
133 pointer options;
135 confScreenRec, *confScreenPtr;
138 typedef enum
140 PosObsolete = -1,
141 PosAbsolute = 0,
142 PosRightOf,
143 PosLeftOf,
144 PosAbove,
145 PosBelow,
146 PosRelative
148 PositionType;
151 typedef struct _screenlayoutrec
153 confScreenPtr screen;
154 char *topname;
155 confScreenPtr top;
156 char *bottomname;
157 confScreenPtr bottom;
158 char *leftname;
159 confScreenPtr left;
160 char *rightname;
161 confScreenPtr right;
162 PositionType where;
163 int x;
164 int y;
165 char *refname;
166 confScreenPtr refscreen;
168 screenLayoutRec, *screenLayoutPtr;
171 typedef struct _serverlayoutrec
173 char *id;
174 screenLayoutPtr screens;
175 GDevPtr inactives;
176 IDevPtr inputs;
177 pointer options;
179 serverLayoutRec, *serverLayoutPtr;
183 * winconfig.c
186 typedef struct
188 /* Files */
189 #ifdef XWIN_XF86CONFIG
190 char *configFile;
191 #endif
192 char *fontPath;
193 char *rgbPath;
194 /* input devices - keyboard */
195 #ifdef XWIN_XF86CONFIG
196 char *keyboard;
197 #endif
198 #ifdef XKB
199 Bool noXkbExtension;
200 char *xkbMap;
201 char *xkbRules;
202 char *xkbModel;
203 char *xkbLayout;
204 char *xkbVariant;
205 char *xkbOptions;
206 #endif
207 /* layout */
208 char *screenname;
209 /* mouse settings */
210 char *mouse;
211 Bool emulate3buttons;
212 long emulate3timeout;
214 WinCmdlineRec, *WinCmdlinePtr;
217 extern WinCmdlineRec g_cmdline;
218 #ifdef XWIN_XF86CONFIG
219 extern XF86ConfigPtr g_xf86configptr;
220 #endif
221 extern serverLayoutRec g_winConfigLayout;
225 * Function prototypes
228 Bool winReadConfigfile (void);
229 Bool winConfigFiles (void);
230 Bool winConfigOptions (void);
231 Bool winConfigScreens (void);
232 Bool winConfigKeyboard (DeviceIntPtr pDevice);
233 Bool winConfigMouse (DeviceIntPtr pDevice);
236 typedef struct
238 double freq;
239 int units;
241 OptFrequency;
244 typedef union
246 unsigned long num;
247 char *str;
248 double realnum;
249 Bool bool;
250 OptFrequency freq;
252 ValueUnion;
255 typedef enum
257 OPTV_NONE = 0,
258 OPTV_INTEGER,
259 OPTV_STRING, /* a non-empty string */
260 OPTV_ANYSTR, /* Any string, including an empty one */
261 OPTV_REAL,
262 OPTV_BOOLEAN,
263 OPTV_FREQ
265 OptionValueType;
268 typedef enum
270 OPTUNITS_HZ = 1,
271 OPTUNITS_KHZ,
272 OPTUNITS_MHZ
274 OptFreqUnits;
277 typedef struct
279 int token;
280 const char *name;
281 OptionValueType type;
282 ValueUnion value;
283 Bool found;
285 OptionInfoRec, *OptionInfoPtr;
289 * Function prototypes
292 char *winSetStrOption (pointer optlist, const char *name, char *deflt);
293 int winSetBoolOption (pointer optlist, const char *name, int deflt);
294 int winSetIntOption (pointer optlist, const char *name, int deflt);
295 double winSetRealOption (pointer optlist, const char *name, double deflt);
296 #ifdef XWIN_XF86CONFIG
297 XF86OptionPtr winFindOption (XF86OptionPtr list, const char *name);
298 char *winFindOptionValue (XF86OptionPtr list, const char *name);
299 #endif
300 int winNameCompare (const char *s1, const char *s2);
301 char *winNormalizeName (const char *s);
304 typedef struct
306 struct
308 long leds;
309 long delay;
310 long rate;
312 keyboard;
313 #ifdef XKB
314 struct
316 Bool disable;
317 char *rules;
318 char *model;
319 char *layout;
320 char *variant;
321 char *options;
322 char *initialMap;
323 char *keymap;
324 char *types;
325 char *compat;
326 char *keycodes;
327 char *symbols;
328 char *geometry;
330 xkb;
331 #endif
332 struct
334 Bool emulate3Buttons;
335 long emulate3Timeout;
337 pointer;
339 winInfoRec, *winInfoPtr;
342 extern winInfoRec g_winInfo;
344 #endif