11from typing import Any
22from typing import Callable
3+ from typing import Literal
34from typing import Optional
45from typing import Sequence
56from typing import Tuple
67from typing import Type
8+ from typing import TypeVar
79
810from gi .repository import Gio
911from gi .repository import GLib
1012from gi .repository import GObject
1113from gi .repository import HarfBuzz
14+ from typing_extensions import Concatenate
15+ from typing_extensions import ParamSpec
16+
17+ _VarArgs = ParamSpec ("_VarArgs" )
1218
1319ANALYSIS_FLAG_CENTERED_BASELINE : int = 1
1420ANALYSIS_FLAG_IS_ELLIPSIS : int = 2
@@ -20,9 +26,9 @@ GLYPH_INVALID_INPUT: int = 4294967295
2026GLYPH_UNKNOWN_FLAG : int = 268435456
2127SCALE : int = 1024
2228VERSION_MAJOR : int = 1
23- VERSION_MICRO : int = 12
29+ VERSION_MICRO : int = 14
2430VERSION_MINOR : int = 50
25- VERSION_STRING : str = "1.50.12 "
31+ VERSION_STRING : str = "1.50.14 "
2632_introspection_module = ... # FIXME Constant
2733_lock = ... # FIXME Constant
2834_namespace : str = "Pango"
@@ -60,9 +66,8 @@ def attr_shape_new(ink_rect: Rectangle, logical_rect: Rectangle) -> Attribute: .
6066def attr_shape_new_with_data (
6167 ink_rect : Rectangle ,
6268 logical_rect : Rectangle ,
63- data : None ,
64- copy_func : Optional [Callable [..., None ]] = None ,
65- destroy_func : Optional [Callable [[None ], None ]] = None ,
69+ data : Optional [Any ] = None ,
70+ copy_func : Optional [Callable [Concatenate [_VarArgs ], None ]] = None ,
6671) -> Attribute : ...
6772def attr_show_new (flags : ShowFlags ) -> Attribute : ...
6873def attr_size_new (size : int ) -> Attribute : ...
@@ -142,7 +147,7 @@ def parse_style(str: str, warn: bool) -> Tuple[bool, Style]: ...
142147def parse_variant (str : str , warn : bool ) -> Tuple [bool , Variant ]: ...
143148def parse_weight (str : str , warn : bool ) -> Tuple [bool , Weight ]: ...
144149def quantize_line_geometry () -> Tuple [int , int ]: ...
145- def read_line (stream : None , str : GLib .String ) -> int : ...
150+ def read_line (stream : Optional [ Any ] , str : GLib .String ) -> int : ...
146151def reorder_items (items : list [Item ]) -> list [Item ]: ...
147152def scan_int () -> Tuple [bool , str , int ]: ...
148153def scan_string (out : GLib .String ) -> Tuple [bool , str ]: ...
@@ -200,15 +205,15 @@ class Analysis(GObject.GPointer):
200205 Analysis()
201206 """
202207
203- shape_engine : None = ...
204- lang_engine : None = ...
208+ shape_engine : Any = ...
209+ lang_engine : Any = ...
205210 font : Font = ...
206211 level : int = ...
207212 gravity : int = ...
208213 flags : int = ...
209214 script : int = ...
210215 language : Language = ...
211- extra_attrs : list [None ] = ...
216+ extra_attrs : list [Any ] = ...
212217
213218class AttrClass (GObject .GPointer ):
214219 """
@@ -323,7 +328,9 @@ class AttrList(GObject.GBoxed):
323328 def change (self , attr : Attribute ) -> None : ...
324329 def copy (self ) -> Optional [AttrList ]: ...
325330 def equal (self , other_list : AttrList ) -> bool : ...
326- def filter (self , func : Callable [..., bool ], * data : Any ) -> Optional [AttrList ]: ...
331+ def filter (
332+ self , func : Callable [Concatenate [Attribute , _VarArgs ], bool ], * data : Any
333+ ) -> Optional [AttrList ]: ...
327334 @staticmethod
328335 def from_string (text : str ) -> Optional [AttrList ]: ...
329336 def get_attributes (self ) -> list [Attribute ]: ...
@@ -350,18 +357,17 @@ class AttrShape(GObject.GPointer):
350357 attr : Attribute = ...
351358 ink_rect : Rectangle = ...
352359 logical_rect : Rectangle = ...
353- data : None = ...
354- copy_func : Callable [... , None ] = ...
355- destroy_func : Callable [[None ], None ] = ...
360+ data : Any = ...
361+ copy_func : Callable [Concatenate [ _VarArgs ] , None ] = ...
362+ destroy_func : Callable [[Optional [ Any ] ], None ] = ...
356363 @staticmethod
357364 def new (ink_rect : Rectangle , logical_rect : Rectangle ) -> Attribute : ...
358365 @staticmethod
359366 def new_with_data (
360367 ink_rect : Rectangle ,
361368 logical_rect : Rectangle ,
362- data : None ,
363- copy_func : Optional [Callable [..., None ]] = None ,
364- destroy_func : Optional [Callable [[None ], None ]] = None ,
369+ data : Optional [Any ] = None ,
370+ copy_func : Optional [Callable [Concatenate [_VarArgs ], None ]] = None ,
365371 ) -> Attribute : ...
366372
367373class AttrSize (GObject .GPointer ):
@@ -668,8 +674,8 @@ class FontFaceClass(GObject.GPointer):
668674 list_sizes : Callable [[FontFace ], list [int ]] = ...
669675 is_synthesized : Callable [[FontFace ], bool ] = ...
670676 get_family : Callable [[FontFace ], FontFamily ] = ...
671- _pango_reserved3 : None = ...
672- _pango_reserved4 : None = ...
677+ _pango_reserved3 : Any = ...
678+ _pango_reserved4 : Any = ...
673679
674680class FontFamily (GObject .Object , Gio .ListModel ):
675681 """
@@ -725,7 +731,7 @@ class FontFamilyClass(GObject.GPointer):
725731 is_monospace : Callable [[FontFamily ], bool ] = ...
726732 is_variable : Callable [[FontFamily ], bool ] = ...
727733 get_face : Callable [[FontFamily , Optional [str ]], Optional [FontFace ]] = ...
728- _pango_reserved2 : None = ...
734+ _pango_reserved2 : Any = ...
729735
730736class FontMap (GObject .Object , Gio .ListModel ):
731737 """
@@ -794,7 +800,7 @@ class FontMapClass(GObject.GPointer):
794800 get_serial : Callable [[FontMap ], int ] = ...
795801 changed : Callable [[FontMap ], None ] = ...
796802 get_family : Callable [[FontMap , str ], FontFamily ] = ...
797- get_face : None = ...
803+ get_face : Any = ...
798804
799805class FontMetrics (GObject .GBoxed ):
800806 """
@@ -842,11 +848,15 @@ class Fontset(GObject.Object):
842848 """
843849
844850 parent_instance : GObject .Object = ...
845- def do_foreach (self , func : Callable [..., bool ], * data : Any ) -> None : ...
851+ def do_foreach (
852+ self , func : Callable [Concatenate [Fontset , Font , _VarArgs ], bool ], * data : Any
853+ ) -> None : ...
846854 def do_get_font (self , wc : int ) -> Font : ...
847855 def do_get_language (self ) -> Language : ...
848856 def do_get_metrics (self ) -> FontMetrics : ...
849- def foreach (self , func : Callable [..., bool ], * data : Any ) -> None : ...
857+ def foreach (
858+ self , func : Callable [Concatenate [Fontset , Font , _VarArgs ], bool ], * data : Any
859+ ) -> None : ...
850860 def get_font (self , wc : int ) -> Font : ...
851861 def get_metrics (self ) -> FontMetrics : ...
852862
@@ -863,11 +873,16 @@ class FontsetClass(GObject.GPointer):
863873 get_font : Callable [[Fontset , int ], Font ] = ...
864874 get_metrics : Callable [[Fontset ], FontMetrics ] = ...
865875 get_language : Callable [[Fontset ], Language ] = ...
866- foreach : Callable [..., None ] = ...
867- _pango_reserved1 : None = ...
868- _pango_reserved2 : None = ...
869- _pango_reserved3 : None = ...
870- _pango_reserved4 : None = ...
876+ foreach : Callable [
877+ Concatenate [
878+ Fontset , Callable [Concatenate [Fontset , Font , _VarArgs ], bool ], _VarArgs
879+ ],
880+ None ,
881+ ] = ...
882+ _pango_reserved1 : Any = ...
883+ _pango_reserved2 : Any = ...
884+ _pango_reserved3 : Any = ...
885+ _pango_reserved4 : Any = ...
871886
872887class FontsetSimple (Fontset ):
873888 """
@@ -1376,9 +1391,9 @@ class RendererClass(GObject.GPointer):
13761391 draw_glyph_item : Callable [
13771392 [Renderer , Optional [str ], GlyphItem , int , int ], None
13781393 ] = ...
1379- _pango_reserved2 : None = ...
1380- _pango_reserved3 : None = ...
1381- _pango_reserved4 : None = ...
1394+ _pango_reserved2 : Any = ...
1395+ _pango_reserved3 : Any = ...
1396+ _pango_reserved4 : Any = ...
13821397
13831398class RendererPrivate (GObject .GPointer ): ...
13841399
0 commit comments