Method

PeasEnginecreate_extension

Declaration [src]

PeasExtension*
peas_engine_create_extension (
  PeasEngine* engine,
  PeasPluginInfo* info,
  GType extension_type,
  const gchar* first_property,
  ...
)

Description [src]

If the plugin identified by info implements the extension_type, then this function will return a new instance of this implementation, wrapped in a new PeasExtension instance. Otherwise, it will return NULL.

When creating the new instance of the extension_type subtype, the provided construct properties will be passed to the extension construction handler (exactly like if you had called g_object_new() yourself).

The new extension instance produced by this function will always be returned wrapped in a PeasExtension proxy, following the current libpeas principle of never giving you the actual object (also because it might as well not be an actual object).

Since libpeas 1.22, extension_type can be an Abstract GType and not just an Interface GType.

This method is not directly available to language bindings.
The implementation of this method is provided by peas_engine_create_extension_with_properties() in language bindings

Parameters

info PeasPluginInfo
 

A loaded PeasPluginInfo.

 The data is owned by the caller of the function.
extension_type GType
 

The implemented extension GType.

first_property const gchar*
 

The name of the first property.

 The data is owned by the caller of the function.
 The value is a NUL terminated UTF-8 string.
...
 

The value of the first property, followed optionally by more name/value pairs, followed by NULL.

Return value

Returns: PeasExtension
 

A new instance of PeasExtension wrapping the extension_type instance, or NULL.

 The data is owned by the instance.