1 | /*
|
---|
2 | * $XFree86: xc/programs/Xserver/randr/randrstr.h,v 1.7 2002/10/14 18:01:42 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 | #ifndef _RANDRSTR_H_
|
---|
26 | #define _RANDRSTR_H_
|
---|
27 |
|
---|
28 | #include "randr.h"
|
---|
29 |
|
---|
30 | typedef struct _rrScreenRate {
|
---|
31 | int rate;
|
---|
32 | Bool referenced;
|
---|
33 | Bool oldReferenced;
|
---|
34 | } RRScreenRate, *RRScreenRatePtr;
|
---|
35 |
|
---|
36 | typedef struct _rrScreenSize {
|
---|
37 | int id;
|
---|
38 | short width, height;
|
---|
39 | short mmWidth, mmHeight;
|
---|
40 | RRScreenRatePtr pRates;
|
---|
41 | int nRates;
|
---|
42 | int nRatesInUse;
|
---|
43 | Bool referenced;
|
---|
44 | Bool oldReferenced;
|
---|
45 | } RRScreenSize, *RRScreenSizePtr;
|
---|
46 |
|
---|
47 | typedef Bool (*RRSetConfigProcPtr) (ScreenPtr pScreen,
|
---|
48 | Rotation rotation,
|
---|
49 | int rate,
|
---|
50 | RRScreenSizePtr pSize);
|
---|
51 |
|
---|
52 | typedef Bool (*RRGetInfoProcPtr) (ScreenPtr pScreen, Rotation *rotations);
|
---|
53 | typedef Bool (*RRCloseScreenProcPtr) ( int i, ScreenPtr pscreen);
|
---|
54 |
|
---|
55 | typedef struct _rrScrPriv {
|
---|
56 | RRSetConfigProcPtr rrSetConfig;
|
---|
57 | RRGetInfoProcPtr rrGetInfo;
|
---|
58 |
|
---|
59 | TimeStamp lastSetTime; /* last changed by client */
|
---|
60 | TimeStamp lastConfigTime; /* possible configs changed */
|
---|
61 | RRCloseScreenProcPtr CloseScreen;
|
---|
62 |
|
---|
63 | /*
|
---|
64 | * Configuration information
|
---|
65 | */
|
---|
66 | Rotation rotations;
|
---|
67 |
|
---|
68 | int nSizes;
|
---|
69 | int nSizesInUse;
|
---|
70 | RRScreenSizePtr pSizes;
|
---|
71 |
|
---|
72 | /*
|
---|
73 | * Current state
|
---|
74 | */
|
---|
75 | Rotation rotation;
|
---|
76 | int size;
|
---|
77 | int rate;
|
---|
78 | } rrScrPrivRec, *rrScrPrivPtr;
|
---|
79 |
|
---|
80 | extern int rrPrivIndex;
|
---|
81 |
|
---|
82 | #define rrGetScrPriv(pScr) ((rrScrPrivPtr) (pScr)->devPrivates[rrPrivIndex].ptr)
|
---|
83 | #define rrScrPriv(pScr) rrScrPrivPtr pScrPriv = rrGetScrPriv(pScr)
|
---|
84 | #define SetRRScreen(s,p) ((s)->devPrivates[rrPrivIndex].ptr = (pointer) (p))
|
---|
85 |
|
---|
86 | /* Initialize the extension */
|
---|
87 | void
|
---|
88 | RRExtensionInit (void);
|
---|
89 |
|
---|
90 | /*
|
---|
91 | * Then, register the specific size with the screen
|
---|
92 | */
|
---|
93 |
|
---|
94 | RRScreenSizePtr
|
---|
95 | RRRegisterSize (ScreenPtr pScreen,
|
---|
96 | short width,
|
---|
97 | short height,
|
---|
98 | short mmWidth,
|
---|
99 | short mmHeight);
|
---|
100 |
|
---|
101 | Bool RRRegisterRate (ScreenPtr pScreen,
|
---|
102 | RRScreenSizePtr pSize,
|
---|
103 | int rate);
|
---|
104 |
|
---|
105 | /*
|
---|
106 | * Finally, set the current configuration of the screen
|
---|
107 | */
|
---|
108 |
|
---|
109 | void
|
---|
110 | RRSetCurrentConfig (ScreenPtr pScreen,
|
---|
111 | Rotation rotation,
|
---|
112 | int rate,
|
---|
113 | RRScreenSizePtr pSize);
|
---|
114 |
|
---|
115 | Bool RRScreenInit(ScreenPtr pScreen);
|
---|
116 |
|
---|
117 | Bool
|
---|
118 | miRandRInit (ScreenPtr pScreen);
|
---|
119 |
|
---|
120 | Bool
|
---|
121 | miRRGetInfo (ScreenPtr pScreen, Rotation *rotations);
|
---|
122 |
|
---|
123 | Bool
|
---|
124 | miRRSetConfig (ScreenPtr pScreen,
|
---|
125 | Rotation rotation,
|
---|
126 | int rate,
|
---|
127 | RRScreenSizePtr size);
|
---|
128 |
|
---|
129 | Bool
|
---|
130 | miRRGetScreenInfo (ScreenPtr pScreen);
|
---|
131 |
|
---|
132 | #endif /* _RANDRSTR_H_ */
|
---|