Synopsis#include <glib-object.h> GTypePlugin; GTypePluginClass; void (*GTypePluginUse) (GTypePlugin *plugin); void (*GTypePluginUnuse) (GTypePlugin *plugin); void (*GTypePluginCompleteTypeInfo) (GTypePlugin *plugin, GType g_type, GTypeInfo *info, GTypeValueTable *value_table); void (*GTypePluginCompleteInterfaceInfo) (GTypePlugin *plugin, GType instance_type, GType interface_type, GInterfaceInfo *info); void g_type_plugin_use (GTypePlugin *plugin); void g_type_plugin_unuse (GTypePlugin *plugin); void g_type_plugin_complete_type_info (GTypePlugin *plugin, GType g_type, GTypeInfo *info, GTypeValueTable *value_table); void g_type_plugin_complete_interface_info (GTypePlugin *plugin, GType instance_type, GType interface_type, GInterfaceInfo *info); DescriptionThe GObject type system supports dynamic loading of types. The GTypePlugin interface is used to handle the lifecycle of dynamically loaded types. It goes as follows:
So basically, you need to implement a GTypePlugin type that
carries a use_count, once use_count goes from zero to one, you need
to load the implementation to successfully handle the upcoming
GTypeModule is an implementation of GTypePlugin that already implements most of this except for the actual module loading and unloading. It even handles multiple registered types per module.
DetailsGTypePlugintypedef struct _GTypePlugin GTypePlugin; The GTypePlugin typedef is used as a placeholder for objects that implement the GTypePlugin interface.
GTypePluginClasstypedef struct { GTypePluginUse use_plugin; GTypePluginUnuse unuse_plugin; GTypePluginCompleteTypeInfo complete_type_info; GTypePluginCompleteInterfaceInfo complete_interface_info; } GTypePluginClass; The GTypePlugin interface is used by the type system in order to handle the lifecycle of dynamically loaded types.
GTypePluginUse ()void (*GTypePluginUse) (GTypePlugin *plugin);
The type of the
GTypePluginUnuse ()void (*GTypePluginUnuse) (GTypePlugin *plugin);
The type of the
GTypePluginCompleteTypeInfo ()void (*GTypePluginCompleteTypeInfo) (GTypePlugin *plugin, GType g_type, GTypeInfo *info, GTypeValueTable *value_table);
The type of the
GTypePluginCompleteInterfaceInfo ()void (*GTypePluginCompleteInterfaceInfo) (GTypePlugin *plugin, GType instance_type, GType interface_type, GInterfaceInfo *info);
The type of the
g_type_plugin_use ()void g_type_plugin_use (GTypePlugin *plugin);
Calls the
g_type_plugin_unuse ()void g_type_plugin_unuse (GTypePlugin *plugin);
Calls the
g_type_plugin_complete_type_info ()void g_type_plugin_complete_type_info (GTypePlugin *plugin, GType g_type, GTypeInfo *info, GTypeValueTable *value_table);
Calls the
g_type_plugin_complete_interface_info ()void g_type_plugin_complete_interface_info (GTypePlugin *plugin, GType instance_type, GType interface_type, GInterfaceInfo *info);
Calls the
|