summary refs log tree commit diff stats
path: root/lib/oldwrappers/x11/xrandr.nim
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2010-02-28 23:12:40 +0100
committerAndreas Rumpf <rumpf_a@web.de>2010-02-28 23:12:40 +0100
commitcf56d5ba3eef4d488319666ce62e8026b6419ac4 (patch)
tree0f27ea50244af27e8f3007e703eb4b6ad54d3861 /lib/oldwrappers/x11/xrandr.nim
parentb559285b78bfa76533d25e77f3f61cab2427bb03 (diff)
downloadNim-cf56d5ba3eef4d488319666ce62e8026b6419ac4.tar.gz
added old wrappers
Diffstat (limited to 'lib/oldwrappers/x11/xrandr.nim')
-rw-r--r--lib/oldwrappers/x11/xrandr.nim194
1 files changed, 194 insertions, 0 deletions
diff --git a/lib/oldwrappers/x11/xrandr.nim b/lib/oldwrappers/x11/xrandr.nim
new file mode 100644
index 000000000..ee6f1705b
--- /dev/null
+++ b/lib/oldwrappers/x11/xrandr.nim
@@ -0,0 +1,194 @@
+#
+#  $XFree86: xc/lib/Xrandr/Xrandr.h,v 1.9 2002/09/29 23:39:44 keithp Exp $
+# 
+#  Copyright (C) 2000 Compaq Computer Corporation, Inc.
+#  Copyright (C) 2002 Hewlett-Packard Company, Inc.
+# 
+#  Permission to use, copy, modify, distribute, and sell this software and its
+#  documentation for any purpose is hereby granted without fee, provided that
+#  the above copyright notice appear in all copies and that both that
+#  copyright notice and this permission notice appear in supporting
+#  documentation, and that the name of Compaq not be used in advertising or
+#  publicity pertaining to distribution of the software without specific,
+#  written prior permission.  HP makes no representations about the
+#  suitability of this software for any purpose.  It is provided "as is"
+#  without express or implied warranty.
+# 
+#  HP DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
+#  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL COMPAQ
+#  BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+#  WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
+#  OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 
+#  CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+# 
+#  Author:  Jim Gettys, HP Labs, HP.
+#
+
+import 
+  x, xlib
+
+const 
+  libXrandr* = "libXrandr.so"
+  
+# * $XFree86: xc/include/extensions/randr.h,v 1.4 2001/11/24 07:24:58 keithp Exp $
+# *
+# * Copyright (C) 2000, Compaq Computer Corporation, 
+# * Copyright (C) 2002, Hewlett Packard, Inc.
+# *
+# * Permission to use, copy, modify, distribute, and sell this software and its
+# * documentation for any purpose is hereby granted without fee, provided that
+# * the above copyright notice appear in all copies and that both that
+# * copyright notice and this permission notice appear in supporting
+# * documentation, and that the name of Compaq or HP not be used in advertising
+# * or publicity pertaining to distribution of the software without specific,
+# * written prior permission.  HP makes no representations about the
+# * suitability of this software for any purpose.  It is provided "as is"
+# * without express or implied warranty.
+# *
+# * HP DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
+# * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL HP
+# * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+# * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
+# * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 
+# * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+# *
+# * Author:  Jim Gettys, HP Labs, Hewlett-Packard, Inc.
+# *
+
+type 
+  PRotation* = ptr TRotation
+  TRotation* = cushort
+  PSizeID* = ptr TSizeID
+  TSizeID* = cushort
+  PSubpixelOrder* = ptr TSubpixelOrder
+  TSubpixelOrder* = cushort
+
+const 
+  RANDR_NAME* = "RANDR"
+  RANDR_MAJOR* = 1
+  RANDR_MINOR* = 1
+  RRNumberErrors* = 0
+  RRNumberEvents* = 1
+  constX_RRQueryVersion* = 0 # we skip 1 to make old clients fail pretty immediately 
+  X_RROldGetScreenInfo* = 1
+  X_RR1_0SetScreenConfig* = 2 # V1.0 apps share the same set screen config request id 
+  constX_RRSetScreenConfig* = 2
+  X_RROldScreenChangeSelectInput* = 3 # 3 used to be ScreenChangeSelectInput; deprecated 
+  constX_RRSelectInput* = 4
+  constX_RRGetScreenInfo* = 5      # used in XRRSelectInput 
+  RRScreenChangeNotifyMask* = 1 shl 0
+  RRScreenChangeNotify* = 0   # used in the rotation field; rotation and reflection in 0.1 proto. 
+  RR_Rotate_0* = 1
+  RR_Rotate_90* = 2
+  RR_Rotate_180* = 4
+  RR_Rotate_270* = 8          # new in 1.0 protocol, to allow reflection of screen 
+  RR_Reflect_X* = 16
+  RR_Reflect_Y* = 32
+  RRSetConfigSuccess* = 0
+  RRSetConfigInvalidConfigTime* = 1
+  RRSetConfigInvalidTime* = 2
+  RRSetConfigFailed* = 3
+
+type 
+  PXRRScreenSize* = ptr TXRRScreenSize
+  TXRRScreenSize*{.final.} = object  #
+                                     #   Events.
+                                     #
+    width*, height*: cint
+    mwidth*, mheight*: cint
+
+  TXRRScreenChangeNotifyEvent*{.final.} = object  # internal representation is private to the library 
+    typ*: cint                # event base 
+    serial*: culong           # # of last request processed by server 
+    send_event*: TBool        # true if this came from a SendEvent request 
+    display*: PDisplay        # Display the event was read from 
+    window*: TWindow          # window which selected for this event 
+    root*: TWindow            # Root window for changed screen 
+    timestamp*: TTime         # when the screen change occurred 
+    config_timestamp*: TTime  # when the last configuration change 
+    size_index*: TSizeID
+    subpixel_order*: TSubpixelOrder
+    rotation*: TRotation
+    width*: cint
+    height*: cint
+    mwidth*: cint
+    mheight*: cint
+
+  PXRRScreenConfiguration* = ptr TXRRScreenConfiguration
+  TXRRScreenConfiguration*{.final.} = object 
+
+proc XRRQueryExtension*(dpy: PDisplay, event_basep, error_basep: Pcint): TBool{.
+    cdecl, dynlib: libXrandr, importc.}
+proc XRRQueryVersion*(dpy: PDisplay, major_versionp: Pcint, 
+                      minor_versionp: Pcint): TStatus{.cdecl, dynlib: libXrandr, 
+    importc.}
+proc XRRGetScreenInfo*(dpy: PDisplay, draw: TDrawable): PXRRScreenConfiguration{.
+    cdecl, dynlib: libXrandr, importc.}
+proc XRRFreeScreenConfigInfo*(config: PXRRScreenConfiguration){.cdecl, 
+    dynlib: libXrandr, importc.}
+  #
+  #  Note that screen configuration changes are only permitted if the client can
+  #  prove it has up to date configuration information.  We are trying to
+  #  insist that it become possible for screens to change dynamically, so
+  #  we want to ensure the client knows what it is talking about when requesting
+  #  changes.
+  #
+proc XRRSetScreenConfig*(dpy: PDisplay, config: PXRRScreenConfiguration, 
+                         draw: TDrawable, size_index: cint, rotation: TRotation, 
+                         timestamp: TTime): TStatus{.cdecl, dynlib: libXrandr, 
+    importc.}
+  # added in v1.1, sorry for the lame name 
+proc XRRSetScreenConfigAndRate*(dpy: PDisplay, config: PXRRScreenConfiguration, 
+                                draw: TDrawable, size_index: cint, 
+                                rotation: TRotation, rate: cshort, 
+                                timestamp: TTime): TStatus{.cdecl, 
+    dynlib: libXrandr, importc.}
+proc XRRConfigRotations*(config: PXRRScreenConfiguration, 
+                         current_rotation: PRotation): TRotation{.cdecl, 
+    dynlib: libXrandr, importc.}
+proc XRRConfigTimes*(config: PXRRScreenConfiguration, config_timestamp: PTime): TTime{.
+    cdecl, dynlib: libXrandr, importc.}
+proc XRRConfigSizes*(config: PXRRScreenConfiguration, nsizes: Pcint): PXRRScreenSize{.
+    cdecl, dynlib: libXrandr, importc.}
+proc XRRConfigRates*(config: PXRRScreenConfiguration, sizeID: cint, 
+                     nrates: Pcint): ptr int16{.cdecl, dynlib: libXrandr, importc.}
+proc XRRConfigCurrentConfiguration*(config: PXRRScreenConfiguration, 
+                                    rotation: PRotation): TSizeID{.cdecl, 
+    dynlib: libXrandr, importc.}
+proc XRRConfigCurrentRate*(config: PXRRScreenConfiguration): cshort{.cdecl, 
+    dynlib: libXrandr, importc.}
+proc XRRRootToScreen*(dpy: PDisplay, root: TWindow): cint{.cdecl, 
+    dynlib: libXrandr, importc.}
+  #
+  #  returns the screen configuration for the specified screen; does a lazy
+  #  evalution to delay getting the information, and caches the result.
+  #  These routines should be used in preference to XRRGetScreenInfo
+  #  to avoid unneeded round trips to the X server.  These are new
+  #  in protocol version 0.1.
+  #
+proc XRRScreenConfig*(dpy: PDisplay, screen: cint): PXRRScreenConfiguration{.
+    cdecl, dynlib: libXrandr, importc.}
+proc XRRConfig*(screen: PScreen): PXRRScreenConfiguration{.cdecl, 
+    dynlib: libXrandr, importc.}
+proc XRRSelectInput*(dpy: PDisplay, window: TWindow, mask: cint){.cdecl, 
+    dynlib: libXrandr, importc.}
+  #
+  #  the following are always safe to call, even if RandR is not implemented 
+  #  on a screen 
+  #
+proc XRRRotations*(dpy: PDisplay, screen: cint, current_rotation: PRotation): TRotation{.
+    cdecl, dynlib: libXrandr, importc.}
+proc XRRSizes*(dpy: PDisplay, screen: cint, nsizes: Pcint): PXRRScreenSize{.
+    cdecl, dynlib: libXrandr, importc.}
+proc XRRRates*(dpy: PDisplay, screen: cint, sizeID: cint, nrates: Pcint): ptr int16{.
+    cdecl, dynlib: libXrandr, importc.}
+proc XRRTimes*(dpy: PDisplay, screen: cint, config_timestamp: PTime): TTime{.
+    cdecl, dynlib: libXrandr, importc.}
+  #
+  #  intended to take RRScreenChangeNotify,  or 
+  #  ConfigureNotify (on the root window)
+  #  returns 1 if it is an event type it understands, 0 if not
+  #
+proc XRRUpdateConfiguration*(event: PXEvent): cint{.cdecl, dynlib: libXrandr, 
+    importc.}
+# implementation
6352b2d3af3652263a536acbd2702e'>b1ddb414 ^
6b2f2ed3 ^


