from typing import Optional, Union
from typing_extensions import deprecated # added in 3.13

from pygame.typing import Point, RectLike
from pygame.locals import WINDOWPOS_UNDEFINED
from pygame.rect import Rect
from pygame.surface import Surface

def get_grabbed_window() -> Optional[Window]: ...

class Window:
    def __init__(
        self,
        title: str = "pygame window",
        size: Point = (640, 480),
        position: Union[int, Point] = WINDOWPOS_UNDEFINED,
        *,
        fullscreen: bool = ...,
        fullscreen_desktop: bool = ...,
        opengl: bool = ...,
        vulkan: bool = ...,
        hidden: bool = ...,
        borderless: bool = ...,
        resizable: bool = ...,
        minimized: bool = ...,
        maximized: bool = ...,
        mouse_grabbed: bool = ...,
        keyboard_grabbed: bool = ...,
        input_focus: bool = ...,
        mouse_focus: bool = ...,
        allow_high_dpi: bool = ...,
        mouse_capture: bool = ...,
        always_on_top: bool = ...,
        utility: bool = ...,
    ) -> None: ...
    def destroy(self) -> None: ...
    def set_windowed(self) -> None: ...
    def set_fullscreen(self, desktop: bool = False) -> None: ...
    def focus(self, input_only: bool = False) -> None: ...
    def hide(self) -> None: ...
    def show(self) -> None: ...
    def restore(self) -> None: ...
    def maximize(self) -> None: ...
    def minimize(self) -> None: ...
    def set_modal_for(self, parent: Window, /) -> None: ...
    def set_icon(self, icon: Surface, /) -> None: ...
    def get_surface(self) -> Surface: ...
    def flip(self) -> None: ...
    def flash(self, operation: int, /) -> None: ...

    grab_mouse: bool
    grab_keyboard: bool
    title: str
    resizable: bool
    borderless: bool
    always_on_top: bool
    relative_mouse: bool
    opacity: float

    @property
    def mouse_grabbed(self) -> bool: ...
    @property
    def keyboard_grabbed(self) -> bool: ...
    @property
    def focused(self) -> bool: ...
    @property
    def id(self) -> int: ...
    @property
    def mouse_rect(self) -> Optional[Rect]: ...
    @mouse_rect.setter
    def mouse_rect(self, value: Optional[RectLike]) -> None: ...
    @property
    def size(self) -> tuple[int, int]: ...
    @size.setter
    def size(self, value: Point) -> None: ...
    @property
    def minimum_size(self) -> tuple[int, int]: ...
    @minimum_size.setter
    def minimum_size(self, value: Point) -> None: ...
    @property
    def maximum_size(self) -> tuple[int, int]: ...
    @maximum_size.setter
    def maximum_size(self, value: Point) -> None: ...
    @property
    def position(self) -> tuple[int, int]: ...
    @position.setter
    def position(self, value: Union[int, Point]) -> None: ...
    @property
    def opengl(self) -> bool: ...
    @property
    def utility(self) -> bool: ...
    @classmethod
    @deprecated("since 2.4.0. Use either the display module or the Window class with get_surface and flip. Try not to mix display and Window")
    def from_display_module(cls) -> Window: ...
