Peas.ExtensionSet

g GObject.GInterface GObject.GInterface Gio.ListModel Gio.ListModel GObject.GInterface->Gio.ListModel GObject.Object GObject.Object Peas.ExtensionSet Peas.ExtensionSet GObject.Object->Peas.ExtensionSet Gio.ListModel->Peas.ExtensionSet

Subclasses:

None

Methods

Inherited:

GObject.Object (37), Gio.ListModel (4)

Structs:

GObject.ObjectClass (5)

class

new (engine, exten_type, prop_names, prop_values)

foreach (func, *data)

get_extension (info)

Virtual Methods

Inherited:

GObject.Object (7), Gio.ListModel (3)

do_call (method_name, args)

do_extension_added (info, exten)

do_extension_removed (info, exten)

Properties

Name

Type

Flags

Short Description

construct-properties

int

w/co

The properties to pass the extensions when creating them

engine

Peas.Engine

r/w/co

The Peas.Engine this set is attached to

extension-type

GObject.GType

r/w/co

The extension GObject.GType managed by this set

Signals

Inherited:

GObject.Object (1), Gio.ListModel (1)

Name

Short Description

extension-added

Emitted when a new extension has been added to the Peas.ExtensionSet.

extension-removed

Emitted when a new extension is about to be removed from the Peas.ExtensionSet.

Fields

Inherited:

GObject.Object (1), Gio.ListModel (1)

Name

Type

Access

Description

parent

GObject.Object

r

Class Details

class Peas.ExtensionSet(**kwargs)
Bases:

GObject.Object, Gio.ListModel

Abstract:

No

Structure:

Peas.ExtensionSetClass

The Peas.ExtensionSet structure contains only private data and should only be accessed using the provided API.

classmethod new(engine, exten_type, prop_names, prop_values)
Parameters:
Returns:

a new instance of Peas.ExtensionSet.

Return type:

Peas.ExtensionSet

Create a new Peas.ExtensionSet for the exten_type extension type.

If engine is None, then the default engine will be used.

Since libpeas 1.22, exten_type can be an Abstract [alias`GObject`.Type] and not just an Interface [alias`GObject`.Type].

See [ctor`ExtensionSet`.new] for more information.

foreach(func, *data)
Parameters:

Calls func for each [alias`Extension`].

New in version 1.2.

get_extension(info)
Parameters:

info (Peas.PluginInfo) – a Peas.PluginInfo

Returns:

a reference to a #PeasExtension

Return type:

GObject.Object or None

Returns the [alias`Extension`] object corresponding to info.

If the plugin doesn’t provide such an extension, it returns None.

do_call(method_name, args) virtual
Parameters:
Return type:

bool

do_extension_added(info, exten) virtual
Parameters:
do_extension_removed(info, exten) virtual
Parameters:

Signal Details

Peas.ExtensionSet.signals.extension_added(extension_set, info, exten)
Signal Name:

extension-added

Flags:

RUN_LAST

Parameters:

Emitted when a new extension has been added to the Peas.ExtensionSet.

It happens when a new plugin implementing the extension set’s extension type is loaded.

You should connect to this signal in order to set up the extensions when they are loaded. Note that this signal is not fired for extensions coming from plugins that were already loaded when the Peas.ExtensionSet instance was created. You should set those up by yourself.

Peas.ExtensionSet.signals.extension_removed(extension_set, info, exten)
Signal Name:

extension-removed

Flags:

RUN_LAST

Parameters:

Emitted when a new extension is about to be removed from the Peas.ExtensionSet.

It happens when a plugin implementing the extension set’s extension type is unloaded, or when the Peas.ExtensionSet itself is destroyed.

You should connect to this signal in order to clean up the extensions when their plugin is unload. Note that this signal is not fired for the [alias`Extension`] instances still available when the Peas.ExtensionSet instance is destroyed. You should clean those up by yourself.

Property Details

Peas.ExtensionSet.props.construct_properties
Name:

construct-properties

Type:

int

Default Value:

None

Flags:

WRITABLE, CONSTRUCT_ONLY

The properties to pass the extensions when creating them

Peas.ExtensionSet.props.engine
Name:

engine

Type:

Peas.Engine

Default Value:

None

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

The Peas.Engine this set is attached to

Peas.ExtensionSet.props.extension_type
Name:

extension-type

Type:

GObject.GType

Default Value:

<GType void>

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

The extension GObject.GType managed by this set