Commit 069b9d1
authored
Unify Windows message handling APIs in
* refactor: Eliminates the alias `LRESULT = LPLONG` by directly importing `LPLONG` as `LRESULT` from `ctypes.wintypes`.
* refactor: Streamline `test_eventinterface.py` imports by using `ctypes.wintypes.MSG`
- Removes redundant `POINT` and `MSG` structure definitions.
- Directly imports `MSG` from `ctypes.wintypes`, simplifying the import statements.
- Reduces boilerplate code and improves consistency by leveraging standard
`wintypes` definitions.
* refactor: Explicitly define WinAPI function signatures in `messageloop.py`.
- Adds `argtypes` and `restype` for `GetMessage`, `TranslateMessage`, and
`DispatchMessage`.
* refactor: Use `POINTER(MSG)` for message function `argtypes` in `messageloop.py`
* refactor: Use `HWND` for window handle in `GetMessage` argtypes in `messageloop.py`
* refactor: Centralize `PeekMessage` in `messageloop.py` and reuse in tests.
- Define `PeekMessage` with `argtypes` and `restype` in `messageloop.py`.
- Update `test_eventinterface.py` and `test_git.py` to use `PeekMessage` and
others from `messageloop`, removing redundant WinAPI definitions.
* refactor: Centralize `PeekMessage` constants in `messageloop.py`.
- Add `PM_NOREMOVE`, `PM_REMOVE`, and `PM_NOYIELD` constants to
`messageloop.py`.
- Update `test_eventinterface.py` and `test_git.py` to import `PM_REMOVE`
from `messageloop`, removing redundant local definitions.messageloop.py. (#932)1 parent 4a1a11a commit 069b9d1
3 files changed
Lines changed: 39 additions & 48 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | | - | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
13 | 19 | | |
14 | 20 | | |
15 | 21 | | |
16 | | - | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
17 | 25 | | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
18 | 29 | | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
19 | 37 | | |
20 | 38 | | |
21 | 39 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
3 | | - | |
| 2 | + | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
6 | 12 | | |
7 | 13 | | |
8 | 14 | | |
| |||
42 | 48 | | |
43 | 49 | | |
44 | 50 | | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | 51 | | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
76 | 52 | | |
77 | | - | |
78 | | - | |
79 | | - | |
80 | | - | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
81 | 56 | | |
82 | 57 | | |
83 | 58 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
22 | 27 | | |
23 | 28 | | |
24 | 29 | | |
25 | 30 | | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
53 | | - | |
54 | 52 | | |
55 | 53 | | |
56 | 54 | | |
| |||
0 commit comments