TypeInterface#
- class TypeInterface(*args, **kwargs)#
An opaque structure used as the base of all interface types.
Methods#
- class TypeInterface
- classmethod add_prerequisite(interface_type: GType, prerequisite_type: GType) None#
Adds
prerequisite_typeto the list of prerequisites ofinterface_type. This means that any type implementinginterface_typemust also implementprerequisite_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.- Parameters:
interface_type –
Typevalue of an interface typeprerequisite_type –
Typevalue of an interface or instantiatable type
- classmethod get_plugin(instance_type: GType, interface_type: GType) TypePlugin#
Returns the
TypePluginstructure for the dynamic interfaceinterface_typewhich has been added toinstance_type, orNoneifinterface_typehas not been added toinstance_typeor does not have aTypePluginstructure. Seetype_add_interface_dynamic().- Parameters:
instance_type –
Typeof an instantiatable typeinterface_type –
Typeof an interface type
- classmethod instantiatable_prerequisite(interface_type: GType) GType#
Returns the most specific instantiatable prerequisite of an interface type. If the interface type has no instantiatable prerequisite,
Invalidis returned.See
add_prerequisite()for more information about prerequisites.Added in version 2.68.
- Parameters:
interface_type – an interface type
- classmethod peek(instance_class: TypeClass, iface_type: GType) TypeInterface | None#
Returns the
TypeInterfacestructure of an interface to which the passed in class conforms.- Parameters:
instance_class – a
TypeClassstructureiface_type – an interface ID which this class conforms to
- peek_parent() TypeInterface | None#
Returns the corresponding
TypeInterfacestructure of the parent type of the instance type to whichg_ifacebelongs.This is useful when deriving the implementation of an interface from the parent type and then possibly overriding some methods.