1191
|
1 # $XFree86: xc/include/extensions/xf86vmode.h,v 3.30 2001/05/07 20:09:50 mvojkovi Exp $
|
|
2 #
|
|
3 #
|
|
4 #Copyright 1995 Kaleb S. KEITHLEY
|
|
5 #
|
|
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:
|
|
13 #
|
|
14 #The above copyright notice and this permission notice shall be
|
|
15 #included in all copies or substantial portions of the Software.
|
|
16 #
|
|
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 NONINFRINGEMENT.
|
|
20 #IN NO EVENT SHALL Kaleb S. KEITHLEY BE LIABLE FOR ANY CLAIM, DAMAGES
|
|
21 #OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
|
22 #ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
|
23 #OTHER DEALINGS IN THE SOFTWARE.
|
|
24 #
|
|
25 #Except as contained in this notice, the name of Kaleb S. KEITHLEY
|
|
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 Kaleb S. KEITHLEY
|
|
29 #
|
|
30 #
|
|
31 # $Xorg: xf86vmode.h,v 1.3 2000/08/18 04:05:46 coskrey Exp $
|
|
32 # THIS IS NOT AN X CONSORTIUM STANDARD OR AN X PROJECT TEAM SPECIFICATION
|
|
33
|
|
34 import
|
|
35 x, xlib
|
|
36
|
|
37 const
|
|
38 libXxf86vm* = "libXxf86vm.so"
|
|
39
|
|
40 type
|
|
41 PINT32* = ptr int32
|
|
42
|
|
43 const
|
|
44 X_XF86VidModeQueryVersion* = 0
|
|
45 X_XF86VidModeGetModeLine* = 1
|
|
46 X_XF86VidModeModModeLine* = 2
|
|
47 X_XF86VidModeSwitchMode* = 3
|
|
48 X_XF86VidModeGetMonitor* = 4
|
|
49 X_XF86VidModeLockModeSwitch* = 5
|
|
50 X_XF86VidModeGetAllModeLines* = 6
|
|
51 X_XF86VidModeAddModeLine* = 7
|
|
52 X_XF86VidModeDeleteModeLine* = 8
|
|
53 X_XF86VidModeValidateModeLine* = 9
|
|
54 X_XF86VidModeSwitchToMode* = 10
|
|
55 X_XF86VidModeGetViewPort* = 11
|
|
56 X_XF86VidModeSetViewPort* = 12 # new for version 2.x of this extension
|
|
57 X_XF86VidModeGetDotClocks* = 13
|
|
58 X_XF86VidModeSetClientVersion* = 14
|
|
59 X_XF86VidModeSetGamma* = 15
|
|
60 X_XF86VidModeGetGamma* = 16
|
|
61 X_XF86VidModeGetGammaRamp* = 17
|
|
62 X_XF86VidModeSetGammaRamp* = 18
|
|
63 X_XF86VidModeGetGammaRampSize* = 19
|
|
64 X_XF86VidModeGetPermissions* = 20
|
|
65 CLKFLAG_PROGRAMABLE* = 1
|
|
66
|
|
67 when defined(XF86VIDMODE_EVENTS):
|
|
68 const
|
|
69 XF86VidModeNotify* = 0
|
|
70 XF86VidModeNumberEvents* = (XF86VidModeNotify + 1)
|
|
71 XF86VidModeNotifyMask* = 0x00000001
|
|
72 XF86VidModeNonEvent* = 0
|
|
73 XF86VidModeModeChange* = 1
|
|
74 else:
|
|
75 const
|
|
76 XF86VidModeNumberEvents* = 0
|
|
77 const
|
|
78 XF86VidModeBadClock* = 0
|
|
79 XF86VidModeBadHTimings* = 1
|
|
80 XF86VidModeBadVTimings* = 2
|
|
81 XF86VidModeModeUnsuitable* = 3
|
|
82 XF86VidModeExtensionDisabled* = 4
|
|
83 XF86VidModeClientNotLocal* = 5
|
|
84 XF86VidModeZoomLocked* = 6
|
|
85 XF86VidModeNumberErrors* = (XF86VidModeZoomLocked + 1)
|
|
86 XF86VM_READ_PERMISSION* = 1
|
|
87 XF86VM_WRITE_PERMISSION* = 2
|
|
88
|
|
89 type
|
|
90 PXF86VidModeModeLine* = ptr XF86VidModeModeLine
|
|
91 XF86VidModeModeLine*{.final.} = object
|
|
92 hdisplay*: cushort
|
|
93 hsyncstart*: cushort
|
|
94 hsyncend*: cushort
|
|
95 htotal*: cushort
|
|
96 hskew*: cushort
|
|
97 vdisplay*: cushort
|
|
98 vsyncstart*: cushort
|
|
99 vsyncend*: cushort
|
|
100 vtotal*: cushort
|
|
101 flags*: cuint
|
|
102 privsize*: cint
|
|
103 c_private*: PINT32
|
|
104
|
|
105 PPPXF86VidModeModeInfo* = ptr PPXF86VidModeModeInfo
|
|
106 PPXF86VidModeModeInfo* = ptr PXF86VidModeModeInfo
|
|
107 PXF86VidModeModeInfo* = ptr XF86VidModeModeInfo
|
|
108 XF86VidModeModeInfo*{.final.} = object
|
|
109 dotclock*: cuint
|
|
110 hdisplay*: cushort
|
|
111 hsyncstart*: cushort
|
|
112 hsyncend*: cushort
|
|
113 htotal*: cushort
|
|
114 hskew*: cushort
|
|
115 vdisplay*: cushort
|
|
116 vsyncstart*: cushort
|
|
117 vsyncend*: cushort
|
|
118 vtotal*: cushort
|
|
119 flags*: cuint
|
|
120 privsize*: cint
|
|
121 c_private*: PINT32
|
|
122
|
|
123 PXF86VidModeSyncRange* = ptr XF86VidModeSyncRange
|
|
124 XF86VidModeSyncRange*{.final.} = object
|
|
125 hi*: cfloat
|
|
126 lo*: cfloat
|
|
127
|
|
128 PXF86VidModeMonitor* = ptr XF86VidModeMonitor
|
|
129 XF86VidModeMonitor*{.final.} = object
|
|
130 vendor*: cstring
|
|
131 model*: cstring
|
|
132 EMPTY*: cfloat
|
|
133 nhsync*: cuchar
|
|
134 hsync*: PXF86VidModeSyncRange
|
|
135 nvsync*: cuchar
|
|
136 vsync*: PXF86VidModeSyncRange
|
|
137
|
|
138 PXF86VidModeNotifyEvent* = ptr XF86VidModeNotifyEvent
|
|
139 XF86VidModeNotifyEvent*{.final.} = object
|
|
140 theType*: cint # of event
|
|
141 serial*: culong # # of last request processed by server
|
|
142 send_event*: XBool # true if this came from a SendEvent req
|
|
143 display*: PDisplay # Display the event was read from
|
|
144 root*: Window # root window of event screen
|
|
145 state*: cint # What happened
|
|
146 kind*: cint # What happened
|
|
147 forced*: XBool # extents of new region
|
|
148 time*: Time # event timestamp
|
|
149
|
|
150 PXF86VidModeGamma* = ptr XF86VidModeGamma
|
|
151 XF86VidModeGamma*{.final.} = object
|
|
152 red*: cfloat # Red Gamma value
|
|
153 green*: cfloat # Green Gamma value
|
|
154 blue*: cfloat # Blue Gamma value
|
|
155
|
|
156 when defined(MACROS):
|
|
157 proc XF86VidModeSelectNextMode*(disp: PDisplay, scr: cint): XBool
|
|
158 proc XF86VidModeSelectPrevMode*(disp: PDisplay, scr: cint): XBool
|
|
159 proc XF86VidModeQueryVersion*(dpy: PDisplay, majorVersion: Pcint,
|
|
160 minorVersion: Pcint): XBool{.cdecl,
|
|
161 dynlib: libXxf86vm, importc.}
|
|
162 proc XF86VidModeQueryExtension*(dpy: PDisplay, event_base: Pcint,
|
|
163 error_base: Pcint): XBool{.cdecl,
|
|
164 dynlib: libXxf86vm, importc.}
|
|
165 proc XF86VidModeSetClientVersion*(dpy: PDisplay): XBool{.cdecl,
|
|
166 dynlib: libXxf86vm, importc.}
|
|
167 proc XF86VidModeGetModeLine*(dpy: PDisplay, screen: cint, dotclock: Pcint,
|
|
168 modeline: PXF86VidModeModeLine): XBool{.cdecl,
|
|
169 dynlib: libXxf86vm, importc.}
|
|
170 proc XF86VidModeGetAllModeLines*(dpy: PDisplay, screen: cint, modecount: Pcint,
|
|
171 modelinesPtr: PPPXF86VidModeModeInfo): XBool{.
|
|
172 cdecl, dynlib: libXxf86vm, importc.}
|
|
173 proc XF86VidModeAddModeLine*(dpy: PDisplay, screen: cint,
|
|
174 new_modeline: PXF86VidModeModeInfo,
|
|
175 after_modeline: PXF86VidModeModeInfo): XBool{.
|
|
176 cdecl, dynlib: libXxf86vm, importc.}
|
|
177 proc XF86VidModeDeleteModeLine*(dpy: PDisplay, screen: cint,
|
|
178 modeline: PXF86VidModeModeInfo): XBool{.cdecl,
|
|
179 dynlib: libXxf86vm, importc.}
|
|
180 proc XF86VidModeModModeLine*(dpy: PDisplay, screen: cint,
|
|
181 modeline: PXF86VidModeModeLine): XBool{.cdecl,
|
|
182 dynlib: libXxf86vm, importc.}
|
|
183 proc XF86VidModeValidateModeLine*(dpy: PDisplay, screen: cint,
|
|
184 modeline: PXF86VidModeModeInfo): Status{.
|
|
185 cdecl, dynlib: libXxf86vm, importc.}
|
|
186 proc XF86VidModeSwitchMode*(dpy: PDisplay, screen: cint, zoom: cint): XBool{.
|
|
187 cdecl, dynlib: libXxf86vm, importc.}
|
|
188 proc XF86VidModeSwitchToMode*(dpy: PDisplay, screen: cint,
|
|
189 modeline: PXF86VidModeModeInfo): XBool{.cdecl,
|
|
190 dynlib: libXxf86vm, importc.}
|
|
191 proc XF86VidModeLockModeSwitch*(dpy: PDisplay, screen: cint, lock: cint): XBool{.
|
|
192 cdecl, dynlib: libXxf86vm, importc.}
|
|
193 proc XF86VidModeGetMonitor*(dpy: PDisplay, screen: cint,
|
|
194 monitor: PXF86VidModeMonitor): XBool{.cdecl,
|
|
195 dynlib: libXxf86vm, importc.}
|
|
196 proc XF86VidModeGetViewPort*(dpy: PDisplay, screen: cint, x_return: Pcint,
|
|
197 y_return: Pcint): XBool{.cdecl, dynlib: libXxf86vm,
|
|
198 importc.}
|
|
199 proc XF86VidModeSetViewPort*(dpy: PDisplay, screen: cint, x: cint, y: cint): XBool{.
|
|
200 cdecl, dynlib: libXxf86vm, importc.}
|
|
201 proc XF86VidModeGetDotClocks*(dpy: PDisplay, screen: cint, flags_return: Pcint,
|
|
202 number_of_clocks_return: Pcint,
|
|
203 max_dot_clock_return: Pcint, clocks_return: PPcint): XBool{.
|
|
204 cdecl, dynlib: libXxf86vm, importc.}
|
|
205 proc XF86VidModeGetGamma*(dpy: PDisplay, screen: cint, Gamma: PXF86VidModeGamma): XBool{.
|
|
206 cdecl, dynlib: libXxf86vm, importc.}
|
|
207 proc XF86VidModeSetGamma*(dpy: PDisplay, screen: cint, Gamma: PXF86VidModeGamma): XBool{.
|
|
208 cdecl, dynlib: libXxf86vm, importc.}
|
|
209 proc XF86VidModeSetGammaRamp*(dpy: PDisplay, screen: cint, size: cint,
|
|
210 red_array: Pcushort, green_array: Pcushort,
|
|
211 blue_array: Pcushort): XBool{.cdecl,
|
|
212 dynlib: libXxf86vm, importc.}
|
|
213 proc XF86VidModeGetGammaRamp*(dpy: PDisplay, screen: cint, size: cint,
|
|
214 red_array: Pcushort, green_array: Pcushort,
|
|
215 blue_array: Pcushort): XBool{.cdecl,
|
|
216 dynlib: libXxf86vm, importc.}
|
|
217 proc XF86VidModeGetGammaRampSize*(dpy: PDisplay, screen: cint, size: Pcint): XBool{.
|
|
218 cdecl, dynlib: libXxf86vm, importc.}
|
|
219 proc XF86VidModeGetPermissions*(dpy: PDisplay, screen: cint, permissions: Pcint): XBool{.
|
|
220 cdecl, dynlib: libXxf86vm, importc.}
|
|
221 # implementation
|
|
222
|
|
223 #when defined(MACROS):
|
|
224 proc XF86VidModeSelectNextMode(disp: PDisplay, scr: cint): XBool =
|
|
225 XF86VidModeSwitchMode(disp, scr, 1)
|
|
226
|
|
227 proc XF86VidModeSelectPrevMode(disp: PDisplay, scr: cint): XBool =
|
|
228 XF86VidModeSwitchMode(disp, scr, - 1)
|