Skip to content

Commit ee69f60

Browse files
AvasamAlexWaygood
andauthored
Added complete Xlib stubs (#9279)
Co-authored-by: Alex Waygood <[email protected]>
1 parent 5c3f10e commit ee69f60

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+5878
-0
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Type helpers
2+
Xlib._typing
3+
4+
# __all__ is a map at runtime
5+
# https://github.com/python-xlib/python-xlib/pull/238
6+
Xlib.ext(\.__all__)?
7+
8+
# These will unconditionally fail at runtime
9+
# See: https://github.com/python-xlib/python-xlib/issues/253
10+
Xlib.protocol.rq.DictWrapper.__gt__
11+
Xlib.protocol.rq.DictWrapper.__lt__
12+
Xlib.protocol.rq.Event.__gt__
13+
Xlib.protocol.rq.Event.__lt__
14+
15+
# Default values
16+
Xlib.protocol.display.Display.send_and_recv
17+
# Can be None or str once instanciated
18+
Xlib.protocol.rq.*.structcode
19+
# Should only ever be str once instanciated
20+
Xlib.protocol.rq.*.name
21+
22+
# Structs generate their attributes (@type_check_only)
23+
Xlib.protocol.rq.Struct.__getattr__
24+
25+
# Iteration variable bleed into the global scope
26+
Xlib.protocol.rq.c
27+
# Re-export from tkinter
28+
Xlib.ext.randr.W
29+
# Re-exports from six
30+
Xlib.ext.xinput.integer_types
31+
Xlib.protocol.display.PY3
32+
Xlib.protocol.display.byte2int
33+
Xlib.protocol.rq.PY3
34+
Xlib.protocol.rq.byte2int
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# failed to import, ModuleNotFoundError: No module named 'fcntl'
2+
# https://github.com/python-xlib/python-xlib/pull/217
3+
Xlib.support.unix_connect

stubs/python-xlib/METADATA.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
version = "0.32.*"
2+
requires = ["types-Pillow"]
3+
4+
[tool.stubtest]
5+
ignore_missing_stub = false

stubs/python-xlib/Xlib/X.pyi

Lines changed: 345 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,345 @@
1+
NONE: int
2+
ParentRelative: int
3+
CopyFromParent: int
4+
PointerWindow: int
5+
InputFocus: int
6+
PointerRoot: int
7+
AnyPropertyType: int
8+
AnyKey: int
9+
AnyButton: int
10+
AllTemporary: int
11+
CurrentTime: int
12+
NoSymbol: int
13+
NoEventMask: int
14+
KeyPressMask: int
15+
KeyReleaseMask: int
16+
ButtonPressMask: int
17+
ButtonReleaseMask: int
18+
EnterWindowMask: int
19+
LeaveWindowMask: int
20+
PointerMotionMask: int
21+
PointerMotionHintMask: int
22+
Button1MotionMask: int
23+
Button2MotionMask: int
24+
Button3MotionMask: int
25+
Button4MotionMask: int
26+
Button5MotionMask: int
27+
ButtonMotionMask: int
28+
KeymapStateMask: int
29+
ExposureMask: int
30+
VisibilityChangeMask: int
31+
StructureNotifyMask: int
32+
ResizeRedirectMask: int
33+
SubstructureNotifyMask: int
34+
SubstructureRedirectMask: int
35+
FocusChangeMask: int
36+
PropertyChangeMask: int
37+
ColormapChangeMask: int
38+
OwnerGrabButtonMask: int
39+
KeyPress: int
40+
KeyRelease: int
41+
ButtonPress: int
42+
ButtonRelease: int
43+
MotionNotify: int
44+
EnterNotify: int
45+
LeaveNotify: int
46+
FocusIn: int
47+
FocusOut: int
48+
KeymapNotify: int
49+
Expose: int
50+
GraphicsExpose: int
51+
NoExpose: int
52+
VisibilityNotify: int
53+
CreateNotify: int
54+
DestroyNotify: int
55+
UnmapNotify: int
56+
MapNotify: int
57+
MapRequest: int
58+
ReparentNotify: int
59+
ConfigureNotify: int
60+
ConfigureRequest: int
61+
GravityNotify: int
62+
ResizeRequest: int
63+
CirculateNotify: int
64+
CirculateRequest: int
65+
PropertyNotify: int
66+
SelectionClear: int
67+
SelectionRequest: int
68+
SelectionNotify: int
69+
ColormapNotify: int
70+
ClientMessage: int
71+
MappingNotify: int
72+
LASTEvent: int
73+
ShiftMask: int
74+
LockMask: int
75+
ControlMask: int
76+
Mod1Mask: int
77+
Mod2Mask: int
78+
Mod3Mask: int
79+
Mod4Mask: int
80+
Mod5Mask: int
81+
ShiftMapIndex: int
82+
LockMapIndex: int
83+
ControlMapIndex: int
84+
Mod1MapIndex: int
85+
Mod2MapIndex: int
86+
Mod3MapIndex: int
87+
Mod4MapIndex: int
88+
Mod5MapIndex: int
89+
Button1Mask: int
90+
Button2Mask: int
91+
Button3Mask: int
92+
Button4Mask: int
93+
Button5Mask: int
94+
AnyModifier: int
95+
Button1: int
96+
Button2: int
97+
Button3: int
98+
Button4: int
99+
Button5: int
100+
NotifyNormal: int
101+
NotifyGrab: int
102+
NotifyUngrab: int
103+
NotifyWhileGrabbed: int
104+
NotifyHint: int
105+
NotifyAncestor: int
106+
NotifyVirtual: int
107+
NotifyInferior: int
108+
NotifyNonlinear: int
109+
NotifyNonlinearVirtual: int
110+
NotifyPointer: int
111+
NotifyPointerRoot: int
112+
NotifyDetailNone: int
113+
VisibilityUnobscured: int
114+
VisibilityPartiallyObscured: int
115+
VisibilityFullyObscured: int
116+
PlaceOnTop: int
117+
PlaceOnBottom: int
118+
FamilyInternet: int
119+
FamilyDECnet: int
120+
FamilyChaos: int
121+
FamilyServerInterpreted: int
122+
FamilyInternetV6: int
123+
PropertyNewValue: int
124+
PropertyDelete: int
125+
ColormapUninstalled: int
126+
ColormapInstalled: int
127+
GrabModeSync: int
128+
GrabModeAsync: int
129+
GrabSuccess: int
130+
AlreadyGrabbed: int
131+
GrabInvalidTime: int
132+
GrabNotViewable: int
133+
GrabFrozen: int
134+
AsyncPointer: int
135+
SyncPointer: int
136+
ReplayPointer: int
137+
AsyncKeyboard: int
138+
SyncKeyboard: int
139+
ReplayKeyboard: int
140+
AsyncBoth: int
141+
SyncBoth: int
142+
RevertToNone: int
143+
RevertToPointerRoot: int
144+
RevertToParent: int
145+
Success: int
146+
BadRequest: int
147+
BadValue: int
148+
BadWindow: int
149+
BadPixmap: int
150+
BadAtom: int
151+
BadCursor: int
152+
BadFont: int
153+
BadMatch: int
154+
BadDrawable: int
155+
BadAccess: int
156+
BadAlloc: int
157+
BadColor: int
158+
BadGC: int
159+
BadIDChoice: int
160+
BadName: int
161+
BadLength: int
162+
BadImplementation: int
163+
FirstExtensionError: int
164+
LastExtensionError: int
165+
InputOutput: int
166+
InputOnly: int
167+
CWBackPixmap: int
168+
CWBackPixel: int
169+
CWBorderPixmap: int
170+
CWBorderPixel: int
171+
CWBitGravity: int
172+
CWWinGravity: int
173+
CWBackingStore: int
174+
CWBackingPlanes: int
175+
CWBackingPixel: int
176+
CWOverrideRedirect: int
177+
CWSaveUnder: int
178+
CWEventMask: int
179+
CWDontPropagate: int
180+
CWColormap: int
181+
CWCursor: int
182+
CWX: int
183+
CWY: int
184+
CWWidth: int
185+
CWHeight: int
186+
CWBorderWidth: int
187+
CWSibling: int
188+
CWStackMode: int
189+
ForgetGravity: int
190+
NorthWestGravity: int
191+
NorthGravity: int
192+
NorthEastGravity: int
193+
WestGravity: int
194+
CenterGravity: int
195+
EastGravity: int
196+
SouthWestGravity: int
197+
SouthGravity: int
198+
SouthEastGravity: int
199+
StaticGravity: int
200+
UnmapGravity: int
201+
NotUseful: int
202+
WhenMapped: int
203+
Always: int
204+
IsUnmapped: int
205+
IsUnviewable: int
206+
IsViewable: int
207+
SetModeInsert: int
208+
SetModeDelete: int
209+
DestroyAll: int
210+
RetainPermanent: int
211+
RetainTemporary: int
212+
Above: int
213+
Below: int
214+
TopIf: int
215+
BottomIf: int
216+
Opposite: int
217+
RaiseLowest: int
218+
LowerHighest: int
219+
PropModeReplace: int
220+
PropModePrepend: int
221+
PropModeAppend: int
222+
GXclear: int
223+
GXand: int
224+
GXandReverse: int
225+
GXcopy: int
226+
GXandInverted: int
227+
GXnoop: int
228+
GXxor: int
229+
GXor: int
230+
GXnor: int
231+
GXequiv: int
232+
GXinvert: int
233+
GXorReverse: int
234+
GXcopyInverted: int
235+
GXorInverted: int
236+
GXnand: int
237+
GXset: int
238+
LineSolid: int
239+
LineOnOffDash: int
240+
LineDoubleDash: int
241+
CapNotLast: int
242+
CapButt: int
243+
CapRound: int
244+
CapProjecting: int
245+
JoinMiter: int
246+
JoinRound: int
247+
JoinBevel: int
248+
FillSolid: int
249+
FillTiled: int
250+
FillStippled: int
251+
FillOpaqueStippled: int
252+
EvenOddRule: int
253+
WindingRule: int
254+
ClipByChildren: int
255+
IncludeInferiors: int
256+
Unsorted: int
257+
YSorted: int
258+
YXSorted: int
259+
YXBanded: int
260+
CoordModeOrigin: int
261+
CoordModePrevious: int
262+
Complex: int
263+
Nonconvex: int
264+
Convex: int
265+
ArcChord: int
266+
ArcPieSlice: int
267+
GCFunction: int
268+
GCPlaneMask: int
269+
GCForeground: int
270+
GCBackground: int
271+
GCLineWidth: int
272+
GCLineStyle: int
273+
GCCapStyle: int
274+
GCJoinStyle: int
275+
GCFillStyle: int
276+
GCFillRule: int
277+
GCTile: int
278+
GCStipple: int
279+
GCTileStipXOrigin: int
280+
GCTileStipYOrigin: int
281+
GCFont: int
282+
GCSubwindowMode: int
283+
GCGraphicsExposures: int
284+
GCClipXOrigin: int
285+
GCClipYOrigin: int
286+
GCClipMask: int
287+
GCDashOffset: int
288+
GCDashList: int
289+
GCArcMode: int
290+
GCLastBit: int
291+
FontLeftToRight: int
292+
FontRightToLeft: int
293+
FontChange: int
294+
XYBitmap: int
295+
XYPixmap: int
296+
ZPixmap: int
297+
AllocNone: int
298+
AllocAll: int
299+
DoRed: int
300+
DoGreen: int
301+
DoBlue: int
302+
CursorShape: int
303+
TileShape: int
304+
StippleShape: int
305+
AutoRepeatModeOff: int
306+
AutoRepeatModeOn: int
307+
AutoRepeatModeDefault: int
308+
LedModeOff: int
309+
LedModeOn: int
310+
KBKeyClickPercent: int
311+
KBBellPercent: int
312+
KBBellPitch: int
313+
KBBellDuration: int
314+
KBLed: int
315+
KBLedMode: int
316+
KBKey: int
317+
KBAutoRepeatMode: int
318+
MappingSuccess: int
319+
MappingBusy: int
320+
MappingFailed: int
321+
MappingModifier: int
322+
MappingKeyboard: int
323+
MappingPointer: int
324+
DontPreferBlanking: int
325+
PreferBlanking: int
326+
DefaultBlanking: int
327+
DisableScreenSaver: int
328+
DisableScreenInterval: int
329+
DontAllowExposures: int
330+
AllowExposures: int
331+
DefaultExposures: int
332+
ScreenSaverReset: int
333+
ScreenSaverActive: int
334+
HostInsert: int
335+
HostDelete: int
336+
EnableAccess: int
337+
DisableAccess: int
338+
StaticGray: int
339+
GrayScale: int
340+
StaticColor: int
341+
PseudoColor: int
342+
TrueColor: int
343+
DirectColor: int
344+
LSBFirst: int
345+
MSBFirst: int

stubs/python-xlib/Xlib/XK.pyi

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
from Xlib.keysymdef.latin1 import *
2+
from Xlib.keysymdef.miscellany import *
3+
from Xlib.X import NoSymbol as NoSymbol
4+
5+
def string_to_keysym(keysym: str) -> int: ...
6+
def load_keysym_group(group: str) -> None: ...
7+
def keysym_to_string(keysym: int) -> str | None: ...

0 commit comments

Comments
 (0)