Function glib::subclass::types::register_dynamic_type

source ·
pub fn register_dynamic_type<P: DynamicObjectRegisterExt, T: ObjectSubclass>(
    type_plugin: &P,
) -> Type
Expand description

Registers a glib::Type ID for T as a dynamic type.

An object subclass must be explicitly registered as a dynamic type when the system loads the implementation by calling TypePluginImpl::use_ or more specifically TypeModuleImpl::load. Therefore, unlike for object subclasses registered as static types, object subclasses registered as dynamic types can be registered several times.

The object_subclass_dynamic! macro helper attribute will create register_type() and on_implementation_load() functions around this, which will ensure that the function is called when necessary.