Plugin Objects

Plugin Objects — abstract plugin implementation

Functions

Properties

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

Signals

void state-changed Run Last

Types and Values

Object Hierarchy

    GEnum
    ╰── GPluginPluginState
    GInterface
    ╰── GPluginPlugin

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

 

Property Details

The “filename” property

  “filename”                 gchar *

The absolute path to the plugin on disk.

Flags: Read / Write / Construct Only

Default value: NULL


The “info” property

  “info”                     GPluginPluginInfo *

The GPluginPluginInfo from this plugin.

Flags: Read / Write / Construct Only


The “loader” property

  “loader”                   GPluginLoader *

The GPluginLoader that loaded this plugin.

Flags: Read / Write / Construct Only


The “state” property

  “state”                    GPluginPluginState

The GPluginPluginState that this plugin is in.

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