## Plugins

Plugins — Plugins management and activation

##

# Synopsis

    void        anjuta_plugins_init             (GList *plugin_dirs);
    void        anjuta_plugins_finalize         (void);
    GtkWidget*  anjuta_plugins_get_installed_dialog
                                                (AnjutaShell *shell);
    const AnjutaPluginDescription* anjuta_plugins_get_description
                                                (AnjutaShell *shell,
                                                 GObject *plugin);
    const AnjutaPluginDescription* anjuta_plugins_get_description_by_id
                                                (AnjutaShell *shell,
                                                 const gchar *plugin_id);
    GSList*     anjuta_plugins_query            (AnjutaShell *shell,
                                                 const gchar *section_name,
                                                 const gchar *attribute_name,
                                                 const gchar *attribute_value,
                                                 ...);
    AnjutaPluginDescription* anjuta_plugins_select
                                                (AnjutaShell *shell,
                                                 gchar *title,
                                                 gchar *description,
                                                 GSList *plugin_descriptions);
    GObject*    anjuta_plugins_select_and_activate
                                                (AnjutaShell *shell,
                                                 gchar *title,
                                                 gchar *description,
                                                 GSList *plugin_descriptions);
    GObject*    anjuta_plugins_get_plugin       (AnjutaShell *shell,
                                                 const gchar *iface_name);
    GObject*    anjuta_plugins_get_plugin_by_id (AnjutaShell *shell,
                                                 const gchar *plugin_id);
    GSList*     anjuta_plugins_get_active_plugins
                                                (AnjutaShell *shell);
    gboolean    anjuta_plugins_unload_plugin    (AnjutaShell *shell,
                                                 GObject *plugin);
    gboolean    anjuta_plugins_unload_plugin_by_id
                                                (AnjutaShell *shell,
                                                 const gchar *plugin_id);
    void        anjuta_plugins_unload_all       (AnjutaShell *shell);
    #define     anjuta_plugins_get_interface    (shell, iface_type, error)

## Description

## Details

### anjuta_plugins_init ()

    void        anjuta_plugins_init             (GList *plugin_dirs);

`plugin_dirs` : |

### anjuta_plugins_finalize ()

    void        anjuta_plugins_finalize         (void);

### anjuta_plugins_get_installed_dialog ()

    GtkWidget*  anjuta_plugins_get_installed_dialog
                                                (AnjutaShell *shell);

`shell` : |
Returns : |

### anjuta_plugins_get_description ()

    const AnjutaPluginDescription* anjuta_plugins_get_description
                                                (AnjutaShell *shell,
                                                 GObject *plugin);

`shell` : |
`plugin` : |
Returns : |

### anjuta_plugins_get_description_by_id ()

    const AnjutaPluginDescription* anjuta_plugins_get_description_by_id
                                                (AnjutaShell *shell,
                                                 const gchar *plugin_id);

`shell` : |
`plugin_id` : |
Returns : |

### anjuta_plugins_query ()

    GSList*     anjuta_plugins_query            (AnjutaShell *shell,
                                                 const gchar *section_name,
                                                 const gchar *attribute_name,
                                                 const gchar *attribute_value,
                                                 ...);

`shell` : |
`section_name` : |
`attribute_name` : |
`attribute_value` : |
`...` : |
Returns : |

### anjuta_plugins_select ()

    AnjutaPluginDescription* anjuta_plugins_select
                                                (AnjutaShell *shell,
                                                 gchar *title,
                                                 gchar *description,
                                                 GSList *plugin_descriptions);

`shell` : |
`title` : |
`description` : |
`plugin_descriptions` : |
Returns : |

### anjuta_plugins_select_and_activate ()

    GObject*    anjuta_plugins_select_and_activate
                                                (AnjutaShell *shell,
                                                 gchar *title,
                                                 gchar *description,
                                                 GSList *plugin_descriptions);

`shell` : |
`title` : |
`description` : |
`plugin_descriptions` : |
Returns : |

### anjuta_plugins_get_plugin ()

    GObject*    anjuta_plugins_get_plugin       (AnjutaShell *shell,
                                                 const gchar *iface_name);

Searches the currently available plugins to find the one which implements the given interface as primary interface and returns it. If the plugin is not yet loaded, it will be loaded and activated. The returned object is garanteed to be an implementor of the interface (as exported by the plugin metafile). It only searches from the pool of plugin objects loaded in this shell and can only search by primary interface. If there are more objects implementing this primary interface, user might be prompted to select one from them (and might give the option to use it as default for future queries). A typical usage of this function is:

    GObject *docman =
        anjuta_plugins_get_plugin (shell, "IAnjutaDocumentManager", error);

Notice that this function takes the interface name string as string, unlike `anjuta_plugins_get_interface()` which takes the type directly.

`shell` : | A AnjutaShell interface
`iface_name` : | The interface implemented by the object to be found
Returns : | The plugin object (subclass of AnjutaPlugin) which implements the given interface. See AnjutaPlugin for more detail on interfaces implemented by plugins.

### anjuta_plugins_get_plugin_by_id ()

    GObject*    anjuta_plugins_get_plugin_by_id (AnjutaShell *shell,
                                                 const gchar *plugin_id);

`shell` : |
`plugin_id` : |
Returns : |

### anjuta_plugins_get_active_plugins ()

    GSList*     anjuta_plugins_get_active_plugins
                                                (AnjutaShell *shell);

`shell` : |
Returns : |

### anjuta_plugins_unload_plugin ()

    gboolean    anjuta_plugins_unload_plugin    (AnjutaShell *shell,
                                                 GObject *plugin);

`shell` : |
`plugin` : |
Returns : |

### anjuta_plugins_unload_plugin_by_id ()

    gboolean    anjuta_plugins_unload_plugin_by_id
                                                (AnjutaShell *shell,
                                                 const gchar *plugin_id);

`shell` : |
`plugin_id` : |
Returns : |

### anjuta_plugins_unload_all ()

    void        anjuta_plugins_unload_all       (AnjutaShell *shell);

`shell` : |

### anjuta_plugins_get_interface()

    #define     anjuta_plugins_get_interface(shell, iface_type, error)

Equivalent to `anjuta_shell_get_object()`, but additionally typecasts returned object to the interface type. It also takes interface type directly. A usage of this function is:

    IAnjutaDocumentManager *docman =
        anjuta_shell_get_interface (shell, IAnjutaDocumentManager, error);

`shell` : | A AnjutaShell object
`iface_type` : | The interface type implemented by the object to be found
`error` : | Error propagation object.