randr.h 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208
  1. /*
  2. * Copyright © 2000 Compaq Computer Corporation
  3. * Copyright © 2002 Hewlett Packard Company
  4. * Copyright © 2006 Intel Corporation
  5. * Copyright © 2008 Red Hat, Inc.
  6. *
  7. * Permission to use, copy, modify, distribute, and sell this software and its
  8. * documentation for any purpose is hereby granted without fee, provided that
  9. * the above copyright notice appear in all copies and that both that copyright
  10. * notice and this permission notice appear in supporting documentation, and
  11. * that the name of the copyright holders not be used in advertising or
  12. * publicity pertaining to distribution of the software without specific,
  13. * written prior permission. The copyright holders make no representations
  14. * about the suitability of this software for any purpose. It is provided "as
  15. * is" without express or implied warranty.
  16. *
  17. * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  18. * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
  19. * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  20. * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  21. * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  22. * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
  23. * OF THIS SOFTWARE.
  24. *
  25. * Author: Jim Gettys, HP Labs, Hewlett-Packard, Inc.
  26. * Keith Packard, Intel Corporation
  27. */
  28. #ifndef _RANDR_H_
  29. #define _RANDR_H_
  30. typedef unsigned short Rotation;
  31. typedef unsigned short SizeID;
  32. typedef unsigned short SubpixelOrder;
  33. typedef unsigned short Connection;
  34. typedef unsigned short XRandrRotation;
  35. typedef unsigned short XRandrSizeID;
  36. typedef unsigned short XRandrSubpixelOrder;
  37. typedef unsigned long XRandrModeFlags;
  38. #define RANDR_NAME "RANDR"
  39. #define RANDR_MAJOR 1
  40. #define RANDR_MINOR 6
  41. #define RRNumberErrors 5
  42. #define RRNumberEvents 2
  43. #define RRNumberRequests 47
  44. #define X_RRQueryVersion 0
  45. /* we skip 1 to make old clients fail pretty immediately */
  46. #define X_RROldGetScreenInfo 1
  47. #define X_RR1_0SetScreenConfig 2
  48. /* V1.0 apps share the same set screen config request id */
  49. #define X_RRSetScreenConfig 2
  50. #define X_RROldScreenChangeSelectInput 3
  51. /* 3 used to be ScreenChangeSelectInput; deprecated */
  52. #define X_RRSelectInput 4
  53. #define X_RRGetScreenInfo 5
  54. /* V1.2 additions */
  55. #define X_RRGetScreenSizeRange 6
  56. #define X_RRSetScreenSize 7
  57. #define X_RRGetScreenResources 8
  58. #define X_RRGetOutputInfo 9
  59. #define X_RRListOutputProperties 10
  60. #define X_RRQueryOutputProperty 11
  61. #define X_RRConfigureOutputProperty 12
  62. #define X_RRChangeOutputProperty 13
  63. #define X_RRDeleteOutputProperty 14
  64. #define X_RRGetOutputProperty 15
  65. #define X_RRCreateMode 16
  66. #define X_RRDestroyMode 17
  67. #define X_RRAddOutputMode 18
  68. #define X_RRDeleteOutputMode 19
  69. #define X_RRGetCrtcInfo 20
  70. #define X_RRSetCrtcConfig 21
  71. #define X_RRGetCrtcGammaSize 22
  72. #define X_RRGetCrtcGamma 23
  73. #define X_RRSetCrtcGamma 24
  74. /* V1.3 additions */
  75. #define X_RRGetScreenResourcesCurrent 25
  76. #define X_RRSetCrtcTransform 26
  77. #define X_RRGetCrtcTransform 27
  78. #define X_RRGetPanning 28
  79. #define X_RRSetPanning 29
  80. #define X_RRSetOutputPrimary 30
  81. #define X_RRGetOutputPrimary 31
  82. #define RRTransformUnit (1L << 0)
  83. #define RRTransformScaleUp (1L << 1)
  84. #define RRTransformScaleDown (1L << 2)
  85. #define RRTransformProjective (1L << 3)
  86. /* v1.4 */
  87. #define X_RRGetProviders 32
  88. #define X_RRGetProviderInfo 33
  89. #define X_RRSetProviderOffloadSink 34
  90. #define X_RRSetProviderOutputSource 35
  91. #define X_RRListProviderProperties 36
  92. #define X_RRQueryProviderProperty 37
  93. #define X_RRConfigureProviderProperty 38
  94. #define X_RRChangeProviderProperty 39
  95. #define X_RRDeleteProviderProperty 40
  96. #define X_RRGetProviderProperty 41
  97. /* v1.5 */
  98. #define X_RRGetMonitors 42
  99. #define X_RRSetMonitor 43
  100. #define X_RRDeleteMonitor 44
  101. /* v1.6 */
  102. #define X_RRCreateLease 45
  103. #define X_RRFreeLease 46
  104. /* Event selection bits */
  105. #define RRScreenChangeNotifyMask (1L << 0)
  106. /* V1.2 additions */
  107. #define RRCrtcChangeNotifyMask (1L << 1)
  108. #define RROutputChangeNotifyMask (1L << 2)
  109. #define RROutputPropertyNotifyMask (1L << 3)
  110. /* V1.4 additions */
  111. #define RRProviderChangeNotifyMask (1L << 4)
  112. #define RRProviderPropertyNotifyMask (1L << 5)
  113. #define RRResourceChangeNotifyMask (1L << 6)
  114. /* V1.6 additions */
  115. #define RRLeaseNotifyMask (1L << 7)
  116. /* Event codes */
  117. #define RRScreenChangeNotify 0
  118. /* V1.2 additions */
  119. #define RRNotify 1
  120. /* RRNotify Subcodes */
  121. #define RRNotify_CrtcChange 0
  122. #define RRNotify_OutputChange 1
  123. #define RRNotify_OutputProperty 2
  124. #define RRNotify_ProviderChange 3
  125. #define RRNotify_ProviderProperty 4
  126. #define RRNotify_ResourceChange 5
  127. /* V1.6 additions */
  128. #define RRNotify_Lease 6
  129. /* used in the rotation field; rotation and reflection in 0.1 proto. */
  130. #define RR_Rotate_0 1
  131. #define RR_Rotate_90 2
  132. #define RR_Rotate_180 4
  133. #define RR_Rotate_270 8
  134. /* new in 1.0 protocol, to allow reflection of screen */
  135. #define RR_Reflect_X 16
  136. #define RR_Reflect_Y 32
  137. #define RRSetConfigSuccess 0
  138. #define RRSetConfigInvalidConfigTime 1
  139. #define RRSetConfigInvalidTime 2
  140. #define RRSetConfigFailed 3
  141. /* new in 1.2 protocol */
  142. #define RR_HSyncPositive 0x00000001
  143. #define RR_HSyncNegative 0x00000002
  144. #define RR_VSyncPositive 0x00000004
  145. #define RR_VSyncNegative 0x00000008
  146. #define RR_Interlace 0x00000010
  147. #define RR_DoubleScan 0x00000020
  148. #define RR_CSync 0x00000040
  149. #define RR_CSyncPositive 0x00000080
  150. #define RR_CSyncNegative 0x00000100
  151. #define RR_HSkewPresent 0x00000200
  152. #define RR_BCast 0x00000400
  153. #define RR_PixelMultiplex 0x00000800
  154. #define RR_DoubleClock 0x00001000
  155. #define RR_ClockDivideBy2 0x00002000
  156. #define RR_Connected 0
  157. #define RR_Disconnected 1
  158. #define RR_UnknownConnection 2
  159. #define BadRROutput 0
  160. #define BadRRCrtc 1
  161. #define BadRRMode 2
  162. #define BadRRProvider 3
  163. #define BadRRLease 4
  164. /* Conventional RandR output properties */
  165. #define RR_PROPERTY_BACKLIGHT "Backlight"
  166. #define RR_PROPERTY_RANDR_EDID "EDID"
  167. #define RR_PROPERTY_SIGNAL_FORMAT "SignalFormat"
  168. #define RR_PROPERTY_SIGNAL_PROPERTIES "SignalProperties"
  169. #define RR_PROPERTY_CONNECTOR_TYPE "ConnectorType"
  170. #define RR_PROPERTY_CONNECTOR_NUMBER "ConnectorNumber"
  171. #define RR_PROPERTY_COMPATIBILITY_LIST "CompatibilityList"
  172. #define RR_PROPERTY_CLONE_LIST "CloneList"
  173. #define RR_PROPERTY_BORDER "Border"
  174. #define RR_PROPERTY_BORDER_DIMENSIONS "BorderDimensions"
  175. #define RR_PROPERTY_GUID "GUID"
  176. #define RR_PROPERTY_RANDR_TILE "TILE"
  177. #define RR_PROPERTY_NON_DESKTOP "non-desktop"
  178. /* roles this device can carry out */
  179. #define RR_Capability_None 0
  180. #define RR_Capability_SourceOutput 1
  181. #define RR_Capability_SinkOutput 2
  182. #define RR_Capability_SourceOffload 4
  183. #define RR_Capability_SinkOffload 8
  184. #endif /* _RANDR_H_ */