7a84094a ^
6b2f2ed3 ^


5f05e954 ^
e3cb4d09 ^
42eeea1d ^



5f05e954 ^
d3902ff0 ^
e3cb4d09 ^




17b90929 ^
436b2b2e ^



e3cb4d09 ^


b1ddb414 ^




e3cb4d09 ^


b1ddb414 ^
e3cb4d09 ^


b1ddb414 ^
6b2f2ed3 ^
b1ddb414 ^



c78bc9bd ^
b1ddb414 ^
c78bc9bd ^
b1ddb414 ^





f3760b0f ^
795f5244 ^
12f304a3 ^
b1ddb414 ^



6b2f2ed3 ^
b24eb476 ^
08cf048f ^
e3cb4d09 ^
6b2f2ed3 ^



555d95c1 ^
6b2f2ed3 ^


b1ddb414 ^
6b2f2ed3 ^
b1ddb414 ^
e3cb4d09 ^
b1ddb414 ^






6c96a437 ^
b1ddb414 ^

e3cb4d09 ^
b1ddb414 ^
e3cb4d09 ^

715806ca ^
e3cb4d09 ^
968866f7 ^
c4e143d6 ^



555d95c1 ^
e3cb4d09 ^



795f5244 ^
e3cb4d09 ^

3965ca03 ^


