xf86vmode.pp 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339
  1. { $XFree86: xc/include/extensions/xf86vmode.h,v 3.30 2001/05/07 20:09:50 mvojkovi Exp $ }
  2. {
  3. Copyright 1995 Kaleb S. KEITHLEY
  4. Permission is hereby granted, free of charge, to any person obtaining
  5. a copy of this software and associated documentation files (the
  6. "Software"), to deal in the Software without restriction, including
  7. without limitation the rights to use, copy, modify, merge, publish,
  8. distribute, sublicense, and/or sell copies of the Software, and to
  9. permit persons to whom the Software is furnished to do so, subject to
  10. the following conditions:
  11. The above copyright notice and this permission notice shall be
  12. included in all copies or substantial portions of the Software.
  13. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  14. EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  15. MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
  16. IN NO EVENT SHALL Kaleb S. KEITHLEY BE LIABLE FOR ANY CLAIM, DAMAGES
  17. OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
  18. ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  19. OTHER DEALINGS IN THE SOFTWARE.
  20. Except as contained in this notice, the name of Kaleb S. KEITHLEY
  21. shall not be used in advertising or otherwise to promote the sale, use
  22. or other dealings in this Software without prior written authorization
  23. from Kaleb S. KEITHLEY
  24. }
  25. { $Xorg: xf86vmode.h,v 1.3 2000/08/18 04:05:46 coskrey Exp $ }
  26. { THIS IS NOT AN X CONSORTIUM STANDARD OR AN X PROJECT TEAM SPECIFICATION }
  27. Unit xf86vmode;
  28. {$PACKRECORDS c}
  29. {$DEFINE MACROS}
  30. Interface
  31. Uses
  32. ctypes, x, xlib;
  33. Const
  34. libXxf86vm = 'Xxf86vm';
  35. Type
  36. PINT32 = ^LongInt; {INT32 *}
  37. Const
  38. X_XF86VidModeQueryVersion = 0;
  39. X_XF86VidModeGetModeLine = 1;
  40. X_XF86VidModeModModeLine = 2;
  41. X_XF86VidModeSwitchMode = 3;
  42. X_XF86VidModeGetMonitor = 4;
  43. X_XF86VidModeLockModeSwitch = 5;
  44. X_XF86VidModeGetAllModeLines = 6;
  45. X_XF86VidModeAddModeLine = 7;
  46. X_XF86VidModeDeleteModeLine = 8;
  47. X_XF86VidModeValidateModeLine = 9;
  48. X_XF86VidModeSwitchToMode = 10;
  49. X_XF86VidModeGetViewPort = 11;
  50. X_XF86VidModeSetViewPort = 12;
  51. { new for version 2.x of this extension }
  52. X_XF86VidModeGetDotClocks = 13;
  53. X_XF86VidModeSetClientVersion = 14;
  54. X_XF86VidModeSetGamma = 15;
  55. X_XF86VidModeGetGamma = 16;
  56. X_XF86VidModeGetGammaRamp = 17;
  57. X_XF86VidModeSetGammaRamp = 18;
  58. X_XF86VidModeGetGammaRampSize = 19;
  59. X_XF86VidModeGetPermissions = 20;
  60. CLKFLAG_PROGRAMABLE = 1;
  61. {$IFDEF XF86VIDMODE_EVENTS}
  62. XF86VidModeNotify = 0;
  63. XF86VidModeNumberEvents = (XF86VidModeNotify + 1);
  64. XF86VidModeNotifyMask = $00000001;
  65. XF86VidModeNonEvent = 0;
  66. XF86VidModeModeChange = 1;
  67. {$ELSE XF86VIDMODE_EVENTS}
  68. XF86VidModeNumberEvents = 0;
  69. {$ENDIF XF86VIDMODE_EVENTS}
  70. XF86VidModeBadClock = 0;
  71. XF86VidModeBadHTimings = 1;
  72. XF86VidModeBadVTimings = 2;
  73. XF86VidModeModeUnsuitable = 3;
  74. XF86VidModeExtensionDisabled = 4;
  75. XF86VidModeClientNotLocal = 5;
  76. XF86VidModeZoomLocked = 6;
  77. XF86VidModeNumberErrors = (XF86VidModeZoomLocked + 1);
  78. XF86VM_READ_PERMISSION = 1;
  79. XF86VM_WRITE_PERMISSION = 2;
  80. Type
  81. PXF86VidModeModeLine = ^TXF86VidModeModeLine;
  82. TXF86VidModeModeLine = Record
  83. hdisplay : cushort;
  84. hsyncstart : cushort;
  85. hsyncend : cushort;
  86. htotal : cushort;
  87. hskew : cushort;
  88. vdisplay : cushort;
  89. vsyncstart : cushort;
  90. vsyncend : cushort;
  91. vtotal : cushort;
  92. flags : cuint;
  93. privsize : cint;
  94. c_private : PINT32;
  95. End;
  96. PPPXF86VidModeModeInfo = ^PPXF86VidModeModeInfo;
  97. PPXF86VidModeModeInfo = ^PXF86VidModeModeInfo;
  98. PXF86VidModeModeInfo = ^TXF86VidModeModeInfo;
  99. TXF86VidModeModeInfo = Record
  100. dotclock : cuint;
  101. hdisplay : cushort;
  102. hsyncstart : cushort;
  103. hsyncend : cushort;
  104. htotal : cushort;
  105. hskew : cushort;
  106. vdisplay : cushort;
  107. vsyncstart : cushort;
  108. vsyncend : cushort;
  109. vtotal : cushort;
  110. flags : cuint;
  111. privsize : cint;
  112. c_private : PINT32;
  113. End;
  114. PXF86VidModeSyncRange = ^TXF86VidModeSyncRange;
  115. TXF86VidModeSyncRange = Record
  116. hi : cfloat;
  117. lo : cfloat;
  118. End;
  119. PXF86VidModeMonitor = ^TXF86VidModeMonitor;
  120. TXF86VidModeMonitor = Record
  121. vendor : PChar;
  122. model : PChar;
  123. EMPTY : cfloat;
  124. nhsync : cuchar;
  125. hsync : PXF86VidModeSyncRange;
  126. nvsync : cuchar;
  127. vsync : PXF86VidModeSyncRange;
  128. End;
  129. PXF86VidModeNotifyEvent = ^TXF86VidModeNotifyEvent;
  130. TXF86VidModeNotifyEvent = Record
  131. _type : cint; { of event }
  132. serial : culong; { # of last request processed by server }
  133. send_event : TBool; { true if this came from a SendEvent req }
  134. display : PDisplay; { Display the event was read from }
  135. root : TWindow; { root window of event screen }
  136. state : cint; { What happened }
  137. kind : cint; { What happened }
  138. forced : TBool; { extents of new region }
  139. time : TTime; { event timestamp }
  140. End;
  141. PXF86VidModeGamma = ^TXF86VidModeGamma;
  142. TXF86VidModeGamma = Record
  143. red : cfloat; { Red Gamma value }
  144. green : cfloat; { Green Gamma value }
  145. blue : cfloat; { Blue Gamma value }
  146. End;
  147. {$IFDEF MACROS}
  148. Function XF86VidModeSelectNextMode(disp : PDisplay; scr : cint) : TBool;
  149. Function XF86VidModeSelectPrevMode(disp : PDisplay; scr : cint) : TBool;
  150. {$ENDIF MACROS}
  151. Function XF86VidModeQueryVersion(
  152. dpy : PDisplay;
  153. majorVersion : Pcint;
  154. minorVersion : Pcint
  155. ) : TBool; CDecl; External libXxf86vm;
  156. Function XF86VidModeQueryExtension(
  157. dpy : PDisplay;
  158. event_base : Pcint;
  159. error_base : Pcint
  160. ) : TBool; CDecl; External libXxf86vm;
  161. Function XF86VidModeSetClientVersion(
  162. dpy : PDisplay
  163. ) : TBool; CDecl; External libXxf86vm;
  164. Function XF86VidModeGetModeLine(
  165. dpy : PDisplay;
  166. screen : cint;
  167. dotclock : Pcint;
  168. modeline : PXF86VidModeModeLine
  169. ) : TBool; CDecl; External libXxf86vm;
  170. Function XF86VidModeGetAllModeLines(
  171. dpy : PDisplay;
  172. screen : cint;
  173. modecount : Pcint;
  174. modelinesPtr : PPPXF86VidModeModeInfo
  175. ) : TBool; CDecl; External libXxf86vm;
  176. Function XF86VidModeAddModeLine(
  177. dpy : PDisplay;
  178. screen : cint;
  179. new_modeline : PXF86VidModeModeInfo;
  180. after_modeline : PXF86VidModeModeInfo
  181. ) : TBool; CDecl; External libXxf86vm;
  182. Function XF86VidModeDeleteModeLine(
  183. dpy : PDisplay;
  184. screen : cint;
  185. modeline : PXF86VidModeModeInfo
  186. ) : TBool; CDecl; External libXxf86vm;
  187. Function XF86VidModeModModeLine(
  188. dpy : PDisplay;
  189. screen : cint;
  190. modeline : PXF86VidModeModeLine
  191. ) : TBool; CDecl; External libXxf86vm;
  192. Function XF86VidModeValidateModeLine(
  193. dpy : PDisplay;
  194. screen : cint;
  195. modeline : PXF86VidModeModeInfo
  196. ) : TStatus; CDecl; External libXxf86vm;
  197. Function XF86VidModeSwitchMode(
  198. dpy : PDisplay;
  199. screen : cint;
  200. zoom : cint
  201. ) : TBool; CDecl; External libXxf86vm;
  202. Function XF86VidModeSwitchToMode(
  203. dpy : PDisplay;
  204. screen : cint;
  205. modeline : PXF86VidModeModeInfo
  206. ) : TBool; CDecl; External libXxf86vm;
  207. Function XF86VidModeLockModeSwitch(
  208. dpy : PDisplay;
  209. screen : cint;
  210. lock : cint
  211. ) : TBool; CDecl; External libXxf86vm;
  212. Function XF86VidModeGetMonitor(
  213. dpy : PDisplay;
  214. screen : cint;
  215. monitor : PXF86VidModeMonitor
  216. ) : TBool; CDecl; External libXxf86vm;
  217. Function XF86VidModeGetViewPort(
  218. dpy : PDisplay;
  219. screen : cint;
  220. x_return : Pcint;
  221. y_return : Pcint
  222. ) : TBool; CDecl; External libXxf86vm;
  223. Function XF86VidModeSetViewPort(
  224. dpy : PDisplay;
  225. screen : cint;
  226. x : cint;
  227. y : cint
  228. ) : TBool; CDecl; External libXxf86vm;
  229. Function XF86VidModeGetDotClocks(
  230. dpy : PDisplay;
  231. screen : cint;
  232. flags_return : Pcint;
  233. number_of_clocks_return : Pcint;
  234. max_dot_clock_return : Pcint;
  235. clocks_return : PPcint
  236. ) : TBool; CDecl; External libXxf86vm;
  237. Function XF86VidModeGetGamma(
  238. dpy : PDisplay;
  239. screen : cint;
  240. Gamma : PXF86VidModeGamma
  241. ) : TBool; CDecl; External libXxf86vm;
  242. Function XF86VidModeSetGamma(
  243. dpy : PDisplay;
  244. screen : cint;
  245. Gamma : PXF86VidModeGamma
  246. ) : TBool; CDecl; External libXxf86vm;
  247. Function XF86VidModeSetGammaRamp(
  248. dpy : PDisplay;
  249. screen : cint;
  250. size : cint;
  251. red_array : Pcushort;
  252. green_array : Pcushort;
  253. blue_array : Pcushort
  254. ) : TBool; CDecl; External libXxf86vm;
  255. Function XF86VidModeGetGammaRamp(
  256. dpy : PDisplay;
  257. screen : cint;
  258. size : cint;
  259. red_array : Pcushort;
  260. green_array : Pcushort;
  261. blue_array : Pcushort
  262. ) : TBool; CDecl; External libXxf86vm;
  263. Function XF86VidModeGetGammaRampSize(
  264. dpy : PDisplay;
  265. screen : cint;
  266. size : Pcint
  267. ) : TBool; CDecl; External libXxf86vm;
  268. Function XF86VidModeGetPermissions(
  269. dpy : PDisplay;
  270. screen : cint;
  271. permissions : Pcint
  272. ) : TBool; CDecl; External libXxf86vm;
  273. Implementation
  274. {$IFDEF MACROS}
  275. Function XF86VidModeSelectNextMode(disp : PDisplay; scr : cint) : TBool;
  276. Begin
  277. XF86VidModeSelectNextMode := XF86VidModeSwitchMode(disp, scr, 1);
  278. End;
  279. Function XF86VidModeSelectPrevMode(disp : PDisplay; scr : cint) : TBool;
  280. Begin
  281. XF86VidModeSelectPrevMode := XF86VidModeSwitchMode(disp, scr, -1);
  282. End;
  283. {$ENDIF MACROS}
  284. End.