cutienator 0.0.1.dev0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. cutienator/__init__.py +44 -0
  2. cutienator/_cpp_addr.py +84 -0
  3. cutienator/_cpp_box.py +23 -0
  4. cutienator/_cute_load_hook.py +159 -0
  5. cutienator/_cute_mixin.py +166 -0
  6. cutienator/_cute_overload.py +285 -0
  7. cutienator/_cute_space.py +727 -0
  8. cutienator/_header_descriptor.py +4 -0
  9. cutienator/_meta_cute.py +444 -0
  10. cutienator/_q_binding_storage.py +101 -0
  11. cutienator/_q_event.py +185 -0
  12. cutienator/_q_meta_object.py +118 -0
  13. cutienator/_q_object.py +582 -0
  14. cutienator/_q_thread.py +106 -0
  15. cutienator/_q_widget.py +80 -0
  16. cutienator/_ugly.py +296 -0
  17. cutienator/_wait.py +303 -0
  18. cutienator/_waiting_overload.py +261 -0
  19. cutienator/example/__init__.py +21 -0
  20. cutienator/example/__main__.py +67 -0
  21. cutienator/example/_calls.py +107 -0
  22. cutienator/occult/__init__.py +27 -0
  23. cutienator/occult/__main__.py +50 -0
  24. cutienator/occult/_base_meta_ugly.py +29 -0
  25. cutienator/occult/_build.py +561 -0
  26. cutienator/occult/_cognito_warning.py +35 -0
  27. cutienator/occult/_declaration.py +572 -0
  28. cutienator/occult/_header.py +710 -0
  29. cutienator/occult/_ritual.py +19 -0
  30. cutienator/occult/_rituals.py +594 -0
  31. cutienator/occult/_shared_object.py +292 -0
  32. cutienator/occult/_symbol.py +162 -0
  33. cutienator/occult/rituals/q_event.cpp +70 -0
  34. cutienator/occult/rituals/q_meta_object.cpp +173 -0
  35. cutienator/occult/rituals/q_object.cpp +178 -0
  36. cutienator/trial/__init__.py +25 -0
  37. cutienator/trial/__main__.py +59 -0
  38. cutienator/trial/_judge.py +589 -0
  39. cutienator/trial/_q_object_trials.py +38 -0
  40. cutienator/trial/_trial.py +495 -0
  41. cutienator/trial/_verdict.py +332 -0
  42. cutienator-0.0.1.dev0.dist-info/METADATA +33 -0
  43. cutienator-0.0.1.dev0.dist-info/RECORD +46 -0
  44. cutienator-0.0.1.dev0.dist-info/WHEEL +5 -0
  45. cutienator-0.0.1.dev0.dist-info/licenses/LICENSE +201 -0
  46. cutienator-0.0.1.dev0.dist-info/top_level.txt +1 -0
