1191
|
1 import x, xlib, xinput
|
|
2
|
|
3 const
|
|
4 libXtst = "libXtst.so(.6|)"
|
|
5
|
|
6 recordName* = "RECORD"
|
|
7 recordMajorVersion* = 1
|
|
8 recordMinorVersion* = 13
|
|
9 recordLowestMajorVersion* = 1
|
|
10 recordLowestMinorVersion* = 12
|
|
11
|
|
12 xRecordBadContext* = 0
|
|
13
|
|
14 recordNumErrors* = xRecordBadContext + 1
|
|
15 recordNumEvents* = 0
|
|
16
|
|
17 xRecordFromServerTime* = 0x01
|
|
18 xRecordFromClientTime* = 0x02
|
|
19 xRecordFromClientSequence* = 0x04
|
|
20
|
|
21 xRecordCurrentClients* = 1
|
|
22 xRecordFutureClients* = 2
|
|
23 xRecordAllClients* = 3
|
|
24
|
|
25 XRecordFromServer* = 0
|
|
26 XRecordFromClient* = 1
|
|
27 XRecordClientStarted* = 2
|
|
28 XRecordClientDied* = 3
|
|
29 XRecordStartOfData* = 4
|
|
30 XRecordEndOfData* = 5
|
|
31
|
|
32 type
|
|
33 PXRecordClientSpec* = ptr XRecordClientSpec
|
|
34 XRecordClientSpec* = culong
|
|
35
|
|
36 PXRecordContext* = ptr XRecordContext
|
|
37 XRecordContext* = culong
|
|
38
|
|
39 PXRecordRange8* = ptr XRecordRange8
|
|
40 XRecordRange8* {.final.} = object
|
|
41 first*: cuchar
|
|
42 last*: cuchar
|
|
43
|
|
44 PXRecordRange16* = ptr XRecordRange16
|
|
45 XRecordRange16* {.final.} = object
|
|
46 first*: cushort
|
|
47 last*: cushort
|
|
48
|
|
49 PXRecordExtRange* = ptr XRecordExtRange
|
|
50 XRecordExtRange* {.final.} = object
|
|
51 ext_major*: XRecordRange8
|
|
52 ext_minor*: XRecordRange16
|
|
53
|
|
54 PXRecordRange* = ptr XRecordRange
|
|
55 XRecordRange* {.final.} = object
|
|
56 core_requests*: XRecordRange8 ## core X requests
|
|
57 core_replies*: XRecordRange8 ## core X replies
|
|
58 ext_requests*: XRecordExtRange ## extension requests
|
|
59 ext_replies*: XRecordExtRange ## extension replies
|
|
60 delivered_events*: XRecordRange8 ## delivered core and ext events
|
|
61 device_events*: XRecordRange8 ## all core and ext device events
|
|
62 errors*: XRecordRange8 ## core X and ext errors
|
|
63 client_started*: XBool ## connection setup reply
|
|
64 client_died*: XBool ## notice of client disconnect
|
|
65
|
|
66 PXRecordClientInfo* = ptr XRecordClientInfo
|
|
67 XRecordClientInfo* {.final.} = object
|
|
68 client*: XRecordClientSpec
|
|
69 nranges*: culong
|
|
70 ranges*: ptr UncheckedArray[XRecordRange]
|
|
71
|
|
72 PXRecordState* = ptr XRecordState
|
|
73 XRecordState* {.final.} = object
|
|
74 enabled*: XBool
|
|
75 datum_flags*: cint
|
|
76 nclients*: culong
|
|
77 client_info*: ptr UncheckedArray[XRecordClientInfo]
|
|
78
|
|
79 PXRecordInterceptData* = ptr XRecordInterceptData
|
|
80 XRecordInterceptData* {.final.} = object
|
|
81 id_base*: XID
|
|
82 server_time*: Time
|
|
83 client_seq*: culong
|
|
84 category*: cint
|
|
85 client_swapped*: XBool
|
|
86 data*: cstring
|
|
87 data_len*: culong ## in 4-byte units
|
|
88
|
|
89 XRecordInterceptProc* = proc (a1: XPointer, a2: PXRecordInterceptData)
|
|
90
|
|
91 {.push cdecl, importc, dynlib: libXtst.}
|
|
92
|
|
93 proc XRecordIdBaseMask*(dpy: PDisplay): XID
|
|
94 proc XRecordQueryVersion*(a1: PDisplay, a2, a3: ptr cint): Status
|
|
95 proc XRecordCreateContext*(a1: PDisplay,
|
|
96 a2: cint, a3: PXRecordClientSpec,
|
|
97 a4: cint, a5: ptr UncheckedArray[XRecordRange],
|
|
98 a6: cint): XRecordContext
|
|
99 proc XRecordAllocRange*: PXRecordRange
|
|
100 proc XRecordRegisterClients*(a1: PDisplay,
|
|
101 a2: XRecordContext,
|
|
102 a3: cint, a4: PXRecordClientSpec,
|
|
103 a5: cint, a6: ptr UncheckedArray[XRecordRange],
|
|
104 a7: cint): Status
|
|
105 proc XRecordUnregisterClients*(a1: PDisplay,
|
|
106 a2: XRecordContext,
|
|
107 a3: PXRecordClientSpec,
|
|
108 a4: cint): Status
|
|
109 proc XRecordGetContext*(a1: PDisplay,
|
|
110 a2: XRecordContext,
|
|
111 a3: ptr UncheckedArray[XRecordState]): Status
|
|
112 proc XRecordFreeState*(a1: PXRecordState)
|
|
113 proc XRecordEnableContext*(a1: PDisplay,
|
|
114 a2: XRecordContext,
|
|
115 a3: XRecordInterceptProc,
|
|
116 a4: XPointer): Status
|
|
117 proc XRecordEnableContextAsync*(a1: PDisplay, a2: XRecordContext,
|
|
118 a3: XRecordInterceptProc,
|
|
119 a4: XPointer): Status
|
|
120 proc XRecordProcessReplies*(a1: PDisplay)
|
|
121 proc XRecordFreeData*(a1: PXRecordInterceptData)
|
|
122 proc XRecordDisableContext*(a1: PDisplay, a2: XRecordContext): Status
|
|
123 proc XRecordFreeContext*(a1: PDisplay, a2: XRecordContext): Status
|
|
124 proc XTestQueryExtension*(a1: PDisplay, a2, a3, a4, a5: ptr cint): XBool
|
|
125 proc XTestCompareCursorWithWindow*(a1: PDisplay, a2: Window, a3: Cursor): XBool
|
|
126 proc XTestCompareCurrentCursorWithWindow*(a1: PDisplay, a2: Window): XBool
|
|
127 proc XTestFakeKeyEvent*(a1: PDisplay, a2: cuint, a3: XBool, a4: culong): cint
|
|
128 proc XTestFakeButtonEvent*(a1: PDisplay, a2: cuint, a3: XBool, a4: culong): cint
|
|
129 proc XTestFakeMotionEvent*(a1: PDisplay, a2, a3, a4: cint, a5: culong): cint
|
|
130 proc XTestFakeRelativeMotionEvent*(a1: PDisplay, a2, a3: cint, a4: culong): cint
|
|
131 proc XTestFakeDeviceKeyEvent*(a1: PDisplay, a2: PXDevice, a3: cuint, a4: XBool,
|
|
132 a5: ptr cint, a6: cint, a7: culong): cint
|
|
133 proc XTestFakeDeviceButtonEvent*(a1: PDisplay, a2: PXDevice, a3: cuint, a4: XBool,
|
|
134 a5: ptr cint, a6: cint, a7: culong): cint
|
|
135 proc XTestFakeProximityEvent*(a1: PDisplay, a2: PXDevice, a3: XBool, a4: ptr cint,
|
|
136 a5: cint, a6: culong): cint
|
|
137 proc XTestFakeDeviceMotionEvent*(a1: PDisplay, a2: PXDevice, a3: XBool, a4: cint,
|
|
138 a5: ptr cint, a6: cint, a7: culong): cint
|
|
139 proc XTestGrabControl*(a1: PDisplay, a2: XBool): cint
|
|
140 proc XTestSetGContextOfGC*(a1: GC, a2: GContext)
|
|
141 proc XTestSetVisualIDOfVisual*(a1: PVisual, a2: VisualID)
|
|
142 proc XTestDiscard*(a1: PDisplay): Status
|
|
143
|
|
144 {.pop.}
|