Plugin Objects

Plugin Objects — abstract plugin implementation

Functions

Properties

char * filename Read / Write / Construct Only
GPluginPluginInfo * info Read / Write / Construct Only
GPluginLoader * loader Read / Write / Construct Only
GPluginPluginState state Read / Write / Construct

Signals

Types and Values

Object Hierarchy

    GInterface
    ╰── GPluginPlugin

Known Implementations

GPluginPlugin is implemented by GPluginNativePlugin.

Description

GPluginPlugin is an abstract class that tracks the state of a plugin. It is subclassed by each loader for them to add additional data for their implementation.

Functions

gplugin_plugin_get_filename ()

gchar *
gplugin_plugin_get_filename (GPluginPlugin *plugin);

Returns the filename that plugin was loaded from.

Parameters

plugin

GPluginPlugin instance

 

Returns

The filename of plugin .

[transfer full]

gplugin_plugin_get_loader ()

GPluginLoader *
gplugin_plugin_get_loader (GPluginPlugin *plugin);

Returns the GPluginLoader that loaded plugin .

Parameters

plugin

GPluginPlugin instance

 

Returns

The GPluginLoader that loaded plugin .

[transfer full]

gplugin_plugin_get_info ()

GPluginPluginInfo *
gplugin_plugin_get_info (GPluginPlugin *plugin);

Returns the GPluginPluginInfo for plugin .

Parameters

plugin

GPluginPlugin instance

 

Returns

The GPluginPluginInfo instance for plugin .

[transfer full]

gplugin_plugin_get_state ()

GPluginPluginState
gplugin_plugin_get_state (GPluginPlugin *plugin);

Gets the current state of plugin

Parameters

plugin

GPluginPlugin instance

 

Returns

The current state of plugin .

[transfer full]

gplugin_plugin_set_state ()

void
gplugin_plugin_set_state (GPluginPlugin *plugin,
                          GPluginPluginState state);

Changes the state of plugin to state . This function should only be called by loaders.

Parameters

plugin

GPluginPlugin instance

 

state

new GPluginPluginState for plugin

 

Types and Values

enum GPluginPluginState

The expected states of a plugin.

Members

GPLUGIN_PLUGIN_STATE_UNKNOWN

The state of the plugin is unknown

 

GPLUGIN_PLUGIN_STATE_ERROR

There was an error loading or unloading the plugin

 

GPLUGIN_PLUGIN_STATE_QUERIED

The plugin has been queried but not loaded

 

GPLUGIN_PLUGIN_STATE_REQUERY

The plugin should be requeried

 

GPLUGIN_PLUGIN_STATE_LOADED

The plugin is loaded

 

GPLUGIN_PLUGIN_STATE_LOAD_FAILED

The plugin failed to load

 

GPLUGIN_TYPE_PLUGIN

#define GPLUGIN_TYPE_PLUGIN (gplugin_plugin_get_type())

The standard _get_type macro for GPluginPlugin.

struct GPluginPluginInterface

struct GPluginPluginInterface {
	void (*state_changed)(GPluginPlugin *plugin, GPluginPluginState oldstate, GPluginPluginState newstate);
};

The interface that defines the behavior of plugins, including properties and signals.

Members

state_changed ()

The class closure for the “state-changed” signal.

 

GPluginPlugin

typedef struct _GPluginPlugin GPluginPlugin;

GPluginPlugin is an opaque data structure and should not be used directly.

Property Details

The “filename” property

  “filename”                 char *

The absolute path to the plugin on disk.

Owner: GPluginPlugin

Flags: Read / Write / Construct Only

Default value: NULL

The “info” property

  “info”                     GPluginPluginInfo *

The GPluginPluginInfo from this plugin.

Owner: GPluginPlugin

Flags: Read / Write / Construct Only

The “loader” property

  “loader”                   GPluginLoader *

The GPluginLoader that loaded this plugin.

Owner: GPluginPlugin

Flags: Read / Write / Construct Only

The “state” property

  “state”                    GPluginPluginState

The GPluginPluginState that this plugin is in.

Owner: GPluginPlugin

Flags: Read / Write / Construct

Default value: GPLUGIN_PLUGIN_STATE_UNKNOWN

Signal Details

The “state-changed” signal

void
user_function (GPluginPlugin     *plugin,
               GPluginPluginState oldstate,
               GPluginPluginState newstate,
               gpointer           user_data)

Emitted when plugin changes state.

Parameters

plugin

The GPluginPlugin that changed states.

 

oldstate

The old GPluginPluginState.

 

newstate

The new state of plugin .

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last