cutienator/_q_event.py ADDED
@@ -0,0 +1,185 @@
1
+ """
2
+ QEvent binding of the Qt C++, so far with what QObject needs of it.
3
+ """
4
+ # Apache-2.0 license
5
+ # Copyright (c) 2026 Asger Jon Vistisen
6
+ from __future__ import annotations
7
+
8
+ from typing import TYPE_CHECKING
9
+
10
+ from worktoy.dispatch import overload
11
+
12
+ from ._cute_mixin import CuteMixin
13
+ from ._meta_cute import MetaCute
14
+ from ._ugly import Ugly
15
+ from .occult import Rituals
16
+
17
+ if TYPE_CHECKING: # pragma: no cover, no mutate
18
+ from typing import Optional
19
+
20
+
21
+ class QEvent(CuteMixin, metaclass=MetaCute):
22
+ """
23
+ The cute side of Qt's QEvent, so far with what 'QObject' needs of it.
24
+ 'QObject.event' and 'QObject.eventFilter' take one, and a signature can
25
+ only name a cute class.
26
+
27
+ event = QEvent(0) # 0 is Qt's 'QEvent::None'
28
+ QObject().event(event) # False: nothing took it
29
+ event.isAccepted() # True, as Qt makes every event
30
+
31
+ What exists so far
32
+ ------------------
33
+
34
+ - Creation from the number of an event type. Qt's 'QEvent::Type' is an
35
+ enum, and no enum is reflected yet, so the number is passed as it
36
+ is.
37
+ - 'type', 'isAccepted', 'accept' and 'ignore', each reflecting the Qt
38
+ function of the same name through a ritual.
39
+
40
+ What to expect
41
+ --------------
42
+
43
+ - The C++ QEvent is created at the first use, not by 'QEvent(0)'.
44
+ - Nothing deletes the C++ QEvent yet.
45
+ """
46
+
47
+ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
48
+ # STATIC METHODS # # # # # # # # # # # # # # # # # # # # # # # # # # # #
49
+ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
50
+
51
+ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
52
+ # NAMESPACE # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
53
+ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
54
+
55
+ # Class Variables
56
+
57
+ # Fallback Variables
58
+
59
+ # Private Variables
60
+ # The number of the event type given to the constructor.
61
+ __given_type__: Optional[int] = None
62
+
63
+ # Public Variables
64
+
65
+ # Virtual Variables
66
+
67
+ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
68
+ # GETTERS # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
69
+ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
70
+
71
+ def _createUglySide(self, ) -> None:
72
+ """
73
+ Creates the C++ QEvent and the Ugly standing for it.
74
+
75
+ 'CuteMixin' calls this at the first read of 'uglySide'. The C++
76
+ QEvent is created with the type number given to 'QEvent(...)'.
77
+ """
78
+ # QEvent::QEvent(Type type)
79
+ ritualName = 'ritual_ZN6QEventC1ENS_4TypeE'
80
+ ugly = Ugly()
81
+ address = Rituals.call(ritualName, self.__given_type__)
82
+ ugly.setAddress(address)
83
+ ugly.setCuteSide(self)
84
+ self.__ugly_side__ = ugly
85
+
86
+ def type(self) -> int:
87
+ """
88
+ Calls Qt's 'Type QEvent::type() const'.
89
+
90
+ Qt's own words: https://doc.qt.io/qt-6/qevent.html#type
91
+
92
+ Returns
93
+ -------
94
+
95
+ int
96
+ The number of the event type. Qt's 'QEvent::Type' is an enum, and
97
+ no enum is reflected yet.
98
+ """
99
+ # Type QEvent::type() const
100
+ return self.uglySide.call('ritual_ZNK6QEvent4typeEv')
101
+
102
+ def isAccepted(self) -> bool:
103
+ """
104
+ Calls Qt's 'bool QEvent::isAccepted() const'.
105
+
106
+ Qt's own words: https://doc.qt.io/qt-6/qevent.html#accepted-prop
107
+ """
108
+ # bool QEvent::isAccepted() const
109
+ return self.uglySide.call('ritual_ZNK6QEvent10isAcceptedEv')
110
+
111
+ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
112
+ # SETTERS # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
113
+ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
114
+
115
+ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
116
+ # NOTIFIERS # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
117
+ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
118
+
119
+ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
120
+ # Python API # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
121
+ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
122
+
123
+ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
124
+ # CONSTRUCTORS # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
125
+ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
126
+
127
+ @overload(int)
128
+ def __init__(self, eventType: int) -> None:
129
+ """
130
+ Notes the event type for Qt's 'QEvent::QEvent(Type type)', which is
131
+ called at the first use.
132
+
133
+ Qt's own words: https://doc.qt.io/qt-6/qevent.html#QEvent
134
+
135
+ Parameters
136
+ ----------
137
+
138
+ eventType : int
139
+ The number of the event type, as 0 for Qt's 'QEvent::None'.
140
+
141
+ Raises
142
+ ------
143
+
144
+ DispatchException
145
+ Called with anything but one 'int'.
146
+ """
147
+ self.__given_type__ = eventType
148
+
149
+ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
150
+ # DOMAIN SPECIFIC # # # # # # # # # # # # # # # # # # # # # # # # # # # #
151
+ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
152
+
153
+ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
154
+ # OPTIONAL METHODS # # # # # # # # # # # # # # # # # # # # # # # # # # #
155
+ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
156
+
157
+ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
158
+ # REQUIRED METHODS # # # # # # # # # # # # # # # # # # # # # # # # # # #
159
+ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
160
+
161
+ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
162
+ # PARENT METHODS # # # # # # # # # # # # # # # # # # # # # # # # # # # #
163
+ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
164
+
165
+ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
166
+ # PUBLIC METHODS # # # # # # # # # # # # # # # # # # # # # # # # # # # #
167
+ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
168
+
169
+ def accept(self) -> None:
170
+ """
171
+ Calls Qt's 'void QEvent::accept()'.
172
+
173
+ Qt's own words: https://doc.qt.io/qt-6/qevent.html#accept
174
+ """
175
+ # void QEvent::accept()
176
+ self.uglySide.call('ritual_ZN6QEvent6acceptEv')
177
+
178
+ def ignore(self) -> None:
179
+ """
180
+ Calls Qt's 'void QEvent::ignore()'.
181
+
182
+ Qt's own words: https://doc.qt.io/qt-6/qevent.html#ignore
183
+ """
184
+ # void QEvent::ignore()
185
+ self.uglySide.call('ritual_ZN6QEvent6ignoreEv')
@@ -0,0 +1,118 @@
1
+ """
2
+ QMetaObject binding of the Qt C++, so far with one function.
3
+ """
4
+ # Apache-2.0 license
5
+ # Copyright (c) 2026 Asger Jon Vistisen
6
+ from __future__ import annotations
7
+
8
+ from ._cute_mixin import CuteMixin
9
+ from ._meta_cute import MetaCute
10
+
11
+
12
+ class QMetaObject(CuteMixin, metaclass=MetaCute):
13
+ """
14
+ The cute side of Qt's QMetaObject, so far with one function. It exists
15
+ because 'QObject.metaObject()' gives one back, and a cute function can
16
+ only give back an object of a cute class.
17
+
18
+ metaObject = QObject().metaObject()
19
+ metaObject.className() # 'QObject'
20
+
21
+ What exists so far
22
+ ------------------
23
+
24
+ - 'className', reflecting the Qt function of the same name through a
25
+ ritual.
26
+ - None can be made from Python. One comes out of
27
+ 'QObject.metaObject()'.
28
+ """
29
+
30
+ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
31
+ # STATIC METHODS # # # # # # # # # # # # # # # # # # # # # # # # # # # #
32
+ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
33
+
34
+ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
35
+ # NAMESPACE # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
36
+ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
37
+
38
+ # Class Variables
39
+
40
+ # Fallback Variables
41
+
42
+ # Private Variables
43
+
44
+ # Public Variables
45
+
46
+ # Virtual Variables
47
+
48
+ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
49
+ # GETTERS # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
50
+ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
51
+
52
+ def _createUglySide(self, ) -> None:
53
+ """
54
+ Refuses: no ritual makes a C++ QMetaObject yet, so 'QMetaObject()'
55
+ has nothing to stand for. One is given by 'QObject.metaObject()'.
56
+
57
+ Raises
58
+ ------
59
+
60
+ TypeError
61
+ Always.
62
+ """
63
+ infoSpec = """A 'QMetaObject' cannot be made from Python yet: there
64
+ is no ritual for its constructor. One is given by
65
+ 'QObject.metaObject()'."""
66
+ raise TypeError(' '.join(infoSpec.split()))
67
+
68
+ def className(self) -> str:
69
+ """
70
+ Calls Qt's 'const char *QMetaObject::className() const'.
71
+
72
+ Qt's own words: https://doc.qt.io/qt-6/qmetaobject.html#className
73
+
74
+ Returns
75
+ -------
76
+
77
+ str
78
+ The text Qt gave back, as 'QObject'.
79
+ """
80
+ # const char *QMetaObject::className() const
81
+ text = self.uglySide.call('ritual_ZNK11QMetaObject9classNameEv')
82
+ return text.decode()
83
+
84
+ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
85
+ # SETTERS # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
86
+ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
87
+
88
+ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
89
+ # NOTIFIERS # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
90
+ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
91
+
92
+ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
93
+ # Python API # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
94
+ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
95
+
96
+ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
97
+ # CONSTRUCTORS # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
98
+ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
99
+
100
+ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
101
+ # DOMAIN SPECIFIC # # # # # # # # # # # # # # # # # # # # # # # # # # # #
102
+ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
103
+
104
+ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
105
+ # OPTIONAL METHODS # # # # # # # # # # # # # # # # # # # # # # # # # # #
106
+ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
107
+
108
+ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
109
+ # REQUIRED METHODS # # # # # # # # # # # # # # # # # # # # # # # # # # #
110
+ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
111
+
112
+ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
113
+ # PARENT METHODS # # # # # # # # # # # # # # # # # # # # # # # # # # # #
114
+ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
115
+
116
+ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
117
+ # PUBLIC METHODS # # # # # # # # # # # # # # # # # # # # # # # # # # # #
118
+ # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #