VirtualBox

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

最後變更 在這個檔案從62425是 40349,由 vboxsync 提交於 13 年 前

Additions/xorg: support X.Org Server 1.12.

  • 屬性 svn:eol-style 設為 native
檔案大小: 16.4 KB
 
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;
58
59extern _X_EXPORT DevPrivateKeyRec xf86ScreenKeyRec;
60#define xf86ScreenKey (&xf86ScreenKeyRec)
61
62extern _X_EXPORT DevPrivateKeyRec xf86CreateRootWindowKeyRec;
63#define xf86CreateRootWindowKey (&xf86CreateRootWindowKeyRec)
64
65extern _X_EXPORT ScrnInfoPtr *xf86Screens; /* List of pointers to ScrnInfoRecs */
66extern _X_EXPORT const unsigned char byte_reversed[256];
67extern _X_EXPORT Bool fbSlotClaimed;
68#if (defined(__sparc__) || defined(__sparc)) && !defined(__OpenBSD__)
69extern _X_EXPORT Bool sbusSlotClaimed;
70#endif
71extern _X_EXPORT confDRIRec xf86ConfigDRI;
72extern _X_EXPORT Bool xf86DRI2Enabled(void);
73
74extern _X_EXPORT Bool VTSwitchEnabled; /* kbd driver */
75
76#define XF86SCRNINFO(p) ((ScrnInfoPtr)dixLookupPrivate(&(p)->devPrivates, \
77 xf86ScreenKey))
78#define XF86FLIP_PIXELS() \
79 do { \
80 if (xf86GetFlipPixels()) { \
81 pScreen->whitePixel = (pScreen->whitePixel) ? 0 : 1; \
82 pScreen->blackPixel = (pScreen->blackPixel) ? 0 : 1; \
83 } \
84 while (0)
85
86#define BOOLTOSTRING(b) ((b) ? "TRUE" : "FALSE")
87
88#define PIX24TOBPP(p) (((p) == Pix24Use24) ? 24 : \
89 (((p) == Pix24Use32) ? 32 : 0))
90
91/* Function Prototypes */
92#ifndef _NO_XF86_PROTOTYPES
93
94/* PCI related */
95#ifdef XSERVER_LIBPCIACCESS
96#include <pciaccess.h>
97extern _X_EXPORT Bool pciSlotClaimed;
98
99extern _X_EXPORT Bool xf86CheckPciSlot(const struct pci_device *);
100extern _X_EXPORT int xf86ClaimPciSlot(struct pci_device *, DriverPtr drvp,
101 int chipset, GDevPtr dev, Bool active);
102extern _X_EXPORT void xf86UnclaimPciSlot(struct pci_device *);
103extern _X_EXPORT Bool xf86ParsePciBusString(const char *busID, int *bus,
104 int *device, int *func);
105extern _X_EXPORT Bool xf86ComparePciBusString(const char *busID, int bus,
106 int device, int func);
107extern _X_EXPORT Bool xf86IsPrimaryPci(struct pci_device * pPci);
108extern _X_EXPORT Bool xf86CheckPciMemBase(struct pci_device * pPci,
109 memType base);
110extern _X_EXPORT struct pci_device * xf86GetPciInfoForEntity(int entityIndex);
111extern _X_EXPORT int xf86MatchPciInstances(const char *driverName,
112 int vendorID, SymTabPtr chipsets, PciChipsets *PCIchipsets,
113 GDevPtr *devList, int numDevs, DriverPtr drvp, int **foundEntities);
114extern _X_EXPORT ScrnInfoPtr xf86ConfigPciEntity(ScrnInfoPtr pScrn,
115 int scrnFlag, int entityIndex,PciChipsets *p_chip, void *dummy,
116 EntityProc init, EntityProc enter, EntityProc leave, pointer private);
117/* Obsolete! don't use */
118extern _X_EXPORT Bool xf86ConfigActivePciEntity(ScrnInfoPtr pScrn,
119 int entityIndex,PciChipsets *p_chip, void *dummy, EntityProc init,
120 EntityProc enter, EntityProc leave, pointer private);
121#else
122#define xf86VGAarbiterInit() do {} while (0)
123#define xf86VGAarbiterFini() do {} while (0)
124#define xf86VGAarbiterLock(x) do {} while (0)
125#define xf86VGAarbiterUnlock(x) do {} while (0)
126#define xf86VGAarbiterScrnInit(x) do {} while (0)
127#define xf86VGAarbiterDeviceDecodes() do {} while (0)
128#define xf86VGAarbiterWrapFunctions() do {} while (0)
129#endif
130
131/* xf86Bus.c */
132
133extern _X_EXPORT int xf86GetFbInfoForScreen(int scrnIndex);
134extern _X_EXPORT int xf86ClaimFbSlot(DriverPtr drvp, int chipset, GDevPtr dev, Bool active);
135extern _X_EXPORT int xf86ClaimNoSlot(DriverPtr drvp, int chipset, GDevPtr dev, Bool active);
136extern _X_EXPORT Bool xf86DriverHasEntities(DriverPtr drvp);
137extern _X_EXPORT void xf86AddEntityToScreen(ScrnInfoPtr pScrn, int entityIndex);
138extern _X_EXPORT void xf86SetEntityInstanceForScreen(ScrnInfoPtr pScrn, int entityIndex,
139 int instance);
140extern _X_EXPORT int xf86GetNumEntityInstances(int entityIndex);
141extern _X_EXPORT GDevPtr xf86GetDevFromEntity(int entityIndex, int instance);
142extern _X_EXPORT void xf86RemoveEntityFromScreen(ScrnInfoPtr pScrn, int entityIndex);
143extern _X_EXPORT EntityInfoPtr xf86GetEntityInfo(int entityIndex);
144extern _X_EXPORT Bool xf86SetEntityFuncs(int entityIndex, EntityProc init,
145 EntityProc enter, EntityProc leave, pointer);
146extern _X_EXPORT Bool xf86IsEntityPrimary(int entityIndex);
147extern _X_EXPORT ScrnInfoPtr xf86FindScreenForEntity(int entityIndex);
148
149extern _X_EXPORT int xf86GetLastScrnFlag(int entityIndex);
150extern _X_EXPORT void xf86SetLastScrnFlag(int entityIndex, int scrnIndex);
151extern _X_EXPORT Bool xf86IsEntityShared(int entityIndex);
152extern _X_EXPORT void xf86SetEntityShared(int entityIndex);
153extern _X_EXPORT Bool xf86IsEntitySharable(int entityIndex);
154extern _X_EXPORT void xf86SetEntitySharable(int entityIndex);
155extern _X_EXPORT Bool xf86IsPrimInitDone(int entityIndex);
156extern _X_EXPORT void xf86SetPrimInitDone(int entityIndex);
157extern _X_EXPORT void xf86ClearPrimInitDone(int entityIndex);
158extern _X_EXPORT int xf86AllocateEntityPrivateIndex(void);
159extern _X_EXPORT DevUnion *xf86GetEntityPrivate(int entityIndex, int privIndex);
160
161/* xf86Configure.c */
162extern _X_EXPORT GDevPtr xf86AddBusDeviceToConfigure(const char *driver, BusType bus,
163 void *busData, int chipset);
164
165/* xf86Cursor.c */
166
167extern _X_EXPORT void xf86LockZoom(ScreenPtr pScreen, int lock);
168extern _X_EXPORT void xf86InitViewport(ScrnInfoPtr pScr);
169extern _X_EXPORT void xf86SetViewport(ScreenPtr pScreen, int x, int y);
170extern _X_EXPORT void xf86ZoomViewport(ScreenPtr pScreen, int zoom);
171extern _X_EXPORT Bool xf86SwitchMode(ScreenPtr pScreen, DisplayModePtr mode);
172extern _X_EXPORT void *xf86GetPointerScreenFuncs(void);
173extern _X_EXPORT void xf86InitOrigins(void);
174extern _X_EXPORT void xf86ReconfigureLayout(void);
175
176/* xf86cvt.c */
177extern _X_EXPORT DisplayModePtr xf86CVTMode(int HDisplay, int VDisplay, float VRefresh,
178 Bool Reduced, Bool Interlaced);
179
180/* xf86DPMS.c */
181
182extern _X_EXPORT Bool xf86DPMSInit(ScreenPtr pScreen, DPMSSetProcPtr set, int flags);
183
184#ifdef DPMSExtension
185extern _X_EXPORT int DPMSSet(ClientPtr client, int level);
186extern _X_EXPORT Bool DPMSSupported(void);
187#endif
188
189
190/* xf86DGA.c */
191
192#ifdef XFreeXDGA
193extern _X_EXPORT Bool DGAInit(ScreenPtr pScreen, DGAFunctionPtr funcs, DGAModePtr modes,
194 int num);
195extern _X_EXPORT Bool DGAReInitModes(ScreenPtr pScreen, DGAModePtr modes, int num);
196extern _X_EXPORT xf86SetDGAModeProc xf86SetDGAMode;
197#endif
198
199/* xf86Events.c */
200
201extern _X_EXPORT void SetTimeSinceLastInputEvent(void);
202extern _X_EXPORT pointer xf86AddInputHandler(int fd, InputHandlerProc proc, pointer data);
203extern _X_EXPORT int xf86RemoveInputHandler(pointer handler);
204extern _X_EXPORT void xf86DisableInputHandler(pointer handler);
205extern _X_EXPORT void xf86EnableInputHandler(pointer handler);
206extern _X_EXPORT pointer xf86AddGeneralHandler(int fd, InputHandlerProc proc, pointer data);
207extern _X_EXPORT int xf86RemoveGeneralHandler(pointer handler);
208extern _X_EXPORT void xf86DisableGeneralHandler(pointer handler);
209extern _X_EXPORT void xf86EnableGeneralHandler(pointer handler);
210extern _X_EXPORT InputHandlerProc xf86SetConsoleHandler(InputHandlerProc handler, pointer data);
211extern _X_EXPORT void xf86InterceptSignals(int *signo);
212extern _X_EXPORT void xf86InterceptSigIll(void (*sigillhandler)(void));
213extern _X_EXPORT Bool xf86EnableVTSwitch(Bool new);
214extern _X_EXPORT void xf86ProcessActionEvent(ActionEvent action, void *arg);
215extern _X_EXPORT void xf86PrintBacktrace(void);
216
217/* xf86Helper.c */
218
219extern _X_EXPORT void xf86AddDriver(DriverPtr driver, pointer module, int flags);
220extern _X_EXPORT void xf86DeleteDriver(int drvIndex);
221extern _X_EXPORT ScrnInfoPtr xf86AllocateScreen(DriverPtr drv, int flags);
222extern _X_EXPORT void xf86DeleteScreen(int scrnIndex, int flags);
223extern _X_EXPORT int xf86AllocateScrnInfoPrivateIndex(void);
224extern _X_EXPORT Bool xf86AddPixFormat(ScrnInfoPtr pScrn, int depth, int bpp, int pad);
225extern _X_EXPORT Bool xf86SetDepthBpp(ScrnInfoPtr scrp, int depth, int bpp, int fbbpp,
226 int depth24flags);
227extern _X_EXPORT void xf86PrintDepthBpp(ScrnInfoPtr scrp);
228extern _X_EXPORT Bool xf86SetWeight(ScrnInfoPtr scrp, rgb weight, rgb mask);
229extern _X_EXPORT Bool xf86SetDefaultVisual(ScrnInfoPtr scrp, int visual);
230extern _X_EXPORT Bool xf86SetGamma(ScrnInfoPtr scrp, Gamma newGamma);
231extern _X_EXPORT void xf86SetDpi(ScrnInfoPtr pScrn, int x, int y);
232extern _X_EXPORT void xf86SetBlackWhitePixels(ScreenPtr pScreen);
233extern _X_EXPORT void xf86EnableDisableFBAccess(int scrnIndex, Bool enable);
234extern _X_EXPORT void xf86VDrvMsgVerb(int scrnIndex, MessageType type, int verb,
235 const char *format, va_list args) _X_ATTRIBUTE_PRINTF(4,0);
236extern _X_EXPORT void xf86DrvMsgVerb(int scrnIndex, MessageType type, int verb,
237 const char *format, ...) _X_ATTRIBUTE_PRINTF(4,5);
238extern _X_EXPORT void xf86DrvMsg(int scrnIndex, MessageType type, const char *format, ...)
239 _X_ATTRIBUTE_PRINTF(3,4);
240extern _X_EXPORT void xf86MsgVerb(MessageType type, int verb, const char *format, ...)
241 _X_ATTRIBUTE_PRINTF(3,4);
242extern _X_EXPORT void xf86Msg(MessageType type, const char *format, ...) _X_ATTRIBUTE_PRINTF(2,3);
243extern _X_EXPORT void xf86ErrorFVerb(int verb, const char *format, ...) _X_ATTRIBUTE_PRINTF(2,3);
244extern _X_EXPORT void xf86ErrorF(const char *format, ...) _X_ATTRIBUTE_PRINTF(1,2);
245extern _X_EXPORT const char *xf86TokenToString(SymTabPtr table, int token);
246extern _X_EXPORT int xf86StringToToken(SymTabPtr table, const char *string);
247extern _X_EXPORT void xf86ShowClocks(ScrnInfoPtr scrp, MessageType from);
248extern _X_EXPORT void xf86PrintChipsets(const char *drvname, const char *drvmsg,
249 SymTabPtr chips);
250extern _X_EXPORT int xf86MatchDevice(const char *drivername, GDevPtr **driversectlist);
251extern _X_EXPORT const char *xf86GetVisualName(int visual);
252extern _X_EXPORT int xf86GetVerbosity(void);
253extern _X_EXPORT Pix24Flags xf86GetPix24(void);
254extern _X_EXPORT int xf86GetDepth(void);
255extern _X_EXPORT rgb xf86GetWeight(void);
256extern _X_EXPORT Gamma xf86GetGamma(void);
257extern _X_EXPORT Bool xf86GetFlipPixels(void);
258extern _X_EXPORT const char *xf86GetServerName(void);
259extern _X_EXPORT Bool xf86ServerIsExiting(void);
260extern _X_EXPORT Bool xf86ServerIsResetting(void);
261extern _X_EXPORT Bool xf86ServerIsInitialising(void);
262extern _X_EXPORT Bool xf86ServerIsOnlyDetecting(void);
263extern _X_EXPORT Bool xf86CaughtSignal(void);
264extern _X_EXPORT Bool xf86GetVidModeAllowNonLocal(void);
265extern _X_EXPORT Bool xf86GetVidModeEnabled(void);
266extern _X_EXPORT Bool xf86GetModInDevAllowNonLocal(void);
267extern _X_EXPORT Bool xf86GetModInDevEnabled(void);
268extern _X_EXPORT Bool xf86GetAllowMouseOpenFail(void);
269extern _X_EXPORT void xf86DisableRandR(void);
270extern _X_EXPORT CARD32 xorgGetVersion(void);
271extern _X_EXPORT CARD32 xf86GetModuleVersion(pointer module);
272extern _X_EXPORT pointer xf86LoadDrvSubModule(DriverPtr drv, const char *name);
273extern _X_EXPORT pointer xf86LoadSubModule(ScrnInfoPtr pScrn, const char *name);
274extern _X_EXPORT pointer xf86LoadOneModule(char *name, pointer optlist);
275extern _X_EXPORT void xf86UnloadSubModule(pointer mod);
276extern _X_EXPORT Bool xf86LoaderCheckSymbol(const char *name);
277extern _X_EXPORT void xf86SetBackingStore(ScreenPtr pScreen);
278extern _X_EXPORT void xf86SetSilkenMouse(ScreenPtr pScreen);
279extern _X_EXPORT pointer xf86FindXvOptions(int scrnIndex, int adapt_index, char *port_name,
280 char **adaptor_name, pointer *adaptor_options);
281extern _X_EXPORT void xf86GetOS(const char **name, int *major, int *minor, int *teeny);
282extern _X_EXPORT ScrnInfoPtr xf86ConfigFbEntity(ScrnInfoPtr pScrn, int scrnFlag,
283 int entityIndex, EntityProc init,
284 EntityProc enter, EntityProc leave,
285 pointer private);
286
287extern _X_EXPORT Bool xf86IsScreenPrimary(int scrnIndex);
288extern _X_EXPORT int xf86RegisterRootWindowProperty(int ScrnIndex, Atom property, Atom type,
289 int format, unsigned long len,
290 pointer value);
291extern _X_EXPORT Bool xf86IsUnblank(int mode);
292
293/* xf86Init.c */
294
295extern _X_EXPORT PixmapFormatPtr xf86GetPixFormat(ScrnInfoPtr pScrn, int depth);
296extern _X_EXPORT int xf86GetBppFromDepth(ScrnInfoPtr pScrn, int depth);
297
298/* xf86Mode.c */
299
300extern _X_EXPORT int xf86GetNearestClock(ScrnInfoPtr scrp, int freq, Bool allowDiv2,
301 int DivFactor, int MulFactor, int *divider);
302extern _X_EXPORT const char *xf86ModeStatusToString(ModeStatus status);
303extern _X_EXPORT ModeStatus xf86LookupMode(ScrnInfoPtr scrp, DisplayModePtr modep,
304 ClockRangePtr clockRanges, LookupModeFlags strategy);
305extern _X_EXPORT ModeStatus xf86CheckModeForMonitor(DisplayModePtr mode, MonPtr monitor);
306extern _X_EXPORT ModeStatus xf86InitialCheckModeForDriver(ScrnInfoPtr scrp, DisplayModePtr mode,
307 ClockRangePtr clockRanges,
308 LookupModeFlags strategy,
309 int maxPitch, int virtualX,
310 int virtualY);
311extern _X_EXPORT ModeStatus xf86CheckModeForDriver(ScrnInfoPtr scrp, DisplayModePtr mode,
312 int flags);
313extern _X_EXPORT int xf86ValidateModes(ScrnInfoPtr scrp, DisplayModePtr availModes,
314 char **modeNames, ClockRangePtr clockRanges,
315 int *linePitches, int minPitch, int maxPitch,
316 int minHeight, int maxHeight, int pitchInc,
317 int virtualX, int virtualY, int apertureSize,
318 LookupModeFlags strategy);
319extern _X_EXPORT void xf86DeleteMode(DisplayModePtr *modeList, DisplayModePtr mode);
320extern _X_EXPORT void xf86PruneDriverModes(ScrnInfoPtr scrp);
321extern _X_EXPORT void xf86SetCrtcForModes(ScrnInfoPtr scrp, int adjustFlags);
322extern _X_EXPORT void xf86PrintModes(ScrnInfoPtr scrp);
323extern _X_EXPORT void xf86ShowClockRanges(ScrnInfoPtr scrp, ClockRangePtr clockRanges);
324extern _X_EXPORT double xf86ModeHSync(const DisplayModeRec *mode);
325extern _X_EXPORT double xf86ModeVRefresh(const DisplayModeRec *mode);
326extern _X_EXPORT void xf86SetModeDefaultName(DisplayModePtr mode);
327extern _X_EXPORT void xf86SetModeCrtc(DisplayModePtr p, int adjustFlags);
328extern _X_EXPORT DisplayModePtr xf86DuplicateMode(const DisplayModeRec *pMode);
329extern _X_EXPORT DisplayModePtr xf86DuplicateModes(ScrnInfoPtr pScrn, DisplayModePtr modeList);
330extern _X_EXPORT Bool xf86ModesEqual(const DisplayModeRec *pMode1,
331 const DisplayModeRec *pMode2);
332extern _X_EXPORT void xf86PrintModeline(int scrnIndex,DisplayModePtr mode);
333extern _X_EXPORT DisplayModePtr xf86ModesAdd(DisplayModePtr modes, DisplayModePtr new);
334
335/* xf86Option.c */
336
337extern _X_EXPORT void xf86CollectOptions(ScrnInfoPtr pScrn, XF86OptionPtr extraOpts);
338
339
340/* xf86RandR.c */
341#ifdef RANDR
342extern _X_EXPORT Bool xf86RandRInit (ScreenPtr pScreen);
343extern _X_EXPORT Rotation xf86GetRotation(ScreenPtr pScreen);
344extern _X_EXPORT Bool xf86RandRSetNewVirtualAndDimensions(ScreenPtr pScreen,
345 int newvirtX, int newvirtY,
346 int newmmWidth, int newmmHeight, Bool resetMode);
347#endif
348
349/* xf86VidModeExtentionInit.c */
350
351extern _X_EXPORT Bool VidModeExtensionInit(ScreenPtr pScreen);
352
353#endif /* _NO_XF86_PROTOTYPES */
354
355#endif /* _XF86_H */
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

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