Skip to content

Commit

Permalink
Use wintypes.RECT as base for RECT
Browse files Browse the repository at this point in the history
  • Loading branch information
CristiFati authored and matham committed Jul 21, 2019
1 parent 4786f5e commit 13bf1f2
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions kivy/input/providers/wm_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,18 +57,12 @@

if 'KIVY_DOC' not in os.environ:
from ctypes.wintypes import (ULONG, HANDLE, DWORD, LONG, UINT,
WPARAM, LPARAM, BOOL, HWND)
WPARAM, LPARAM, BOOL, HWND, RECT as RECT_BASE)
from ctypes import (windll, WINFUNCTYPE, POINTER,
c_int, c_longlong, c_void_p, Structure,
sizeof, byref, cast)

class RECT(Structure):
_fields_ = [
('left', LONG),
('top', LONG),
('right', LONG),
('bottom', LONG)]

class RECT(RECT_BASE):
x = property(lambda self: self.left)
y = property(lambda self: self.top)
w = property(lambda self: self.right - self.left)
Expand Down Expand Up @@ -141,9 +135,9 @@ def _closure(hWnd, wndProc):
windll.user32.GetMessageExtraInfo.restype = LPARAM
windll.user32.GetMessageExtraInfo.argtypes = []
windll.user32.GetClientRect.restype = BOOL
windll.user32.GetClientRect.argtypes = [HANDLE, POINTER(RECT)]
windll.user32.GetClientRect.argtypes = [HANDLE, POINTER(RECT_BASE)]
windll.user32.GetWindowRect.restype = BOOL
windll.user32.GetWindowRect.argtypes = [HANDLE, POINTER(RECT)]
windll.user32.GetWindowRect.argtypes = [HANDLE, POINTER(RECT_BASE)]
windll.user32.CallWindowProcW.restype = LRESULT
windll.user32.CallWindowProcW.argtypes = [WNDPROC, HANDLE, UINT, WPARAM,
LPARAM]
Expand Down

0 comments on commit 13bf1f2

Please sign in to comment.