python-type-stubs/pygame/display.pyi

68 строки
2.4 KiB
Python

from typing import List, Mapping, Optional, Sequence, Tuple, Union
from . import color, math, rect, surface
_Coordinate = Union[Tuple[float, float], List[float], math.Vector2]
_RectValue = Union[
rect.Rect, Union[Tuple[int, int, int, int], List[int]], Union[Tuple[_Coordinate, _Coordinate], List[_Coordinate]],
]
_ColorValue = Union[color.Color, int, Tuple[int, int, int], Tuple[int, int, int, int], List[int]]
class _VidInfo:
hw: int
wm: int
video_mem: int
bitsize: int
bytesize: int
masks: Tuple[int, int, int, int]
shifts: Tuple[int, int, int, int]
losses: Tuple[int, int, int, int]
blit_hw: int
blit_hw_CC: int
blit_hw_A: int
blit_sw: int
blit_sw_CC: int
blit_sw_A: int
current_h: int
current_w: int
def init() -> None: ...
def quit() -> None: ...
def get_init() -> bool: ...
def set_mode(
size: Optional[Union[Tuple[int, int], Sequence[int]]] = ...,
flags: Optional[int] = ...,
depth: Optional[int] = ...,
display: Optional[int] = ...,
vsync: Optional[int] = ...,
) -> surface.Surface: ...
def mode_ok(
size: Union[Sequence[int], Tuple[int, int]],
flags: Optional[int] = ...,
depth: Optional[int] = ...,
display: Optional[int] = ...,
) -> int: ...
def get_surface() -> surface.Surface: ...
def flip() -> None: ...
def update(rectangle: Optional[Union[_RectValue, Sequence[_RectValue]]] = ...) -> None: ...
def get_driver() -> str: ...
def Info() -> _VidInfo: ...
def get_wm_info() -> Mapping[str, int]: ...
def list_modes(depth: Optional[int], flags: Optional[int] = ..., display: Optional[int] = ...) -> List[Tuple[int, int]]: ...
def gl_get_attribute(flag: int) -> int: ...
def gl_set_attribute(flag: int, value: int) -> None: ...
def get_active() -> int: ...
def iconify() -> int: ...
def toggle_fullscreen() -> int: ...
def set_gamma(red: float, green: Optional[float] = ..., blue: Optional[float] = ...) -> int: ...
def set_gamma_ramp(red: Sequence[int], green: Sequence[int], blue: Sequence[int]) -> int: ...
def set_icon(surface: surface.Surface) -> None: ...
def set_caption(title: str, icontitle: Optional[str] = ...) -> None: ...
def get_caption() -> Tuple[str, str]: ...
def set_palette(palette: Sequence[_ColorValue]) -> None: ...
def get_num_displays() -> int: ...
def get_window_size() -> Tuple[int, int]: ...
def get_allow_screensaver() -> bool: ...
def set_allow_screensaver(value: bool) -> None: ...