Functions ========= .. currentmodule:: gi.repository.GObject .. function:: add_emission_hook(type: ~gi.repository.GObject.Object, name: str, callback: ~typing.Callable[[...], None], *args: ~typing.Any) -> None :param type: :param name: :param callback: :param args: .. function:: boxed_free(boxed_type: ~gobject.GType, boxed: ~typing.Any) -> None Free the boxed structure ``boxed`` which is of type ``boxed_type``\. :param boxed_type: The type of ``boxed``\. :param boxed: The boxed structure to be freed. .. function:: boxed_type_register_static(name: str, boxed_copy: ~typing.Callable[[~typing.Any], ~typing.Any], boxed_free: ~typing.Callable[[~typing.Any], None]) -> ~gobject.GType This function creates a new ``Boxed`` derived type id for a new boxed type with name ``name``\. Boxed type handling functions have to be provided to copy and free opaque boxed structures of this type. For the general case, it is recommended to use :func:`~gi.repository.GObject.DEFINE_BOXED_TYPE` instead of calling :func:`~gi.repository.GObject.boxed_type_register_static` directly. The macro will create the appropriate ``*_get_type()`` function for the boxed type. :param name: Name of the new boxed type. :param boxed_copy: Boxed structure copy function. :param boxed_free: Boxed structure free function. :return: New ``Boxed`` derived type id for ``name``\. .. function:: cclosure_marshal_BOOLEAN__BOXED_BOXED(closure: ~gi.repository.GObject.Closure, return_value: ~gi.repository.GObject.Value, n_param_values: int, param_values: ~gi.repository.GObject.Value, invocation_hint: ~typing.Any = None, marshal_data: ~typing.Any = None) -> None :param closure: :param return_value: :param n_param_values: :param param_values: :param invocation_hint: :param marshal_data: .. function:: cclosure_marshal_BOOLEAN__FLAGS(closure: ~gi.repository.GObject.Closure, return_value: ~gi.repository.GObject.Value, n_param_values: int, param_values: ~gi.repository.GObject.Value, invocation_hint: ~typing.Any = None, marshal_data: ~typing.Any = None) -> None :param closure: :param return_value: :param n_param_values: :param param_values: :param invocation_hint: :param marshal_data: .. function:: cclosure_marshal_STRING__OBJECT_POINTER(closure: ~gi.repository.GObject.Closure, return_value: ~gi.repository.GObject.Value, n_param_values: int, param_values: ~gi.repository.GObject.Value, invocation_hint: ~typing.Any = None, marshal_data: ~typing.Any = None) -> None :param closure: :param return_value: :param n_param_values: :param param_values: :param invocation_hint: :param marshal_data: .. function:: cclosure_marshal_VOID__BOOLEAN(closure: ~gi.repository.GObject.Closure, return_value: ~gi.repository.GObject.Value, n_param_values: int, param_values: ~gi.repository.GObject.Value, invocation_hint: ~typing.Any = None, marshal_data: ~typing.Any = None) -> None :param closure: :param return_value: :param n_param_values: :param param_values: :param invocation_hint: :param marshal_data: .. function:: cclosure_marshal_VOID__BOXED(closure: ~gi.repository.GObject.Closure, return_value: ~gi.repository.GObject.Value, n_param_values: int, param_values: ~gi.repository.GObject.Value, invocation_hint: ~typing.Any = None, marshal_data: ~typing.Any = None) -> None :param closure: :param return_value: :param n_param_values: :param param_values: :param invocation_hint: :param marshal_data: .. function:: cclosure_marshal_VOID__CHAR(closure: ~gi.repository.GObject.Closure, return_value: ~gi.repository.GObject.Value, n_param_values: int, param_values: ~gi.repository.GObject.Value, invocation_hint: ~typing.Any = None, marshal_data: ~typing.Any = None) -> None :param closure: :param return_value: :param n_param_values: :param param_values: :param invocation_hint: :param marshal_data: .. function:: cclosure_marshal_VOID__DOUBLE(closure: ~gi.repository.GObject.Closure, return_value: ~gi.repository.GObject.Value, n_param_values: int, param_values: ~gi.repository.GObject.Value, invocation_hint: ~typing.Any = None, marshal_data: ~typing.Any = None) -> None :param closure: :param return_value: :param n_param_values: :param param_values: :param invocation_hint: :param marshal_data: .. function:: cclosure_marshal_VOID__ENUM(closure: ~gi.repository.GObject.Closure, return_value: ~gi.repository.GObject.Value, n_param_values: int, param_values: ~gi.repository.GObject.Value, invocation_hint: ~typing.Any = None, marshal_data: ~typing.Any = None) -> None :param closure: :param return_value: :param n_param_values: :param param_values: :param invocation_hint: :param marshal_data: .. function:: cclosure_marshal_VOID__FLAGS(closure: ~gi.repository.GObject.Closure, return_value: ~gi.repository.GObject.Value, n_param_values: int, param_values: ~gi.repository.GObject.Value, invocation_hint: ~typing.Any = None, marshal_data: ~typing.Any = None) -> None :param closure: :param return_value: :param n_param_values: :param param_values: :param invocation_hint: :param marshal_data: .. function:: cclosure_marshal_VOID__FLOAT(closure: ~gi.repository.GObject.Closure, return_value: ~gi.repository.GObject.Value, n_param_values: int, param_values: ~gi.repository.GObject.Value, invocation_hint: ~typing.Any = None, marshal_data: ~typing.Any = None) -> None :param closure: :param return_value: :param n_param_values: :param param_values: :param invocation_hint: :param marshal_data: .. function:: cclosure_marshal_VOID__INT(closure: ~gi.repository.GObject.Closure, return_value: ~gi.repository.GObject.Value, n_param_values: int, param_values: ~gi.repository.GObject.Value, invocation_hint: ~typing.Any = None, marshal_data: ~typing.Any = None) -> None :param closure: :param return_value: :param n_param_values: :param param_values: :param invocation_hint: :param marshal_data: .. function:: cclosure_marshal_VOID__LONG(closure: ~gi.repository.GObject.Closure, return_value: ~gi.repository.GObject.Value, n_param_values: int, param_values: ~gi.repository.GObject.Value, invocation_hint: ~typing.Any = None, marshal_data: ~typing.Any = None) -> None :param closure: :param return_value: :param n_param_values: :param param_values: :param invocation_hint: :param marshal_data: .. function:: cclosure_marshal_VOID__OBJECT(closure: ~gi.repository.GObject.Closure, return_value: ~gi.repository.GObject.Value, n_param_values: int, param_values: ~gi.repository.GObject.Value, invocation_hint: ~typing.Any = None, marshal_data: ~typing.Any = None) -> None :param closure: :param return_value: :param n_param_values: :param param_values: :param invocation_hint: :param marshal_data: .. function:: cclosure_marshal_VOID__PARAM(closure: ~gi.repository.GObject.Closure, return_value: ~gi.repository.GObject.Value, n_param_values: int, param_values: ~gi.repository.GObject.Value, invocation_hint: ~typing.Any = None, marshal_data: ~typing.Any = None) -> None :param closure: :param return_value: :param n_param_values: :param param_values: :param invocation_hint: :param marshal_data: .. function:: cclosure_marshal_VOID__POINTER(closure: ~gi.repository.GObject.Closure, return_value: ~gi.repository.GObject.Value, n_param_values: int, param_values: ~gi.repository.GObject.Value, invocation_hint: ~typing.Any = None, marshal_data: ~typing.Any = None) -> None :param closure: :param return_value: :param n_param_values: :param param_values: :param invocation_hint: :param marshal_data: .. function:: cclosure_marshal_VOID__STRING(closure: ~gi.repository.GObject.Closure, return_value: ~gi.repository.GObject.Value, n_param_values: int, param_values: ~gi.repository.GObject.Value, invocation_hint: ~typing.Any = None, marshal_data: ~typing.Any = None) -> None :param closure: :param return_value: :param n_param_values: :param param_values: :param invocation_hint: :param marshal_data: .. function:: cclosure_marshal_VOID__UCHAR(closure: ~gi.repository.GObject.Closure, return_value: ~gi.repository.GObject.Value, n_param_values: int, param_values: ~gi.repository.GObject.Value, invocation_hint: ~typing.Any = None, marshal_data: ~typing.Any = None) -> None :param closure: :param return_value: :param n_param_values: :param param_values: :param invocation_hint: :param marshal_data: .. function:: cclosure_marshal_VOID__UINT(closure: ~gi.repository.GObject.Closure, return_value: ~gi.repository.GObject.Value, n_param_values: int, param_values: ~gi.repository.GObject.Value, invocation_hint: ~typing.Any = None, marshal_data: ~typing.Any = None) -> None :param closure: :param return_value: :param n_param_values: :param param_values: :param invocation_hint: :param marshal_data: .. function:: cclosure_marshal_VOID__UINT_POINTER(closure: ~gi.repository.GObject.Closure, return_value: ~gi.repository.GObject.Value, n_param_values: int, param_values: ~gi.repository.GObject.Value, invocation_hint: ~typing.Any = None, marshal_data: ~typing.Any = None) -> None :param closure: :param return_value: :param n_param_values: :param param_values: :param invocation_hint: :param marshal_data: .. function:: cclosure_marshal_VOID__ULONG(closure: ~gi.repository.GObject.Closure, return_value: ~gi.repository.GObject.Value, n_param_values: int, param_values: ~gi.repository.GObject.Value, invocation_hint: ~typing.Any = None, marshal_data: ~typing.Any = None) -> None :param closure: :param return_value: :param n_param_values: :param param_values: :param invocation_hint: :param marshal_data: .. function:: cclosure_marshal_VOID__VARIANT(closure: ~gi.repository.GObject.Closure, return_value: ~gi.repository.GObject.Value, n_param_values: int, param_values: ~gi.repository.GObject.Value, invocation_hint: ~typing.Any = None, marshal_data: ~typing.Any = None) -> None :param closure: :param return_value: :param n_param_values: :param param_values: :param invocation_hint: :param marshal_data: .. function:: cclosure_marshal_VOID__VOID(closure: ~gi.repository.GObject.Closure, return_value: ~gi.repository.GObject.Value, n_param_values: int, param_values: ~gi.repository.GObject.Value, invocation_hint: ~typing.Any = None, marshal_data: ~typing.Any = None) -> None :param closure: :param return_value: :param n_param_values: :param param_values: :param invocation_hint: :param marshal_data: .. function:: cclosure_marshal_generic(closure: ~gi.repository.GObject.Closure, return_gvalue: ~gi.repository.GObject.Value, n_param_values: int, param_values: ~gi.repository.GObject.Value, invocation_hint: ~typing.Any = None, marshal_data: ~typing.Any = None) -> None :param closure: :param return_gvalue: :param n_param_values: :param param_values: :param invocation_hint: :param marshal_data: .. function:: child_watch_add(*args, **kwargs) .. deprecated:: PyGObject-3.16.0 GObject.child_watch_add is deprecated; use GLib.child_watch_add instead :param args: :param kwargs: .. function:: clear_signal_handler(handler_id_ptr: int, instance: ~gi.repository.GObject.Object) -> None Disconnects a handler from ``instance`` so it will not be called during any future or currently ongoing emissions of the signal it has been connected to. The ``handler_id_ptr`` is then set to zero, which is never a valid handler ID value (see :func:`~gi.repository.GObject.signal_connect`). If the handler ID is 0 then this function does nothing. There is also a macro version of this function so that the code will be inlined. .. versionadded:: 2.62 :param handler_id_ptr: A pointer to a handler ID (of type :obj:`~gi.repository.gulong`\) of the handler to be disconnected. :param instance: The instance to remove the signal handler from. This pointer may be :const:`None` or invalid, if the handler ID is zero. .. function:: enum_complete_type_info(g_enum_type: ~gobject.GType, const_values: ~gi.repository.GObject.EnumValue) -> ~gi.repository.GObject.TypeInfo This function is meant to be called from the ``complete_type_info`` function of a :obj:`~gi.repository.GObject.TypePlugin` implementation, as in the following example: .. code-block:: C :dedent: static void my_enum_complete_type_info (GTypePlugin *plugin, GType g_type, GTypeInfo *info, GTypeValueTable *value_table) { static const GEnumValue values[] = { { MY_ENUM_FOO, "MY_ENUM_FOO", "foo" }, { MY_ENUM_BAR, "MY_ENUM_BAR", "bar" }, { 0, NULL, NULL } }; g_enum_complete_type_info (type, info, values); } :param g_enum_type: the type identifier of the type being completed :param const_values: An array of :obj:`~gi.repository.GObject.EnumValue` structs for the possible enumeration values. The array is terminated by a struct with all members being 0. .. function:: enum_get_value(enum_class: ~gi.repository.GObject.EnumClass, value: int) -> ~gi.repository.GObject.EnumValue | None Returns the :obj:`~gi.repository.GObject.EnumValue` for a value. :param enum_class: a :obj:`~gi.repository.GObject.EnumClass` :param value: the value to look up :return: the :obj:`~gi.repository.GObject.EnumValue` for ``value``\, or :const:`None` if ``value`` is not a member of the enumeration .. function:: enum_get_value_by_name(enum_class: ~gi.repository.GObject.EnumClass, name: str) -> ~gi.repository.GObject.EnumValue | None Looks up a :obj:`~gi.repository.GObject.EnumValue` by name. :param enum_class: a :obj:`~gi.repository.GObject.EnumClass` :param name: the name to look up :return: the :obj:`~gi.repository.GObject.EnumValue` with name ``name``\, or :const:`None` if the enumeration doesn't have a member with that name .. function:: enum_get_value_by_nick(enum_class: ~gi.repository.GObject.EnumClass, nick: str) -> ~gi.repository.GObject.EnumValue | None Looks up a :obj:`~gi.repository.GObject.EnumValue` by nickname. :param enum_class: a :obj:`~gi.repository.GObject.EnumClass` :param nick: the nickname to look up :return: the :obj:`~gi.repository.GObject.EnumValue` with nickname ``nick``\, or :const:`None` if the enumeration doesn't have a member with that nickname .. function:: enum_register_static(name: str, const_static_values: ~gi.repository.GObject.EnumValue) -> ~gobject.GType Registers a new static enumeration type with the name ``name``\. It is normally more convenient to let [glib-mkenums][glib-mkenums], generate a my_enum_get_type() function from a usual C enumeration definition than to write one yourself using :func:`~gi.repository.GObject.enum_register_static`. :param name: A nul-terminated string used as the name of the new type. :param const_static_values: An array of :obj:`~gi.repository.GObject.EnumValue` structs for the possible enumeration values. The array is terminated by a struct with all members being 0. GObject keeps a reference to the data, so it cannot be stack-allocated. :return: The new type identifier. .. function:: enum_to_string(g_enum_type: ~gobject.GType, value: int) -> str Pretty-prints ``value`` in the form of the enum’s name. This is intended to be used for debugging purposes. The format of the output may change in the future. .. versionadded:: 2.54 :param g_enum_type: the type identifier of a :obj:`~gi.repository.GObject.EnumClass` type :param value: the value :return: a newly-allocated text string .. function:: filename_display_basename(filename: str) -> str .. deprecated:: PyGObject-3.16.0 GObject.filename_display_basename is deprecated; use GLib.filename_display_basename instead :param filename: .. function:: filename_display_name(filename: str) -> str .. deprecated:: PyGObject-3.16.0 GObject.filename_display_name is deprecated; use GLib.filename_display_name instead :param filename: .. function:: filename_from_utf8(utf8string, len=-1) .. deprecated:: PyGObject-3.16.0 GObject.filename_from_utf8 is deprecated; use GLib.filename_from_utf8 instead :param utf8string: :param len: .. function:: flags_complete_type_info(g_flags_type: ~gobject.GType, const_values: ~gi.repository.GObject.FlagsValue) -> ~gi.repository.GObject.TypeInfo This function is meant to be called from the complete_type_info() function of a :obj:`~gi.repository.GObject.TypePlugin` implementation, see the example for :func:`~gi.repository.GObject.enum_complete_type_info` above. :param g_flags_type: the type identifier of the type being completed :param const_values: An array of :obj:`~gi.repository.GObject.FlagsValue` structs for the possible enumeration values. The array is terminated by a struct with all members being 0. .. function:: flags_get_first_value(flags_class: ~gi.repository.GObject.FlagsClass, value: int) -> ~gi.repository.GObject.FlagsValue | None Returns the first :obj:`~gi.repository.GObject.FlagsValue` which is set in ``value``\. :param flags_class: a :obj:`~gi.repository.GObject.FlagsClass` :param value: the value :return: the first :obj:`~gi.repository.GObject.FlagsValue` which is set in ``value``\, or :const:`None` if none is set .. function:: flags_get_value_by_name(flags_class: ~gi.repository.GObject.FlagsClass, name: str) -> ~gi.repository.GObject.FlagsValue | None Looks up a :obj:`~gi.repository.GObject.FlagsValue` by name. :param flags_class: a :obj:`~gi.repository.GObject.FlagsClass` :param name: the name to look up :return: the :obj:`~gi.repository.GObject.FlagsValue` with name ``name``\, or :const:`None` if there is no flag with that name .. function:: flags_get_value_by_nick(flags_class: ~gi.repository.GObject.FlagsClass, nick: str) -> ~gi.repository.GObject.FlagsValue | None Looks up a :obj:`~gi.repository.GObject.FlagsValue` by nickname. :param flags_class: a :obj:`~gi.repository.GObject.FlagsClass` :param nick: the nickname to look up :return: the :obj:`~gi.repository.GObject.FlagsValue` with nickname ``nick``\, or :const:`None` if there is no flag with that nickname .. function:: flags_register_static(name: str, const_static_values: ~gi.repository.GObject.FlagsValue) -> ~gobject.GType Registers a new static flags type with the name ``name``\. It is normally more convenient to let [glib-mkenums][glib-mkenums] generate a my_flags_get_type() function from a usual C enumeration definition than to write one yourself using :func:`~gi.repository.GObject.flags_register_static`. :param name: A nul-terminated string used as the name of the new type. :param const_static_values: An array of :obj:`~gi.repository.GObject.FlagsValue` structs for the possible flags values. The array is terminated by a struct with all members being 0. GObject keeps a reference to the data, so it cannot be stack-allocated. :return: The new type identifier. .. function:: flags_to_string(flags_type: ~gobject.GType, value: int) -> str Pretty-prints ``value`` in the form of the flag names separated by ``|`` and sorted. Any extra bits will be shown at the end as a hexadecimal number. This is intended to be used for debugging purposes. The format of the output may change in the future. .. versionadded:: 2.54 :param flags_type: the type identifier of a :obj:`~gi.repository.GObject.FlagsClass` type :param value: the value :return: a newly-allocated text string .. function:: get_application_name() -> str | None .. deprecated:: PyGObject-3.16.0 GObject.get_application_name is deprecated; use GLib.get_application_name instead .. function:: get_current_time() .. deprecated:: PyGObject-3.16.0 GObject.get_current_time is deprecated; use GLib.get_current_time instead .. function:: get_prgname() -> str | None .. deprecated:: PyGObject-3.16.0 GObject.get_prgname is deprecated; use GLib.get_prgname instead .. function:: gtype_get_type() -> ~gobject.GType .. function:: idle_add(function, *user_data, priority=200) .. deprecated:: PyGObject-3.16.0 GObject.idle_add is deprecated; use GLib.idle_add instead :param function: :param user_data: :param priority: .. function:: io_add_watch(*args, **kwargs) .. deprecated:: PyGObject-3.16.0 GObject.io_add_watch is deprecated; use GLib.io_add_watch instead :param args: :param kwargs: .. function:: list_properties() -> list[~gi.overrides.GObject.ParamSpec] .. function:: main_context_default() -> ~gi.repository.GLib.MainContext .. deprecated:: PyGObject-3.16.0 GObject.main_context_default is deprecated; use GLib.main_context_default instead .. function:: main_depth() -> int .. deprecated:: PyGObject-3.16.0 GObject.main_depth is deprecated; use GLib.main_depth instead .. function:: markup_escape_text(text, length=-1) .. deprecated:: PyGObject-3.16.0 GObject.markup_escape_text is deprecated; use GLib.markup_escape_text instead :param text: :param length: .. function:: new(gtype: ~gobject.GType) -> None :param gtype: .. function:: param_spec_boolean(name: str, nick: str | None, blurb: str | None, default_value: bool, flags: ~gi.repository.GObject.ParamFlags) -> ~gi.overrides.GObject.ParamSpec Creates a new ``GParamSpecBoolean`` instance specifying a :obj:`bool` property. In many cases, it may be more appropriate to use an enum with :func:`~gi.repository.GObject.param_spec_enum`, both to improve code clarity by using explicitly named values, and to allow for more values to be added in future without breaking API. See :func:`~gi.repository.GObject.ParamSpec.internal` for details on property names. :param name: canonical name of the property specified :param nick: nick name for the property specified :param blurb: description of the property specified :param default_value: default value for the property specified :param flags: flags for the property specified :return: a newly created parameter specification .. function:: param_spec_boxed(name: str, nick: str | None, blurb: str | None, boxed_type: ~gobject.GType, flags: ~gi.repository.GObject.ParamFlags) -> ~gi.overrides.GObject.ParamSpec Creates a new ``GParamSpecBoxed`` instance specifying a ``Boxed`` derived property. See :func:`~gi.repository.GObject.ParamSpec.internal` for details on property names. :param name: canonical name of the property specified :param nick: nick name for the property specified :param blurb: description of the property specified :param boxed_type: ``Boxed`` derived type of this property :param flags: flags for the property specified :return: a newly created parameter specification .. function:: param_spec_char(name: str, nick: str | None, blurb: str | None, minimum: int, maximum: int, default_value: int, flags: ~gi.repository.GObject.ParamFlags) -> ~gi.overrides.GObject.ParamSpec Creates a new ``GParamSpecChar`` instance specifying a :obj:`int` property. :param name: canonical name of the property specified :param nick: nick name for the property specified :param blurb: description of the property specified :param minimum: minimum value for the property specified :param maximum: maximum value for the property specified :param default_value: default value for the property specified :param flags: flags for the property specified :return: a newly created parameter specification .. function:: param_spec_double(name: str, nick: str | None, blurb: str | None, minimum: float, maximum: float, default_value: float, flags: ~gi.repository.GObject.ParamFlags) -> ~gi.overrides.GObject.ParamSpec Creates a new ``GParamSpecDouble`` instance specifying a :obj:`float` property. See :func:`~gi.repository.GObject.ParamSpec.internal` for details on property names. :param name: canonical name of the property specified :param nick: nick name for the property specified :param blurb: description of the property specified :param minimum: minimum value for the property specified :param maximum: maximum value for the property specified :param default_value: default value for the property specified :param flags: flags for the property specified :return: a newly created parameter specification .. function:: param_spec_enum(name: str, nick: str | None, blurb: str | None, enum_type: ~gobject.GType, default_value: int, flags: ~gi.repository.GObject.ParamFlags) -> ~gi.overrides.GObject.ParamSpec Creates a new ``GParamSpecEnum`` instance specifying a ``Enum`` property. See :func:`~gi.repository.GObject.ParamSpec.internal` for details on property names. :param name: canonical name of the property specified :param nick: nick name for the property specified :param blurb: description of the property specified :param enum_type: a :obj:`~gi.repository.GObject.Type` derived from ``Enum`` :param default_value: default value for the property specified :param flags: flags for the property specified :return: a newly created parameter specification .. function:: param_spec_flags(name: str, nick: str | None, blurb: str | None, flags_type: ~gobject.GType, default_value: int, flags: ~gi.repository.GObject.ParamFlags) -> ~gi.overrides.GObject.ParamSpec Creates a new ``GParamSpecFlags`` instance specifying a ``Flags`` property. See :func:`~gi.repository.GObject.ParamSpec.internal` for details on property names. :param name: canonical name of the property specified :param nick: nick name for the property specified :param blurb: description of the property specified :param flags_type: a :obj:`~gi.repository.GObject.Type` derived from ``Flags`` :param default_value: default value for the property specified :param flags: flags for the property specified :return: a newly created parameter specification .. function:: param_spec_float(name: str, nick: str | None, blurb: str | None, minimum: float, maximum: float, default_value: float, flags: ~gi.repository.GObject.ParamFlags) -> ~gi.overrides.GObject.ParamSpec Creates a new ``GParamSpecFloat`` instance specifying a :obj:`float` property. See :func:`~gi.repository.GObject.ParamSpec.internal` for details on property names. :param name: canonical name of the property specified :param nick: nick name for the property specified :param blurb: description of the property specified :param minimum: minimum value for the property specified :param maximum: maximum value for the property specified :param default_value: default value for the property specified :param flags: flags for the property specified :return: a newly created parameter specification .. function:: param_spec_gtype(name: str, nick: str | None, blurb: str | None, is_a_type: ~gobject.GType, flags: ~gi.repository.GObject.ParamFlags) -> ~gi.overrides.GObject.ParamSpec Creates a new ``GParamSpecGType`` instance specifying a ``GType`` property. See :func:`~gi.repository.GObject.ParamSpec.internal` for details on property names. .. versionadded:: 2.10 :param name: canonical name of the property specified :param nick: nick name for the property specified :param blurb: description of the property specified :param is_a_type: a :obj:`~gi.repository.GObject.Type` whose subtypes are allowed as values of the property (use %G_TYPE_NONE for any type) :param flags: flags for the property specified :return: a newly created parameter specification .. function:: param_spec_int(name: str, nick: str | None, blurb: str | None, minimum: int, maximum: int, default_value: int, flags: ~gi.repository.GObject.ParamFlags) -> ~gi.overrides.GObject.ParamSpec Creates a new ``GParamSpecInt`` instance specifying a :obj:`int` property. See :func:`~gi.repository.GObject.ParamSpec.internal` for details on property names. :param name: canonical name of the property specified :param nick: nick name for the property specified :param blurb: description of the property specified :param minimum: minimum value for the property specified :param maximum: maximum value for the property specified :param default_value: default value for the property specified :param flags: flags for the property specified :return: a newly created parameter specification .. function:: param_spec_int64(name: str, nick: str | None, blurb: str | None, minimum: int, maximum: int, default_value: int, flags: ~gi.repository.GObject.ParamFlags) -> ~gi.overrides.GObject.ParamSpec Creates a new ``GParamSpecInt64`` instance specifying a :obj:`int` property. See :func:`~gi.repository.GObject.ParamSpec.internal` for details on property names. :param name: canonical name of the property specified :param nick: nick name for the property specified :param blurb: description of the property specified :param minimum: minimum value for the property specified :param maximum: maximum value for the property specified :param default_value: default value for the property specified :param flags: flags for the property specified :return: a newly created parameter specification .. function:: param_spec_long(name: str, nick: str | None, blurb: str | None, minimum: int, maximum: int, default_value: int, flags: ~gi.repository.GObject.ParamFlags) -> ~gi.overrides.GObject.ParamSpec Creates a new ``GParamSpecLong`` instance specifying a :obj:`int` property. See :func:`~gi.repository.GObject.ParamSpec.internal` for details on property names. :param name: canonical name of the property specified :param nick: nick name for the property specified :param blurb: description of the property specified :param minimum: minimum value for the property specified :param maximum: maximum value for the property specified :param default_value: default value for the property specified :param flags: flags for the property specified :return: a newly created parameter specification .. function:: param_spec_object(name: str, nick: str | None, blurb: str | None, object_type: ~gobject.GType, flags: ~gi.repository.GObject.ParamFlags) -> ~gi.overrides.GObject.ParamSpec Creates a new ``GParamSpecBoxed`` instance specifying a :obj:`object` derived property. See :func:`~gi.repository.GObject.ParamSpec.internal` for details on property names. :param name: canonical name of the property specified :param nick: nick name for the property specified :param blurb: description of the property specified :param object_type: :obj:`object` derived type of this property :param flags: flags for the property specified :return: a newly created parameter specification .. function:: param_spec_param(name: str, nick: str | None, blurb: str | None, param_type: ~gobject.GType, flags: ~gi.repository.GObject.ParamFlags) -> ~gi.overrides.GObject.ParamSpec Creates a new ``GParamSpecParam`` instance specifying a :obj:`~gi.repository.GObject.ParamSpec` property. See :func:`~gi.repository.GObject.ParamSpec.internal` for details on property names. :param name: canonical name of the property specified :param nick: nick name for the property specified :param blurb: description of the property specified :param param_type: a :obj:`~gi.repository.GObject.Type` derived from :obj:`~gi.repository.GObject.ParamSpec` :param flags: flags for the property specified :return: a newly created parameter specification .. function:: param_spec_pointer(name: str, nick: str | None, blurb: str | None, flags: ~gi.repository.GObject.ParamFlags) -> ~gi.overrides.GObject.ParamSpec Creates a new ``GParamSpecPointer`` instance specifying a pointer property. Where possible, it is better to use :func:`~gi.repository.GObject.param_spec_object` or :func:`~gi.repository.GObject.param_spec_boxed` to expose memory management information. See :func:`~gi.repository.GObject.ParamSpec.internal` for details on property names. :param name: canonical name of the property specified :param nick: nick name for the property specified :param blurb: description of the property specified :param flags: flags for the property specified :return: a newly created parameter specification .. function:: param_spec_string(name: str, nick: str | None, blurb: str | None, default_value: str | None, flags: ~gi.repository.GObject.ParamFlags) -> ~gi.overrides.GObject.ParamSpec Creates a new ``GParamSpecString`` instance. See :func:`~gi.repository.GObject.ParamSpec.internal` for details on property names. :param name: canonical name of the property specified :param nick: nick name for the property specified :param blurb: description of the property specified :param default_value: default value for the property specified :param flags: flags for the property specified :return: a newly created parameter specification .. function:: param_spec_uchar(name: str, nick: str | None, blurb: str | None, minimum: int, maximum: int, default_value: int, flags: ~gi.repository.GObject.ParamFlags) -> ~gi.overrides.GObject.ParamSpec Creates a new ``GParamSpecUChar`` instance specifying a unsigned :obj:`int` property. :param name: canonical name of the property specified :param nick: nick name for the property specified :param blurb: description of the property specified :param minimum: minimum value for the property specified :param maximum: maximum value for the property specified :param default_value: default value for the property specified :param flags: flags for the property specified :return: a newly created parameter specification .. function:: param_spec_uint(name: str, nick: str | None, blurb: str | None, minimum: int, maximum: int, default_value: int, flags: ~gi.repository.GObject.ParamFlags) -> ~gi.overrides.GObject.ParamSpec Creates a new ``GParamSpecUInt`` instance specifying a unsigned :obj:`int` property. See :func:`~gi.repository.GObject.ParamSpec.internal` for details on property names. :param name: canonical name of the property specified :param nick: nick name for the property specified :param blurb: description of the property specified :param minimum: minimum value for the property specified :param maximum: maximum value for the property specified :param default_value: default value for the property specified :param flags: flags for the property specified :return: a newly created parameter specification .. function:: param_spec_uint64(name: str, nick: str | None, blurb: str | None, minimum: int, maximum: int, default_value: int, flags: ~gi.repository.GObject.ParamFlags) -> ~gi.overrides.GObject.ParamSpec Creates a new ``GParamSpecUInt64`` instance specifying a unsigned :obj:`int` property. See :func:`~gi.repository.GObject.ParamSpec.internal` for details on property names. :param name: canonical name of the property specified :param nick: nick name for the property specified :param blurb: description of the property specified :param minimum: minimum value for the property specified :param maximum: maximum value for the property specified :param default_value: default value for the property specified :param flags: flags for the property specified :return: a newly created parameter specification .. function:: param_spec_ulong(name: str, nick: str | None, blurb: str | None, minimum: int, maximum: int, default_value: int, flags: ~gi.repository.GObject.ParamFlags) -> ~gi.overrides.GObject.ParamSpec Creates a new ``GParamSpecULong`` instance specifying a unsigned :obj:`int` property. See :func:`~gi.repository.GObject.ParamSpec.internal` for details on property names. :param name: canonical name of the property specified :param nick: nick name for the property specified :param blurb: description of the property specified :param minimum: minimum value for the property specified :param maximum: maximum value for the property specified :param default_value: default value for the property specified :param flags: flags for the property specified :return: a newly created parameter specification .. function:: param_spec_unichar(name: str, nick: str | None, blurb: str | None, default_value: str, flags: ~gi.repository.GObject.ParamFlags) -> ~gi.overrides.GObject.ParamSpec Creates a new ``GParamSpecUnichar`` instance specifying a unsigned :obj:`int` property. :obj:`~gi.repository.GObject.Value` structures for this property can be accessed with :func:`~gi.repository.GObject.Value.set_uint` and :func:`~gi.repository.GObject.Value.get_uint`. See :func:`~gi.repository.GObject.ParamSpec.internal` for details on property names. :param name: canonical name of the property specified :param nick: nick name for the property specified :param blurb: description of the property specified :param default_value: default value for the property specified :param flags: flags for the property specified :return: a newly created parameter specification .. function:: param_spec_variant(name: str, nick: str | None, blurb: str | None, type: ~gi.repository.GLib.VariantType, default_value: ~gi.repository.GLib.Variant | None, flags: ~gi.repository.GObject.ParamFlags) -> ~gi.overrides.GObject.ParamSpec Creates a new ``GParamSpecVariant`` instance specifying a :obj:`~gi.repository.GLib.Variant` property. If ``default_value`` is floating, it is consumed. See :func:`~gi.repository.GObject.ParamSpec.internal` for details on property names. .. versionadded:: 2.26 :param name: canonical name of the property specified :param nick: nick name for the property specified :param blurb: description of the property specified :param type: a :obj:`~gi.repository.GLib.VariantType` :param default_value: a :obj:`~gi.repository.GLib.Variant` of type ``type`` to use as the default value, or :const:`None` :param flags: flags for the property specified :return: the newly created :obj:`~gi.repository.GObject.ParamSpec` .. function:: param_type_register_static(name: str, pspec_info: ~gi.repository.GObject.ParamSpecTypeInfo) -> ~gobject.GType Registers ``name`` as the name of a new static type derived from :obj:`~gi.repository.GObject.ParamSpec`. The type system uses the information contained in the :obj:`~gi.repository.GObject.ParamSpecTypeInfo` structure pointed to by ``info`` to manage the :obj:`~gi.repository.GObject.ParamSpec` type and its instances. :param name: 0-terminated string used as the name of the new :obj:`~gi.repository.GObject.ParamSpec` type. :param pspec_info: The :obj:`~gi.repository.GObject.ParamSpecTypeInfo` for this :obj:`~gi.repository.GObject.ParamSpec` type. :return: The new type identifier. .. function:: param_value_convert(pspec: ~gi.overrides.GObject.ParamSpec, src_value: ~gi.repository.GObject.Value, dest_value: ~gi.repository.GObject.Value, strict_validation: bool) -> bool Transforms ``src_value`` into ``dest_value`` if possible, and then validates ``dest_value``\, in order for it to conform to ``pspec``\. If ``strict_validation`` is :const:`True` this function will only succeed if the transformed ``dest_value`` complied to ``pspec`` without modifications. See also :func:`~gi.repository.GObject.Value.type_transformable`, :func:`~gi.repository.GObject.Value.transform` and :func:`~gi.repository.GObject.param_value_validate`. :param pspec: a valid :obj:`~gi.repository.GObject.ParamSpec` :param src_value: source :obj:`~gi.repository.GObject.Value` :param dest_value: destination :obj:`~gi.repository.GObject.Value` of correct type for ``pspec`` :param strict_validation: :const:`True` requires ``dest_value`` to conform to ``pspec`` without modifications :return: :const:`True` if transformation and validation were successful, :const:`False` otherwise and ``dest_value`` is left untouched. .. function:: param_value_defaults(pspec: ~gi.overrides.GObject.ParamSpec, value: ~gi.repository.GObject.Value) -> bool Checks whether ``value`` contains the default value as specified in ``pspec``\. :param pspec: a valid :obj:`~gi.repository.GObject.ParamSpec` :param value: a :obj:`~gi.repository.GObject.Value` of correct type for ``pspec`` :return: whether ``value`` contains the canonical default for this ``pspec`` .. function:: param_value_is_valid(pspec: ~gi.overrides.GObject.ParamSpec, value: ~gi.repository.GObject.Value) -> bool Return whether the contents of ``value`` comply with the specifications set out by ``pspec``\. .. versionadded:: 2.74 :param pspec: a valid :obj:`~gi.repository.GObject.ParamSpec` :param value: a :obj:`~gi.repository.GObject.Value` of correct type for ``pspec`` :return: whether the contents of ``value`` comply with the specifications set out by ``pspec``\. .. function:: param_value_set_default(pspec: ~gi.overrides.GObject.ParamSpec, value: ~gi.repository.GObject.Value) -> None Sets ``value`` to its default value as specified in ``pspec``\. :param pspec: a valid :obj:`~gi.repository.GObject.ParamSpec` :param value: a :obj:`~gi.repository.GObject.Value` of correct type for ``pspec``\; since 2.64, you can also pass an empty :obj:`~gi.repository.GObject.Value`\, initialized with %G_VALUE_INIT .. function:: param_value_validate(pspec: ~gi.overrides.GObject.ParamSpec, value: ~gi.repository.GObject.Value) -> bool Ensures that the contents of ``value`` comply with the specifications set out by ``pspec``\. For example, a ``GParamSpecInt`` might require that integers stored in ``value`` may not be smaller than -42 and not be greater than +42. If ``value`` contains an integer outside of this range, it is modified accordingly, so the resulting value will fit into the range -42 .. +42. :param pspec: a valid :obj:`~gi.repository.GObject.ParamSpec` :param value: a :obj:`~gi.repository.GObject.Value` of correct type for ``pspec`` :return: whether modifying ``value`` was necessary to ensure validity .. function:: param_values_cmp(pspec: ~gi.overrides.GObject.ParamSpec, value1: ~gi.repository.GObject.Value, value2: ~gi.repository.GObject.Value) -> int Compares ``value1`` with ``value2`` according to ``pspec``\, and return -1, 0 or +1, if ``value1`` is found to be less than, equal to or greater than ``value2``\, respectively. :param pspec: a valid :obj:`~gi.repository.GObject.ParamSpec` :param value1: a :obj:`~gi.repository.GObject.Value` of correct type for ``pspec`` :param value2: a :obj:`~gi.repository.GObject.Value` of correct type for ``pspec`` :return: -1, 0 or +1, for a less than, equal to or greater than result .. function:: pointer_type_register_static(name: str) -> ~gobject.GType Creates a new %G_TYPE_POINTER derived type id for a new pointer type with name ``name``\. :param name: the name of the new pointer type. :return: a new %G_TYPE_POINTER derived type id for ``name``\. .. function:: remove_emission_hook(obj, detailed_signal, hook_id) :param obj: :param detailed_signal: :param hook_id: .. function:: set_application_name(application_name: str) -> None .. deprecated:: PyGObject-3.16.0 GObject.set_application_name is deprecated; use GLib.set_application_name instead :param application_name: .. function:: set_prgname(prgname: str) -> None .. deprecated:: PyGObject-3.16.0 GObject.set_prgname is deprecated; use GLib.set_prgname instead :param prgname: .. function:: signal_accumulator_first_wins(ihint, return_accu, handler_return, user_data=None) A predefined :obj:`~gi.repository.GObject.SignalAccumulator` for signals intended to be used as a hook for application code to provide a particular value. Usually only one such value is desired and multiple handlers for the same signal don't make much sense (except for the case of the default handler defined in the class structure, in which case you will usually want the signal connection to override the class handler). This accumulator will use the return value from the first signal handler that is run as the return value for the signal and not run any further handlers (ie: the first handler "wins"). .. versionadded:: 2.28 :param ihint: standard :obj:`~gi.repository.GObject.SignalAccumulator` parameter :param return_accu: standard :obj:`~gi.repository.GObject.SignalAccumulator` parameter :param handler_return: standard :obj:`~gi.repository.GObject.SignalAccumulator` parameter :param user_data: :return: standard :obj:`~gi.repository.GObject.SignalAccumulator` result .. function:: signal_accumulator_true_handled(ihint, return_accu, handler_return, user_data=None) A predefined :obj:`~gi.repository.GObject.SignalAccumulator` for signals that return a boolean values. The behavior that this accumulator gives is that a return of :const:`True` stops the signal emission: no further callbacks will be invoked, while a return of :const:`False` allows the emission to continue. The idea here is that a :const:`True` return indicates that the callback handled the signal, and no further handling is needed. .. versionadded:: 2.4 :param ihint: standard :obj:`~gi.repository.GObject.SignalAccumulator` parameter :param return_accu: standard :obj:`~gi.repository.GObject.SignalAccumulator` parameter :param handler_return: standard :obj:`~gi.repository.GObject.SignalAccumulator` parameter :param user_data: :return: standard :obj:`~gi.repository.GObject.SignalAccumulator` result .. function:: signal_add_emission_hook(signal_id: int, detail: int, hook_func: ~typing.Callable[[~gi.repository.GObject.SignalInvocationHint, list[~gi.repository.GObject.Value], ~typing.Any], bool]) -> int Adds an emission hook for a signal, which will get called for any emission of that signal, independent of the instance. This is possible only for signals which don't have :const:`~gi.repository.GObject.SignalFlags.NO_HOOKS` flag set. :param signal_id: the signal identifier, as returned by :func:`~gi.repository.GObject.signal_lookup`. :param detail: the detail on which to call the hook. :param hook_func: a :obj:`~gi.repository.GObject.SignalEmissionHook` function. :return: the hook id, for later use with :func:`~gi.repository.GObject.signal_remove_emission_hook`. .. function:: signal_chain_from_overridden(instance_and_params: list[~gi.repository.GObject.Value], return_value: ~gi.repository.GObject.Value) -> None Calls the original class closure of a signal. This function should only be called from an overridden class closure; see :func:`~gi.repository.GObject.signal_override_class_closure` and :func:`~gi.repository.GObject.signal_override_class_handler`. :param instance_and_params: the argument list of the signal emission. The first element in the array is a :obj:`~gi.repository.GObject.Value` for the instance the signal is being emitted on. The rest are any arguments to be passed to the signal. :param return_value: Location for the return value. .. function:: signal_connect_closure(instance: ~gi.repository.GObject.Object, detailed_signal: str, closure: ~gi.repository.GObject.Closure, after: bool) -> int Connects a closure to a signal for a particular object. If ``closure`` is a floating reference (see :func:`~gi.repository.GObject.Closure.sink`), this function takes ownership of ``closure``\. This function cannot fail. If the given signal doesn’t exist, a critical warning is emitted. :param instance: the instance to connect to. :param detailed_signal: a string of the form "signal-name::detail". :param closure: the closure to connect. :param after: whether the handler should be called before or after the default handler of the signal. :return: the handler ID (always greater than 0) .. function:: signal_connect_closure_by_id(instance: ~gi.repository.GObject.Object, signal_id: int, detail: int, closure: ~gi.repository.GObject.Closure, after: bool) -> int Connects a closure to a signal for a particular object. If ``closure`` is a floating reference (see :func:`~gi.repository.GObject.Closure.sink`), this function takes ownership of ``closure``\. This function cannot fail. If the given signal doesn’t exist, a critical warning is emitted. :param instance: the instance to connect to. :param signal_id: the id of the signal. :param detail: the detail. :param closure: the closure to connect. :param after: whether the handler should be called before or after the default handler of the signal. :return: the handler ID (always greater than 0) .. function:: signal_emitv(instance_and_params: list[~gi.repository.GObject.Value], signal_id: int, detail: int, return_value: ~gi.repository.GObject.Value = Ellipsis) -> ~gi.repository.GObject.Value Emits a signal. Signal emission is done synchronously. The method will only return control after all handlers are called or signal emission was stopped. Note that :func:`~gi.repository.GObject.signal_emitv` doesn't change ``return_value`` if no handlers are connected, in contrast to :func:`~gi.repository.GObject.signal_emit` and :func:`~gi.repository.GObject.signal_emit_valist`. :param instance_and_params: argument list for the signal emission. The first element in the array is a :obj:`~gi.repository.GObject.Value` for the instance the signal is being emitted on. The rest are any arguments to be passed to the signal. :param signal_id: the signal id :param detail: the detail :param return_value: Location to store the return value of the signal emission. This must be provided if the specified signal returns a value, but may be ignored otherwise. .. function:: signal_get_invocation_hint(instance: ~gi.repository.GObject.Object) -> ~gi.repository.GObject.SignalInvocationHint | None Returns the invocation hint of the innermost signal emission of instance. :param instance: the instance to query :return: the invocation hint of the innermost signal emission, or :const:`None` if not found. .. function:: signal_handler_block(obj, handler_id) Blocks the signal handler from being invoked until handler_unblock() is called. :param GObject.Object obj: Object instance to block handlers for. :param int handler_id: Id of signal to block. :returns: A context manager which optionally can be used to automatically unblock the handler: .. code-block:: python with GObject.signal_handler_block(obj, id): pass .. function:: signal_handler_disconnect(instance: ~gi.repository.GObject.Object, handler_id: int) -> None Disconnects a handler from an instance so it will not be called during any future or currently ongoing emissions of the signal it has been connected to. The ``handler_id`` becomes invalid and may be reused. The ``handler_id`` has to be a valid signal handler id, connected to a signal of ``instance``\. :param instance: The instance to remove the signal handler from. :param handler_id: Handler id of the handler to be disconnected. .. function:: signal_handler_find(instance: ~gi.repository.GObject.Object, mask: ~gi.repository.GObject.SignalMatchType, signal_id: int, detail: int, closure: ~gi.repository.GObject.Closure | None = None, func: ~typing.Any = None, data: ~typing.Any = None) -> int Finds the first signal handler that matches certain selection criteria. The criteria mask is passed as an OR-ed combination of :obj:`~gi.repository.GObject.SignalMatchType` flags, and the criteria values are passed as arguments. The match ``mask`` has to be non-0 for successful matches. If no handler was found, 0 is returned. :param instance: The instance owning the signal handler to be found. :param mask: Mask indicating which of ``signal_id``\, ``detail``\, ``closure``\, ``func`` and/or ``data`` the handler has to match. :param signal_id: Signal the handler has to be connected to. :param detail: Signal detail the handler has to be connected to. :param closure: The closure the handler will invoke. :param func: The C closure callback of the handler (useless for non-C closures). :param data: The closure data of the handler's closure. :return: A valid non-0 signal handler id for a successful match. .. function:: signal_handler_is_connected(instance: ~gi.repository.GObject.Object, handler_id: int) -> bool Returns whether ``handler_id`` is the ID of a handler connected to ``instance``\. :param instance: The instance where a signal handler is sought. :param handler_id: the handler ID. :return: whether ``handler_id`` identifies a handler connected to ``instance``\. .. function:: signal_handler_unblock(instance: ~gi.repository.GObject.Object, handler_id: int) -> None Undoes the effect of a previous :func:`~gi.repository.GObject.signal_handler_block` call. A blocked handler is skipped during signal emissions and will not be invoked, unblocking it (for exactly the amount of times it has been blocked before) reverts its "blocked" state, so the handler will be recognized by the signal system and is called upon future or currently ongoing signal emissions (since the order in which handlers are called during signal emissions is deterministic, whether the unblocked handler in question is called as part of a currently ongoing emission depends on how far that emission has proceeded yet). The ``handler_id`` has to be a valid id of a signal handler that is connected to a signal of ``instance`` and is currently blocked. :param instance: The instance to unblock the signal handler of. :param handler_id: Handler id of the handler to be unblocked. .. function:: signal_handlers_block_matched(instance: ~gi.repository.GObject.Object, mask: ~gi.repository.GObject.SignalMatchType, signal_id: int, detail: int, closure: ~gi.repository.GObject.Closure | None = None, func: ~typing.Any = None, data: ~typing.Any = None) -> int Blocks all handlers on an instance that match a certain selection criteria. The criteria mask is passed as a combination of :obj:`~gi.repository.GObject.SignalMatchType` flags, and the criteria values are passed as arguments. A handler must match on all flags set in ``mask`` to be blocked (i.e. the match is conjunctive). Passing at least one of the :const:`~gi.repository.GObject.SignalMatchType.ID`, :const:`~gi.repository.GObject.SignalMatchType.CLOSURE`, :const:`~gi.repository.GObject.SignalMatchType.FUNC` or :const:`~gi.repository.GObject.SignalMatchType.DATA` match flags is required for successful matches. If no handlers were found, 0 is returned, the number of blocked handlers otherwise. Support for :const:`~gi.repository.GObject.SignalMatchType.ID` was added in GLib 2.78. :param instance: The instance to block handlers from. :param mask: Mask indicating which of ``signal_id``\, ``detail``\, ``closure``\, ``func`` and/or ``data`` the handlers have to match. :param signal_id: Signal the handlers have to be connected to. :param detail: Signal detail the handlers have to be connected to. :param closure: The closure the handlers will invoke. :param func: The C closure callback of the handlers (useless for non-C closures). :param data: The closure data of the handlers' closures. :return: The number of handlers that matched. .. function:: signal_handlers_destroy(instance: ~gi.repository.GObject.Object) -> None Destroy all signal handlers of a type instance. This function is an implementation detail of the :obj:`~gi.repository.GObject.Object` dispose implementation, and should not be used outside of the type system. :param instance: The instance whose signal handlers are destroyed .. function:: signal_handlers_disconnect_matched(instance: ~gi.repository.GObject.Object, mask: ~gi.repository.GObject.SignalMatchType, signal_id: int, detail: int, closure: ~gi.repository.GObject.Closure | None = None, func: ~typing.Any = None, data: ~typing.Any = None) -> int Disconnects all handlers on an instance that match a certain selection criteria. The criteria mask is passed as a combination of :obj:`~gi.repository.GObject.SignalMatchType` flags, and the criteria values are passed as arguments. A handler must match on all flags set in ``mask`` to be disconnected (i.e. the match is conjunctive). Passing at least one of the :const:`~gi.repository.GObject.SignalMatchType.ID`, :const:`~gi.repository.GObject.SignalMatchType.CLOSURE`, :const:`~gi.repository.GObject.SignalMatchType.FUNC` or :const:`~gi.repository.GObject.SignalMatchType.DATA` match flags is required for successful matches. If no handlers were found, 0 is returned, the number of disconnected handlers otherwise. Support for :const:`~gi.repository.GObject.SignalMatchType.ID` was added in GLib 2.78. :param instance: The instance to remove handlers from. :param mask: Mask indicating which of ``signal_id``\, ``detail``\, ``closure``\, ``func`` and/or ``data`` the handlers have to match. :param signal_id: Signal the handlers have to be connected to. :param detail: Signal detail the handlers have to be connected to. :param closure: The closure the handlers will invoke. :param func: The C closure callback of the handlers (useless for non-C closures). :param data: The closure data of the handlers' closures. :return: The number of handlers that matched. .. function:: signal_handlers_unblock_matched(instance: ~gi.repository.GObject.Object, mask: ~gi.repository.GObject.SignalMatchType, signal_id: int, detail: int, closure: ~gi.repository.GObject.Closure | None = None, func: ~typing.Any = None, data: ~typing.Any = None) -> int Unblocks all handlers on an instance that match a certain selection criteria. The criteria mask is passed as a combination of :obj:`~gi.repository.GObject.SignalMatchType` flags, and the criteria values are passed as arguments. A handler must match on all flags set in ``mask`` to be unblocked (i.e. the match is conjunctive). Passing at least one of the :const:`~gi.repository.GObject.SignalMatchType.ID`, :const:`~gi.repository.GObject.SignalMatchType.CLOSURE`, :const:`~gi.repository.GObject.SignalMatchType.FUNC` or :const:`~gi.repository.GObject.SignalMatchType.DATA` match flags is required for successful matches. If no handlers were found, 0 is returned, the number of unblocked handlers otherwise. The match criteria should not apply to any handlers that are not currently blocked. Support for :const:`~gi.repository.GObject.SignalMatchType.ID` was added in GLib 2.78. :param instance: The instance to unblock handlers from. :param mask: Mask indicating which of ``signal_id``\, ``detail``\, ``closure``\, ``func`` and/or ``data`` the handlers have to match. :param signal_id: Signal the handlers have to be connected to. :param detail: Signal detail the handlers have to be connected to. :param closure: The closure the handlers will invoke. :param func: The C closure callback of the handlers (useless for non-C closures). :param data: The closure data of the handlers' closures. :return: The number of handlers that matched. .. function:: signal_has_handler_pending(instance: ~gi.repository.GObject.Object, signal_id: int, detail: int, may_be_blocked: bool) -> bool Returns whether there are any handlers connected to ``instance`` for the given signal id and detail. If ``detail`` is 0 then it will only match handlers that were connected without detail. If ``detail`` is non-zero then it will match handlers connected both without detail and with the given detail. This is consistent with how a signal emitted with ``detail`` would be delivered to those handlers. Since 2.46 this also checks for a non-default class closure being installed, as this is basically always what you want. One example of when you might use this is when the arguments to the signal are difficult to compute. A class implementor may opt to not emit the signal if no one is attached anyway, thus saving the cost of building the arguments. :param instance: the object whose signal handlers are sought. :param signal_id: the signal id. :param detail: the detail. :param may_be_blocked: whether blocked handlers should count as match. :return: :const:`True` if a handler is connected to the signal, :const:`False` otherwise. .. function:: signal_is_valid_name(name: str) -> bool Validate a signal name. This can be useful for dynamically-generated signals which need to be validated at run-time before actually trying to create them. See :obj:`~gi.repository.GObject.signal_new` for details of the rules for valid names. The rules for signal names are the same as those for property names. .. versionadded:: 2.66 :param name: the canonical name of the signal :return: :const:`True` if ``name`` is a valid signal name, :const:`False` otherwise. .. function:: signal_list_ids(type_) Lists the signals by id that a certain instance or interface type created. Further information about the signals can be acquired through :func:`~gi.repository.GObject.signal_query`. :param type_: :return: Newly allocated array of signal IDs. .. function:: signal_list_names(type_) :param type_: .. function:: signal_lookup(name, type_) Given the name of the signal and the type of object it connects to, gets the signal's identifying integer. Emitting the signal by number is somewhat faster than using the name each time. Also tries the ancestors of the given type. The type class passed as ``itype`` must already have been instantiated (for example, using :func:`~gi.repository.GObject.TypeClass.ref`) for this function to work, as signals are always installed during class initialization. See :func:`~gi.repository.GObject.signal_new` for details on allowed signal names. :param name: the signal's name. :param type_: :return: the signal's identifying number, or 0 if no signal was found. .. function:: signal_name(signal_id: int) -> str | None Given the signal's identifier, finds its name. Two different signals may have the same name, if they have differing types. :param signal_id: the signal's identifying number. :return: the signal name, or :const:`None` if the signal number was invalid. .. function:: signal_new(signal_name: str, itype: type[~gi.repository.GObject.Object], signal_flags: ~gi.repository.GObject.SignalFlags, return_type: type, param_types: ~typing.Sequence[~gobject.GType]) -> int Creates a new signal. (This is usually done in the class initializer.) A signal name consists of segments consisting of ASCII letters and digits, separated by either the ``-`` or ``_`` character. The first character of a signal name must be a letter. Names which violate these rules lead to undefined behaviour. These are the same rules as for property naming (see :func:`~gi.repository.GObject.ParamSpec.internal`). When registering a signal and looking up a signal, either separator can be used, but they cannot be mixed. Using ``-`` is considerably more efficient. Using ``_`` is discouraged. If 0 is used for ``class_offset`` subclasses cannot override the class handler in their class_init method by doing super_class->signal_handler = my_signal_handler. Instead they will have to use :func:`~gi.repository.GObject.signal_override_class_handler`. If ``c_marshaller`` is :const:`None`, :func:`~gi.repository.GObject.CClosure.marshal_generic` will be used as the marshaller for this signal. In some simple cases, :func:`~gi.repository.GObject.signal_new` will use a more optimized c_marshaller and va_marshaller for the signal instead of :func:`~gi.repository.GObject.CClosure.marshal_generic`. If ``c_marshaller`` is non-:const:`None`, you need to also specify a va_marshaller using :func:`~gi.repository.GObject.signal_set_va_marshaller` or the generic va_marshaller will be used. :param signal_name: the name for the signal :param itype: the type this signal pertains to. It will also pertain to types which are derived from this type. :param signal_flags: a combination of :obj:`~gi.repository.GObject.SignalFlags` specifying detail of when the default handler is to be invoked. You should at least specify :const:`~gi.repository.GObject.SignalFlags.RUN_FIRST` or :const:`~gi.repository.GObject.SignalFlags.RUN_LAST`. :param return_type: the type of return value, or %G_TYPE_NONE for a signal without a return value. :param param_types: :return: the signal id .. function:: signal_override_class_closure(signal_id: int, instance_type: ~gobject.GType, class_closure: ~gi.repository.GObject.Closure) -> None Overrides the class closure (i.e. the default handler) for the given signal for emissions on instances of ``instance_type``\. ``instance_type`` must be derived from the type to which the signal belongs. See :func:`~gi.repository.GObject.signal_chain_from_overridden` and :func:`~gi.repository.GObject.signal_chain_from_overridden_handler` for how to chain up to the parent class closure from inside the overridden one. :param signal_id: the signal id :param instance_type: the instance type on which to override the class closure for the signal. :param class_closure: the closure. .. function:: signal_override_class_handler(signal_name: str, instance_type: ~gobject.GType, class_handler: ~typing.Callable[[], None]) -> None Overrides the class closure (i.e. the default handler) for the given signal for emissions on instances of ``instance_type`` with callback ``class_handler``\. ``instance_type`` must be derived from the type to which the signal belongs. See :func:`~gi.repository.GObject.signal_chain_from_overridden` and :func:`~gi.repository.GObject.signal_chain_from_overridden_handler` for how to chain up to the parent class closure from inside the overridden one. .. versionadded:: 2.18 :param signal_name: the name for the signal :param instance_type: the instance type on which to override the class handler for the signal. :param class_handler: the handler. .. function:: signal_parse_name(detailed_signal, itype, force_detail_quark) Parse a detailed signal name into (signal_id, detail). :param str detailed_signal: Signal name which can include detail. For example: "notify:prop_name" :returns: Tuple of (signal_id, detail) :raises ValueError: If the given signal is unknown. .. function:: signal_query(id_or_name, type_=None) Queries the signal system for in-depth information about a specific signal. This function will fill in a user-provided structure to hold signal-specific information. If an invalid signal id is passed in, the ``signal_id`` member of the :obj:`~gi.repository.GObject.SignalQuery` is 0. All members filled into the :obj:`~gi.repository.GObject.SignalQuery` structure should be considered constant and have to be left untouched. :param id_or_name: :param type_: .. function:: signal_remove_emission_hook(signal_id: int, hook_id: int) -> None Deletes an emission hook. :param signal_id: the id of the signal :param hook_id: the id of the emission hook, as returned by :func:`~gi.repository.GObject.signal_add_emission_hook` .. function:: signal_stop_emission(instance: ~gi.repository.GObject.Object, signal_id: int, detail: int) -> None Stops a signal's current emission. This will prevent the default method from running, if the signal was :const:`~gi.repository.GObject.SignalFlags.RUN_LAST` and you connected normally (i.e. without the "after" flag). Prints a warning if used on a signal which isn't being emitted. :param instance: the object whose signal handlers you wish to stop. :param signal_id: the signal identifier, as returned by :func:`~gi.repository.GObject.signal_lookup`. :param detail: the detail which the signal was emitted with. .. function:: signal_stop_emission_by_name(instance: ~gi.repository.GObject.Object, detailed_signal: str) -> None Stops a signal's current emission. This is just like :func:`~gi.repository.GObject.signal_stop_emission` except it will look up the signal id for you. :param instance: the object whose signal handlers you wish to stop. :param detailed_signal: a string of the form "signal-name::detail". .. function:: signal_type_cclosure_new(itype: ~gobject.GType, struct_offset: int) -> ~gi.repository.GObject.Closure Creates a new closure which invokes the function found at the offset ``struct_offset`` in the class structure of the interface or classed type identified by ``itype``\. :param itype: the :obj:`~gi.repository.GObject.Type` identifier of an interface or classed type :param struct_offset: the offset of the member function of ``itype``\'s class structure which is to be invoked by the new closure :return: a floating reference to a new ``GCClosure`` .. function:: source_remove(tag: int) -> bool .. deprecated:: PyGObject-3.16.0 GObject.source_remove is deprecated; use GLib.source_remove instead :param tag: .. function:: source_set_closure(source: ~gi.repository.GLib.Source, closure: ~gi.repository.GObject.Closure) -> None Set the callback for a source as a :obj:`~gi.repository.GObject.Closure`\. If the source is not one of the standard GLib types, the ``closure_callback`` and ``closure_marshal`` fields of the :obj:`~gi.repository.GLib.SourceFuncs` structure must have been filled in with pointers to appropriate functions. :param source: the source :param closure: a :obj:`~gi.repository.GObject.Closure` .. function:: source_set_dummy_callback(source: ~gi.repository.GLib.Source) -> None Sets a dummy callback for ``source``\. The callback will do nothing, and if the source expects a :obj:`~gi.repository.gboolean` return value, it will return :const:`True`. (If the source expects any other type of return value, it will return a 0/:const:`None` value; whatever :func:`~gi.repository.GObject.Value.init` initializes a :obj:`~gi.repository.GObject.Value` to for that type.) If the source is not one of the standard GLib types, the ``closure_callback`` and ``closure_marshal`` fields of the :obj:`~gi.repository.GLib.SourceFuncs` structure must have been filled in with pointers to appropriate functions. :param source: the source .. function:: spawn_async(argv: ~typing.Sequence[str], envp: ~typing.Sequence[str] | None = None, working_directory: str | None = None, flags: ~gi.repository.GLib.SpawnFlags = , child_setup: ~typing.Callable[[~typing.Any], None] | None = None, user_data: ~typing.Any = None, standard_input: bool = False, standard_output: bool = False, standard_error: bool = False) -> tuple[~gi._gi.Pid, int | None, int | None, int | None] spawn_async(argv, envp=None, working_directory=None, flags=0, child_setup=None, user_data=None, standard_input=None, standard_output=None, standard_error=None) -> (pid, stdin, stdout, stderr) Execute a child program asynchronously within a glib.MainLoop() See the reference manual for a complete reference. .. deprecated:: PyGObject-3.16.0 GObject.spawn_async is deprecated; use GLib.spawn_async instead :param argv: :param envp: :param working_directory: :param flags: :param child_setup: :param user_data: :param standard_input: :param standard_output: :param standard_error: .. function:: strdup_value_contents(value: ~gi.repository.GObject.Value) -> str Return a newly allocated string, which describes the contents of a :obj:`~gi.repository.GObject.Value`\. The main purpose of this function is to describe :obj:`~gi.repository.GObject.Value` contents for debugging output, the way in which the contents are described may change between different GLib versions. :param value: :obj:`~gi.repository.GObject.Value` which contents are to be described. :return: Newly allocated string. .. function:: threads_init() .. function:: timeout_add(interval, function, *user_data, priority=0) .. deprecated:: PyGObject-3.16.0 GObject.timeout_add is deprecated; use GLib.timeout_add instead :param interval: :param function: :param user_data: :param priority: .. function:: timeout_add_seconds(interval, function, *user_data, priority=0) .. deprecated:: PyGObject-3.16.0 GObject.timeout_add_seconds is deprecated; use GLib.timeout_add_seconds instead :param interval: :param function: :param user_data: :param priority: .. function:: type_add_class_private(class_type: ~gobject.GType, private_size: int) -> None Registers a private class structure for a classed type; when the class is allocated, the private structures for the class and all of its parent types are allocated sequentially in the same memory block as the public structures, and are zero-filled. This function should be called in the type's get_type() function after the type is registered. The private structure can be retrieved using the :func:`~gi.repository.GObject.TYPE_CLASS_GET_PRIVATE` macro. .. versionadded:: 2.24 :param class_type: GType of a classed type :param private_size: size of private structure .. function:: type_add_instance_private(class_type: ~gobject.GType, private_size: int) -> int :param class_type: :param private_size: .. function:: type_add_interface_dynamic(instance_type: ~gobject.GType, interface_type: ~gobject.GType, plugin: ~gi.repository.GObject.TypePlugin) -> None Adds ``interface_type`` to the dynamic ``instance_type``\. The information contained in the :obj:`~gi.repository.GObject.TypePlugin` structure pointed to by ``plugin`` is used to manage the relationship. :param instance_type: :obj:`~gi.repository.GObject.Type` value of an instantiatable type :param interface_type: :obj:`~gi.repository.GObject.Type` value of an interface type :param plugin: :obj:`~gi.repository.GObject.TypePlugin` structure to retrieve the :obj:`~gi.repository.GObject.InterfaceInfo` from .. function:: type_add_interface_static(instance_type: ~gobject.GType, interface_type: ~gobject.GType, info: ~gi.repository.GObject.InterfaceInfo) -> None Adds ``interface_type`` to the static ``instance_type``\. The information contained in the :obj:`~gi.repository.GObject.InterfaceInfo` structure pointed to by ``info`` is used to manage the relationship. :param instance_type: :obj:`~gi.repository.GObject.Type` value of an instantiatable type :param interface_type: :obj:`~gi.repository.GObject.Type` value of an interface type :param info: :obj:`~gi.repository.GObject.InterfaceInfo` structure for this (``instance_type``\, ``interface_type``\) combination .. function:: type_check_class_is_a(g_class: ~gi.repository.GObject.TypeClass, is_a_type: ~gobject.GType) -> bool :param g_class: :param is_a_type: .. function:: type_check_instance(instance: ~gi.repository.GObject.TypeInstance) -> bool Private helper function to aid implementation of the :func:`~gi.repository.GObject.TYPE_CHECK_INSTANCE` macro. :param instance: a valid :obj:`~gi.repository.GObject.TypeInstance` structure :return: :const:`True` if ``instance`` is valid, :const:`False` otherwise .. function:: type_check_instance_is_a(instance: ~gi.repository.GObject.TypeInstance, iface_type: ~gobject.GType) -> bool :param instance: :param iface_type: .. function:: type_check_instance_is_fundamentally_a(instance: ~gi.repository.GObject.TypeInstance, fundamental_type: ~gobject.GType) -> bool :param instance: :param fundamental_type: .. function:: type_check_is_value_type(type: ~gobject.GType) -> bool :param type: .. function:: type_check_value(value: ~gi.repository.GObject.Value) -> bool :param value: .. function:: type_check_value_holds(value: ~gi.repository.GObject.Value, type: ~gobject.GType) -> bool :param value: :param type: .. function:: type_children(type: ~gobject.GType) -> list[~gobject.GType] Return a newly allocated and 0-terminated array of type IDs, listing the child types of ``type``\. :param type: the parent type :return: Newly allocated and 0-terminated array of child types, free with :func:`~gi.repository.GLib.free` .. function:: type_class_adjust_private_offset(g_class: ~typing.Any, private_size_or_offset: int) -> None :param g_class: :param private_size_or_offset: .. function:: type_class_peek(type: ~gobject.GType) -> ~gi.repository.GObject.TypeClass :param type: .. function:: type_class_peek_static(type: ~gobject.GType) -> ~gi.repository.GObject.TypeClass :param type: .. function:: type_default_interface_peek(g_type: ~gobject.GType) -> ~gi.repository.GObject.TypeInterface If the interface type ``g_type`` is currently in use, returns its default interface vtable. .. versionadded:: 2.4 :param g_type: an interface type :return: the default vtable for the interface, or :const:`None` if the type is not currently in use .. function:: type_depth(type: ~gobject.GType) -> int Returns the length of the ancestry of the passed in type. This includes the type itself, so that e.g. a fundamental type has depth 1. :param type: a :obj:`~gi.repository.GObject.Type` :return: the depth of ``type`` .. function:: type_ensure(type: ~gobject.GType) -> None Ensures that the indicated ``type`` has been registered with the type system, and its _class_init() method has been run. In theory, simply calling the type's _get_type() method (or using the corresponding macro) is supposed take care of this. However, _get_type() methods are often marked %G_GNUC_CONST for performance reasons, even though this is technically incorrect (since %G_GNUC_CONST requires that the function not have side effects, which _get_type() methods do on the first call). As a result, if you write a bare call to a _get_type() macro, it may get optimized out by the compiler. Using :func:`~gi.repository.GObject.type_ensure` guarantees that the type's _get_type() method is called. .. versionadded:: 2.34 :param type: a :obj:`~gi.repository.GObject.Type` .. function:: type_free_instance(instance: ~gi.repository.GObject.TypeInstance) -> None Frees an instance of a type, returning it to the instance pool for the type, if there is one. Like :func:`~gi.repository.GObject.type_create_instance`, this function is reserved for implementors of fundamental types. :param instance: an instance of a type .. function:: type_from_name(name) Look up the type ID from a given type name, returning 0 if no type has been registered under this name (this is the preferred method to find out by name whether a specific type has been registered yet). :param name: type name to look up :return: corresponding type ID or 0 .. function:: type_fundamental(type_id: ~gobject.GType) -> ~gobject.GType Internal function, used to extract the fundamental type ID portion. Use :func:`~gi.repository.GObject.TYPE_FUNDAMENTAL` instead. :param type_id: valid type ID :return: fundamental type ID .. function:: type_fundamental_next() -> ~gobject.GType Returns the next free fundamental type id which can be used to register a new fundamental type with :func:`~gi.repository.GObject.type_register_fundamental`. The returned type ID represents the highest currently registered fundamental type identifier. :return: the next available fundamental type ID to be registered, or 0 if the type system ran out of fundamental type IDs .. function:: type_get_instance_count(type: ~gobject.GType) -> int Returns the number of instances allocated of the particular type; this is only available if GLib is built with debugging support and the ``instance-count`` debug flag is set (by setting the ``GOBJECT_DEBUG`` variable to include ``instance-count``\). .. versionadded:: 2.44 :param type: a :obj:`~gi.repository.GObject.Type` :return: the number of instances allocated of the given type; if instance counts are not available, returns 0. .. function:: type_get_plugin(type: ~gobject.GType) -> ~gi.repository.GObject.TypePlugin Returns the :obj:`~gi.repository.GObject.TypePlugin` structure for ``type``\. :param type: :obj:`~gi.repository.GObject.Type` to retrieve the plugin for :return: the corresponding plugin if ``type`` is a dynamic type, :const:`None` otherwise .. function:: type_get_qdata(type: ~gobject.GType, quark: int) -> ~typing.Any | None Obtains data which has previously been attached to ``type`` with :func:`~gi.repository.GObject.type_set_qdata`. Note that this does not take subtyping into account; data attached to one type with :func:`~gi.repository.GObject.type_set_qdata` cannot be retrieved from a subtype using :func:`~gi.repository.GObject.type_get_qdata`. :param type: a :obj:`~gi.repository.GObject.Type` :param quark: a :obj:`~gi.repository.GLib.Quark` id to identify the data :return: the data, or :const:`None` if no data was found .. function:: type_get_type_registration_serial() -> int Returns an opaque serial number that represents the state of the set of registered types. Any time a type is registered this serial changes, which means you can cache information based on type lookups (such as :func:`~gi.repository.GObject.type_from_name`) and know if the cache is still valid at a later time by comparing the current serial with the one at the type lookup. .. versionadded:: 2.36 :return: An unsigned int, representing the state of type registrations .. function:: type_init() -> None This function used to initialise the type system. Since GLib 2.36, the type system is initialised automatically and this function does nothing. .. deprecated:: 2.36 the type system is now initialised automatically .. function:: type_init_with_debug_flags(debug_flags: ~gi.repository.GObject.TypeDebugFlags) -> None This function used to initialise the type system with debugging flags. Since GLib 2.36, the type system is initialised automatically and this function does nothing. If you need to enable debugging features, use the ``GOBJECT_DEBUG`` environment variable. .. deprecated:: 2.36 the type system is now initialised automatically :param debug_flags: bitwise combination of :obj:`~gi.repository.GObject.TypeDebugFlags` values for debugging purposes .. function:: type_interface_add_prerequisite(interface_type: ~gobject.GType, prerequisite_type: ~gobject.GType) -> None :param interface_type: :param prerequisite_type: .. function:: type_interface_get_plugin(instance_type: ~gobject.GType, interface_type: ~gobject.GType) -> ~gi.repository.GObject.TypePlugin :param instance_type: :param interface_type: .. function:: type_interface_instantiatable_prerequisite(interface_type: ~gobject.GType) -> ~gobject.GType :param interface_type: .. function:: type_interface_peek(instance_class: ~gi.repository.GObject.TypeClass, iface_type: ~gobject.GType) -> ~gi.repository.GObject.TypeInterface :param instance_class: :param iface_type: .. function:: type_interface_prerequisites(interface_type: ~gobject.GType) -> list[~gobject.GType] :param interface_type: .. function:: type_interfaces(type: ~gobject.GType) -> list[~gobject.GType] Return a newly allocated and 0-terminated array of type IDs, listing the interface types that ``type`` conforms to. :param type: the type to list interface types for :return: Newly allocated and 0-terminated array of interface types, free with :func:`~gi.repository.GLib.free` .. function:: type_is_a(type: ~gobject.GType, is_a_type: ~gobject.GType) -> bool If ``is_a_type`` is a derivable type, check whether ``type`` is a descendant of ``is_a_type``\. If ``is_a_type`` is an interface, check whether ``type`` conforms to it. :param type: type to check ancestry for :param is_a_type: possible ancestor of ``type`` or interface that ``type`` could conform to :return: :const:`True` if ``type`` is a ``is_a_type`` .. function:: type_name(type: ~gobject.GType) -> str | None Get the unique name that is assigned to a type ID. Note that this function (like all other GType API) cannot cope with invalid type IDs. ``Invalid`` may be passed to this function, as may be any other validly registered type ID, but randomized type IDs should not be passed in and will most likely lead to a crash. :param type: type to return name for :return: static type name or :const:`None` .. function:: type_name_from_class(g_class: ~gi.repository.GObject.TypeClass) -> str :param g_class: .. function:: type_name_from_instance(instance: ~gi.repository.GObject.TypeInstance) -> str :param instance: .. function:: type_next_base(leaf_type: ~gobject.GType, root_type: ~gobject.GType) -> ~gobject.GType Given a ``leaf_type`` and a ``root_type`` which is contained in its ancestry, return the type that ``root_type`` is the immediate parent of. In other words, this function determines the type that is derived directly from ``root_type`` which is also a base class of ``leaf_type``\. Given a root type and a leaf type, this function can be used to determine the types and order in which the leaf type is descended from the root type. :param leaf_type: descendant of ``root_type`` and the type to be returned :param root_type: immediate parent of the returned type :return: immediate child of ``root_type`` and ancestor of ``leaf_type`` .. function:: type_parent(type_) Return the direct parent type of the passed in type. If the passed in type has no parent, i.e. is a fundamental type, 0 is returned. :param type_: :return: the parent type .. function:: type_qname(type: ~gobject.GType) -> int Get the corresponding quark of the type IDs name. :param type: type to return quark of type name for :return: the type names quark or 0 .. function:: type_query(type: ~gobject.GType) -> ~gi.repository.GObject.TypeQuery Queries the type system for information about a specific type. This function will fill in a user-provided structure to hold type-specific information. If an invalid :obj:`~gi.repository.GObject.Type` is passed in, the ``type`` member of the :obj:`~gi.repository.GObject.TypeQuery` is 0. All members filled into the :obj:`~gi.repository.GObject.TypeQuery` structure should be considered constant and have to be left untouched. Since GLib 2.78, this function allows queries on dynamic types. Previously it only supported static types. :param type: :obj:`~gi.repository.GObject.Type` of a static, classed type .. function:: type_register(type) -> ~gobject.GType :param type: .. function:: type_register_dynamic(parent_type: ~gobject.GType, type_name: str, plugin: ~gi.repository.GObject.TypePlugin, flags: ~gi.repository.GObject.TypeFlags) -> ~gobject.GType Registers ``type_name`` as the name of a new dynamic type derived from ``parent_type``\. The type system uses the information contained in the :obj:`~gi.repository.GObject.TypePlugin` structure pointed to by ``plugin`` to manage the type and its instances (if not abstract). The value of ``flags`` determines the nature (e.g. abstract or not) of the type. :param parent_type: type from which this type will be derived :param type_name: 0-terminated string used as the name of the new type :param plugin: :obj:`~gi.repository.GObject.TypePlugin` structure to retrieve the :obj:`~gi.repository.GObject.TypeInfo` from :param flags: bitwise combination of :obj:`~gi.repository.GObject.TypeFlags` values :return: the new type identifier or ``Invalid`` if registration failed .. function:: type_register_fundamental(type_id: ~gobject.GType, type_name: str, info: ~gi.repository.GObject.TypeInfo, finfo: ~gi.repository.GObject.TypeFundamentalInfo, flags: ~gi.repository.GObject.TypeFlags) -> ~gobject.GType Registers ``type_id`` as the predefined identifier and ``type_name`` as the name of a fundamental type. If ``type_id`` is already registered, or a type named ``type_name`` is already registered, the behaviour is undefined. The type system uses the information contained in the :obj:`~gi.repository.GObject.TypeInfo` structure pointed to by ``info`` and the :obj:`~gi.repository.GObject.TypeFundamentalInfo` structure pointed to by ``finfo`` to manage the type and its instances. The value of ``flags`` determines additional characteristics of the fundamental type. :param type_id: a predefined type identifier :param type_name: 0-terminated string used as the name of the new type :param info: :obj:`~gi.repository.GObject.TypeInfo` structure for this type :param finfo: :obj:`~gi.repository.GObject.TypeFundamentalInfo` structure for this type :param flags: bitwise combination of :obj:`~gi.repository.GObject.TypeFlags` values :return: the predefined type identifier .. function:: type_register_static(parent_type: ~gobject.GType, type_name: str, info: ~gi.repository.GObject.TypeInfo, flags: ~gi.repository.GObject.TypeFlags) -> ~gobject.GType Registers ``type_name`` as the name of a new static type derived from ``parent_type``\. The type system uses the information contained in the :obj:`~gi.repository.GObject.TypeInfo` structure pointed to by ``info`` to manage the type and its instances (if not abstract). The value of ``flags`` determines the nature (e.g. abstract or not) of the type. :param parent_type: type from which this type will be derived :param type_name: 0-terminated string used as the name of the new type :param info: :obj:`~gi.repository.GObject.TypeInfo` structure for this type :param flags: bitwise combination of :obj:`~gi.repository.GObject.TypeFlags` values :return: the new type identifier .. function:: type_set_qdata(type: ~gobject.GType, quark: int, data: ~typing.Any = None) -> None Attaches arbitrary data to a type. :param type: a :obj:`~gi.repository.GObject.Type` :param quark: a :obj:`~gi.repository.GLib.Quark` id to identify the data :param data: the data .. function:: type_test_flags(type: ~gobject.GType, flags: int) -> bool :param type: :param flags: .. function:: uri_list_extract_uris(uri_list: str) -> list[str] .. deprecated:: PyGObject-3.16.0 GObject.uri_list_extract_uris is deprecated; use GLib.uri_list_extract_uris instead :param uri_list: .. function:: value_type_compatible(src_type: ~gobject.GType, dest_type: ~gobject.GType) -> bool :param src_type: :param dest_type: .. function:: value_type_transformable(src_type: ~gobject.GType, dest_type: ~gobject.GType) -> bool :param src_type: :param dest_type: .. function:: variant_get_gtype() -> ~gobject.GType