-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
core: window: implement get_window_info()
This commit implements a method for getting platform specific window information from Kivy window providers. Platform specific window system information is useful for programatically acquiring a handle to the Kivy window. When unable to retrieve windowing subsystem information, the function returns `None`. Currently, only the SDL2 window provider actually implements the function, using SDL_GetWindowWMInfo. The implementation only returns information for Linux (X11/Wayland) and Windows.
- Loading branch information
Showing
6 changed files
with
103 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
include 'window_attrs.pxi' | ||
|
||
from libc.stdint cimport uintptr_t | ||
|
||
IF UNAME_SYSNAME == 'Linux': | ||
cdef class WindowInfoWayland: | ||
cdef wl_display *display | ||
cdef wl_surface *surface | ||
cdef wl_shell_surface *shell_surface | ||
|
||
cdef class WindowInfoX11: | ||
cdef Display *display | ||
cdef Window window | ||
|
||
IF UNAME_SYSNAME == 'Windows': | ||
cdef class WindowInfoWindows: | ||
cdef HWND hwnd | ||
cdef HDC hdc | ||
cdef HINSTANCE hinstance |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
IF UNAME_SYSNAME == 'Linux': | ||
cdef class WindowInfoWayland: | ||
@property | ||
def display(self): | ||
return <uintptr_t>self.display | ||
|
||
@property | ||
def surface(self): | ||
return <uintptr_t>self.surface | ||
|
||
@property | ||
def shell_surface(self): | ||
return <uintptr_t>self.shell_surface | ||
|
||
|
||
cdef class WindowInfoX11: | ||
@property | ||
def display(self): | ||
return <uintptr_t>self.display | ||
|
||
@property | ||
def window(self): | ||
return <uintptr_t>self.window | ||
|
||
IF UNAME_SYSNAME == 'Windows': | ||
cdef class WindowInfoWindows: | ||
@property | ||
def hwnd(self): | ||
return <uintptr_t>self.hwnd | ||
|
||
@property | ||
def hdc(self): | ||
return <uintptr_t>self.hdc | ||
|
||
@property | ||
def hinstance(self): | ||
return <uintptr_t>self.hinstance |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters