:right-sidebar: True TypeInterface =================================================================== .. currentmodule:: gi.repository.GObject .. class:: TypeInterface(*args, **kwargs) :no-contents-entry: An opaque structure used as the base of all interface types. Methods ------- .. rst-class:: interim-class .. class:: TypeInterface :no-index: .. method:: add_prerequisite(interface_type: type, prerequisite_type: type) -> None Adds ``prerequisite_type`` to the list of prerequisites of ``interface_type``. This means that any type implementing ``interface_type`` must also implement ``prerequisite_type``. Prerequisites can be thought of as an alternative to interface derivation (which GType doesn't support). An interface can have at most one instantiatable prerequisite type. :param interface_type: :obj:`~gi.repository.GObject.Type` value of an interface type :param prerequisite_type: :obj:`~gi.repository.GObject.Type` value of an interface or instantiatable type .. method:: get_plugin(instance_type: type, interface_type: type) -> ~gi.repository.GObject.TypePlugin Returns the :obj:`~gi.repository.GObject.TypePlugin` structure for the dynamic interface ``interface_type`` which has been added to ``instance_type``, or :const:`None` if ``interface_type`` has not been added to ``instance_type`` or does not have a :obj:`~gi.repository.GObject.TypePlugin` structure. See :func:`~gi.repository.GObject.type_add_interface_dynamic`. :param instance_type: :obj:`~gi.repository.GObject.Type` of an instantiatable type :param interface_type: :obj:`~gi.repository.GObject.Type` of an interface type .. method:: instantiatable_prerequisite(interface_type: type) -> type Returns the most specific instantiatable prerequisite of an interface type. If the interface type has no instantiatable prerequisite, ``Invalid`` is returned. See :func:`~gi.repository.GObject.TypeInterface.add_prerequisite` for more information about prerequisites. .. versionadded:: 2.68 :param interface_type: an interface type .. method:: peek(instance_class: ~gi.repository.GObject.TypeClass, iface_type: type) -> ~gi.repository.GObject.TypeInterface Returns the :obj:`~gi.repository.GObject.TypeInterface` structure of an interface to which the passed in class conforms. :param instance_class: a :obj:`~gi.repository.GObject.TypeClass` structure :param iface_type: an interface ID which this class conforms to .. method:: peek_parent() -> ~gi.repository.GObject.TypeInterface Returns the corresponding :obj:`~gi.repository.GObject.TypeInterface` structure of the parent type of the instance type to which ``g_iface`` belongs. This is useful when deriving the implementation of an interface from the parent type and then possibly overriding some methods. .. method:: prerequisites(interface_type: type) -> list[type] Returns the prerequisites of an interfaces type. .. versionadded:: 2.2 :param interface_type: an interface type Fields ------ .. rst-class:: interim-class .. class:: TypeInterface :no-index: .. attribute:: g_instance_type .. attribute:: g_type