IdeApplicationAddin: Builder SDK Reference

## IdeApplicationAddin IdeApplicationAddin — extend functionality of IdeApplication |

## Functions

void | ide_application_addin_open ()
void | ide_application_addin_activate ()
void | ide_application_addin_load ()
void | ide_application_addin_unload ()
void | ide_application_addin_add_option_entries ()
void | ide_application_addin_handle_command_line ()
void | ide_application_addin_workbench_added ()
void | ide_application_addin_workbench_removed ()

## Types and Values

#define | IDE_TYPE_APPLICATION_ADDIN
struct | IdeApplicationAddinInterface
| IdeApplicationAddin

## Object Hierarchy

        GInterface
        ╰── IdeApplicationAddin

## Prerequisites

IdeApplicationAddin requires GObject.

## Description

The IdeApplicationAddin interface is used by plugins that want to extend the set of features provided by IdeApplication. This is useful if you need utility code that is bound to the lifetime of the IdeApplication.

The IdeApplicationAddin is created after the application has initialized and unloaded when Builder is shut down.

Use this interface when you can share code between multiple projects that are open at the same time.

## Functions

### ide_application_addin_open ()

    void
    ide_application_addin_open (IdeApplicationAddin *self,
                                IdeApplication *application,
                                GFile **files,
                                gint n_files,
                                const gchar *hint);

This function is activated when the “open” signal is emitted.

#### Parameters

self | a IdeApplicationAddin |
application | an ideApplication |
files | an array of GFiles. | [array length=n_files][element-type GFile]
n_files | the length of `files` |
hint | a hint provided by the calling instance |

Since: 3.32

### ide_application_addin_activate ()

    void
    ide_application_addin_activate (IdeApplicationAddin *self,
                                    IdeApplication *application);

This function is activated when the GApplication::activate signal is emitted.

#### Parameters

self | a IdeApplicationAddin |
application | an ideApplication |

Since: 3.32

### ide_application_addin_load ()

    void
    ide_application_addin_load (IdeApplicationAddin *self,
                                IdeApplication *application);

This interface method is called when the application is started or the plugin has just been activated.

Use this to setup code in your plugin that needs to be loaded once per application process.

#### Parameters

self | An IdeApplicationAddin. |
application | An IdeApplication. |

Since: 3.32

### ide_application_addin_unload ()

    void
    ide_application_addin_unload (IdeApplicationAddin *self,
                                  IdeApplication *application);

This inteface method is called when the application is shutting down or the plugin has been unloaded.

Use this function to cleanup after anything setup in `ide_application_addin_load()`.

#### Parameters

self | An IdeApplicationAddin. |
application | An IdeApplication. |

Since: 3.32

### ide_application_addin_add_option_entries ()

    void
    ide_application_addin_add_option_entries
                                   (IdeApplicationAddin *self,
                                    IdeApplication *application);

This function is called to allow the application a chance to add various command-line options to the GOptionContext. See `g_application_add_main_option_entries()` for more information on how to add arguments.

See `ide_application_addin_handle_command_line()` for how to handle arguments once command line argument processing begins.

Make sure you set `X-At-Startup=true` in your `.plugin` file so that the plugin is loaded early during startup or this virtual function will not be called.

#### Parameters

self | a IdeApplicationAddin |
application | an IdeApplication |

Since: 3.32

### ide_application_addin_handle_command_line ()

    void
    ide_application_addin_handle_command_line
                                   (IdeApplicationAddin *self,
                                    IdeApplication *application,
                                    GApplicationCommandLine *cmdline);

This function is called to allow the addin to procses command line arguments that were parsed based on options added in `ide_application_addin_add_option_entries()`.

See `g_application_command_line_get_option_dict()` for more information.

#### Parameters

self | a IdeApplicationAddin |
application | an IdeApplication |
cmdline | a GApplicationCommandLine |

Since: 3.32

### ide_application_addin_workbench_added ()

    void
    ide_application_addin_workbench_added (IdeApplicationAddin *self,
                                           IdeWorkbench *workbench);

### ide_application_addin_workbench_removed ()

    void
    ide_application_addin_workbench_removed
                                   (IdeApplicationAddin *self,
                                    IdeWorkbench *workbench);

## Types and Values

### IDE_TYPE_APPLICATION_ADDIN

    #define IDE_TYPE_APPLICATION_ADDIN (ide_application_addin_get_type())

### struct IdeApplicationAddinInterface

    struct IdeApplicationAddinInterface {
      GTypeInterface parent_interface;

      void (*load)                (IdeApplicationAddin     *self,
                                   IdeApplication          *application);
      void (*unload)              (IdeApplicationAddin     *self,
                                   IdeApplication          *application);
      void (*activate)            (IdeApplicationAddin     *self,
                                   IdeApplication          *application);
      void (*open)                (IdeApplicationAddin     *self,
                                   IdeApplication          *application,
                                   GFile                  **files,
                                   gint                     n_files,
                                   const gchar             *hint);
      void (*add_option_entries)  (IdeApplicationAddin     *self,
                                   IdeApplication          *application);
      void (*handle_command_line) (IdeApplicationAddin     *self,
                                   IdeApplication          *application,
                                   GApplicationCommandLine *cmdline);
      void (*workbench_added)     (IdeApplicationAddin     *self,
                                   IdeWorkbench            *workbench);
      void (*workbench_removed)   (IdeApplicationAddin     *self,
                                   IdeWorkbench            *workbench);
    };

#### Members

GTypeInterface `parent_interface`; |  |
`load` () | Set this virtual method to implement the `ide_application_addin_load()` virtual method. |
`unload` () | Set this virtual method to implement the `ide_application_addin_unload()` virtual method. |
`activate` () |  |
`open` () |  |
`add_option_entries` () | Set this virtual method to add option entries to the gnome-builder command-line argument parsing. See `g_application_add_main_option_entries()`. |
`handle_command_line` () | Set this virtual method to handle parsing command line arguments. |
`workbench_added` () |  |
`workbench_removed` () |  |

Since: 3.32

### IdeApplicationAddin

    typedef struct _IdeApplicationAddin IdeApplicationAddin;