Skip to content

Commit e79b460

Browse files
committed
Update stubs after deprecation
1 parent e12de24 commit e79b460

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+2922
-3
lines changed

src/gi-stubs/repository/Adw.pyi

+347
Large diffs are not rendered by default.

src/gi-stubs/repository/AppIndicator3.pyi

+7
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ from typing import Tuple
77
from typing import Type
88
from typing import TypeVar
99

10+
try:
11+
from warnings import deprecated
12+
except ImportError:
13+
from typing_extensions import deprecated
14+
1015
from gi.repository import Gdk
1116
from gi.repository import GObject
1217
from gi.repository import Gtk
@@ -142,8 +147,10 @@ class Indicator(GObject.Object):
142147
def new_with_path(
143148
cls, id: str, icon_name: str, category: IndicatorCategory, icon_theme_path: str
144149
) -> Indicator: ...
150+
@deprecated("Use app_indicator_set_attention_icon_full() instead.")
145151
def set_attention_icon(self, icon_name: str) -> None: ...
146152
def set_attention_icon_full(self, icon_name: str, icon_desc: str) -> None: ...
153+
@deprecated("Use app_indicator_set_icon_full()")
147154
def set_icon(self, icon_name: str) -> None: ...
148155
def set_icon_full(self, icon_name: str, icon_desc: str) -> None: ...
149156
def set_icon_theme_path(self, icon_theme_path: str) -> None: ...

src/gi-stubs/repository/AppStream.pyi

+5
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ from typing import Tuple
77
from typing import Type
88
from typing import TypeVar
99

10+
try:
11+
from warnings import deprecated
12+
except ImportError:
13+
from typing_extensions import deprecated
14+
1015
from gi.repository import Gio
1116
from gi.repository import GLib
1217
from gi.repository import GObject

src/gi-stubs/repository/Atk.pyi

+50
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ from typing import Tuple
77
from typing import Type
88
from typing import TypeVar
99

10+
try:
11+
from warnings import deprecated
12+
except ImportError:
13+
from typing_extensions import deprecated
14+
1015
from gi.repository import GLib
1116
from gi.repository import GObject
1217

@@ -21,6 +26,9 @@ _namespace: str = "Atk"
2126
_version: str = "1.0"
2227

