Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add types for Gdk.Display and Gdk.Monitor #60

Merged
merged 1 commit into from
Jul 15, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
120 changes: 66 additions & 54 deletions gi-stubs/repository/Gdk.pyi
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

from typing import Optional
from typing import Optional, Tuple

from gi.repository import GObject
from gi.repository import GdkPixbuf
Expand Down Expand Up @@ -2529,56 +2529,68 @@ class DeviceTool:
def get_tool_type(*args, **kwargs): ...


class Display:
def beep(*args, **kwargs): ...
def close(*args, **kwargs): ...
def device_is_grabbed(*args, **kwargs): ...
def flush(*args, **kwargs): ...
def get_app_launch_context(*args, **kwargs): ...
class Size(Tuple[int, int]):
width: int
height: int

class Pointer(Tuple[Screen, int, int, ModifierType]):
screen: Screen
x: int
y: int
mask: ModifierType

class Display(GObject.Object):
def beep(self) -> None: ...
def close(self) -> None: ...
def device_is_grabbed(self, device: Device) -> bool: ...
def flush(self) -> None: ...
def get_app_launch_context(self) -> AppLaunchContext: ...
@classmethod
def get_default(cls) -> Optional[Display]: ...
def get_default_cursor_size(*args, **kwargs): ...
def get_default_group(*args, **kwargs): ...
def get_default_screen(*args, **kwargs): ...
def get_default_seat(*args, **kwargs): ...
def get_device_manager(*args, **kwargs): ...
def get_event(*args, **kwargs): ...
def get_maximal_cursor_size(*args, **kwargs): ...
def get_default_cursor_size(self) -> int: ...
def get_default_group(self) -> Window: ...
def get_default_screen(self) -> Screen: ...
def get_default_seat(self) -> Seat: ...
def get_device_manager(self) -> Optional[DeviceManager]: ...
def get_event(self) -> Optional[Event]: ...
def get_maximal_cursor_size(self) -> Size: ...
def get_monitor(self, monitor_num: int) -> Optional[Monitor]: ...
def get_monitor_at_point(*args, **kwargs): ...
def get_monitor_at_window(*args, **kwargs): ...
def get_monitor_at_point(self, x: int, y: int) -> Monitor: ...
def get_monitor_at_window(self, window: Window) -> Monitor: ...
def get_n_monitors(self) -> int: ...
def get_n_screens(*args, **kwargs): ...
def get_name(*args, **kwargs): ...
def get_pointer(*args, **kwargs): ...
def get_n_screens(self) -> int: ...
def get_name(self) -> str: ...
def get_pointer(self) -> Pointer: ...
def get_primary_monitor(self) -> Optional[Monitor]: ...
def get_screen(*args, **kwargs): ...
def get_screen(self, screen_num: int) -> Screen: ...
def get_window_at_pointer(*args, **kwargs): ...
def has_pending(*args, **kwargs): ...
def is_closed(*args, **kwargs): ...
def keyboard_ungrab(*args, **kwargs): ...
def list_devices(*args, **kwargs): ...
def list_seats(*args, **kwargs): ...
def notify_startup_complete(*args, **kwargs): ...
def open(*args, **kwargs): ...
def open_default_libgtk_only(*args, **kwargs): ...
def peek_event(*args, **kwargs): ...
def pointer_is_grabbed(*args, **kwargs): ...
def pointer_ungrab(*args, **kwargs): ...
def put_event(*args, **kwargs): ...
def request_selection_notification(*args, **kwargs): ...
def set_double_click_distance(*args, **kwargs): ...
def set_double_click_time(*args, **kwargs): ...
def store_clipboard(*args, **kwargs): ...
def supports_clipboard_persistence(*args, **kwargs): ...
def supports_composite(*args, **kwargs): ...
def supports_cursor_alpha(*args, **kwargs): ...
def supports_cursor_color(*args, **kwargs): ...
def supports_input_shapes(*args, **kwargs): ...
def supports_selection_notification(*args, **kwargs): ...
def supports_shapes(*args, **kwargs): ...
def sync(*args, **kwargs): ...
def warp_pointer(*args, **kwargs): ...
def has_pending(self) -> bool: ...
def is_closed(self) -> bool: ...
def keyboard_ungrab(self, time: int) -> None: ...
def list_devices(self) -> list[Device]: ...
def list_seats(self) -> list[Seat]: ...
def notify_startup_complete(self, startup_id: str) -> None: ...
@classmethod
def open(cls, display_name: str) -> Optional[Display]: ...
@classmethod
def open_default_libgtk_only(cls) -> Optional[Display]: ...
def peek_event(self) -> Optional[Event]: ...
def pointer_is_grabbed(self) -> bool: ...
def pointer_ungrab(self, time: int) -> None: ...
def put_event(self, event: Event) -> None: ...
def request_selection_notification(self, selection: Atom) -> bool: ...
def set_double_click_distance(self, distance: int) -> None: ...
def set_double_click_time(self, msec: int) -> None: ...
def store_clipboard(self, clipboard_window: Window, time: int, targets: Optional[list[Atom]]) -> None: ...
def supports_clipboard_persistence(self) -> bool: ...
def supports_composite(self) -> bool: ...
def supports_cursor_alpha(self) -> bool: ...
def supports_cursor_color(self) -> bool: ...
def supports_input_shapes(self) -> bool: ...
def supports_selection_notification(self) -> bool: ...
def supports_shapes(self) -> bool: ...
def sync(self) -> None: ...
def warp_pointer(self, screen: Screen, x: int, y: int) -> None: ...


class DisplayManager:
Expand Down Expand Up @@ -3714,18 +3726,18 @@ class KeymapKey:
level: int = ...


class Monitor:
class Monitor(GObject.Object):
def get_display(self) -> Display: ...
def get_geometry(self) -> Rectangle: ...
def get_height_mm(*args, **kwargs): ...
def get_manufacturer(*args, **kwargs): ...
def get_model(*args, **kwargs): ...
def get_refresh_rate(*args, **kwargs): ...
def get_height_mm(self) -> int: ...
def get_manufacturer(self) -> Optional[str]: ...
def get_model(self) -> Optional[str]: ...
def get_refresh_rate(self) -> int: ...
def get_scale_factor(self) -> int: ...
def get_subpixel_layout(*args, **kwargs): ...
def get_width_mm(*args, **kwargs): ...
def get_workarea(*args, **kwargs): ...
def is_primary(*args, **kwargs): ...
def get_subpixel_layout(self) -> SubpixelLayout: ...
def get_width_mm(self) -> int: ...
def get_workarea(self) -> Rectangle: ...
def is_primary(self) -> bool: ...


class Point:
Expand Down