7a84094a ^
3965ca03 ^
1ead3562 ^
7a84094a ^
3965ca03 ^


75ab8732 ^
3965ca03 ^

75ab8732 ^
3965ca03 ^


75ab8732 ^
3965ca03 ^

75ab8732 ^

4c569925 ^
3965ca03 ^
17b90929 ^
a4f12265 ^

7a84094a ^
a4f12265 ^
1ead3562 ^
a4f12265 ^
7a84094a ^
a4f12265 ^


17b90929 ^
a09697d0 ^

7a84094a ^
a09697d0 ^
1ead3562 ^
a09697d0 ^





17b90929 ^
7637d1ac ^

7a84094a ^
7637d1ac ^
1ead3562 ^
760f683f ^

7637d1ac ^
b0bf5321 ^
7637d1ac ^
d4dea9bd ^


7a84094a ^
d4dea9bd ^


7a84094a ^
d4dea9bd ^
1ead3562 ^
d4dea9bd ^
7a84094a ^
d4dea9bd ^


452086e3 ^




1ead3562 ^
7c9def3c ^


d52406cc ^
452086e3 ^


a09697d0 ^
3377364a ^
af023b32 ^



8dede22e ^
8e1c4783 ^
b5606419 ^
5052a6ff ^
3377364a ^






