├── .chglog ├── CHANGELOG.tpl.md └── config.yml ├── .github └── workflows │ ├── codespell.yml │ ├── lint.yml │ └── publish.yml ├── .gitignore ├── .pre-commit-config.yaml ├── CHANGELOG.md ├── CONTRIBUTING.md ├── LICENSE ├── MANIFEST.in ├── README.md ├── pep517backend ├── __init__.py └── backend.py ├── pyproject.toml ├── src └── gi-stubs │ ├── __init__.pyi │ └── repository │ ├── Adw.pyi │ ├── AppIndicator3.pyi │ ├── AppStream.pyi │ ├── Atk.pyi │ ├── AyatanaAppIndicator3.pyi │ ├── Farstream.pyi │ ├── Flatpak.pyi │ ├── GExiv2.pyi │ ├── GIRepository.pyi │ ├── GLib.pyi │ ├── GModule.pyi │ ├── GObject.pyi │ ├── GSound.pyi │ ├── GdkPixbuf.pyi │ ├── GdkX11.pyi │ ├── Geoclue.pyi │ ├── Ggit.pyi │ ├── Gio.pyi │ ├── Goa.pyi │ ├── Graphene.pyi │ ├── Gsk.pyi │ ├── Gspell.pyi │ ├── Gst.pyi │ ├── GstBase.pyi │ ├── GstPbutils.pyi │ ├── GstRtp.pyi │ ├── GstRtsp.pyi │ ├── GstRtspServer.pyi │ ├── GstSdp.pyi │ ├── GstWebRTC.pyi │ ├── Handy.pyi │ ├── IBus.pyi │ ├── Manette.pyi │ ├── Notify.pyi │ ├── OSTree.pyi │ ├── Panel.pyi │ ├── Pango.pyi │ ├── PangoCairo.pyi │ ├── Poppler.pyi │ ├── Rsvg.pyi │ ├── Secret.pyi │ ├── Shumate.pyi │ ├── Spelling.pyi │ ├── Vte.pyi │ ├── XApp.pyi │ ├── Xdp.pyi │ ├── XdpGtk4.pyi │ ├── _Gdk3.pyi │ ├── _Gdk4.pyi │ ├── _Gtk3.pyi │ ├── _Gtk4.pyi │ ├── _GtkSource4.pyi │ ├── _GtkSource5.pyi │ ├── _JavaScriptCore6.pyi │ ├── _Soup2.pyi │ ├── _Soup3.pyi │ ├── _WebKit6.pyi │ └── __init__.pyi └── tools ├── bump_version.py ├── generate.py ├── parse.py └── update_all.py /.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 | -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /.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: psf/black@stable 11 | with: 12 | options: "--check --verbose" 13 | src: "." 14 | version: "~= 25.1" 15 | - uses: isort/isort-action@v1 16 | - uses: astral-sh/ruff-action@v3 17 | with: 18 | src: "." 19 | version: 0.9.10 20 | -------------------------------------------------------------------------------- /.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 | user: __token__ 39 | password: ${{ secrets.PYPI_API_TOKEN }} 40 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.pyc 2 | .mypy_cache 3 | .ruff_cache 4 | MANIFEST 5 | build 6 | dist 7 | *.egg-info 8 | *.sublime-* 9 | *.venv 10 | 11 | src/gi-stubs/repository/Gdk.pyi 12 | src/gi-stubs/repository/Gtk.pyi 13 | src/gi-stubs/repository/GtkSource.pyi 14 | src/gi-stubs/repository/JavaScriptCore.pyi 15 | src/gi-stubs/repository/Soup.pyi 16 | src/gi-stubs/repository/WebKit.pyi 17 | -------------------------------------------------------------------------------- /.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/psf/black 16 | rev: 25.1.0 17 | hooks: 18 | - id: black 19 | 20 | - repo: https://github.com/astral-sh/ruff-pre-commit 21 | rev: v0.9.10 22 | hooks: 23 | - id: ruff 24 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # 2.13.0 (11 Mar 2025) 2 | 3 | ## Feature 4 | 5 | * Add GstBase ([#206](https://github.com/pygobject/pygobject-stubs/issues/206)) (#206) 6 | * Add Shumate ([#197](https://github.com/pygobject/pygobject-stubs/issues/197)) (#197) 7 | * Add stubs for IBus 8 | * Add GdkX11 4.0 9 | 10 | ## Typing 11 | 12 | * Improve type hints for 13 | - Gtk4 14 | - Gio 15 | - GObject 16 | - Gdk4 17 | - GLib 18 | - GtkSource5 19 | 20 | ## Change 21 | 22 | * Require Python >=3.9 23 | 24 | # 2.12.0 (31 Oct 2024) 25 | 26 | ## Feature 27 | 28 | * Add Spelling 1 29 | * Add GstRtp and GstRtps ([#188](https://github.com/pygobject/pygobject-stubs/issues/188)) (#188) 30 | 31 | ## Typing 32 | 33 | * Improve type hints for 34 | - Flatpak: Update to 1.15.10 35 | - Gdk3 36 | - GdkPixbuf: Update to 2.42.12 37 | - Gio 38 | - GIRepository: Update to 1.80.1 39 | - GLib: Update to 2.80.5 40 | - Graphene 41 | - Gsk 42 | - Gst 43 | - Gst: Update to 1.24.7 44 | - GstRtspServer 45 | - Gtk3 46 | - Gtk4: Update to 4.16.2 47 | - GtkSource5: Update to 5.12.1 48 | - Pango: Update to 1.54.0 49 | 50 | # 2.11.0 (03 Apr 2024) 51 | 52 | ## Feature 53 | 54 | * Add Goa ([#163](https://github.com/pygobject/pygobject-stubs/issues/163)) (#163) 55 | * Add JavaSciptCore 6.0 for WebKit 56 | * Add Notify 0.7 ([#175](https://github.com/pygobject/pygobject-stubs/issues/175)) (#175) 57 | * Add Panel 58 | * Add Poppler ([#180](https://github.com/pygobject/pygobject-stubs/issues/180)) (#180) 59 | * Add Secret ([#163](https://github.com/pygobject/pygobject-stubs/issues/163)) (#163) 60 | * Add XApp 61 | * Add Xdp ([#178](https://github.com/pygobject/pygobject-stubs/issues/178)) (#178) 62 | * Add WebKit-6.0 63 | 64 | ## Improvements 65 | 66 | * Generator: Rename optional argument 67 | 68 | ## Typing 69 | 70 | * Improve type hints for 71 | - Adw: Upgrade stubs to 1.5 ([#181](https://github.com/pygobject/pygobject-stubs/issues/181)) (#181) 72 | - Gtk3 73 | - Gtk4: Upgrade stubs to 4.14 ([#182](https://github.com/pygobject/pygobject-stubs/issues/182)) (#182) 74 | 75 | ## Bug Fixes 76 | 77 | * Gsk: Use pyi extension 78 | * Generator: Fix regex class pattern (#168) 79 | 80 | # 2.10.0 (16 Nov 2023) 81 | 82 | ## Feature 83 | 84 | * Add Handy 85 | * Add GstWebRTC 86 | * Add GstSdp 87 | 88 | ## Improvements 89 | 90 | * Generator: Require GIRepository 2.0 91 | 92 | ## Typing 93 | 94 | * Improve type hints for 95 | - Adw 96 | - Gio 97 | - GLib 98 | - GstPbutils 99 | - Gtk4 100 | 101 | ## Bug Fixes 102 | 103 | * Allow GObject.emit to return value 104 | * generator: Fix array length param for functions 105 | 106 | # 2.9.0 (14 Sep 2023) 107 | 108 | ## Feature 109 | 110 | * Add AyatanaAppIndicator3 111 | * Add AppStream and OSTree ([#152](https://github.com/pygobject/pygobject-stubs/issues/152)) (#152) 112 | * Add Flatpak 113 | 114 | ## Improvements 115 | 116 | * generator: Strip documentation strings 117 | 118 | ## Typing 119 | 120 | * Improve type hints for 121 | - AppIndicator3 122 | - Cairo 123 | - Gdk4 124 | - GObject 125 | - Gtk3 126 | - PangoCairo 127 | 128 | ## Bug Fixes 129 | 130 | * generator: Fix documentation if empty 131 | 132 | # 2.8.0 (24 May 2023) 133 | 134 | ## Improvements 135 | 136 | * generator: Check nullability for __init__ 137 | 138 | ## Typing 139 | 140 | * Improve type hints for 141 | - Adw 142 | - Gtk4 143 | 144 | ## Bug Fixes 145 | 146 | * generate: Force varargs if function has closure 147 | * parse: Ignore documentation 148 | 149 | # 2.7.0 (28 Apr 2023) 150 | 151 | ## Improvements 152 | 153 | * Extract class' docstring 154 | 155 | ## Typing 156 | 157 | * Improve type hints for 158 | - Gdk4 159 | - Gtk3 160 | 161 | # 2.6.0 (08 Apr 2023) 162 | 163 | ## Improvements 164 | 165 | * Generator: Correctly type optional props 166 | 167 | ## Typing 168 | 169 | * Improve type hints for 170 | - Adw 171 | - GObject 172 | - Graphene 173 | - Gsk 174 | - Gtk3 175 | - Gtk4 176 | - GtkSource5 177 | - Pango 178 | 179 | ## Bug Fixes 180 | 181 | * Generator: Correct arg info for setter 182 | 183 | # 2.5.0 (21 Mar 2023) 184 | 185 | ## Feature 186 | 187 | * Add Vte (#7) 188 | * Add Rsvg (#116) 189 | 190 | ## Improvements 191 | 192 | * generator: Make file executable 193 | * generator: Add TypeVar _SomeSurface 194 | * generator: Better hints for functions 195 | 196 | ## Typing 197 | 198 | * Improve type hints for 199 | - Gdk4 200 | - Gio 201 | - Gio 202 | - Gtk3 203 | - Gtk4 204 | - GtkSource4 205 | 206 | ## Bug Fixes 207 | 208 | * generator: Fix hash maps 209 | * generator: Use GObject.GInterface for ifaces 210 | 211 | # 2.4.0 (19 Feb 2023) 212 | 213 | ## Feature 214 | 215 | * Add Ggit 216 | 217 | ## Improvements 218 | 219 | * Use GObject introspection to generate more accurate stubs ([#98](https://github.com/pygobject/pygobject-stubs/issues/98)) (#98) 220 | 221 | ## Typing 222 | 223 | * Improve type hints for 224 | - Adw 225 | - Atk 226 | - Gdk3 227 | - Gdk4 228 | - GdkPixbuf 229 | - Geoclue 230 | - Gio 231 | - GLib 232 | - GSound 233 | - Soup3 234 | 235 | # 2.3.1 (08 Feb 2023) 236 | 237 | ## Bug Fixes 238 | 239 | * Fix installing multilib stubs 240 | 241 | # 2.3.0 (08 Feb 2023) 242 | 243 | ## Feature 244 | 245 | * Add GtkSource5 246 | 247 | ## Typing 248 | 249 | * Improve type hints for 250 | - Adw 251 | - Gdk3 252 | - GeoClue 253 | - GObject 254 | - Gtk3 255 | - Gtk4 256 | - Manette 257 | 258 | ## Bug Fixes 259 | 260 | * Default to GtkSource5 when installing 261 | * Overwrite existing files when building from source 262 | 263 | # 2.2.0 (03 Jan 2023) 264 | 265 | ## Feature 266 | 267 | * Build with a PEP517 in-tree backend 268 | * Add Manette 269 | * Add Adwaita 270 | * Add Gdk4 271 | 272 | ## Typing 273 | 274 | * Improve type hints for 275 | - Gtk4 276 | - Gdk4 277 | - Gtk3 278 | - Soup 279 | - Gio 280 | - GObject 281 | - Soup3 282 | 283 | # 2.1.0 (18 Dec 2022) 284 | 285 | ## Changes 286 | 287 | * Port to pyproject.toml 288 | 289 | # 2.0.0 (18 Dec 2022) 290 | 291 | ## Changes 292 | 293 | * Add install option for multi version libs 294 | * Newest version of lib is installed by default 295 | -------------------------------------------------------------------------------- /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 | black . 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 | -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | include CHANGELOG.md 2 | recursive-include pep517backend * 3 | prune */__pycache__ 4 | -------------------------------------------------------------------------------- /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 | ```shell 8 | pip install pygobject-stubs 9 | ``` 10 | 11 | ### Configuration 12 | 13 | Some libraries exist in multiple versions like Gtk3/4. 14 | As both libraries are currently imported under the namespace `Gtk` only stubs for one can be installed. 15 | 16 | You need to decide this at install time either by using the `--config-settings` option with pip: 17 | 18 | ```shell 19 | pip install pygobject-stubs --no-cache-dir --config-settings=config=Gtk3,Gdk3,Soup2 20 | ``` 21 | 22 | or by setting the `PYGOBJECT_STUB_CONFIG` env variable: 23 | 24 | ```shell 25 | PYGOBJECT_STUB_CONFIG=Gtk3,Gdk3,Soup2 pip install --no-cache-dir pygobject-stubs 26 | ``` 27 | 28 | If no configuration is set, the most recent version of each library is installed. 29 | 30 | `--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. 31 | 32 | ### Project Integration 33 | 34 | Usually you want the stubs to be installed as part of the development dependencies. 35 | `pyproject.toml` does not allow to pass `config-settings` to requirements. 36 | 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. 37 | 38 | ```shell 39 | pip install . -r dev.txt 40 | ``` 41 | 42 | ## Contributing 43 | 44 | [Guide](./CONTRIBUTING.md) 45 | -------------------------------------------------------------------------------- /pep517backend/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/pygobject/pygobject-stubs/0f6104b3c6db58637d63561b8956c155262b512e/pep517backend/__init__.py -------------------------------------------------------------------------------- /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("Gtk", "4"), 45 | LibVersion("GtkSource", "5"), 46 | LibVersion("JavaScriptCore", "6"), 47 | LibVersion("Soup", "3"), 48 | LibVersion("WebKit", "6"), 49 | ] 50 | 51 | 52 | def _get_settings_stub_config( 53 | config_settings: Optional[dict[str, str]], 54 | ) -> list[LibVersion]: 55 | libs = [] 56 | if config_settings is None: 57 | return libs 58 | 59 | config = config_settings.get("config") 60 | if config is None: 61 | return libs 62 | 63 | libs = [lib.strip() for lib in config.split(",")] 64 | log.info("Settings stub config: %s", libs) 65 | return list(map(LibVersion.from_str, libs)) 66 | 67 | 68 | def _get_env_stub_config() -> list[LibVersion]: 69 | libs = [] 70 | env_var = os.environ.get("PYGOBJECT_STUB_CONFIG") 71 | if env_var is not None: 72 | libs = [lib.strip() for lib in env_var.split(",")] 73 | log.info("Env stub config: %s", libs) 74 | return list(map(LibVersion.from_str, libs)) 75 | 76 | 77 | def _check_config(stub_config: list[LibVersion]) -> None: 78 | for lib in stub_config: 79 | stub_path = GI_REPOSITORY_DIR / f"_{lib}.pyi" 80 | if not stub_path.exists(): 81 | raise ValueError(f"Unknown library {lib}") 82 | 83 | 84 | def _install_stubs(stub_config: list[LibVersion]) -> None: 85 | for lib in stub_config: 86 | if lib in DEFAULT_STUB_CONFIG: 87 | DEFAULT_STUB_CONFIG.remove(lib) 88 | 89 | for lib in itertools.chain(stub_config, DEFAULT_STUB_CONFIG): 90 | stub_path = GI_REPOSITORY_DIR / f"_{lib}.pyi" 91 | new_stub_path = GI_REPOSITORY_DIR / f"{lib.name}.pyi" 92 | log.info("Install %s", lib) 93 | shutil.copy(stub_path, new_stub_path) 94 | 95 | 96 | def get_requires_for_build_sdist(*args: Any, **kwargs: Any) -> str: 97 | return _orig.get_requires_for_build_sdist(*args, **kwargs) 98 | 99 | 100 | def build_sdist(*args: Any, **kwargs: Any) -> str: 101 | return _orig.build_sdist(*args, **kwargs) 102 | 103 | 104 | def get_requires_for_build_wheel(*args: Any, **kwargs: Any) -> str: 105 | return _orig.get_requires_for_build_wheel(*args, **kwargs) 106 | 107 | 108 | def prepare_metadata_for_build_wheel(*args: Any, **kwargs: Any) -> str: 109 | return _orig.prepare_metadata_for_build_wheel(*args, **kwargs) 110 | 111 | 112 | def build_wheel( 113 | wheel_directory: str, 114 | config_settings: Optional[dict[str, str]] = None, 115 | metadata_directory: Optional[str] = None, 116 | ) -> str: 117 | stub_config = _get_settings_stub_config(config_settings) 118 | if not stub_config: 119 | stub_config = _get_env_stub_config() 120 | 121 | _check_config(stub_config) 122 | _install_stubs(stub_config) 123 | 124 | basename = _orig.build_wheel( 125 | wheel_directory, 126 | config_settings=config_settings, 127 | metadata_directory=metadata_directory, 128 | ) 129 | 130 | return basename 131 | -------------------------------------------------------------------------------- /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.13.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 | 24 | [project.optional-dependencies] 25 | dev = [ 26 | "black>=25.1.0", 27 | "codespell>=2.4.1", 28 | "isort>=6.0.1", 29 | "ruff>=0.9.10", 30 | "pre-commit", 31 | "PyGObject", 32 | ] 33 | 34 | [project.urls] 35 | homepage = "https://github.com/pygobject/pygobject-stubs" 36 | repository = "https://github.com/pygobject/pygobject-stubs" 37 | 38 | [tool.setuptools.packages.find] 39 | where = ["src"] 40 | 41 | [tool.setuptools.package-data] 42 | "*" = ["*.pyi"] 43 | 44 | [tool.black] 45 | line-length = 88 46 | target-version = ['py39'] 47 | include = '\.pyi?$' 48 | 49 | [tool.codespell] 50 | skip = "*__pycache__*,.mypy_cache,.git,pyproject.toml,test,*.pyi" 51 | ignore-words-list = """ 52 | astroid, 53 | inout""" 54 | 55 | [tool.isort] 56 | force_alphabetical_sort_within_sections = true 57 | force_single_line = true 58 | group_by_package = true 59 | known_typing = ["typing"] 60 | sections = ["FUTURE", "TYPING", "STDLIB", "THIRDPARTY", "FIRSTPARTY", "LOCALFOLDER"] 61 | skip_gitignore = true 62 | 63 | [tool.ruff] 64 | line-length = 88 65 | exclude = [ 66 | ".eggs", 67 | ".git", 68 | ".ruff_cache", 69 | ".venv", 70 | ] 71 | 72 | target-version = "py39" 73 | 74 | [tool.ruff.lint] 75 | select = [ 76 | "PYI", # flake8-pyi 77 | ] 78 | ignore = [ 79 | "PYI001", # Name of private `TypeVar` must start with `_` 80 | "PYI011", # Only simple default values allowed for typed arguments 81 | "PYI019", # Methods like `__or__` should return `typing.Self` instead of a custom `TypeVar` 82 | "PYI021", # Docstrings should not be included in stubs 83 | "PYI026", # Use `typing_extensions.TypeAlias` 84 | "PYI052", # Need type annotation 85 | "PYI054", # Numeric literals with a string representation longer than ten characters are not permitted 86 | ] 87 | -------------------------------------------------------------------------------- /src/gi-stubs/__init__.pyi: -------------------------------------------------------------------------------- 1 | from typing import Optional 2 | 3 | __version__: str 4 | 5 | def check_version(version: str) -> None: ... 6 | def require_version(namespace: str, version: str) -> None: ... 7 | def require_versions(versions: dict[str, str]) -> None: ... 8 | def get_required_version(namespace: str) -> Optional[str]: ... 9 | def require_foreign(namespace: str, symbol: Optional[str] = None) -> None: ... 10 | -------------------------------------------------------------------------------- /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/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/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/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/GIRepository.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 = 1 14 | MICRO_VERSION: int = 1 15 | MINOR_VERSION: int = 80 16 | TYPE_TAG_N_TYPES: int = 22 17 | _lock = ... # FIXME Constant 18 | _namespace: str = "GIRepository" 19 | _version: str = "2.0" 20 | 21 | def arg_info_get_closure(info: BaseInfo) -> int: ... 22 | def arg_info_get_destroy(info: BaseInfo) -> int: ... 23 | def arg_info_get_direction(info: BaseInfo) -> Direction: ... 24 | def arg_info_get_ownership_transfer(info: BaseInfo) -> Transfer: ... 25 | def arg_info_get_scope(info: BaseInfo) -> ScopeType: ... 26 | def arg_info_get_type(info: BaseInfo) -> BaseInfo: ... 27 | def arg_info_is_caller_allocates(info: BaseInfo) -> bool: ... 28 | def arg_info_is_optional(info: BaseInfo) -> bool: ... 29 | def arg_info_is_return_value(info: BaseInfo) -> bool: ... 30 | def arg_info_is_skip(info: BaseInfo) -> bool: ... 31 | def arg_info_load_type(info: BaseInfo) -> BaseInfo: ... 32 | def arg_info_may_be_null(info: BaseInfo) -> bool: ... 33 | def callable_info_can_throw_gerror(info: BaseInfo) -> bool: ... 34 | def callable_info_get_arg(info: BaseInfo, n: int) -> BaseInfo: ... 35 | def callable_info_get_caller_owns(info: BaseInfo) -> Transfer: ... 36 | def callable_info_get_instance_ownership_transfer(info: BaseInfo) -> Transfer: ... 37 | def callable_info_get_n_args(info: BaseInfo) -> int: ... 38 | def callable_info_get_return_attribute(info: BaseInfo, name: str) -> str: ... 39 | def callable_info_get_return_type(info: BaseInfo) -> BaseInfo: ... 40 | def callable_info_invoke( 41 | info: BaseInfo, 42 | function: None, 43 | in_args: Sequence[Argument], 44 | out_args: Sequence[Argument], 45 | return_value: Argument, 46 | is_method: bool, 47 | throws: bool, 48 | ) -> bool: ... 49 | def callable_info_is_method(info: BaseInfo) -> bool: ... 50 | def callable_info_iterate_return_attributes( 51 | info: BaseInfo, 52 | ) -> Tuple[bool, AttributeIter, str, str]: ... 53 | def callable_info_load_arg(info: BaseInfo, n: int) -> BaseInfo: ... 54 | def callable_info_load_return_type(info: BaseInfo) -> BaseInfo: ... 55 | def callable_info_may_return_null(info: BaseInfo) -> bool: ... 56 | def callable_info_skip_return(info: BaseInfo) -> bool: ... 57 | def cclosure_marshal_generic( 58 | closure: Callable[..., Any], 59 | return_gvalue: Any, 60 | n_param_values: int, 61 | param_values: Any, 62 | invocation_hint: None, 63 | marshal_data: None, 64 | ) -> None: ... 65 | def constant_info_get_type(info: BaseInfo) -> BaseInfo: ... 66 | def enum_info_get_error_domain(info: BaseInfo) -> str: ... 67 | def enum_info_get_method(info: BaseInfo, n: int) -> BaseInfo: ... 68 | def enum_info_get_n_methods(info: BaseInfo) -> int: ... 69 | def enum_info_get_n_values(info: BaseInfo) -> int: ... 70 | def enum_info_get_storage_type(info: BaseInfo) -> TypeTag: ... 71 | def enum_info_get_value(info: BaseInfo, n: int) -> BaseInfo: ... 72 | def field_info_get_flags(info: BaseInfo) -> FieldInfoFlags: ... 73 | def field_info_get_offset(info: BaseInfo) -> int: ... 74 | def field_info_get_size(info: BaseInfo) -> int: ... 75 | def field_info_get_type(info: BaseInfo) -> BaseInfo: ... 76 | def function_info_get_flags(info: BaseInfo) -> FunctionInfoFlags: ... 77 | def function_info_get_property(info: BaseInfo) -> BaseInfo: ... 78 | def function_info_get_symbol(info: BaseInfo) -> str: ... 79 | def function_info_get_vfunc(info: BaseInfo) -> BaseInfo: ... 80 | def get_major_version() -> int: ... 81 | def get_micro_version() -> int: ... 82 | def get_minor_version() -> int: ... 83 | def info_new( 84 | type: InfoType, container: BaseInfo, typelib: Typelib, offset: int 85 | ) -> BaseInfo: ... 86 | def info_type_to_string(type: InfoType) -> str: ... 87 | def interface_info_find_method(info: BaseInfo, name: str) -> BaseInfo: ... 88 | def interface_info_find_signal(info: BaseInfo, name: str) -> BaseInfo: ... 89 | def interface_info_find_vfunc(info: BaseInfo, name: str) -> BaseInfo: ... 90 | def interface_info_get_constant(info: BaseInfo, n: int) -> BaseInfo: ... 91 | def interface_info_get_iface_struct(info: BaseInfo) -> BaseInfo: ... 92 | def interface_info_get_method(info: BaseInfo, n: int) -> BaseInfo: ... 93 | def interface_info_get_n_constants(info: BaseInfo) -> int: ... 94 | def interface_info_get_n_methods(info: BaseInfo) -> int: ... 95 | def interface_info_get_n_prerequisites(info: BaseInfo) -> int: ... 96 | def interface_info_get_n_properties(info: BaseInfo) -> int: ... 97 | def interface_info_get_n_signals(info: BaseInfo) -> int: ... 98 | def interface_info_get_n_vfuncs(info: BaseInfo) -> int: ... 99 | def interface_info_get_prerequisite(info: BaseInfo, n: int) -> BaseInfo: ... 100 | def interface_info_get_property(info: BaseInfo, n: int) -> BaseInfo: ... 101 | def interface_info_get_signal(info: BaseInfo, n: int) -> BaseInfo: ... 102 | def interface_info_get_vfunc(info: BaseInfo, n: int) -> BaseInfo: ... 103 | def invoke_error_quark() -> int: ... 104 | def object_info_find_method(info: BaseInfo, name: str) -> Optional[BaseInfo]: ... 105 | def object_info_find_method_using_interfaces( 106 | info: BaseInfo, name: str 107 | ) -> Tuple[Optional[BaseInfo], BaseInfo]: ... 108 | def object_info_find_signal(info: BaseInfo, name: str) -> Optional[BaseInfo]: ... 109 | def object_info_find_vfunc(info: BaseInfo, name: str) -> Optional[BaseInfo]: ... 110 | def object_info_find_vfunc_using_interfaces( 111 | info: BaseInfo, name: str 112 | ) -> Tuple[Optional[BaseInfo], BaseInfo]: ... 113 | def object_info_get_abstract(info: BaseInfo) -> bool: ... 114 | def object_info_get_class_struct(info: BaseInfo) -> Optional[BaseInfo]: ... 115 | def object_info_get_constant(info: BaseInfo, n: int) -> BaseInfo: ... 116 | def object_info_get_field(info: BaseInfo, n: int) -> BaseInfo: ... 117 | def object_info_get_final(info: BaseInfo) -> bool: ... 118 | def object_info_get_fundamental(info: BaseInfo) -> bool: ... 119 | def object_info_get_get_value_function(info: BaseInfo) -> Optional[str]: ... 120 | def object_info_get_interface(info: BaseInfo, n: int) -> BaseInfo: ... 121 | def object_info_get_method(info: BaseInfo, n: int) -> BaseInfo: ... 122 | def object_info_get_n_constants(info: BaseInfo) -> int: ... 123 | def object_info_get_n_fields(info: BaseInfo) -> int: ... 124 | def object_info_get_n_interfaces(info: BaseInfo) -> int: ... 125 | def object_info_get_n_methods(info: BaseInfo) -> int: ... 126 | def object_info_get_n_properties(info: BaseInfo) -> int: ... 127 | def object_info_get_n_signals(info: BaseInfo) -> int: ... 128 | def object_info_get_n_vfuncs(info: BaseInfo) -> int: ... 129 | def object_info_get_parent(info: BaseInfo) -> Optional[BaseInfo]: ... 130 | def object_info_get_property(info: BaseInfo, n: int) -> BaseInfo: ... 131 | def object_info_get_ref_function(info: BaseInfo) -> Optional[str]: ... 132 | def object_info_get_set_value_function(info: BaseInfo) -> Optional[str]: ... 133 | def object_info_get_signal(info: BaseInfo, n: int) -> BaseInfo: ... 134 | def object_info_get_type_init(info: BaseInfo) -> str: ... 135 | def object_info_get_type_name(info: BaseInfo) -> str: ... 136 | def object_info_get_unref_function(info: BaseInfo) -> Optional[str]: ... 137 | def object_info_get_vfunc(info: BaseInfo, n: int) -> BaseInfo: ... 138 | def property_info_get_flags(info: BaseInfo) -> GObject.ParamFlags: ... 139 | def property_info_get_getter(info: BaseInfo) -> Optional[BaseInfo]: ... 140 | def property_info_get_ownership_transfer(info: BaseInfo) -> Transfer: ... 141 | def property_info_get_setter(info: BaseInfo) -> Optional[BaseInfo]: ... 142 | def property_info_get_type(info: BaseInfo) -> BaseInfo: ... 143 | def registered_type_info_get_g_type(info: BaseInfo) -> Type: ... 144 | def registered_type_info_get_type_init(info: BaseInfo) -> str: ... 145 | def registered_type_info_get_type_name(info: BaseInfo) -> str: ... 146 | def signal_info_get_class_closure(info: BaseInfo) -> BaseInfo: ... 147 | def signal_info_get_flags(info: BaseInfo) -> GObject.SignalFlags: ... 148 | def signal_info_true_stops_emit(info: BaseInfo) -> bool: ... 149 | def struct_info_find_field(info: BaseInfo, name: str) -> BaseInfo: ... 150 | def struct_info_find_method(info: BaseInfo, name: str) -> BaseInfo: ... 151 | def struct_info_get_alignment(info: BaseInfo) -> int: ... 152 | def struct_info_get_copy_function(info: BaseInfo) -> Optional[str]: ... 153 | def struct_info_get_field(info: BaseInfo, n: int) -> BaseInfo: ... 154 | def struct_info_get_free_function(info: BaseInfo) -> Optional[str]: ... 155 | def struct_info_get_method(info: BaseInfo, n: int) -> BaseInfo: ... 156 | def struct_info_get_n_fields(info: BaseInfo) -> int: ... 157 | def struct_info_get_n_methods(info: BaseInfo) -> int: ... 158 | def struct_info_get_size(info: BaseInfo) -> int: ... 159 | def struct_info_is_foreign(info: BaseInfo) -> bool: ... 160 | def struct_info_is_gtype_struct(info: BaseInfo) -> bool: ... 161 | def type_info_argument_from_hash_pointer( 162 | info: BaseInfo, hash_pointer: None, arg: Argument 163 | ) -> None: ... 164 | def type_info_get_array_fixed_size(info: BaseInfo) -> int: ... 165 | def type_info_get_array_length(info: BaseInfo) -> int: ... 166 | def type_info_get_array_type(info: BaseInfo) -> ArrayType: ... 167 | def type_info_get_interface(info: BaseInfo) -> BaseInfo: ... 168 | def type_info_get_param_type(info: BaseInfo, n: int) -> BaseInfo: ... 169 | def type_info_get_storage_type(info: BaseInfo) -> TypeTag: ... 170 | def type_info_get_tag(info: BaseInfo) -> TypeTag: ... 171 | def type_info_hash_pointer_from_argument(info: BaseInfo, arg: Argument) -> None: ... 172 | def type_info_is_pointer(info: BaseInfo) -> bool: ... 173 | def type_info_is_zero_terminated(info: BaseInfo) -> bool: ... 174 | def type_tag_argument_from_hash_pointer( 175 | storage_type: TypeTag, hash_pointer: None, arg: Argument 176 | ) -> None: ... 177 | def type_tag_hash_pointer_from_argument( 178 | storage_type: TypeTag, arg: Argument 179 | ) -> None: ... 180 | def type_tag_to_string(type: TypeTag) -> str: ... 181 | def union_info_find_method(info: BaseInfo, name: str) -> BaseInfo: ... 182 | def union_info_get_alignment(info: BaseInfo) -> int: ... 183 | def union_info_get_copy_function(info: BaseInfo) -> Optional[str]: ... 184 | def union_info_get_discriminator(info: BaseInfo, n: int) -> BaseInfo: ... 185 | def union_info_get_discriminator_offset(info: BaseInfo) -> int: ... 186 | def union_info_get_discriminator_type(info: BaseInfo) -> BaseInfo: ... 187 | def union_info_get_field(info: BaseInfo, n: int) -> BaseInfo: ... 188 | def union_info_get_free_function(info: BaseInfo) -> Optional[str]: ... 189 | def union_info_get_method(info: BaseInfo, n: int) -> BaseInfo: ... 190 | def union_info_get_n_fields(info: BaseInfo) -> int: ... 191 | def union_info_get_n_methods(info: BaseInfo) -> int: ... 192 | def union_info_get_size(info: BaseInfo) -> int: ... 193 | def union_info_is_discriminated(info: BaseInfo) -> bool: ... 194 | def value_info_get_value(info: BaseInfo) -> int: ... 195 | def vfunc_info_get_address(info: BaseInfo, implementor_gtype: Type) -> None: ... 196 | def vfunc_info_get_flags(info: BaseInfo) -> VFuncInfoFlags: ... 197 | def vfunc_info_get_invoker(info: BaseInfo) -> BaseInfo: ... 198 | def vfunc_info_get_offset(info: BaseInfo) -> int: ... 199 | def vfunc_info_get_signal(info: BaseInfo) -> BaseInfo: ... 200 | 201 | class Argument(GObject.GPointer): 202 | v_boolean = ... # FIXME Constant 203 | v_double = ... # FIXME Constant 204 | v_float = ... # FIXME Constant 205 | v_int = ... # FIXME Constant 206 | v_int16 = ... # FIXME Constant 207 | v_int32 = ... # FIXME Constant 208 | v_int64 = ... # FIXME Constant 209 | v_int8 = ... # FIXME Constant 210 | v_long = ... # FIXME Constant 211 | v_pointer = ... # FIXME Constant 212 | v_short = ... # FIXME Constant 213 | v_size = ... # FIXME Constant 214 | v_ssize = ... # FIXME Constant 215 | v_string = ... # FIXME Constant 216 | v_uint = ... # FIXME Constant 217 | v_uint16 = ... # FIXME Constant 218 | v_uint32 = ... # FIXME Constant 219 | v_uint64 = ... # FIXME Constant 220 | v_uint8 = ... # FIXME Constant 221 | v_ulong = ... # FIXME Constant 222 | v_ushort = ... # FIXME Constant 223 | 224 | class AttributeIter(GObject.GPointer): 225 | """ 226 | :Constructors: 227 | 228 | :: 229 | 230 | AttributeIter() 231 | """ 232 | 233 | data: None = ... 234 | data2: None = ... 235 | data3: None = ... 236 | data4: None = ... 237 | 238 | class BaseInfo(GObject.GBoxed): 239 | """ 240 | :Constructors: 241 | 242 | :: 243 | 244 | BaseInfo() 245 | """ 246 | 247 | dummy1: int = ... 248 | dummy2: int = ... 249 | dummy3: None = ... 250 | dummy4: None = ... 251 | dummy5: None = ... 252 | dummy6: int = ... 253 | dummy7: int = ... 254 | padding: list[None] = ... 255 | def equal(self, info2: BaseInfo) -> bool: ... 256 | def get_attribute(self, name: str) -> str: ... 257 | def get_container(self) -> BaseInfo: ... 258 | def get_name(self) -> str: ... 259 | def get_namespace(self) -> str: ... 260 | def get_type(self) -> InfoType: ... 261 | def get_typelib(self) -> Typelib: ... 262 | def is_deprecated(self) -> bool: ... 263 | def iterate_attributes(self) -> Tuple[bool, AttributeIter, str, str]: ... 264 | 265 | class Repository(GObject.Object): 266 | """ 267 | :Constructors: 268 | 269 | :: 270 | 271 | Repository(**properties) 272 | 273 | Object GIRepository 274 | 275 | Signals from GObject: 276 | notify (GParam) 277 | """ 278 | 279 | parent: GObject.Object = ... 280 | priv: RepositoryPrivate = ... 281 | @staticmethod 282 | def dump(arg: str) -> bool: ... 283 | def enumerate_versions(self, namespace_: str) -> list[str]: ... 284 | @staticmethod 285 | def error_quark() -> int: ... 286 | def find_by_error_domain(self, domain: int) -> BaseInfo: ... 287 | def find_by_gtype(self, gtype: Type) -> BaseInfo: ... 288 | def find_by_name(self, namespace_: str, name: str) -> BaseInfo: ... 289 | def get_c_prefix(self, namespace_: str) -> str: ... 290 | @staticmethod 291 | def get_default() -> Repository: ... 292 | def get_dependencies(self, namespace_: str) -> list[str]: ... 293 | def get_immediate_dependencies(self, namespace_: str) -> list[str]: ... 294 | def get_info(self, namespace_: str, index: int) -> BaseInfo: ... 295 | def get_loaded_namespaces(self) -> list[str]: ... 296 | def get_n_infos(self, namespace_: str) -> int: ... 297 | def get_object_gtype_interfaces(self, gtype: Type) -> list[BaseInfo]: ... 298 | @staticmethod 299 | def get_option_group() -> GLib.OptionGroup: ... 300 | @staticmethod 301 | def get_search_path() -> list[str]: ... 302 | def get_shared_library(self, namespace_: str) -> Optional[str]: ... 303 | def get_typelib_path(self, namespace_: str) -> str: ... 304 | def get_version(self, namespace_: str) -> str: ... 305 | def is_registered(self, namespace_: str, version: Optional[str] = None) -> bool: ... 306 | def load_typelib(self, typelib: Typelib, flags: RepositoryLoadFlags) -> str: ... 307 | @staticmethod 308 | def prepend_library_path(directory: str) -> None: ... 309 | @staticmethod 310 | def prepend_search_path(directory: str) -> None: ... 311 | def require( 312 | self, namespace_: str, version: Optional[str], flags: RepositoryLoadFlags 313 | ) -> Typelib: ... 314 | def require_private( 315 | self, 316 | typelib_dir: str, 317 | namespace_: str, 318 | version: Optional[str], 319 | flags: RepositoryLoadFlags, 320 | ) -> Typelib: ... 321 | 322 | class RepositoryClass(GObject.GPointer): 323 | """ 324 | :Constructors: 325 | 326 | :: 327 | 328 | RepositoryClass() 329 | """ 330 | 331 | parent: GObject.ObjectClass = ... 332 | 333 | class RepositoryPrivate(GObject.GPointer): ... 334 | 335 | class Typelib(GObject.GPointer): 336 | def free(self) -> None: ... 337 | def get_namespace(self) -> str: ... 338 | def symbol(self, symbol_name: str, symbol: None) -> bool: ... 339 | 340 | class UnresolvedInfo(GObject.GPointer): ... 341 | 342 | class FieldInfoFlags(GObject.GFlags): 343 | READABLE = 1 344 | WRITABLE = 2 345 | 346 | class FunctionInfoFlags(GObject.GFlags): 347 | IS_CONSTRUCTOR = 2 348 | IS_GETTER = 4 349 | IS_METHOD = 1 350 | IS_SETTER = 8 351 | THROWS = 32 352 | WRAPS_VFUNC = 16 353 | 354 | class RepositoryLoadFlags(GObject.GFlags): 355 | IREPOSITORY_LOAD_FLAG_LAZY = 1 356 | 357 | class VFuncInfoFlags(GObject.GFlags): 358 | MUST_CHAIN_UP = 1 359 | MUST_NOT_OVERRIDE = 4 360 | MUST_OVERRIDE = 2 361 | THROWS = 8 362 | 363 | class ArrayType(GObject.GEnum): 364 | ARRAY = 1 365 | BYTE_ARRAY = 3 366 | C = 0 367 | PTR_ARRAY = 2 368 | 369 | class Direction(GObject.GEnum): 370 | IN = 0 371 | INOUT = 2 372 | OUT = 1 373 | 374 | class InfoType(GObject.GEnum): 375 | ARG = 17 376 | BOXED = 4 377 | CALLBACK = 2 378 | CONSTANT = 9 379 | ENUM = 5 380 | FIELD = 16 381 | FLAGS = 6 382 | FUNCTION = 1 383 | INTERFACE = 8 384 | INVALID = 0 385 | INVALID_0 = 10 386 | OBJECT = 7 387 | PROPERTY = 15 388 | SIGNAL = 13 389 | STRUCT = 3 390 | TYPE = 18 391 | UNION = 11 392 | UNRESOLVED = 19 393 | VALUE = 12 394 | VFUNC = 14 395 | 396 | class RepositoryError(GObject.GEnum): 397 | LIBRARY_NOT_FOUND = 3 398 | NAMESPACE_MISMATCH = 1 399 | NAMESPACE_VERSION_CONFLICT = 2 400 | TYPELIB_NOT_FOUND = 0 401 | 402 | class ScopeType(GObject.GEnum): 403 | ASYNC = 2 404 | CALL = 1 405 | FOREVER = 4 406 | INVALID = 0 407 | NOTIFIED = 3 408 | 409 | class Transfer(GObject.GEnum): 410 | CONTAINER = 1 411 | EVERYTHING = 2 412 | NOTHING = 0 413 | 414 | class TypeTag(GObject.GEnum): 415 | ARRAY = 15 416 | BOOLEAN = 1 417 | DOUBLE = 11 418 | ERROR = 20 419 | FILENAME = 14 420 | FLOAT = 10 421 | GHASH = 19 422 | GLIST = 17 423 | GSLIST = 18 424 | GTYPE = 12 425 | INT16 = 4 426 | INT32 = 6 427 | INT64 = 8 428 | INT8 = 2 429 | INTERFACE = 16 430 | UINT16 = 5 431 | UINT32 = 7 432 | UINT64 = 9 433 | UINT8 = 3 434 | UNICHAR = 21 435 | UTF8 = 13 436 | VOID = 0 437 | 438 | class nvokeError(GObject.GEnum): 439 | ARGUMENT_MISMATCH = 2 440 | FAILED = 0 441 | SYMBOL_NOT_FOUND = 1 442 | -------------------------------------------------------------------------------- /src/gi-stubs/repository/GModule.pyi: -------------------------------------------------------------------------------- 1 | from gi.repository import GObject 2 | 3 | _namespace: str = ... 4 | _version: str = ... 5 | 6 | def module_build_path(*args, **kwargs): ... 7 | def module_error(*args, **kwargs): ... 8 | def module_supported(*args, **kwargs): ... 9 | 10 | class Module: 11 | def build_path(*args, **kwargs): ... 12 | def close(*args, **kwargs): ... 13 | def error(*args, **kwargs): ... 14 | def make_resident(*args, **kwargs): ... 15 | def name(*args, **kwargs): ... 16 | def supported(*args, **kwargs): ... 17 | def symbol(*args, **kwargs): ... 18 | 19 | class ModuleFlags(GObject.GFlags): 20 | LAZY = ... 21 | LOCAL = ... 22 | MASK = ... 23 | -------------------------------------------------------------------------------- /src/gi-stubs/repository/GSound.pyi: -------------------------------------------------------------------------------- 1 | from typing import Any 2 | from typing import Callable 3 | from typing import Optional 4 | 5 | from gi.repository import Gio 6 | from gi.repository import GObject 7 | 8 | ATTR_APPLICATION_ICON: str = "application.icon" 9 | ATTR_APPLICATION_ICON_NAME: str = "application.icon_name" 10 | ATTR_APPLICATION_ID: str = "application.id" 11 | ATTR_APPLICATION_LANGUAGE: str = "application.language" 12 | ATTR_APPLICATION_NAME: str = "application.name" 13 | ATTR_APPLICATION_PROCESS_BINARY: str = "application.process.binary" 14 | ATTR_APPLICATION_PROCESS_HOST: str = "application.process.host" 15 | ATTR_APPLICATION_PROCESS_ID: str = "application.process.id" 16 | ATTR_APPLICATION_PROCESS_USER: str = "application.process.user" 17 | ATTR_APPLICATION_VERSION: str = "application.version" 18 | ATTR_CANBERRA_CACHE_CONTROL: str = "canberra.cache-control" 19 | ATTR_CANBERRA_ENABLE: str = "canberra.enable" 20 | ATTR_CANBERRA_FORCE_CHANNEL: str = "canberra.force_channel" 21 | ATTR_CANBERRA_VOLUME: str = "canberra.volume" 22 | ATTR_CANBERRA_XDG_THEME_NAME: str = "canberra.xdg-theme.name" 23 | ATTR_CANBERRA_XDG_THEME_OUTPUT_PROFILE: str = "canberra.xdg-theme.output-profile" 24 | ATTR_EVENT_DESCRIPTION: str = "event.description" 25 | ATTR_EVENT_ID: str = "event.id" 26 | ATTR_EVENT_MOUSE_BUTTON: str = "event.mouse.button" 27 | ATTR_EVENT_MOUSE_HPOS: str = "event.mouse.hpos" 28 | ATTR_EVENT_MOUSE_VPOS: str = "event.mouse.vpos" 29 | ATTR_EVENT_MOUSE_X: str = "event.mouse.x" 30 | ATTR_EVENT_MOUSE_Y: str = "event.mouse.y" 31 | ATTR_MEDIA_ARTIST: str = "media.artist" 32 | ATTR_MEDIA_FILENAME: str = "media.filename" 33 | ATTR_MEDIA_ICON: str = "media.icon" 34 | ATTR_MEDIA_ICON_NAME: str = "media.icon_name" 35 | ATTR_MEDIA_LANGUAGE: str = "media.language" 36 | ATTR_MEDIA_NAME: str = "media.name" 37 | ATTR_MEDIA_ROLE: str = "media.role" 38 | ATTR_MEDIA_TITLE: str = "media.title" 39 | ATTR_WINDOW_DESKTOP: str = "window.desktop" 40 | ATTR_WINDOW_HEIGHT: str = "window.height" 41 | ATTR_WINDOW_HPOS: str = "window.hpos" 42 | ATTR_WINDOW_ICON: str = "window.icon" 43 | ATTR_WINDOW_ICON_NAME: str = "window.icon_name" 44 | ATTR_WINDOW_ID: str = "window.id" 45 | ATTR_WINDOW_NAME: str = "window.name" 46 | ATTR_WINDOW_VPOS: str = "window.vpos" 47 | ATTR_WINDOW_WIDTH: str = "window.width" 48 | ATTR_WINDOW_X: str = "window.x" 49 | ATTR_WINDOW_X11_DISPLAY: str = "window.x11.display" 50 | ATTR_WINDOW_X11_MONITOR: str = "window.x11.monitor" 51 | ATTR_WINDOW_X11_SCREEN: str = "window.x11.screen" 52 | ATTR_WINDOW_X11_XID: str = "window.x11.xid" 53 | ATTR_WINDOW_Y: str = "window.y" 54 | _namespace: str = "GSound" 55 | _version: str = "1.0" 56 | 57 | def error_quark() -> int: ... 58 | 59 | class Context(GObject.Object, Gio.Initable): 60 | def cache(self, attrs: dict[str, str]) -> bool: ... 61 | @classmethod 62 | def new(cls, cancellable: Optional[Gio.Cancellable] = None) -> Context: ... 63 | def open(self) -> bool: ... 64 | def play_full( 65 | self, 66 | attrs: dict[str, str], 67 | cancellable: Optional[Gio.Cancellable] = None, 68 | callback: Optional[Callable[..., None]] = None, 69 | *user_data: Any, 70 | ) -> None: ... 71 | def play_full_finish(self, result: Gio.AsyncResult) -> bool: ... 72 | def play_simple( 73 | self, attrs: dict[str, str], cancellable: Optional[Gio.Cancellable] = None 74 | ) -> bool: ... 75 | def set_attributes(self, attrs: dict[str, str]) -> bool: ... 76 | def set_driver(self, driver: str) -> bool: ... 77 | 78 | class ContextClass(GObject.GPointer): ... 79 | 80 | class Error(GObject.GEnum): 81 | ACCESS = -13 82 | CANCELED = -11 83 | CORRUPT = -7 84 | DESTROYED = -10 85 | DISABLED = -16 86 | DISCONNECTED = -18 87 | FORKED = -17 88 | INTERNAL = -15 89 | INVALID = -2 90 | IO = -14 91 | NODRIVER = -5 92 | NOTAVAILABLE = -12 93 | NOTFOUND = -9 94 | NOTSUPPORTED = -1 95 | OOM = -4 96 | STATE = -3 97 | SYSTEM = -6 98 | TOOBIG = -8 99 | -------------------------------------------------------------------------------- /src/gi-stubs/repository/GdkX11.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 | from typing import Union 10 | 11 | from gi.repository import Gdk 12 | from gi.repository import GObject 13 | from gi.repository import Pango 14 | from gi.repository import xlib 15 | 16 | _lock = ... # FIXME Constant 17 | _namespace: str = "GdkX11" 18 | _version: str = "4.0" 19 | 20 | def x11_device_get_id(device: X11DeviceXI2) -> int: ... 21 | def x11_device_manager_lookup( 22 | device_manager: X11DeviceManagerXI2, device_id: int 23 | ) -> Optional[X11DeviceXI2]: ... 24 | def x11_free_compound_text(ctext: int) -> None: ... 25 | def x11_free_text_list(list: str) -> None: ... 26 | def x11_get_server_time(surface: X11Surface) -> int: ... 27 | def x11_get_xatom_by_name_for_display(display: X11Display, atom_name: str) -> int: ... 28 | def x11_get_xatom_name_for_display(display: X11Display, xatom: int) -> str: ... 29 | def x11_lookup_xdisplay(xdisplay: xlib.Display) -> X11Display: ... 30 | def x11_set_sm_client_id(sm_client_id: Optional[str] = None) -> None: ... 31 | 32 | class X11AppLaunchContext(Gdk.AppLaunchContext): 33 | """ 34 | :Constructors: 35 | 36 | :: 37 | 38 | X11AppLaunchContext(**properties) 39 | 40 | Object GdkX11AppLaunchContext 41 | 42 | Properties from GdkAppLaunchContext: 43 | display -> GdkDisplay: display 44 | 45 | Signals from GAppLaunchContext: 46 | launch-failed (gchararray) 47 | launch-started (GAppInfo, GVariant) 48 | launched (GAppInfo, GVariant) 49 | 50 | Signals from GObject: 51 | notify (GParam) 52 | """ 53 | 54 | class Props: 55 | display: Gdk.Display 56 | 57 | props: Props = ... 58 | def __init__(self, display: Gdk.Display = ...): ... 59 | 60 | class X11AppLaunchContextClass(GObject.GPointer): ... 61 | 62 | class X11DeviceManagerXI2(GObject.Object): 63 | """ 64 | :Constructors: 65 | 66 | :: 67 | 68 | X11DeviceManagerXI2(**properties) 69 | 70 | Object GdkX11DeviceManagerXI2 71 | 72 | Properties from GdkX11DeviceManagerXI2: 73 | display -> GdkDisplay: display 74 | opcode -> gint: opcode 75 | major -> gint: major 76 | minor -> gint: minor 77 | 78 | Signals from GObject: 79 | notify (GParam) 80 | """ 81 | 82 | class Props: 83 | display: Gdk.Display 84 | major: int 85 | minor: int 86 | opcode: int 87 | 88 | props: Props = ... 89 | def __init__( 90 | self, 91 | display: Gdk.Display = ..., 92 | major: int = ..., 93 | minor: int = ..., 94 | opcode: int = ..., 95 | ): ... 96 | 97 | class X11DeviceManagerXI2Class(GObject.GPointer): ... 98 | 99 | class X11DeviceXI2(Gdk.Device): 100 | """ 101 | :Constructors: 102 | 103 | :: 104 | 105 | X11DeviceXI2(**properties) 106 | 107 | Object GdkX11DeviceXI2 108 | 109 | Properties from GdkX11DeviceXI2: 110 | device-id -> gint: device-id 111 | 112 | Signals from GdkDevice: 113 | changed () 114 | tool-changed (GdkDeviceTool) 115 | 116 | Properties from GdkDevice: 117 | display -> GdkDisplay: display 118 | name -> gchararray: name 119 | source -> GdkInputSource: source 120 | has-cursor -> gboolean: has-cursor 121 | n-axes -> guint: n-axes 122 | vendor-id -> gchararray: vendor-id 123 | product-id -> gchararray: product-id 124 | seat -> GdkSeat: seat 125 | num-touches -> guint: num-touches 126 | tool -> GdkDeviceTool: tool 127 | direction -> PangoDirection: direction 128 | has-bidi-layouts -> gboolean: has-bidi-layouts 129 | caps-lock-state -> gboolean: caps-lock-state 130 | num-lock-state -> gboolean: num-lock-state 131 | scroll-lock-state -> gboolean: scroll-lock-state 132 | modifier-state -> GdkModifierType: modifier-state 133 | 134 | Signals from GObject: 135 | notify (GParam) 136 | """ 137 | 138 | class Props: 139 | device_id: int 140 | caps_lock_state: bool 141 | direction: Pango.Direction 142 | display: Gdk.Display 143 | has_bidi_layouts: bool 144 | has_cursor: bool 145 | modifier_state: Gdk.ModifierType 146 | n_axes: int 147 | name: str 148 | num_lock_state: bool 149 | num_touches: int 150 | product_id: Optional[str] 151 | scroll_lock_state: bool 152 | seat: Gdk.Seat 153 | source: Gdk.InputSource 154 | tool: Gdk.DeviceTool 155 | vendor_id: Optional[str] 156 | 157 | props: Props = ... 158 | def __init__( 159 | self, 160 | device_id: int = ..., 161 | display: Gdk.Display = ..., 162 | has_cursor: bool = ..., 163 | name: str = ..., 164 | num_touches: int = ..., 165 | product_id: str = ..., 166 | seat: Gdk.Seat = ..., 167 | source: Gdk.InputSource = ..., 168 | vendor_id: str = ..., 169 | ): ... 170 | 171 | class X11DeviceXI2Class(GObject.GPointer): ... 172 | 173 | class X11Display(Gdk.Display): 174 | """ 175 | :Constructors: 176 | 177 | :: 178 | 179 | X11Display(**properties) 180 | 181 | Object GdkX11Display 182 | 183 | Signals from GdkX11Display: 184 | xevent (gpointer) -> gboolean 185 | 186 | Signals from GdkDisplay: 187 | opened () 188 | closed (gboolean) 189 | seat-added (GdkSeat) 190 | seat-removed (GdkSeat) 191 | setting-changed (gchararray) 192 | 193 | Properties from GdkDisplay: 194 | composited -> gboolean: composited 195 | rgba -> gboolean: rgba 196 | shadow-width -> gboolean: shadow-width 197 | input-shapes -> gboolean: input-shapes 198 | dmabuf-formats -> GdkDmabufFormats: dmabuf-formats 199 | 200 | Signals from GObject: 201 | notify (GParam) 202 | """ 203 | 204 | class Props: 205 | composited: bool 206 | dmabuf_formats: Gdk.DmabufFormats 207 | input_shapes: bool 208 | rgba: bool 209 | shadow_width: bool 210 | 211 | props: Props = ... 212 | def error_trap_pop(self) -> int: ... 213 | def error_trap_pop_ignored(self) -> None: ... 214 | def error_trap_push(self) -> None: ... 215 | def get_default_group(self) -> Gdk.Surface: ... 216 | def get_egl_display(self) -> None: ... 217 | def get_egl_version(self) -> Tuple[bool, int, int]: ... 218 | def get_glx_version(self) -> Tuple[bool, int, int]: ... 219 | def get_primary_monitor(self) -> Gdk.Monitor: ... 220 | def get_screen(self) -> X11Screen: ... 221 | def get_startup_notification_id(self) -> str: ... 222 | def get_user_time(self) -> int: ... 223 | def get_xcursor(self, cursor: Gdk.Cursor) -> int: ... 224 | def get_xdisplay(self) -> xlib.Display: ... 225 | def get_xrootwindow(self) -> int: ... 226 | def get_xscreen(self) -> xlib.Screen: ... 227 | def grab(self) -> None: ... 228 | @staticmethod 229 | def open(display_name: Optional[str] = None) -> Optional[Gdk.Display]: ... 230 | def set_cursor_theme(self, theme: Optional[str], size: int) -> None: ... 231 | @staticmethod 232 | def set_program_class(display: Gdk.Display, program_class: str) -> None: ... 233 | def set_startup_notification_id(self, startup_id: str) -> None: ... 234 | def set_surface_scale(self, scale: int) -> None: ... 235 | def string_to_compound_text(self, str: str) -> Tuple[int, str, int, bytes]: ... 236 | def text_property_to_text_list( 237 | self, encoding: str, format: int, text: int, length: int, list: str 238 | ) -> int: ... 239 | def ungrab(self) -> None: ... 240 | def utf8_to_compound_text(self, str: str) -> Tuple[bool, str, int, bytes]: ... 241 | 242 | class X11DisplayClass(GObject.GPointer): ... 243 | 244 | class X11Drag(Gdk.Drag): 245 | """ 246 | :Constructors: 247 | 248 | :: 249 | 250 | X11Drag(**properties) 251 | 252 | Object GdkX11Drag 253 | 254 | Signals from GdkDrag: 255 | cancel (GdkDragCancelReason) 256 | drop-performed () 257 | dnd-finished () 258 | 259 | Properties from GdkDrag: 260 | content -> GdkContentProvider: content 261 | device -> GdkDevice: device 262 | display -> GdkDisplay: display 263 | formats -> GdkContentFormats: formats 264 | selected-action -> GdkDragAction: selected-action 265 | actions -> GdkDragAction: actions 266 | surface -> GdkSurface: surface 267 | 268 | Signals from GObject: 269 | notify (GParam) 270 | """ 271 | 272 | class 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 | ): ... 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 | 317 | class Props: 318 | allowed_apis: Gdk.GLAPI 319 | api: Gdk.GLAPI 320 | shared_context: Optional[Gdk.GLContext] 321 | display: Optional[Gdk.Display] 322 | surface: Optional[Gdk.Surface] 323 | 324 | props: Props = ... 325 | def __init__( 326 | self, 327 | allowed_apis: Gdk.GLAPI = ..., 328 | shared_context: Gdk.GLContext = ..., 329 | display: Gdk.Display = ..., 330 | surface: Gdk.Surface = ..., 331 | ): ... 332 | 333 | class X11GLContextClass(GObject.GPointer): ... 334 | 335 | class X11Monitor(Gdk.Monitor): 336 | """ 337 | :Constructors: 338 | 339 | :: 340 | 341 | X11Monitor(**properties) 342 | 343 | Object GdkX11Monitor 344 | 345 | Signals from GdkMonitor: 346 | invalidate () 347 | 348 | Properties from GdkMonitor: 349 | description -> gchararray: description 350 | display -> GdkDisplay: display 351 | manufacturer -> gchararray: manufacturer 352 | model -> gchararray: model 353 | connector -> gchararray: connector 354 | scale-factor -> gint: scale-factor 355 | scale -> gdouble: scale 356 | geometry -> GdkRectangle: geometry 357 | width-mm -> gint: width-mm 358 | height-mm -> gint: height-mm 359 | refresh-rate -> gint: refresh-rate 360 | subpixel-layout -> GdkSubpixelLayout: subpixel-layout 361 | valid -> gboolean: valid 362 | 363 | Signals from GObject: 364 | notify (GParam) 365 | """ 366 | 367 | class Props: 368 | connector: Optional[str] 369 | description: Optional[str] 370 | display: Gdk.Display 371 | geometry: Gdk.Rectangle 372 | height_mm: int 373 | manufacturer: Optional[str] 374 | model: Optional[str] 375 | refresh_rate: int 376 | scale: float 377 | scale_factor: int 378 | subpixel_layout: Gdk.SubpixelLayout 379 | valid: bool 380 | width_mm: int 381 | 382 | props: Props = ... 383 | def __init__(self, display: Gdk.Display = ...): ... 384 | def get_output(self) -> int: ... 385 | def get_workarea(self) -> Gdk.Rectangle: ... 386 | 387 | class X11MonitorClass(GObject.GPointer): ... 388 | 389 | class X11Screen(GObject.Object): 390 | """ 391 | :Constructors: 392 | 393 | :: 394 | 395 | X11Screen(**properties) 396 | 397 | Object GdkX11Screen 398 | 399 | Signals from GdkX11Screen: 400 | window-manager-changed () 401 | 402 | Signals from GObject: 403 | notify (GParam) 404 | """ 405 | 406 | def get_current_desktop(self) -> int: ... 407 | def get_monitor_output(self, monitor_num: int) -> int: ... 408 | def get_number_of_desktops(self) -> int: ... 409 | def get_screen_number(self) -> int: ... 410 | def get_window_manager_name(self) -> str: ... 411 | def get_xscreen(self) -> xlib.Screen: ... 412 | def supports_net_wm_hint(self, property_name: str) -> bool: ... 413 | 414 | class X11ScreenClass(GObject.GPointer): ... 415 | 416 | class X11Surface(Gdk.Surface): 417 | """ 418 | :Constructors: 419 | 420 | :: 421 | 422 | X11Surface(**properties) 423 | 424 | Object GdkX11Surface 425 | 426 | Signals from GdkSurface: 427 | layout (gint, gint) 428 | render (CairoRegion) -> gboolean 429 | event (gpointer) -> gboolean 430 | enter-monitor (GdkMonitor) 431 | leave-monitor (GdkMonitor) 432 | 433 | Properties from GdkSurface: 434 | cursor -> GdkCursor: cursor 435 | display -> GdkDisplay: display 436 | frame-clock -> GdkFrameClock: frame-clock 437 | mapped -> gboolean: mapped 438 | width -> gint: width 439 | height -> gint: height 440 | scale-factor -> gint: scale-factor 441 | scale -> gdouble: scale 442 | 443 | Signals from GObject: 444 | notify (GParam) 445 | """ 446 | 447 | class Props: 448 | cursor: Optional[Gdk.Cursor] 449 | display: Gdk.Display 450 | frame_clock: Gdk.FrameClock 451 | height: int 452 | mapped: bool 453 | scale: float 454 | scale_factor: int 455 | width: int 456 | 457 | props: Props = ... 458 | def __init__( 459 | self, 460 | cursor: Optional[Gdk.Cursor] = ..., 461 | display: Gdk.Display = ..., 462 | frame_clock: Gdk.FrameClock = ..., 463 | ): ... 464 | def get_desktop(self) -> int: ... 465 | def get_group(self) -> Optional[Gdk.Surface]: ... 466 | def get_xid(self) -> int: ... 467 | @staticmethod 468 | def lookup_for_display(display: X11Display, window: int) -> X11Surface: ... 469 | def move_to_current_desktop(self) -> None: ... 470 | def move_to_desktop(self, desktop: int) -> None: ... 471 | def set_frame_sync_enabled(self, frame_sync_enabled: bool) -> None: ... 472 | def set_group(self, leader: Gdk.Surface) -> None: ... 473 | def set_skip_pager_hint(self, skips_pager: bool) -> None: ... 474 | def set_skip_taskbar_hint(self, skips_taskbar: bool) -> None: ... 475 | def set_theme_variant(self, variant: str) -> None: ... 476 | def set_urgency_hint(self, urgent: bool) -> None: ... 477 | def set_user_time(self, timestamp: int) -> None: ... 478 | def set_utf8_property(self, name: str, value: Optional[str] = None) -> None: ... 479 | 480 | class X11SurfaceClass(GObject.GPointer): ... 481 | 482 | class X11DeviceType(GObject.GEnum): 483 | FLOATING = 2 484 | LOGICAL = 0 485 | PHYSICAL = 1 486 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /src/gi-stubs/repository/GstSdp.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 | from gi.repository import Gst 13 | 14 | MIKEY_VERSION: int = 1 15 | SDP_BWTYPE_AS: str = "AS" 16 | SDP_BWTYPE_CT: str = "CT" 17 | SDP_BWTYPE_EXT_PREFIX: str = "X-" 18 | SDP_BWTYPE_RR: str = "RR" 19 | SDP_BWTYPE_RS: str = "RS" 20 | SDP_BWTYPE_TIAS: str = "TIAS" 21 | _lock = ... # FIXME Constant 22 | _namespace: str = "GstSdp" 23 | _version: str = "1.0" 24 | 25 | def sdp_address_is_multicast(nettype: str, addrtype: str, addr: str) -> bool: ... 26 | def sdp_make_keymgmt(uri: str, base64: str) -> str: ... 27 | def sdp_media_new() -> Tuple[SDPResult, SDPMedia]: ... 28 | def sdp_media_set_media_from_caps(caps: Gst.Caps, media: SDPMedia) -> SDPResult: ... 29 | def sdp_message_as_uri(scheme: str, msg: SDPMessage) -> str: ... 30 | def sdp_message_new() -> Tuple[SDPResult, SDPMessage]: ... 31 | def sdp_message_new_from_text(text: str) -> Tuple[SDPResult, SDPMessage]: ... 32 | def sdp_message_parse_buffer(data: Sequence[int], msg: SDPMessage) -> SDPResult: ... 33 | def sdp_message_parse_uri(uri: str, msg: SDPMessage) -> SDPResult: ... 34 | 35 | class MIKEYDecryptInfo(GObject.GPointer): ... 36 | class MIKEYEncryptInfo(GObject.GPointer): ... 37 | 38 | class MIKEYMapSRTP(GObject.GPointer): 39 | """ 40 | :Constructors: 41 | 42 | :: 43 | 44 | MIKEYMapSRTP() 45 | """ 46 | 47 | policy: int = ... 48 | ssrc: int = ... 49 | roc: int = ... 50 | 51 | class MIKEYMessage(GObject.GBoxed): 52 | """ 53 | :Constructors: 54 | 55 | :: 56 | 57 | MIKEYMessage() 58 | new() -> GstSdp.MIKEYMessage 59 | new_from_bytes(bytes:GLib.Bytes, info:GstSdp.MIKEYDecryptInfo) -> GstSdp.MIKEYMessage 60 | new_from_caps(caps:Gst.Caps) -> GstSdp.MIKEYMessage 61 | new_from_data(data:list, info:GstSdp.MIKEYDecryptInfo) -> GstSdp.MIKEYMessage 62 | """ 63 | 64 | mini_object: Gst.MiniObject = ... 65 | version: int = ... 66 | type: MIKEYType = ... 67 | V: bool = ... 68 | prf_func: MIKEYPRFFunc = ... 69 | CSB_id: int = ... 70 | map_type: MIKEYMapType = ... 71 | map_info: list[None] = ... 72 | payloads: list[None] = ... 73 | def add_cs_srtp(self, policy: int, ssrc: int, roc: int) -> bool: ... 74 | def add_payload(self, payload: MIKEYPayload) -> bool: ... 75 | def add_pke(self, C: MIKEYCacheType, data: Sequence[int]) -> bool: ... 76 | def add_rand(self, rand: Sequence[int]) -> bool: ... 77 | def add_rand_len(self, len: int) -> bool: ... 78 | def add_t(self, type: MIKEYTSType, ts_value: Sequence[int]) -> bool: ... 79 | def add_t_now_ntp_utc(self) -> bool: ... 80 | def base64_encode(self) -> str: ... 81 | def find_payload(self, type: MIKEYPayloadType, nth: int) -> MIKEYPayload: ... 82 | def get_cs_srtp(self, idx: int) -> MIKEYMapSRTP: ... 83 | def get_n_cs(self) -> int: ... 84 | def get_n_payloads(self) -> int: ... 85 | def get_payload(self, idx: int) -> MIKEYPayload: ... 86 | def insert_cs_srtp(self, idx: int, map: MIKEYMapSRTP) -> bool: ... 87 | def insert_payload(self, idx: int, payload: MIKEYPayload) -> bool: ... 88 | @classmethod 89 | def new(cls) -> MIKEYMessage: ... 90 | @classmethod 91 | def new_from_bytes( 92 | cls, bytes: GLib.Bytes, info: MIKEYDecryptInfo 93 | ) -> MIKEYMessage: ... 94 | @classmethod 95 | def new_from_caps(cls, caps: Gst.Caps) -> MIKEYMessage: ... 96 | @classmethod 97 | def new_from_data( 98 | cls, data: Sequence[int], info: MIKEYDecryptInfo 99 | ) -> MIKEYMessage: ... 100 | def remove_cs_srtp(self, idx: int) -> bool: ... 101 | def remove_payload(self, idx: int) -> bool: ... 102 | def replace_cs_srtp(self, idx: int, map: MIKEYMapSRTP) -> bool: ... 103 | def replace_payload(self, idx: int, payload: MIKEYPayload) -> bool: ... 104 | def set_info( 105 | self, 106 | version: int, 107 | type: MIKEYType, 108 | V: bool, 109 | prf_func: MIKEYPRFFunc, 110 | CSB_id: int, 111 | map_type: MIKEYMapType, 112 | ) -> bool: ... 113 | def to_bytes(self, info: MIKEYEncryptInfo) -> GLib.Bytes: ... 114 | def to_caps(self, caps: Gst.Caps) -> bool: ... 115 | 116 | class MIKEYPayload(GObject.GBoxed): 117 | """ 118 | :Constructors: 119 | 120 | :: 121 | 122 | MIKEYPayload() 123 | new(type:GstSdp.MIKEYPayloadType) -> GstSdp.MIKEYPayload or None 124 | """ 125 | 126 | mini_object: Gst.MiniObject = ... 127 | type: MIKEYPayloadType = ... 128 | len: int = ... 129 | def kemac_add_sub(self, newpay: MIKEYPayload) -> bool: ... 130 | def kemac_get_n_sub(self) -> int: ... 131 | def kemac_get_sub(self, idx: int) -> MIKEYPayload: ... 132 | def kemac_remove_sub(self, idx: int) -> bool: ... 133 | def kemac_set(self, enc_alg: MIKEYEncAlg, mac_alg: MIKEYMacAlg) -> bool: ... 134 | def key_data_set_interval( 135 | self, vf_data: Sequence[int], vt_data: Sequence[int] 136 | ) -> bool: ... 137 | def key_data_set_key( 138 | self, key_type: MIKEYKeyDataType, key_data: Sequence[int] 139 | ) -> bool: ... 140 | def key_data_set_salt(self, salt_data: Optional[Sequence[int]] = None) -> bool: ... 141 | def key_data_set_spi(self, spi_data: Sequence[int]) -> bool: ... 142 | @classmethod 143 | def new(cls, type: MIKEYPayloadType) -> Optional[MIKEYPayload]: ... 144 | def pke_set(self, C: MIKEYCacheType, data: Sequence[int]) -> bool: ... 145 | def rand_set(self, rand: Sequence[int]) -> bool: ... 146 | def sp_add_param(self, type: int, val: Sequence[int]) -> bool: ... 147 | def sp_get_n_params(self) -> int: ... 148 | def sp_get_param(self, idx: int) -> MIKEYPayloadSPParam: ... 149 | def sp_remove_param(self, idx: int) -> bool: ... 150 | def sp_set(self, policy: int, proto: MIKEYSecProto) -> bool: ... 151 | def t_set(self, type: MIKEYTSType, ts_value: Sequence[int]) -> bool: ... 152 | 153 | class MIKEYPayloadKEMAC(GObject.GPointer): 154 | """ 155 | :Constructors: 156 | 157 | :: 158 | 159 | MIKEYPayloadKEMAC() 160 | """ 161 | 162 | pt: MIKEYPayload = ... 163 | enc_alg: MIKEYEncAlg = ... 164 | mac_alg: MIKEYMacAlg = ... 165 | subpayloads: list[None] = ... 166 | 167 | class MIKEYPayloadKeyData(GObject.GPointer): 168 | """ 169 | :Constructors: 170 | 171 | :: 172 | 173 | MIKEYPayloadKeyData() 174 | """ 175 | 176 | pt: MIKEYPayload = ... 177 | key_type: MIKEYKeyDataType = ... 178 | key_len: int = ... 179 | key_data: int = ... 180 | salt_len: int = ... 181 | salt_data: int = ... 182 | kv_type: MIKEYKVType = ... 183 | kv_len: bytes = ... 184 | kv_data: bytes = ... 185 | 186 | class MIKEYPayloadPKE(GObject.GPointer): 187 | """ 188 | :Constructors: 189 | 190 | :: 191 | 192 | MIKEYPayloadPKE() 193 | """ 194 | 195 | pt: MIKEYPayload = ... 196 | C: MIKEYCacheType = ... 197 | data_len: int = ... 198 | data: int = ... 199 | 200 | class MIKEYPayloadRAND(GObject.GPointer): 201 | """ 202 | :Constructors: 203 | 204 | :: 205 | 206 | MIKEYPayloadRAND() 207 | """ 208 | 209 | pt: MIKEYPayload = ... 210 | len: int = ... 211 | rand: int = ... 212 | 213 | class MIKEYPayloadSP(GObject.GPointer): 214 | """ 215 | :Constructors: 216 | 217 | :: 218 | 219 | MIKEYPayloadSP() 220 | """ 221 | 222 | pt: MIKEYPayload = ... 223 | policy: int = ... 224 | proto: MIKEYSecProto = ... 225 | params: list[None] = ... 226 | 227 | class MIKEYPayloadSPParam(GObject.GPointer): 228 | """ 229 | :Constructors: 230 | 231 | :: 232 | 233 | MIKEYPayloadSPParam() 234 | """ 235 | 236 | type: int = ... 237 | len: int = ... 238 | val: int = ... 239 | 240 | class MIKEYPayloadT(GObject.GPointer): 241 | """ 242 | :Constructors: 243 | 244 | :: 245 | 246 | MIKEYPayloadT() 247 | """ 248 | 249 | pt: MIKEYPayload = ... 250 | type: MIKEYTSType = ... 251 | ts_value: int = ... 252 | 253 | class SDPAttribute(GObject.GPointer): 254 | """ 255 | :Constructors: 256 | 257 | :: 258 | 259 | SDPAttribute() 260 | """ 261 | 262 | key: str = ... 263 | value: str = ... 264 | def clear(self) -> SDPResult: ... 265 | def set(self, key: str, value: Optional[str] = None) -> SDPResult: ... 266 | 267 | class SDPBandwidth(GObject.GPointer): 268 | """ 269 | :Constructors: 270 | 271 | :: 272 | 273 | SDPBandwidth() 274 | """ 275 | 276 | bwtype: str = ... 277 | bandwidth: int = ... 278 | def clear(self) -> SDPResult: ... 279 | def set(self, bwtype: str, bandwidth: int) -> SDPResult: ... 280 | 281 | class SDPConnection(GObject.GPointer): 282 | """ 283 | :Constructors: 284 | 285 | :: 286 | 287 | SDPConnection() 288 | """ 289 | 290 | nettype: str = ... 291 | addrtype: str = ... 292 | address: str = ... 293 | ttl: int = ... 294 | addr_number: int = ... 295 | def clear(self) -> SDPResult: ... 296 | def set( 297 | self, nettype: str, addrtype: str, address: str, ttl: int, addr_number: int 298 | ) -> SDPResult: ... 299 | 300 | class SDPKey(GObject.GPointer): 301 | """ 302 | :Constructors: 303 | 304 | :: 305 | 306 | SDPKey() 307 | """ 308 | 309 | type: str = ... 310 | data: str = ... 311 | 312 | class SDPMedia(GObject.GPointer): 313 | """ 314 | :Constructors: 315 | 316 | :: 317 | 318 | SDPMedia() 319 | """ 320 | 321 | media: str = ... 322 | port: int = ... 323 | num_ports: int = ... 324 | proto: str = ... 325 | fmts: list[None] = ... 326 | information: str = ... 327 | connections: list[None] = ... 328 | bandwidths: list[None] = ... 329 | key: SDPKey = ... 330 | attributes: list[None] = ... 331 | def add_attribute(self, key: str, value: Optional[str] = None) -> SDPResult: ... 332 | def add_bandwidth(self, bwtype: str, bandwidth: int) -> SDPResult: ... 333 | def add_connection( 334 | self, nettype: str, addrtype: str, address: str, ttl: int, addr_number: int 335 | ) -> SDPResult: ... 336 | def add_format(self, format: str) -> SDPResult: ... 337 | def as_text(self) -> str: ... 338 | def attributes_len(self) -> int: ... 339 | def attributes_to_caps(self, caps: Gst.Caps) -> SDPResult: ... 340 | def bandwidths_len(self) -> int: ... 341 | def connections_len(self) -> int: ... 342 | def copy(self) -> Tuple[SDPResult, SDPMedia]: ... 343 | def formats_len(self) -> int: ... 344 | def free(self) -> SDPResult: ... 345 | def get_attribute(self, idx: int) -> SDPAttribute: ... 346 | def get_attribute_val(self, key: str) -> str: ... 347 | def get_attribute_val_n(self, key: str, nth: int) -> str: ... 348 | def get_bandwidth(self, idx: int) -> SDPBandwidth: ... 349 | def get_caps_from_media(self, pt: int) -> Gst.Caps: ... 350 | def get_connection(self, idx: int) -> SDPConnection: ... 351 | def get_format(self, idx: int) -> str: ... 352 | def get_information(self) -> str: ... 353 | def get_key(self) -> SDPKey: ... 354 | def get_media(self) -> str: ... 355 | def get_num_ports(self) -> int: ... 356 | def get_port(self) -> int: ... 357 | def get_proto(self) -> str: ... 358 | def init(self) -> SDPResult: ... 359 | def insert_attribute(self, idx: int, attr: SDPAttribute) -> SDPResult: ... 360 | def insert_bandwidth(self, idx: int, bw: SDPBandwidth) -> SDPResult: ... 361 | def insert_connection(self, idx: int, conn: SDPConnection) -> SDPResult: ... 362 | def insert_format(self, idx: int, format: str) -> SDPResult: ... 363 | @staticmethod 364 | def new() -> Tuple[SDPResult, SDPMedia]: ... 365 | def parse_keymgmt(self) -> Tuple[SDPResult, MIKEYMessage]: ... 366 | def remove_attribute(self, idx: int) -> SDPResult: ... 367 | def remove_bandwidth(self, idx: int) -> SDPResult: ... 368 | def remove_connection(self, idx: int) -> SDPResult: ... 369 | def remove_format(self, idx: int) -> SDPResult: ... 370 | def replace_attribute(self, idx: int, attr: SDPAttribute) -> SDPResult: ... 371 | def replace_bandwidth(self, idx: int, bw: SDPBandwidth) -> SDPResult: ... 372 | def replace_connection(self, idx: int, conn: SDPConnection) -> SDPResult: ... 373 | def replace_format(self, idx: int, format: str) -> SDPResult: ... 374 | def set_information(self, information: str) -> SDPResult: ... 375 | def set_key(self, type: str, data: str) -> SDPResult: ... 376 | def set_media(self, med: str) -> SDPResult: ... 377 | @staticmethod 378 | def set_media_from_caps(caps: Gst.Caps, media: SDPMedia) -> SDPResult: ... 379 | def set_port_info(self, port: int, num_ports: int) -> SDPResult: ... 380 | def set_proto(self, proto: str) -> SDPResult: ... 381 | def uninit(self) -> SDPResult: ... 382 | 383 | class SDPMessage(GObject.GBoxed): 384 | """ 385 | :Constructors: 386 | 387 | :: 388 | 389 | SDPMessage() 390 | """ 391 | 392 | version: str = ... 393 | origin: SDPOrigin = ... 394 | session_name: str = ... 395 | information: str = ... 396 | uri: str = ... 397 | emails: list[None] = ... 398 | phones: list[None] = ... 399 | connection: SDPConnection = ... 400 | bandwidths: list[None] = ... 401 | times: list[None] = ... 402 | zones: list[None] = ... 403 | key: SDPKey = ... 404 | attributes: list[None] = ... 405 | medias: list[None] = ... 406 | def add_attribute(self, key: str, value: Optional[str] = None) -> SDPResult: ... 407 | def add_bandwidth(self, bwtype: str, bandwidth: int) -> SDPResult: ... 408 | def add_email(self, email: str) -> SDPResult: ... 409 | def add_media(self, media: SDPMedia) -> SDPResult: ... 410 | def add_phone(self, phone: str) -> SDPResult: ... 411 | def add_time(self, start: str, stop: str, repeat: Sequence[str]) -> SDPResult: ... 412 | def add_zone(self, adj_time: str, typed_time: str) -> SDPResult: ... 413 | def as_text(self) -> str: ... 414 | @staticmethod 415 | def as_uri(scheme: str, msg: SDPMessage) -> str: ... 416 | def attributes_len(self) -> int: ... 417 | def attributes_to_caps(self, caps: Gst.Caps) -> SDPResult: ... 418 | def bandwidths_len(self) -> int: ... 419 | def copy(self) -> Tuple[SDPResult, SDPMessage]: ... 420 | def dump(self) -> SDPResult: ... 421 | def emails_len(self) -> int: ... 422 | def free(self) -> SDPResult: ... 423 | def get_attribute(self, idx: int) -> SDPAttribute: ... 424 | def get_attribute_val(self, key: str) -> str: ... 425 | def get_attribute_val_n(self, key: str, nth: int) -> str: ... 426 | def get_bandwidth(self, idx: int) -> SDPBandwidth: ... 427 | def get_connection(self) -> SDPConnection: ... 428 | def get_email(self, idx: int) -> str: ... 429 | def get_information(self) -> str: ... 430 | def get_key(self) -> SDPKey: ... 431 | def get_media(self, idx: int) -> SDPMedia: ... 432 | def get_origin(self) -> SDPOrigin: ... 433 | def get_phone(self, idx: int) -> str: ... 434 | def get_session_name(self) -> str: ... 435 | def get_time(self, idx: int) -> SDPTime: ... 436 | def get_uri(self) -> str: ... 437 | def get_version(self) -> str: ... 438 | def get_zone(self, idx: int) -> SDPZone: ... 439 | def init(self) -> SDPResult: ... 440 | def insert_attribute(self, idx: int, attr: SDPAttribute) -> SDPResult: ... 441 | def insert_bandwidth(self, idx: int, bw: SDPBandwidth) -> SDPResult: ... 442 | def insert_email(self, idx: int, email: str) -> SDPResult: ... 443 | def insert_phone(self, idx: int, phone: str) -> SDPResult: ... 444 | def insert_time(self, idx: int, t: SDPTime) -> SDPResult: ... 445 | def insert_zone(self, idx: int, zone: SDPZone) -> SDPResult: ... 446 | def medias_len(self) -> int: ... 447 | @staticmethod 448 | def new() -> Tuple[SDPResult, SDPMessage]: ... 449 | @staticmethod 450 | def new_from_text(text: str) -> Tuple[SDPResult, SDPMessage]: ... 451 | @staticmethod 452 | def parse_buffer(data: Sequence[int], msg: SDPMessage) -> SDPResult: ... 453 | def parse_keymgmt(self) -> Tuple[SDPResult, MIKEYMessage]: ... 454 | @staticmethod 455 | def parse_uri(uri: str, msg: SDPMessage) -> SDPResult: ... 456 | def phones_len(self) -> int: ... 457 | def remove_attribute(self, idx: int) -> SDPResult: ... 458 | def remove_bandwidth(self, idx: int) -> SDPResult: ... 459 | def remove_email(self, idx: int) -> SDPResult: ... 460 | def remove_phone(self, idx: int) -> SDPResult: ... 461 | def remove_time(self, idx: int) -> SDPResult: ... 462 | def remove_zone(self, idx: int) -> SDPResult: ... 463 | def replace_attribute(self, idx: int, attr: SDPAttribute) -> SDPResult: ... 464 | def replace_bandwidth(self, idx: int, bw: SDPBandwidth) -> SDPResult: ... 465 | def replace_email(self, idx: int, email: str) -> SDPResult: ... 466 | def replace_phone(self, idx: int, phone: str) -> SDPResult: ... 467 | def replace_time(self, idx: int, t: SDPTime) -> SDPResult: ... 468 | def replace_zone(self, idx: int, zone: SDPZone) -> SDPResult: ... 469 | def set_connection( 470 | self, nettype: str, addrtype: str, address: str, ttl: int, addr_number: int 471 | ) -> SDPResult: ... 472 | def set_information(self, information: str) -> SDPResult: ... 473 | def set_key(self, type: str, data: str) -> SDPResult: ... 474 | def set_origin( 475 | self, 476 | username: str, 477 | sess_id: str, 478 | sess_version: str, 479 | nettype: str, 480 | addrtype: str, 481 | addr: str, 482 | ) -> SDPResult: ... 483 | def set_session_name(self, session_name: str) -> SDPResult: ... 484 | def set_uri(self, uri: str) -> SDPResult: ... 485 | def set_version(self, version: str) -> SDPResult: ... 486 | def times_len(self) -> int: ... 487 | def uninit(self) -> SDPResult: ... 488 | def zones_len(self) -> int: ... 489 | 490 | class SDPOrigin(GObject.GPointer): 491 | """ 492 | :Constructors: 493 | 494 | :: 495 | 496 | SDPOrigin() 497 | """ 498 | 499 | username: str = ... 500 | sess_id: str = ... 501 | sess_version: str = ... 502 | nettype: str = ... 503 | addrtype: str = ... 504 | addr: str = ... 505 | 506 | class SDPTime(GObject.GPointer): 507 | """ 508 | :Constructors: 509 | 510 | :: 511 | 512 | SDPTime() 513 | """ 514 | 515 | start: str = ... 516 | stop: str = ... 517 | repeat: list[None] = ... 518 | def clear(self) -> SDPResult: ... 519 | def set(self, start: str, stop: str, repeat: Sequence[str]) -> SDPResult: ... 520 | 521 | class SDPZone(GObject.GPointer): 522 | """ 523 | :Constructors: 524 | 525 | :: 526 | 527 | SDPZone() 528 | """ 529 | 530 | time: str = ... 531 | typed_time: str = ... 532 | def clear(self) -> SDPResult: ... 533 | def set(self, adj_time: str, typed_time: str) -> SDPResult: ... 534 | 535 | class MIKEYCacheType(GObject.GEnum): 536 | ALWAYS = 1 537 | FOR_CSB = 2 538 | NONE = 0 539 | 540 | class MIKEYEncAlg(GObject.GEnum): 541 | AES_CM_128 = 1 542 | AES_GCM_128 = 6 543 | AES_KW_128 = 2 544 | NULL = 0 545 | 546 | class MIKEYKVType(GObject.GEnum): 547 | INTERVAL = 2 548 | NULL = 0 549 | SPI = 1 550 | 551 | class MIKEYKeyDataType(GObject.GEnum): 552 | TEK = 2 553 | TGK = 0 554 | 555 | class MIKEYMacAlg(GObject.GEnum): 556 | HMAC_SHA_1_160 = 1 557 | NULL = 0 558 | 559 | class MIKEYMapType(GObject.GEnum): 560 | MIKEY_MAP_TYPE_SRTP = 0 561 | 562 | class MIKEYPRFFunc(GObject.GEnum): 563 | MIKEY_PRF_MIKEY_1 = 0 564 | 565 | class MIKEYPayloadType(GObject.GEnum): 566 | CERT = 7 567 | CHASH = 8 568 | DH = 3 569 | ERR = 12 570 | GEN_EXT = 21 571 | ID = 6 572 | KEMAC = 1 573 | KEY_DATA = 20 574 | LAST = 0 575 | PKE = 2 576 | RAND = 11 577 | SIGN = 4 578 | SP = 10 579 | T = 5 580 | V = 9 581 | 582 | class MIKEYSecProto(GObject.GEnum): 583 | MIKEY_SEC_PROTO_SRTP = 0 584 | 585 | class MIKEYSecSRTP(GObject.GEnum): 586 | AEAD_AUTH_TAG_LEN = 20 587 | AUTH_ALG = 2 588 | AUTH_KEY_LEN = 3 589 | AUTH_TAG_LEN = 11 590 | ENC_ALG = 0 591 | ENC_KEY_LEN = 1 592 | FEC_ORDER = 9 593 | KEY_DERIV_RATE = 6 594 | PRF = 5 595 | SALT_KEY_LEN = 4 596 | SRTCP_ENC = 8 597 | SRTP_AUTH = 10 598 | SRTP_ENC = 7 599 | SRTP_PREFIX_LEN = 12 600 | 601 | class MIKEYTSType(GObject.GEnum): 602 | COUNTER = 2 603 | NTP = 1 604 | NTP_UTC = 0 605 | 606 | class MIKEYType(GObject.GEnum): 607 | DH_INIT = 4 608 | DH_RESP = 5 609 | ERROR = 6 610 | INVALID = -1 611 | PK_INIT = 2 612 | PK_VERIFY = 3 613 | PSK_INIT = 0 614 | PSK_VERIFY = 1 615 | 616 | class SDPResult(GObject.GEnum): 617 | EINVAL = -1 618 | OK = 0 619 | -------------------------------------------------------------------------------- /src/gi-stubs/repository/GstWebRTC.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 | from gi.repository import Gst 13 | from gi.repository import GstSdp 14 | 15 | _lock = ... # FIXME Constant 16 | _namespace: str = "GstWebRTC" 17 | _version: str = "1.0" 18 | 19 | def webrtc_error_quark() -> int: ... 20 | def webrtc_sdp_type_to_string(type: WebRTCSDPType) -> str: ... 21 | 22 | class WebRTCDTLSTransport(Gst.Object): 23 | """ 24 | :Constructors: 25 | 26 | :: 27 | 28 | WebRTCDTLSTransport(**properties) 29 | 30 | Object GstWebRTCDTLSTransport 31 | 32 | Properties from GstWebRTCDTLSTransport: 33 | session-id -> guint: Session ID 34 | Unique session ID 35 | transport -> GstWebRTCICETransport: ICE transport 36 | ICE transport used by this dtls transport 37 | state -> GstWebRTCDTLSTransportState: DTLS state 38 | State of the DTLS transport 39 | client -> gboolean: DTLS client 40 | Are we the client in the DTLS handshake? 41 | certificate -> gchararray: DTLS certificate 42 | DTLS certificate 43 | remote-certificate -> gchararray: Remote DTLS certificate 44 | Remote DTLS certificate 45 | 46 | Signals from GstObject: 47 | deep-notify (GstObject, GParam) 48 | 49 | Properties from GstObject: 50 | name -> gchararray: Name 51 | The name of the object 52 | parent -> GstObject: Parent 53 | The parent of the object 54 | 55 | Signals from GObject: 56 | notify (GParam) 57 | """ 58 | 59 | class Props: 60 | certificate: str 61 | client: bool 62 | remote_certificate: str 63 | session_id: int 64 | state: WebRTCDTLSTransportState 65 | transport: WebRTCICETransport 66 | name: Optional[str] 67 | parent: Optional[Gst.Object] 68 | 69 | props: Props = ... 70 | def __init__( 71 | self, 72 | certificate: str = ..., 73 | client: bool = ..., 74 | session_id: int = ..., 75 | name: Optional[str] = ..., 76 | parent: Gst.Object = ..., 77 | ): ... 78 | 79 | class WebRTCDTLSTransportClass(GObject.GPointer): ... 80 | 81 | class WebRTCDataChannel(GObject.Object): 82 | """ 83 | :Constructors: 84 | 85 | :: 86 | 87 | WebRTCDataChannel(**properties) 88 | 89 | Object GstWebRTCDataChannel 90 | 91 | Signals from GstWebRTCDataChannel: 92 | on-open () 93 | on-close () 94 | on-error (GError) 95 | on-message-data (GBytes) 96 | on-message-string (gchararray) 97 | on-buffered-amount-low () 98 | send-data (GBytes) 99 | send-string (gchararray) 100 | close () 101 | 102 | Properties from GstWebRTCDataChannel: 103 | label -> gchararray: Label 104 | Data channel label 105 | ordered -> gboolean: Ordered 106 | Using ordered transmission mode 107 | max-packet-lifetime -> gint: Maximum Packet Lifetime 108 | Maximum number of milliseconds that transmissions and retransmissions may occur in unreliable mode (-1 = unset) 109 | max-retransmits -> gint: Maximum Retransmits 110 | Maximum number of retransmissions attempted in unreliable mode 111 | protocol -> gchararray: Protocol 112 | Data channel protocol 113 | negotiated -> gboolean: Negotiated 114 | Whether this data channel was negotiated by the application 115 | id -> gint: ID 116 | ID negotiated by this data channel (-1 = unset) 117 | priority -> GstWebRTCPriorityType: Priority 118 | The priority of data sent using this data channel 119 | ready-state -> GstWebRTCDataChannelState: Ready State 120 | The Ready state of this data channel 121 | buffered-amount -> guint64: Buffered Amount 122 | The amount of data in bytes currently buffered 123 | buffered-amount-low-threshold -> guint64: Buffered Amount Low Threshold 124 | The threshold at which the buffered amount is considered low and the buffered-amount-low signal is emitted 125 | 126 | Signals from GObject: 127 | notify (GParam) 128 | """ 129 | 130 | class Props: 131 | buffered_amount: int 132 | buffered_amount_low_threshold: int 133 | id: int 134 | label: str 135 | max_packet_lifetime: int 136 | max_retransmits: int 137 | negotiated: bool 138 | ordered: bool 139 | priority: WebRTCPriorityType 140 | protocol: str 141 | ready_state: WebRTCDataChannelState 142 | 143 | props: Props = ... 144 | def __init__( 145 | self, 146 | buffered_amount_low_threshold: int = ..., 147 | id: int = ..., 148 | label: str = ..., 149 | max_packet_lifetime: int = ..., 150 | max_retransmits: int = ..., 151 | negotiated: bool = ..., 152 | ordered: bool = ..., 153 | priority: WebRTCPriorityType = ..., 154 | protocol: str = ..., 155 | ): ... 156 | def close(self) -> None: ... 157 | def send_data(self, data: Optional[GLib.Bytes] = None) -> None: ... 158 | def send_string(self, str: Optional[str] = None) -> None: ... 159 | 160 | class WebRTCDataChannelClass(GObject.GPointer): ... 161 | 162 | class WebRTCICETransport(Gst.Object): 163 | """ 164 | :Constructors: 165 | 166 | :: 167 | 168 | WebRTCICETransport(**properties) 169 | 170 | Object GstWebRTCICETransport 171 | 172 | Signals from GstWebRTCICETransport: 173 | on-selected-candidate-pair-change () 174 | on-new-candidate (gchararray) 175 | 176 | Properties from GstWebRTCICETransport: 177 | component -> GstWebRTCICEComponent: ICE component 178 | The ICE component of this transport 179 | state -> GstWebRTCICEConnectionState: ICE connection state 180 | The ICE connection state of this transport 181 | gathering-state -> GstWebRTCICEGatheringState: ICE gathering state 182 | The ICE gathering state of this transport 183 | 184 | Signals from GstObject: 185 | deep-notify (GstObject, GParam) 186 | 187 | Properties from GstObject: 188 | name -> gchararray: Name 189 | The name of the object 190 | parent -> GstObject: Parent 191 | The parent of the object 192 | 193 | Signals from GObject: 194 | notify (GParam) 195 | """ 196 | 197 | class Props: 198 | component: WebRTCICEComponent 199 | gathering_state: WebRTCICEGatheringState 200 | state: WebRTCICEConnectionState 201 | name: Optional[str] 202 | parent: Optional[Gst.Object] 203 | 204 | props: Props = ... 205 | def __init__( 206 | self, 207 | component: WebRTCICEComponent = ..., 208 | name: Optional[str] = ..., 209 | parent: Gst.Object = ..., 210 | ): ... 211 | 212 | class WebRTCICETransportClass(GObject.GPointer): ... 213 | 214 | class WebRTCRTPReceiver(Gst.Object): 215 | """ 216 | :Constructors: 217 | 218 | :: 219 | 220 | WebRTCRTPReceiver(**properties) 221 | 222 | Object GstWebRTCRTPReceiver 223 | 224 | Properties from GstWebRTCRTPReceiver: 225 | transport -> GstWebRTCDTLSTransport: Transport 226 | The DTLS transport for this receiver 227 | 228 | Signals from GstObject: 229 | deep-notify (GstObject, GParam) 230 | 231 | Properties from GstObject: 232 | name -> gchararray: Name 233 | The name of the object 234 | parent -> GstObject: Parent 235 | The parent of the object 236 | 237 | Signals from GObject: 238 | notify (GParam) 239 | """ 240 | 241 | class Props: 242 | transport: WebRTCDTLSTransport 243 | name: Optional[str] 244 | parent: Optional[Gst.Object] 245 | 246 | props: Props = ... 247 | def __init__(self, name: Optional[str] = ..., parent: Gst.Object = ...): ... 248 | 249 | class WebRTCRTPReceiverClass(GObject.GPointer): ... 250 | 251 | class WebRTCRTPSender(Gst.Object): 252 | """ 253 | :Constructors: 254 | 255 | :: 256 | 257 | WebRTCRTPSender(**properties) 258 | 259 | Object GstWebRTCRTPSender 260 | 261 | Properties from GstWebRTCRTPSender: 262 | priority -> GstWebRTCPriorityType: Priority 263 | The priority from which to set the DSCP field on packets 264 | transport -> GstWebRTCDTLSTransport: Transport 265 | The DTLS transport for this sender 266 | 267 | Signals from GstObject: 268 | deep-notify (GstObject, GParam) 269 | 270 | Properties from GstObject: 271 | name -> gchararray: Name 272 | The name of the object 273 | parent -> GstObject: Parent 274 | The parent of the object 275 | 276 | Signals from GObject: 277 | notify (GParam) 278 | """ 279 | 280 | class Props: 281 | priority: WebRTCPriorityType 282 | transport: WebRTCDTLSTransport 283 | name: Optional[str] 284 | parent: Optional[Gst.Object] 285 | 286 | props: Props = ... 287 | def __init__( 288 | self, 289 | priority: WebRTCPriorityType = ..., 290 | name: Optional[str] = ..., 291 | parent: Gst.Object = ..., 292 | ): ... 293 | def set_priority(self, priority: WebRTCPriorityType) -> None: ... 294 | 295 | class WebRTCRTPSenderClass(GObject.GPointer): ... 296 | 297 | class WebRTCRTPTransceiver(Gst.Object): 298 | """ 299 | :Constructors: 300 | 301 | :: 302 | 303 | WebRTCRTPTransceiver(**properties) 304 | 305 | Object GstWebRTCRTPTransceiver 306 | 307 | Properties from GstWebRTCRTPTransceiver: 308 | sender -> GstWebRTCRTPSender: Sender 309 | The RTP sender for this transceiver 310 | receiver -> GstWebRTCRTPReceiver: Receiver 311 | The RTP receiver for this transceiver 312 | current-direction -> GstWebRTCRTPTransceiverDirection: Current Direction 313 | Transceiver current direction 314 | direction -> GstWebRTCRTPTransceiverDirection: Direction 315 | Transceiver direction 316 | mlineindex -> guint: Media Line Index 317 | Index in the SDP of the Media 318 | mid -> gchararray: Media ID 319 | The media ID of the m-line associated with this transceiver. This association is established, when possible, whenever either a local or remote description is applied. This field is null if neither a local or remote description has been applied, or if its associated m-line is rejected by either a remote offer or any answer. 320 | kind -> GstWebRTCKind: Media Kind 321 | Kind of media this transceiver transports 322 | 323 | Signals from GstObject: 324 | deep-notify (GstObject, GParam) 325 | 326 | Properties from GstObject: 327 | name -> gchararray: Name 328 | The name of the object 329 | parent -> GstObject: Parent 330 | The parent of the object 331 | 332 | Signals from GObject: 333 | notify (GParam) 334 | """ 335 | 336 | class Props: 337 | codec_preferences: Gst.Caps 338 | current_direction: WebRTCRTPTransceiverDirection 339 | direction: WebRTCRTPTransceiverDirection 340 | kind: WebRTCKind 341 | mid: str 342 | mlineindex: int 343 | receiver: WebRTCRTPReceiver 344 | sender: WebRTCRTPSender 345 | name: Optional[str] 346 | parent: Optional[Gst.Object] 347 | 348 | props: Props = ... 349 | def __init__( 350 | self, 351 | codec_preferences: Gst.Caps = ..., 352 | direction: WebRTCRTPTransceiverDirection = ..., 353 | mlineindex: int = ..., 354 | receiver: WebRTCRTPReceiver = ..., 355 | sender: WebRTCRTPSender = ..., 356 | name: Optional[str] = ..., 357 | parent: Gst.Object = ..., 358 | ): ... 359 | 360 | class WebRTCRTPTransceiverClass(GObject.GPointer): ... 361 | 362 | class WebRTCSCTPTransport(Gst.Object): 363 | """ 364 | :Constructors: 365 | 366 | :: 367 | 368 | WebRTCSCTPTransport(**properties) 369 | 370 | Object GstWebRTCSCTPTransport 371 | 372 | Properties from GstWebRTCSCTPTransport: 373 | transport -> GstWebRTCDTLSTransport: WebRTC DTLS Transport 374 | DTLS transport used for this SCTP transport 375 | state -> GstWebRTCSCTPTransportState: WebRTC SCTP Transport state 376 | WebRTC SCTP Transport state 377 | max-message-size -> guint64: Maximum message size 378 | Maximum message size as reported by the transport 379 | max-channels -> guint: Maximum number of channels 380 | Maximum number of channels 381 | 382 | Signals from GstObject: 383 | deep-notify (GstObject, GParam) 384 | 385 | Properties from GstObject: 386 | name -> gchararray: Name 387 | The name of the object 388 | parent -> GstObject: Parent 389 | The parent of the object 390 | 391 | Signals from GObject: 392 | notify (GParam) 393 | """ 394 | 395 | class Props: 396 | max_channels: int 397 | max_message_size: int 398 | state: WebRTCSCTPTransportState 399 | transport: WebRTCDTLSTransport 400 | name: Optional[str] 401 | parent: Optional[Gst.Object] 402 | 403 | props: Props = ... 404 | def __init__(self, name: Optional[str] = ..., parent: Gst.Object = ...): ... 405 | 406 | class WebRTCSCTPTransportClass(GObject.GPointer): ... 407 | 408 | class WebRTCSessionDescription(GObject.GBoxed): 409 | """ 410 | :Constructors: 411 | 412 | :: 413 | 414 | WebRTCSessionDescription() 415 | new(type:GstWebRTC.WebRTCSDPType, sdp:GstSdp.SDPMessage) -> GstWebRTC.WebRTCSessionDescription 416 | """ 417 | 418 | type: WebRTCSDPType = ... 419 | sdp: GstSdp.SDPMessage = ... 420 | def copy(self) -> WebRTCSessionDescription: ... 421 | def free(self) -> None: ... 422 | @classmethod 423 | def new( 424 | cls, type: WebRTCSDPType, sdp: GstSdp.SDPMessage 425 | ) -> WebRTCSessionDescription: ... 426 | 427 | class WebRTCBundlePolicy(GObject.GEnum): 428 | BALANCED = 1 429 | MAX_BUNDLE = 3 430 | MAX_COMPAT = 2 431 | NONE = 0 432 | 433 | class WebRTCDTLSSetup(GObject.GEnum): 434 | ACTIVE = 2 435 | ACTPASS = 1 436 | NONE = 0 437 | PASSIVE = 3 438 | 439 | class WebRTCDTLSTransportState(GObject.GEnum): 440 | CLOSED = 1 441 | CONNECTED = 4 442 | CONNECTING = 3 443 | FAILED = 2 444 | NEW = 0 445 | 446 | class WebRTCDataChannelState(GObject.GEnum): 447 | CLOSED = 4 448 | CLOSING = 3 449 | CONNECTING = 1 450 | NEW = 0 451 | OPEN = 2 452 | 453 | class WebRTCError(GObject.GEnum): 454 | DATA_CHANNEL_FAILURE = 0 455 | DTLS_FAILURE = 1 456 | ENCODER_ERROR = 6 457 | FINGERPRINT_FAILURE = 2 458 | HARDWARE_ENCODER_NOT_AVAILABLE = 5 459 | INTERNAL_FAILURE = 8 460 | INVALID_STATE = 7 461 | SCTP_FAILURE = 3 462 | SDP_SYNTAX_ERROR = 4 463 | @staticmethod 464 | def quark() -> int: ... 465 | 466 | class WebRTCFECType(GObject.GEnum): 467 | NONE = 0 468 | ULP_RED = 1 469 | 470 | class WebRTCICEComponent(GObject.GEnum): 471 | RTCP = 1 472 | RTP = 0 473 | 474 | class WebRTCICEConnectionState(GObject.GEnum): 475 | CHECKING = 1 476 | CLOSED = 6 477 | COMPLETED = 3 478 | CONNECTED = 2 479 | DISCONNECTED = 5 480 | FAILED = 4 481 | NEW = 0 482 | 483 | class WebRTCICEGatheringState(GObject.GEnum): 484 | COMPLETE = 2 485 | GATHERING = 1 486 | NEW = 0 487 | 488 | class WebRTCICERole(GObject.GEnum): 489 | CONTROLLED = 0 490 | CONTROLLING = 1 491 | 492 | class WebRTCICETransportPolicy(GObject.GEnum): 493 | ALL = 0 494 | RELAY = 1 495 | 496 | class WebRTCKind(GObject.GEnum): 497 | AUDIO = 1 498 | UNKNOWN = 0 499 | VIDEO = 2 500 | 501 | class WebRTCPeerConnectionState(GObject.GEnum): 502 | CLOSED = 5 503 | CONNECTED = 2 504 | CONNECTING = 1 505 | DISCONNECTED = 3 506 | FAILED = 4 507 | NEW = 0 508 | 509 | class WebRTCPriorityType(GObject.GEnum): 510 | HIGH = 4 511 | LOW = 2 512 | MEDIUM = 3 513 | VERY_LOW = 1 514 | 515 | class WebRTCRTPTransceiverDirection(GObject.GEnum): 516 | INACTIVE = 1 517 | NONE = 0 518 | RECVONLY = 3 519 | SENDONLY = 2 520 | SENDRECV = 4 521 | 522 | class WebRTCSCTPTransportState(GObject.GEnum): 523 | CLOSED = 3 524 | CONNECTED = 2 525 | CONNECTING = 1 526 | NEW = 0 527 | 528 | class WebRTCSDPType(GObject.GEnum): 529 | ANSWER = 3 530 | OFFER = 1 531 | PRANSWER = 2 532 | ROLLBACK = 4 533 | @staticmethod 534 | def to_string(type: WebRTCSDPType) -> str: ... 535 | 536 | class WebRTCSignalingState(GObject.GEnum): 537 | CLOSED = 1 538 | HAVE_LOCAL_OFFER = 2 539 | HAVE_LOCAL_PRANSWER = 4 540 | HAVE_REMOTE_OFFER = 3 541 | HAVE_REMOTE_PRANSWER = 5 542 | STABLE = 0 543 | 544 | class WebRTCStatsType(GObject.GEnum): 545 | CANDIDATE_PAIR = 11 546 | CERTIFICATE = 14 547 | CODEC = 1 548 | CSRC = 6 549 | DATA_CHANNEL = 8 550 | INBOUND_RTP = 2 551 | LOCAL_CANDIDATE = 12 552 | OUTBOUND_RTP = 3 553 | PEER_CONNECTION = 7 554 | REMOTE_CANDIDATE = 13 555 | REMOTE_INBOUND_RTP = 4 556 | REMOTE_OUTBOUND_RTP = 5 557 | STREAM = 9 558 | TRANSPORT = 10 559 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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/PangoCairo.pyi: -------------------------------------------------------------------------------- 1 | from typing import Any 2 | from typing import Callable 3 | from typing import Optional 4 | from typing import TypeVar 5 | 6 | import cairo 7 | from gi.repository import GObject 8 | from gi.repository import Pango 9 | 10 | _SomeSurface = TypeVar("_SomeSurface", bound=cairo.Surface) 11 | 12 | _lock = ... # FIXME Constant 13 | _namespace: str = "PangoCairo" 14 | _version: str = "1.0" 15 | 16 | def context_get_font_options(context: Pango.Context) -> Optional[cairo.FontOptions]: ... 17 | def context_get_resolution(context: Pango.Context) -> float: ... 18 | def context_set_font_options( 19 | context: Pango.Context, options: Optional[cairo.FontOptions] = None 20 | ) -> None: ... 21 | def context_set_resolution(context: Pango.Context, dpi: float) -> None: ... 22 | def context_set_shape_renderer( 23 | context: Pango.Context, func: Optional[Callable[..., None]] = None, *data: Any 24 | ) -> None: ... 25 | def create_context(cr: cairo.Context[_SomeSurface]) -> Pango.Context: ... 26 | def create_layout(cr: cairo.Context[_SomeSurface]) -> Pango.Layout: ... 27 | def error_underline_path( 28 | cr: cairo.Context[_SomeSurface], x: float, y: float, width: float, height: float 29 | ) -> None: ... 30 | def font_map_get_default() -> Pango.FontMap: ... 31 | def font_map_new() -> Pango.FontMap: ... 32 | def font_map_new_for_font_type(fonttype: cairo.FontType) -> Optional[Pango.FontMap]: ... 33 | def glyph_string_path( 34 | cr: cairo.Context[_SomeSurface], font: Pango.Font, glyphs: Pango.GlyphString 35 | ) -> None: ... 36 | def layout_line_path( 37 | cr: cairo.Context[_SomeSurface], line: Pango.LayoutLine 38 | ) -> None: ... 39 | def layout_path(cr: cairo.Context[_SomeSurface], layout: Pango.Layout) -> None: ... 40 | def show_error_underline( 41 | cr: cairo.Context[_SomeSurface], x: float, y: float, width: float, height: float 42 | ) -> None: ... 43 | def show_glyph_item( 44 | cr: cairo.Context[_SomeSurface], text: str, glyph_item: Pango.GlyphItem 45 | ) -> None: ... 46 | def show_glyph_string( 47 | cr: cairo.Context[_SomeSurface], font: Pango.Font, glyphs: Pango.GlyphString 48 | ) -> None: ... 49 | def show_layout(cr: cairo.Context[_SomeSurface], layout: Pango.Layout) -> None: ... 50 | def show_layout_line( 51 | cr: cairo.Context[_SomeSurface], line: Pango.LayoutLine 52 | ) -> None: ... 53 | def update_context(cr: cairo.Context[_SomeSurface], context: Pango.Context) -> None: ... 54 | def update_layout(cr: cairo.Context[_SomeSurface], layout: Pango.Layout) -> None: ... 55 | 56 | class Font(GObject.GInterface): 57 | """ 58 | Interface PangoCairoFont 59 | 60 | Signals from GObject: 61 | notify (GParam) 62 | """ 63 | 64 | def get_scaled_font(self) -> Optional[cairo.ScaledFont]: ... 65 | 66 | class FontMap(GObject.GInterface): 67 | """ 68 | Interface PangoCairoFontMap 69 | 70 | Signals from GObject: 71 | notify (GParam) 72 | """ 73 | 74 | # override 75 | @classmethod 76 | def get_default(cls) -> Pango.FontMap: ... 77 | def get_font_type(self) -> cairo.FontType: ... 78 | def get_resolution(self) -> float: ... 79 | # override 80 | @classmethod 81 | def new(cls) -> Pango.FontMap: ... 82 | # override 83 | @classmethod 84 | def new_for_font_type(cls, fonttype: cairo.FontType) -> Optional[Pango.FontMap]: ... 85 | def set_default(self) -> None: ... 86 | def set_resolution(self, dpi: float) -> None: ... 87 | -------------------------------------------------------------------------------- /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 | 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 Gio 11 | from gi.repository import GObject 12 | from gi.repository import Gtk 13 | from gi.repository import GtkSource 14 | 15 | _lock = ... # FIXME Constant 16 | _namespace: str = "Spelling" 17 | _version: str = "1" 18 | 19 | def init() -> None: ... 20 | 21 | class Checker(GObject.Object): 22 | """ 23 | :Constructors: 24 | 25 | :: 26 | 27 | Checker(**properties) 28 | new(provider:Spelling.Provider, language:str) -> Spelling.Checker 29 | 30 | Object SpellingChecker 31 | 32 | Properties from SpellingChecker: 33 | language -> gchararray: Language 34 | The language code 35 | provider -> SpellingProvider: Provider 36 | The spell check provider 37 | 38 | Signals from GObject: 39 | notify (GParam) 40 | """ 41 | 42 | class Props: 43 | language: Optional[str] 44 | provider: Provider 45 | 46 | props: Props = ... 47 | def __init__(self, language: str = ..., provider: Provider = ...): ... 48 | def add_word(self, word: str) -> None: ... 49 | def check_word(self, word: str, word_len: int) -> bool: ... 50 | @staticmethod 51 | def get_default() -> Checker: ... 52 | def get_extra_word_chars(self) -> str: ... 53 | def get_language(self) -> Optional[str]: ... 54 | def get_provider(self) -> Provider: ... 55 | def ignore_word(self, word: str) -> None: ... 56 | def list_corrections(self, word: str) -> Optional[list[str]]: ... 57 | @classmethod 58 | def new(cls, provider: Provider, language: str) -> Checker: ... 59 | def set_language(self, language: str) -> None: ... 60 | 61 | class CheckerClass(GObject.GPointer): 62 | """ 63 | :Constructors: 64 | 65 | :: 66 | 67 | CheckerClass() 68 | """ 69 | 70 | parent_class: GObject.ObjectClass = ... 71 | 72 | class Language(GObject.Object): 73 | """ 74 | :Constructors: 75 | 76 | :: 77 | 78 | Language(**properties) 79 | 80 | Object SpellingLanguage 81 | 82 | Properties from SpellingLanguage: 83 | code -> gchararray: Code 84 | The language code 85 | 86 | Signals from GObject: 87 | notify (GParam) 88 | """ 89 | 90 | class Props: 91 | code: str 92 | 93 | props: Props = ... 94 | def __init__(self, code: str = ...): ... 95 | def add_word(self, word: str) -> None: ... 96 | def contains_word(self, word: str, word_len: int) -> bool: ... 97 | def get_code(self) -> str: ... 98 | def get_extra_word_chars(self) -> str: ... 99 | def ignore_word(self, word: str) -> None: ... 100 | def list_corrections(self, word: str, word_len: int) -> Optional[list[str]]: ... 101 | 102 | class LanguageClass(GObject.GPointer): ... 103 | 104 | class LanguageInfo(GObject.Object): 105 | """ 106 | :Constructors: 107 | 108 | :: 109 | 110 | LanguageInfo(**properties) 111 | 112 | Object SpellingLanguageInfo 113 | 114 | Properties from SpellingLanguageInfo: 115 | code -> gchararray: Code 116 | The language code 117 | group -> gchararray: Group 118 | A group for sorting, usually the country name 119 | name -> gchararray: Name 120 | The name of the language 121 | 122 | Signals from GObject: 123 | notify (GParam) 124 | """ 125 | 126 | class Props: 127 | code: str 128 | group: str 129 | name: str 130 | 131 | props: Props = ... 132 | def __init__(self, code: str = ..., group: str = ..., name: str = ...): ... 133 | def get_code(self) -> str: ... 134 | def get_group(self) -> str: ... 135 | def get_name(self) -> str: ... 136 | 137 | class LanguageInfoClass(GObject.GPointer): 138 | """ 139 | :Constructors: 140 | 141 | :: 142 | 143 | LanguageInfoClass() 144 | """ 145 | 146 | parent_class: GObject.ObjectClass = ... 147 | 148 | class Provider(GObject.Object): 149 | """ 150 | :Constructors: 151 | 152 | :: 153 | 154 | Provider(**properties) 155 | 156 | Object SpellingProvider 157 | 158 | Properties from SpellingProvider: 159 | display-name -> gchararray: Display Name 160 | Display Name 161 | 162 | Signals from GObject: 163 | notify (GParam) 164 | """ 165 | 166 | class Props: 167 | display_name: str 168 | 169 | props: Props = ... 170 | def __init__(self, display_name: str = ...): ... 171 | @staticmethod 172 | def get_default() -> Provider: ... 173 | def get_default_code(self) -> str: ... 174 | def get_display_name(self) -> str: ... 175 | def get_language(self, language: str) -> Optional[Language]: ... 176 | def list_languages(self) -> list[LanguageInfo]: ... 177 | def supports_language(self, language: str) -> bool: ... 178 | 179 | class ProviderClass(GObject.GPointer): ... 180 | 181 | class TextBufferAdapter(GObject.Object, Gio.ActionGroup): 182 | """ 183 | :Constructors: 184 | 185 | :: 186 | 187 | TextBufferAdapter(**properties) 188 | new(buffer:GtkSource.Buffer, checker:Spelling.Checker) -> Spelling.TextBufferAdapter 189 | 190 | Object SpellingTextBufferAdapter 191 | 192 | Properties from SpellingTextBufferAdapter: 193 | buffer -> GtkSourceBuffer: Buffer 194 | Buffer 195 | checker -> SpellingChecker: Checker 196 | Checker 197 | enabled -> gboolean: Enabled 198 | If spellcheck is enabled 199 | language -> gchararray: Language 200 | The language code such as en_US 201 | 202 | Signals from GActionGroup: 203 | action-added (gchararray) 204 | action-removed (gchararray) 205 | action-enabled-changed (gchararray, gboolean) 206 | action-state-changed (gchararray, GVariant) 207 | 208 | Signals from GObject: 209 | notify (GParam) 210 | """ 211 | 212 | class Props: 213 | buffer: Optional[GtkSource.Buffer] 214 | checker: Optional[Checker] 215 | enabled: bool 216 | language: str 217 | 218 | props: Props = ... 219 | def __init__( 220 | self, 221 | buffer: GtkSource.Buffer = ..., 222 | checker: Checker = ..., 223 | enabled: bool = ..., 224 | language: str = ..., 225 | ): ... 226 | def get_buffer(self) -> Optional[GtkSource.Buffer]: ... 227 | def get_checker(self) -> Optional[Checker]: ... 228 | def get_enabled(self) -> bool: ... 229 | def get_language(self) -> str: ... 230 | def get_menu_model(self) -> Gio.MenuModel: ... 231 | def get_tag(self) -> Optional[Gtk.TextTag]: ... 232 | def invalidate_all(self) -> None: ... 233 | @classmethod 234 | def new(cls, buffer: GtkSource.Buffer, checker: Checker) -> TextBufferAdapter: ... 235 | def set_checker(self, checker: Checker) -> None: ... 236 | def set_enabled(self, enabled: bool) -> None: ... 237 | def set_language(self, language: str) -> None: ... 238 | 239 | class TextBufferAdapterClass(GObject.GPointer): 240 | """ 241 | :Constructors: 242 | 243 | :: 244 | 245 | TextBufferAdapterClass() 246 | """ 247 | 248 | parent_class: GObject.ObjectClass = ... 249 | -------------------------------------------------------------------------------- /src/gi-stubs/repository/Xdp.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 Gio 11 | from gi.repository import GLib 12 | from gi.repository import GObject 13 | 14 | WALLPAPER_TARGET_BOTH: int = 0 15 | _lock = ... # FIXME Constant 16 | _namespace: str = "Xdp" 17 | _version: str = "1.0" 18 | 19 | class Parent(GObject.GBoxed): 20 | def copy(self) -> Parent: ... 21 | def free(self) -> None: ... 22 | 23 | class Portal(GObject.Object, Gio.Initable): 24 | """ 25 | :Constructors: 26 | 27 | :: 28 | 29 | Portal(**properties) 30 | initable_new() -> Xdp.Portal or None 31 | new() -> Xdp.Portal 32 | 33 | Object XdpPortal 34 | 35 | Signals from XdpPortal: 36 | spawn-exited (guint, guint) 37 | session-state-changed (gboolean, XdpLoginSessionState) 38 | update-available (gchararray, gchararray, gchararray) 39 | update-progress (guint, guint, guint, XdpUpdateStatus, gchararray, gchararray) 40 | location-updated (gdouble, gdouble, gdouble, gdouble, gdouble, gdouble, gchararray, gint64, gint64) 41 | notification-action-invoked (gchararray, gchararray, GVariant) 42 | 43 | Signals from GObject: 44 | notify (GParam) 45 | """ 46 | 47 | def access_camera( 48 | self, 49 | parent: Optional[Parent], 50 | flags: CameraFlags, 51 | cancellable: Optional[Gio.Cancellable] = None, 52 | callback: Optional[Callable[..., None]] = None, 53 | *data: Any, 54 | ) -> None: ... 55 | def access_camera_finish(self, result: Gio.AsyncResult) -> bool: ... 56 | def add_notification( 57 | self, 58 | id: str, 59 | notification: GLib.Variant, 60 | flags: NotificationFlags, 61 | cancellable: Optional[Gio.Cancellable] = None, 62 | callback: Optional[Callable[..., None]] = None, 63 | *data: Any, 64 | ) -> None: ... 65 | def add_notification_finish(self, result: Gio.AsyncResult) -> bool: ... 66 | def compose_email( 67 | self, 68 | parent: Optional[Parent], 69 | addresses: Optional[Sequence[str]], 70 | cc: Optional[Sequence[str]], 71 | bcc: Optional[Sequence[str]], 72 | subject: Optional[str], 73 | body: Optional[str], 74 | attachments: Optional[Sequence[str]], 75 | flags: EmailFlags, 76 | cancellable: Optional[Gio.Cancellable] = None, 77 | callback: Optional[Callable[..., None]] = None, 78 | *data: Any, 79 | ) -> None: ... 80 | def compose_email_finish(self, result: Gio.AsyncResult) -> bool: ... 81 | def create_remote_desktop_session( 82 | self, 83 | devices: DeviceType, 84 | outputs: OutputType, 85 | flags: RemoteDesktopFlags, 86 | cursor_mode: CursorMode, 87 | cancellable: Optional[Gio.Cancellable] = None, 88 | callback: Optional[Callable[..., None]] = None, 89 | *data: Any, 90 | ) -> None: ... 91 | def create_remote_desktop_session_finish( 92 | self, result: Gio.AsyncResult 93 | ) -> Session: ... 94 | def create_screencast_session( 95 | self, 96 | outputs: OutputType, 97 | flags: ScreencastFlags, 98 | cursor_mode: CursorMode, 99 | persist_mode: PersistMode, 100 | restore_token: Optional[str] = None, 101 | cancellable: Optional[Gio.Cancellable] = None, 102 | callback: Optional[Callable[..., None]] = None, 103 | *data: Any, 104 | ) -> None: ... 105 | def create_screencast_session_finish(self, result: Gio.AsyncResult) -> Session: ... 106 | def dynamic_launcher_get_desktop_entry(self, desktop_file_id: str) -> str: ... 107 | def dynamic_launcher_get_icon( 108 | self, 109 | desktop_file_id: str, 110 | out_icon_format: Optional[str] = None, 111 | out_icon_size: Optional[int] = None, 112 | ) -> GLib.Variant: ... 113 | def dynamic_launcher_install( 114 | self, token: str, desktop_file_id: str, desktop_entry: str 115 | ) -> bool: ... 116 | def dynamic_launcher_launch( 117 | self, desktop_file_id: str, activation_token: str 118 | ) -> bool: ... 119 | def dynamic_launcher_prepare_install( 120 | self, 121 | parent: Optional[Parent], 122 | name: str, 123 | icon_v: GLib.Variant, 124 | launcher_type: LauncherType, 125 | target: Optional[str], 126 | editable_name: bool, 127 | editable_icon: bool, 128 | cancellable: Optional[Gio.Cancellable] = None, 129 | callback: Optional[Callable[..., None]] = None, 130 | *data: Any, 131 | ) -> None: ... 132 | def dynamic_launcher_prepare_install_finish( 133 | self, result: Gio.AsyncResult 134 | ) -> GLib.Variant: ... 135 | def dynamic_launcher_request_install_token( 136 | self, name: str, icon_v: GLib.Variant 137 | ) -> str: ... 138 | def dynamic_launcher_uninstall(self, desktop_file_id: str) -> bool: ... 139 | def get_user_information( 140 | self, 141 | parent: Optional[Parent], 142 | reason: Optional[str], 143 | flags: UserInformationFlags, 144 | cancellable: Optional[Gio.Cancellable] = None, 145 | callback: Optional[Callable[..., None]] = None, 146 | *data: Any, 147 | ) -> None: ... 148 | def get_user_information_finish(self, result: Gio.AsyncResult) -> GLib.Variant: ... 149 | @classmethod 150 | def initable_new(cls) -> Optional[Portal]: ... 151 | def is_camera_present(self) -> bool: ... 152 | def location_monitor_start( 153 | self, 154 | parent: Optional[Parent], 155 | distance_threshold: int, 156 | time_threshold: int, 157 | accuracy: LocationAccuracy, 158 | flags: LocationMonitorFlags, 159 | cancellable: Optional[Gio.Cancellable] = None, 160 | callback: Optional[Callable[..., None]] = None, 161 | *data: Any, 162 | ) -> None: ... 163 | def location_monitor_start_finish(self, result: Gio.AsyncResult) -> bool: ... 164 | def location_monitor_stop(self) -> None: ... 165 | @classmethod 166 | def new(cls) -> Portal: ... 167 | def open_directory( 168 | self, 169 | parent: Parent, 170 | uri: str, 171 | flags: OpenUriFlags, 172 | cancellable: Optional[Gio.Cancellable] = None, 173 | callback: Optional[Callable[..., None]] = None, 174 | *data: Any, 175 | ) -> None: ... 176 | def open_directory_finish(self, result: Gio.AsyncResult) -> bool: ... 177 | def open_file( 178 | self, 179 | parent: Optional[Parent], 180 | title: str, 181 | filters: Optional[GLib.Variant], 182 | current_filter: Optional[GLib.Variant], 183 | choices: Optional[GLib.Variant], 184 | flags: OpenFileFlags, 185 | cancellable: Optional[Gio.Cancellable] = None, 186 | callback: Optional[Callable[..., None]] = None, 187 | *data: Any, 188 | ) -> None: ... 189 | def open_file_finish(self, result: Gio.AsyncResult) -> GLib.Variant: ... 190 | def open_pipewire_remote_for_camera(self) -> int: ... 191 | def open_uri( 192 | self, 193 | parent: Parent, 194 | uri: str, 195 | flags: OpenUriFlags, 196 | cancellable: Optional[Gio.Cancellable] = None, 197 | callback: Optional[Callable[..., None]] = None, 198 | *data: Any, 199 | ) -> None: ... 200 | def open_uri_finish(self, result: Gio.AsyncResult) -> bool: ... 201 | def pick_color( 202 | self, 203 | parent: Optional[Parent] = None, 204 | cancellable: Optional[Gio.Cancellable] = None, 205 | callback: Optional[Callable[..., None]] = None, 206 | *data: Any, 207 | ) -> None: ... 208 | def pick_color_finish(self, result: Gio.AsyncResult) -> GLib.Variant: ... 209 | def prepare_print( 210 | self, 211 | parent: Optional[Parent], 212 | title: str, 213 | settings: Optional[GLib.Variant], 214 | page_setup: Optional[GLib.Variant], 215 | flags: PrintFlags, 216 | cancellable: Optional[Gio.Cancellable] = None, 217 | callback: Optional[Callable[..., None]] = None, 218 | *data: Any, 219 | ) -> None: ... 220 | def prepare_print_finish(self, result: Gio.AsyncResult) -> GLib.Variant: ... 221 | def print_file( 222 | self, 223 | parent: Optional[Parent], 224 | title: str, 225 | token: int, 226 | file: str, 227 | flags: PrintFlags, 228 | cancellable: Optional[Gio.Cancellable] = None, 229 | callback: Optional[Callable[..., None]] = None, 230 | *data: Any, 231 | ) -> None: ... 232 | def print_file_finish(self, result: Gio.AsyncResult) -> bool: ... 233 | def remove_notification(self, id: str) -> None: ... 234 | def request_background( 235 | self, 236 | parent: Optional[Parent], 237 | reason: Optional[str], 238 | commandline: Sequence[str], 239 | flags: BackgroundFlags, 240 | cancellable: Optional[Gio.Cancellable] = None, 241 | callback: Optional[Callable[..., None]] = None, 242 | *user_data: Any, 243 | ) -> None: ... 244 | def request_background_finish(self, result: Gio.AsyncResult) -> bool: ... 245 | @staticmethod 246 | def running_under_flatpak() -> bool: ... 247 | @staticmethod 248 | def running_under_sandbox() -> bool: ... 249 | @staticmethod 250 | def running_under_snap() -> bool: ... 251 | def save_file( 252 | self, 253 | parent: Optional[Parent], 254 | title: str, 255 | current_name: Optional[str], 256 | current_folder: Optional[str], 257 | current_file: Optional[str], 258 | filters: Optional[GLib.Variant], 259 | current_filter: Optional[GLib.Variant], 260 | choices: Optional[GLib.Variant], 261 | flags: SaveFileFlags, 262 | cancellable: Optional[Gio.Cancellable] = None, 263 | callback: Optional[Callable[..., None]] = None, 264 | *data: Any, 265 | ) -> None: ... 266 | def save_file_finish(self, result: Gio.AsyncResult) -> GLib.Variant: ... 267 | def save_files( 268 | self, 269 | parent: Optional[Parent], 270 | title: str, 271 | current_name: Optional[str], 272 | current_folder: Optional[str], 273 | files: GLib.Variant, 274 | choices: Optional[GLib.Variant], 275 | flags: SaveFileFlags, 276 | cancellable: Optional[Gio.Cancellable] = None, 277 | callback: Optional[Callable[..., None]] = None, 278 | *data: Any, 279 | ) -> None: ... 280 | def save_files_finish(self, result: Gio.AsyncResult) -> GLib.Variant: ... 281 | def session_inhibit( 282 | self, 283 | parent: Optional[Parent], 284 | reason: Optional[str], 285 | flags: InhibitFlags, 286 | cancellable: Optional[Gio.Cancellable] = None, 287 | callback: Optional[Callable[..., None]] = None, 288 | *data: Any, 289 | ) -> None: ... 290 | def session_inhibit_finish(self, result: Gio.AsyncResult) -> int: ... 291 | def session_monitor_query_end_response(self) -> None: ... 292 | def session_monitor_start( 293 | self, 294 | parent: Optional[Parent], 295 | flags: SessionMonitorFlags, 296 | cancellable: Optional[Gio.Cancellable] = None, 297 | callback: Optional[Callable[..., None]] = None, 298 | *data: Any, 299 | ) -> None: ... 300 | def session_monitor_start_finish(self, result: Gio.AsyncResult) -> bool: ... 301 | def session_monitor_stop(self) -> None: ... 302 | def session_uninhibit(self, id: int) -> None: ... 303 | def set_background_status( 304 | self, 305 | status_message: Optional[str] = None, 306 | cancellable: Optional[Gio.Cancellable] = None, 307 | callback: Optional[Callable[..., None]] = None, 308 | *data: Any, 309 | ) -> None: ... 310 | def set_background_status_finish(self, result: Gio.AsyncResult) -> bool: ... 311 | def set_wallpaper( 312 | self, 313 | parent: Optional[Parent], 314 | uri: str, 315 | flags: WallpaperFlags, 316 | cancellable: Optional[Gio.Cancellable] = None, 317 | callback: Optional[Callable[..., None]] = None, 318 | *data: Any, 319 | ) -> None: ... 320 | def set_wallpaper_finish(self, result: Gio.AsyncResult) -> bool: ... 321 | def spawn( 322 | self, 323 | cwd: str, 324 | argv: Sequence[str], 325 | fds: Optional[Sequence[int]], 326 | map_to: Optional[Sequence[int]], 327 | env: Optional[Sequence[str]], 328 | flags: SpawnFlags, 329 | sandbox_expose: Optional[Sequence[str]] = None, 330 | sandbox_expose_ro: Optional[Sequence[str]] = None, 331 | cancellable: Optional[Gio.Cancellable] = None, 332 | callback: Optional[Callable[..., None]] = None, 333 | *data: Any, 334 | ) -> None: ... 335 | def spawn_finish(self, result: Gio.AsyncResult) -> int: ... 336 | def spawn_signal(self, pid: int, signal: int, to_process_group: bool) -> None: ... 337 | def take_screenshot( 338 | self, 339 | parent: Optional[Parent], 340 | flags: ScreenshotFlags, 341 | cancellable: Optional[Gio.Cancellable] = None, 342 | callback: Optional[Callable[..., None]] = None, 343 | *data: Any, 344 | ) -> None: ... 345 | def take_screenshot_finish(self, result: Gio.AsyncResult) -> Optional[str]: ... 346 | def trash_file( 347 | self, 348 | path: str, 349 | cancellable: Optional[Gio.Cancellable] = None, 350 | callback: Optional[Callable[..., None]] = None, 351 | *data: Any, 352 | ) -> None: ... 353 | def trash_file_finish(self, result: Gio.AsyncResult) -> bool: ... 354 | def update_install( 355 | self, 356 | parent: Parent, 357 | flags: UpdateInstallFlags, 358 | cancellable: Optional[Gio.Cancellable] = None, 359 | callback: Optional[Callable[..., None]] = None, 360 | *data: Any, 361 | ) -> None: ... 362 | def update_install_finish(self, result: Gio.AsyncResult) -> bool: ... 363 | def update_monitor_start( 364 | self, 365 | flags: UpdateMonitorFlags, 366 | cancellable: Optional[Gio.Cancellable] = None, 367 | callback: Optional[Callable[..., None]] = None, 368 | *data: Any, 369 | ) -> None: ... 370 | def update_monitor_start_finish(self, result: Gio.AsyncResult) -> bool: ... 371 | def update_monitor_stop(self) -> None: ... 372 | 373 | class PortalClass(GObject.GPointer): 374 | """ 375 | :Constructors: 376 | 377 | :: 378 | 379 | PortalClass() 380 | """ 381 | 382 | parent_class: GObject.ObjectClass = ... 383 | 384 | class Session(GObject.Object): 385 | """ 386 | :Constructors: 387 | 388 | :: 389 | 390 | Session(**properties) 391 | 392 | Object XdpSession 393 | 394 | Signals from XdpSession: 395 | closed () 396 | 397 | Signals from GObject: 398 | notify (GParam) 399 | """ 400 | 401 | def close(self) -> None: ... 402 | def connect_to_eis(self) -> int: ... 403 | def get_devices(self) -> DeviceType: ... 404 | def get_persist_mode(self) -> PersistMode: ... 405 | def get_restore_token(self) -> Optional[str]: ... 406 | def get_session_state(self) -> SessionState: ... 407 | def get_session_type(self) -> SessionType: ... 408 | def get_streams(self) -> GLib.Variant: ... 409 | def keyboard_key(self, keysym: bool, key: int, state: KeyState) -> None: ... 410 | def open_pipewire_remote(self) -> int: ... 411 | def pointer_axis(self, finish: bool, dx: float, dy: float) -> None: ... 412 | def pointer_axis_discrete(self, axis: DiscreteAxis, steps: int) -> None: ... 413 | def pointer_button(self, button: int, state: ButtonState) -> None: ... 414 | def pointer_motion(self, dx: float, dy: float) -> None: ... 415 | def pointer_position(self, stream: int, x: float, y: float) -> None: ... 416 | def start( 417 | self, 418 | parent: Optional[Parent] = None, 419 | cancellable: Optional[Gio.Cancellable] = None, 420 | callback: Optional[Callable[..., None]] = None, 421 | *data: Any, 422 | ) -> None: ... 423 | def start_finish(self, result: Gio.AsyncResult) -> bool: ... 424 | def touch_down(self, stream: int, slot: int, x: float, y: float) -> None: ... 425 | def touch_position(self, stream: int, slot: int, x: float, y: float) -> None: ... 426 | def touch_up(self, slot: int) -> None: ... 427 | 428 | class SessionClass(GObject.GPointer): 429 | """ 430 | :Constructors: 431 | 432 | :: 433 | 434 | SessionClass() 435 | """ 436 | 437 | parent_class: GObject.ObjectClass = ... 438 | 439 | class BackgroundFlags(GObject.GFlags): 440 | ACTIVATABLE = 2 441 | AUTOSTART = 1 442 | NONE = 0 443 | 444 | class CursorMode(GObject.GFlags): 445 | EMBEDDED = 2 446 | HIDDEN = 1 447 | METADATA = 4 448 | 449 | class DeviceType(GObject.GFlags): 450 | KEYBOARD = 1 451 | NONE = 0 452 | POINTER = 2 453 | TOUCHSCREEN = 4 454 | 455 | class InhibitFlags(GObject.GFlags): 456 | IDLE = 8 457 | LOGOUT = 1 458 | SUSPEND = 4 459 | USER_SWITCH = 2 460 | 461 | class LauncherType(GObject.GFlags): 462 | APPLICATION = 1 463 | WEBAPP = 2 464 | 465 | class OpenFileFlags(GObject.GFlags): 466 | MULTIPLE = 1 467 | NONE = 0 468 | 469 | class OpenUriFlags(GObject.GFlags): 470 | ASK = 1 471 | NONE = 0 472 | WRITABLE = 2 473 | 474 | class OutputType(GObject.GFlags): 475 | MONITOR = 1 476 | NONE = 0 477 | VIRTUAL = 4 478 | WINDOW = 2 479 | 480 | class RemoteDesktopFlags(GObject.GFlags): 481 | MULTIPLE = 1 482 | NONE = 0 483 | 484 | class ScreencastFlags(GObject.GFlags): 485 | MULTIPLE = 1 486 | NONE = 0 487 | 488 | class ScreenshotFlags(GObject.GFlags): 489 | INTERACTIVE = 1 490 | NONE = 0 491 | 492 | class SpawnFlags(GObject.GFlags): 493 | CLEARENV = 1 494 | LATEST = 2 495 | NONE = 0 496 | NO_NETWORK = 8 497 | SANDBOX = 4 498 | WATCH = 16 499 | 500 | class WallpaperFlags(GObject.GFlags): 501 | BACKGROUND = 1 502 | LOCKSCREEN = 2 503 | NONE = 0 504 | PREVIEW = 4 505 | 506 | class ButtonState(GObject.GEnum): 507 | PRESSED = 1 508 | RELEASED = 0 509 | 510 | class CameraFlags(GObject.GEnum): 511 | NONE = 0 512 | 513 | class DiscreteAxis(GObject.GEnum): 514 | HORIZONTAL_SCROLL = 0 515 | VERTICAL_SCROLL = 1 516 | 517 | class EmailFlags(GObject.GEnum): 518 | NONE = 0 519 | 520 | class KeyState(GObject.GEnum): 521 | PRESSED = 1 522 | RELEASED = 0 523 | 524 | class LocationAccuracy(GObject.GEnum): 525 | CITY = 2 526 | COUNTRY = 1 527 | EXACT = 5 528 | NEIGHBORHOOD = 3 529 | NONE = 0 530 | STREET = 4 531 | 532 | class LocationMonitorFlags(GObject.GEnum): 533 | NONE = 0 534 | 535 | class LoginSessionState(GObject.GEnum): 536 | ENDING = 3 537 | QUERY_END = 2 538 | RUNNING = 1 539 | 540 | class NotificationFlags(GObject.GEnum): 541 | NONE = 0 542 | 543 | class PersistMode(GObject.GEnum): 544 | NONE = 0 545 | PERSISTENT = 2 546 | TRANSIENT = 1 547 | 548 | class PrintFlags(GObject.GEnum): 549 | NONE = 0 550 | 551 | class SaveFileFlags(GObject.GEnum): 552 | NONE = 0 553 | 554 | class SessionMonitorFlags(GObject.GEnum): 555 | NONE = 0 556 | 557 | class SessionState(GObject.GEnum): 558 | ACTIVE = 1 559 | CLOSED = 2 560 | INITIAL = 0 561 | 562 | class SessionType(GObject.GEnum): 563 | REMOTE_DESKTOP = 1 564 | SCREENCAST = 0 565 | 566 | class UpdateInstallFlags(GObject.GEnum): 567 | NONE = 0 568 | 569 | class UpdateMonitorFlags(GObject.GEnum): 570 | NONE = 0 571 | 572 | class UpdateStatus(GObject.GEnum): 573 | DONE = 2 574 | EMPTY = 1 575 | FAILED = 3 576 | RUNNING = 0 577 | 578 | class UserInformationFlags(GObject.GEnum): 579 | NONE = 0 580 | -------------------------------------------------------------------------------- /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/_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 | -------------------------------------------------------------------------------- /src/gi-stubs/repository/__init__.pyi: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /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 | CHANGELOG = REPO_DIR / "CHANGELOG.md" 14 | 15 | VERSION_RX = r"version = \"(\d+\.\d+\.\d+)" 16 | 17 | 18 | def get_current_version() -> str: 19 | with PYPROJECT_TOML.open("r") as f: 20 | content = f.read() 21 | 22 | match = re.search(VERSION_RX, content) 23 | if match is None: 24 | sys.exit("Unable to find current version") 25 | return match[1] 26 | 27 | 28 | def bump_pyproject_toml(current_version: str, new_version: str) -> None: 29 | with PYPROJECT_TOML.open("r", encoding="utf8") as f: 30 | content = f.read() 31 | 32 | content = content.replace(current_version, new_version, 1) 33 | 34 | with PYPROJECT_TOML.open("w", encoding="utf8") as f: 35 | f.write(content) 36 | 37 | 38 | def make_changelog(new_version: str) -> None: 39 | cmd = ["git-chglog", "--next-tag", new_version] 40 | 41 | result = subprocess.run( 42 | cmd, cwd=REPO_DIR, text=True, check=True, capture_output=True 43 | ) 44 | 45 | changes = result.stdout 46 | changes = changes.removeprefix("\n") 47 | 48 | current_changelog = CHANGELOG.read_text() 49 | 50 | with CHANGELOG.open("w") as f: 51 | f.write(changes + current_changelog) 52 | 53 | 54 | if __name__ == "__main__": 55 | parser = argparse.ArgumentParser(description="Bump Version") 56 | parser.add_argument("version", help="The new version, e.g. 1.5.0") 57 | args = parser.parse_args() 58 | 59 | current_version = get_current_version() 60 | bump_pyproject_toml(current_version, args.version) 61 | make_changelog(args.version) 62 | -------------------------------------------------------------------------------- /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*"""\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 | -------------------------------------------------------------------------------- /tools/update_all.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import subprocess 4 | import sys 5 | from pathlib import Path 6 | 7 | 8 | class Lib: 9 | name: str 10 | version: str 11 | output: str 12 | 13 | def __init__(self, name: str, version: str, *, output: str | None = None) -> None: 14 | self.name = name 15 | self.version = version 16 | self.output = output or name 17 | 18 | 19 | # Add libraries below. When multiple versions are available, specify the output argument. 20 | libraries = [ 21 | Lib("Adw", "1"), 22 | Lib("AppIndicator3", "0.1"), 23 | Lib("AppStream", "1.0"), 24 | Lib("Atk", "1.0"), 25 | Lib("AyatanaAppIndicator3", "0.1"), 26 | Lib("Farstream", "0.2"), 27 | Lib("Flatpak", "1.0"), 28 | Lib("Gdk", "3.0", output="_Gdk3"), 29 | Lib("Gdk", "4.0", output="_Gdk4"), 30 | Lib("GdkPixbuf", "2.0"), 31 | Lib("GdkX11", "4.0"), 32 | Lib("Geoclue", "2.0"), 33 | Lib("GExiv2", "0.10"), 34 | Lib("Ggit", "1.0"), 35 | Lib("Gio", "2.0"), 36 | Lib("GIRepository", "2.0"), 37 | Lib("GLib", "2.0"), 38 | Lib("GModule", "2.0"), 39 | Lib("Goa", "1.0"), 40 | Lib("GObject", "2.0"), 41 | Lib("Graphene", "1.0"), 42 | Lib("Gsk", "4.0"), 43 | Lib("GSound", "1.0"), 44 | Lib("Gspell", "1"), 45 | Lib("Gst", "1.0"), 46 | Lib("GstBase", "1.0"), 47 | Lib("GstRtsp", "1.0"), 48 | Lib("GstRtp", "1.0"), 49 | Lib("GstRtspServer", "1.0"), 50 | Lib("GstPbutils", "1.0"), 51 | Lib("GstSdp", "1.0"), 52 | Lib("GstWebRTC", "1.0"), 53 | Lib("Gtk", "3.0", output="_Gtk3"), 54 | Lib("Gtk", "4.0", output="_Gtk4"), 55 | Lib("GtkSource", "4", output="_GtkSource4"), 56 | Lib("GtkSource", "5", output="_GtkSource5"), 57 | Lib("Handy", "1"), 58 | Lib("JavaScriptCore", "6.0", output="_JavaScriptCore6"), 59 | Lib("Manette", "0.2"), 60 | Lib("Notify", "0.7"), 61 | Lib("OSTree", "1.0"), 62 | Lib("Panel", "1"), 63 | Lib("Pango", "1.0"), 64 | Lib("PangoCairo", "1.0"), 65 | Lib("Poppler", "0.18"), 66 | Lib("Rsvg", "2.0"), 67 | Lib("Secret", "1"), 68 | Lib("Shumate", "1.0"), 69 | Lib("Soup", "2.4", output="_Soup2"), 70 | Lib("Soup", "3.0", output="_Soup3"), 71 | Lib("Spelling", "1"), 72 | Lib("Vte", "2.91"), 73 | Lib("WebKit", "6.0", output="_WebKit6"), 74 | Lib("XApp", "1.0"), 75 | Lib("Xdp", "1.0"), 76 | ] 77 | 78 | if __name__ == "__main__": 79 | repo_path = Path("src/gi-stubs/repository") 80 | failed_generations = [] 81 | 82 | for lib in libraries: 83 | output_path = repo_path / f"{lib.output}.pyi" 84 | 85 | print(f"Generating {output_path}", file=sys.stderr) 86 | gen_process = subprocess.run( 87 | ["tools/generate.py", lib.name, lib.version, "-u", output_path], 88 | ) 89 | 90 | if gen_process.returncode == 0: 91 | print(f"Formatting {output_path}", file=sys.stderr) 92 | subprocess.run(["black", output_path]) 93 | print(f"Sorting imports in {output_path}", file=sys.stderr) 94 | subprocess.run(["isort", output_path]) 95 | else: 96 | print(f"Failed to generate {output_path}", file=sys.stderr) 97 | failed_generations.append(output_path) 98 | 99 | if failed_generations: 100 | print("Generating the following stubs failed:", file=sys.stderr) 101 | print( 102 | "\n".join(f" - {path}" for path in failed_generations), 103 | file=sys.stderr, 104 | ) 105 | sys.exit(1) 106 | --------------------------------------------------------------------------------