## PeasObjectModule

PeasObjectModule — Type module which allows extension registration.

## Functions

GObject * | (*PeasFactoryFunc) ()
void | peas_object_module_register_extension_factory ()
void | peas_object_module_register_extension_type ()

## Properties

gboolean | local-linkage | Read / Write / Construct Only
char * | module-name | Read / Write / Construct Only
char * | path | Read / Write / Construct Only
gboolean | resident | Read / Write / Construct Only
char * | symbol | Read / Write / Construct Only

## Types and Values

struct | PeasObjectModule
struct | PeasObjectModuleClass

## Object Hierarchy

        GObject
        ╰── GTypeModule
            ╰── PeasObjectModule

## Implemented Interfaces

PeasObjectModule implements GTypePlugin.

## Description

PeasObjectModule is a subclass of GTypeModule which allows registration of extensions. It will be used by C extensions implementors to register extension implementations from within the peas_register_types module function.

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

## Functions

### PeasFactoryFunc ()

    GObject *
    (*PeasFactoryFunc) (guint n_parameters,
                        GParameter *parameters,
                        gpointer user_data);

A PeasFactoryFunc is a factory function which will instanciate a new extension of a given type. `g_object_newv()` is such a function.

It is used with `peas_object_module_register_extension_factory()`.

#### Parameters

n_parameters | The number of paramteters. |
parameters | The parameters. | [array length=n_parameters]
user_data | Optional data to be passed to the function, or `NULL`. |

#### Returns

The created object.

[transfer full]

### peas_object_module_register_extension_factory ()

    void
    peas_object_module_register_extension_factory
                                   (PeasObjectModule *module,
                                    GType exten_type,
                                    PeasFactoryFunc factory_func,
                                    gpointer user_data,
                                    GDestroyNotify destroy_func);

Register an implementation for an extension type through a factory function `factory_func` which will instantiate the extension when requested.

This method is primarily meant to be used by native bindings (like gtkmm), creating native types which cannot be instantiated correctly using `g_object_new()`. For other uses, you will usually prefer relying on `peas_object_module_register_extension_type()`.

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

#### Parameters

module | Your plugin's PeasObjectModule. |
exten_type | The GType of the extension you implement. |
factory_func | The PeasFactoryFunc that will create the `exten_type` instance when requested. |
user_data | Data to pass to `func` calls. |
destroy_func | A GDestroyNotify for `user_data` . |

### peas_object_module_register_extension_type ()

    void
    peas_object_module_register_extension_type
                                   (PeasObjectModule *module,
                                    GType exten_type,
                                    GType impl_type);

Register `impl_type` as an extension which implements `extension_type` .

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

#### Parameters

module | Your plugin's PeasObjectModule. |
exten_type | The GType of the extension you implement. |
impl_type | The GType of your implementation of `exten_type` . |

## Types and Values

### struct PeasObjectModule

    struct PeasObjectModule;

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

### struct PeasObjectModuleClass

    struct PeasObjectModuleClass {
      GTypeModuleClass parent_class;
    };

The class structure for PeasObjectModule.

#### Members

## Property Details

### The `“local-linkage”` property

      “local-linkage”            gboolean

This property indicates whether the module is loaded with local linkage, i.e. G_MODULE_BIND_LOCAL.

Since 1.14

Owner: PeasObjectModule

Flags: Read / Write / Construct Only

Default value: FALSE

### The `“module-name”` property

      “module-name”              char *

The module to load for this object.

Owner: PeasObjectModule

Flags: Read / Write / Construct Only

Default value: NULL

### The `“path”` property

      “path”                     char *

The path to use when loading this module.

Owner: PeasObjectModule

Flags: Read / Write / Construct Only

Default value: NULL

### The `“resident”` property

      “resident”                 gboolean

Whether the module is resident.

Owner: PeasObjectModule

Flags: Read / Write / Construct Only

Default value: FALSE

### The `“symbol”` property

      “symbol”                   char *

The registration symbol to use for this module.

Owner: PeasObjectModule

Flags: Read / Write / Construct Only

Default value: "peas_register_types"