WpPlugin is a base class for objects that provide functionality to the WirePlumber daemon.
Typically, a plugin is created within a module and then registered to make it available for use by the daemon. The daemon is responsible for calling wp_object_activate() on it after all modules have been loaded, the core is connected and the initial discovery of global objects is done.
Being a WpObject subclass, the plugin inherits WpObject’s activation system. For most implementations, there is only need for activating one feature, WP_PLUGIN_FEATURE_ENABLED, and this can be done by implementing only WpPluginClass::enable() and WpPluginClass::disable(). For more advanced plugins that need to have more features, you may implement directly the functions of WpObjectClass and ignore the ones of WpPluginClass.
The name of this plugin
G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY
void (*enable)(WpPlugin *self, WpTransition *transition)
Enables the plugin. The plugin is required to start any operations only when this method is called and not before.
When enabling the plugin is done, you must call wp_object_update_features() with WP_PLUGIN_FEATURE_ENABLED marked as activated, or return an error on transition.
- Param self
- Param transition
the activation transition
- WpObjectClass parent_class
Flags to be used as WpObjectFeatures on WpPlugin subclasses.
enumerator WP_PLUGIN_FEATURE_ENABLED = (1 << 0)
enables the plugin
- enumerator WP_PLUGIN_FEATURE_ENABLED = (1 << 0)
void wp_plugin_register(WpPlugin *plugin)
Registers the plugin to its associated core, making it available for use.
plugin – (transfer full): the plugin
WpPlugin *wp_plugin_find(WpCore *core, const gchar *plugin_name)
Looks up a plugin.
core – the core
plugin_name – the lookup name
(transfer full) (nullable): the plugin matching the lookup name
const gchar *wp_plugin_get_name(WpPlugin *self)
Retreives the name of a plugin.
self – the plugin
the name of this plugin
WP_TYPE_PLUGIN (wp_plugin_get_type ())
The WpPlugin GType.