annotate semiconginev2/thirdparty/x11/xrandr.nim @ 1249:d83726af7abb

did: first triangles getting loaded from gltf
author sam <sam@basx.dev>
date Thu, 25 Jul 2024 22:41:24 +0700
parents 56781cc0fc7c
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1191
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
1 #
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
2 # $XFree86: xc/lib/Xrandr/Xrandr.h,v 1.9 2002/09/29 23:39:44 keithp Exp $
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
3 #
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
4 # Copyright (C) 2000 Compaq Computer Corporation, Inc.
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
5 # Copyright (C) 2002 Hewlett-Packard Company, Inc.
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
6 #
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
7 # Permission to use, copy, modify, distribute, and sell this software and its
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
8 # documentation for any purpose is hereby granted without fee, provided that
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
9 # the above copyright notice appear in all copies and that both that
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
10 # copyright notice and this permission notice appear in supporting
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
11 # documentation, and that the name of Compaq not be used in advertising or
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
12 # publicity pertaining to distribution of the software without specific,
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
13 # written prior permission. HP makes no representations about the
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
14 # suitability of this software for any purpose. It is provided "as is"
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
15 # without express or implied warranty.
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
16 #
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
17 # HP DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
18 # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL COMPAQ
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
19 # BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
20 # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
21 # OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
22 # CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
23 #
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
24 # Author: Jim Gettys, HP Labs, HP.
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
25 #
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
26
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
27 import
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
28 x, xlib
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
29
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
30 const
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
31 libXrandr* = "libXrandr.so(.2|)"
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
32
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
33 # * $XFree86: xc/include/extensions/randr.h,v 1.4 2001/11/24 07:24:58 keithp Exp $
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
34 # *
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
35 # * Copyright (C) 2000, Compaq Computer Corporation,
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
36 # * Copyright (C) 2002, Hewlett Packard, Inc.
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
37 # *
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
38 # * Permission to use, copy, modify, distribute, and sell this software and its
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
39 # * documentation for any purpose is hereby granted without fee, provided that
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
40 # * the above copyright notice appear in all copies and that both that
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
41 # * copyright notice and this permission notice appear in supporting
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
42 # * documentation, and that the name of Compaq or HP not be used in advertising
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
43 # * or publicity pertaining to distribution of the software without specific,
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
44 # * written prior permission. HP makes no representations about the
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
45 # * suitability of this software for any purpose. It is provided "as is"
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
46 # * without express or implied warranty.
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
47 # *
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
48 # * HP DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
49 # * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL HP
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
50 # * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
51 # * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
52 # * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
53 # * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
54 # *
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
55 # * Author: Jim Gettys, HP Labs, Hewlett-Packard, Inc.
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
56 # *
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
57
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
58 type
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
59 PRotation* = ptr Rotation
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
60 Rotation* = cushort
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
61
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
62 PSizeID* = ptr SizeID
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
63 SizeID* = cushort
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
64
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
65 PSubpixelOrder* = ptr SubpixelOrder
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
66 SubpixelOrder* = cushort
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
67
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
68 PRRCrtc* = ptr RRCrtc
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
69 RRCrtc* = XID
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
70
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
71 PRROutput* = ptr RROutput
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
72 RROutput* = XID
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
73
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
74 PRRMode* = ptr RRMode
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
75 RRMode* = XID
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
76
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
77 PXRRModeFlags* = ptr XRRModeFlags
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
78 XRRModeFlags* = culong
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
79
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
80 PConnection* = ptr Connection
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
81 Connection* = cushort
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
82
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
83 const
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
84 RANDR_NAME* = "RANDR"
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
85 RANDR_MAJOR* = 1
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
86 RANDR_MINOR* = 1
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
87 RRNumberErrors* = 0
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
88 RRNumberEvents* = 1
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
89 constX_RRQueryVersion* = 0 # we skip 1 to make old clients fail pretty immediately
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
90 X_RROldGetScreenInfo* = 1
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
91 X_RR1_0SetScreenConfig* = 2 # V1.0 apps share the same set screen config request id
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
92 constX_RRSetScreenConfig* = 2
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
93 X_RROldScreenChangeSelectInput* = 3 # 3 used to be ScreenChangeSelectInput; deprecated
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
94 constX_RRSelectInput* = 4
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
95 constX_RRGetScreenInfo* = 5 # used in XRRSelectInput
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
96 RRScreenChangeNotifyMask* = 1 shl 0
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
97 RRScreenChangeNotify* = 0 # used in the rotation field; rotation and reflection in 0.1 proto.
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
98 RR_Rotate_0* = 1
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
99 RR_Rotate_90* = 2
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
100 RR_Rotate_180* = 4
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
101 RR_Rotate_270* = 8 # new in 1.0 protocol, to allow reflection of screen
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
102 RR_Reflect_X* = 16
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
103 RR_Reflect_Y* = 32
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
104 RRSetConfigSuccess* = 0
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
105 RRSetConfigInvalidConfigTime* = 1
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
106 RRSetConfigInvalidTime* = 2
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
107 RRSetConfigFailed* = 3
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
108 RR_Connected* = 0
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
109 RR_Disconnected* = 1
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
110 RR_UnknownConnection* = 2
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
111
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
112 type
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
113 PXRRScreenSize* = ptr XRRScreenSize
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
114 XRRScreenSize*{.final.} = object #
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
115 # Events.
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
116 #
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
117 width*, height*: cint
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
118 mwidth*, mheight*: cint
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
119
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
120 XRRScreenChangeNotifyEvent*{.final.} = object # internal representation is private to the library
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
121 typ*: cint # event base
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
122 serial*: culong # # of last request processed by server
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
123 send_event*: XBool # true if this came from a SendEvent request
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
124 display*: PDisplay # Display the event was read from
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
125 window*: Window # window which selected for this event
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
126 root*: Window # Root window for changed screen
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
127 timestamp*: Time # when the screen change occurred
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
128 config_timestamp*: Time # when the last configuration change
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
129 size_index*: SizeID
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
130 subpixel_order*: SubpixelOrder
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
131 rotation*: Rotation
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
132 width*: cint
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
133 height*: cint
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
134 mwidth*: cint
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
135 mheight*: cint
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
136
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
137 PXRRScreenConfiguration* = ptr XRRScreenConfiguration
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
138 XRRScreenConfiguration* {.final.} = object
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
139
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
140 PXRRModeInfo* = ptr XRRModeInfo
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
141 XRRModeInfo* {.final.} = object
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
142 id*: RRMode
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
143 width*, height*: cuint
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
144 dotClock*: culong
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
145 hSyncStart*, hSyncEnd*, hTotal*, hSkew*: cuint
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
146 vSyncStart*, vSyncEnd*, vTotal*: cuint
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
147 name*: cstring
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
148 nameLength*: cuint
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
149 modeFlags*: XRRModeFlags
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
150
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
151 PXRRScreenResources* = ptr XRRScreenResources
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
152 XRRScreenResources* {.final.} = object
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
153 timestamp*, configTimestamp*: Time
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
154 ncrtc*: cint
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
155 crtcs*: ptr UncheckedArray[RRCrtc]
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
156 noutput*: cint
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
157 outputs*: ptr UncheckedArray[RROutput]
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
158 nmode*: cint
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
159 modes*: ptr UncheckedArray[XRRModeInfo]
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
160
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
161 PXRROutputInfo* = ptr XRROutputInfo
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
162 XRROutputInfo* {.final.} = object
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
163 timestamp*: Time
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
164 crtc*: RRCrtc
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
165 name*: cstring
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
166 nameLen*: cint
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
167 mmWidth*, mmHeight*: culong
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
168 connection*: Connection
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
169 subpixelOrder*: SubpixelOrder
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
170 ncrtc*: cint
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
171 crtcs*: ptr UncheckedArray[RRCrtc]
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
172 nclone*: cint
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
173 clones*: ptr UncheckedArray[RROutput]
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
174 nmode*, npreferred*: cint
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
175 modes*: ptr UncheckedArray[RRMode]
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
176
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
177 PXRRPropertyInfo* = ptr XRRPropertyInfo
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
178 XRRPropertyInfo* {.final.} = object
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
179 pending, range, immutable: bool
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
180 numValues: cint
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
181 values: ptr UncheckedArray[clong]
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
182
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
183 RandrFormat* = enum
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
184 randrFormat16bit = 16, randrFormat32bit = 32
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
185
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
186 proc XRRQueryExtension*(dpy: PDisplay, event_basep, error_basep: Pcint): XBool{.
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
187 cdecl, dynlib: libXrandr, importc.}
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
188 proc XRRQueryVersion*(dpy: PDisplay, major_versionp: Pcint,
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
189 minor_versionp: Pcint): Status{.cdecl, dynlib: libXrandr,
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
190 importc.}
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
191 proc XRRQueryOutputProperty*(dpy: PDisplay, output: RROutput, property: Atom):
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
192 PXRRPropertyInfo {.cdecl, dynlib: libXrandr, importc.}
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
193 proc XRRChangeOutputProperty*(dpy: PDisplay, output: RROutput,
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
194 property, kind: Atom, format, mode: cint, data: ptr cuchar, nelements: cint) {.
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
195 cdecl, dynlib: libXrandr, importc.}
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
196 proc XRRGetScreenInfo*(dpy: PDisplay, draw: Drawable): PXRRScreenConfiguration{.
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
197 cdecl, dynlib: libXrandr, importc.}
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
198 proc XRRFreeScreenConfigInfo*(config: PXRRScreenConfiguration){.cdecl,
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
199 dynlib: libXrandr, importc.}
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
200 #
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
201 # Note that screen configuration changes are only permitted if the client can
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
202 # prove it has up to date configuration information. We are trying to
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
203 # insist that it become possible for screens to change dynamically, so
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
204 # we want to ensure the client knows what it is talking about when requesting
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
205 # changes.
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
206 #
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
207 proc XRRSetScreenConfig*(dpy: PDisplay, config: PXRRScreenConfiguration,
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
208 draw: Drawable, size_index: cint, rotation: Rotation,
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
209 timestamp: Time): Status{.cdecl, dynlib: libXrandr,
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
210 importc.}
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
211 # added in v1.1, sorry for the lame name
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
212 proc XRRSetScreenConfigAndRate*(dpy: PDisplay, config: PXRRScreenConfiguration,
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
213 draw: Drawable, size_index: cint,
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
214 rotation: Rotation, rate: cshort,
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
215 timestamp: Time): Status{.cdecl,
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
216 dynlib: libXrandr, importc.}
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
217 proc XRRConfigRotations*(config: PXRRScreenConfiguration,
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
218 current_rotation: PRotation): Rotation{.cdecl,
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
219 dynlib: libXrandr, importc.}
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
220 proc XRRConfigTimes*(config: PXRRScreenConfiguration, config_timestamp: PTime): Time{.
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
221 cdecl, dynlib: libXrandr, importc.}
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
222 proc XRRConfigSizes*(config: PXRRScreenConfiguration, nsizes: Pcint): PXRRScreenSize{.
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
223 cdecl, dynlib: libXrandr, importc.}
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
224 proc XRRConfigRates*(config: PXRRScreenConfiguration, sizeID: cint,
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
225 nrates: Pcint): ptr int16{.cdecl, dynlib: libXrandr, importc.}
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
226 proc XRRConfigCurrentConfiguration*(config: PXRRScreenConfiguration,
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
227 rotation: PRotation): SizeID{.cdecl,
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
228 dynlib: libXrandr, importc.}
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
229 proc XRRConfigCurrentRate*(config: PXRRScreenConfiguration): cshort{.cdecl,
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
230 dynlib: libXrandr, importc.}
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
231 proc XRRRootToScreen*(dpy: PDisplay, root: Window): cint{.cdecl,
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
232 dynlib: libXrandr, importc.}
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
233 #
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
234 # returns the screen configuration for the specified screen; does a lazy
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
235 # evalution to delay getting the information, and caches the result.
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
236 # These routines should be used in preference to XRRGetScreenInfo
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
237 # to avoid unneeded round trips to the X server. These are new
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
238 # in protocol version 0.1.
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
239 #
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
240 proc XRRScreenConfig*(dpy: PDisplay, screen: cint): PXRRScreenConfiguration{.
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
241 cdecl, dynlib: libXrandr, importc.}
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
242 proc XRRConfig*(screen: PScreen): PXRRScreenConfiguration{.cdecl,
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
243 dynlib: libXrandr, importc.}
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
244 proc XRRSelectInput*(dpy: PDisplay, window: Window, mask: cint){.cdecl,
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
245 dynlib: libXrandr, importc.}
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
246 #
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
247 # the following are always safe to call, even if RandR is not implemented
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
248 # on a screen
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
249 #
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
250 proc XRRRotations*(dpy: PDisplay, screen: cint, current_rotation: PRotation): Rotation{.
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
251 cdecl, dynlib: libXrandr, importc.}
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
252 proc XRRSizes*(dpy: PDisplay, screen: cint, nsizes: Pcint): PXRRScreenSize{.
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
253 cdecl, dynlib: libXrandr, importc.}
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
254 proc XRRRates*(dpy: PDisplay, screen: cint, sizeID: cint, nrates: Pcint): ptr int16{.
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
255 cdecl, dynlib: libXrandr, importc.}
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
256 proc XRRTimes*(dpy: PDisplay, screen: cint, config_timestamp: PTime): Time{.
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
257 cdecl, dynlib: libXrandr, importc.}
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
258 #
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
259 # intended to take RRScreenChangeNotify, or
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
260 # ConfigureNotify (on the root window)
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
261 # returns 1 if it is an event type it understands, 0 if not
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
262 #
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
263 proc XRRUpdateConfiguration*(event: PXEvent): cint{.cdecl, dynlib: libXrandr,
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
264 importc.}
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
265 # implementation
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
266 proc XRRGetScreenResourcesCurrent*(dpy: PDisplay, win: Window):
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
267 PXRRScreenResources {.cdecl, dynlib: libXrandr, importc.}
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
268 proc XRRFreeScreenResources*(res: PXRRScreenResources) {.cdecl,
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
269 dynlib: libXrandr, importc.}
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
270 proc XRRGetOutputInfo*(dpy: PDisplay, res: PXRRScreenResources, ret: RROutput):
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
271 PXRROutputInfo {.cdecl, dynlib: libXrandr, importc.}
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
272 proc XRRFreeOutputInfo*(info: PXRROutputInfo) {.cdecl, dynlib: libXrandr,
239adab121a3 sync from bedroom to office
sam <sam@basx.dev>
parents:
diff changeset
273 importc.}