IdeEditorAddin: Builder SDK Reference

## IdeEditorAddin IdeEditorAddin — Addins for the editor surface |

## Functions

void | ide_editor_addin_load ()
void | ide_editor_addin_unload ()
void | ide_editor_addin_page_set ()
IdeEditorAddin * | ide_editor_addin_find_by_module_name ()

## Types and Values

#define | IDE_TYPE_EDITOR_ADDIN
struct | IdeEditorAddinInterface
| IdeEditorAddin

## Object Hierarchy

        GInterface
        ╰── IdeEditorAddin

## Prerequisites

IdeEditorAddin requires GObject.

## Description

The IdeEditorAddin interface provides a simplified interface for plugins that want to perform operations in, or extend, the editor surface.

This differs from the IdeWorkbenchAddin in that you are given access to the editor surface directly. This can be convenient if all you need to do is add panels or perform page tracking of the current focus page.

## Functions

### ide_editor_addin_load ()

    void
    ide_editor_addin_load (IdeEditorAddin *self,
                           IdeEditorSurface *surface);

This method is called to load the addin.

The addin should add any necessary UI components.

#### Parameters

self | an IdeEditorAddin |
surface | an IdeEditorPeprsective |

Since: 3.32

### ide_editor_addin_unload ()

    void
    ide_editor_addin_unload (IdeEditorAddin *self,
                             IdeEditorSurface *surface);

This method is called to unload the addin.

The addin is responsible for undoing anything it setup in load and cancel any in-flight or pending tasks immediately.

#### Parameters

self | an IdeEditorAddin |
surface | an IdeEditorSurface |

Since: 3.32

### ide_editor_addin_page_set ()

    void
    ide_editor_addin_page_set (IdeEditorAddin *self,
                               IdePage *page);

This function is called when the current page has changed in the editor surface. This could happen when the user focus another page, either with the keyboard, mouse, touch, or by opening a new buffer.

Note that `page` may not be an IdeEditorView, so consumers of this interface should take appropriate action based on the type.

When the last page is removed, `page` will be `NULL` to indicate to the addin that there is no active page.

#### Parameters

self | an IdeEditorAddin |
page | an IdePage or `NULL`. | [nullable]

Since: 3.32

### ide_editor_addin_find_by_module_name ()

    IdeEditorAddin *
    ide_editor_addin_find_by_module_name (IdeEditorSurface *editor,
                                          const gchar *module_name);

This function allows locating an IdeEditorAddin that is attached to the IdeEditorSurface by the addin module name. The module name should match the value specified in the ".plugin" module definition.

#### Parameters

editor | an IdeEditorSurface |
module_name | the module name of the addin |

#### Returns

An IdeEditorAddin or `NULL`.

[transfer none][nullable]

Since: 3.32

## Types and Values

### IDE_TYPE_EDITOR_ADDIN

    #define IDE_TYPE_EDITOR_ADDIN (ide_editor_addin_get_type())

### struct IdeEditorAddinInterface

    struct IdeEditorAddinInterface {
      GTypeInterface parent_iface;

      void (*load)     (IdeEditorAddin   *self,
                        IdeEditorSurface *surface);
      void (*unload)   (IdeEditorAddin   *self,
                        IdeEditorSurface *surface);
      void (*page_set) (IdeEditorAddin   *self,
                        IdePage          *page);
    };

### IdeEditorAddin

    typedef struct _IdeEditorAddin IdeEditorAddin;