PeasActivatable

PeasActivatable — Interface for activatable extensions

Synopsis

                    PeasActivatable;
                    PeasActivatableInterface;
void                peas_activatable_activate           (PeasActivatable *activatable,
                                                         GObject *object);
void                peas_activatable_deactivate         (PeasActivatable *activatable,
                                                         GObject *object);
void                peas_activatable_update_state       (PeasActivatable *activatable,
                                                         GObject *object);

Object Hierarchy

  GInterface
   +----PeasActivatable

Prerequisites

PeasActivatable requires GObject.

Description

PeasActivatable is an interface which should be implemented by extensions that should be activated on an object of a certain type (depending on the application). For instance, in gedit, PeasActivatable extension instances are bound to individual windows.

It is typical to use PeasActivatable along with PeasExtensionSet in order to activate and deactivate extensions automatically when plugins are loaded or unloaded.

Details

PeasActivatable

typedef struct _PeasActivatable PeasActivatable;

PeasActivatableInterface

typedef struct {
  GTypeInterface g_iface;

  /* Virtual public methods */
  void        (*activate)                 (PeasActivatable *activatable,
                                           GObject         *object);
  void        (*deactivate)               (PeasActivatable *activatable,
                                           GObject         *object);
  void        (*update_state)             (PeasActivatable *activatable,
                                           GObject         *object);
} PeasActivatableInterface;

peas_activatable_activate ()

void                peas_activatable_activate           (PeasActivatable *activatable,
                                                         GObject *object);

Activates the extension on the given object.

activatable :

A PeasActivatable.

object :

The GObject on which the plugin should be activated.

peas_activatable_deactivate ()

void                peas_activatable_deactivate         (PeasActivatable *activatable,
                                                         GObject *object);

Deactivates the plugin on the given object.

activatable :

A PeasActivatable.

object :

A GObject.

peas_activatable_update_state ()

void                peas_activatable_update_state       (PeasActivatable *activatable,
                                                         GObject *object);

Triggers an update of the plugin's internal state to take into account state changes in the targetted object, due to a plugin or user action.

activatable :

A PeasActivatable.

object :

A GObject.

See Also

PeasExtensionSet