2328
def attribute_set_free(attrib_set: list[None]) -> None: ...
29+
@deprecated(
30+
"Focus tracking has been dropped as a featureto be implemented by ATK itself. As #AtkObject::focus-event wasdeprecated in favor of a #AtkObject::state-change signal, in orderto notify a focus change on your implementation, you can useatk_object_notify_state_change() instead."
31+
)
2432
def focus_tracker_notify(object: Object) -> None: ...
2533
def get_binary_age() -> int: ...
2634
def get_default_registry() -> Registry: ...
@@ -36,12 +44,18 @@ def get_version() -> str: ...
3644
def relation_type_for_name(name: str) -> RelationType: ...
3745
def relation_type_get_name(type: RelationType) -> str: ...
3846
def relation_type_register(name: str) -> RelationType: ...
47+
@deprecated(
48+
'Focus tracking has been dropped as a feature to be implemented by ATK itself. If you need focus tracking on your implementation, subscribe to the #AtkObject::state-change "focused" signal.'
49+
)
3950
def remove_focus_tracker(tracker_id: int) -> None: ...
4051
def remove_global_event_listener(listener_id: int) -> None: ...
4152
def remove_key_event_listener(listener_id: int) -> None: ...
4253
def role_for_name(name: str) -> Role: ...
4354
def role_get_localized_name(role: Role) -> str: ...
4455
def role_get_name(role: Role) -> str: ...
56+
@deprecated(
57+
"Since 2.12. If your application/toolkit doesn't find asuitable role for a specific object defined at #AtkRole, pleasesubmit a bug in order to add a new role to the specification."
58+
)
4559
def role_register(name: str) -> Role: ...
4660
def state_type_for_name(name: str) -> StateType: ...
4761
def state_type_get_name(type: StateType) -> str: ...
@@ -109,12 +123,17 @@ class Component(GObject.GInterface):
109123
def get_extents(self, coord_type: CoordType) -> Tuple[int, int, int, int]: ...
110124
def get_layer(self) -> Layer: ...
111125
def get_mdi_zorder(self) -> int: ...
126+
@deprecated("Since 2.12. Use atk_component_get_extents() instead.")
112127
def get_position(self, coord_type: CoordType) -> Tuple[int, int]: ...
128+
@deprecated("Since 2.12. Use atk_component_get_extents() instead.")
113129
def get_size(self) -> Tuple[int, int]: ...
114130
def grab_focus(self) -> bool: ...
115131
def ref_accessible_at_point(
116132
self, x: int, y: int, coord_type: CoordType
117133
) -> Optional[Object]: ...
134+
@deprecated(
135+
'If you need to track when an object gains orlose the focus, use the #AtkObject::state-change "focused" notification instead.'
136+
)
118137
def remove_focus_handler(self, handler_id: int) -> None: ...
119138
def scroll_to(self, type: ScrollType) -> bool: ...
120139
def scroll_to_point(self, coords: CoordType, x: int, y: int) -> bool: ...
@@ -162,8 +181,15 @@ class Document(GObject.GInterface):
162181
def get_attribute_value(self, attribute_name: str) -> Optional[str]: ...
163182
def get_attributes(self) -> list[None]: ...
164183
def get_current_page_number(self) -> int: ...
184+
@deprecated(
185+
"Since 2.12. @document is already a representation ofthe document. Use it directly, or one of its children, as aninstance of the DOM."
186+
)
165187
def get_document(self) -> None: ...
188+
@deprecated(
189+
"Since 2.12. Please use atk_document_get_attributes() toask for the document type if it applies."
190+
)
166191
def get_document_type(self) -> str: ...
192+
@deprecated("Please use atk_object_get_object_locale() instead.")
167193
def get_locale(self) -> str: ...
168194
def get_page_count(self) -> int: ...
169195
def set_attribute_value(
@@ -377,6 +403,9 @@ class Hyperlink(GObject.Object, Action):
377403
def get_start_index(self) -> int: ...
378404
def get_uri(self, i: int) -> str: ...
379405
def is_inline(self) -> bool: ...
406+
@deprecated(
407+
"Please use ATK_STATE_FOCUSABLE for all links,and ATK_STATE_FOCUSED for focused links."
408+
)
380409
def is_selected_link(self) -> bool: ...
381410
def is_valid(self) -> bool: ...
382411

@@ -510,9 +539,12 @@ class Misc(GObject.Object):
510539
parent: GObject.Object = ...
511540
def do_threads_enter(self) -> None: ...
512541
def do_threads_leave(self) -> None: ...
542+
@deprecated("Since 2.12.")
513543
@staticmethod
514544
def get_instance() -> Misc: ...
545+
@deprecated("Since 2.12.")
515546
def threads_enter(self) -> None: ...
547+
@deprecated("Since 2.12.")
516548
def threads_leave(self) -> None: ...
517549

518550
class MiscClass(GObject.GPointer):
@@ -847,7 +879,9 @@ class Object(GObject.Object):
847879
def get_attributes(self) -> list[None]: ...
848880
def get_description(self) -> str: ...
849881
def get_index_in_parent(self) -> int: ...
882+
@deprecated("Use atk_component_get_layer instead.")
850883
def get_layer(self) -> Layer: ...
884+
@deprecated("Use atk_component_get_mdi_zorder instead.")
851885
def get_mdi_zorder(self) -> int: ...
852886
def get_n_accessible_children(self) -> int: ...
853887
def get_name(self) -> str: ...
@@ -860,6 +894,7 @@ class Object(GObject.Object):
860894
def ref_accessible_child(self, i: int) -> Object: ...
861895
def ref_relation_set(self) -> RelationSet: ...
862896
def ref_state_set(self) -> StateSet: ...
897+
@deprecated("See atk_object_connect_property_change_handler()")
863898
def remove_property_change_handler(self, handler_id: int) -> None: ...
864899
def remove_relationship(
865900
self, relationship: RelationType, target: Object
@@ -1443,13 +1478,18 @@ class Table(GObject.GInterface):
14431478
def add_column_selection(self, column: int) -> bool: ...
14441479
def add_row_selection(self, row: int) -> bool: ...
14451480
def get_caption(self) -> Optional[Object]: ...
1481+
@deprecated("Since 2.12.")
14461482
def get_column_at_index(self, index_: int) -> int: ...
14471483
def get_column_description(self, column: int) -> str: ...
14481484
def get_column_extent_at(self, row: int, column: int) -> int: ...
14491485
def get_column_header(self, column: int) -> Optional[Object]: ...
1486+
@deprecated(
1487+
"Since 2.12. Use atk_table_ref_at() in order to get theaccessible that represents the cell at (@row, @column)"
1488+
)
14501489
def get_index_at(self, row: int, column: int) -> int: ...
14511490
def get_n_columns(self) -> int: ...
14521491
def get_n_rows(self) -> int: ...
1492+
@deprecated("since 2.12.")
14531493
def get_row_at_index(self, index_: int) -> int: ...
14541494
def get_row_description(self, row: int) -> Optional[str]: ...
14551495
def get_row_extent_at(self, row: int, column: int) -> int: ...
@@ -1584,12 +1624,17 @@ class Text(GObject.GInterface):
15841624
self, offset: int, granularity: TextGranularity
15851625
) -> Tuple[Optional[str], int, int]: ...
15861626
def get_text(self, start_offset: int, end_offset: int) -> str: ...
1627+
@deprecated("Please use atk_text_get_string_at_offset() instead.")
15871628
def get_text_after_offset(
15881629
self, offset: int, boundary_type: TextBoundary
15891630
) -> Tuple[str, int, int]: ...
1631+
@deprecated(
1632+
"This method is deprecated since ATK version2.9.4. Please use atk_text_get_string_at_offset() instead."
1633+
)
15901634
def get_text_at_offset(
15911635
self, offset: int, boundary_type: TextBoundary
15921636
) -> Tuple[str, int, int]: ...
1637+
@deprecated("Please use atk_text_get_string_at_offset() instead.")
15931638
def get_text_before_offset(
15941639
self, offset: int, boundary_type: TextBoundary
15951640
) -> Tuple[str, int, int]: ...
@@ -1721,14 +1766,19 @@ class Value(GObject.GInterface):
17211766
Interface AtkValue
17221767
"""
17231768

1769+
@deprecated("Since 2.12. Use atk_value_get_value_and_text()instead.")
17241770
def get_current_value(self) -> Any: ...
17251771
def get_increment(self) -> float: ...
1772+
@deprecated("Since 2.12. Use atk_value_get_range() instead.")
17261773
def get_maximum_value(self) -> Any: ...
1774+
@deprecated("Since 2.12. Use atk_value_get_increment() instead.")
17271775
def get_minimum_increment(self) -> Any: ...
1776+
@deprecated("Since 2.12. Use atk_value_get_range() instead.")
17281777
def get_minimum_value(self) -> Any: ...
17291778
def get_range(self) -> Optional[Range]: ...
17301779
def get_sub_ranges(self) -> list[Range]: ...
17311780
def get_value_and_text(self) -> Tuple[float, str]: ...
1781+
@deprecated("Since 2.12. Use atk_value_set_value() instead.")
17321782
def set_current_value(self, value: Any) -> bool: ...
17331783
def set_value(self, new_value: float) -> None: ...
17341784

src/gi-stubs/repository/AyatanaAppIndicator3.pyi

+7
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ from typing import Tuple
77
from typing import Type
88
from typing import TypeVar
99

10+
try:
11+
from warnings import deprecated
12+
except ImportError:
13+
from typing_extensions import deprecated
14+
1015
from gi.repository import Gdk
1116
from gi.repository import GObject
1217
from gi.repository import Gtk
@@ -141,10 +146,12 @@ class Indicator(GObject.Object):
141146
def new_with_path(
142147
cls, id: str, icon_name: str, category: IndicatorCategory, icon_theme_path: str
143148
) -> Indicator: ...
149+
@deprecated("Use app_indicator_set_attention_icon_full() instead.")
144150
def set_attention_icon(self, icon_name: str) -> None: ...
145151
def set_attention_icon_full(
146152
self, icon_name: str, icon_desc: Optional[str] = None
147153
) -> None: ...
154+
@deprecated("Use app_indicator_set_icon_full()")
148155
def set_icon(self, icon_name: str) -> None: ...
149156
def set_icon_full(
150157
self, icon_name: str, icon_desc: Optional[str] = None

src/gi-stubs/repository/Farstream.pyi

+5
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ from typing import Tuple
77
from typing import Type
88
from typing import TypeVar
99

10+
try:
11+
from warnings import deprecated
12+
except ImportError:
13+
from typing_extensions import deprecated
14+
1015
from gi.repository import GLib
1116
from gi.repository import GObject
1217
from gi.repository import Gst

src/gi-stubs/repository/Flatpak.pyi

+13
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ from typing import Tuple
77
from typing import Type
88
from typing import TypeVar
99

10+
try:
11+
from warnings import deprecated
12+
except ImportError:
13+
from typing_extensions import deprecated
14+
1015
from gi.repository import Gio
1116
from gi.repository import GLib
1217
from gi.repository import GObject
@@ -185,6 +190,7 @@ class Installation(GObject.Object):
185190
self, name: str, cancellable: Optional[Gio.Cancellable] = None
186191
) -> Remote: ...
187192
def get_storage_type(self) -> StorageType: ...
193+
@deprecated("Use flatpak_transaction_add_install() instead.")
188194
def install(
189195
self,
190196
remote_name: str,
@@ -196,13 +202,15 @@ class Installation(GObject.Object):
196202
cancellable: Optional[Gio.Cancellable] = None,
197203
*progress_data: Any,
198204
) -> InstalledRef: ...
205+
@deprecated("Use flatpak_transaction_add_install_bundle() instead.")
199206
def install_bundle(
200207
self,
201208
file: Gio.File,
202209
progress: Optional[Callable[..., None]] = None,
203210
cancellable: Optional[Gio.Cancellable] = None,
204211
*progress_data: Any,
205212
) -> InstalledRef: ...
213+
@deprecated("Use flatpak_transaction_add_install() instead.")
206214
def install_full(
207215
self,
208216
flags: InstallFlags,
@@ -216,6 +224,7 @@ class Installation(GObject.Object):
216224
cancellable: Optional[Gio.Cancellable] = None,
217225
*progress_data: Any,
218226
) -> InstalledRef: ...
227+
@deprecated("Use flatpak_transaction_add_install_flatpakref() instead.")
219228
def install_ref_file(
220229
self, ref_file_data: GLib.Bytes, cancellable: Optional[Gio.Cancellable] = None
221230
) -> RemoteRef: ...
@@ -319,6 +328,7 @@ class Installation(GObject.Object):
319328
self, key: str, value: str, cancellable: Optional[Gio.Cancellable] = None
320329
) -> bool: ...
321330
def set_no_interaction(self, no_interaction: bool) -> None: ...
331+
@deprecated("Use flatpak_transaction_add_uninstall() instead.")
322332
def uninstall(
323333
self,
324334
kind: RefKind,
@@ -329,6 +339,7 @@ class Installation(GObject.Object):
329339
cancellable: Optional[Gio.Cancellable] = None,
330340
*progress_data: Any,
331341
) -> bool: ...
342+
@deprecated("Use flatpak_transaction_add_uninstall() instead.")
332343
def uninstall_full(
333344
self,
334345
flags: UninstallFlags,
@@ -340,6 +351,7 @@ class Installation(GObject.Object):
340351
cancellable: Optional[Gio.Cancellable] = None,
341352
*progress_data: Any,
342353
) -> bool: ...
354+
@deprecated("Use flatpak_transaction_add_update() instead.")
343355
def update(
344356
self,
345357
flags: UpdateFlags,
@@ -367,6 +379,7 @@ class Installation(GObject.Object):
367379
out_changed: Optional[bool] = None,
368380
cancellable: Optional[Gio.Cancellable] = None,
369381
) -> bool: ...
382+
@deprecated("Use flatpak_transaction_add_update() instead.")
370383
def update_full(
371384
self,
372385
flags: UpdateFlags,

src/gi-stubs/repository/GIRepository.pyi

+5
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ from typing import Tuple
77
from typing import Type
88
from typing import TypeVar
99

10+
try:
11+
from warnings import deprecated
12+
except ImportError:
13+
from typing_extensions import deprecated
14+
1015
from gi.repository import GLib
1116
from gi.repository import GObject
1217

0 commit comments

Comments
 (0)