VirtualBox

source: vbox/trunk/src/VBox/Additions/x11/x11include/xorg-server-1.16.0/xf86.h@ 99743

Last change on this file since 99743 was 52145, checked in by vboxsync, 10 years ago

Additions/x11/x11include: add header files for X.Org Server 1.16.

  • Property svn:eol-style set to native
File size: 18.1 KB
Line 
1/*
2 * Copyright (c) 1997-2003 by The XFree86 Project, Inc.
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
13 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
18 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20 * OTHER DEALINGS IN THE SOFTWARE.
21 *
22 * Except as contained in this notice, the name of the copyright holder(s)
23 * and author(s) shall not be used in advertising or otherwise to promote
24 * the sale, use or other dealings in this Software without prior written
25 * authorization from the copyright holder(s) and author(s).
26 */
27
28/*
29 * This file contains declarations for public XFree86 functions and variables,
30 * and definitions of public macros.
31 *
32 * "public" means available to video drivers.
33 */
34
35#ifndef _XF86_H
36#define _XF86_H
37
38#if HAVE_XORG_CONFIG_H
39#include <xorg-config.h>
40#elif HAVE_DIX_CONFIG_H
41#include <dix-config.h>
42#endif
43
44#include "xf86str.h"
45#include "xf86Opt.h"
46#include <X11/Xfuncproto.h>
47#include <stdarg.h>
48#ifdef RANDR
49#include <X11/extensions/randr.h>
50#endif
51
52#include "propertyst.h"
53
54/* General parameters */
55extern _X_EXPORT int xf86DoConfigure;
56extern _X_EXPORT int xf86DoShowOptions;
57extern _X_EXPORT Bool xf86DoConfigurePass1;
58extern _X_EXPORT Bool xorgHWAccess;
59
60extern _X_EXPORT DevPrivateKeyRec xf86ScreenKeyRec;
61
62#define xf86ScreenKey (&xf86ScreenKeyRec)
63
64extern _X_EXPORT DevPrivateKeyRec xf86CreateRootWindowKeyRec;
65
66#define xf86CreateRootWindowKey (&xf86CreateRootWindowKeyRec)
67
68extern _X_EXPORT ScrnInfoPtr *xf86Screens; /* List of pointers to ScrnInfoRecs */
69extern _X_EXPORT const unsigned char byte_reversed[256];
70extern _X_EXPORT Bool fbSlotClaimed;
71
72#if (defined(__sparc__) || defined(__sparc)) && !defined(__OpenBSD__)
73extern _X_EXPORT Bool sbusSlotClaimed;
74#endif
75
76#if defined(XSERVER_PLATFORM_BUS)
77extern _X_EXPORT int platformSlotClaimed;
78#endif
79
80extern _X_EXPORT confDRIRec xf86ConfigDRI;
81extern _X_EXPORT Bool xf86DRI2Enabled(void);
82
83extern _X_EXPORT Bool VTSwitchEnabled; /* kbd driver */
84
85#define XF86SCRNINFO(p) xf86ScreenToScrn(p)
86
87#define XF86FLIP_PIXELS() \
88 do { \
89 if (xf86GetFlipPixels()) { \
90 pScreen->whitePixel = (pScreen->whitePixel) ? 0 : 1; \
91 pScreen->blackPixel = (pScreen->blackPixel) ? 0 : 1; \
92 } \
93 while (0)
94
95#define BOOLTOSTRING(b) ((b) ? "TRUE" : "FALSE")
96
97#define PIX24TOBPP(p) (((p) == Pix24Use24) ? 24 : \
98 (((p) == Pix24Use32) ? 32 : 0))
99
100/* Function Prototypes */
101#ifndef _NO_XF86_PROTOTYPES
102
103/* PCI related */
104#ifdef XSERVER_LIBPCIACCESS
105#include <pciaccess.h>
106extern _X_EXPORT int pciSlotClaimed;
107
108extern _X_EXPORT Bool xf86CheckPciSlot(const struct pci_device *);
109extern _X_EXPORT int xf86ClaimPciSlot(struct pci_device *, DriverPtr drvp,
110 int chipset, GDevPtr dev, Bool active);
111extern _X_EXPORT void xf86UnclaimPciSlot(struct pci_device *, GDevPtr dev);
112extern _X_EXPORT Bool xf86ParsePciBusString(const char *busID, int *bus,
113 int *device, int *func);
114extern _X_EXPORT Bool xf86ComparePciBusString(const char *busID, int bus,
115 int device, int func);
116extern _X_EXPORT Bool xf86IsPrimaryPci(struct pci_device *pPci);
117extern _X_EXPORT Bool xf86CheckPciMemBase(struct pci_device *pPci,
118 memType base);
119extern _X_EXPORT struct pci_device *xf86GetPciInfoForEntity(int entityIndex);
120extern _X_EXPORT int xf86MatchPciInstances(const char *driverName,
121 int vendorID, SymTabPtr chipsets,
122 PciChipsets * PCIchipsets,
123 GDevPtr * devList, int numDevs,
124 DriverPtr drvp, int **foundEntities);
125extern _X_EXPORT ScrnInfoPtr xf86ConfigPciEntity(ScrnInfoPtr pScrn,
126 int scrnFlag, int entityIndex,
127 PciChipsets * p_chip,
128 void *dummy, EntityProc init,
129 EntityProc enter,
130 EntityProc leave,
131 void *private);
132/* Obsolete! don't use */
133extern _X_EXPORT Bool xf86ConfigActivePciEntity(ScrnInfoPtr pScrn,
134 int entityIndex,
135 PciChipsets * p_chip,
136 void *dummy, EntityProc init,
137 EntityProc enter,
138 EntityProc leave,
139 void *private);
140#else
141#define xf86VGAarbiterInit() do {} while (0)
142#define xf86VGAarbiterFini() do {} while (0)
143#define xf86VGAarbiterLock(x) do {} while (0)
144#define xf86VGAarbiterUnlock(x) do {} while (0)
145#define xf86VGAarbiterScrnInit(x) do {} while (0)
146#define xf86VGAarbiterDeviceDecodes() do {} while (0)
147#define xf86VGAarbiterWrapFunctions() do {} while (0)
148#endif
149
150/* xf86Bus.c */
151
152extern _X_EXPORT int xf86GetFbInfoForScreen(int scrnIndex);
153extern _X_EXPORT int xf86ClaimFbSlot(DriverPtr drvp, int chipset, GDevPtr dev,
154 Bool active);
155extern _X_EXPORT int xf86ClaimNoSlot(DriverPtr drvp, int chipset, GDevPtr dev,
156 Bool active);
157extern _X_EXPORT Bool xf86DriverHasEntities(DriverPtr drvp);
158extern _X_EXPORT void xf86AddEntityToScreen(ScrnInfoPtr pScrn, int entityIndex);
159extern _X_EXPORT void xf86SetEntityInstanceForScreen(ScrnInfoPtr pScrn,
160 int entityIndex,
161 int instance);
162extern _X_EXPORT int xf86GetNumEntityInstances(int entityIndex);
163extern _X_EXPORT GDevPtr xf86GetDevFromEntity(int entityIndex, int instance);
164extern _X_EXPORT void xf86RemoveEntityFromScreen(ScrnInfoPtr pScrn,
165 int entityIndex);
166extern _X_EXPORT EntityInfoPtr xf86GetEntityInfo(int entityIndex);
167extern _X_EXPORT Bool xf86SetEntityFuncs(int entityIndex, EntityProc init,
168 EntityProc enter, EntityProc leave,
169 void *);
170extern _X_EXPORT Bool xf86IsEntityPrimary(int entityIndex);
171extern _X_EXPORT ScrnInfoPtr xf86FindScreenForEntity(int entityIndex);
172
173extern _X_EXPORT int xf86GetLastScrnFlag(int entityIndex);
174extern _X_EXPORT void xf86SetLastScrnFlag(int entityIndex, int scrnIndex);
175extern _X_EXPORT Bool xf86IsEntityShared(int entityIndex);
176extern _X_EXPORT void xf86SetEntityShared(int entityIndex);
177extern _X_EXPORT Bool xf86IsEntitySharable(int entityIndex);
178extern _X_EXPORT void xf86SetEntitySharable(int entityIndex);
179extern _X_EXPORT Bool xf86IsPrimInitDone(int entityIndex);
180extern _X_EXPORT void xf86SetPrimInitDone(int entityIndex);
181extern _X_EXPORT void xf86ClearPrimInitDone(int entityIndex);
182extern _X_EXPORT int xf86AllocateEntityPrivateIndex(void);
183extern _X_EXPORT DevUnion *xf86GetEntityPrivate(int entityIndex, int privIndex);
184
185/* xf86Configure.c */
186extern _X_EXPORT GDevPtr xf86AddBusDeviceToConfigure(const char *driver,
187 BusType bus, void *busData,
188 int chipset);
189
190/* xf86Cursor.c */
191
192extern _X_EXPORT void xf86LockZoom(ScreenPtr pScreen, int lock);
193extern _X_EXPORT void xf86InitViewport(ScrnInfoPtr pScr);
194extern _X_EXPORT void xf86SetViewport(ScreenPtr pScreen, int x, int y);
195extern _X_EXPORT void xf86ZoomViewport(ScreenPtr pScreen, int zoom);
196extern _X_EXPORT Bool xf86SwitchMode(ScreenPtr pScreen, DisplayModePtr mode);
197extern _X_EXPORT void *xf86GetPointerScreenFuncs(void);
198extern _X_EXPORT void xf86InitOrigins(void);
199extern _X_EXPORT void xf86ReconfigureLayout(void);
200
201/* xf86DPMS.c */
202
203extern _X_EXPORT Bool xf86DPMSInit(ScreenPtr pScreen, DPMSSetProcPtr set,
204 int flags);
205
206/* xf86DGA.c */
207
208#ifdef XFreeXDGA
209extern _X_EXPORT Bool DGAInit(ScreenPtr pScreen, DGAFunctionPtr funcs,
210 DGAModePtr modes, int num);
211extern _X_EXPORT Bool DGAReInitModes(ScreenPtr pScreen, DGAModePtr modes,
212 int num);
213extern _X_EXPORT xf86SetDGAModeProc xf86SetDGAMode;
214#endif
215
216/* xf86Events.c */
217
218typedef struct _InputInfoRec *InputInfoPtr;
219
220extern _X_EXPORT void SetTimeSinceLastInputEvent(void);
221extern _X_EXPORT void *xf86AddInputHandler(int fd, InputHandlerProc proc,
222 void *data);
223extern _X_EXPORT int xf86RemoveInputHandler(void *handler);
224extern _X_EXPORT void xf86DisableInputHandler(void *handler);
225extern _X_EXPORT void xf86EnableInputHandler(void *handler);
226extern _X_EXPORT void *xf86AddGeneralHandler(int fd, InputHandlerProc proc,
227 void *data);
228extern _X_EXPORT int xf86RemoveGeneralHandler(void *handler);
229extern _X_EXPORT void xf86DisableGeneralHandler(void *handler);
230extern _X_EXPORT void xf86EnableGeneralHandler(void *handler);
231extern _X_EXPORT InputHandlerProc xf86SetConsoleHandler(InputHandlerProc
232 handler, void *data);
233extern _X_EXPORT void xf86InterceptSignals(int *signo);
234extern _X_EXPORT void xf86InterceptSigIll(void (*sigillhandler) (void));
235extern _X_EXPORT Bool xf86EnableVTSwitch(Bool new);
236extern _X_EXPORT void xf86ProcessActionEvent(ActionEvent action, void *arg);
237extern _X_EXPORT void xf86PrintBacktrace(void);
238extern _X_EXPORT Bool xf86VTOwner(void);
239extern _X_EXPORT void xf86VTLeave(void);
240extern _X_EXPORT void xf86VTEnter(void);
241extern _X_EXPORT void xf86EnableInputDeviceForVTSwitch(InputInfoPtr pInfo);
242extern _X_EXPORT void xf86DisableInputDeviceForVTSwitch(InputInfoPtr pInfo);
243
244/* xf86Helper.c */
245
246extern _X_EXPORT void xf86AddDriver(DriverPtr driver, void *module,
247 int flags);
248extern _X_EXPORT void xf86DeleteDriver(int drvIndex);
249extern _X_EXPORT ScrnInfoPtr xf86AllocateScreen(DriverPtr drv, int flags);
250extern _X_EXPORT void xf86DeleteScreen(ScrnInfoPtr pScrn);
251extern _X_EXPORT int xf86AllocateScrnInfoPrivateIndex(void);
252extern _X_EXPORT Bool xf86AddPixFormat(ScrnInfoPtr pScrn, int depth, int bpp,
253 int pad);
254extern _X_EXPORT Bool xf86SetDepthBpp(ScrnInfoPtr scrp, int depth, int bpp,
255 int fbbpp, int depth24flags);
256extern _X_EXPORT void xf86PrintDepthBpp(ScrnInfoPtr scrp);
257extern _X_EXPORT Bool xf86SetWeight(ScrnInfoPtr scrp, rgb weight, rgb mask);
258extern _X_EXPORT Bool xf86SetDefaultVisual(ScrnInfoPtr scrp, int visual);
259extern _X_EXPORT Bool xf86SetGamma(ScrnInfoPtr scrp, Gamma newGamma);
260extern _X_EXPORT void xf86SetDpi(ScrnInfoPtr pScrn, int x, int y);
261extern _X_EXPORT void xf86SetBlackWhitePixels(ScreenPtr pScreen);
262extern _X_EXPORT void xf86EnableDisableFBAccess(ScrnInfoPtr pScrn, Bool enable);
263extern _X_EXPORT void
264xf86VDrvMsgVerb(int scrnIndex, MessageType type, int verb,
265 const char *format, va_list args)
266_X_ATTRIBUTE_PRINTF(4, 0);
267extern _X_EXPORT void
268xf86DrvMsgVerb(int scrnIndex, MessageType type, int verb,
269 const char *format, ...)
270_X_ATTRIBUTE_PRINTF(4, 5);
271extern _X_EXPORT void
272xf86DrvMsg(int scrnIndex, MessageType type, const char *format, ...)
273_X_ATTRIBUTE_PRINTF(3, 4);
274extern _X_EXPORT void
275xf86MsgVerb(MessageType type, int verb, const char *format, ...)
276_X_ATTRIBUTE_PRINTF(3, 4);
277extern _X_EXPORT void
278xf86Msg(MessageType type, const char *format, ...)
279_X_ATTRIBUTE_PRINTF(2, 3);
280extern _X_EXPORT void
281xf86ErrorFVerb(int verb, const char *format, ...)
282_X_ATTRIBUTE_PRINTF(2, 3);
283extern _X_EXPORT void
284xf86ErrorF(const char *format, ...)
285_X_ATTRIBUTE_PRINTF(1, 2);
286extern _X_EXPORT const char *
287xf86TokenToString(SymTabPtr table, int token);
288extern _X_EXPORT int
289xf86StringToToken(SymTabPtr table, const char *string);
290extern _X_EXPORT void
291xf86ShowClocks(ScrnInfoPtr scrp, MessageType from);
292extern _X_EXPORT void
293xf86PrintChipsets(const char *drvname, const char *drvmsg, SymTabPtr chips);
294extern _X_EXPORT int
295xf86MatchDevice(const char *drivername, GDevPtr ** driversectlist);
296extern _X_EXPORT const char *
297xf86GetVisualName(int visual);
298extern _X_EXPORT int
299xf86GetVerbosity(void);
300extern _X_EXPORT Pix24Flags
301xf86GetPix24(void);
302extern _X_EXPORT int
303xf86GetDepth(void);
304extern _X_EXPORT rgb
305xf86GetWeight(void);
306extern _X_EXPORT Gamma
307xf86GetGamma(void);
308extern _X_EXPORT Bool
309xf86GetFlipPixels(void);
310extern _X_EXPORT const char *
311xf86GetServerName(void);
312extern _X_EXPORT Bool
313xf86ServerIsExiting(void);
314extern _X_EXPORT Bool
315xf86ServerIsResetting(void);
316extern _X_EXPORT Bool
317xf86ServerIsInitialising(void);
318extern _X_EXPORT Bool
319xf86ServerIsOnlyDetecting(void);
320extern _X_EXPORT Bool
321xf86CaughtSignal(void);
322extern _X_EXPORT Bool
323xf86GetVidModeAllowNonLocal(void);
324extern _X_EXPORT Bool
325xf86GetVidModeEnabled(void);
326extern _X_EXPORT Bool
327xf86GetModInDevAllowNonLocal(void);
328extern _X_EXPORT Bool
329xf86GetModInDevEnabled(void);
330extern _X_EXPORT Bool
331xf86GetAllowMouseOpenFail(void);
332extern _X_EXPORT void
333xf86DisableRandR(void);
334extern _X_EXPORT CARD32
335xorgGetVersion(void);
336extern _X_EXPORT CARD32
337xf86GetModuleVersion(void *module);
338extern _X_EXPORT void *
339xf86LoadDrvSubModule(DriverPtr drv, const char *name);
340extern _X_EXPORT void *
341xf86LoadSubModule(ScrnInfoPtr pScrn, const char *name);
342extern _X_EXPORT void *
343xf86LoadOneModule(const char *name, void *optlist);
344extern _X_EXPORT void
345xf86UnloadSubModule(void *mod);
346extern _X_EXPORT Bool
347xf86LoaderCheckSymbol(const char *name);
348extern _X_EXPORT void
349xf86SetBackingStore(ScreenPtr pScreen);
350extern _X_EXPORT void
351xf86SetSilkenMouse(ScreenPtr pScreen);
352extern _X_EXPORT void *
353xf86FindXvOptions(ScrnInfoPtr pScrn, int adapt_index, const char *port_name,
354 const char **adaptor_name, void **adaptor_options);
355extern _X_EXPORT void
356xf86GetOS(const char **name, int *major, int *minor, int *teeny);
357extern _X_EXPORT ScrnInfoPtr
358xf86ConfigFbEntity(ScrnInfoPtr pScrn, int scrnFlag,
359 int entityIndex, EntityProc init,
360 EntityProc enter, EntityProc leave, void *private);
361
362extern _X_EXPORT Bool
363xf86IsScreenPrimary(ScrnInfoPtr pScrn);
364extern _X_EXPORT int
365xf86RegisterRootWindowProperty(int ScrnIndex, Atom property, Atom type,
366 int format, unsigned long len, void *value);
367extern _X_EXPORT Bool
368xf86IsUnblank(int mode);
369
370/* xf86Init.c */
371
372extern _X_EXPORT PixmapFormatPtr
373xf86GetPixFormat(ScrnInfoPtr pScrn, int depth);
374extern _X_EXPORT int
375xf86GetBppFromDepth(ScrnInfoPtr pScrn, int depth);
376
377/* xf86Mode.c */
378
379extern _X_EXPORT int
380xf86GetNearestClock(ScrnInfoPtr scrp, int freq, Bool allowDiv2,
381 int DivFactor, int MulFactor, int *divider);
382extern _X_EXPORT const char *
383xf86ModeStatusToString(ModeStatus status);
384extern _X_EXPORT ModeStatus
385xf86LookupMode(ScrnInfoPtr scrp, DisplayModePtr modep,
386 ClockRangePtr clockRanges, LookupModeFlags strategy);
387extern _X_EXPORT ModeStatus
388xf86CheckModeForMonitor(DisplayModePtr mode, MonPtr monitor);
389extern _X_EXPORT ModeStatus
390xf86InitialCheckModeForDriver(ScrnInfoPtr scrp, DisplayModePtr mode,
391 ClockRangePtr clockRanges,
392 LookupModeFlags strategy,
393 int maxPitch, int virtualX, int virtualY);
394extern _X_EXPORT ModeStatus
395xf86CheckModeForDriver(ScrnInfoPtr scrp, DisplayModePtr mode, int flags);
396extern _X_EXPORT int
397xf86ValidateModes(ScrnInfoPtr scrp, DisplayModePtr availModes,
398 const char **modeNames, ClockRangePtr clockRanges,
399 int *linePitches, int minPitch, int maxPitch,
400 int minHeight, int maxHeight, int pitchInc,
401 int virtualX, int virtualY, int apertureSize,
402 LookupModeFlags strategy);
403extern _X_EXPORT void
404xf86DeleteMode(DisplayModePtr * modeList, DisplayModePtr mode);
405extern _X_EXPORT void
406xf86PruneDriverModes(ScrnInfoPtr scrp);
407extern _X_EXPORT void
408xf86SetCrtcForModes(ScrnInfoPtr scrp, int adjustFlags);
409extern _X_EXPORT void
410xf86PrintModes(ScrnInfoPtr scrp);
411extern _X_EXPORT void
412xf86ShowClockRanges(ScrnInfoPtr scrp, ClockRangePtr clockRanges);
413
414/* xf86Option.c */
415
416extern _X_EXPORT void
417xf86CollectOptions(ScrnInfoPtr pScrn, XF86OptionPtr extraOpts);
418
419/* xf86RandR.c */
420#ifdef RANDR
421extern _X_EXPORT Bool
422xf86RandRInit(ScreenPtr pScreen);
423extern _X_EXPORT Rotation
424xf86GetRotation(ScreenPtr pScreen);
425extern _X_EXPORT Bool
426xf86RandRSetNewVirtualAndDimensions(ScreenPtr pScreen,
427 int newvirtX, int newvirtY,
428 int newmmWidth, int newmmHeight,
429 Bool resetMode);
430#endif
431
432/* xf86Extensions.c */
433extern void xf86ExtensionInit(void);
434
435/* convert ScreenPtr to ScrnInfoPtr */
436extern _X_EXPORT ScrnInfoPtr xf86ScreenToScrn(ScreenPtr pScreen);
437/* convert ScrnInfoPtr to ScreenPtr */
438extern _X_EXPORT ScreenPtr xf86ScrnToScreen(ScrnInfoPtr pScrn);
439
440#endif /* _NO_XF86_PROTOTYPES */
441
442#define XF86_HAS_SCRN_CONV 1 /* define for drivers to use in api compat */
443
444#define XF86_SCRN_INTERFACE 1 /* define for drivers to use in api compat */
445
446/* flags passed to xf86 allocate screen */
447#define XF86_ALLOCATE_GPU_SCREEN 1
448
449/* Update the internal total dimensions of all ScreenRecs together */
450extern _X_EXPORT void
451xf86UpdateDesktopDimensions(void);
452
453#endif /* _XF86_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