xrandr.pp 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  1. {
  2. $XFree86: xc/lib/Xrandr/Xrandr.h,v 1.9 2002/09/29 23:39:44 keithp Exp $
  3. Copyright (C) 2000 Compaq Computer Corporation, Inc.
  4. Copyright (C) 2002 Hewlett-Packard Company, Inc.
  5. Permission to use, copy, modify, distribute, and sell this software and its
  6. documentation for any purpose is hereby granted without fee, provided that
  7. the above copyright notice appear in all copies and that both that
  8. copyright notice and this permission notice appear in supporting
  9. documentation, and that the name of Compaq not be used in advertising or
  10. publicity pertaining to distribution of the software without specific,
  11. written prior permission. HP makes no representations about the
  12. suitability of this software for any purpose. It is provided "as is"
  13. without express or implied warranty.
  14. HP DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
  15. IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL COMPAQ
  16. BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
  17. WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
  18. OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
  19. CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  20. Author: Jim Gettys, HP Labs, HP.
  21. }
  22. unit xrandr;
  23. interface
  24. {$PACKRECORDS c}
  25. uses
  26. ctypes, x, xlib;
  27. const
  28. libXrandr = 'Xrandr';
  29. {$I randr.inc}
  30. type
  31. PXRRScreenSize = ^TXRRScreenSize;
  32. TXRRScreenSize = record
  33. width, height : cint;
  34. mwidth, mheight : cint;
  35. end;
  36. {
  37. Events.
  38. }
  39. TXRRScreenChangeNotifyEvent = record
  40. _type : cint; { event base }
  41. serial : culong; { # of last request processed by server }
  42. send_event : TBool; { true if this came from a SendEvent request }
  43. display : PDisplay; { Display the event was read from }
  44. window : TWindow; { window which selected for this event }
  45. root : TWindow; { Root window for changed screen }
  46. timestamp : TTime; { when the screen change occurred }
  47. config_timestamp : TTime; { when the last configuration change }
  48. size_index : TSizeID;
  49. subpixel_order : TSubpixelOrder;
  50. rotation : TRotation;
  51. width : cint;
  52. height : cint;
  53. mwidth : cint;
  54. mheight : cint;
  55. end;
  56. { internal representation is private to the library }
  57. PXRRScreenConfiguration = ^TXRRScreenConfiguration;
  58. TXRRScreenConfiguration = record end;
  59. function XRRQueryExtension(
  60. dpy : PDisplay;
  61. event_basep,
  62. error_basep : Pcint) : TBool; cdecl; external libXrandr;
  63. function XRRQueryVersion(
  64. dpy : PDisplay;
  65. major_versionp : Pcint;
  66. minor_versionp : Pcint) : TStatus; cdecl; external libXrandr;
  67. function XRRGetScreenInfo(
  68. dpy : PDisplay;
  69. draw : TDrawable) : PXRRScreenConfiguration; cdecl; external libXrandr;
  70. procedure XRRFreeScreenConfigInfo(
  71. config : PXRRScreenConfiguration); cdecl; external libXrandr;
  72. {
  73. Note that screen configuration changes are only permitted if the client can
  74. prove it has up to date configuration information. We are trying to
  75. insist that it become possible for screens to change dynamically, so
  76. we want to ensure the client knows what it is talking about when requesting
  77. changes.
  78. }
  79. function XRRSetScreenConfig(
  80. dpy : PDisplay;
  81. config : PXRRScreenConfiguration;
  82. draw : TDrawable;
  83. size_index : cint;
  84. rotation : TRotation;
  85. timestamp : TTime) : TStatus; cdecl; external libXrandr;
  86. { added in v1.1, sorry for the lame name }
  87. function XRRSetScreenConfigAndRate(
  88. dpy : PDisplay;
  89. config : PXRRScreenConfiguration;
  90. draw : TDrawable;
  91. size_index : cint;
  92. rotation : TRotation;
  93. rate : cshort;
  94. timestamp : TTime) : TStatus; cdecl; external libXrandr;
  95. function XRRConfigRotations(
  96. config : PXRRScreenConfiguration;
  97. current_rotation : PRotation) : TRotation; cdecl; external libXrandr;
  98. function XRRConfigTimes(
  99. config : PXRRScreenConfiguration;
  100. config_timestamp : PTime) : TTime; cdecl; external libXrandr;
  101. function XRRConfigSizes(
  102. config : PXRRScreenConfiguration;
  103. nsizes : Pcint) : PXRRScreenSize; cdecl; external libXrandr;
  104. function XRRConfigRates(
  105. config : PXRRScreenConfiguration;
  106. sizeID : cint;
  107. nrates : Pcint) : Pcshort; cdecl; external libXrandr;
  108. function XRRConfigCurrentConfiguration(
  109. config : PXRRScreenConfiguration;
  110. rotation : PRotation) : TSizeID; cdecl; external libXrandr;
  111. function XRRConfigCurrentRate(
  112. config : PXRRScreenConfiguration) : cshort; cdecl; external libXrandr;
  113. function XRRRootToScreen(
  114. dpy : PDisplay;
  115. root : TWindow) : cint; cdecl; external libXrandr;
  116. {
  117. returns the screen configuration for the specified screen; does a lazy
  118. evalution to delay getting the information, and caches the result.
  119. These routines should be used in preference to XRRGetScreenInfo
  120. to avoid unneeded round trips to the X server. These are new
  121. in protocol version 0.1.
  122. }
  123. function XRRScreenConfig(
  124. dpy : PDisplay;
  125. screen : cint) : PXRRScreenConfiguration; cdecl; external libXrandr;
  126. function XRRConfig(
  127. screen : PScreen) : PXRRScreenConfiguration; cdecl; external libXrandr;
  128. procedure XRRSelectInput(
  129. dpy : PDisplay;
  130. window : TWindow;
  131. mask : cint); cdecl; external libXrandr;
  132. {
  133. the following are always safe to call, even if RandR is not implemented
  134. on a screen
  135. }
  136. function XRRRotations(
  137. dpy : PDisplay;
  138. screen : cint;
  139. current_rotation : PRotation) : TRotation; cdecl; external libXrandr;
  140. function XRRSizes(
  141. dpy : PDisplay;
  142. screen : cint;
  143. nsizes : Pcint) : PXRRScreenSize; cdecl; external libXrandr;
  144. function XRRRates(
  145. dpy : PDisplay;
  146. screen : cint;
  147. sizeID : cint;
  148. nrates : Pcint) : Pcshort; cdecl; external libXrandr;
  149. function XRRTimes(
  150. dpy : PDisplay;
  151. screen : cint;
  152. config_timestamp : PTime) : TTime; cdecl; external libXrandr;
  153. {
  154. intended to take RRScreenChangeNotify, or
  155. ConfigureNotify (on the root window)
  156. returns 1 if it is an event type it understands, 0 if not
  157. }
  158. function XRRUpdateConfiguration(
  159. event : PXEvent) : cint; cdecl; external libXrandr;
  160. implementation
  161. end.