a09697d0 ^

3377364a ^

f890f147 ^

3377364a ^
a09697d0 ^






af023b32 ^
a09697d0 ^


4f3d9065 ^
c4e143d6 ^
5d4a1d3b ^
a09697d0 ^
af023b32 ^




d59554f5 ^
b24eb476 ^
d59554f5 ^
1b76245c ^
d59554f5 ^

af023b32 ^

d59554f5 ^
af023b32 ^


6c96a437 ^
af023b32 ^



d59554f5 ^
af023b32 ^




cd85ca3c ^

b24eb476 ^
cd85ca3c ^



a09697d0 ^
cd85ca3c ^
a09697d0 ^

4ea9905f ^
fbc3455b ^
07ca5691 ^

7a84094a ^
07ca5691 ^

471839da ^
84c9e3cf ^
07ca5691 ^

fbc3455b ^
07ca5691 ^






471839da ^
84c9e3cf ^
07ca5691 ^

fbc3455b ^
07ca5691 ^





b0bf5321 ^
471839da ^
84c9e3cf ^
07ca5691 ^

fbc3455b ^
07ca5691 ^



7a84094a ^
07ca5691 ^

471839da ^
84c9e3cf ^
07ca5691 ^






b0bf5321 ^
471839da ^
84c9e3cf ^
471839da ^
84c9e3cf ^
07ca5691 ^







b0bf5321 ^
471839da ^
84c9e3cf ^
471839da ^
84c9e3cf ^
471839da ^
84c9e3cf ^
07ca5691 ^

4f3d9065 ^




b0bf5321 ^
471839da ^
84c9e3cf ^
4f3d9065 ^



a0331a9b ^
4f3d9065 ^





b0bf5321 ^
471839da ^
84c9e3cf ^
4f3d9065 ^

4ea9905f ^
b24eb476 ^
5d4a1d3b ^
3c163ef7 ^
5d4a1d3b ^



17b90929 ^
5d4a1d3b ^


7a84094a ^
5d4a1d3b ^
1ead3562 ^
5d4a1d3b ^
7a84094a ^
5d4a1d3b ^
c4e143d6 ^
5d4a1d3b ^
af023b32 ^




















7a84094a ^
af023b32 ^








7a84094a ^
af023b32 ^




7a84094a ^
af023b32 ^





7a84094a ^
af023b32 ^

760f683f ^
af023b32 ^









7a84094a ^
760f683f ^
af023b32 ^
7a84094a ^
af023b32 ^


















7a84094a ^
af023b32 ^

760f683f ^
af023b32 ^












7a84094a ^
af023b32 ^





760f683f ^
af023b32 ^















5ba1c3b9 ^

5ba1c3b9 ^
7a84094a ^
5ba1c3b9 ^


7a84094a ^

5ba1c3b9 ^
1ead3562 ^
5ba1c3b9 ^









7a84094a ^
5ba1c3b9 ^


7a84094a ^

5ba1c3b9 ^
1ead3562 ^
5ba1c3b9 ^




5ba1c3b9 ^
7a84094a ^
5ba1c3b9 ^


7a84094a ^

5ba1c3b9 ^
1ead3562 ^
5ba1c3b9 ^







5ba1c3b9 ^
7a84094a ^
5ba1c3b9 ^


7a84094a ^

5ba1c3b9 ^
1ead3562 ^
5ba1c3b9 ^






7a84094a ^
5ba1c3b9 ^


7a84094a ^

5ba1c3b9 ^
1ead3562 ^
5ba1c3b9 ^





8e1c4783 ^
9dcbec39 ^
8e1c4783 ^
5ba1c3b9 ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690