Plugins

digraph inheritance { rankdir=LR; GObject -> WpObject; WpObject -> WpPlugin; }

struct WpPlugin

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.

GObject Properties

struct _WpPluginClass

Public Members

WpObjectClass parent_class
voidenable)(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.

Parameters
  • self: the plugin

  • transition: the activation transition

voiddisable)(WpPlugin *self)

Disables the plugin. The plugin is required to stop all operations and release all resources associated with it.

Parameters
  • self: the plugin

enum wpplugin::WpPluginFeatures

Flags to be used as WpObjectFeatures on WpPlugin subclasses.

Values:

WP_PLUGIN_FEATURE_ENABLED = (1 << 0)

enables the plugin

WpPlugin * wp_plugin_find(WpCore * core, const gchar * plugin_name)

Looks up a plugin.

Return

(transfer full) (nullable): the plugin matching the lookup name

Parameters
  • core: the core

  • plugin_name: the lookup name

const gchar * wp_plugin_get_name(WpPlugin * self)

Retreives the name of a plugin.

Return

the name of this plugin

Parameters
  • self: the plugin

WP_TYPE_PLUGIN (wp_plugin_get_type ())

The WpPlugin GType.