1 | /*
|
---|
2 | * $XFree86: xc/programs/Xserver/randr/randrstr.h,v 1.5 2002/09/29 23:39:45 keithp Exp $
|
---|
3 | *
|
---|
4 | * Copyright © 2000 Compaq Computer Corporation
|
---|
5 | *
|
---|
6 | * Permission to use, copy, modify, distribute, and sell this software and its
|
---|
7 | * documentation for any purpose is hereby granted without fee, provided that
|
---|
8 | * the above copyright notice appear in all copies and that both that
|
---|
9 | * copyright notice and this permission notice appear in supporting
|
---|
10 | * documentation, and that the name of Compaq not be used in
|
---|
11 | * advertising or publicity pertaining to distribution of the software without
|
---|
12 | * specific, written prior permission. Compaq makes no
|
---|
13 | * representations about the suitability of this software for any purpose. It
|
---|
14 | * is provided "as is" without express or implied warranty.
|
---|
15 | *
|
---|
16 | * COMPAQ DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
|
---|
17 | * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
|
---|
18 | * EVENT SHALL COMPAQ BE LIABLE FOR ANY SPECIAL, INDIRECT OR
|
---|
19 | * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
|
---|
20 | * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
---|
21 | * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
---|
22 | * PERFORMANCE OF THIS SOFTWARE.
|
---|
23 | */
|
---|
24 |
|
---|
25 | #ifdef HAVE_DIX_CONFIG_H
|
---|
26 | #include <dix-config.h>
|
---|
27 | #endif
|
---|
28 |
|
---|
29 | #ifndef _RANDRSTR_H_
|
---|
30 | #define _RANDRSTR_H_
|
---|
31 |
|
---|
32 | #include <X11/extensions/randr.h>
|
---|
33 |
|
---|
34 | typedef struct _rrScreenRate {
|
---|
35 | int rate;
|
---|
36 | Bool referenced;
|
---|
37 | Bool oldReferenced;
|
---|
38 | } RRScreenRate, *RRScreenRatePtr;
|
---|
39 |
|
---|
40 | typedef struct _rrScreenSize {
|
---|
41 | int id;
|
---|
42 | short width, height;
|
---|
43 | short mmWidth, mmHeight;
|
---|
44 | RRScreenRatePtr pRates;
|
---|
45 | int nRates;
|
---|
46 | int nRatesInUse;
|
---|
47 | Bool referenced;
|
---|
48 | Bool oldReferenced;
|
---|
49 | } RRScreenSize, *RRScreenSizePtr;
|
---|
50 |
|
---|
51 | typedef Bool (*RRSetConfigProcPtr) (ScreenPtr pScreen,
|
---|
52 | Rotation rotation,
|
---|
53 | int rate,
|
---|
54 | RRScreenSizePtr pSize);
|
---|
55 |
|
---|
56 | typedef Bool (*RRGetInfoProcPtr) (ScreenPtr pScreen, Rotation *rotations);
|
---|
57 | typedef Bool (*RRCloseScreenProcPtr) ( int i, ScreenPtr pscreen);
|
---|
58 |
|
---|
59 | typedef struct _rrScrPriv {
|
---|
60 | RRSetConfigProcPtr rrSetConfig;
|
---|
61 | RRGetInfoProcPtr rrGetInfo;
|
---|
62 |
|
---|
63 | TimeStamp lastSetTime; /* last changed by client */
|
---|
64 | TimeStamp lastConfigTime; /* possible configs changed */
|
---|
65 | RRCloseScreenProcPtr CloseScreen;
|
---|
66 |
|
---|
67 | /*
|
---|
68 | * Configuration information
|
---|
69 | */
|
---|
70 | Rotation rotations;
|
---|
71 |
|
---|
72 | int nSizes;
|
---|
73 | int nSizesInUse;
|
---|
74 | RRScreenSizePtr pSizes;
|
---|
75 |
|
---|
76 | /*
|
---|
77 | * Current state
|
---|
78 | */
|
---|
79 | Rotation rotation;
|
---|
80 | int size;
|
---|
81 | int rate;
|
---|
82 | } rrScrPrivRec, *rrScrPrivPtr;
|
---|
83 |
|
---|
84 | extern int rrPrivIndex;
|
---|
85 |
|
---|
86 | #define rrGetScrPriv(pScr) ((rrScrPrivPtr) (pScr)->devPrivates[rrPrivIndex].ptr)
|
---|
87 | #define rrScrPriv(pScr) rrScrPrivPtr pScrPriv = rrGetScrPriv(pScr)
|
---|
88 | #define SetRRScreen(s,p) ((s)->devPrivates[rrPrivIndex].ptr = (pointer) (p))
|
---|
89 |
|
---|
90 | /* Initialize the extension */
|
---|
91 | void
|
---|
92 | RRExtensionInit (void);
|
---|
93 |
|
---|
94 | /*
|
---|
95 | * Then, register the specific size with the screen
|
---|
96 | */
|
---|
97 |
|
---|
98 | RRScreenSizePtr
|
---|
99 | RRRegisterSize (ScreenPtr pScreen,
|
---|
100 | short width,
|
---|
101 | short height,
|
---|
102 | short mmWidth,
|
---|
103 | short mmHeight);
|
---|
104 |
|
---|
105 | Bool RRRegisterRate (ScreenPtr pScreen,
|
---|
106 | RRScreenSizePtr pSize,
|
---|
107 | int rate);
|
---|
108 |
|
---|
109 | /*
|
---|
110 | * Finally, set the current configuration of the screen
|
---|
111 | */
|
---|
112 |
|
---|
113 | void
|
---|
114 | RRSetCurrentConfig (ScreenPtr pScreen,
|
---|
115 | Rotation rotation,
|
---|
116 | int rate,
|
---|
117 | RRScreenSizePtr pSize);
|
---|
118 |
|
---|
119 | Bool RRScreenInit(ScreenPtr pScreen);
|
---|
120 |
|
---|
121 | int
|
---|
122 | RRSetScreenConfig (ScreenPtr pScreen,
|
---|
123 | Rotation rotation,
|
---|
124 | int rate,
|
---|
125 | RRScreenSizePtr pSize);
|
---|
126 |
|
---|
127 | Bool
|
---|
128 | miRandRInit (ScreenPtr pScreen);
|
---|
129 |
|
---|
130 | Bool
|
---|
131 | miRRGetInfo (ScreenPtr pScreen, Rotation *rotations);
|
---|
132 |
|
---|
133 | Bool
|
---|
134 | miRRSetConfig (ScreenPtr pScreen,
|
---|
135 | Rotation rotation,
|
---|
136 | int rate,
|
---|
137 | RRScreenSizePtr size);
|
---|
138 |
|
---|
139 | Bool
|
---|
140 | miRRGetScreenInfo (ScreenPtr pScreen);
|
---|
141 |
|
---|
142 | #endif /* _RANDRSTR_H_ */
|
---|