├── pep517backend ├── __init__.py └── backend.py ├── src ├── gi-stubs │ ├── repository │ │ ├── __init__.pyi │ │ ├── win32.pyi │ │ ├── GlyGtk4.pyi │ │ ├── XdpGtk4.pyi │ │ ├── DBusGLib.pyi │ │ ├── DBus.pyi │ │ ├── GModule.pyi │ │ ├── GLibWin32.pyi │ │ ├── Manette.pyi │ │ ├── PangoCairo.pyi │ │ ├── GioWin32.pyi │ │ ├── _GdkWin323.pyi │ │ ├── GSound.pyi │ │ ├── Notify.pyi │ │ ├── Gspell.pyi │ │ ├── _GdkWin324.pyi │ │ ├── Rsvg.pyi │ │ ├── Spelling.pyi │ │ ├── AyatanaAppIndicator3.pyi │ │ ├── AppIndicator3.pyi │ │ ├── Farstream.pyi │ │ ├── Gly.pyi │ │ ├── GExiv2.pyi │ │ ├── GdkWayland.pyi │ │ ├── GioUnix.pyi │ │ ├── GdkX11.pyi │ │ ├── GstApp.pyi │ │ └── _JavaScriptCore6.pyi │ ├── overrides │ │ └── __init__.pyi │ ├── __init__.pyi │ └── events.pyi └── meson.build ├── MANIFEST.in ├── meson.build ├── tools ├── meson.build ├── bump_version.py ├── update_all.py └── parse.py ├── .github └── workflows │ ├── lint.yml │ ├── codespell.yml │ └── publish.yml ├── .gitignore ├── .pre-commit-config.yaml ├── .chglog ├── CHANGELOG.tpl.md └── config.yml ├── README.md ├── CONTRIBUTING.md ├── pyproject.toml └── CHANGELOG.md /pep517backend/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /src/gi-stubs/repository/__init__.pyi: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | include CHANGELOG.md 2 | recursive-include pep517backend * 3 | prune */__pycache__ 4 | -------------------------------------------------------------------------------- /src/gi-stubs/overrides/__init__.pyi: -------------------------------------------------------------------------------- 1 | import typing 2 | 3 | def override(_type: typing.Type) -> typing.Type: ... 4 | -------------------------------------------------------------------------------- /src/meson.build: -------------------------------------------------------------------------------- 1 | python_mod = import('python').find_installation() 2 | install_dir = python_mod.get_install_dir() 3 | install_subdir('gi-stubs', install_dir: install_dir) 4 | -------------------------------------------------------------------------------- /meson.build: -------------------------------------------------------------------------------- 1 | project('pygobject-stubs', 2 | version: '2.16.0', 3 | license: 'LGPL-2.1-or-later', 4 | meson_version: '>=1.0.0', 5 | ) 6 | 7 | subdir('src') 8 | subdir('tools') 9 | -------------------------------------------------------------------------------- /tools/meson.build: -------------------------------------------------------------------------------- 1 | generate = find_program('generate.py') 2 | meson.override_find_program('pygi_stubs_generate', generate) 3 | 4 | update_all = find_program('update_all.py') 5 | run_target('update-stubs', command: [update_all]) 6 | -------------------------------------------------------------------------------- /src/gi-stubs/repository/win32.pyi: -------------------------------------------------------------------------------- 1 | import typing 2 | 3 | from gi.repository import GObject 4 | 5 | T = typing.TypeVar("T") 6 | 7 | _lock = ... # FIXME Constant 8 | _namespace: str = "win32" 9 | _version: str = "1.0" 10 | 11 | class MSG(GObject.GPointer): ... 12 | -------------------------------------------------------------------------------- /.github/workflows/lint.yml: -------------------------------------------------------------------------------- 1 | name: Lint 2 | 3 | on: [push, pull_request] 4 | 5 | jobs: 6 | lint: 7 | runs-on: ubuntu-latest 8 | steps: 9 | - uses: actions/checkout@v4 10 | - uses: isort/isort-action@v1 11 | - uses: astral-sh/ruff-action@v3 12 | - run: ruff format 13 | -------------------------------------------------------------------------------- /src/gi-stubs/repository/GlyGtk4.pyi: -------------------------------------------------------------------------------- 1 | import typing 2 | 3 | from gi.repository import Gdk 4 | from gi.repository import Gly 5 | 6 | T = typing.TypeVar("T") 7 | 8 | _lock = ... # FIXME Constant 9 | _namespace: str = "GlyGtk4" 10 | _version: str = "2" 11 | 12 | def frame_get_texture(frame: Gly.Frame) -> Gdk.Texture: ... 13 | -------------------------------------------------------------------------------- /src/gi-stubs/repository/XdpGtk4.pyi: -------------------------------------------------------------------------------- 1 | import typing 2 | 3 | from gi.repository import Gtk 4 | from gi.repository import Xdp 5 | 6 | T = typing.TypeVar("T") 7 | 8 | _lock = ... # FIXME Constant 9 | _namespace: str = "XdpGtk4" 10 | _version: str = "1.0" 11 | 12 | def parent_new_gtk(window: Gtk.Window) -> Xdp.Parent: ... 13 | -------------------------------------------------------------------------------- /src/gi-stubs/repository/DBusGLib.pyi: -------------------------------------------------------------------------------- 1 | import typing 2 | 3 | from gi.repository import GObject 4 | from typing_extensions import Self 5 | 6 | T = typing.TypeVar("T") 7 | 8 | class Connection(GObject.GPointer): ... 9 | class MethodInvocation(GObject.GPointer): ... 10 | class Proxy(GObject.Object): ... 11 | class ProxyClass(GObject.GPointer): ... 12 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.pyc 2 | .mypy_cache 3 | .ruff_cache 4 | MANIFEST 5 | build 6 | dist 7 | *.egg-info 8 | *.sublime-* 9 | *.vscode 10 | *.venv 11 | 12 | src/gi-stubs/repository/Gdk.pyi 13 | src/gi-stubs/repository/GdkWin32.pyi 14 | src/gi-stubs/repository/GIRepository.pyi 15 | src/gi-stubs/repository/Gtk.pyi 16 | src/gi-stubs/repository/GtkSource.pyi 17 | src/gi-stubs/repository/JavaScriptCore.pyi 18 | src/gi-stubs/repository/Soup.pyi 19 | src/gi-stubs/repository/WebKit.pyi 20 | -------------------------------------------------------------------------------- /src/gi-stubs/repository/DBus.pyi: -------------------------------------------------------------------------------- 1 | import typing 2 | 3 | from gi.repository import GObject 4 | from typing_extensions import Self 5 | 6 | T = typing.TypeVar("T") 7 | 8 | class Connection(GObject.GPointer): ... 9 | class Error(GObject.GPointer): ... 10 | class Message(GObject.GPointer): ... 11 | class MessageIter(GObject.GPointer): ... 12 | class PendingCall(GObject.GPointer): ... 13 | 14 | class BusType(GObject.GEnum): 15 | SESSION = 0 16 | STARTER = 2 17 | SYSTEM = 1 18 | -------------------------------------------------------------------------------- /.pre-commit-config.yaml: -------------------------------------------------------------------------------- 1 | repos: 2 | - repo: https://github.com/codespell-project/codespell 3 | rev: v2.4.1 4 | hooks: 5 | - id: codespell 6 | pass_filenames: false 7 | additional_dependencies: 8 | - tomli 9 | 10 | - repo: https://github.com/pycqa/isort 11 | rev: 6.0.1 12 | hooks: 13 | - id: isort 14 | 15 | - repo: https://github.com/astral-sh/ruff-pre-commit 16 | rev: v0.12.7 17 | hooks: 18 | - id: ruff-check 19 | - id: ruff-format 20 | -------------------------------------------------------------------------------- /src/gi-stubs/__init__.pyi: -------------------------------------------------------------------------------- 1 | import typing 2 | 3 | __version__: str 4 | version_info: typing.Tuple[int, int, int] 5 | 6 | def check_version(version: str) -> None: ... 7 | def require_version(namespace: str, version: str) -> None: ... 8 | def require_versions(versions: dict[str, str]) -> None: ... 9 | def get_required_version(namespace: str) -> typing.Optional[str]: ... 10 | def require_foreign(namespace: str, symbol: typing.Optional[str] = None) -> None: ... 11 | def get_option(name: str) -> bool: ... 12 | def disable_legacy_autoinit() -> None: ... 13 | -------------------------------------------------------------------------------- /.chglog/CHANGELOG.tpl.md: -------------------------------------------------------------------------------- 1 | {{ range .Versions }} 2 | # {{ .Tag.Name }} ({{ datetime "02 Jan 2006" .Tag.Date }}) 3 | 4 | {{ range .CommitGroups -}} 5 | {{ if .Title }}## {{ .Title }}{{end}} 6 | 7 | {{ range .Commits -}} 8 | {{ if .Subject }}* {{ .Subject }}{{end}}{{if .Refs}} ({{range .Refs}}#{{.Ref}}{{end}}){{end}} 9 | {{ end }} 10 | {{ end -}} 11 | 12 | {{- if .NoteGroups -}} 13 | {{ range .NoteGroups -}} 14 | {{ .Title }} 15 | {{ range .Notes }} 16 | {{ .Body }} 17 | {{ end }} 18 | {{ end -}} 19 | {{ end -}} 20 | 21 | {{break}} 22 | 23 | {{ end -}} 24 | -------------------------------------------------------------------------------- /.github/workflows/codespell.yml: -------------------------------------------------------------------------------- 1 | name: Codespell 2 | 3 | on: [push, pull_request] 4 | 5 | jobs: 6 | codespell: 7 | runs-on: ubuntu-latest 8 | steps: 9 | - uses: actions/checkout@v4 10 | - name: Set up Python 11 | uses: actions/setup-python@v5 12 | with: 13 | python-version: '3.x' 14 | 15 | - name: Install dependencies 16 | run: | 17 | python -m pip install --upgrade pip 18 | pip install codespell==2.4.1 19 | pip install tomli 20 | 21 | - name: Run Codespell 22 | run: | 23 | codespell || exit 24 | -------------------------------------------------------------------------------- /.chglog/config.yml: -------------------------------------------------------------------------------- 1 | style: gitlab 2 | template: CHANGELOG.tpl.md 3 | info: 4 | title: CHANGELOG 5 | repository_url: https://github.com/pygobject/pygobject-stubs 6 | options: 7 | commits: 8 | filters: 9 | Type: 10 | - feat 11 | - imprv 12 | - typing 13 | - change 14 | - fix 15 | commit_groups: 16 | sort_by: Custom 17 | title_order: 18 | - feat 19 | - imprv 20 | - typing 21 | - change 22 | - fix 23 | title_maps: 24 | feat: Feature 25 | imprv: Improvements 26 | typing: Typing 27 | change: Change 28 | fix: Bug Fixes 29 | header: 30 | pattern: "^(\\w*)\\:\\s(.*)$" 31 | pattern_maps: 32 | - Type 33 | - Subject 34 | issues: 35 | prefix: 36 | - "#" 37 | refs: 38 | actions: 39 | - Fixes 40 | notes: 41 | keywords: 42 | - NOTES 43 | -------------------------------------------------------------------------------- /src/gi-stubs/events.pyi: -------------------------------------------------------------------------------- 1 | import typing 2 | 3 | from signal import Signals 4 | 5 | from gi.repository import GLib 6 | 7 | class GLibTask: 8 | def __init__(self, *args: typing.Any, **kwargs: typing.Any) -> None: ... 9 | def set_priority(self, priority: int) -> None: ... 10 | def get_priority(self) -> int: ... 11 | 12 | class GLibEventLoop: 13 | def __init__(self, main_context: GLib.MainContext) -> None: ... 14 | def add_signal_handler( 15 | self, 16 | sig: Signals, 17 | callback: typing.Callable[..., typing.Any], 18 | *args: typing.Any, 19 | ) -> None: ... 20 | def remove_signal_handler(self, sig: Signals) -> bool: ... 21 | def close(self) -> None: ... 22 | 23 | class GLibEventLoopPolicy: 24 | def __init__(self) -> None: ... 25 | def get_event_loop(self) -> GLibEventLoop: ... 26 | def get_event_loop_for_context(self, ctx: GLib.MainContext) -> GLibEventLoop: ... 27 | def set_event_loop(self, loop: GLibEventLoop) -> None: ... 28 | -------------------------------------------------------------------------------- /src/gi-stubs/repository/GModule.pyi: -------------------------------------------------------------------------------- 1 | import typing 2 | 3 | from gi.repository import GObject 4 | from typing_extensions import Self 5 | 6 | T = typing.TypeVar("T") 7 | 8 | MODULE_IMPL_AR: int = 7 9 | MODULE_IMPL_DL: int = 1 10 | MODULE_IMPL_NONE: int = 0 11 | MODULE_IMPL_WIN32: int = 3 12 | 13 | def module_build_path(directory: typing.Optional[str], module_name: str) -> str: ... 14 | def module_error() -> str: ... 15 | def module_error_quark() -> int: ... 16 | def module_supported() -> bool: ... 17 | 18 | class Module(GObject.GPointer): 19 | @staticmethod 20 | def build_path(directory: typing.Optional[str], module_name: str) -> str: ... 21 | def close(self) -> bool: ... 22 | @staticmethod 23 | def error() -> str: ... 24 | @staticmethod 25 | def error_quark() -> int: ... 26 | def make_resident(self) -> None: ... 27 | def name(self) -> str: ... 28 | @staticmethod 29 | def supported() -> bool: ... 30 | def symbol(self, symbol_name: str) -> typing.Tuple[bool, None]: ... 31 | 32 | class ModuleFlags(GObject.GFlags): 33 | LAZY = 1 34 | LOCAL = 2 35 | MASK = 3 36 | 37 | class ModuleError(GObject.GEnum): 38 | CHECK_FAILED = 1 39 | FAILED = 0 40 | -------------------------------------------------------------------------------- /.github/workflows/publish.yml: -------------------------------------------------------------------------------- 1 | # This workflow will upload a Python Package using Twine when a release is created 2 | # For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries 3 | 4 | # This workflow uses actions that are not certified by GitHub. 5 | # They are provided by a third-party and are governed by 6 | # separate terms of service, privacy policy, and support 7 | # documentation. 8 | 9 | name: Upload Python Package 10 | 11 | on: 12 | release: 13 | types: [published] 14 | 15 | jobs: 16 | deploy: 17 | 18 | runs-on: ubuntu-latest 19 | 20 | steps: 21 | - uses: actions/checkout@v4 22 | - name: Set up Python 23 | uses: actions/setup-python@v5 24 | with: 25 | python-version: '3.x' 26 | 27 | - name: Install dependencies 28 | run: | 29 | python -m pip install --upgrade pip 30 | pip install build 31 | 32 | - name: Build package 33 | run: python -m build -s 34 | 35 | - name: Publish Package to PyPI 36 | uses: pypa/gh-action-pypi-publish@release/v1 37 | with: 38 | attestations: false 39 | user: __token__ 40 | password: ${{ secrets.PYPI_API_TOKEN }} 41 | -------------------------------------------------------------------------------- /src/gi-stubs/repository/GLibWin32.pyi: -------------------------------------------------------------------------------- 1 | import typing 2 | 3 | T = typing.TypeVar("T") 4 | 5 | _lock = ... # FIXME Constant 6 | _namespace: str = "GLibWin32" 7 | _version: str = "2.0" 8 | 9 | def check_windows_version( 10 | major: int, minor: int, spver: int, os_type: OSType 11 | ) -> bool: ... 12 | def error_message(error: int) -> str: ... 13 | def ftruncate(f: int, size: int) -> int: ... 14 | def get_package_installation_directory(package: str, dll_name: str) -> str: ... 15 | def get_package_installation_directory_of_module(hmodule: None) -> str: ... 16 | def get_package_installation_subdirectory( 17 | package: str, dll_name: str, subdir: str 18 | ) -> str: ... 19 | def get_windows_version() -> int: ... 20 | def getlocale() -> str: ... 21 | def locale_filename_from_utf8(utf8filename: str) -> str: ... 22 | 23 | class OSType: 24 | ANY: OSType = 0 25 | SERVER: OSType = 2 26 | WORKSTATION: OSType = 1 27 | denominator = ... # FIXME Constant 28 | imag = ... # FIXME Constant 29 | numerator = ... # FIXME Constant 30 | real = ... # FIXME Constant 31 | 32 | def as_integer_ratio(self, /): ... # FIXME Function 33 | def bit_count(self, /): ... # FIXME Function 34 | def bit_length(self, /): ... # FIXME Function 35 | def conjugate(self, *args, **kwargs): ... # FIXME Function 36 | def from_bytes(bytes, byteorder="big", *, signed=False): ... # FIXME Function 37 | def is_integer(self, /): ... # FIXME Function 38 | def to_bytes( 39 | self, /, length=1, byteorder="big", *, signed=False 40 | ): ... # FIXME Function 41 | -------------------------------------------------------------------------------- /src/gi-stubs/repository/Manette.pyi: -------------------------------------------------------------------------------- 1 | from typing import Union 2 | 3 | from gi.repository import Gio 4 | from gi.repository import GObject 5 | 6 | _lock = ... 7 | _namespace: str = ... 8 | _version: str = ... 9 | 10 | def get_resource() -> Gio.Resource: ... 11 | 12 | class Device(GObject.Object): 13 | def get_name(self) -> str: ... 14 | def has_input(self, type: int, code: int) -> bool: ... 15 | def has_rumble(self) -> bool: ... 16 | def has_user_mapping(self) -> bool: ... 17 | def remove_user_mapping(self) -> None: ... 18 | def rumble( 19 | self, strong_magnitude: int, weak_magnitude: int, milliseconds: int 20 | ) -> bool: ... 21 | def save_user_mapping(self, mapping_string: str) -> None: ... 22 | 23 | class Event: 24 | def get_absolute(self) -> tuple[bool, int, float]: ... 25 | def get_button(self) -> tuple[bool, int]: ... 26 | def get_device(self) -> Device: ... 27 | def get_event_type(self) -> EventType: ... 28 | def get_hardware_code(self) -> int: ... 29 | def get_hardware_index(self) -> int: ... 30 | def get_hardware_type(self) -> int: ... 31 | def get_hardware_value(self) -> int: ... 32 | def get_hat(self) -> tuple[bool, int, int]: ... 33 | def get_time(self) -> int: ... 34 | 35 | class Monitor(GObject.Object): 36 | def iterate(self) -> MonitorIter: ... 37 | @classmethod 38 | def new() -> Monitor: ... 39 | 40 | class MonitorIter: 41 | def next(self) -> tuple[bool, Union[Device, None]]: ... 42 | 43 | class EventType(GObject.GEnum): 44 | EVENT_ABSOLUTE = ... 45 | EVENT_BUTTON_PRESS = ... 46 | EVENT_BUTTON_RELEASE = ... 47 | EVENT_HAT = ... 48 | EVENT_NOTHING = ... 49 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Typing Stubs for PyGObject 2 | 3 | [![PyPI](https://img.shields.io/pypi/v/pygobject-stubs)](https://pypi.org/project/PyGObject-stubs) 4 | 5 | ## Installation 6 | 7 | With uv: 8 | ```shell 9 | uv add --dev pygobject-stubs 10 | ``` 11 | 12 | With pip: 13 | ```shell 14 | pip install pygobject-stubs 15 | ``` 16 | 17 | ### Configuration 18 | 19 | Some libraries exist in multiple versions like Gtk3/4. 20 | As both libraries are currently imported under the namespace `Gtk` only stubs for one can be installed. 21 | 22 | You need to decide this at install time either by using the `--config-settings` option with pip: 23 | 24 | ```shell 25 | pip install pygobject-stubs --no-cache-dir --config-settings=config=Gtk3,Gdk3,Soup2 26 | ``` 27 | 28 | or by setting the `PYGOBJECT_STUB_CONFIG` env variable: 29 | 30 | ```shell 31 | PYGOBJECT_STUB_CONFIG=Gtk3,Gdk3,Soup2 pip install --no-cache-dir pygobject-stubs 32 | ``` 33 | 34 | If no configuration is set, the most recent version of each library is installed. 35 | 36 | `--no-cache-dir` is only necessary on subsequent reinstalls, otherwise the stubs will not be rebuild and a cache of a previous installation is used. 37 | 38 | #### uv 39 | 40 | ``` 41 | [tool.uv] 42 | config-settings-package = { pygobject-stubs = { config = "Gtk3,Gdk3,Soup2" } } 43 | ``` 44 | 45 | #### poetry 46 | 47 | https://python-poetry.org/docs/configuration/#installerbuild-config-settingspackage-name 48 | 49 | 50 | ### Project Integration 51 | 52 | Usually you want the stubs to be installed as part of the development dependencies. 53 | `pyproject.toml` does not allow to pass `config-settings` to requirements. 54 | If you need specific versions of some libraries you can use a `requirements.txt` file instead, which allows to pass `config-settings` per requirement as of pip >= 23.1.0. 55 | 56 | ```shell 57 | pip install . -r dev.txt 58 | ``` 59 | 60 | ## Contributing 61 | 62 | [Guide](./CONTRIBUTING.md) 63 | -------------------------------------------------------------------------------- /tools/bump_version.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import argparse 4 | import re 5 | import subprocess 6 | import sys 7 | from pathlib import Path 8 | 9 | REPO_DIR = Path(__file__).resolve().parent.parent 10 | 11 | 12 | PYPROJECT_TOML = REPO_DIR / "pyproject.toml" 13 | MESON_BUILD = REPO_DIR / "meson.build" 14 | CHANGELOG = REPO_DIR / "CHANGELOG.md" 15 | 16 | VERSION_RX = r"version = \"(\d+\.\d+\.\d+)" 17 | 18 | 19 | def get_current_version() -> str: 20 | with PYPROJECT_TOML.open("r") as f: 21 | content = f.read() 22 | 23 | match = re.search(VERSION_RX, content) 24 | if match is None: 25 | sys.exit("Unable to find current version") 26 | return match[1] 27 | 28 | 29 | def bump_version(filename: Path, current_version: str, new_version: str) -> None: 30 | with filename.open("r", encoding="utf8") as f: 31 | content = f.read() 32 | 33 | content = content.replace(current_version, new_version, 1) 34 | 35 | with filename.open("w", encoding="utf8") as f: 36 | f.write(content) 37 | 38 | 39 | def make_changelog(new_version: str) -> None: 40 | cmd = ["git-chglog", "--next-tag", new_version] 41 | 42 | result = subprocess.run( 43 | cmd, cwd=REPO_DIR, text=True, check=True, capture_output=True 44 | ) 45 | 46 | changes = result.stdout 47 | changes = changes.removeprefix("\n") 48 | 49 | current_changelog = CHANGELOG.read_text() 50 | 51 | with CHANGELOG.open("w") as f: 52 | f.write(changes + current_changelog) 53 | 54 | 55 | if __name__ == "__main__": 56 | parser = argparse.ArgumentParser(description="Bump Version") 57 | parser.add_argument("version", help="The new version, e.g. 1.5.0") 58 | args = parser.parse_args() 59 | 60 | current_version = get_current_version() 61 | bump_version(PYPROJECT_TOML, current_version, args.version) 62 | bump_version(MESON_BUILD, current_version, args.version) 63 | make_changelog(args.version) 64 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | ## Generating base stubs for module 4 | 5 | You can generate stubs with `tools/generate.py`. 6 | 7 | Usage: 8 | 9 | ```shellsession 10 | $ python tools/generate.py -h 11 | usage: generate.py [-h] [-u UPDATE] module version 12 | 13 | Generate module stubs 14 | 15 | positional arguments: 16 | module Gdk, Gtk, ... 17 | version 3.0, 4.0, ... 18 | 19 | options: 20 | -h, --help show this help message and exit 21 | -u UPDATE Stub file to update e.g. -u Gdk.pyi 22 | ``` 23 | 24 | Usage examples: 25 | 26 | ```shellsession 27 | python tools/generate.py GtkSource 5 -u ./src/gi-stubs/repository/_GtkSource5.pyi 28 | python tools/generate.py Spelling 1 -u ./src/gi-stubs/repository/Spelling.pyi 29 | isort . 30 | ruff format . 31 | ``` 32 | 33 | To re-generate all known stubs, run `tools/update_all.py`. 34 | You can comment out the libraries you are not interested in. 35 | 36 | ## Install development dependencies 37 | 38 | $ pip install .[dev] 39 | 40 | Using editable install `pip install -e .` does not currently work for libraries which have multiple versions 41 | 42 | ## Use pre-commit 43 | 44 | pre-commit is a library which executes checks defined in this repository. 45 | 46 | $ pre-commit install 47 | 48 | ## Commit Messages 49 | 50 | A good article regarding [good commit messages](https://chris.beams.io/posts/git-commit/) 51 | 52 | Every commit message must be prefixed with one of the following tags: 53 | 54 | Changelog relevant 55 | 56 | - feat (a new feature was added) 57 | - fix (something was fixed) 58 | - imprv (improvements) 59 | - change (existing functionality was changed) 60 | - typing (whenever type hints are added to a module, Example: typing: GLib: Add hints) 61 | 62 | Prefixes for development 63 | 64 | - new (new code, but the end user will not notice) 65 | - ci (ci related changes) 66 | - cq (code quality changes e.g. formatting, codestyle) 67 | - cfix (code fixes which should not show up in the changelog) 68 | - refactor (code was changed, but the end user will not notice) 69 | - chore (reoccuring tasks which need to be done) 70 | - release (only used for release commits) 71 | - other (everything which does not fit any categories) 72 | 73 | Example: 74 | 75 | `feat: New Button which does something` 76 | -------------------------------------------------------------------------------- /pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = ["setuptools >= 65.0.0"] 3 | build-backend = "backend" 4 | backend-path = ["pep517backend"] 5 | 6 | [project] 7 | name = "PyGObject-stubs" 8 | version = "2.16.0" 9 | description = "Typing stubs for PyGObject" 10 | readme = "README.md" 11 | requires-python = ">=3.9" 12 | license = {text = "LGPL-2.1"} 13 | authors = [ 14 | {email = "reiter.christoph@gmail.com"}, 15 | {name = "Christoph Reiter"} 16 | ] 17 | classifiers = [ 18 | "Programming Language :: Python :: 3", 19 | "Intended Audience :: Developers", 20 | "License :: OSI Approved :: GNU Lesser General Public License v2 or later (LGPLv2+)", 21 | "Operating System :: OS Independent", 22 | ] 23 | dependencies = [ 24 | "typing_extensions", 25 | ] 26 | 27 | [project.optional-dependencies] 28 | dev = [ 29 | "codespell>=2.4.1", 30 | "isort>=6.0.1", 31 | "ruff>=0.12.7", 32 | "pre-commit", 33 | "PyGObject", 34 | ] 35 | 36 | [project.urls] 37 | homepage = "https://github.com/pygobject/pygobject-stubs" 38 | repository = "https://github.com/pygobject/pygobject-stubs" 39 | 40 | [tool.setuptools.packages.find] 41 | where = ["src"] 42 | 43 | [tool.setuptools.package-data] 44 | "*" = ["*.pyi"] 45 | 46 | [tool.codespell] 47 | skip = "*__pycache__*,.mypy_cache,.git,pyproject.toml,test,*.pyi,*venv" 48 | ignore-words-list = """ 49 | astroid, 50 | inout""" 51 | 52 | [tool.isort] 53 | force_alphabetical_sort_within_sections = true 54 | force_single_line = true 55 | group_by_package = true 56 | known_typing = ["typing"] 57 | sections = ["FUTURE", "TYPING", "STDLIB", "THIRDPARTY", "FIRSTPARTY", "LOCALFOLDER"] 58 | skip_gitignore = true 59 | 60 | [tool.ruff] 61 | line-length = 88 62 | exclude = [ 63 | ".eggs", 64 | ".git", 65 | ".ruff_cache", 66 | ".venv", 67 | ] 68 | 69 | target-version = "py39" 70 | 71 | [tool.ruff.lint] 72 | select = [ 73 | "PYI", # flake8-pyi 74 | ] 75 | ignore = [ 76 | "PYI001", # Name of private `TypeVar` must start with `_` 77 | "PYI011", # Only simple default values allowed for typed arguments 78 | "PYI019", # Methods like `__or__` should return `typing.Self` instead of a custom `TypeVar` 79 | "PYI021", # Docstrings should not be included in stubs 80 | "PYI026", # Use `typing_extensions.TypeAlias` 81 | "PYI052", # Need type annotation 82 | "PYI054", # Numeric literals with a string representation longer than ten characters are not permitted 83 | ] 84 | -------------------------------------------------------------------------------- /src/gi-stubs/repository/PangoCairo.pyi: -------------------------------------------------------------------------------- 1 | import typing 2 | 3 | import cairo 4 | from gi.repository import GObject 5 | from gi.repository import Pango 6 | from typing_extensions import Self 7 | 8 | T = typing.TypeVar("T") 9 | _SomeSurface = typing.TypeVar("_SomeSurface", bound=cairo.Surface) 10 | 11 | _lock = ... # FIXME Constant 12 | _namespace: str = "PangoCairo" 13 | _version: str = "1.0" 14 | 15 | def context_get_font_options( 16 | context: Pango.Context, 17 | ) -> typing.Optional[cairo.FontOptions]: ... 18 | def context_get_resolution(context: Pango.Context) -> float: ... 19 | def context_set_font_options( 20 | context: Pango.Context, options: typing.Optional[cairo.FontOptions] = None 21 | ) -> None: ... 22 | def context_set_resolution(context: Pango.Context, dpi: float) -> None: ... 23 | def context_set_shape_renderer( 24 | context: Pango.Context, 25 | func: typing.Optional[typing.Callable[..., None]] = None, 26 | *data: typing.Any, 27 | ) -> None: ... 28 | def create_context(cr: cairo.Context[_SomeSurface]) -> Pango.Context: ... 29 | def create_layout(cr: cairo.Context[_SomeSurface]) -> Pango.Layout: ... 30 | def error_underline_path( 31 | cr: cairo.Context[_SomeSurface], x: float, y: float, width: float, height: float 32 | ) -> None: ... 33 | def font_map_get_default() -> Pango.FontMap: ... 34 | def font_map_new() -> Pango.FontMap: ... 35 | def font_map_new_for_font_type( 36 | fonttype: cairo.FontType, 37 | ) -> typing.Optional[Pango.FontMap]: ... 38 | def glyph_string_path( 39 | cr: cairo.Context[_SomeSurface], font: Pango.Font, glyphs: Pango.GlyphString 40 | ) -> None: ... 41 | def layout_line_path( 42 | cr: cairo.Context[_SomeSurface], line: Pango.LayoutLine 43 | ) -> None: ... 44 | def layout_path(cr: cairo.Context[_SomeSurface], layout: Pango.Layout) -> None: ... 45 | def show_error_underline( 46 | cr: cairo.Context[_SomeSurface], x: float, y: float, width: float, height: float 47 | ) -> None: ... 48 | def show_glyph_item( 49 | cr: cairo.Context[_SomeSurface], text: str, glyph_item: Pango.GlyphItem 50 | ) -> None: ... 51 | def show_glyph_string( 52 | cr: cairo.Context[_SomeSurface], font: Pango.Font, glyphs: Pango.GlyphString 53 | ) -> None: ... 54 | def show_layout(cr: cairo.Context[_SomeSurface], layout: Pango.Layout) -> None: ... 55 | def show_layout_line( 56 | cr: cairo.Context[_SomeSurface], line: Pango.LayoutLine 57 | ) -> None: ... 58 | def update_context(cr: cairo.Context[_SomeSurface], context: Pango.Context) -> None: ... 59 | def update_layout(cr: cairo.Context[_SomeSurface], layout: Pango.Layout) -> None: ... 60 | 61 | class Font(GObject.GInterface): 62 | """ 63 | Interface PangoCairoFont 64 | 65 | Signals from GObject: 66 | notify (GParam) 67 | """ 68 | def get_scaled_font(self) -> typing.Optional[cairo.ScaledFont]: ... 69 | 70 | class FontMap(GObject.GInterface): 71 | """ 72 | Interface PangoCairoFontMap 73 | 74 | Signals from GObject: 75 | notify (GParam) 76 | """ 77 | # override 78 | @classmethod 79 | def get_default(cls) -> Pango.FontMap: ... 80 | def get_font_type(self) -> cairo.FontType: ... 81 | def get_resolution(self) -> float: ... 82 | # override 83 | @classmethod 84 | def new(cls) -> Pango.FontMap: ... 85 | # override 86 | @classmethod 87 | def new_for_font_type( 88 | cls, fonttype: cairo.FontType 89 | ) -> typing.Optional[Pango.FontMap]: ... 90 | def set_default(self) -> None: ... 91 | def set_resolution(self, dpi: float) -> None: ... 92 | -------------------------------------------------------------------------------- /src/gi-stubs/repository/GioWin32.pyi: -------------------------------------------------------------------------------- 1 | import typing 2 | 3 | from gi.repository import Gio 4 | from gi.repository import GObject 5 | 6 | T = typing.TypeVar("T") 7 | 8 | _lock = ... # FIXME Constant 9 | _namespace: str = "GioWin32" 10 | _version: str = "2.0" 11 | 12 | def registry_settings_backend_new( 13 | registry_key: typing.Optional[str] = None, 14 | ) -> Gio.SettingsBackend: ... 15 | 16 | class InputStream(Gio.InputStream): 17 | """ 18 | :Constructors: 19 | 20 | :: 21 | 22 | InputStream(**properties) 23 | new(handle=None, close_handle:bool) -> Gio.InputStream 24 | 25 | Object GWin32InputStream 26 | 27 | Properties from GWin32InputStream: 28 | handle -> gpointer: handle 29 | close-handle -> gboolean: close-handle 30 | 31 | Signals from GObject: 32 | notify (GParam) 33 | """ 34 | 35 | parent_instance: Gio.InputStream = ... 36 | priv: InputStreamPrivate = ... 37 | @staticmethod 38 | def get_close_handle(stream: InputStream) -> bool: ... 39 | @staticmethod 40 | def get_handle(stream: InputStream) -> None: ... 41 | def new( 42 | handle: typing.Any, close_handle: bool 43 | ) -> InputStream: ... # FIXME Function 44 | @staticmethod 45 | def set_close_handle(stream: InputStream, close_handle: bool) -> None: ... 46 | 47 | class InputStreamClass(GObject.GPointer): 48 | """ 49 | :Constructors: 50 | 51 | :: 52 | 53 | InputStreamClass() 54 | """ 55 | 56 | parent_class: Gio.InputStreamClass = ... 57 | _g_reserved1: None = ... 58 | _g_reserved2: None = ... 59 | _g_reserved3: None = ... 60 | _g_reserved4: None = ... 61 | _g_reserved5: None = ... 62 | 63 | class InputStreamPrivate(GObject.GPointer): ... 64 | 65 | class NetworkMonitor(GObject.GPointer): 66 | """ 67 | :Constructors: 68 | 69 | :: 70 | 71 | NetworkMonitor() 72 | """ 73 | 74 | parent_instance: None = ... 75 | priv: NetworkMonitorPrivate = ... 76 | 77 | class NetworkMonitorClass(GObject.GPointer): 78 | """ 79 | :Constructors: 80 | 81 | :: 82 | 83 | NetworkMonitorClass() 84 | """ 85 | 86 | parent_class: None = ... 87 | 88 | class NetworkMonitorPrivate(GObject.GPointer): ... 89 | 90 | class OutputStream(Gio.OutputStream): 91 | """ 92 | :Constructors: 93 | 94 | :: 95 | 96 | OutputStream(**properties) 97 | new(handle=None, close_handle:bool) -> Gio.OutputStream 98 | 99 | Object GWin32OutputStream 100 | 101 | Properties from GWin32OutputStream: 102 | handle -> gpointer: handle 103 | close-handle -> gboolean: close-handle 104 | 105 | Signals from GObject: 106 | notify (GParam) 107 | """ 108 | 109 | parent_instance: Gio.OutputStream = ... 110 | priv: OutputStreamPrivate = ... 111 | @staticmethod 112 | def get_close_handle(stream: OutputStream) -> bool: ... 113 | @staticmethod 114 | def get_handle(stream: OutputStream) -> None: ... 115 | def new( 116 | handle: typing.Any, close_handle: bool 117 | ) -> OutputStream: ... # FIXME Function 118 | @staticmethod 119 | def set_close_handle(stream: OutputStream, close_handle: bool) -> None: ... 120 | 121 | class OutputStreamClass(GObject.GPointer): 122 | """ 123 | :Constructors: 124 | 125 | :: 126 | 127 | OutputStreamClass() 128 | """ 129 | 130 | parent_class: Gio.OutputStreamClass = ... 131 | _g_reserved1: None = ... 132 | _g_reserved2: None = ... 133 | _g_reserved3: None = ... 134 | _g_reserved4: None = ... 135 | _g_reserved5: None = ... 136 | 137 | class OutputStreamPrivate(GObject.GPointer): ... 138 | -------------------------------------------------------------------------------- /src/gi-stubs/repository/_GdkWin323.pyi: -------------------------------------------------------------------------------- 1 | import typing 2 | 3 | from gi.repository import Gdk 4 | from gi.repository import GObject 5 | 6 | T = typing.TypeVar("T") 7 | 8 | _lock = ... # FIXME Constant 9 | _namespace: str = "GdkWin32" 10 | _version: str = "3.0" 11 | 12 | def win32_selection_add_targets( 13 | owner: Gdk.Window, selection: Gdk.Atom, n_targets: int, targets: Gdk.Atom 14 | ) -> None: ... 15 | def win32_selection_clear_targets_libgtk_only( 16 | display: Gdk.Display, selection: Gdk.Atom 17 | ) -> None: ... 18 | 19 | class Win32Cursor(Gdk.Cursor): ... 20 | class Win32CursorClass(GObject.GPointer): ... 21 | 22 | class Win32Display(Gdk.Display): 23 | """ 24 | :Constructors: 25 | 26 | :: 27 | 28 | Win32Display(**properties) 29 | 30 | Object GdkWin32Display 31 | 32 | Signals from GdkDisplay: 33 | opened () 34 | closed (gboolean) 35 | seat-added (GdkSeat) 36 | seat-removed (GdkSeat) 37 | monitor-added (GdkMonitor) 38 | monitor-removed (GdkMonitor) 39 | 40 | Signals from GObject: 41 | notify (GParam) 42 | """ 43 | 44 | @staticmethod 45 | def get_wgl_version(display: Gdk.Display) -> typing.Tuple[bool, int, int]: ... 46 | def set_cursor_theme(self, name: typing.Optional[str], size: int) -> None: ... 47 | 48 | class Win32DisplayClass(GObject.GPointer): ... 49 | class Win32DisplayManager(Gdk.DisplayManager): ... 50 | class Win32DisplayManagerClass(GObject.GPointer): ... 51 | class Win32DragContext(Gdk.DragContext): ... 52 | class Win32DragContextClass(GObject.GPointer): ... 53 | class Win32GLContext(Gdk.GLContext): ... 54 | class Win32GLContextClass(GObject.GPointer): ... 55 | 56 | class Win32Keymap(Gdk.Keymap): 57 | """ 58 | :Constructors: 59 | 60 | :: 61 | 62 | Win32Keymap(**properties) 63 | 64 | Object GdkWin32Keymap 65 | 66 | Signals from GdkKeymap: 67 | direction-changed () 68 | keys-changed () 69 | state-changed () 70 | 71 | Signals from GObject: 72 | notify (GParam) 73 | """ 74 | 75 | def check_compose( 76 | self, compose_buffer: int, compose_buffer_len: int, output: int, output_len: int 77 | ) -> Win32KeymapMatch: ... 78 | 79 | class Win32KeymapClass(GObject.GPointer): ... 80 | 81 | class Win32KeymapMatch: 82 | EXACT: Win32KeymapMatch = 3 83 | INCOMPLETE: Win32KeymapMatch = 1 84 | NONE: Win32KeymapMatch = 0 85 | PARTIAL: Win32KeymapMatch = 2 86 | denominator = ... # FIXME Constant 87 | imag = ... # FIXME Constant 88 | numerator = ... # FIXME Constant 89 | real = ... # FIXME Constant 90 | 91 | def as_integer_ratio(self, /): ... # FIXME Function 92 | def bit_count(self, /): ... # FIXME Function 93 | def bit_length(self, /): ... # FIXME Function 94 | def conjugate(self, *args, **kwargs): ... # FIXME Function 95 | def from_bytes(bytes, byteorder="big", *, signed=False): ... # FIXME Function 96 | def is_integer(self, /): ... # FIXME Function 97 | def to_bytes( 98 | self, /, length=1, byteorder="big", *, signed=False 99 | ): ... # FIXME Function 100 | 101 | class Win32Monitor(Gdk.Monitor): ... 102 | class Win32MonitorClass(GObject.GPointer): ... 103 | class Win32Screen(Gdk.Screen): ... 104 | class Win32ScreenClass(GObject.GPointer): ... 105 | 106 | class Win32Window(Gdk.Window): 107 | """ 108 | :Constructors: 109 | 110 | :: 111 | 112 | Win32Window(**properties) 113 | 114 | Object GdkWin32Window 115 | 116 | Signals from GdkWindow: 117 | pick-embedded-child (gdouble, gdouble) -> GdkWindow 118 | to-embedder (gdouble, gdouble, gpointer, gpointer) 119 | from-embedder (gdouble, gdouble, gpointer, gpointer) 120 | create-surface (gint, gint) -> CairoSurface 121 | moved-to-rect (gpointer, gpointer, gboolean, gboolean) 122 | 123 | Properties from GdkWindow: 124 | cursor -> GdkCursor: Cursor 125 | Cursor 126 | 127 | Signals from GObject: 128 | notify (GParam) 129 | """ 130 | 131 | @staticmethod 132 | def is_win32(window: Gdk.Window) -> bool: ... 133 | 134 | class Win32WindowClass(GObject.GPointer): ... 135 | -------------------------------------------------------------------------------- /pep517backend/backend.py: -------------------------------------------------------------------------------- 1 | from __future__ import annotations 2 | 3 | from typing import Any 4 | from typing import Optional 5 | 6 | import itertools 7 | import logging 8 | import os 9 | import shutil 10 | from dataclasses import dataclass 11 | from pathlib import Path 12 | 13 | import setuptools.build_meta as _orig 14 | 15 | logging.basicConfig(level="INFO", format="%(levelname)s: %(message)s") 16 | log = logging.getLogger() 17 | 18 | PACKAGE_DIR = Path("src/gi-stubs") 19 | GI_REPOSITORY_DIR = PACKAGE_DIR / "repository" 20 | 21 | 22 | @dataclass 23 | class LibVersion: 24 | name: str 25 | version: str 26 | 27 | @classmethod 28 | def from_str(cls, string: str) -> LibVersion: 29 | name = string[:-1] 30 | version = string[-1] 31 | return cls(name=name, version=version) 32 | 33 | def __eq__(self, obj: object) -> bool: 34 | if not isinstance(obj, LibVersion): 35 | return False 36 | return obj.name == self.name 37 | 38 | def __str__(self) -> str: 39 | return f"{self.name}{self.version}" 40 | 41 | 42 | DEFAULT_STUB_CONFIG = [ 43 | LibVersion("Gdk", "4"), 44 | LibVersion("GdkWin32", "4"), 45 | LibVersion("GIRepository", "3"), 46 | LibVersion("Gtk", "4"), 47 | LibVersion("GtkSource", "5"), 48 | LibVersion("JavaScriptCore", "6"), 49 | LibVersion("Soup", "3"), 50 | LibVersion("WebKit", "6"), 51 | ] 52 | 53 | 54 | def _get_settings_stub_config( 55 | config_settings: Optional[dict[str, str]], 56 | ) -> list[LibVersion]: 57 | libs = [] 58 | if config_settings is None: 59 | return libs 60 | 61 | config = config_settings.get("config") 62 | if config is None: 63 | return libs 64 | 65 | libs = [lib.strip() for lib in config.split(",")] 66 | log.info("Settings stub config: %s", libs) 67 | return list(map(LibVersion.from_str, libs)) 68 | 69 | 70 | def _get_env_stub_config() -> list[LibVersion]: 71 | libs = [] 72 | env_var = os.environ.get("PYGOBJECT_STUB_CONFIG") 73 | if env_var is not None: 74 | libs = [lib.strip() for lib in env_var.split(",")] 75 | log.info("Env stub config: %s", libs) 76 | return list(map(LibVersion.from_str, libs)) 77 | 78 | 79 | def _check_config(stub_config: list[LibVersion]) -> None: 80 | for lib in stub_config: 81 | stub_path = GI_REPOSITORY_DIR / f"_{lib}.pyi" 82 | if not stub_path.exists(): 83 | raise ValueError(f"Unknown library {lib}") 84 | 85 | 86 | def _install_stubs(stub_config: list[LibVersion]) -> None: 87 | for lib in stub_config: 88 | if lib in DEFAULT_STUB_CONFIG: 89 | DEFAULT_STUB_CONFIG.remove(lib) 90 | 91 | for lib in itertools.chain(stub_config, DEFAULT_STUB_CONFIG): 92 | stub_path = GI_REPOSITORY_DIR / f"_{lib}.pyi" 93 | new_stub_path = GI_REPOSITORY_DIR / f"{lib.name}.pyi" 94 | log.info("Install %s", lib) 95 | shutil.copy(stub_path, new_stub_path) 96 | 97 | 98 | def get_requires_for_build_sdist(*args: Any, **kwargs: Any) -> str: 99 | return _orig.get_requires_for_build_sdist(*args, **kwargs) 100 | 101 | 102 | def build_sdist(*args: Any, **kwargs: Any) -> str: 103 | return _orig.build_sdist(*args, **kwargs) 104 | 105 | 106 | def get_requires_for_build_wheel(*args: Any, **kwargs: Any) -> str: 107 | return _orig.get_requires_for_build_wheel(*args, **kwargs) 108 | 109 | 110 | def prepare_metadata_for_build_wheel(*args: Any, **kwargs: Any) -> str: 111 | return _orig.prepare_metadata_for_build_wheel(*args, **kwargs) 112 | 113 | 114 | def build_wheel( 115 | wheel_directory: str, 116 | config_settings: Optional[dict[str, str]] = None, 117 | metadata_directory: Optional[str] = None, 118 | ) -> str: 119 | stub_config = _get_settings_stub_config(config_settings) 120 | if not stub_config: 121 | stub_config = _get_env_stub_config() 122 | 123 | _check_config(stub_config) 124 | _install_stubs(stub_config) 125 | 126 | basename = _orig.build_wheel( 127 | wheel_directory, 128 | config_settings=config_settings, 129 | metadata_directory=metadata_directory, 130 | ) 131 | 132 | return basename 133 | -------------------------------------------------------------------------------- /src/gi-stubs/repository/GSound.pyi: -------------------------------------------------------------------------------- 1 | import typing 2 | 3 | from gi.repository import Gio 4 | from gi.repository import GObject 5 | from typing_extensions import Self 6 | 7 | T = typing.TypeVar("T") 8 | 9 | ATTR_APPLICATION_ICON: str = "application.icon" 10 | ATTR_APPLICATION_ICON_NAME: str = "application.icon_name" 11 | ATTR_APPLICATION_ID: str = "application.id" 12 | ATTR_APPLICATION_LANGUAGE: str = "application.language" 13 | ATTR_APPLICATION_NAME: str = "application.name" 14 | ATTR_APPLICATION_PROCESS_BINARY: str = "application.process.binary" 15 | ATTR_APPLICATION_PROCESS_HOST: str = "application.process.host" 16 | ATTR_APPLICATION_PROCESS_ID: str = "application.process.id" 17 | ATTR_APPLICATION_PROCESS_USER: str = "application.process.user" 18 | ATTR_APPLICATION_VERSION: str = "application.version" 19 | ATTR_CANBERRA_CACHE_CONTROL: str = "canberra.cache-control" 20 | ATTR_CANBERRA_ENABLE: str = "canberra.enable" 21 | ATTR_CANBERRA_FORCE_CHANNEL: str = "canberra.force_channel" 22 | ATTR_CANBERRA_VOLUME: str = "canberra.volume" 23 | ATTR_CANBERRA_XDG_THEME_NAME: str = "canberra.xdg-theme.name" 24 | ATTR_CANBERRA_XDG_THEME_OUTPUT_PROFILE: str = "canberra.xdg-theme.output-profile" 25 | ATTR_EVENT_DESCRIPTION: str = "event.description" 26 | ATTR_EVENT_ID: str = "event.id" 27 | ATTR_EVENT_MOUSE_BUTTON: str = "event.mouse.button" 28 | ATTR_EVENT_MOUSE_HPOS: str = "event.mouse.hpos" 29 | ATTR_EVENT_MOUSE_VPOS: str = "event.mouse.vpos" 30 | ATTR_EVENT_MOUSE_X: str = "event.mouse.x" 31 | ATTR_EVENT_MOUSE_Y: str = "event.mouse.y" 32 | ATTR_MEDIA_ARTIST: str = "media.artist" 33 | ATTR_MEDIA_FILENAME: str = "media.filename" 34 | ATTR_MEDIA_ICON: str = "media.icon" 35 | ATTR_MEDIA_ICON_NAME: str = "media.icon_name" 36 | ATTR_MEDIA_LANGUAGE: str = "media.language" 37 | ATTR_MEDIA_NAME: str = "media.name" 38 | ATTR_MEDIA_ROLE: str = "media.role" 39 | ATTR_MEDIA_TITLE: str = "media.title" 40 | ATTR_WINDOW_DESKTOP: str = "window.desktop" 41 | ATTR_WINDOW_HEIGHT: str = "window.height" 42 | ATTR_WINDOW_HPOS: str = "window.hpos" 43 | ATTR_WINDOW_ICON: str = "window.icon" 44 | ATTR_WINDOW_ICON_NAME: str = "window.icon_name" 45 | ATTR_WINDOW_ID: str = "window.id" 46 | ATTR_WINDOW_NAME: str = "window.name" 47 | ATTR_WINDOW_VPOS: str = "window.vpos" 48 | ATTR_WINDOW_WIDTH: str = "window.width" 49 | ATTR_WINDOW_X: str = "window.x" 50 | ATTR_WINDOW_X11_DISPLAY: str = "window.x11.display" 51 | ATTR_WINDOW_X11_MONITOR: str = "window.x11.monitor" 52 | ATTR_WINDOW_X11_SCREEN: str = "window.x11.screen" 53 | ATTR_WINDOW_X11_XID: str = "window.x11.xid" 54 | ATTR_WINDOW_Y: str = "window.y" 55 | _lock = ... # FIXME Constant 56 | _namespace: str = "GSound" 57 | _version: str = "1.0" 58 | 59 | def error_quark() -> int: ... 60 | 61 | class Context(GObject.Object, Gio.Initable): 62 | """ 63 | :Constructors: 64 | 65 | :: 66 | 67 | Context(**properties) 68 | new(cancellable:Gio.Cancellable=None) -> GSound.Context 69 | 70 | Object GSoundContext 71 | 72 | Signals from GObject: 73 | notify (GParam) 74 | """ 75 | def cache(self, attrs: dict[str, str]) -> bool: ... 76 | @classmethod 77 | def new(cls, cancellable: typing.Optional[Gio.Cancellable] = None) -> Context: ... 78 | def open(self) -> bool: ... 79 | def play_full( 80 | self, 81 | attrs: dict[str, str], 82 | cancellable: typing.Optional[Gio.Cancellable] = None, 83 | callback: typing.Optional[typing.Callable[..., None]] = None, 84 | *user_data: typing.Any, 85 | ) -> None: ... 86 | def play_full_finish(self, result: Gio.AsyncResult) -> bool: ... 87 | def play_simple( 88 | self, 89 | attrs: dict[str, str], 90 | cancellable: typing.Optional[Gio.Cancellable] = None, 91 | ) -> bool: ... 92 | def set_attributes(self, attrs: dict[str, str]) -> bool: ... 93 | def set_driver(self, driver: str) -> bool: ... 94 | 95 | class ContextClass(GObject.GPointer): ... 96 | 97 | class Error(GObject.GEnum): 98 | ACCESS = -13 99 | CANCELED = -11 100 | CORRUPT = -7 101 | DESTROYED = -10 102 | DISABLED = -16 103 | DISCONNECTED = -18 104 | FORKED = -17 105 | INTERNAL = -15 106 | INVALID = -2 107 | IO = -14 108 | NODRIVER = -5 109 | NOTAVAILABLE = -12 110 | NOTFOUND = -9 111 | NOTSUPPORTED = -1 112 | OOM = -4 113 | STATE = -3 114 | SYSTEM = -6 115 | TOOBIG = -8 116 | -------------------------------------------------------------------------------- /src/gi-stubs/repository/Notify.pyi: -------------------------------------------------------------------------------- 1 | from typing import Any 2 | from typing import Callable 3 | from typing import Literal 4 | from typing import Optional 5 | from typing import Sequence 6 | from typing import Tuple 7 | from typing import Type 8 | from typing import TypeVar 9 | 10 | from gi.repository import GdkPixbuf 11 | from gi.repository import GLib 12 | from gi.repository import GObject 13 | 14 | EXPIRES_DEFAULT: int = -1 15 | EXPIRES_NEVER: int = 0 16 | VERSION_MAJOR: int = 0 17 | VERSION_MICRO: int = 3 18 | VERSION_MINOR: int = 8 19 | _lock = ... # FIXME Constant 20 | _namespace: str = "Notify" 21 | _version: str = "0.7" 22 | 23 | def get_app_name() -> str: ... 24 | def get_server_caps() -> list[str]: ... 25 | def get_server_info() -> Tuple[bool, str, str, str, str]: ... 26 | def init(app_name: Optional[str] = None) -> bool: ... 27 | def is_initted() -> bool: ... 28 | def set_app_name(app_name: str) -> None: ... 29 | def uninit() -> None: ... 30 | 31 | class Notification(GObject.Object): 32 | """ 33 | :Constructors: 34 | 35 | :: 36 | 37 | Notification(**properties) 38 | new(summary:str, body:str=None, icon:str=None) -> Notify.Notification 39 | 40 | Object NotifyNotification 41 | 42 | Signals from NotifyNotification: 43 | closed () 44 | 45 | Properties from NotifyNotification: 46 | id -> gint: ID 47 | The notification ID 48 | app-name -> gchararray: Application name 49 | The application name to use for this notification 50 | summary -> gchararray: Summary 51 | The summary text 52 | body -> gchararray: Message Body 53 | The message body text 54 | icon-name -> gchararray: Icon Name 55 | The icon filename or icon theme-compliant name 56 | closed-reason -> gint: Closed Reason 57 | The reason code for why the notification was closed 58 | 59 | Signals from GObject: 60 | notify (GParam) 61 | """ 62 | 63 | class Props: 64 | app_name: Optional[str] 65 | body: str 66 | closed_reason: int 67 | icon_name: str 68 | id: int 69 | summary: str 70 | 71 | props: Props = ... 72 | parent_object: GObject.Object = ... 73 | priv: NotificationPrivate = ... 74 | def __init__( 75 | self, 76 | app_name: Optional[str] = ..., 77 | body: str = ..., 78 | icon_name: str = ..., 79 | id: int = ..., 80 | summary: str = ..., 81 | ): ... 82 | def add_action( 83 | self, action: str, label: str, callback: Callable[..., None], *user_data: Any 84 | ) -> None: ... 85 | def clear_actions(self) -> None: ... 86 | def clear_hints(self) -> None: ... 87 | def close(self) -> bool: ... 88 | def do_closed(self) -> None: ... 89 | def get_activation_token(self) -> Optional[str]: ... 90 | def get_closed_reason(self) -> int: ... 91 | @classmethod 92 | def new( 93 | cls, summary: str, body: Optional[str] = None, icon: Optional[str] = None 94 | ) -> Notification: ... 95 | def set_app_name(self, app_name: Optional[str] = None) -> None: ... 96 | def set_category(self, category: str) -> None: ... 97 | def set_hint(self, key: str, value: Optional[GLib.Variant] = None) -> None: ... 98 | def set_hint_byte(self, key: str, value: int) -> None: ... 99 | def set_hint_byte_array(self, key: str, value: Sequence[int]) -> None: ... 100 | def set_hint_double(self, key: str, value: float) -> None: ... 101 | def set_hint_int32(self, key: str, value: int) -> None: ... 102 | def set_hint_string(self, key: str, value: str) -> None: ... 103 | def set_hint_uint32(self, key: str, value: int) -> None: ... 104 | def set_icon_from_pixbuf(self, icon: GdkPixbuf.Pixbuf) -> None: ... 105 | def set_image_from_pixbuf(self, pixbuf: GdkPixbuf.Pixbuf) -> None: ... 106 | def set_timeout(self, timeout: int) -> None: ... 107 | def set_urgency(self, urgency: Urgency) -> None: ... 108 | def show(self) -> bool: ... 109 | def update( 110 | self, summary: str, body: Optional[str] = None, icon: Optional[str] = None 111 | ) -> bool: ... 112 | 113 | class NotificationClass(GObject.GPointer): 114 | """ 115 | :Constructors: 116 | 117 | :: 118 | 119 | NotificationClass() 120 | """ 121 | 122 | parent_class: GObject.ObjectClass = ... 123 | closed: Callable[[Notification], None] = ... 124 | 125 | class NotificationPrivate(GObject.GPointer): ... 126 | 127 | class ClosedReason(GObject.GEnum): 128 | API_REQUEST = 3 129 | DISMISSED = 2 130 | EXPIRED = 1 131 | UNDEFIEND = 4 132 | UNSET = -1 133 | 134 | class Urgency(GObject.GEnum): 135 | CRITICAL = 2 136 | LOW = 0 137 | NORMAL = 1 138 | -------------------------------------------------------------------------------- /src/gi-stubs/repository/Gspell.pyi: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | from gi.repository import GObject 4 | from gi.repository import Gtk 5 | 6 | _namespace: str = ... 7 | _version: str = ... 8 | 9 | def checker_error_quark() -> int: ... 10 | def language_get_available() -> list[Language]: ... 11 | def language_get_default() -> Optional[Language]: ... 12 | def language_lookup(language_code: str) -> Optional[Language]: ... 13 | 14 | class Checker(GObject.Object): 15 | parent_instance = ... 16 | 17 | def add_word_to_personal(self, word: str, word_length: int) -> None: ... 18 | def add_word_to_session(self, word: str, word_length: int) -> None: ... 19 | def check_word(self, word: str, word_length: int) -> bool: ... 20 | def clear_session(self) -> None: ... 21 | def get_language(self) -> Optional[Language]: ... 22 | def get_suggestions(self, word: str, word_length: int) -> list[str]: ... 23 | @classmethod 24 | def new(cls, language: Optional[Language]) -> Checker: ... 25 | def set_correction( 26 | self, word: str, word_length: int, replacement: str, replacement_length: int 27 | ) -> None: ... 28 | def set_language(self, language: Optional[Language]) -> None: ... 29 | def do_session_cleared(self) -> None: ... 30 | def do_word_added_to_personal(self, word: str) -> None: ... 31 | def do_word_added_to_session(self, word: str) -> None: ... 32 | 33 | class CheckerDialog(Gtk.Dialog): 34 | def get_spell_navigator(self) -> Navigator: ... 35 | 36 | class Entry(GObject.Object): 37 | def basic_setup(self) -> None: ... 38 | def get_entry(self) -> Gtk.Entry: ... 39 | @classmethod 40 | def get_from_gtk_entry(cls, gtk_entry: Gtk.Entry) -> Entry: ... 41 | def get_inline_spell_checking(self) -> bool: ... 42 | def set_inline_spell_checking(self, enable: bool) -> None: ... 43 | 44 | class EntryBuffer(GObject.Object): 45 | def get_buffer(self) -> EntryBuffer: ... 46 | @classmethod 47 | def get_from_gtk_entry_buffer(cls, gtk_buffer: Gtk.EntryBuffer) -> EntryBuffer: ... 48 | def get_spell_checker(self) -> Checker: ... 49 | def set_spell_checker(self, spell_checker: Optional[Checker]) -> None: ... 50 | 51 | class Language: 52 | def compare(self, language_b: Language) -> int: ... 53 | def free(self) -> None: ... 54 | def get_available(cls) -> list[Language]: ... 55 | def get_code(self) -> str: ... 56 | @classmethod 57 | def get_default(cls) -> Language: ... 58 | def get_name(self) -> str: ... 59 | @classmethod 60 | def lookup(cls, language_code: str) -> Optional[Language]: ... 61 | 62 | class LanguageChooser(GObject.GInterface): 63 | def get_language(self) -> Optional[Language]: ... 64 | def get_language_code(self) -> str: ... 65 | def set_language(self, language: Optional[Language]) -> None: ... 66 | def set_language_code(self, language_code: Optional[str]) -> None: ... 67 | 68 | class LanguageChooserButton(Gtk.Button): ... 69 | class LanguageChooserDialog(Gtk.Dialog, LanguageChooser): ... 70 | 71 | class LanguageChooserInterface: 72 | get_language_full: object = ... 73 | parent_interface: GObject.TypeInterface = ... 74 | set_language: object = ... 75 | 76 | class Navigator(GObject.GInterface): 77 | def change(self, word: str, change_to: str) -> None: ... 78 | def change_all(self, word: str, change_to: str) -> None: ... 79 | def goto_next(self) -> tuple[bool, str, Checker]: ... 80 | 81 | class NavigatorInterface: 82 | change: object = ... 83 | change_all: object = ... 84 | goto_next: object = ... 85 | parent_interface: GObject.TypeInterface = ... 86 | 87 | class NavigatorTextView(GObject.Object, Navigator): 88 | parent_instance = ... 89 | 90 | def get_view(self) -> Gtk.TextView: ... 91 | @classmethod 92 | def new(cls, view: Gtk.TextView) -> Navigator: ... 93 | 94 | class TextBuffer(GObject.Object): 95 | def get_buffer(self) -> Gtk.TextBuffer: ... 96 | @classmethod 97 | def get_from_gtk_text_buffer(cls, gtk_buffer: Gtk.TextBuffer) -> TextBuffer: ... 98 | def get_spell_checker(self) -> Optional[Checker]: ... 99 | def set_spell_checker(self, spell_checker: Optional[Checker]) -> None: ... 100 | 101 | class TextView(GObject.Object): 102 | parent_instance = ... 103 | 104 | def basic_setup(self) -> None: ... 105 | def get_enable_language_menu(self) -> bool: ... 106 | @classmethod 107 | def get_from_gtk_text_view(cls, gtk_view: Gtk.TextView) -> TextView: ... 108 | def get_inline_spell_checking(self) -> bool: ... 109 | def get_view(self) -> Gtk.TextView: ... 110 | def set_enable_language_menu(self, enable_language_menu: bool) -> None: ... 111 | def set_inline_spell_checking(self, enable: bool) -> None: ... 112 | 113 | class CheckerError(GObject.GEnum): 114 | DICTIONARY: int = ... 115 | NO_LANGUAGE_SET: int = ... 116 | quark: int = ... 117 | -------------------------------------------------------------------------------- /tools/update_all.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import typing 4 | 5 | import argparse 6 | import subprocess 7 | import sys 8 | from pathlib import Path 9 | 10 | 11 | class Lib: 12 | name: str 13 | version: str 14 | output: str 15 | init: str 16 | 17 | def __init__( 18 | self, name: str, version: str, *, output: str | None = None, init: str = "" 19 | ) -> None: 20 | self.name = name 21 | self.version = version 22 | self.output = output or name 23 | self.init = init 24 | 25 | 26 | GST_INIT = ( 27 | 'gi.require_version("Gst", "1.0"); from gi.repository import Gst; Gst.init(None)' 28 | ) 29 | 30 | 31 | # Add libraries below. When multiple versions are available, specify the output argument. 32 | libraries = [ 33 | Lib("Adw", "1"), 34 | Lib("AppIndicator3", "0.1"), 35 | Lib("AppStream", "1.0"), 36 | Lib("Atk", "1.0"), 37 | Lib("AyatanaAppIndicator3", "0.1"), 38 | Lib("Farstream", "0.2"), 39 | Lib("Flatpak", "1.0"), 40 | Lib("Gdk", "3.0", output="_Gdk3"), 41 | Lib("Gdk", "4.0", output="_Gdk4"), 42 | Lib("GdkPixbuf", "2.0"), 43 | Lib("GdkWin32", "3.0", output="_GdkWin323"), 44 | Lib("GdkWin32", "4.0", output="_GdkWin324"), 45 | Lib("GdkX11", "4.0"), 46 | Lib("Geoclue", "2.0"), 47 | Lib("GExiv2", "0.10"), 48 | Lib("Ggit", "1.0"), 49 | Lib("Gio", "2.0"), 50 | # This only works for either version at a time 51 | # Lib("GIRepository", "2.0", output="_GIRepository2"), 52 | Lib("GIRepository", "3.0", output="_GIRepository3"), 53 | Lib("GioWin32", "2.0"), 54 | Lib("GLib", "2.0"), 55 | Lib("GLibWin32", "2.0"), 56 | Lib("Gly", "2"), 57 | Lib("GlyGtk4", "2"), 58 | Lib("GModule", "2.0"), 59 | Lib("Goa", "1.0"), 60 | Lib("GObject", "2.0"), 61 | Lib("Graphene", "1.0"), 62 | Lib("Gsk", "4.0"), 63 | Lib("GSound", "1.0"), 64 | Lib("Gspell", "1"), 65 | Lib("Gst", "1.0", init=GST_INIT), 66 | Lib("GstBase", "1.0", init=GST_INIT), 67 | Lib("GstRtsp", "1.0", init=GST_INIT), 68 | Lib("GstRtp", "1.0", init=GST_INIT), 69 | Lib("GstRtspServer", "1.0", init=GST_INIT), 70 | Lib("GstPbutils", "1.0", init=GST_INIT), 71 | Lib("GstSdp", "1.0", init=GST_INIT), 72 | Lib("GstWebRTC", "1.0", init=GST_INIT), 73 | Lib("GstAudio", "1.0", init=GST_INIT), 74 | Lib("GstVideo", "1.0", init=GST_INIT), 75 | Lib("GstApp", "1.0", init=GST_INIT), 76 | Lib("Gtk", "3.0", output="_Gtk3"), 77 | Lib("Gtk", "4.0", output="_Gtk4"), 78 | Lib("GtkSource", "4", output="_GtkSource4"), 79 | Lib("GtkSource", "5", output="_GtkSource5"), 80 | Lib("Handy", "1"), 81 | Lib("JavaScriptCore", "6.0", output="_JavaScriptCore6"), 82 | Lib("Manette", "0.2"), 83 | Lib("Notify", "0.7"), 84 | Lib("OSTree", "1.0"), 85 | Lib("Panel", "1"), 86 | Lib("Pango", "1.0"), 87 | Lib("PangoCairo", "1.0"), 88 | Lib("Poppler", "0.18"), 89 | Lib("Rsvg", "2.0"), 90 | Lib("Secret", "1"), 91 | Lib("Shumate", "1.0"), 92 | Lib("Soup", "2.4", output="_Soup2"), 93 | Lib("Soup", "3.0", output="_Soup3"), 94 | Lib("Spelling", "1"), 95 | Lib("Vte", "2.91"), 96 | Lib("WebKit", "6.0", output="_WebKit6"), 97 | Lib("XApp", "1.0"), 98 | Lib("Xdp", "1.0"), 99 | Lib("win32", "1.0"), 100 | ] 101 | 102 | if __name__ == "__main__": 103 | parser = argparse.ArgumentParser(description="Update stubs") 104 | parser.add_argument( 105 | "--only", type=str, help="Update only modules with the given name prefix" 106 | ) 107 | 108 | args = parser.parse_args() 109 | 110 | repo_path = Path("src/gi-stubs/repository") 111 | failed_generations = [] 112 | 113 | for lib in libraries: 114 | if args.only and not lib.name.startswith(args.only): 115 | continue 116 | 117 | output_path = repo_path / f"{lib.output}.pyi" 118 | 119 | print(f"Generating {output_path}", file=sys.stderr) 120 | cmd: typing.List[str | Path] = [ 121 | "tools/generate.py", 122 | lib.name, 123 | lib.version, 124 | "-u", 125 | output_path, 126 | ] 127 | if lib.init: 128 | cmd += ["--init", lib.init] 129 | gen_process = subprocess.run(cmd) 130 | 131 | if gen_process.returncode == 0: 132 | print(f"Formatting {output_path}", file=sys.stderr) 133 | subprocess.run(["ruff", "format", output_path]) 134 | print(f"Sorting imports in {output_path}", file=sys.stderr) 135 | subprocess.run(["isort", output_path]) 136 | else: 137 | print(f"Failed to generate {output_path}", file=sys.stderr) 138 | failed_generations.append(output_path) 139 | 140 | if failed_generations: 141 | print("Generating the following stubs failed:", file=sys.stderr) 142 | print( 143 | "\n".join(f" - {path}" for path in failed_generations), 144 | file=sys.stderr, 145 | ) 146 | sys.exit(1) 147 | -------------------------------------------------------------------------------- /src/gi-stubs/repository/_GdkWin324.pyi: -------------------------------------------------------------------------------- 1 | import typing 2 | 3 | from gi.repository import Gdk 4 | from gi.repository import GObject 5 | from gi.repository import win32 6 | 7 | T = typing.TypeVar("T") 8 | 9 | _lock = ... # FIXME Constant 10 | _namespace: str = "GdkWin32" 11 | _version: str = "4.0" 12 | 13 | def win32_handle_table_lookup(handle: int) -> None: ... 14 | 15 | class Win32Display(Gdk.Display): 16 | """ 17 | :Constructors: 18 | 19 | :: 20 | 21 | Win32Display(**properties) 22 | 23 | Object GdkWin32Display 24 | 25 | Signals from GdkDisplay: 26 | opened () 27 | closed (gboolean) 28 | seat-added (GdkSeat) 29 | seat-removed (GdkSeat) 30 | setting-changed (gchararray) 31 | 32 | Properties from GdkDisplay: 33 | composited -> gboolean: composited 34 | rgba -> gboolean: rgba 35 | shadow-width -> gboolean: shadow-width 36 | input-shapes -> gboolean: input-shapes 37 | dmabuf-formats -> GdkDmabufFormats: dmabuf-formats 38 | 39 | Signals from GObject: 40 | notify (GParam) 41 | """ 42 | 43 | def add_filter( 44 | self, 45 | function: typing.Callable[..., Win32MessageFilterReturn], 46 | *data: typing.Any, 47 | ) -> None: ... 48 | def get_egl_display(self) -> None: ... 49 | @staticmethod 50 | def get_wgl_version(display: Gdk.Display) -> typing.Tuple[bool, int, int]: ... 51 | def remove_filter( 52 | self, 53 | function: typing.Callable[..., Win32MessageFilterReturn], 54 | *data: typing.Any, 55 | ) -> None: ... 56 | def set_cursor_theme(self, name: typing.Optional[str], size: int) -> None: ... 57 | 58 | class Win32DisplayClass(GObject.GPointer): ... 59 | class Win32DisplayManager(Gdk.DisplayManager): ... 60 | class Win32DisplayManagerClass(GObject.GPointer): ... 61 | class Win32Drag(Gdk.Drag): ... 62 | class Win32DragClass(GObject.GPointer): ... 63 | class Win32GLContext(Gdk.GLContext): ... 64 | class Win32GLContextClass(GObject.GPointer): ... 65 | 66 | class Win32HCursor(GObject.Object): 67 | """ 68 | :Constructors: 69 | 70 | :: 71 | 72 | Win32HCursor(**properties) 73 | new(display:GdkWin32.Win32Display, handle:int, destroyable:bool) -> GdkWin32.Win32HCursor 74 | 75 | Object GdkWin32HCursor 76 | 77 | Properties from GdkWin32HCursor: 78 | display -> GdkDisplay: display 79 | handle -> gpointer: handle 80 | destroyable -> gboolean: destroyable 81 | 82 | Signals from GObject: 83 | notify (GParam) 84 | """ 85 | 86 | def new( 87 | display: Win32Display, handle: int, destroyable: bool 88 | ) -> Win32HCursor: ... # FIXME Function 89 | 90 | class Win32HCursorClass(GObject.GPointer): ... 91 | 92 | class Win32MessageFilterReturn: 93 | CONTINUE: Win32MessageFilterReturn = 0 94 | REMOVE: Win32MessageFilterReturn = 1 95 | denominator = ... # FIXME Constant 96 | imag = ... # FIXME Constant 97 | numerator = ... # FIXME Constant 98 | real = ... # FIXME Constant 99 | 100 | def as_integer_ratio(self, /): ... # FIXME Function 101 | def bit_count(self, /): ... # FIXME Function 102 | def bit_length(self, /): ... # FIXME Function 103 | def conjugate(self, *args, **kwargs): ... # FIXME Function 104 | def from_bytes(bytes, byteorder="big", *, signed=False): ... # FIXME Function 105 | def is_integer(self, /): ... # FIXME Function 106 | def to_bytes( 107 | self, /, length=1, byteorder="big", *, signed=False 108 | ): ... # FIXME Function 109 | 110 | class Win32Monitor(Gdk.Monitor): 111 | """ 112 | :Constructors: 113 | 114 | :: 115 | 116 | Win32Monitor(**properties) 117 | 118 | Object GdkWin32Monitor 119 | 120 | Signals from GdkMonitor: 121 | invalidate () 122 | 123 | Properties from GdkMonitor: 124 | description -> gchararray: description 125 | display -> GdkDisplay: display 126 | manufacturer -> gchararray: manufacturer 127 | model -> gchararray: model 128 | connector -> gchararray: connector 129 | scale-factor -> gint: scale-factor 130 | scale -> gdouble: scale 131 | geometry -> GdkRectangle: geometry 132 | width-mm -> gint: width-mm 133 | height-mm -> gint: height-mm 134 | refresh-rate -> gint: refresh-rate 135 | subpixel-layout -> GdkSubpixelLayout: subpixel-layout 136 | valid -> gboolean: valid 137 | 138 | Signals from GObject: 139 | notify (GParam) 140 | """ 141 | 142 | @staticmethod 143 | def get_workarea(monitor: Gdk.Monitor) -> Gdk.Rectangle: ... 144 | 145 | class Win32MonitorClass(GObject.GPointer): ... 146 | class Win32Screen(GObject.Object): ... 147 | class Win32ScreenClass(GObject.GPointer): ... 148 | 149 | class Win32Surface(Gdk.Surface): 150 | """ 151 | :Constructors: 152 | 153 | :: 154 | 155 | Win32Surface(**properties) 156 | 157 | Object GdkWin32Surface 158 | 159 | Signals from GdkSurface: 160 | layout (gint, gint) 161 | render (CairoRegion) -> gboolean 162 | event (gpointer) -> gboolean 163 | enter-monitor (GdkMonitor) 164 | leave-monitor (GdkMonitor) 165 | 166 | Properties from GdkSurface: 167 | cursor -> GdkCursor: cursor 168 | display -> GdkDisplay: display 169 | frame-clock -> GdkFrameClock: frame-clock 170 | mapped -> gboolean: mapped 171 | width -> gint: width 172 | height -> gint: height 173 | scale-factor -> gint: scale-factor 174 | scale -> gdouble: scale 175 | 176 | Signals from GObject: 177 | notify (GParam) 178 | """ 179 | 180 | def get_handle(self) -> int: ... 181 | @staticmethod 182 | def get_impl_hwnd(surface: Gdk.Surface) -> int: ... 183 | @staticmethod 184 | def is_win32(surface: Gdk.Surface) -> bool: ... 185 | def set_urgency_hint(self, urgent: bool) -> None: ... 186 | 187 | class Win32SurfaceClass(GObject.GPointer): ... 188 | 189 | class _Win32HCursorFake(GObject.GPointer): 190 | """ 191 | :Constructors: 192 | 193 | :: 194 | 195 | _Win32HCursorFake() 196 | """ 197 | 198 | parent_instance: GObject.Object = ... 199 | readonly_handle: int = ... 200 | -------------------------------------------------------------------------------- /tools/parse.py: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | import ast 4 | import re 5 | 6 | ParseResult = dict[str, str] 7 | 8 | OVERRIDE_PATTERN = r"^.*#\s*override.*$" 9 | CLASS_PATTERN = r"^\s*class\s(?P\w*)\s*(\(|:)" 10 | CONSTANT_INDEX = 2 11 | SYMBOLS_PATTERNS = [ 12 | r"^\s*def\s+(?P\w*)\s*\(", # Functions 13 | CLASS_PATTERN, 14 | r"^\s*(?P\w*)\s*(:|=)[^,)]*$", # Constants 15 | ] 16 | DOCUMENTATION_PATTERN = r'^\s*""".*$' 17 | INDENTATION_SPACES = 4 18 | 19 | OverridableSymbols = ast.ClassDef | ast.FunctionDef | ast.AnnAssign | ast.Assign 20 | 21 | 22 | class ParseError(Exception): 23 | pass 24 | 25 | 26 | def _search_overridden_symbols(input: str) -> list[str]: 27 | symbols: list[str] = [] 28 | parents: list[str] = [] 29 | 30 | last_class: Optional[str] = None 31 | last_indentation_level: int = 0 32 | 33 | is_override: bool = False 34 | 35 | is_doc: bool = False 36 | 37 | for i, line in enumerate(input.splitlines()): 38 | if re.match(DOCUMENTATION_PATTERN, line): 39 | is_doc = not is_doc 40 | 41 | if is_doc: 42 | continue 43 | 44 | if re.match(OVERRIDE_PATTERN, line): 45 | is_override = True 46 | 47 | for index, pattern in enumerate(SYMBOLS_PATTERNS): 48 | res = re.match(pattern, line) 49 | if res and res["symbol"]: 50 | symbol = res["symbol"] 51 | 52 | indentation_level = ( 53 | len(line) - len(line.lstrip(" ")) 54 | ) / INDENTATION_SPACES 55 | if indentation_level != int(indentation_level): 56 | raise ParseError( 57 | f"Wrong indentation at line: {i}, {indentation_level} != {int(indentation_level)}" 58 | ) 59 | indentation_level = int(indentation_level) 60 | 61 | if indentation_level > last_indentation_level: 62 | if last_class: 63 | parents.append(last_class) 64 | last_class = None 65 | else: 66 | if index != CONSTANT_INDEX: 67 | raise ParseError(f"Wrong indentation at line: {i}") 68 | else: 69 | # Regex for constant trigger also on functions arguments 70 | print( 71 | f"Wrong indentation for constant at line {i}, skipping" 72 | ) 73 | continue 74 | elif indentation_level < last_indentation_level: 75 | while indentation_level < last_indentation_level: 76 | parents.pop() 77 | last_indentation_level -= 1 78 | last_indentation_level = indentation_level 79 | 80 | if is_override: 81 | is_override = False 82 | full_list = parents + [symbol] 83 | symbols.append(".".join(full_list)) 84 | 85 | break 86 | elif res: 87 | raise ParseError(f"Unable to parse line {i}: '{line}'") 88 | 89 | class_res = re.match(CLASS_PATTERN, line) 90 | if class_res and class_res["symbol"]: 91 | last_class = class_res["symbol"] 92 | elif class_res: 93 | raise ParseError(f"Unable to parse line {i}: '{line}'") 94 | 95 | return symbols 96 | 97 | 98 | def _generate_result_node( 99 | parents: list[str], 100 | node: OverridableSymbols, 101 | overridden_symbols: list[str], 102 | result: ParseResult, 103 | ) -> None: 104 | parents = parents[:] 105 | if isinstance(node, ast.FunctionDef | ast.ClassDef): 106 | name = node.name 107 | parents.append(name) 108 | full_name = ".".join(parents) 109 | if full_name in overridden_symbols: 110 | result[full_name] = ast.unparse(node) 111 | return 112 | 113 | if isinstance(node, ast.ClassDef): 114 | for child in node.body: 115 | if ( 116 | isinstance(child, ast.Expr) 117 | and isinstance(child.value, ast.Constant) 118 | and child.value.value == Ellipsis 119 | ): 120 | continue 121 | 122 | if not isinstance(child, OverridableSymbols): 123 | print( 124 | f"Skipping {'.'.join(parents)} {child} no overridable", 125 | ast.dump(child, indent=4), 126 | ) 127 | continue 128 | _generate_result_node(parents, child, overridden_symbols, result) 129 | 130 | if isinstance(node, ast.AnnAssign): 131 | if not hasattr(node.target, "id"): 132 | print(f"Skipping {'.'.join(parents)} {node} no id attribute") 133 | return 134 | name = node.target.id # type: ignore 135 | parents.append(name) 136 | full_name = ".".join(parents) 137 | if full_name in overridden_symbols: 138 | result[full_name] = ast.unparse(node) 139 | return 140 | 141 | if isinstance(node, ast.Assign): 142 | if not hasattr(node.targets[0], "id"): 143 | print(f"Skipping {'.'.join(parents)} {node} no id attribute") 144 | return 145 | name = node.targets[0].id # type: ignore 146 | parents.append(name) 147 | full_name = ".".join(parents) 148 | if full_name in overridden_symbols: 149 | result[full_name] = ast.unparse(node) 150 | return 151 | 152 | 153 | def _generate_result(root: ast.Module, overridden_symbols: list[str]) -> ParseResult: 154 | result: ParseResult = {} 155 | parents: list[str] = [] 156 | body = root.body 157 | 158 | for child in body: 159 | if not isinstance(child, OverridableSymbols): 160 | print(f"Skipped root.{child}") 161 | continue 162 | _generate_result_node(parents, child, overridden_symbols, result) 163 | 164 | return result 165 | 166 | 167 | def parse(input: str) -> ParseResult: 168 | overridden_symbols = _search_overridden_symbols(input) 169 | root = ast.parse(input) 170 | return _generate_result(root, overridden_symbols) 171 | -------------------------------------------------------------------------------- /src/gi-stubs/repository/Rsvg.pyi: -------------------------------------------------------------------------------- 1 | from typing import Any 2 | from typing import Callable 3 | from typing import Optional 4 | from typing import Sequence 5 | from typing import Tuple 6 | from typing import Type 7 | 8 | from gi.repository import GdkPixbuf 9 | from gi.repository import Gio 10 | from gi.repository import GObject 11 | 12 | MAJOR_VERSION: int = 2 13 | MICRO_VERSION: int = 5 14 | MINOR_VERSION: int = 54 15 | VERSION: str = "2.54.5" 16 | _lock = ... # FIXME Constant 17 | _namespace: str = "Rsvg" 18 | _version: str = "2.0" 19 | 20 | def cleanup() -> None: ... 21 | def error_quark() -> int: ... 22 | def init() -> None: ... 23 | def pixbuf_from_file(filename: str) -> Optional[GdkPixbuf.Pixbuf]: ... 24 | def pixbuf_from_file_at_max_size( 25 | filename: str, max_width: int, max_height: int 26 | ) -> Optional[GdkPixbuf.Pixbuf]: ... 27 | def pixbuf_from_file_at_size( 28 | filename: str, width: int, height: int 29 | ) -> Optional[GdkPixbuf.Pixbuf]: ... 30 | def pixbuf_from_file_at_zoom( 31 | filename: str, x_zoom: float, y_zoom: float 32 | ) -> Optional[GdkPixbuf.Pixbuf]: ... 33 | def pixbuf_from_file_at_zoom_with_max( 34 | filename: str, x_zoom: float, y_zoom: float, max_width: int, max_height: int 35 | ) -> Optional[GdkPixbuf.Pixbuf]: ... 36 | def set_default_dpi(dpi: float) -> None: ... 37 | def set_default_dpi_x_y(dpi_x: float, dpi_y: float) -> None: ... 38 | def term() -> None: ... 39 | 40 | class DimensionData(GObject.GPointer): 41 | width: int = ... 42 | height: int = ... 43 | em: float = ... 44 | ex: float = ... 45 | 46 | class Handle(GObject.Object): 47 | class Props: 48 | base_uri: str 49 | desc: str 50 | dpi_x: float 51 | dpi_y: float 52 | em: float 53 | ex: float 54 | flags: HandleFlags 55 | height: int 56 | metadata: str 57 | title: str 58 | width: int 59 | 60 | props: Props = ... 61 | parent: GObject.Object = ... 62 | _abi_padding: list[None] = ... 63 | def __init__( 64 | self, 65 | base_uri: str = ..., 66 | dpi_x: float = ..., 67 | dpi_y: float = ..., 68 | flags: HandleFlags = ..., 69 | ): ... 70 | def close(self) -> bool: ... 71 | def free(self) -> None: ... 72 | def get_base_uri(self) -> str: ... 73 | def get_desc(self) -> Optional[str]: ... 74 | def get_dimensions(self) -> DimensionData: ... 75 | def get_dimensions_sub( 76 | self, id: Optional[str] = None 77 | ) -> Tuple[bool, DimensionData]: ... 78 | def get_geometry_for_element( 79 | self, id: Optional[str] = None 80 | ) -> Tuple[bool, Rectangle, Rectangle]: ... 81 | def get_geometry_for_layer( 82 | self, id: Optional[str], viewport: Rectangle 83 | ) -> Tuple[bool, Rectangle, Rectangle]: ... 84 | def get_intrinsic_dimensions( 85 | self, 86 | ) -> Tuple[bool, Length, bool, Length, bool, Rectangle]: ... 87 | def get_intrinsic_size_in_pixels(self) -> Tuple[bool, float, float]: ... 88 | def get_metadata(self) -> Optional[str]: ... 89 | def get_pixbuf(self) -> Optional[GdkPixbuf.Pixbuf]: ... 90 | def get_pixbuf_sub( 91 | self, id: Optional[str] = None 92 | ) -> Optional[GdkPixbuf.Pixbuf]: ... 93 | def get_position_sub( 94 | self, id: Optional[str] = None 95 | ) -> Tuple[bool, PositionData]: ... 96 | def get_title(self) -> Optional[str]: ... 97 | def has_sub(self, id: str) -> bool: ... 98 | def internal_set_testing(self, testing: bool) -> None: ... 99 | @classmethod 100 | def new(cls) -> Handle: ... 101 | @classmethod 102 | def new_from_data(cls, data: Sequence[int]) -> Optional[Handle]: ... 103 | @classmethod 104 | def new_from_file(cls, filename: str) -> Optional[Handle]: ... 105 | @classmethod 106 | def new_from_gfile_sync( 107 | cls, 108 | file: Gio.File, 109 | flags: HandleFlags, 110 | cancellable: Optional[Gio.Cancellable] = None, 111 | ) -> Optional[Handle]: ... 112 | @classmethod 113 | def new_from_stream_sync( 114 | cls, 115 | input_stream: Gio.InputStream, 116 | base_file: Optional[Gio.File], 117 | flags: HandleFlags, 118 | cancellable: Optional[Gio.Cancellable] = None, 119 | ) -> Optional[Handle]: ... 120 | @classmethod 121 | def new_with_flags(cls, flags: HandleFlags) -> Handle: ... 122 | def read_stream_sync( 123 | self, stream: Gio.InputStream, cancellable: Optional[Gio.Cancellable] = None 124 | ) -> bool: ... 125 | def render_cairo(self, cr: cairo.Context[_SomeSurface]) -> bool: ... 126 | def render_cairo_sub( 127 | self, cr: cairo.Context[_SomeSurface], id: Optional[str] = None 128 | ) -> bool: ... 129 | def render_document( 130 | self, cr: cairo.Context[_SomeSurface], viewport: Rectangle 131 | ) -> bool: ... 132 | def render_element( 133 | self, 134 | cr: cairo.Context[_SomeSurface], 135 | id: Optional[str], 136 | element_viewport: Rectangle, 137 | ) -> bool: ... 138 | def render_layer( 139 | self, cr: cairo.Context[_SomeSurface], id: Optional[str], viewport: Rectangle 140 | ) -> bool: ... 141 | def set_base_gfile(self, base_file: Gio.File) -> None: ... 142 | def set_base_uri(self, base_uri: str) -> None: ... 143 | def set_dpi(self, dpi: float) -> None: ... 144 | def set_dpi_x_y(self, dpi_x: float, dpi_y: float) -> None: ... 145 | def set_size_callback( 146 | self, 147 | size_func: Optional[Callable[..., Tuple[int, int]]] = None, 148 | *user_data: Any, 149 | ) -> None: ... 150 | def set_stylesheet(self, css: Sequence[int]) -> bool: ... 151 | def write(self, buf: Sequence[int]) -> bool: ... 152 | 153 | class HandleClass(GObject.GPointer): 154 | parent: GObject.ObjectClass = ... 155 | _abi_padding: list[None] = ... 156 | 157 | class Length(GObject.GPointer): 158 | length: float = ... 159 | unit: Unit = ... 160 | 161 | class PositionData(GObject.GPointer): 162 | x: int = ... 163 | y: int = ... 164 | 165 | class Rectangle(GObject.GPointer): 166 | x: float = ... 167 | y: float = ... 168 | width: float = ... 169 | height: float = ... 170 | 171 | class HandleFlags(GObject.GFlags): 172 | FLAGS_NONE = 0 173 | FLAG_KEEP_IMAGE_DATA = 2 174 | FLAG_UNLIMITED = 1 175 | 176 | class Error(GObject.GEnum): 177 | FAILED = 0 178 | @staticmethod 179 | def quark() -> int: ... 180 | 181 | class Unit(GObject.GEnum): 182 | CM = 5 183 | EM = 2 184 | EX = 3 185 | IN = 4 186 | MM = 6 187 | PC = 8 188 | PERCENT = 0 189 | PT = 7 190 | PX = 1 191 | -------------------------------------------------------------------------------- /src/gi-stubs/repository/Spelling.pyi: -------------------------------------------------------------------------------- 1 | import typing 2 | 3 | from gi.repository import Gio 4 | from gi.repository import GObject 5 | from gi.repository import Gtk 6 | from gi.repository import GtkSource 7 | from typing_extensions import Self 8 | 9 | T = typing.TypeVar("T") 10 | 11 | _lock = ... # FIXME Constant 12 | _namespace: str = "Spelling" 13 | _version: str = "1" 14 | 15 | def init() -> None: ... 16 | 17 | class Checker(GObject.Object): 18 | """ 19 | :Constructors: 20 | 21 | :: 22 | 23 | Checker(**properties) 24 | new(provider:Spelling.Provider=None, language:str=None) -> Spelling.Checker 25 | 26 | Object SpellingChecker 27 | 28 | Properties from SpellingChecker: 29 | language -> gchararray: language 30 | provider -> SpellingProvider: provider 31 | 32 | Signals from GObject: 33 | notify (GParam) 34 | """ 35 | class Props(GObject.Object.Props): 36 | language: typing.Optional[str] 37 | provider: Provider 38 | 39 | props: Props = ... 40 | def __init__(self, language: str = ..., provider: Provider = ...) -> None: ... 41 | def add_word(self, word: str) -> None: ... 42 | def check_word(self, word: str, word_len: int) -> bool: ... 43 | @staticmethod 44 | def get_default() -> Checker: ... 45 | def get_extra_word_chars(self) -> str: ... 46 | def get_language(self) -> typing.Optional[str]: ... 47 | def get_provider(self) -> Provider: ... 48 | def ignore_word(self, word: str) -> None: ... 49 | def list_corrections(self, word: str) -> typing.Optional[list[str]]: ... 50 | @classmethod 51 | def new( 52 | cls, 53 | provider: typing.Optional[Provider] = None, 54 | language: typing.Optional[str] = None, 55 | ) -> Checker: ... 56 | def set_language(self, language: str) -> None: ... 57 | 58 | class CheckerClass(GObject.GPointer): 59 | """ 60 | :Constructors: 61 | 62 | :: 63 | 64 | CheckerClass() 65 | """ 66 | 67 | parent_class: GObject.ObjectClass = ... 68 | 69 | class Dictionary(GObject.Object): 70 | """ 71 | :Constructors: 72 | 73 | :: 74 | 75 | Dictionary(**properties) 76 | 77 | Object SpellingDictionary 78 | 79 | Properties from SpellingDictionary: 80 | code -> gchararray: code 81 | 82 | Signals from GObject: 83 | notify (GParam) 84 | """ 85 | class Props(GObject.Object.Props): 86 | code: typing.Optional[str] 87 | 88 | props: Props = ... 89 | def __init__(self, code: str = ...) -> None: ... 90 | def add_word(self, word: str) -> None: ... 91 | def contains_word(self, word: str, word_len: int) -> bool: ... 92 | def get_code(self) -> typing.Optional[str]: ... 93 | def get_extra_word_chars(self) -> str: ... 94 | def ignore_word(self, word: str) -> None: ... 95 | def list_corrections( 96 | self, word: str, word_len: int 97 | ) -> typing.Optional[list[str]]: ... 98 | 99 | class DictionaryClass(GObject.GPointer): ... 100 | 101 | class Language(GObject.Object): 102 | """ 103 | :Constructors: 104 | 105 | :: 106 | 107 | Language(**properties) 108 | 109 | Object SpellingLanguage 110 | 111 | Properties from SpellingLanguage: 112 | code -> gchararray: code 113 | group -> gchararray: group 114 | name -> gchararray: name 115 | 116 | Signals from GObject: 117 | notify (GParam) 118 | """ 119 | class Props(GObject.Object.Props): 120 | code: typing.Optional[str] 121 | group: typing.Optional[str] 122 | name: typing.Optional[str] 123 | 124 | props: Props = ... 125 | def __init__(self, code: str = ..., group: str = ..., name: str = ...) -> None: ... 126 | def get_code(self) -> typing.Optional[str]: ... 127 | def get_group(self) -> typing.Optional[str]: ... 128 | def get_name(self) -> typing.Optional[str]: ... 129 | 130 | class LanguageClass(GObject.GPointer): 131 | """ 132 | :Constructors: 133 | 134 | :: 135 | 136 | LanguageClass() 137 | """ 138 | 139 | parent_class: GObject.ObjectClass = ... 140 | 141 | class Provider(GObject.Object): 142 | """ 143 | :Constructors: 144 | 145 | :: 146 | 147 | Provider(**properties) 148 | 149 | Object SpellingProvider 150 | 151 | Properties from SpellingProvider: 152 | display-name -> gchararray: Display Name 153 | Display Name 154 | 155 | Signals from GObject: 156 | notify (GParam) 157 | """ 158 | class Props(GObject.Object.Props): 159 | display_name: typing.Optional[str] 160 | 161 | props: Props = ... 162 | def __init__(self, display_name: str = ...) -> None: ... 163 | @staticmethod 164 | def get_default() -> Provider: ... 165 | def get_default_code(self) -> typing.Optional[str]: ... 166 | def get_display_name(self) -> typing.Optional[str]: ... 167 | def list_languages(self) -> Gio.ListModel: ... 168 | def load_dictionary(self, language: str) -> typing.Optional[Dictionary]: ... 169 | def supports_language(self, language: str) -> bool: ... 170 | 171 | class ProviderClass(GObject.GPointer): ... 172 | 173 | class TextBufferAdapter(GObject.Object, Gio.ActionGroup): 174 | """ 175 | :Constructors: 176 | 177 | :: 178 | 179 | TextBufferAdapter(**properties) 180 | new(buffer:GtkSource.Buffer, checker:Spelling.Checker) -> Spelling.TextBufferAdapter 181 | 182 | Object SpellingTextBufferAdapter 183 | 184 | Properties from SpellingTextBufferAdapter: 185 | buffer -> GtkSourceBuffer: buffer 186 | checker -> SpellingChecker: checker 187 | enabled -> gboolean: enabled 188 | language -> gchararray: language 189 | 190 | Signals from GActionGroup: 191 | action-added (gchararray) 192 | action-removed (gchararray) 193 | action-enabled-changed (gchararray, gboolean) 194 | action-state-changed (gchararray, GVariant) 195 | 196 | Signals from GObject: 197 | notify (GParam) 198 | """ 199 | class Props(GObject.Object.Props): 200 | buffer: typing.Optional[GtkSource.Buffer] 201 | checker: typing.Optional[Checker] 202 | enabled: bool 203 | language: typing.Optional[str] 204 | 205 | props: Props = ... 206 | def __init__( 207 | self, 208 | buffer: GtkSource.Buffer = ..., 209 | checker: Checker = ..., 210 | enabled: bool = ..., 211 | language: str = ..., 212 | ) -> None: ... 213 | def get_buffer(self) -> typing.Optional[GtkSource.Buffer]: ... 214 | def get_checker(self) -> typing.Optional[Checker]: ... 215 | def get_enabled(self) -> bool: ... 216 | def get_language(self) -> typing.Optional[str]: ... 217 | def get_menu_model(self) -> Gio.MenuModel: ... 218 | def get_tag(self) -> typing.Optional[Gtk.TextTag]: ... 219 | def invalidate_all(self) -> None: ... 220 | @classmethod 221 | def new(cls, buffer: GtkSource.Buffer, checker: Checker) -> TextBufferAdapter: ... 222 | def set_checker(self, checker: Checker) -> None: ... 223 | def set_enabled(self, enabled: bool) -> None: ... 224 | def set_language(self, language: str) -> None: ... 225 | def update_corrections(self) -> None: ... 226 | 227 | class TextBufferAdapterClass(GObject.GPointer): 228 | """ 229 | :Constructors: 230 | 231 | :: 232 | 233 | TextBufferAdapterClass() 234 | """ 235 | 236 | parent_class: GObject.ObjectClass = ... 237 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # 2.16.0 (08 Dec 2025) 2 | 3 | ## Improvements 4 | 5 | * Remove FIXME when override function is typed 6 | 7 | ## Typing 8 | 9 | * Improve type hints for 10 | - Gst* 11 | 12 | ## Bug Fixes 13 | 14 | * Gst module cannot reference itself 15 | * Add [@staticmethod](https://github.com/staticmethod) for override methods 16 | 17 | # 2.15.0 (01 Dec 2025) 18 | 19 | ## Feature 20 | 21 | * Add Gly 22 | * Add GlyGtk4 23 | * Add overridden function docstring 24 | 25 | ## Improvements 26 | 27 | * Add non-GI base classes 28 | * Allow stub for some special python methods 29 | 30 | ## Typing 31 | 32 | * Improve type hints for 33 | - Adw 34 | - Gdk4 35 | - GdkPixbuf 36 | - GdkX11 37 | - GLib 38 | - GObject 39 | - Gsk 40 | - GSound 41 | - Gst* 42 | - Gtk4 43 | - Pango 44 | - PangoCairo 45 | - Spelling 46 | 47 | ## Change 48 | 49 | * Filter out private constants and fields 50 | 51 | ## Bug Fixes 52 | 53 | * Correctly skip field if a method has the same name 54 | * skip closure/destroy arguments preceding current arg 55 | 56 | # 2.14.0 (17 Sep 2025) 57 | 58 | ## Feature 59 | 60 | * Add GIRepository 3.0 61 | * Add win32 1.0 62 | * Add GLibWin32 2.0 63 | * Add GioWin32 2.0 64 | * Add GdkWin32 3.0 and 4.0 65 | * Add Atspi ([#215](https://github.com/pygobject/pygobject-stubs/issues/215)) (#215) 66 | * Add XdpGtk4 ([#212](https://github.com/pygobject/pygobject-stubs/issues/212)) (#212#203) 67 | * Add GExiv2 ([#209](https://github.com/pygobject/pygobject-stubs/issues/209)) (#209) 68 | 69 | ## Typing 70 | 71 | * Improve type hints for 72 | - Adw 73 | - Gdk4 74 | - GdkPixbuf 75 | - GdkX11 76 | - Gio 77 | - Gio 78 | - GIRepository 2.0 79 | - GLib 80 | - GObject 81 | - Graphene 82 | - Gsk 83 | - Gtk4 84 | - Pango 85 | - PangoCairo 86 | - PyGObject 87 | - Secret 88 | - Soup3 89 | - Spelling 90 | 91 | ## Bug Fixes 92 | 93 | * Generator: Handle enums with no attributes 94 | * Generator: Convert Flags with invalid names to int 95 | 96 | # 2.13.0 (11 Mar 2025) 97 | 98 | ## Feature 99 | 100 | * Add GstBase ([#206](https://github.com/pygobject/pygobject-stubs/issues/206)) (#206) 101 | * Add Shumate ([#197](https://github.com/pygobject/pygobject-stubs/issues/197)) (#197) 102 | * Add stubs for IBus 103 | * Add GdkX11 4.0 104 | 105 | ## Typing 106 | 107 | * Improve type hints for 108 | - Gtk4 109 | - Gio 110 | - GObject 111 | - Gdk4 112 | - GLib 113 | - GtkSource5 114 | 115 | ## Change 116 | 117 | * Require Python >=3.9 118 | 119 | # 2.12.0 (31 Oct 2024) 120 | 121 | ## Feature 122 | 123 | * Add Spelling 1 124 | * Add GstRtp and GstRtps ([#188](https://github.com/pygobject/pygobject-stubs/issues/188)) (#188) 125 | 126 | ## Typing 127 | 128 | * Improve type hints for 129 | - Flatpak: Update to 1.15.10 130 | - Gdk3 131 | - GdkPixbuf: Update to 2.42.12 132 | - Gio 133 | - GIRepository: Update to 1.80.1 134 | - GLib: Update to 2.80.5 135 | - Graphene 136 | - Gsk 137 | - Gst 138 | - Gst: Update to 1.24.7 139 | - GstRtspServer 140 | - Gtk3 141 | - Gtk4: Update to 4.16.2 142 | - GtkSource5: Update to 5.12.1 143 | - Pango: Update to 1.54.0 144 | 145 | # 2.11.0 (03 Apr 2024) 146 | 147 | ## Feature 148 | 149 | * Add Goa ([#163](https://github.com/pygobject/pygobject-stubs/issues/163)) (#163) 150 | * Add JavaSciptCore 6.0 for WebKit 151 | * Add Notify 0.7 ([#175](https://github.com/pygobject/pygobject-stubs/issues/175)) (#175) 152 | * Add Panel 153 | * Add Poppler ([#180](https://github.com/pygobject/pygobject-stubs/issues/180)) (#180) 154 | * Add Secret ([#163](https://github.com/pygobject/pygobject-stubs/issues/163)) (#163) 155 | * Add XApp 156 | * Add Xdp ([#178](https://github.com/pygobject/pygobject-stubs/issues/178)) (#178) 157 | * Add WebKit-6.0 158 | 159 | ## Improvements 160 | 161 | * Generator: Rename optional argument 162 | 163 | ## Typing 164 | 165 | * Improve type hints for 166 | - Adw: Upgrade stubs to 1.5 ([#181](https://github.com/pygobject/pygobject-stubs/issues/181)) (#181) 167 | - Gtk3 168 | - Gtk4: Upgrade stubs to 4.14 ([#182](https://github.com/pygobject/pygobject-stubs/issues/182)) (#182) 169 | 170 | ## Bug Fixes 171 | 172 | * Gsk: Use pyi extension 173 | * Generator: Fix regex class pattern (#168) 174 | 175 | # 2.10.0 (16 Nov 2023) 176 | 177 | ## Feature 178 | 179 | * Add Handy 180 | * Add GstWebRTC 181 | * Add GstSdp 182 | 183 | ## Improvements 184 | 185 | * Generator: Require GIRepository 2.0 186 | 187 | ## Typing 188 | 189 | * Improve type hints for 190 | - Adw 191 | - Gio 192 | - GLib 193 | - GstPbutils 194 | - Gtk4 195 | 196 | ## Bug Fixes 197 | 198 | * Allow GObject.emit to return value 199 | * generator: Fix array length param for functions 200 | 201 | # 2.9.0 (14 Sep 2023) 202 | 203 | ## Feature 204 | 205 | * Add AyatanaAppIndicator3 206 | * Add AppStream and OSTree ([#152](https://github.com/pygobject/pygobject-stubs/issues/152)) (#152) 207 | * Add Flatpak 208 | 209 | ## Improvements 210 | 211 | * generator: Strip documentation strings 212 | 213 | ## Typing 214 | 215 | * Improve type hints for 216 | - AppIndicator3 217 | - Cairo 218 | - Gdk4 219 | - GObject 220 | - Gtk3 221 | - PangoCairo 222 | 223 | ## Bug Fixes 224 | 225 | * generator: Fix documentation if empty 226 | 227 | # 2.8.0 (24 May 2023) 228 | 229 | ## Improvements 230 | 231 | * generator: Check nullability for __init__ 232 | 233 | ## Typing 234 | 235 | * Improve type hints for 236 | - Adw 237 | - Gtk4 238 | 239 | ## Bug Fixes 240 | 241 | * generate: Force varargs if function has closure 242 | * parse: Ignore documentation 243 | 244 | # 2.7.0 (28 Apr 2023) 245 | 246 | ## Improvements 247 | 248 | * Extract class' docstring 249 | 250 | ## Typing 251 | 252 | * Improve type hints for 253 | - Gdk4 254 | - Gtk3 255 | 256 | # 2.6.0 (08 Apr 2023) 257 | 258 | ## Improvements 259 | 260 | * Generator: Correctly type optional props 261 | 262 | ## Typing 263 | 264 | * Improve type hints for 265 | - Adw 266 | - GObject 267 | - Graphene 268 | - Gsk 269 | - Gtk3 270 | - Gtk4 271 | - GtkSource5 272 | - Pango 273 | 274 | ## Bug Fixes 275 | 276 | * Generator: Correct arg info for setter 277 | 278 | # 2.5.0 (21 Mar 2023) 279 | 280 | ## Feature 281 | 282 | * Add Vte (#7) 283 | * Add Rsvg (#116) 284 | 285 | ## Improvements 286 | 287 | * generator: Make file executable 288 | * generator: Add TypeVar _SomeSurface 289 | * generator: Better hints for functions 290 | 291 | ## Typing 292 | 293 | * Improve type hints for 294 | - Gdk4 295 | - Gio 296 | - Gio 297 | - Gtk3 298 | - Gtk4 299 | - GtkSource4 300 | 301 | ## Bug Fixes 302 | 303 | * generator: Fix hash maps 304 | * generator: Use GObject.GInterface for ifaces 305 | 306 | # 2.4.0 (19 Feb 2023) 307 | 308 | ## Feature 309 | 310 | * Add Ggit 311 | 312 | ## Improvements 313 | 314 | * Use GObject introspection to generate more accurate stubs ([#98](https://github.com/pygobject/pygobject-stubs/issues/98)) (#98) 315 | 316 | ## Typing 317 | 318 | * Improve type hints for 319 | - Adw 320 | - Atk 321 | - Gdk3 322 | - Gdk4 323 | - GdkPixbuf 324 | - Geoclue 325 | - Gio 326 | - GLib 327 | - GSound 328 | - Soup3 329 | 330 | # 2.3.1 (08 Feb 2023) 331 | 332 | ## Bug Fixes 333 | 334 | * Fix installing multilib stubs 335 | 336 | # 2.3.0 (08 Feb 2023) 337 | 338 | ## Feature 339 | 340 | * Add GtkSource5 341 | 342 | ## Typing 343 | 344 | * Improve type hints for 345 | - Adw 346 | - Gdk3 347 | - GeoClue 348 | - GObject 349 | - Gtk3 350 | - Gtk4 351 | - Manette 352 | 353 | ## Bug Fixes 354 | 355 | * Default to GtkSource5 when installing 356 | * Overwrite existing files when building from source 357 | 358 | # 2.2.0 (03 Jan 2023) 359 | 360 | ## Feature 361 | 362 | * Build with a PEP517 in-tree backend 363 | * Add Manette 364 | * Add Adwaita 365 | * Add Gdk4 366 | 367 | ## Typing 368 | 369 | * Improve type hints for 370 | - Gtk4 371 | - Gdk4 372 | - Gtk3 373 | - Soup 374 | - Gio 375 | - GObject 376 | - Soup3 377 | 378 | # 2.1.0 (18 Dec 2022) 379 | 380 | ## Changes 381 | 382 | * Port to pyproject.toml 383 | 384 | # 2.0.0 (18 Dec 2022) 385 | 386 | ## Changes 387 | 388 | * Add install option for multi version libs 389 | * Newest version of lib is installed by default 390 | -------------------------------------------------------------------------------- /src/gi-stubs/repository/AyatanaAppIndicator3.pyi: -------------------------------------------------------------------------------- 1 | from typing import Any 2 | from typing import Callable 3 | from typing import Optional 4 | 5 | from gi.repository import Gdk 6 | from gi.repository import GObject 7 | from gi.repository import Gtk 8 | 9 | INDICATOR_SIGNAL_CONNECTION_CHANGED: str = "connection-changed" 10 | INDICATOR_SIGNAL_NEW_ATTENTION_ICON: str = "new-attention-icon" 11 | INDICATOR_SIGNAL_NEW_ICON: str = "new-icon" 12 | INDICATOR_SIGNAL_NEW_ICON_THEME_PATH: str = "new-icon-theme-path" 13 | INDICATOR_SIGNAL_NEW_LABEL: str = "new-label" 14 | INDICATOR_SIGNAL_NEW_STATUS: str = "new-status" 15 | INDICATOR_SIGNAL_SCROLL_EVENT: str = "scroll-event" 16 | _lock = ... # FIXME Constant 17 | _namespace: str = "AyatanaAppIndicator3" 18 | _version: str = "0.1" 19 | 20 | class Indicator(GObject.Object): 21 | """ 22 | :Constructors: 23 | 24 | :: 25 | 26 | Indicator(**properties) 27 | new(id:str, icon_name:str, category:AyatanaAppIndicator3.IndicatorCategory) -> AyatanaAppIndicator3.Indicator 28 | new_with_path(id:str, icon_name:str, category:AyatanaAppIndicator3.IndicatorCategory, icon_theme_path:str) -> AyatanaAppIndicator3.Indicator 29 | 30 | Object AppIndicator 31 | 32 | Signals from AppIndicator: 33 | scroll-event (gint, GdkScrollDirection) 34 | new-icon () 35 | new-attention-icon () 36 | new-status (gchararray) 37 | new-label (gchararray, gchararray) 38 | connection-changed (gboolean) 39 | new-icon-theme-path (gchararray) 40 | 41 | Properties from AppIndicator: 42 | id -> gchararray: The ID for this indicator 43 | An ID that should be unique, but used consistently by this program and its indicator. 44 | category -> gchararray: Indicator Category 45 | The type of indicator that this represents. Please don't use 'other'. Defaults to 'ApplicationStatus'. 46 | status -> gchararray: Indicator Status 47 | Whether the indicator is shown or requests attention. Defaults to 'Passive'. 48 | icon-name -> gchararray: An icon for the indicator 49 | The default icon that is shown for the indicator. 50 | icon-desc -> gchararray: A description of the icon for the indicator 51 | A description of the default icon that is shown for the indicator. 52 | attention-icon-name -> gchararray: An icon to show when the indicator request attention. 53 | If the indicator sets it's status to 'attention' then this icon is shown. 54 | attention-icon-desc -> gchararray: A description of the icon to show when the indicator request attention. 55 | When the indicator is an attention mode this should describe the icon shown 56 | icon-theme-path -> gchararray: An additional path for custom icons. 57 | An additional place to look for icon names that may be installed by the application. 58 | connected -> gboolean: Whether we're conneced to a watcher 59 | Pretty simple, true if we have a reasonable expectation of being displayed through this object. You should hide your TrayIcon if so. 60 | label -> gchararray: A label next to the icon 61 | A label to provide dynamic information. 62 | label-guide -> gchararray: A string to size the space available for the label. 63 | To ensure that the label does not cause the panel to 'jiggle' this string should provide information on how much space it could take. 64 | ordering-index -> guint: The location that this app indicator should be in the list. 65 | A way to override the default ordering of the applications by providing a very specific idea of where this entry should be placed. 66 | dbus-menu-server -> DbusmenuServer: The internal DBusmenu Server 67 | DBusmenu server which is available for testing the application indicators. 68 | title -> gchararray: Title of the application indicator 69 | A human readable way to refer to this application indicator in the UI. 70 | 71 | Signals from GObject: 72 | notify (GParam) 73 | """ 74 | 75 | class Props: 76 | attention_icon_desc: str 77 | attention_icon_name: str 78 | category: str 79 | connected: bool 80 | icon_desc: str 81 | icon_name: str 82 | icon_theme_path: str 83 | id: str 84 | label: str 85 | label_guide: str 86 | ordering_index: int 87 | status: str 88 | title: str 89 | 90 | props: Props = ... 91 | parent: GObject.Object = ... 92 | 93 | def __init__( 94 | self, 95 | attention_icon_desc: str = ..., 96 | attention_icon_name: str = ..., 97 | category: str = ..., 98 | icon_desc: str = ..., 99 | icon_name: str = ..., 100 | icon_theme_path: str = ..., 101 | id: str = ..., 102 | label: str = ..., 103 | label_guide: str = ..., 104 | ordering_index: int = ..., 105 | status: str = ..., 106 | title: Optional[str] = ..., 107 | ): ... 108 | def build_menu_from_desktop( 109 | self, desktop_file: str, desktop_profile: str 110 | ) -> None: ... 111 | def do_connection_changed(self, connected: bool, *user_data: Any) -> None: ... 112 | def do_new_attention_icon(self, *user_data: Any) -> None: ... 113 | def do_new_icon(self, *user_data: Any) -> None: ... 114 | def do_new_icon_theme_path(self, icon_theme_path: str, *user_data: Any) -> None: ... 115 | def do_new_label(self, label: str, guide: str, *user_data: Any) -> None: ... 116 | def do_new_status(self, status: str, *user_data: Any) -> None: ... 117 | def do_scroll_event( 118 | self, delta: int, direction: Gdk.ScrollDirection, *user_data: Any 119 | ) -> None: ... 120 | def do_unfallback(self, status_icon: Gtk.StatusIcon) -> None: ... 121 | def get_attention_icon(self) -> str: ... 122 | def get_attention_icon_desc(self) -> str: ... 123 | def get_category(self) -> IndicatorCategory: ... 124 | def get_icon(self) -> str: ... 125 | def get_icon_desc(self) -> str: ... 126 | def get_icon_theme_path(self) -> str: ... 127 | def get_id(self) -> str: ... 128 | def get_label(self) -> str: ... 129 | def get_label_guide(self) -> str: ... 130 | def get_menu(self) -> Gtk.Menu: ... 131 | def get_ordering_index(self) -> int: ... 132 | def get_secondary_activate_target(self) -> Gtk.Widget: ... 133 | def get_status(self) -> IndicatorStatus: ... 134 | def get_title(self) -> str: ... 135 | @classmethod 136 | def new(cls, id: str, icon_name: str, category: IndicatorCategory) -> Indicator: ... 137 | @classmethod 138 | def new_with_path( 139 | cls, id: str, icon_name: str, category: IndicatorCategory, icon_theme_path: str 140 | ) -> Indicator: ... 141 | def set_attention_icon(self, icon_name: str) -> None: ... 142 | def set_attention_icon_full(self, icon_name: str, icon_desc: str) -> None: ... 143 | def set_icon(self, icon_name: str) -> None: ... 144 | def set_icon_full(self, icon_name: str, icon_desc: str) -> None: ... 145 | def set_icon_theme_path(self, icon_theme_path: str) -> None: ... 146 | def set_label(self, label: str, guide: str) -> None: ... 147 | def set_menu(self, menu: Optional[Gtk.Menu] = None) -> None: ... 148 | def set_ordering_index(self, ordering_index: int) -> None: ... 149 | def set_secondary_activate_target( 150 | self, menuitem: Optional[Gtk.Widget] = None 151 | ) -> None: ... 152 | def set_status(self, status: IndicatorStatus) -> None: ... 153 | def set_title(self, title: Optional[str] = None) -> None: ... 154 | 155 | class IndicatorClass(GObject.GPointer): 156 | """ 157 | :Constructors: 158 | 159 | :: 160 | 161 | IndicatorClass() 162 | """ 163 | 164 | parent_class: GObject.ObjectClass = ... 165 | new_icon: Callable[..., None] = ... 166 | new_attention_icon: Callable[..., None] = ... 167 | new_status: Callable[..., None] = ... 168 | new_icon_theme_path: Callable[..., None] = ... 169 | new_label: Callable[..., None] = ... 170 | connection_changed: Callable[..., None] = ... 171 | scroll_event: Callable[..., None] = ... 172 | app_indicator_reserved_ats: Callable[[], None] = ... 173 | fallback: None = ... 174 | unfallback: Callable[[Indicator, Gtk.StatusIcon], None] = ... 175 | app_indicator_reserved_1: Callable[[], None] = ... 176 | app_indicator_reserved_2: Callable[[], None] = ... 177 | app_indicator_reserved_3: Callable[[], None] = ... 178 | app_indicator_reserved_4: Callable[[], None] = ... 179 | app_indicator_reserved_5: Callable[[], None] = ... 180 | app_indicator_reserved_6: Callable[[], None] = ... 181 | 182 | class IndicatorCategory(GObject.GEnum): 183 | APPLICATION_STATUS = 0 184 | COMMUNICATIONS = 1 185 | HARDWARE = 3 186 | OTHER = 4 187 | SYSTEM_SERVICES = 2 188 | 189 | class IndicatorStatus(GObject.GEnum): 190 | ACTIVE = 1 191 | ATTENTION = 2 192 | PASSIVE = 0 193 | -------------------------------------------------------------------------------- /src/gi-stubs/repository/AppIndicator3.pyi: -------------------------------------------------------------------------------- 1 | from typing import Any 2 | from typing import Callable 3 | from typing import Optional 4 | 5 | from gi.repository import Gdk 6 | from gi.repository import GObject 7 | from gi.repository import Gtk 8 | 9 | INDICATOR_SIGNAL_CONNECTION_CHANGED: str = "connection-changed" 10 | INDICATOR_SIGNAL_NEW_ATTENTION_ICON: str = "new-attention-icon" 11 | INDICATOR_SIGNAL_NEW_ICON: str = "new-icon" 12 | INDICATOR_SIGNAL_NEW_ICON_THEME_PATH: str = "new-icon-theme-path" 13 | INDICATOR_SIGNAL_NEW_LABEL: str = "new-label" 14 | INDICATOR_SIGNAL_NEW_STATUS: str = "new-status" 15 | INDICATOR_SIGNAL_SCROLL_EVENT: str = "scroll-event" 16 | _lock = ... # FIXME Constant 17 | _namespace: str = "AppIndicator3" 18 | _version: str = "0.1" 19 | 20 | class Indicator(GObject.Object): 21 | """ 22 | :Constructors: 23 | 24 | :: 25 | 26 | Indicator(**properties) 27 | new(id:str, icon_name:str, category:AppIndicator3.IndicatorCategory) -> AppIndicator3.Indicator 28 | new_with_path(id:str, icon_name:str, category:AppIndicator3.IndicatorCategory, icon_theme_path:str) -> AppIndicator3.Indicator 29 | 30 | Object AppIndicator 31 | 32 | Signals from AppIndicator: 33 | scroll-event (gint, GdkScrollDirection) 34 | new-icon () 35 | new-attention-icon () 36 | new-status (gchararray) 37 | new-label (gchararray, gchararray) 38 | connection-changed (gboolean) 39 | new-icon-theme-path (gchararray) 40 | 41 | Properties from AppIndicator: 42 | id -> gchararray: The ID for this indicator 43 | An ID that should be unique, but used consistently by this program and its indicator. 44 | category -> gchararray: Indicator Category 45 | The type of indicator that this represents. Please don't use 'other'. Defaults to 'ApplicationStatus'. 46 | status -> gchararray: Indicator Status 47 | Whether the indicator is shown or requests attention. Defaults to 'Passive'. 48 | icon-name -> gchararray: An icon for the indicator 49 | The default icon that is shown for the indicator. 50 | icon-desc -> gchararray: A description of the icon for the indicator 51 | A description of the default icon that is shown for the indicator. 52 | attention-icon-name -> gchararray: An icon to show when the indicator request attention. 53 | If the indicator sets it's status to 'attention' then this icon is shown. 54 | attention-icon-desc -> gchararray: A description of the icon to show when the indicator request attention. 55 | When the indicator is an attention mode this should describe the icon shown 56 | icon-theme-path -> gchararray: An additional path for custom icons. 57 | An additional place to look for icon names that may be installed by the application. 58 | connected -> gboolean: Whether we're conneced to a watcher 59 | Pretty simple, true if we have a reasonable expectation of being displayed through this object. You should hide your TrayIcon if so. 60 | label -> gchararray: A label next to the icon 61 | A label to provide dynamic information. 62 | label-guide -> gchararray: A string to size the space available for the label. 63 | To ensure that the label does not cause the panel to 'jiggle' this string should provide information on how much space it could take. 64 | ordering-index -> guint: The location that this app indicator should be in the list. 65 | A way to override the default ordering of the applications by providing a very specific idea of where this entry should be placed. 66 | dbus-menu-server -> DbusmenuServer: The internal DBusmenu Server 67 | DBusmenu server which is available for testing the application indicators. 68 | title -> gchararray: Title of the application indicator 69 | A human readable way to refer to this application indicator in the UI. 70 | 71 | Signals from GObject: 72 | notify (GParam) 73 | """ 74 | 75 | class Props: 76 | attention_icon_desc: str 77 | attention_icon_name: str 78 | category: str 79 | connected: bool 80 | icon_desc: str 81 | icon_name: str 82 | icon_theme_path: str 83 | id: str 84 | label: str 85 | label_guide: str 86 | ordering_index: int 87 | status: str 88 | title: str 89 | 90 | props: Props = ... 91 | parent: GObject.Object = ... 92 | priv: IndicatorPrivate = ... 93 | 94 | def __init__( 95 | self, 96 | attention_icon_desc: str = ..., 97 | attention_icon_name: str = ..., 98 | category: str = ..., 99 | icon_desc: str = ..., 100 | icon_name: str = ..., 101 | icon_theme_path: str = ..., 102 | id: str = ..., 103 | label: str = ..., 104 | label_guide: str = ..., 105 | ordering_index: int = ..., 106 | status: str = ..., 107 | title: str = ..., 108 | ): ... 109 | def build_menu_from_desktop( 110 | self, desktop_file: str, desktop_profile: str 111 | ) -> None: ... 112 | def do_connection_changed(self, connected: bool, *user_data: Any) -> None: ... 113 | def do_new_attention_icon(self, *user_data: Any) -> None: ... 114 | def do_new_icon(self, *user_data: Any) -> None: ... 115 | def do_new_icon_theme_path(self, icon_theme_path: str, *user_data: Any) -> None: ... 116 | def do_new_label(self, label: str, guide: str, *user_data: Any) -> None: ... 117 | def do_new_status(self, status: str, *user_data: Any) -> None: ... 118 | def do_scroll_event( 119 | self, delta: int, direction: Gdk.ScrollDirection, *user_data: Any 120 | ) -> None: ... 121 | def do_unfallback(self, status_icon: Gtk.StatusIcon) -> None: ... 122 | def get_attention_icon(self) -> str: ... 123 | def get_attention_icon_desc(self) -> str: ... 124 | def get_category(self) -> IndicatorCategory: ... 125 | def get_icon(self) -> str: ... 126 | def get_icon_desc(self) -> str: ... 127 | def get_icon_theme_path(self) -> str: ... 128 | def get_id(self) -> str: ... 129 | def get_label(self) -> str: ... 130 | def get_label_guide(self) -> str: ... 131 | def get_menu(self) -> Gtk.Menu: ... 132 | def get_ordering_index(self) -> int: ... 133 | def get_secondary_activate_target(self) -> Gtk.Widget: ... 134 | def get_status(self) -> IndicatorStatus: ... 135 | def get_title(self) -> str: ... 136 | @classmethod 137 | def new(cls, id: str, icon_name: str, category: IndicatorCategory) -> Indicator: ... 138 | @classmethod 139 | def new_with_path( 140 | cls, id: str, icon_name: str, category: IndicatorCategory, icon_theme_path: str 141 | ) -> Indicator: ... 142 | def set_attention_icon(self, icon_name: str) -> None: ... 143 | def set_attention_icon_full(self, icon_name: str, icon_desc: str) -> None: ... 144 | def set_icon(self, icon_name: str) -> None: ... 145 | def set_icon_full(self, icon_name: str, icon_desc: str) -> None: ... 146 | def set_icon_theme_path(self, icon_theme_path: str) -> None: ... 147 | def set_label(self, label: str, guide: str) -> None: ... 148 | def set_menu(self, menu: Optional[Gtk.Menu] = None) -> None: ... 149 | def set_ordering_index(self, ordering_index: int) -> None: ... 150 | def set_secondary_activate_target( 151 | self, menuitem: Optional[Gtk.Widget] = None 152 | ) -> None: ... 153 | def set_status(self, status: IndicatorStatus) -> None: ... 154 | def set_title(self, title: Optional[str] = None) -> None: ... 155 | 156 | class IndicatorClass(GObject.GPointer): 157 | """ 158 | :Constructors: 159 | 160 | :: 161 | 162 | IndicatorClass() 163 | """ 164 | 165 | parent_class: GObject.ObjectClass = ... 166 | new_icon: Callable[..., None] = ... 167 | new_attention_icon: Callable[..., None] = ... 168 | new_status: Callable[..., None] = ... 169 | new_icon_theme_path: Callable[..., None] = ... 170 | new_label: Callable[..., None] = ... 171 | connection_changed: Callable[..., None] = ... 172 | scroll_event: Callable[..., None] = ... 173 | app_indicator_reserved_ats: Callable[[], None] = ... 174 | fallback: None = ... 175 | unfallback: Callable[[Indicator, Gtk.StatusIcon], None] = ... 176 | app_indicator_reserved_1: Callable[[], None] = ... 177 | app_indicator_reserved_2: Callable[[], None] = ... 178 | app_indicator_reserved_3: Callable[[], None] = ... 179 | app_indicator_reserved_4: Callable[[], None] = ... 180 | app_indicator_reserved_5: Callable[[], None] = ... 181 | app_indicator_reserved_6: Callable[[], None] = ... 182 | 183 | class IndicatorPrivate(GObject.GPointer): ... 184 | 185 | class IndicatorCategory(GObject.GEnum): 186 | APPLICATION_STATUS = 0 187 | COMMUNICATIONS = 1 188 | HARDWARE = 3 189 | OTHER = 4 190 | SYSTEM_SERVICES = 2 191 | 192 | class IndicatorStatus(GObject.GEnum): 193 | ACTIVE = 1 194 | ATTENTION = 2 195 | PASSIVE = 0 196 | -------------------------------------------------------------------------------- /src/gi-stubs/repository/Farstream.pyi: -------------------------------------------------------------------------------- 1 | from gi.repository import GObject 2 | from gi.repository import Gst 3 | 4 | CODEC_FORMAT: str = ... 5 | CODEC_ID_ANY: int = ... 6 | CODEC_ID_DISABLE: int = ... 7 | RTP_HEADER_EXTENSION_FORMAT: str = ... 8 | 9 | def candidate_list_copy(*args, **kwargs): ... 10 | def codec_list_are_equal(*args, **kwargs): ... 11 | def codec_list_copy(*args, **kwargs): ... 12 | def codec_list_from_keyfile(*args, **kwargs): ... 13 | def error_quark(*args, **kwargs): ... 14 | def media_type_to_string(*args, **kwargs): ... 15 | def parse_error(*args, **kwargs): ... 16 | def rtp_header_extension_list_copy(*args, **kwargs): ... 17 | def rtp_header_extension_list_from_keyfile(*args, **kwargs): ... 18 | def utils_get_default_codec_preferences(*args, **kwargs): ... 19 | def utils_get_default_rtp_header_extension_preferences(*args, **kwargs): ... 20 | def utils_set_bitrate(*args, **kwargs): ... 21 | def value_set_candidate_list(*args, **kwargs): ... 22 | 23 | class Candidate: 24 | base_ip = ... 25 | base_port = ... 26 | component_id = ... 27 | foundation = ... 28 | ip = ... 29 | password = ... 30 | port = ... 31 | priority = ... 32 | proto = ... 33 | ttl = ... 34 | type = ... 35 | username = ... 36 | 37 | def new(*args, **kwargs): ... 38 | def new_full(*args, **kwargs): ... 39 | 40 | class CandidateList: ... 41 | 42 | class Codec: 43 | channels = ... 44 | clock_rate = ... 45 | encoding_name = ... 46 | feedback_params = ... 47 | id = ... 48 | media_type = ... 49 | minimum_reporting_interval = ... 50 | optional_params = ... 51 | 52 | def add_feedback_parameter(*args, **kwargs): ... 53 | def add_optional_parameter(*args, **kwargs): ... 54 | def are_equal(*args, **kwargs): ... 55 | def get_feedback_parameter(*args, **kwargs): ... 56 | def get_optional_parameter(*args, **kwargs): ... 57 | def new(*args, **kwargs): ... 58 | def remove_feedback_parameter(*args, **kwargs): ... 59 | def remove_optional_parameter(*args, **kwargs): ... 60 | def to_string(*args, **kwargs): ... 61 | 62 | class CodecGList: 63 | def are_equal(*args, **kwargs): ... 64 | def from_keyfile(*args, **kwargs): ... 65 | 66 | class CodecParameter: 67 | name = ... 68 | value = ... 69 | 70 | def free(*args, **kwargs): ... 71 | 72 | class Conference(Gst.Bin): 73 | _padding = ... 74 | 75 | def new_participant(*args, **kwargs): ... 76 | def new_session(self, media_type: MediaType) -> Session: ... 77 | def do_new_participant(self, *args, **kwargs): ... 78 | def do_new_session(self, *args, **kwargs): ... 79 | 80 | class ElementAddedNotifier: 81 | parent = ... 82 | priv = ... 83 | 84 | def add(*args, **kwargs): ... 85 | def new(*args, **kwargs): ... 86 | def remove(*args, **kwargs): ... 87 | def set_default_properties(*args, **kwargs): ... 88 | def set_properties_from_file(*args, **kwargs): ... 89 | def set_properties_from_keyfile(*args, **kwargs): ... 90 | 91 | class FeedbackParameter: 92 | extra_params = ... 93 | subtype = ... 94 | type = ... 95 | 96 | def free(*args, **kwargs): ... 97 | 98 | class Participant: 99 | _padding = ... 100 | mutex = ... 101 | parent = ... 102 | priv = ... 103 | 104 | class Plugin: 105 | parent = ... 106 | priv = ... 107 | type = ... 108 | unused = ... 109 | 110 | def list_available(*args, **kwargs): ... 111 | def register_static(*args, **kwargs): ... 112 | 113 | class RtpHeaderExtension: 114 | direction = ... 115 | id = ... 116 | uri = ... 117 | 118 | def are_equal(*args, **kwargs): ... 119 | def new(*args, **kwargs): ... 120 | 121 | class RtpHeaderExtensionGList: 122 | def from_keyfile(*args, **kwargs): ... 123 | 124 | class Session: 125 | _padding = ... 126 | parent = ... 127 | priv = ... 128 | 129 | def codecs_need_resend(*args, **kwargs): ... 130 | def destroy(*args, **kwargs): ... 131 | def emit_error(*args, **kwargs): ... 132 | def get_stream_transmitter_type(*args, **kwargs): ... 133 | def list_transmitters(*args, **kwargs): ... 134 | def new_stream(*args, **kwargs): ... 135 | def parse_codecs_changed(*args, **kwargs): ... 136 | def parse_send_codec_changed(*args, **kwargs): ... 137 | def parse_telephony_event_started(*args, **kwargs): ... 138 | def parse_telephony_event_stopped(*args, **kwargs): ... 139 | def set_allowed_caps(*args, **kwargs): ... 140 | def set_codec_preferences(*args, **kwargs): ... 141 | def set_encryption_parameters(*args, **kwargs): ... 142 | def set_send_codec(*args, **kwargs): ... 143 | def start_telephony_event(*args, **kwargs): ... 144 | def stop_telephony_event(*args, **kwargs): ... 145 | def do_codecs_need_resend(self, *args, **kwargs): ... 146 | def do_get_stream_transmitter_type(self, *args, **kwargs): ... 147 | def do_list_transmitters(self, *args, **kwargs): ... 148 | def do_new_stream(self, *args, **kwargs): ... 149 | def do_set_allowed_caps(self, *args, **kwargs): ... 150 | def do_set_codec_preferences(self, *args, **kwargs): ... 151 | def do_set_encryption_parameters(self, *args, **kwargs): ... 152 | def do_set_send_codec(self, *args, **kwargs): ... 153 | def do_start_telephony_event(self, *args, **kwargs): ... 154 | def do_stop_telephony_event(self, *args, **kwargs): ... 155 | 156 | class Stream: 157 | _padding = ... 158 | parent = ... 159 | priv = ... 160 | 161 | def add_id(*args, **kwargs): ... 162 | def add_remote_candidates(*args, **kwargs): ... 163 | def destroy(*args, **kwargs): ... 164 | def emit_error(*args, **kwargs): ... 165 | def emit_src_pad_added(*args, **kwargs): ... 166 | def force_remote_candidates(*args, **kwargs): ... 167 | def iterate_src_pads(*args, **kwargs): ... 168 | def parse_component_state_changed(*args, **kwargs): ... 169 | def parse_local_candidates_prepared(*args, **kwargs): ... 170 | def parse_new_active_candidate_pair(*args, **kwargs): ... 171 | def parse_new_local_candidate(*args, **kwargs): ... 172 | def parse_recv_codecs_changed(*args, **kwargs): ... 173 | def set_decryption_parameters(*args, **kwargs): ... 174 | def set_remote_codecs(*args, **kwargs): ... 175 | def set_transmitter(*args, **kwargs): ... 176 | def set_transmitter_ht(*args, **kwargs): ... 177 | def do_add_id(self, *args, **kwargs): ... 178 | def do_add_remote_candidates(self, *args, **kwargs): ... 179 | def do_force_remote_candidates(self, *args, **kwargs): ... 180 | def do_set_decryption_parameters(self, *args, **kwargs): ... 181 | def do_set_remote_codecs(self, *args, **kwargs): ... 182 | def do_set_transmitter(self, *args, **kwargs): ... 183 | 184 | class StreamTransmitter: 185 | _padding = ... 186 | parent = ... 187 | priv = ... 188 | 189 | def add_remote_candidates(*args, **kwargs): ... 190 | def emit_error(*args, **kwargs): ... 191 | def force_remote_candidates(*args, **kwargs): ... 192 | def gather_local_candidates(*args, **kwargs): ... 193 | def stop(*args, **kwargs): ... 194 | def do_add_remote_candidates(self, *args, **kwargs): ... 195 | def do_force_remote_candidates(self, *args, **kwargs): ... 196 | def do_gather_local_candidates(self, *args, **kwargs): ... 197 | def do_stop(self, *args, **kwargs): ... 198 | 199 | class Transmitter: 200 | _padding = ... 201 | construction_error = ... 202 | parent = ... 203 | priv = ... 204 | 205 | def emit_error(*args, **kwargs): ... 206 | def get_stream_transmitter_type(*args, **kwargs): ... 207 | def list_available(*args, **kwargs): ... 208 | def new(*args, **kwargs): ... 209 | def new_stream_transmitter(*args, **kwargs): ... 210 | def do_get_stream_transmitter_type(self, *args, **kwargs): ... 211 | def do_new_stream_transmitter(self, *args, **kwargs): ... 212 | 213 | class StreamDirection(GObject.GFlags): 214 | NONE = ... 215 | SEND = ... 216 | RECV = ... 217 | BOTH = ... 218 | 219 | class CandidateType(GObject.GEnum): 220 | HOST = ... 221 | SRFLX = ... 222 | PRFLX = ... 223 | RELAY = ... 224 | MULTICAST = ... 225 | 226 | class ComponentType(GObject.GEnum): 227 | NONE = ... 228 | RTP = ... 229 | RTCP = ... 230 | 231 | class DTMFEvent(GObject.GEnum): 232 | STAR = ... 233 | POUND = ... 234 | A = ... 235 | B = ... 236 | C = ... 237 | D = ... 238 | 239 | class DTMFMethod(GObject.GEnum): 240 | RTP_RFC4733 = ... 241 | SOUND = ... 242 | 243 | class Error(GObject.GEnum): 244 | CONSTRUCTION = ... 245 | INTERNAL = ... 246 | INVALID_ARGUMENTS = ... 247 | NETWORK = ... 248 | NOT_IMPLEMENTED = ... 249 | NEGOTIATION_FAILED = ... 250 | UNKNOWN_CODEC = ... 251 | NO_CODECS = ... 252 | NO_CODECS_LEFT = ... 253 | CONNECTION_FAILED = ... 254 | DISPOSED = ... 255 | ALREADY_EXISTS = ... 256 | quark = ... 257 | 258 | class MediaType(GObject.GEnum): 259 | AUDIO = ... 260 | VIDEO = ... 261 | APPLICATION = ... 262 | LAST = ... 263 | to_string = ... 264 | 265 | class NetworkProtocol(GObject.GEnum): 266 | UDP = ... 267 | TCP = ... 268 | TCP_PASSIVE = ... 269 | TCP_ACTIVE = ... 270 | TCP_SO = ... 271 | 272 | class StreamState(GObject.GEnum): 273 | FAILED = ... 274 | DISCONNECTED = ... 275 | GATHERING = ... 276 | CONNECTING = ... 277 | CONNECTED = ... 278 | READY = ... 279 | -------------------------------------------------------------------------------- /src/gi-stubs/repository/Gly.pyi: -------------------------------------------------------------------------------- 1 | import typing 2 | 3 | import enum 4 | 5 | from gi.repository import Gio 6 | from gi.repository import GLib 7 | from gi.repository import GObject 8 | 9 | T = typing.TypeVar("T") 10 | 11 | _lock = ... # FIXME Constant 12 | _namespace: str = "Gly" 13 | _version: str = "2" 14 | 15 | def loader_error_quark() -> int: ... 16 | def memory_format_has_alpha(memory_format: MemoryFormat) -> bool: ... 17 | def memory_format_is_premultiplied(memory_format: MemoryFormat) -> bool: ... 18 | 19 | class Cicp(GObject.GBoxed): 20 | """ 21 | :Constructors: 22 | 23 | :: 24 | 25 | Cicp() 26 | """ 27 | 28 | color_primaries: int = ... 29 | transfer_characteristics: int = ... 30 | matrix_coefficients: int = ... 31 | video_full_range_flag: int = ... 32 | def copy(self) -> Cicp: ... 33 | def free(self) -> None: ... 34 | 35 | class Creator(GObject.Object): 36 | """ 37 | :Constructors: 38 | 39 | :: 40 | 41 | Creator(**properties) 42 | new(mime_type:str) -> Gly.Creator 43 | 44 | Object GlyCreator 45 | 46 | Properties from GlyCreator: 47 | sandbox-selector -> GlySandboxSelector: sandbox-selector 48 | mime-type -> gchararray: mime-type 49 | 50 | Signals from GObject: 51 | notify (GParam) 52 | """ 53 | class Props(GObject.Object.Props): 54 | mime_type: str 55 | sandbox_selector: SandboxSelector 56 | 57 | props: Props = ... 58 | def __init__( 59 | self, mime_type: str = ..., sandbox_selector: SandboxSelector = ... 60 | ) -> None: ... 61 | def add_frame( 62 | self, width: int, height: int, memory_format: MemoryFormat, texture: GLib.Bytes 63 | ) -> NewFrame: ... 64 | def add_frame_with_stride( 65 | self, 66 | width: int, 67 | height: int, 68 | stride: int, 69 | memory_format: MemoryFormat, 70 | texture: GLib.Bytes, 71 | ) -> NewFrame: ... 72 | def add_metadata_key_value(self, key: str, value: str) -> bool: ... 73 | def create(self) -> typing.Optional[EncodedImage]: ... 74 | def create_async( 75 | self, 76 | cancellable: typing.Optional[Gio.Cancellable] = None, 77 | callback: typing.Optional[typing.Callable[..., None]] = None, 78 | *user_data: typing.Any, 79 | ) -> None: ... 80 | def create_finish(self, result: Gio.AsyncResult) -> EncodedImage: ... 81 | @classmethod 82 | def new(cls, mime_type: str) -> Creator: ... 83 | def set_encoding_compression(self, compression: int) -> bool: ... 84 | def set_encoding_quality(self, quality: int) -> bool: ... 85 | def set_sandbox_selector(self, sandbox_selector: SandboxSelector) -> bool: ... 86 | 87 | class CreatorClass(GObject.GPointer): 88 | """ 89 | :Constructors: 90 | 91 | :: 92 | 93 | CreatorClass() 94 | """ 95 | 96 | parent_class: GObject.ObjectClass = ... 97 | 98 | class EncodedImage(GObject.Object): 99 | """ 100 | :Constructors: 101 | 102 | :: 103 | 104 | EncodedImage(**properties) 105 | 106 | Object GlyEncodedImage 107 | 108 | Properties from GlyEncodedImage: 109 | data -> GBytes: data 110 | 111 | Signals from GObject: 112 | notify (GParam) 113 | """ 114 | class Props(GObject.Object.Props): 115 | data: GLib.Bytes 116 | 117 | props: Props = ... 118 | def get_data(self) -> GLib.Bytes: ... 119 | 120 | class EncodedImageClass(GObject.GPointer): 121 | """ 122 | :Constructors: 123 | 124 | :: 125 | 126 | EncodedImageClass() 127 | """ 128 | 129 | parent_class: GObject.ObjectClass = ... 130 | 131 | class Frame(GObject.Object): 132 | """ 133 | :Constructors: 134 | 135 | :: 136 | 137 | Frame(**properties) 138 | 139 | Object GlyFrame 140 | 141 | Signals from GObject: 142 | notify (GParam) 143 | """ 144 | def get_buf_bytes(self) -> GLib.Bytes: ... 145 | def get_color_cicp(self) -> typing.Optional[Cicp]: ... 146 | def get_delay(self) -> int: ... 147 | def get_height(self) -> int: ... 148 | def get_memory_format(self) -> MemoryFormat: ... 149 | def get_stride(self) -> int: ... 150 | def get_width(self) -> int: ... 151 | 152 | class FrameClass(GObject.GPointer): 153 | """ 154 | :Constructors: 155 | 156 | :: 157 | 158 | FrameClass() 159 | """ 160 | 161 | parent_class: GObject.ObjectClass = ... 162 | 163 | class FrameRequest(GObject.Object): 164 | """ 165 | :Constructors: 166 | 167 | :: 168 | 169 | FrameRequest(**properties) 170 | new() -> Gly.FrameRequest 171 | 172 | Object GlyFrameRequest 173 | 174 | Properties from GlyFrameRequest: 175 | scale-width -> guint: scale-width 176 | scale-height -> guint: scale-height 177 | loop-animation -> gboolean: loop-animation 178 | 179 | Signals from GObject: 180 | notify (GParam) 181 | """ 182 | class Props(GObject.Object.Props): 183 | loop_animation: bool 184 | scale_height: int 185 | scale_width: int 186 | 187 | props: Props = ... 188 | def __init__(self, loop_animation: bool = ...) -> None: ... 189 | @classmethod 190 | def new(cls) -> FrameRequest: ... 191 | def set_loop_animation(self, loop_animation: bool) -> None: ... 192 | def set_scale(self, width: int, height: int) -> None: ... 193 | 194 | class FrameRequestClass(GObject.GPointer): 195 | """ 196 | :Constructors: 197 | 198 | :: 199 | 200 | FrameRequestClass() 201 | """ 202 | 203 | parent_class: GObject.ObjectClass = ... 204 | 205 | class Image(GObject.Object): 206 | """ 207 | :Constructors: 208 | 209 | :: 210 | 211 | Image(**properties) 212 | 213 | Object GlyImage 214 | 215 | Signals from GObject: 216 | notify (GParam) 217 | """ 218 | def get_height(self) -> int: ... 219 | def get_metadata_key_value(self, key: str) -> typing.Optional[str]: ... 220 | def get_metadata_keys(self) -> list[str]: ... 221 | def get_mime_type(self) -> str: ... 222 | def get_specific_frame(self, frame_request: FrameRequest) -> Frame: ... 223 | def get_specific_frame_async( 224 | self, 225 | frame_request: FrameRequest, 226 | cancellable: typing.Optional[Gio.Cancellable] = None, 227 | callback: typing.Optional[typing.Callable[..., None]] = None, 228 | *user_data: typing.Any, 229 | ) -> None: ... 230 | def get_specific_frame_finish(self, result: Gio.AsyncResult) -> Frame: ... 231 | def get_transformation_orientation(self) -> int: ... 232 | def get_width(self) -> int: ... 233 | def next_frame(self) -> Frame: ... 234 | def next_frame_async( 235 | self, 236 | cancellable: typing.Optional[Gio.Cancellable] = None, 237 | callback: typing.Optional[typing.Callable[..., None]] = None, 238 | *user_data: typing.Any, 239 | ) -> None: ... 240 | def next_frame_finish(self, result: Gio.AsyncResult) -> Frame: ... 241 | 242 | class ImageClass(GObject.GPointer): 243 | """ 244 | :Constructors: 245 | 246 | :: 247 | 248 | ImageClass() 249 | """ 250 | 251 | parent_class: GObject.ObjectClass = ... 252 | 253 | class Loader(GObject.Object): 254 | """ 255 | :Constructors: 256 | 257 | :: 258 | 259 | Loader(**properties) 260 | new(file:Gio.File) -> Gly.Loader 261 | new_for_bytes(bytes:GLib.Bytes) -> Gly.Loader 262 | new_for_stream(stream:Gio.InputStream) -> Gly.Loader 263 | 264 | Object GlyLoader 265 | 266 | Properties from GlyLoader: 267 | file -> GFile: file 268 | stream -> GInputStream: stream 269 | bytes -> GBytes: bytes 270 | cancellable -> GCancellable: cancellable 271 | sandbox-selector -> GlySandboxSelector: sandbox-selector 272 | memory-format-selection -> GlyMemoryFormatSelection: memory-format-selection 273 | apply-transformation -> gboolean: apply-transformation 274 | 275 | Signals from GObject: 276 | notify (GParam) 277 | """ 278 | class Props(GObject.Object.Props): 279 | apply_transformation: bool 280 | bytes: GLib.Bytes 281 | cancellable: Gio.Cancellable 282 | file: Gio.File 283 | memory_format_selection: MemoryFormatSelection 284 | sandbox_selector: SandboxSelector 285 | stream: Gio.InputStream 286 | 287 | props: Props = ... 288 | def __init__( 289 | self, 290 | apply_transformation: bool = ..., 291 | bytes: GLib.Bytes = ..., 292 | cancellable: Gio.Cancellable = ..., 293 | file: Gio.File = ..., 294 | memory_format_selection: MemoryFormatSelection = ..., 295 | sandbox_selector: SandboxSelector = ..., 296 | stream: Gio.InputStream = ..., 297 | ) -> None: ... 298 | @staticmethod 299 | def get_mime_types() -> list[str]: ... 300 | @staticmethod 301 | def get_mime_types_async( 302 | cancellable: typing.Optional[Gio.Cancellable] = None, 303 | callback: typing.Optional[typing.Callable[..., None]] = None, 304 | *user_data: typing.Any, 305 | ) -> None: ... 306 | @staticmethod 307 | def get_mime_types_finish(result: Gio.AsyncResult) -> list[str]: ... 308 | def load(self) -> Image: ... 309 | def load_async( 310 | self, 311 | cancellable: typing.Optional[Gio.Cancellable] = None, 312 | callback: typing.Optional[typing.Callable[..., None]] = None, 313 | *user_data: typing.Any, 314 | ) -> None: ... 315 | def load_finish(self, result: Gio.AsyncResult) -> Image: ... 316 | @classmethod 317 | def new(cls, file: Gio.File) -> Loader: ... 318 | @classmethod 319 | def new_for_bytes(cls, bytes: GLib.Bytes) -> Loader: ... 320 | @classmethod 321 | def new_for_stream(cls, stream: Gio.InputStream) -> Loader: ... 322 | def set_accepted_memory_formats( 323 | self, memory_format_selection: MemoryFormatSelection 324 | ) -> None: ... 325 | def set_apply_transformations(self, apply_transformations: bool) -> None: ... 326 | def set_sandbox_selector(self, sandbox_selector: SandboxSelector) -> None: ... 327 | 328 | class LoaderClass(GObject.GPointer): 329 | """ 330 | :Constructors: 331 | 332 | :: 333 | 334 | LoaderClass() 335 | """ 336 | 337 | parent_class: GObject.ObjectClass = ... 338 | 339 | class NewFrame(GObject.Object): 340 | """ 341 | :Constructors: 342 | 343 | :: 344 | 345 | NewFrame(**properties) 346 | 347 | Object GlyNewFrame 348 | 349 | Signals from GObject: 350 | notify (GParam) 351 | """ 352 | def set_color_icc_profile(self, icc_profile: GLib.Bytes) -> bool: ... 353 | 354 | class NewFrameClass(GObject.GPointer): 355 | """ 356 | :Constructors: 357 | 358 | :: 359 | 360 | NewFrameClass() 361 | """ 362 | 363 | parent_class: GObject.ObjectClass = ... 364 | 365 | class MemoryFormatSelection(enum.IntFlag): 366 | A8B8G8R8 = 64 367 | A8R8G8B8 = 16 368 | A8R8G8B8_PREMULTIPLIED = 2 369 | B8G8R8 = 256 370 | B8G8R8A8 = 8 371 | B8G8R8A8_PREMULTIPLIED = 1 372 | G16 = 4194304 373 | G16A16 = 2097152 374 | G16A16_PREMULTIPLIED = 1048576 375 | G8 = 524288 376 | G8A8 = 262144 377 | G8A8_PREMULTIPLIED = 131072 378 | R16G16B16 = 512 379 | R16G16B16A16 = 2048 380 | R16G16B16A16_FLOAT = 8192 381 | R16G16B16A16_PREMULTIPLIED = 1024 382 | R16G16B16_FLOAT = 4096 383 | R32G32B32A32_FLOAT = 65536 384 | R32G32B32A32_FLOAT_PREMULTIPLIED = 32768 385 | R32G32B32_FLOAT = 16384 386 | R8G8B8 = 128 387 | R8G8B8A8 = 32 388 | R8G8B8A8_PREMULTIPLIED = 4 389 | 390 | class LoaderError(enum.IntEnum): 391 | FAILED = 0 392 | NO_MORE_FRAMES = 2 393 | UNKNOWN_IMAGE_FORMAT = 1 394 | @staticmethod 395 | def quark() -> int: ... 396 | 397 | class MemoryFormat(enum.IntEnum): 398 | A8B8G8R8 = 6 399 | A8R8G8B8 = 4 400 | A8R8G8B8_PREMULTIPLIED = 1 401 | B8G8R8 = 8 402 | B8G8R8A8 = 3 403 | B8G8R8A8_PREMULTIPLIED = 0 404 | G16 = 22 405 | G16A16 = 21 406 | G16A16_PREMULTIPLIED = 20 407 | G8 = 19 408 | G8A8 = 18 409 | G8A8_PREMULTIPLIED = 17 410 | R16G16B16 = 9 411 | R16G16B16A16 = 11 412 | R16G16B16A16_FLOAT = 13 413 | R16G16B16A16_PREMULTIPLIED = 10 414 | R16G16B16_FLOAT = 12 415 | R32G32B32A32_FLOAT = 16 416 | R32G32B32A32_FLOAT_PREMULTIPLIED = 15 417 | R32G32B32_FLOAT = 14 418 | R8G8B8 = 7 419 | R8G8B8A8 = 5 420 | R8G8B8A8_PREMULTIPLIED = 2 421 | @staticmethod 422 | def has_alpha(memory_format: MemoryFormat) -> bool: ... 423 | @staticmethod 424 | def is_premultiplied(memory_format: MemoryFormat) -> bool: ... 425 | 426 | class SandboxSelector(enum.IntEnum): 427 | AUTO = 0 428 | BWRAP = 1 429 | FLATPAK_SPAWN = 2 430 | NOT_SANDBOXED = 3 431 | -------------------------------------------------------------------------------- /src/gi-stubs/repository/GExiv2.pyi: -------------------------------------------------------------------------------- 1 | import typing 2 | 3 | import datetime 4 | from fractions import Fraction 5 | 6 | from gi.repository import Gio 7 | from gi.repository import GLib 8 | from gi.repository import GObject 9 | 10 | T = typing.TypeVar("T") 11 | 12 | MAJOR_VERSION: int = 0 13 | MICRO_VERSION: int = 3 14 | MINOR_VERSION: int = 14 15 | _introspection_module = ... # FIXME Constant 16 | _lock = ... # FIXME Constant 17 | _namespace: str = "GExiv2" 18 | _overrides_module = ... # FIXME Constant 19 | _version: str = "0.10" 20 | 21 | def get_version() -> int: ... 22 | def initialize() -> bool: ... 23 | def log_get_level() -> LogLevel: ... 24 | def log_set_level(level: LogLevel) -> None: ... 25 | def log_use_glib_logging() -> None: ... 26 | 27 | class Metadata(GObject.Object): 28 | """ 29 | :Constructors: 30 | 31 | :: 32 | 33 | Metadata(**properties) 34 | new() -> GExiv2.Metadata 35 | 36 | Object GExiv2Metadata 37 | 38 | Signals from GObject: 39 | notify (GParam) 40 | """ 41 | 42 | parent_instance: GObject.Object = ... 43 | priv: MetadataPrivate = ... 44 | # override 45 | def __init__(self, path: typing.Optional[str] = None): ... 46 | def clear(self) -> None: ... 47 | def clear_comment(self) -> None: ... 48 | def clear_exif(self) -> None: ... 49 | def clear_iptc(self) -> None: ... 50 | def clear_tag(self, tag: str) -> bool: ... 51 | def clear_xmp(self) -> None: ... 52 | def delete_gps_info(self) -> None: ... 53 | def erase_exif_thumbnail(self) -> None: ... 54 | def free(self) -> None: ... 55 | def from_app1_segment(self, data: typing.Sequence[int]) -> bool: ... 56 | def from_stream(self, stream: Gio.InputStream) -> bool: ... 57 | def generate_xmp_packet( 58 | self, xmp_format_flags: XmpFormatFlags, padding: int 59 | ) -> typing.Optional[str]: ... 60 | # override 61 | def get(self, key, default=None) -> typing.Optional[str]: ... 62 | def get_comment(self) -> typing.Optional[str]: ... 63 | # override 64 | def get_date_time(self) -> datetime.datetime: ... 65 | def get_exif_data(self, byte_order: ByteOrder) -> typing.Optional[GLib.Bytes]: ... 66 | # override 67 | def get_exif_tag_rational(self, key) -> typing.Optional[Fraction]: ... 68 | def get_exif_tags(self) -> list[str]: ... 69 | def get_exif_thumbnail(self) -> typing.Tuple[bool, bytes]: ... 70 | # override 71 | def get_exposure_time(self) -> typing.Optional[Fraction]: ... 72 | def get_fnumber(self) -> float: ... 73 | def get_focal_length(self) -> float: ... 74 | def get_gps_altitude(self) -> typing.Tuple[bool, float]: ... 75 | def get_gps_info(self) -> typing.Tuple[bool, float, float, float]: ... 76 | def get_gps_latitude(self) -> typing.Tuple[bool, float]: ... 77 | def get_gps_longitude(self) -> typing.Tuple[bool, float]: ... 78 | def get_iptc_tags(self) -> list[str]: ... 79 | def get_iso_speed(self) -> int: ... 80 | def get_metadata_pixel_height(self) -> int: ... 81 | def get_metadata_pixel_width(self) -> int: ... 82 | def get_mime_type(self) -> str: ... 83 | def get_orientation(self) -> Orientation: ... 84 | def get_pixel_height(self) -> int: ... 85 | def get_pixel_width(self) -> int: ... 86 | def get_preview_image(self, props: PreviewProperties) -> PreviewImage: ... 87 | def get_preview_properties(self) -> typing.Optional[list[PreviewProperties]]: ... 88 | # override 89 | def get_raw(self, key) -> bytes: ... 90 | def get_supports_exif(self) -> bool: ... 91 | def get_supports_iptc(self) -> bool: ... 92 | def get_supports_xmp(self) -> bool: ... 93 | @staticmethod 94 | def get_tag_description(tag: str) -> typing.Optional[str]: ... 95 | def get_tag_interpreted_string(self, tag: str) -> typing.Optional[str]: ... 96 | @staticmethod 97 | def get_tag_label(tag: str) -> typing.Optional[str]: ... 98 | def get_tag_long(self, tag: str) -> int: ... 99 | def get_tag_multiple(self, tag: str) -> typing.Optional[list[str]]: ... 100 | def get_tag_raw(self, tag: str) -> typing.Optional[GLib.Bytes]: ... 101 | def get_tag_string(self, tag: str) -> typing.Optional[str]: ... 102 | @staticmethod 103 | def get_tag_type(tag: str) -> typing.Optional[str]: ... 104 | # override 105 | def get_tags(self) -> list[str]: ... 106 | @staticmethod 107 | def get_xmp_namespace_for_tag(tag: str) -> str: ... 108 | def get_xmp_packet(self) -> typing.Optional[str]: ... 109 | def get_xmp_tags(self) -> list[str]: ... 110 | def has_exif(self) -> bool: ... 111 | def has_iptc(self) -> bool: ... 112 | def has_tag(self, tag: str) -> bool: ... 113 | def has_xmp(self) -> bool: ... 114 | @staticmethod 115 | def is_exif_tag(tag: str) -> bool: ... 116 | @staticmethod 117 | def is_iptc_tag(tag: str) -> bool: ... 118 | @staticmethod 119 | def is_xmp_tag(tag: str) -> bool: ... 120 | @classmethod 121 | def new(cls) -> Metadata: ... 122 | def open_buf(self, data: typing.Sequence[int]) -> bool: ... 123 | # override 124 | def open_path(self, path: typing.Optional[str]): ... 125 | @staticmethod 126 | def register_xmp_namespace(name: str, prefix: str) -> bool: ... 127 | def save_external(self, path: str) -> bool: ... 128 | # override 129 | def save_file(self, path: typing.Optional[str] = None): ... 130 | def set_comment(self, comment: str) -> None: ... 131 | # override 132 | def set_date_time(self, value: str): ... 133 | # override 134 | def set_exif_tag_rational(self, key, fraction: Fraction): ... 135 | def set_exif_thumbnail_from_buffer(self, buffer: typing.Sequence[int]) -> None: ... 136 | def set_exif_thumbnail_from_file(self, path: str) -> bool: ... 137 | def set_gps_info( 138 | self, longitude: float, latitude: float, altitude: float 139 | ) -> bool: ... 140 | def set_metadata_pixel_height(self, height: int) -> None: ... 141 | def set_metadata_pixel_width(self, width: int) -> None: ... 142 | def set_orientation(self, orientation: Orientation) -> None: ... 143 | def set_tag_long(self, tag: str, value: int) -> bool: ... 144 | def set_tag_multiple(self, tag: str, values: typing.Sequence[str]) -> bool: ... 145 | def set_tag_string(self, tag: str, value: str) -> bool: ... 146 | def set_xmp_tag_struct(self, tag: str, type: StructureType) -> bool: ... 147 | def try_clear_tag(self, tag: str) -> bool: ... 148 | def try_delete_gps_info(self) -> None: ... 149 | def try_erase_exif_thumbnail(self) -> None: ... 150 | def try_generate_xmp_packet( 151 | self, xmp_format_flags: XmpFormatFlags, padding: int 152 | ) -> typing.Optional[str]: ... 153 | def try_get_comment(self) -> typing.Optional[str]: ... 154 | def try_get_exif_tag_rational(self, tag: str) -> typing.Tuple[bool, int, int]: ... 155 | def try_get_exposure_time(self) -> typing.Tuple[bool, int, int]: ... 156 | def try_get_fnumber(self) -> float: ... 157 | def try_get_focal_length(self) -> float: ... 158 | def try_get_gps_altitude(self) -> typing.Tuple[bool, float]: ... 159 | def try_get_gps_info(self) -> typing.Tuple[bool, float, float, float]: ... 160 | def try_get_gps_latitude(self) -> typing.Tuple[bool, float]: ... 161 | def try_get_gps_longitude(self) -> typing.Tuple[bool, float]: ... 162 | def try_get_iso_speed(self) -> int: ... 163 | def try_get_metadata_pixel_height(self) -> int: ... 164 | def try_get_metadata_pixel_width(self) -> int: ... 165 | def try_get_orientation(self) -> Orientation: ... 166 | def try_get_preview_image(self, props: PreviewProperties) -> PreviewImage: ... 167 | @staticmethod 168 | def try_get_tag_description(tag: str) -> typing.Optional[str]: ... 169 | def try_get_tag_interpreted_string(self, tag: str) -> typing.Optional[str]: ... 170 | @staticmethod 171 | def try_get_tag_label(tag: str) -> typing.Optional[str]: ... 172 | def try_get_tag_long(self, tag: str) -> int: ... 173 | def try_get_tag_multiple(self, tag: str) -> typing.Optional[list[str]]: ... 174 | def try_get_tag_raw(self, tag: str) -> typing.Optional[GLib.Bytes]: ... 175 | def try_get_tag_string(self, tag: str) -> typing.Optional[str]: ... 176 | @staticmethod 177 | def try_get_tag_type(tag: str) -> typing.Optional[str]: ... 178 | @staticmethod 179 | def try_get_xmp_namespace_for_tag(tag: str) -> str: ... 180 | def try_get_xmp_packet(self) -> typing.Optional[str]: ... 181 | def try_has_tag(self, tag: str) -> bool: ... 182 | @staticmethod 183 | def try_register_xmp_namespace(name: str, prefix: str) -> bool: ... 184 | def try_set_comment(self, comment: str) -> None: ... 185 | def try_set_exif_tag_rational(self, tag: str, nom: int, den: int) -> bool: ... 186 | def try_set_exif_thumbnail_from_buffer( 187 | self, buffer: typing.Sequence[int] 188 | ) -> None: ... 189 | def try_set_gps_info( 190 | self, longitude: float, latitude: float, altitude: float 191 | ) -> bool: ... 192 | def try_set_metadata_pixel_height(self, height: int) -> None: ... 193 | def try_set_metadata_pixel_width(self, width: int) -> None: ... 194 | def try_set_orientation(self, orientation: Orientation) -> None: ... 195 | def try_set_tag_long(self, tag: str, value: int) -> bool: ... 196 | def try_set_tag_multiple(self, tag: str, values: typing.Sequence[str]) -> bool: ... 197 | def try_set_tag_string(self, tag: str, value: str) -> bool: ... 198 | def try_set_xmp_tag_struct(self, tag: str, type: StructureType) -> bool: ... 199 | def try_tag_supports_multiple_values(self, tag: str) -> bool: ... 200 | @staticmethod 201 | def try_unregister_all_xmp_namespaces() -> None: ... 202 | @staticmethod 203 | def try_unregister_xmp_namespace(name: str) -> bool: ... 204 | def try_update_gps_info( 205 | self, longitude: float, latitude: float, altitude: float 206 | ) -> bool: ... 207 | @staticmethod 208 | def unregister_all_xmp_namespaces() -> None: ... 209 | @staticmethod 210 | def unregister_xmp_namespace(name: str) -> bool: ... 211 | def update_gps_info( 212 | self, longitude: float, latitude: float, altitude: float 213 | ) -> bool: ... 214 | 215 | class MetadataClass(GObject.GPointer): 216 | """ 217 | :Constructors: 218 | 219 | :: 220 | 221 | MetadataClass() 222 | """ 223 | 224 | parent_class: GObject.ObjectClass = ... 225 | 226 | class MetadataPrivate(GObject.GPointer): ... 227 | 228 | class PreviewImage(GObject.Object): 229 | """ 230 | :Constructors: 231 | 232 | :: 233 | 234 | PreviewImage(**properties) 235 | 236 | Object GExiv2PreviewImage 237 | 238 | Signals from GObject: 239 | notify (GParam) 240 | """ 241 | 242 | parent_instance: GObject.Object = ... 243 | priv: PreviewImagePrivate = ... 244 | def free(self) -> None: ... 245 | def get_data(self) -> bytes: ... 246 | def get_extension(self) -> str: ... 247 | def get_height(self) -> int: ... 248 | def get_mime_type(self) -> str: ... 249 | def get_width(self) -> int: ... 250 | def try_write_file(self, path: str) -> int: ... 251 | def write_file(self, path: str) -> int: ... 252 | 253 | class PreviewImageClass(GObject.GPointer): 254 | """ 255 | :Constructors: 256 | 257 | :: 258 | 259 | PreviewImageClass() 260 | """ 261 | 262 | parent_class: GObject.ObjectClass = ... 263 | 264 | class PreviewImagePrivate(GObject.GPointer): ... 265 | 266 | class PreviewProperties(GObject.Object): 267 | """ 268 | :Constructors: 269 | 270 | :: 271 | 272 | PreviewProperties(**properties) 273 | 274 | Object GExiv2PreviewProperties 275 | 276 | Signals from GObject: 277 | notify (GParam) 278 | """ 279 | 280 | parent_instance: GObject.Object = ... 281 | priv: PreviewPropertiesPrivate = ... 282 | def get_extension(self) -> str: ... 283 | def get_height(self) -> int: ... 284 | def get_mime_type(self) -> str: ... 285 | def get_size(self) -> int: ... 286 | def get_width(self) -> int: ... 287 | 288 | class PreviewPropertiesClass(GObject.GPointer): 289 | """ 290 | :Constructors: 291 | 292 | :: 293 | 294 | PreviewPropertiesClass() 295 | """ 296 | 297 | parent_class: GObject.ObjectClass = ... 298 | 299 | class PreviewPropertiesPrivate(GObject.GPointer): ... 300 | 301 | class XmpFormatFlags(GObject.GFlags): 302 | EXACT_PACKET_LENGTH = 512 303 | INCLUDE_THUMBNAIL_PAD = 256 304 | OMIT_ALL_FORMATTING = 2048 305 | OMIT_PACKET_WRAPPER = 16 306 | READ_ONLY_PACKET = 32 307 | USE_COMPACT_FORMAT = 64 308 | WRITE_ALIAS_COMMENTS = 1024 309 | 310 | class ByteOrder(GObject.GEnum): 311 | BIG = 1 312 | LITTLE = 0 313 | 314 | class LogLevel(GObject.GEnum): 315 | DEBUG = 0 316 | ERROR = 3 317 | INFO = 1 318 | MUTE = 4 319 | WARN = 2 320 | 321 | class Orientation(GObject.GEnum): 322 | HFLIP = 2 323 | NORMAL = 1 324 | ROT_180 = 3 325 | ROT_270 = 8 326 | ROT_90 = 6 327 | ROT_90_HFLIP = 5 328 | ROT_90_VFLIP = 7 329 | UNSPECIFIED = 0 330 | VFLIP = 4 331 | 332 | class StructureType(GObject.GEnum): 333 | ALT = 20 334 | BAG = 21 335 | LANG = 23 336 | NONE = 0 337 | SEQ = 22 338 | -------------------------------------------------------------------------------- /src/gi-stubs/repository/GdkWayland.pyi: -------------------------------------------------------------------------------- 1 | import typing 2 | 3 | from gi.repository import Gdk 4 | from gi.repository import GObject 5 | from gi.repository import Pango 6 | from typing_extensions import Self 7 | 8 | T = typing.TypeVar("T") 9 | 10 | class WaylandDevice(Gdk.Device): 11 | """ 12 | :Constructors: 13 | 14 | :: 15 | 16 | WaylandDevice(**properties) 17 | 18 | Object GdkWaylandDevice 19 | 20 | Signals from GdkDevice: 21 | changed () 22 | tool-changed (GdkDeviceTool) 23 | 24 | Properties from GdkDevice: 25 | display -> GdkDisplay: display 26 | name -> gchararray: name 27 | source -> GdkInputSource: source 28 | has-cursor -> gboolean: has-cursor 29 | n-axes -> guint: n-axes 30 | vendor-id -> gchararray: vendor-id 31 | product-id -> gchararray: product-id 32 | seat -> GdkSeat: seat 33 | num-touches -> guint: num-touches 34 | tool -> GdkDeviceTool: tool 35 | direction -> PangoDirection: direction 36 | has-bidi-layouts -> gboolean: has-bidi-layouts 37 | caps-lock-state -> gboolean: caps-lock-state 38 | num-lock-state -> gboolean: num-lock-state 39 | scroll-lock-state -> gboolean: scroll-lock-state 40 | modifier-state -> GdkModifierType: modifier-state 41 | layout-names -> GStrv: layout-names 42 | active-layout-index -> gint: active-layout-index 43 | 44 | Signals from GObject: 45 | notify (GParam) 46 | """ 47 | class Props(Gdk.Device.Props): 48 | active_layout_index: int 49 | caps_lock_state: bool 50 | direction: Pango.Direction 51 | display: Gdk.Display 52 | has_bidi_layouts: bool 53 | has_cursor: bool 54 | layout_names: typing.Optional[list[str]] 55 | modifier_state: Gdk.ModifierType 56 | n_axes: int 57 | name: str 58 | num_lock_state: bool 59 | num_touches: int 60 | product_id: typing.Optional[str] 61 | scroll_lock_state: bool 62 | seat: Gdk.Seat 63 | source: Gdk.InputSource 64 | tool: typing.Optional[Gdk.DeviceTool] 65 | vendor_id: typing.Optional[str] 66 | 67 | props: Props = ... 68 | def __init__( 69 | self, 70 | display: Gdk.Display = ..., 71 | has_cursor: bool = ..., 72 | name: str = ..., 73 | num_touches: int = ..., 74 | product_id: str = ..., 75 | seat: Gdk.Seat = ..., 76 | source: Gdk.InputSource = ..., 77 | vendor_id: str = ..., 78 | ) -> None: ... 79 | def get_node_path(self) -> typing.Optional[str]: ... 80 | def get_xkb_keymap(self) -> None: ... 81 | 82 | class WaylandDeviceClass(GObject.GPointer): ... 83 | 84 | class WaylandDisplay(Gdk.Display): 85 | """ 86 | :Constructors: 87 | 88 | :: 89 | 90 | WaylandDisplay(**properties) 91 | 92 | Object GdkWaylandDisplay 93 | 94 | Signals from GdkDisplay: 95 | opened () 96 | closed (gboolean) 97 | seat-added (GdkSeat) 98 | seat-removed (GdkSeat) 99 | setting-changed (gchararray) 100 | 101 | Properties from GdkDisplay: 102 | composited -> gboolean: composited 103 | rgba -> gboolean: rgba 104 | shadow-width -> gboolean: shadow-width 105 | input-shapes -> gboolean: input-shapes 106 | dmabuf-formats -> GdkDmabufFormats: dmabuf-formats 107 | 108 | Signals from GObject: 109 | notify (GParam) 110 | """ 111 | class Props(Gdk.Display.Props): 112 | composited: bool 113 | dmabuf_formats: Gdk.DmabufFormats 114 | input_shapes: bool 115 | rgba: bool 116 | shadow_width: bool 117 | 118 | props: Props = ... 119 | def get_egl_display(self) -> None: ... 120 | def get_startup_notification_id(self) -> typing.Optional[str]: ... 121 | def query_registry(self, global_: str) -> bool: ... 122 | def set_cursor_theme(self, name: str, size: int) -> None: ... 123 | def set_startup_notification_id(self, startup_id: str) -> None: ... 124 | 125 | class WaylandDisplayClass(GObject.GPointer): ... 126 | 127 | class WaylandGLContext(Gdk.GLContext): 128 | """ 129 | :Constructors: 130 | 131 | :: 132 | 133 | WaylandGLContext(**properties) 134 | 135 | Object GdkWaylandGLContext 136 | 137 | Properties from GdkGLContext: 138 | allowed-apis -> GdkGLAPI: allowed-apis 139 | api -> GdkGLAPI: api 140 | shared-context -> GdkGLContext: shared-context 141 | 142 | Properties from GdkDrawContext: 143 | display -> GdkDisplay: display 144 | surface -> GdkSurface: surface 145 | 146 | Signals from GObject: 147 | notify (GParam) 148 | """ 149 | class Props(Gdk.GLContext.Props): 150 | allowed_apis: Gdk.GLAPI 151 | api: Gdk.GLAPI 152 | shared_context: typing.Optional[Gdk.GLContext] 153 | display: typing.Optional[Gdk.Display] 154 | surface: typing.Optional[Gdk.Surface] 155 | 156 | props: Props = ... 157 | def __init__( 158 | self, 159 | allowed_apis: Gdk.GLAPI = ..., 160 | shared_context: Gdk.GLContext = ..., 161 | display: Gdk.Display = ..., 162 | surface: Gdk.Surface = ..., 163 | ) -> None: ... 164 | 165 | class WaylandGLContextClass(GObject.GPointer): ... 166 | 167 | class WaylandMonitor(Gdk.Monitor): 168 | """ 169 | :Constructors: 170 | 171 | :: 172 | 173 | WaylandMonitor(**properties) 174 | 175 | Object GdkWaylandMonitor 176 | 177 | Signals from GdkMonitor: 178 | invalidate () 179 | 180 | Properties from GdkMonitor: 181 | description -> gchararray: description 182 | display -> GdkDisplay: display 183 | manufacturer -> gchararray: manufacturer 184 | model -> gchararray: model 185 | connector -> gchararray: connector 186 | scale-factor -> gint: scale-factor 187 | scale -> gdouble: scale 188 | geometry -> GdkRectangle: geometry 189 | width-mm -> gint: width-mm 190 | height-mm -> gint: height-mm 191 | refresh-rate -> gint: refresh-rate 192 | subpixel-layout -> GdkSubpixelLayout: subpixel-layout 193 | valid -> gboolean: valid 194 | 195 | Signals from GObject: 196 | notify (GParam) 197 | """ 198 | class Props(Gdk.Monitor.Props): 199 | connector: typing.Optional[str] 200 | description: typing.Optional[str] 201 | display: Gdk.Display 202 | geometry: Gdk.Rectangle 203 | height_mm: int 204 | manufacturer: typing.Optional[str] 205 | model: typing.Optional[str] 206 | refresh_rate: int 207 | scale: float 208 | scale_factor: int 209 | subpixel_layout: Gdk.SubpixelLayout 210 | valid: bool 211 | width_mm: int 212 | 213 | props: Props = ... 214 | def __init__(self, display: Gdk.Display = ...) -> None: ... 215 | 216 | class WaylandMonitorClass(GObject.GPointer): ... 217 | 218 | class WaylandPopup(WaylandSurface, Gdk.Popup): 219 | """ 220 | :Constructors: 221 | 222 | :: 223 | 224 | WaylandPopup(**properties) 225 | 226 | Object GdkWaylandPopup 227 | 228 | Signals from GdkSurface: 229 | layout (gint, gint) 230 | render (CairoRegion) -> gboolean 231 | event (gpointer) -> gboolean 232 | enter-monitor (GdkMonitor) 233 | leave-monitor (GdkMonitor) 234 | 235 | Properties from GdkSurface: 236 | cursor -> GdkCursor: cursor 237 | display -> GdkDisplay: display 238 | frame-clock -> GdkFrameClock: frame-clock 239 | mapped -> gboolean: mapped 240 | width -> gint: width 241 | height -> gint: height 242 | scale-factor -> gint: scale-factor 243 | scale -> gdouble: scale 244 | 245 | Signals from GObject: 246 | notify (GParam) 247 | """ 248 | class Props(WaylandSurface.Props): 249 | cursor: typing.Optional[Gdk.Cursor] 250 | display: Gdk.Display 251 | frame_clock: Gdk.FrameClock 252 | height: int 253 | mapped: bool 254 | scale: float 255 | scale_factor: int 256 | width: int 257 | autohide: bool 258 | parent: typing.Optional[Gdk.Surface] 259 | 260 | props: Props = ... 261 | def __init__( 262 | self, 263 | cursor: typing.Optional[Gdk.Cursor] = ..., 264 | display: Gdk.Display = ..., 265 | frame_clock: Gdk.FrameClock = ..., 266 | autohide: bool = ..., 267 | parent: Gdk.Surface = ..., 268 | ) -> None: ... 269 | 270 | class WaylandSeat(Gdk.Seat): 271 | """ 272 | :Constructors: 273 | 274 | :: 275 | 276 | WaylandSeat(**properties) 277 | 278 | Object GdkWaylandSeat 279 | 280 | Signals from GdkSeat: 281 | device-added (GdkDevice) 282 | device-removed (GdkDevice) 283 | tool-added (GdkDeviceTool) 284 | tool-removed (GdkDeviceTool) 285 | 286 | Properties from GdkSeat: 287 | display -> GdkDisplay: display 288 | 289 | Signals from GObject: 290 | notify (GParam) 291 | """ 292 | class Props(Gdk.Seat.Props): 293 | display: Gdk.Display 294 | 295 | props: Props = ... 296 | def __init__(self, display: Gdk.Display = ...) -> None: ... 297 | 298 | class WaylandSeatClass(GObject.GPointer): ... 299 | 300 | class WaylandSurface(Gdk.Surface): 301 | """ 302 | :Constructors: 303 | 304 | :: 305 | 306 | WaylandSurface(**properties) 307 | 308 | Object GdkWaylandSurface 309 | 310 | Signals from GdkSurface: 311 | layout (gint, gint) 312 | render (CairoRegion) -> gboolean 313 | event (gpointer) -> gboolean 314 | enter-monitor (GdkMonitor) 315 | leave-monitor (GdkMonitor) 316 | 317 | Properties from GdkSurface: 318 | cursor -> GdkCursor: cursor 319 | display -> GdkDisplay: display 320 | frame-clock -> GdkFrameClock: frame-clock 321 | mapped -> gboolean: mapped 322 | width -> gint: width 323 | height -> gint: height 324 | scale-factor -> gint: scale-factor 325 | scale -> gdouble: scale 326 | 327 | Signals from GObject: 328 | notify (GParam) 329 | """ 330 | class Props(Gdk.Surface.Props): 331 | cursor: typing.Optional[Gdk.Cursor] 332 | display: Gdk.Display 333 | frame_clock: Gdk.FrameClock 334 | height: int 335 | mapped: bool 336 | scale: float 337 | scale_factor: int 338 | width: int 339 | 340 | props: Props = ... 341 | def __init__( 342 | self, 343 | cursor: typing.Optional[Gdk.Cursor] = ..., 344 | display: Gdk.Display = ..., 345 | frame_clock: Gdk.FrameClock = ..., 346 | ) -> None: ... 347 | def force_next_commit(self) -> None: ... 348 | 349 | class WaylandToplevel(WaylandSurface, Gdk.Toplevel): 350 | """ 351 | :Constructors: 352 | 353 | :: 354 | 355 | WaylandToplevel(**properties) 356 | 357 | Object GdkWaylandToplevel 358 | 359 | Signals from GdkToplevel: 360 | compute-size (GdkToplevelSize) 361 | 362 | Signals from GdkSurface: 363 | layout (gint, gint) 364 | render (CairoRegion) -> gboolean 365 | event (gpointer) -> gboolean 366 | enter-monitor (GdkMonitor) 367 | leave-monitor (GdkMonitor) 368 | 369 | Properties from GdkSurface: 370 | cursor -> GdkCursor: cursor 371 | display -> GdkDisplay: display 372 | frame-clock -> GdkFrameClock: frame-clock 373 | mapped -> gboolean: mapped 374 | width -> gint: width 375 | height -> gint: height 376 | scale-factor -> gint: scale-factor 377 | scale -> gdouble: scale 378 | 379 | Signals from GObject: 380 | notify (GParam) 381 | """ 382 | class Props(WaylandSurface.Props): 383 | cursor: typing.Optional[Gdk.Cursor] 384 | display: Gdk.Display 385 | frame_clock: Gdk.FrameClock 386 | height: int 387 | mapped: bool 388 | scale: float 389 | scale_factor: int 390 | width: int 391 | capabilities: Gdk.ToplevelCapabilities 392 | decorated: bool 393 | deletable: bool 394 | fullscreen_mode: Gdk.FullscreenMode 395 | gravity: Gdk.Gravity 396 | icon_list: None 397 | modal: bool 398 | shortcuts_inhibited: bool 399 | startup_id: str 400 | state: Gdk.ToplevelState 401 | title: str 402 | transient_for: Gdk.Surface 403 | 404 | props: Props = ... 405 | def __init__( 406 | self, 407 | cursor: typing.Optional[Gdk.Cursor] = ..., 408 | display: Gdk.Display = ..., 409 | frame_clock: Gdk.FrameClock = ..., 410 | decorated: bool = ..., 411 | deletable: bool = ..., 412 | fullscreen_mode: Gdk.FullscreenMode = ..., 413 | gravity: Gdk.Gravity = ..., 414 | icon_list: None = ..., 415 | modal: bool = ..., 416 | startup_id: str = ..., 417 | title: str = ..., 418 | transient_for: Gdk.Surface = ..., 419 | ) -> None: ... 420 | def drop_exported_handle(self, handle: str) -> None: ... 421 | def export_handle( 422 | self, callback: typing.Callable[..., None], *user_data: typing.Any 423 | ) -> bool: ... 424 | def set_application_id(self, application_id: str) -> None: ... 425 | def set_transient_for_exported(self, parent_handle_str: str) -> bool: ... 426 | def unexport_handle(self) -> None: ... 427 | -------------------------------------------------------------------------------- /src/gi-stubs/repository/GioUnix.pyi: -------------------------------------------------------------------------------- 1 | import typing 2 | 3 | from gi.repository import Gio 4 | from gi.repository import GLib 5 | from gi.repository import GObject 6 | from typing_extensions import Self 7 | 8 | T = typing.TypeVar("T") 9 | 10 | DESKTOP_APP_INFO_LOOKUP_EXTENSION_POINT_NAME: str = "gio-desktop-app-info-lookup" 11 | 12 | def is_mount_path_system_internal(mount_path: str) -> bool: ... 13 | def is_system_device_path(device_path: str) -> bool: ... 14 | def is_system_fs_type(fs_type: str) -> bool: ... 15 | def mount_at(mount_path: str) -> typing.Tuple[typing.Optional[MountEntry], int]: ... 16 | def mount_compare(mount1: MountEntry, mount2: MountEntry) -> int: ... 17 | def mount_copy(mount_entry: MountEntry) -> MountEntry: ... 18 | def mount_entries_changed_since(time: int) -> bool: ... 19 | def mount_entries_get() -> typing.Tuple[list[MountEntry], int]: ... 20 | def mount_entries_get_from_file( 21 | table_path: str, 22 | ) -> typing.Tuple[typing.Optional[list[MountEntry]], int]: ... 23 | def mount_entry_at( 24 | mount_path: str, 25 | ) -> typing.Tuple[typing.Optional[MountEntry], int]: ... 26 | def mount_entry_for( 27 | file_path: str, 28 | ) -> typing.Tuple[typing.Optional[MountEntry], int]: ... 29 | def mount_for(file_path: str) -> typing.Tuple[typing.Optional[MountEntry], int]: ... 30 | def mount_free(mount_entry: MountEntry) -> None: ... 31 | def mount_get_device_path(mount_entry: MountEntry) -> str: ... 32 | def mount_get_fs_type(mount_entry: MountEntry) -> str: ... 33 | def mount_get_mount_path(mount_entry: MountEntry) -> str: ... 34 | def mount_get_options(mount_entry: MountEntry) -> typing.Optional[str]: ... 35 | def mount_get_root_path(mount_entry: MountEntry) -> typing.Optional[str]: ... 36 | def mount_guess_can_eject(mount_entry: MountEntry) -> bool: ... 37 | def mount_guess_icon(mount_entry: MountEntry) -> Gio.Icon: ... 38 | def mount_guess_name(mount_entry: MountEntry) -> str: ... 39 | def mount_guess_should_display(mount_entry: MountEntry) -> bool: ... 40 | def mount_guess_symbolic_icon(mount_entry: MountEntry) -> Gio.Icon: ... 41 | def mount_is_readonly(mount_entry: MountEntry) -> bool: ... 42 | def mount_is_system_internal(mount_entry: MountEntry) -> bool: ... 43 | def mount_point_at( 44 | mount_path: str, 45 | ) -> typing.Tuple[typing.Optional[MountPoint], int]: ... 46 | def mount_points_changed_since(time: int) -> bool: ... 47 | def mount_points_get() -> typing.Tuple[list[MountPoint], int]: ... 48 | def mount_points_get_from_file( 49 | table_path: str, 50 | ) -> typing.Tuple[typing.Optional[list[MountPoint]], int]: ... 51 | def mounts_changed_since(time: int) -> bool: ... 52 | def mounts_get() -> typing.Tuple[list[MountEntry], int]: ... 53 | def mounts_get_from_file( 54 | table_path: str, 55 | ) -> typing.Tuple[typing.Optional[list[MountEntry]], int]: ... 56 | 57 | class DesktopAppInfo(GObject.Object, Gio.AppInfo): 58 | """ 59 | :Constructors: 60 | 61 | :: 62 | 63 | DesktopAppInfo(**properties) 64 | new(desktop_id:str) -> GioUnix.DesktopAppInfo or None 65 | new_from_filename(filename:str) -> GioUnix.DesktopAppInfo or None 66 | new_from_keyfile(key_file:GLib.KeyFile) -> GioUnix.DesktopAppInfo or None 67 | 68 | Object GDesktopAppInfo 69 | 70 | Properties from GDesktopAppInfo: 71 | filename -> gchararray: filename 72 | 73 | Signals from GObject: 74 | notify (GParam) 75 | """ 76 | class Props(GObject.Object.Props): 77 | filename: typing.Optional[str] 78 | 79 | props: Props = ... 80 | def __init__(self, filename: str = ...) -> None: ... 81 | def get_action_name(self, action_name: str) -> str: ... 82 | def get_boolean(self, key: str) -> bool: ... 83 | def get_categories(self) -> typing.Optional[str]: ... 84 | def get_filename(self) -> typing.Optional[str]: ... 85 | def get_generic_name(self) -> typing.Optional[str]: ... 86 | @staticmethod 87 | def get_implementations(interface: str) -> list[DesktopAppInfo]: ... 88 | def get_is_hidden(self) -> bool: ... 89 | def get_keywords(self) -> list[str]: ... 90 | def get_locale_string(self, key: str) -> typing.Optional[str]: ... 91 | def get_nodisplay(self) -> bool: ... 92 | def get_show_in(self, desktop_env: typing.Optional[str] = None) -> bool: ... 93 | def get_startup_wm_class(self) -> typing.Optional[str]: ... 94 | def get_string(self, key: str) -> typing.Optional[str]: ... 95 | def get_string_list(self, key: str) -> list[str]: ... 96 | def has_key(self, key: str) -> bool: ... 97 | def launch_action( 98 | self, 99 | action_name: str, 100 | launch_context: typing.Optional[Gio.AppLaunchContext] = None, 101 | ) -> None: ... 102 | def launch_uris_as_manager( 103 | self, 104 | uris: list[str], 105 | launch_context: typing.Optional[Gio.AppLaunchContext], 106 | spawn_flags: GLib.SpawnFlags, 107 | user_setup: typing.Optional[typing.Callable[..., None]] = None, 108 | pid_callback: typing.Optional[typing.Callable[..., None]] = None, 109 | *pid_callback_data: typing.Any, 110 | ) -> bool: ... 111 | def launch_uris_as_manager_with_fds( 112 | self, 113 | uris: list[str], 114 | launch_context: typing.Optional[Gio.AppLaunchContext], 115 | spawn_flags: GLib.SpawnFlags, 116 | user_setup: typing.Optional[typing.Callable[..., None]], 117 | pid_callback: typing.Optional[typing.Callable[..., None]], 118 | stdin_fd: int, 119 | stdout_fd: int, 120 | stderr_fd: int, 121 | *pid_callback_data: typing.Any, 122 | ) -> bool: ... 123 | def list_actions(self) -> list[str]: ... 124 | @classmethod 125 | def new(cls, desktop_id: str) -> typing.Optional[DesktopAppInfo]: ... 126 | @classmethod 127 | def new_from_filename(cls, filename: str) -> typing.Optional[DesktopAppInfo]: ... 128 | @classmethod 129 | def new_from_keyfile( 130 | cls, key_file: GLib.KeyFile 131 | ) -> typing.Optional[DesktopAppInfo]: ... 132 | @staticmethod 133 | def search(search_string: str) -> list[typing.Sequence[str]]: ... 134 | @staticmethod 135 | def set_desktop_env(desktop_env: str) -> None: ... 136 | 137 | class DesktopAppInfoClass(GObject.GPointer): 138 | """ 139 | :Constructors: 140 | 141 | :: 142 | 143 | DesktopAppInfoClass() 144 | """ 145 | 146 | parent_class: GObject.ObjectClass = ... 147 | 148 | class DesktopAppInfoLookup(GObject.GInterface): 149 | """ 150 | Interface GDesktopAppInfoLookup 151 | 152 | Signals from GObject: 153 | notify (GParam) 154 | """ 155 | def get_default_for_uri_scheme( 156 | self, uri_scheme: str 157 | ) -> typing.Optional[Gio.AppInfo]: ... 158 | 159 | class DesktopAppInfoLookupIface(GObject.GPointer): 160 | """ 161 | :Constructors: 162 | 163 | :: 164 | 165 | DesktopAppInfoLookupIface() 166 | """ 167 | 168 | g_iface: GObject.TypeInterface = ... 169 | get_default_for_uri_scheme: typing.Callable[ 170 | [DesktopAppInfoLookup, str], typing.Optional[Gio.AppInfo] 171 | ] = ... 172 | 173 | class FDMessage(Gio.SocketControlMessage): 174 | """ 175 | :Constructors: 176 | 177 | :: 178 | 179 | FDMessage(**properties) 180 | new() -> Gio.SocketControlMessage 181 | new_with_fd_list(fd_list:Gio.UnixFDList) -> Gio.SocketControlMessage 182 | 183 | Object GUnixFDMessage 184 | 185 | Properties from GUnixFDMessage: 186 | fd-list -> GUnixFDList: fd-list 187 | 188 | Signals from GObject: 189 | notify (GParam) 190 | """ 191 | class Props(Gio.SocketControlMessage.Props): 192 | fd_list: Gio.UnixFDList 193 | 194 | props: Props = ... 195 | parent_instance: Gio.SocketControlMessage = ... 196 | priv: FDMessagePrivate = ... 197 | def __init__(self, fd_list: Gio.UnixFDList = ...) -> None: ... 198 | def append_fd(self, fd: int) -> bool: ... 199 | def get_fd_list(self) -> Gio.UnixFDList: ... 200 | @classmethod 201 | def new(cls) -> FDMessage: ... 202 | @classmethod 203 | def new_with_fd_list(cls, fd_list: Gio.UnixFDList) -> FDMessage: ... 204 | def steal_fds(self) -> list[int]: ... 205 | 206 | class FDMessageClass(GObject.GPointer): 207 | """ 208 | :Constructors: 209 | 210 | :: 211 | 212 | FDMessageClass() 213 | """ 214 | 215 | parent_class: Gio.SocketControlMessageClass = ... 216 | 217 | class FDMessagePrivate(GObject.GPointer): ... 218 | 219 | class FileDescriptorBased(GObject.GInterface): 220 | """ 221 | Interface GFileDescriptorBased 222 | 223 | Signals from GObject: 224 | notify (GParam) 225 | """ 226 | def get_fd(self) -> int: ... 227 | 228 | class FileDescriptorBasedIface(GObject.GPointer): 229 | """ 230 | :Constructors: 231 | 232 | :: 233 | 234 | FileDescriptorBasedIface() 235 | """ 236 | 237 | g_iface: GObject.TypeInterface = ... 238 | get_fd: typing.Callable[[FileDescriptorBased], int] = ... 239 | 240 | class InputStream(Gio.InputStream, Gio.PollableInputStream, FileDescriptorBased): 241 | """ 242 | :Constructors: 243 | 244 | :: 245 | 246 | InputStream(**properties) 247 | new(fd:int, close_fd:bool) -> Gio.InputStream 248 | 249 | Object GUnixInputStream 250 | 251 | Properties from GUnixInputStream: 252 | fd -> gint: fd 253 | close-fd -> gboolean: close-fd 254 | 255 | Signals from GObject: 256 | notify (GParam) 257 | """ 258 | class Props(Gio.InputStream.Props): 259 | close_fd: bool 260 | fd: int 261 | 262 | props: Props = ... 263 | parent_instance: Gio.InputStream = ... 264 | priv: InputStreamPrivate = ... 265 | def __init__(self, close_fd: bool = ..., fd: int = ...) -> None: ... 266 | def get_close_fd(self) -> bool: ... 267 | def get_fd(self) -> int: ... 268 | @classmethod 269 | def new(cls, fd: int, close_fd: bool) -> InputStream: ... 270 | def set_close_fd(self, close_fd: bool) -> None: ... 271 | 272 | class InputStreamClass(GObject.GPointer): 273 | """ 274 | :Constructors: 275 | 276 | :: 277 | 278 | InputStreamClass() 279 | """ 280 | 281 | parent_class: Gio.InputStreamClass = ... 282 | 283 | class InputStreamPrivate(GObject.GPointer): ... 284 | 285 | class MountEntry(GObject.GBoxed): 286 | @staticmethod 287 | def at(mount_path: str) -> typing.Tuple[typing.Optional[MountEntry], int]: ... 288 | def compare(self, mount2: MountEntry) -> int: ... 289 | def copy(self) -> MountEntry: ... 290 | @staticmethod 291 | def for_(file_path: str) -> typing.Tuple[typing.Optional[MountEntry], int]: ... 292 | def free(self) -> None: ... 293 | def get_device_path(self) -> str: ... 294 | def get_fs_type(self) -> str: ... 295 | def get_mount_path(self) -> str: ... 296 | def get_options(self) -> typing.Optional[str]: ... 297 | def get_root_path(self) -> typing.Optional[str]: ... 298 | def guess_can_eject(self) -> bool: ... 299 | def guess_icon(self) -> Gio.Icon: ... 300 | def guess_name(self) -> str: ... 301 | def guess_should_display(self) -> bool: ... 302 | def guess_symbolic_icon(self) -> Gio.Icon: ... 303 | def is_readonly(self) -> bool: ... 304 | def is_system_internal(self) -> bool: ... 305 | 306 | class MountMonitor(GObject.Object): 307 | """ 308 | :Constructors: 309 | 310 | :: 311 | 312 | MountMonitor(**properties) 313 | new() -> GioUnix.MountMonitor 314 | 315 | Object GUnixMountMonitor 316 | 317 | Signals from GUnixMountMonitor: 318 | mounts-changed () 319 | mountpoints-changed () 320 | 321 | Signals from GObject: 322 | notify (GParam) 323 | """ 324 | @staticmethod 325 | def get() -> MountMonitor: ... 326 | @classmethod 327 | def new(cls) -> MountMonitor: ... 328 | def set_rate_limit(self, limit_msec: int) -> None: ... 329 | 330 | class MountMonitorClass(GObject.GPointer): ... 331 | 332 | class MountPoint(GObject.GBoxed): 333 | @staticmethod 334 | def at(mount_path: str) -> typing.Tuple[typing.Optional[MountPoint], int]: ... 335 | def compare(self, mount2: MountPoint) -> int: ... 336 | def copy(self) -> MountPoint: ... 337 | def free(self) -> None: ... 338 | def get_device_path(self) -> str: ... 339 | def get_fs_type(self) -> str: ... 340 | def get_mount_path(self) -> str: ... 341 | def get_options(self) -> typing.Optional[str]: ... 342 | def guess_can_eject(self) -> bool: ... 343 | def guess_icon(self) -> Gio.Icon: ... 344 | def guess_name(self) -> str: ... 345 | def guess_symbolic_icon(self) -> Gio.Icon: ... 346 | def is_loopback(self) -> bool: ... 347 | def is_readonly(self) -> bool: ... 348 | def is_user_mountable(self) -> bool: ... 349 | 350 | class OutputStream(Gio.OutputStream, Gio.PollableOutputStream, FileDescriptorBased): 351 | """ 352 | :Constructors: 353 | 354 | :: 355 | 356 | OutputStream(**properties) 357 | new(fd:int, close_fd:bool) -> Gio.OutputStream 358 | 359 | Object GUnixOutputStream 360 | 361 | Properties from GUnixOutputStream: 362 | fd -> gint: fd 363 | close-fd -> gboolean: close-fd 364 | 365 | Signals from GObject: 366 | notify (GParam) 367 | """ 368 | class Props(Gio.OutputStream.Props): 369 | close_fd: bool 370 | fd: int 371 | 372 | props: Props = ... 373 | parent_instance: Gio.OutputStream = ... 374 | priv: OutputStreamPrivate = ... 375 | def __init__(self, close_fd: bool = ..., fd: int = ...) -> None: ... 376 | def get_close_fd(self) -> bool: ... 377 | def get_fd(self) -> int: ... 378 | @classmethod 379 | def new(cls, fd: int, close_fd: bool) -> OutputStream: ... 380 | def set_close_fd(self, close_fd: bool) -> None: ... 381 | 382 | class OutputStreamClass(GObject.GPointer): 383 | """ 384 | :Constructors: 385 | 386 | :: 387 | 388 | OutputStreamClass() 389 | """ 390 | 391 | parent_class: Gio.OutputStreamClass = ... 392 | 393 | class OutputStreamPrivate(GObject.GPointer): ... 394 | -------------------------------------------------------------------------------- /src/gi-stubs/repository/GdkX11.pyi: -------------------------------------------------------------------------------- 1 | import typing 2 | 3 | from gi.repository import Gdk 4 | from gi.repository import GObject 5 | from gi.repository import Pango 6 | from gi.repository import xlib 7 | from typing_extensions import Self 8 | 9 | T = typing.TypeVar("T") 10 | 11 | _lock = ... # FIXME Constant 12 | _namespace: str = "GdkX11" 13 | _version: str = "4.0" 14 | 15 | def x11_device_get_id(device: X11DeviceXI2) -> int: ... 16 | def x11_device_manager_lookup( 17 | device_manager: X11DeviceManagerXI2, device_id: int 18 | ) -> typing.Optional[X11DeviceXI2]: ... 19 | def x11_free_compound_text(ctext: int) -> None: ... 20 | def x11_free_text_list(list: str) -> None: ... 21 | def x11_get_server_time(surface: X11Surface) -> int: ... 22 | def x11_get_xatom_by_name_for_display(display: X11Display, atom_name: str) -> int: ... 23 | def x11_get_xatom_name_for_display(display: X11Display, xatom: int) -> str: ... 24 | def x11_lookup_xdisplay(xdisplay: xlib.Display) -> X11Display: ... 25 | def x11_set_sm_client_id(sm_client_id: typing.Optional[str] = None) -> None: ... 26 | 27 | class X11AppLaunchContext(Gdk.AppLaunchContext): 28 | """ 29 | :Constructors: 30 | 31 | :: 32 | 33 | X11AppLaunchContext(**properties) 34 | 35 | Object GdkX11AppLaunchContext 36 | 37 | Properties from GdkAppLaunchContext: 38 | display -> GdkDisplay: display 39 | 40 | Signals from GAppLaunchContext: 41 | launch-failed (gchararray) 42 | launch-started (GAppInfo, GVariant) 43 | launched (GAppInfo, GVariant) 44 | 45 | Signals from GObject: 46 | notify (GParam) 47 | """ 48 | class Props(Gdk.AppLaunchContext.Props): 49 | display: Gdk.Display 50 | 51 | props: Props = ... 52 | def __init__(self, display: Gdk.Display = ...) -> None: ... 53 | 54 | class X11AppLaunchContextClass(GObject.GPointer): ... 55 | 56 | class X11DeviceManagerXI2(GObject.Object): 57 | """ 58 | :Constructors: 59 | 60 | :: 61 | 62 | X11DeviceManagerXI2(**properties) 63 | 64 | Object GdkX11DeviceManagerXI2 65 | 66 | Properties from GdkX11DeviceManagerXI2: 67 | display -> GdkDisplay: display 68 | opcode -> gint: opcode 69 | major -> gint: major 70 | minor -> gint: minor 71 | 72 | Signals from GObject: 73 | notify (GParam) 74 | """ 75 | class Props(GObject.Object.Props): 76 | display: Gdk.Display 77 | major: int 78 | minor: int 79 | opcode: int 80 | 81 | props: Props = ... 82 | def __init__( 83 | self, 84 | display: Gdk.Display = ..., 85 | major: int = ..., 86 | minor: int = ..., 87 | opcode: int = ..., 88 | ) -> None: ... 89 | 90 | class X11DeviceManagerXI2Class(GObject.GPointer): ... 91 | 92 | class X11DeviceXI2(Gdk.Device): 93 | """ 94 | :Constructors: 95 | 96 | :: 97 | 98 | X11DeviceXI2(**properties) 99 | 100 | Object GdkX11DeviceXI2 101 | 102 | Properties from GdkX11DeviceXI2: 103 | device-id -> gint: device-id 104 | 105 | Signals from GdkDevice: 106 | changed () 107 | tool-changed (GdkDeviceTool) 108 | 109 | Properties from GdkDevice: 110 | display -> GdkDisplay: display 111 | name -> gchararray: name 112 | source -> GdkInputSource: source 113 | has-cursor -> gboolean: has-cursor 114 | n-axes -> guint: n-axes 115 | vendor-id -> gchararray: vendor-id 116 | product-id -> gchararray: product-id 117 | seat -> GdkSeat: seat 118 | num-touches -> guint: num-touches 119 | tool -> GdkDeviceTool: tool 120 | direction -> PangoDirection: direction 121 | has-bidi-layouts -> gboolean: has-bidi-layouts 122 | caps-lock-state -> gboolean: caps-lock-state 123 | num-lock-state -> gboolean: num-lock-state 124 | scroll-lock-state -> gboolean: scroll-lock-state 125 | modifier-state -> GdkModifierType: modifier-state 126 | layout-names -> GStrv: layout-names 127 | active-layout-index -> gint: active-layout-index 128 | 129 | Signals from GObject: 130 | notify (GParam) 131 | """ 132 | class Props(Gdk.Device.Props): 133 | device_id: int 134 | active_layout_index: int 135 | caps_lock_state: bool 136 | direction: Pango.Direction 137 | display: Gdk.Display 138 | has_bidi_layouts: bool 139 | has_cursor: bool 140 | layout_names: typing.Optional[list[str]] 141 | modifier_state: Gdk.ModifierType 142 | n_axes: int 143 | name: str 144 | num_lock_state: bool 145 | num_touches: int 146 | product_id: typing.Optional[str] 147 | scroll_lock_state: bool 148 | seat: Gdk.Seat 149 | source: Gdk.InputSource 150 | tool: typing.Optional[Gdk.DeviceTool] 151 | vendor_id: typing.Optional[str] 152 | 153 | props: Props = ... 154 | def __init__( 155 | self, 156 | device_id: int = ..., 157 | display: Gdk.Display = ..., 158 | has_cursor: bool = ..., 159 | name: str = ..., 160 | num_touches: int = ..., 161 | product_id: str = ..., 162 | seat: Gdk.Seat = ..., 163 | source: Gdk.InputSource = ..., 164 | vendor_id: str = ..., 165 | ) -> None: ... 166 | 167 | class X11DeviceXI2Class(GObject.GPointer): ... 168 | 169 | class X11Display(Gdk.Display): 170 | """ 171 | :Constructors: 172 | 173 | :: 174 | 175 | X11Display(**properties) 176 | 177 | Object GdkX11Display 178 | 179 | Signals from GdkX11Display: 180 | xevent (gpointer) -> gboolean 181 | 182 | Signals from GdkDisplay: 183 | opened () 184 | closed (gboolean) 185 | seat-added (GdkSeat) 186 | seat-removed (GdkSeat) 187 | setting-changed (gchararray) 188 | 189 | Properties from GdkDisplay: 190 | composited -> gboolean: composited 191 | rgba -> gboolean: rgba 192 | shadow-width -> gboolean: shadow-width 193 | input-shapes -> gboolean: input-shapes 194 | dmabuf-formats -> GdkDmabufFormats: dmabuf-formats 195 | 196 | Signals from GObject: 197 | notify (GParam) 198 | """ 199 | class Props(Gdk.Display.Props): 200 | composited: bool 201 | dmabuf_formats: Gdk.DmabufFormats 202 | input_shapes: bool 203 | rgba: bool 204 | shadow_width: bool 205 | 206 | props: Props = ... 207 | def error_trap_pop(self) -> int: ... 208 | def error_trap_pop_ignored(self) -> None: ... 209 | def error_trap_push(self) -> None: ... 210 | def get_default_group(self) -> Gdk.Surface: ... 211 | def get_egl_display(self) -> None: ... 212 | def get_egl_version(self) -> typing.Tuple[bool, int, int]: ... 213 | def get_glx_version(self) -> typing.Tuple[bool, int, int]: ... 214 | def get_primary_monitor(self) -> Gdk.Monitor: ... 215 | def get_screen(self) -> X11Screen: ... 216 | def get_startup_notification_id(self) -> str: ... 217 | def get_user_time(self) -> int: ... 218 | def get_xcursor(self, cursor: Gdk.Cursor) -> int: ... 219 | def get_xdisplay(self) -> xlib.Display: ... 220 | def get_xrootwindow(self) -> int: ... 221 | def get_xscreen(self) -> xlib.Screen: ... 222 | def grab(self) -> None: ... 223 | @staticmethod 224 | def open( 225 | display_name: typing.Optional[str] = None, 226 | ) -> typing.Optional[Gdk.Display]: ... 227 | def set_cursor_theme(self, theme: typing.Optional[str], size: int) -> None: ... 228 | @staticmethod 229 | def set_program_class(display: Gdk.Display, program_class: str) -> None: ... 230 | def set_startup_notification_id(self, startup_id: str) -> None: ... 231 | def set_surface_scale(self, scale: int) -> None: ... 232 | def string_to_compound_text( 233 | self, str: str 234 | ) -> typing.Tuple[int, str, int, bytes]: ... 235 | def text_property_to_text_list( 236 | self, encoding: str, format: int, text: int, length: int, list: str 237 | ) -> int: ... 238 | def ungrab(self) -> None: ... 239 | def utf8_to_compound_text( 240 | self, str: str 241 | ) -> typing.Tuple[bool, str, int, bytes]: ... 242 | 243 | class X11DisplayClass(GObject.GPointer): ... 244 | 245 | class X11Drag(Gdk.Drag): 246 | """ 247 | :Constructors: 248 | 249 | :: 250 | 251 | X11Drag(**properties) 252 | 253 | Object GdkX11Drag 254 | 255 | Signals from GdkDrag: 256 | cancel (GdkDragCancelReason) 257 | drop-performed () 258 | dnd-finished () 259 | 260 | Properties from GdkDrag: 261 | content -> GdkContentProvider: content 262 | device -> GdkDevice: device 263 | display -> GdkDisplay: display 264 | formats -> GdkContentFormats: formats 265 | selected-action -> GdkDragAction: selected-action 266 | actions -> GdkDragAction: actions 267 | surface -> GdkSurface: surface 268 | 269 | Signals from GObject: 270 | notify (GParam) 271 | """ 272 | class Props(Gdk.Drag.Props): 273 | actions: Gdk.DragAction 274 | content: Gdk.ContentProvider 275 | device: Gdk.Device 276 | display: Gdk.Display 277 | formats: Gdk.ContentFormats 278 | selected_action: Gdk.DragAction 279 | surface: Gdk.Surface 280 | 281 | props: Props = ... 282 | def __init__( 283 | self, 284 | actions: Gdk.DragAction = ..., 285 | content: Gdk.ContentProvider = ..., 286 | device: Gdk.Device = ..., 287 | formats: Gdk.ContentFormats = ..., 288 | selected_action: Gdk.DragAction = ..., 289 | surface: Gdk.Surface = ..., 290 | ) -> None: ... 291 | 292 | class X11DragClass(GObject.GPointer): ... 293 | 294 | class X11GLContext(Gdk.GLContext): 295 | """ 296 | :Constructors: 297 | 298 | :: 299 | 300 | X11GLContext(**properties) 301 | 302 | Object GdkX11GLContext 303 | 304 | Properties from GdkGLContext: 305 | allowed-apis -> GdkGLAPI: allowed-apis 306 | api -> GdkGLAPI: api 307 | shared-context -> GdkGLContext: shared-context 308 | 309 | Properties from GdkDrawContext: 310 | display -> GdkDisplay: display 311 | surface -> GdkSurface: surface 312 | 313 | Signals from GObject: 314 | notify (GParam) 315 | """ 316 | class Props(Gdk.GLContext.Props): 317 | allowed_apis: Gdk.GLAPI 318 | api: Gdk.GLAPI 319 | shared_context: typing.Optional[Gdk.GLContext] 320 | display: typing.Optional[Gdk.Display] 321 | surface: typing.Optional[Gdk.Surface] 322 | 323 | props: Props = ... 324 | def __init__( 325 | self, 326 | allowed_apis: Gdk.GLAPI = ..., 327 | shared_context: Gdk.GLContext = ..., 328 | display: Gdk.Display = ..., 329 | surface: Gdk.Surface = ..., 330 | ) -> None: ... 331 | 332 | class X11GLContextClass(GObject.GPointer): ... 333 | 334 | class X11Monitor(Gdk.Monitor): 335 | """ 336 | :Constructors: 337 | 338 | :: 339 | 340 | X11Monitor(**properties) 341 | 342 | Object GdkX11Monitor 343 | 344 | Signals from GdkMonitor: 345 | invalidate () 346 | 347 | Properties from GdkMonitor: 348 | description -> gchararray: description 349 | display -> GdkDisplay: display 350 | manufacturer -> gchararray: manufacturer 351 | model -> gchararray: model 352 | connector -> gchararray: connector 353 | scale-factor -> gint: scale-factor 354 | scale -> gdouble: scale 355 | geometry -> GdkRectangle: geometry 356 | width-mm -> gint: width-mm 357 | height-mm -> gint: height-mm 358 | refresh-rate -> gint: refresh-rate 359 | subpixel-layout -> GdkSubpixelLayout: subpixel-layout 360 | valid -> gboolean: valid 361 | 362 | Signals from GObject: 363 | notify (GParam) 364 | """ 365 | class Props(Gdk.Monitor.Props): 366 | connector: typing.Optional[str] 367 | description: typing.Optional[str] 368 | display: Gdk.Display 369 | geometry: Gdk.Rectangle 370 | height_mm: int 371 | manufacturer: typing.Optional[str] 372 | model: typing.Optional[str] 373 | refresh_rate: int 374 | scale: float 375 | scale_factor: int 376 | subpixel_layout: Gdk.SubpixelLayout 377 | valid: bool 378 | width_mm: int 379 | 380 | props: Props = ... 381 | def __init__(self, display: Gdk.Display = ...) -> None: ... 382 | def get_output(self) -> int: ... 383 | def get_workarea(self) -> Gdk.Rectangle: ... 384 | 385 | class X11MonitorClass(GObject.GPointer): ... 386 | 387 | class X11Screen(GObject.Object): 388 | """ 389 | :Constructors: 390 | 391 | :: 392 | 393 | X11Screen(**properties) 394 | 395 | Object GdkX11Screen 396 | 397 | Signals from GdkX11Screen: 398 | window-manager-changed () 399 | 400 | Signals from GObject: 401 | notify (GParam) 402 | """ 403 | def get_current_desktop(self) -> int: ... 404 | def get_monitor_output(self, monitor_num: int) -> int: ... 405 | def get_number_of_desktops(self) -> int: ... 406 | def get_screen_number(self) -> int: ... 407 | def get_window_manager_name(self) -> str: ... 408 | def get_xscreen(self) -> xlib.Screen: ... 409 | def supports_net_wm_hint(self, property_name: str) -> bool: ... 410 | 411 | class X11ScreenClass(GObject.GPointer): ... 412 | 413 | class X11Surface(Gdk.Surface): 414 | """ 415 | :Constructors: 416 | 417 | :: 418 | 419 | X11Surface(**properties) 420 | 421 | Object GdkX11Surface 422 | 423 | Signals from GdkSurface: 424 | layout (gint, gint) 425 | render (CairoRegion) -> gboolean 426 | event (gpointer) -> gboolean 427 | enter-monitor (GdkMonitor) 428 | leave-monitor (GdkMonitor) 429 | 430 | Properties from GdkSurface: 431 | cursor -> GdkCursor: cursor 432 | display -> GdkDisplay: display 433 | frame-clock -> GdkFrameClock: frame-clock 434 | mapped -> gboolean: mapped 435 | width -> gint: width 436 | height -> gint: height 437 | scale-factor -> gint: scale-factor 438 | scale -> gdouble: scale 439 | 440 | Signals from GObject: 441 | notify (GParam) 442 | """ 443 | class Props(Gdk.Surface.Props): 444 | cursor: typing.Optional[Gdk.Cursor] 445 | display: Gdk.Display 446 | frame_clock: Gdk.FrameClock 447 | height: int 448 | mapped: bool 449 | scale: float 450 | scale_factor: int 451 | width: int 452 | 453 | props: Props = ... 454 | def __init__( 455 | self, 456 | cursor: typing.Optional[Gdk.Cursor] = ..., 457 | display: Gdk.Display = ..., 458 | frame_clock: Gdk.FrameClock = ..., 459 | ) -> None: ... 460 | def get_desktop(self) -> int: ... 461 | def get_group(self) -> typing.Optional[Gdk.Surface]: ... 462 | def get_xid(self) -> int: ... 463 | @staticmethod 464 | def lookup_for_display(display: X11Display, window: int) -> X11Surface: ... 465 | def move_to_current_desktop(self) -> None: ... 466 | def move_to_desktop(self, desktop: int) -> None: ... 467 | def set_frame_sync_enabled(self, frame_sync_enabled: bool) -> None: ... 468 | def set_group(self, leader: Gdk.Surface) -> None: ... 469 | def set_skip_pager_hint(self, skips_pager: bool) -> None: ... 470 | def set_skip_taskbar_hint(self, skips_taskbar: bool) -> None: ... 471 | def set_theme_variant(self, variant: str) -> None: ... 472 | def set_urgency_hint(self, urgent: bool) -> None: ... 473 | def set_user_time(self, timestamp: int) -> None: ... 474 | def set_utf8_property( 475 | self, name: str, value: typing.Optional[str] = None 476 | ) -> None: ... 477 | 478 | class X11SurfaceClass(GObject.GPointer): ... 479 | 480 | class X11DeviceType(GObject.GEnum): 481 | FLOATING = 2 482 | LOGICAL = 0 483 | PHYSICAL = 1 484 | -------------------------------------------------------------------------------- /src/gi-stubs/repository/GstApp.pyi: -------------------------------------------------------------------------------- 1 | import typing 2 | 3 | from gi.repository import GObject 4 | from gi.repository import Gst 5 | from gi.repository import GstBase 6 | from typing_extensions import Self 7 | 8 | T = typing.TypeVar("T") 9 | 10 | class AppSink(GstBase.BaseSink, Gst.URIHandler): 11 | """ 12 | :Constructors: 13 | 14 | :: 15 | 16 | AppSink(**properties) 17 | 18 | Object GstAppSink 19 | 20 | Signals from GstAppSink: 21 | eos () 22 | new-preroll () -> GstFlowReturn 23 | new-sample () -> GstFlowReturn 24 | propose-allocation (GstQuery) -> gboolean 25 | new-serialized-event () -> gboolean 26 | pull-preroll () -> GstSample 27 | pull-sample () -> GstSample 28 | try-pull-preroll (guint64) -> GstSample 29 | try-pull-sample (guint64) -> GstSample 30 | try-pull-object (guint64) -> GstMiniObject 31 | 32 | Properties from GstAppSink: 33 | caps -> GstCaps: Caps 34 | The allowed caps for the sink pad 35 | eos -> gboolean: EOS 36 | Check if the sink is EOS or not started 37 | emit-signals -> gboolean: Emit signals 38 | Emit new-preroll and new-sample signals 39 | max-buffers -> guint: Max Buffers 40 | The maximum number of buffers to queue internally (0 = unlimited) 41 | drop -> gboolean: Drop 42 | Drop old buffers when the buffer queue is filled 43 | wait-on-eos -> gboolean: Wait on EOS 44 | Wait for all buffers to be processed after receiving an EOS 45 | buffer-list -> gboolean: Buffer List 46 | Use buffer lists 47 | max-time -> guint64: Max time 48 | The maximum total duration to queue internally (in ns, 0 = unlimited) 49 | max-bytes -> guint64: Max bytes 50 | The maximum amount of bytes to queue internally (0 = unlimited) 51 | 52 | Properties from GstBaseSink: 53 | sync -> gboolean: Sync 54 | Sync on the clock 55 | max-lateness -> gint64: Max Lateness 56 | Maximum number of nanoseconds that a buffer can be late before it is dropped (-1 unlimited) 57 | qos -> gboolean: Qos 58 | Generate Quality-of-Service events upstream 59 | async -> gboolean: Async 60 | Go asynchronously to PAUSED 61 | ts-offset -> gint64: TS Offset 62 | Timestamp offset in nanoseconds 63 | enable-last-sample -> gboolean: Enable Last Buffer 64 | Enable the last-sample property 65 | last-sample -> GstSample: Last Sample 66 | The last sample received in the sink 67 | blocksize -> guint: Block size 68 | Size in bytes to pull per buffer (0 = default) 69 | render-delay -> guint64: Render Delay 70 | Additional render delay of the sink in nanoseconds 71 | throttle-time -> guint64: Throttle time 72 | The time to keep between rendered buffers (0 = disabled) 73 | max-bitrate -> guint64: Max Bitrate 74 | The maximum bits per second to render (0 = disabled) 75 | processing-deadline -> guint64: Processing deadline 76 | Maximum processing time for a buffer in nanoseconds 77 | stats -> GstStructure: Statistics 78 | Sink Statistics 79 | 80 | Signals from GstElement: 81 | pad-added (GstPad) 82 | pad-removed (GstPad) 83 | no-more-pads () 84 | 85 | Signals from GstObject: 86 | deep-notify (GstObject, GParam) 87 | 88 | Properties from GstObject: 89 | name -> gchararray: Name 90 | The name of the object 91 | parent -> GstObject: Parent 92 | The parent of the object 93 | 94 | Signals from GObject: 95 | notify (GParam) 96 | """ 97 | class Props(GstBase.BaseSink.Props): 98 | buffer_list: bool 99 | caps: typing.Optional[Gst.Caps] 100 | drop: bool 101 | emit_signals: bool 102 | eos: bool 103 | max_buffers: int 104 | max_bytes: int 105 | max_time: int 106 | wait_on_eos: bool 107 | blocksize: int 108 | enable_last_sample: bool 109 | last_sample: typing.Optional[Gst.Sample] 110 | max_bitrate: int 111 | max_lateness: int 112 | processing_deadline: int 113 | qos: bool 114 | render_delay: int 115 | stats: Gst.Structure 116 | sync: bool 117 | throttle_time: int 118 | ts_offset: int 119 | name: typing.Optional[str] 120 | parent: typing.Optional[Gst.Object] 121 | 122 | props: Props = ... 123 | basesink: GstBase.BaseSink = ... 124 | priv: AppSinkPrivate = ... 125 | def __init__( 126 | self, 127 | buffer_list: bool = ..., 128 | caps: typing.Optional[Gst.Caps] = ..., 129 | drop: bool = ..., 130 | emit_signals: bool = ..., 131 | max_buffers: int = ..., 132 | max_bytes: int = ..., 133 | max_time: int = ..., 134 | wait_on_eos: bool = ..., 135 | blocksize: int = ..., 136 | enable_last_sample: bool = ..., 137 | max_bitrate: int = ..., 138 | max_lateness: int = ..., 139 | processing_deadline: int = ..., 140 | qos: bool = ..., 141 | render_delay: int = ..., 142 | sync: bool = ..., 143 | throttle_time: int = ..., 144 | ts_offset: int = ..., 145 | name: typing.Optional[str] = ..., 146 | parent: Gst.Object = ..., 147 | ) -> None: ... 148 | def do_eos(self) -> None: ... 149 | def do_new_preroll(self) -> Gst.FlowReturn: ... 150 | def do_new_sample(self) -> Gst.FlowReturn: ... 151 | def do_pull_preroll(self) -> typing.Optional[Gst.Sample]: ... 152 | def do_pull_sample(self) -> typing.Optional[Gst.Sample]: ... 153 | def do_try_pull_object(self, timeout: int) -> typing.Optional[Gst.MiniObject]: ... 154 | def do_try_pull_preroll(self, timeout: int) -> typing.Optional[Gst.Sample]: ... 155 | def do_try_pull_sample(self, timeout: int) -> typing.Optional[Gst.Sample]: ... 156 | def get_buffer_list_support(self) -> bool: ... 157 | def get_caps(self) -> typing.Optional[Gst.Caps]: ... 158 | def get_drop(self) -> bool: ... 159 | def get_emit_signals(self) -> bool: ... 160 | def get_max_buffers(self) -> int: ... 161 | def get_max_bytes(self) -> int: ... 162 | def get_max_time(self) -> int: ... 163 | def get_wait_on_eos(self) -> bool: ... 164 | def is_eos(self) -> bool: ... 165 | def pull_object(self) -> gi.repository.Gst.MiniObject: ... 166 | def pull_preroll(self) -> typing.Optional[Gst.Sample]: ... 167 | def pull_sample(self) -> typing.Optional[Gst.Sample]: ... 168 | def set_buffer_list_support(self, enable_lists: bool) -> None: ... 169 | def set_caps(self, caps: typing.Optional[Gst.Caps] = None) -> None: ... 170 | def set_drop(self, drop: bool) -> None: ... 171 | def set_emit_signals(self, emit: bool) -> None: ... 172 | def set_max_buffers(self, max: int) -> None: ... 173 | def set_max_bytes(self, max: int) -> None: ... 174 | def set_max_time(self, max: int) -> None: ... 175 | def set_wait_on_eos(self, wait: bool) -> None: ... 176 | def try_pull_object( 177 | self, timeout: int 178 | ) -> Optional[gi.repository.Gst.MiniObject]: ... 179 | def try_pull_preroll(self, timeout: int) -> typing.Optional[Gst.Sample]: ... 180 | def try_pull_sample(self, timeout: int) -> typing.Optional[Gst.Sample]: ... 181 | 182 | class AppSinkClass(GObject.GPointer): 183 | """ 184 | :Constructors: 185 | 186 | :: 187 | 188 | AppSinkClass() 189 | """ 190 | 191 | basesink_class: GstBase.BaseSinkClass = ... 192 | eos: typing.Callable[[AppSink], None] = ... 193 | new_preroll: typing.Callable[[AppSink], Gst.FlowReturn] = ... 194 | new_sample: typing.Callable[[AppSink], Gst.FlowReturn] = ... 195 | pull_preroll: typing.Callable[[AppSink], typing.Optional[Gst.Sample]] = ... 196 | pull_sample: typing.Callable[[AppSink], typing.Optional[Gst.Sample]] = ... 197 | try_pull_preroll: typing.Callable[[AppSink, int], typing.Optional[Gst.Sample]] = ... 198 | try_pull_sample: typing.Callable[[AppSink, int], typing.Optional[Gst.Sample]] = ... 199 | try_pull_object: typing.Callable[ 200 | [AppSink, int], typing.Optional[Gst.MiniObject] 201 | ] = ... 202 | 203 | class AppSinkPrivate(GObject.GPointer): ... 204 | 205 | class AppSrc(GstBase.BaseSrc, Gst.URIHandler): 206 | """ 207 | :Constructors: 208 | 209 | :: 210 | 211 | AppSrc(**properties) 212 | 213 | Object GstAppSrc 214 | 215 | Signals from GstAppSrc: 216 | need-data (guint) 217 | enough-data () 218 | seek-data (guint64) -> gboolean 219 | push-buffer (GstBuffer) -> GstFlowReturn 220 | push-buffer-list (GstBufferList) -> GstFlowReturn 221 | push-sample (GstSample) -> GstFlowReturn 222 | end-of-stream () -> GstFlowReturn 223 | 224 | Properties from GstAppSrc: 225 | caps -> GstCaps: Caps 226 | The allowed caps for the src pad 227 | size -> gint64: Size 228 | The size of the data stream in bytes (-1 if unknown) 229 | stream-type -> GstAppStreamType: Stream Type 230 | the type of the stream 231 | max-bytes -> guint64: Max bytes 232 | The maximum number of bytes to queue internally (0 = unlimited) 233 | max-buffers -> guint64: Max buffers 234 | The maximum number of buffers to queue internally (0 = unlimited) 235 | max-time -> guint64: Max time 236 | The maximum amount of time to queue internally (0 = unlimited) 237 | format -> GstFormat: Format 238 | The format of the segment events and seek 239 | block -> gboolean: Block 240 | Block push-buffer when max-bytes are queued 241 | is-live -> gboolean: Is Live 242 | Whether to act as a live source 243 | min-latency -> gint64: Min Latency 244 | The minimum latency (-1 = default) 245 | max-latency -> gint64: Max Latency 246 | The maximum latency (-1 = unlimited) 247 | emit-signals -> gboolean: Emit signals 248 | Emit need-data, enough-data and seek-data signals 249 | min-percent -> guint: Min Percent 250 | Emit need-data when queued bytes drops below this percent of max-bytes 251 | current-level-bytes -> guint64: Current Level Bytes 252 | The number of currently queued bytes 253 | current-level-buffers -> guint64: Current Level Buffers 254 | The number of currently queued buffers 255 | current-level-time -> guint64: Current Level Time 256 | The amount of currently queued time 257 | duration -> guint64: Duration 258 | The duration of the data stream in nanoseconds (GST_CLOCK_TIME_NONE if unknown) 259 | handle-segment-change -> gboolean: Handle Segment Change 260 | Whether to detect and handle changed time format GstSegment in GstSample. User should set valid GstSegment in GstSample. Must set format property as "time" to enable this property 261 | leaky-type -> GstAppLeakyType: Leaky Type 262 | Whether to drop buffers once the internal queue is full 263 | 264 | Properties from GstBaseSrc: 265 | blocksize -> guint: Block size 266 | Size in bytes to read per buffer (-1 = default) 267 | num-buffers -> gint: num-buffers 268 | Number of buffers to output before sending EOS (-1 = unlimited) 269 | typefind -> gboolean: Typefind 270 | Run typefind before negotiating (deprecated, non-functional) 271 | do-timestamp -> gboolean: Do timestamp 272 | Apply current stream time to buffers 273 | automatic-eos -> gboolean: Automatic EOS 274 | Automatically EOS when the segment is done 275 | 276 | Signals from GstElement: 277 | pad-added (GstPad) 278 | pad-removed (GstPad) 279 | no-more-pads () 280 | 281 | Signals from GstObject: 282 | deep-notify (GstObject, GParam) 283 | 284 | Properties from GstObject: 285 | name -> gchararray: Name 286 | The name of the object 287 | parent -> GstObject: Parent 288 | The parent of the object 289 | 290 | Signals from GObject: 291 | notify (GParam) 292 | """ 293 | class Props(GstBase.BaseSrc.Props): 294 | block: bool 295 | caps: typing.Optional[Gst.Caps] 296 | current_level_buffers: int 297 | current_level_bytes: int 298 | current_level_time: int 299 | duration: int 300 | emit_signals: bool 301 | format: Gst.Format 302 | handle_segment_change: bool 303 | is_live: bool 304 | leaky_type: AppLeakyType 305 | max_buffers: int 306 | max_bytes: int 307 | max_latency: int 308 | max_time: int 309 | min_latency: int 310 | min_percent: int 311 | size: int 312 | stream_type: AppStreamType 313 | automatic_eos: bool 314 | blocksize: int 315 | do_timestamp: bool 316 | num_buffers: int 317 | typefind: bool 318 | name: typing.Optional[str] 319 | parent: typing.Optional[Gst.Object] 320 | 321 | props: Props = ... 322 | basesrc: GstBase.BaseSrc = ... 323 | priv: AppSrcPrivate = ... 324 | def __init__( 325 | self, 326 | block: bool = ..., 327 | caps: typing.Optional[Gst.Caps] = ..., 328 | duration: int = ..., 329 | emit_signals: bool = ..., 330 | format: Gst.Format = ..., 331 | handle_segment_change: bool = ..., 332 | is_live: bool = ..., 333 | leaky_type: AppLeakyType = ..., 334 | max_buffers: int = ..., 335 | max_bytes: int = ..., 336 | max_latency: int = ..., 337 | max_time: int = ..., 338 | min_latency: int = ..., 339 | min_percent: int = ..., 340 | size: int = ..., 341 | stream_type: AppStreamType = ..., 342 | automatic_eos: bool = ..., 343 | blocksize: int = ..., 344 | do_timestamp: bool = ..., 345 | num_buffers: int = ..., 346 | typefind: bool = ..., 347 | name: typing.Optional[str] = ..., 348 | parent: Gst.Object = ..., 349 | ) -> None: ... 350 | def do_end_of_stream(self) -> Gst.FlowReturn: ... 351 | def do_enough_data(self) -> None: ... 352 | def do_need_data(self, length: int) -> None: ... 353 | def do_push_buffer(self, buffer: Gst.Buffer) -> Gst.FlowReturn: ... 354 | def do_push_buffer_list(self, buffer_list: Gst.BufferList) -> Gst.FlowReturn: ... 355 | def do_push_sample(self, sample: Gst.Sample) -> Gst.FlowReturn: ... 356 | def do_seek_data(self, offset: int) -> bool: ... 357 | def end_of_stream(self) -> Gst.FlowReturn: ... 358 | def get_caps(self) -> typing.Optional[Gst.Caps]: ... 359 | def get_current_level_buffers(self) -> int: ... 360 | def get_current_level_bytes(self) -> int: ... 361 | def get_current_level_time(self) -> int: ... 362 | def get_duration(self) -> int: ... 363 | def get_emit_signals(self) -> bool: ... 364 | def get_latency(self) -> typing.Tuple[int, int]: ... 365 | def get_leaky_type(self) -> AppLeakyType: ... 366 | def get_max_buffers(self) -> int: ... 367 | def get_max_bytes(self) -> int: ... 368 | def get_max_time(self) -> int: ... 369 | def get_size(self) -> int: ... 370 | def get_stream_type(self) -> AppStreamType: ... 371 | def push_buffer(self, buffer: Gst.Buffer) -> Gst.FlowReturn: ... 372 | def push_buffer_list(self, buffer_list: Gst.BufferList) -> Gst.FlowReturn: ... 373 | def push_sample(self, sample: Gst.Sample) -> Gst.FlowReturn: ... 374 | def set_caps(self, caps: typing.Optional[Gst.Caps] = None) -> None: ... 375 | def set_duration(self, duration: int) -> None: ... 376 | def set_emit_signals(self, emit: bool) -> None: ... 377 | def set_latency(self, min: int, max: int) -> None: ... 378 | def set_leaky_type(self, leaky: AppLeakyType) -> None: ... 379 | def set_max_buffers(self, max: int) -> None: ... 380 | def set_max_bytes(self, max: int) -> None: ... 381 | def set_max_time(self, max: int) -> None: ... 382 | def set_size(self, size: int) -> None: ... 383 | def set_stream_type(self, type: AppStreamType) -> None: ... 384 | 385 | class AppSrcClass(GObject.GPointer): 386 | """ 387 | :Constructors: 388 | 389 | :: 390 | 391 | AppSrcClass() 392 | """ 393 | 394 | basesrc_class: GstBase.BaseSrcClass = ... 395 | need_data: typing.Callable[[AppSrc, int], None] = ... 396 | enough_data: typing.Callable[[AppSrc], None] = ... 397 | seek_data: typing.Callable[[AppSrc, int], bool] = ... 398 | push_buffer: typing.Callable[[AppSrc, Gst.Buffer], Gst.FlowReturn] = ... 399 | end_of_stream: typing.Callable[[AppSrc], Gst.FlowReturn] = ... 400 | push_sample: typing.Callable[[AppSrc, Gst.Sample], Gst.FlowReturn] = ... 401 | push_buffer_list: typing.Callable[[AppSrc, Gst.BufferList], Gst.FlowReturn] = ... 402 | 403 | class AppSrcPrivate(GObject.GPointer): ... 404 | 405 | class AppLeakyType(GObject.GEnum): 406 | DOWNSTREAM = 2 407 | NONE = 0 408 | UPSTREAM = 1 409 | 410 | class AppStreamType(GObject.GEnum): 411 | RANDOM_ACCESS = 2 412 | SEEKABLE = 1 413 | STREAM = 0 414 | -------------------------------------------------------------------------------- /src/gi-stubs/repository/_JavaScriptCore6.pyi: -------------------------------------------------------------------------------- 1 | from typing import Any 2 | from typing import Callable 3 | from typing import Literal 4 | from typing import Optional 5 | from typing import Sequence 6 | from typing import Tuple 7 | from typing import Type 8 | from typing import TypeVar 9 | 10 | from gi.repository import GLib 11 | from gi.repository import GObject 12 | 13 | MAJOR_VERSION: int = 2 14 | MICRO_VERSION: int = 3 15 | MINOR_VERSION: int = 42 16 | OPTIONS_USE_DFG: str = "useDFGJIT" 17 | OPTIONS_USE_FTL: str = "useFTLJIT" 18 | OPTIONS_USE_JIT: str = "useJIT" 19 | OPTIONS_USE_LLINT: str = "useLLInt" 20 | _lock = ... # FIXME Constant 21 | _namespace: str = "JavaScriptCore" 22 | _version: str = "6.0" 23 | 24 | def get_major_version() -> int: ... 25 | def get_micro_version() -> int: ... 26 | def get_minor_version() -> int: ... 27 | def options_foreach(function: Callable[..., bool], *user_data: Any) -> None: ... 28 | def options_get_boolean(option: str) -> Tuple[bool, bool]: ... 29 | def options_get_double(option: str) -> Tuple[bool, float]: ... 30 | def options_get_int(option: str) -> Tuple[bool, int]: ... 31 | def options_get_option_group() -> GLib.OptionGroup: ... 32 | def options_get_range_string(option: str) -> Tuple[bool, str]: ... 33 | def options_get_size(option: str) -> Tuple[bool, int]: ... 34 | def options_get_string(option: str) -> Tuple[bool, str]: ... 35 | def options_get_uint(option: str) -> Tuple[bool, int]: ... 36 | def options_set_boolean(option: str, value: bool) -> bool: ... 37 | def options_set_double(option: str, value: float) -> bool: ... 38 | def options_set_int(option: str, value: int) -> bool: ... 39 | def options_set_range_string(option: str, value: str) -> bool: ... 40 | def options_set_size(option: str, value: int) -> bool: ... 41 | def options_set_string(option: str, value: str) -> bool: ... 42 | def options_set_uint(option: str, value: int) -> bool: ... 43 | 44 | class Class(GObject.Object): 45 | """ 46 | :Constructors: 47 | 48 | :: 49 | 50 | Class(**properties) 51 | 52 | Object JSCClass 53 | 54 | Properties from JSCClass: 55 | context -> JSCContext: context 56 | name -> gchararray: name 57 | parent -> JSCClass: parent 58 | 59 | Signals from GObject: 60 | notify (GParam) 61 | """ 62 | 63 | class Props: 64 | name: str 65 | parent: Class 66 | context: Context 67 | 68 | props: Props = ... 69 | def __init__( 70 | self, context: Context = ..., name: str = ..., parent: Class = ... 71 | ): ... 72 | def add_constructor( 73 | self, 74 | name: Optional[str], 75 | callback: Callable[..., None], 76 | return_type: Type, 77 | parameter_types: Optional[Sequence[Type]] = None, 78 | *user_data: Any, 79 | ) -> Value: ... 80 | def add_constructor_variadic( 81 | self, 82 | name: Optional[str], 83 | callback: Callable[..., None], 84 | return_type: Type, 85 | *user_data: Any, 86 | ) -> Value: ... 87 | def add_method( 88 | self, 89 | name: str, 90 | callback: Callable[..., None], 91 | return_type: Type, 92 | parameter_types: Optional[Sequence[Type]] = None, 93 | *user_data: Any, 94 | ) -> None: ... 95 | def add_method_variadic( 96 | self, 97 | name: str, 98 | callback: Callable[..., None], 99 | return_type: Type, 100 | *user_data: Any, 101 | ) -> None: ... 102 | def add_property( 103 | self, 104 | name: str, 105 | property_type: Type, 106 | getter: Optional[Callable[[], None]] = None, 107 | setter: Optional[Callable[..., None]] = None, 108 | *user_data: Any, 109 | ) -> None: ... 110 | def get_name(self) -> str: ... 111 | def get_parent(self) -> Class: ... 112 | 113 | class ClassClass(GObject.GPointer): 114 | """ 115 | :Constructors: 116 | 117 | :: 118 | 119 | ClassClass() 120 | """ 121 | 122 | parent_class: GObject.ObjectClass = ... 123 | 124 | class ClassVTable(GObject.GPointer): 125 | """ 126 | :Constructors: 127 | 128 | :: 129 | 130 | ClassVTable() 131 | """ 132 | 133 | get_property: Callable[[Class, Context, None, str], Optional[Value]] = ... 134 | set_property: Callable[[Class, Context, None, str, Value], bool] = ... 135 | has_property: Callable[[Class, Context, None, str], bool] = ... 136 | delete_property: Callable[[Class, Context, None, str], bool] = ... 137 | enumerate_properties: Callable[[Class, Context, None], Optional[list[str]]] = ... 138 | _jsc_reserved0: None = ... 139 | _jsc_reserved1: None = ... 140 | _jsc_reserved2: None = ... 141 | _jsc_reserved3: None = ... 142 | _jsc_reserved4: None = ... 143 | _jsc_reserved5: None = ... 144 | _jsc_reserved6: None = ... 145 | _jsc_reserved7: None = ... 146 | 147 | class Context(GObject.Object): 148 | """ 149 | :Constructors: 150 | 151 | :: 152 | 153 | Context(**properties) 154 | new() -> JavaScriptCore.Context 155 | new_with_virtual_machine(vm:JavaScriptCore.VirtualMachine) -> JavaScriptCore.Context 156 | 157 | Object JSCContext 158 | 159 | Properties from JSCContext: 160 | virtual-machine -> JSCVirtualMachine: virtual-machine 161 | 162 | Signals from GObject: 163 | notify (GParam) 164 | """ 165 | 166 | class Props: 167 | virtual_machine: VirtualMachine 168 | 169 | props: Props = ... 170 | def __init__(self, virtual_machine: VirtualMachine = ...): ... 171 | def check_syntax( 172 | self, code: str, length: int, mode: CheckSyntaxMode, uri: str, line_number: int 173 | ) -> Tuple[CheckSyntaxResult, Exception]: ... 174 | def clear_exception(self) -> None: ... 175 | def evaluate(self, code: str, length: int) -> Value: ... 176 | def evaluate_in_object( 177 | self, 178 | code: str, 179 | length: int, 180 | object_instance: None, 181 | object_class: Optional[Class], 182 | uri: str, 183 | line_number: int, 184 | ) -> Tuple[Value, Value]: ... 185 | def evaluate_with_source_uri( 186 | self, code: str, length: int, uri: str, line_number: int 187 | ) -> Value: ... 188 | @staticmethod 189 | def get_current() -> Optional[Context]: ... 190 | def get_exception(self) -> Optional[Exception]: ... 191 | def get_global_object(self) -> Value: ... 192 | def get_value(self, name: str) -> Value: ... 193 | def get_virtual_machine(self) -> VirtualMachine: ... 194 | @classmethod 195 | def new(cls) -> Context: ... 196 | @classmethod 197 | def new_with_virtual_machine(cls, vm: VirtualMachine) -> Context: ... 198 | def pop_exception_handler(self) -> None: ... 199 | def push_exception_handler( 200 | self, handler: Callable[..., None], *user_data: Any 201 | ) -> None: ... 202 | def register_class( 203 | self, 204 | name: str, 205 | parent_class: Optional[Class] = None, 206 | vtable: Optional[ClassVTable] = None, 207 | destroy_notify: Optional[Callable[[None], None]] = None, 208 | ) -> Class: ... 209 | def set_value(self, name: str, value: Value) -> None: ... 210 | def throw(self, error_message: str) -> None: ... 211 | def throw_exception(self, exception: Exception) -> None: ... 212 | def throw_with_name(self, error_name: str, error_message: str) -> None: ... 213 | 214 | class ContextClass(GObject.GPointer): 215 | """ 216 | :Constructors: 217 | 218 | :: 219 | 220 | ContextClass() 221 | """ 222 | 223 | parent_class: GObject.ObjectClass = ... 224 | 225 | class Exception(GObject.Object): 226 | """ 227 | :Constructors: 228 | 229 | :: 230 | 231 | Exception(**properties) 232 | new(context:JavaScriptCore.Context, message:str) -> JavaScriptCore.Exception 233 | new_with_name(context:JavaScriptCore.Context, name:str, message:str) -> JavaScriptCore.Exception 234 | 235 | Object JSCException 236 | 237 | Signals from GObject: 238 | notify (GParam) 239 | """ 240 | 241 | def get_backtrace_string(self) -> Optional[str]: ... 242 | def get_column_number(self) -> int: ... 243 | def get_line_number(self) -> int: ... 244 | def get_message(self) -> str: ... 245 | def get_name(self) -> str: ... 246 | def get_source_uri(self) -> Optional[str]: ... 247 | @classmethod 248 | def new(cls, context: Context, message: str) -> Exception: ... 249 | @classmethod 250 | def new_with_name(cls, context: Context, name: str, message: str) -> Exception: ... 251 | def report(self) -> str: ... 252 | def to_string(self) -> str: ... 253 | 254 | class ExceptionClass(GObject.GPointer): 255 | """ 256 | :Constructors: 257 | 258 | :: 259 | 260 | ExceptionClass() 261 | """ 262 | 263 | parent_class: GObject.ObjectClass = ... 264 | 265 | class Value(GObject.Object): 266 | """ 267 | :Constructors: 268 | 269 | :: 270 | 271 | Value(**properties) 272 | new_array_buffer(context:JavaScriptCore.Context, data=None, size:int, destroy_notify:GLib.DestroyNotify=None, user_data=None) -> JavaScriptCore.Value or None 273 | new_array_from_garray(context:JavaScriptCore.Context, array:list=None) -> JavaScriptCore.Value 274 | new_array_from_strv(context:JavaScriptCore.Context, strv:list) -> JavaScriptCore.Value 275 | new_boolean(context:JavaScriptCore.Context, value:bool) -> JavaScriptCore.Value 276 | new_from_json(context:JavaScriptCore.Context, json:str) -> JavaScriptCore.Value 277 | new_function_variadic(context:JavaScriptCore.Context, name:str=None, callback:GObject.Callback, user_data=None, return_type:GType) -> JavaScriptCore.Value 278 | new_function(context:JavaScriptCore.Context, name:str=None, callback:GObject.Callback, user_data=None, return_type:GType, parameter_types:list=None) -> JavaScriptCore.Value 279 | new_null(context:JavaScriptCore.Context) -> JavaScriptCore.Value 280 | new_number(context:JavaScriptCore.Context, number:float) -> JavaScriptCore.Value 281 | new_object(context:JavaScriptCore.Context, instance=None, jsc_class:JavaScriptCore.Class=None) -> JavaScriptCore.Value 282 | new_string(context:JavaScriptCore.Context, string:str=None) -> JavaScriptCore.Value 283 | new_string_from_bytes(context:JavaScriptCore.Context, bytes:GLib.Bytes=None) -> JavaScriptCore.Value 284 | new_typed_array(context:JavaScriptCore.Context, type:JavaScriptCore.TypedArrayType, length:int) -> JavaScriptCore.Value 285 | new_undefined(context:JavaScriptCore.Context) -> JavaScriptCore.Value 286 | 287 | Object JSCValue 288 | 289 | Properties from JSCValue: 290 | context -> JSCContext: context 291 | 292 | Signals from GObject: 293 | notify (GParam) 294 | """ 295 | 296 | class Props: 297 | context: Context 298 | 299 | props: Props = ... 300 | def __init__(self, context: Context = ...): ... 301 | def array_buffer_get_data(self, size: Optional[int] = None) -> None: ... 302 | def array_buffer_get_size(self) -> int: ... 303 | def constructor_call( 304 | self, parameters: Optional[Sequence[Value]] = None 305 | ) -> Value: ... 306 | def function_call(self, parameters: Optional[Sequence[Value]] = None) -> Value: ... 307 | def get_context(self) -> Context: ... 308 | def is_array(self) -> bool: ... 309 | def is_array_buffer(self) -> bool: ... 310 | def is_boolean(self) -> bool: ... 311 | def is_constructor(self) -> bool: ... 312 | def is_function(self) -> bool: ... 313 | def is_null(self) -> bool: ... 314 | def is_number(self) -> bool: ... 315 | def is_object(self) -> bool: ... 316 | def is_string(self) -> bool: ... 317 | def is_typed_array(self) -> bool: ... 318 | def is_undefined(self) -> bool: ... 319 | @classmethod 320 | def new_array_buffer( 321 | cls, 322 | context: Context, 323 | data: None, 324 | size: int, 325 | destroy_notify: Optional[Callable[..., None]] = None, 326 | *user_data: Any, 327 | ) -> Optional[Value]: ... 328 | @classmethod 329 | def new_array_from_garray( 330 | cls, context: Context, array: Optional[Sequence[Value]] = None 331 | ) -> Value: ... 332 | @classmethod 333 | def new_array_from_strv(cls, context: Context, strv: Sequence[str]) -> Value: ... 334 | @classmethod 335 | def new_boolean(cls, context: Context, value: bool) -> Value: ... 336 | @classmethod 337 | def new_from_json(cls, context: Context, json: str) -> Value: ... 338 | @classmethod 339 | def new_function( 340 | cls, 341 | context: Context, 342 | name: Optional[str], 343 | callback: Callable[..., None], 344 | return_type: Type, 345 | parameter_types: Optional[Sequence[Type]] = None, 346 | *user_data: Any, 347 | ) -> Value: ... 348 | @classmethod 349 | def new_function_variadic( 350 | cls, 351 | context: Context, 352 | name: Optional[str], 353 | callback: Callable[..., None], 354 | return_type: Type, 355 | *user_data: Any, 356 | ) -> Value: ... 357 | @classmethod 358 | def new_null(cls, context: Context) -> Value: ... 359 | @classmethod 360 | def new_number(cls, context: Context, number: float) -> Value: ... 361 | @classmethod 362 | def new_object( 363 | cls, context: Context, instance: None, jsc_class: Optional[Class] = None 364 | ) -> Value: ... 365 | @classmethod 366 | def new_string(cls, context: Context, string: Optional[str] = None) -> Value: ... 367 | @classmethod 368 | def new_string_from_bytes( 369 | cls, context: Context, bytes: Optional[GLib.Bytes] = None 370 | ) -> Value: ... 371 | @classmethod 372 | def new_typed_array( 373 | cls, context: Context, type: TypedArrayType, length: int 374 | ) -> Value: ... 375 | def new_typed_array_with_buffer( 376 | self, type: TypedArrayType, offset: int, length: int 377 | ) -> Value: ... 378 | @classmethod 379 | def new_undefined(cls, context: Context) -> Value: ... 380 | def object_define_property_accessor( 381 | self, 382 | property_name: str, 383 | flags: ValuePropertyFlags, 384 | property_type: Type, 385 | getter: Optional[Callable[..., None]] = None, 386 | setter: Optional[Callable[..., None]] = None, 387 | *user_data: Any, 388 | ) -> None: ... 389 | def object_define_property_data( 390 | self, 391 | property_name: str, 392 | flags: ValuePropertyFlags, 393 | property_value: Optional[Value] = None, 394 | ) -> None: ... 395 | def object_delete_property(self, name: str) -> bool: ... 396 | def object_enumerate_properties(self) -> Optional[list[str]]: ... 397 | def object_get_property(self, name: str) -> Value: ... 398 | def object_get_property_at_index(self, index: int) -> Value: ... 399 | def object_has_property(self, name: str) -> bool: ... 400 | def object_invoke_method( 401 | self, name: str, parameters: Optional[Sequence[Value]] = None 402 | ) -> Value: ... 403 | def object_is_instance_of(self, name: str) -> bool: ... 404 | def object_set_property(self, name: str, property: Value) -> None: ... 405 | def object_set_property_at_index(self, index: int, property: Value) -> None: ... 406 | def to_boolean(self) -> bool: ... 407 | def to_double(self) -> float: ... 408 | def to_int32(self) -> int: ... 409 | def to_json(self, indent: int) -> str: ... 410 | def to_string(self) -> str: ... 411 | def to_string_as_bytes(self) -> GLib.Bytes: ... 412 | def typed_array_get_buffer(self) -> Value: ... 413 | def typed_array_get_data(self) -> int: ... 414 | def typed_array_get_length(self) -> int: ... 415 | def typed_array_get_offset(self) -> int: ... 416 | def typed_array_get_size(self) -> int: ... 417 | def typed_array_get_type(self) -> TypedArrayType: ... 418 | 419 | class ValueClass(GObject.GPointer): 420 | """ 421 | :Constructors: 422 | 423 | :: 424 | 425 | ValueClass() 426 | """ 427 | 428 | parent_class: GObject.ObjectClass = ... 429 | 430 | class VirtualMachine(GObject.Object): 431 | """ 432 | :Constructors: 433 | 434 | :: 435 | 436 | VirtualMachine(**properties) 437 | new() -> JavaScriptCore.VirtualMachine 438 | 439 | Object JSCVirtualMachine 440 | 441 | Signals from GObject: 442 | notify (GParam) 443 | """ 444 | 445 | @classmethod 446 | def new(cls) -> VirtualMachine: ... 447 | 448 | class VirtualMachineClass(GObject.GPointer): 449 | """ 450 | :Constructors: 451 | 452 | :: 453 | 454 | VirtualMachineClass() 455 | """ 456 | 457 | parent_class: GObject.ObjectClass = ... 458 | 459 | class WeakValue(GObject.Object): 460 | """ 461 | :Constructors: 462 | 463 | :: 464 | 465 | WeakValue(**properties) 466 | new(value:JavaScriptCore.Value) -> JavaScriptCore.WeakValue 467 | 468 | Object JSCWeakValue 469 | 470 | Signals from JSCWeakValue: 471 | cleared () 472 | 473 | Properties from JSCWeakValue: 474 | value -> JSCValue: value 475 | 476 | Signals from GObject: 477 | notify (GParam) 478 | """ 479 | 480 | class Props: 481 | value: Value 482 | 483 | props: Props = ... 484 | def __init__(self, value: Value = ...): ... 485 | def get_value(self) -> Value: ... 486 | @classmethod 487 | def new(cls, value: Value) -> WeakValue: ... 488 | 489 | class WeakValueClass(GObject.GPointer): 490 | """ 491 | :Constructors: 492 | 493 | :: 494 | 495 | WeakValueClass() 496 | """ 497 | 498 | parent_class: GObject.ObjectClass = ... 499 | 500 | class ValuePropertyFlags(GObject.GFlags): 501 | CONFIGURABLE = 1 502 | ENUMERABLE = 2 503 | WRITABLE = 4 504 | 505 | class CheckSyntaxMode(GObject.GEnum): 506 | MODULE = 1 507 | SCRIPT = 0 508 | 509 | class CheckSyntaxResult(GObject.GEnum): 510 | IRRECOVERABLE_ERROR = 2 511 | OUT_OF_MEMORY_ERROR = 4 512 | RECOVERABLE_ERROR = 1 513 | STACK_OVERFLOW_ERROR = 5 514 | SUCCESS = 0 515 | UNTERMINATED_LITERAL_ERROR = 3 516 | 517 | class OptionType(GObject.GEnum): 518 | BOOLEAN = 0 519 | DOUBLE = 4 520 | INT = 1 521 | RANGE_STRING = 6 522 | SIZE = 3 523 | STRING = 5 524 | UINT = 2 525 | 526 | class TypedArrayType(GObject.GEnum): 527 | FLOAT32 = 10 528 | FLOAT64 = 11 529 | INT16 = 2 530 | INT32 = 3 531 | INT64 = 4 532 | INT8 = 1 533 | NONE = 0 534 | UINT16 = 7 535 | UINT32 = 8 536 | UINT64 = 9 537 | UINT8 = 5 538 | UINT8_CLAMPED = 6 539 | --------------------------------------------------------------------------------