## IdeWorkspaceAddin IdeWorkspaceAddin — Extend the IdeWorkspace windows |

## Functions

void | ide_workspace_addin_load ()
void | ide_workspace_addin_unload ()
void | ide_workspace_addin_surface_set ()
gboolean | ide_workspace_addin_can_close ()

## Types and Values

#define | IDE_TYPE_WORKSPACE_ADDIN
struct | IdeWorkspaceAddinInterface
| IdeWorkspaceAddin

## Object Hierarchy

        GInterface
        ╰── IdeWorkspaceAddin

## Prerequisites

IdeWorkspaceAddin requires GObject.

## Description

The IdeWorkspaceAddin is created with each IdeWorkspace, allowing plugins a chance to modify each window that is created.

If you set `X-Workspace-Kind=primary` in your `.plugin` file, your addin will only be loaded in the primary workspace. You may specify multiple workspace kinds such as `primary` or `secondary` separated by a comma such as `primary,secondary;`.

## Functions

### ide_workspace_addin_load ()

    void
    ide_workspace_addin_load (IdeWorkspaceAddin *self,
                              IdeWorkspace *workspace);

Lods the IdeWorkspaceAddin.

This is a good place to modify the workspace from your addin. Remember to unmodify the workspace in `ide_workspace_addin_unload()`.

#### Parameters

self | a IdeWorkspaceAddin |

Since: 3.32

### ide_workspace_addin_unload ()

    void
    ide_workspace_addin_unload (IdeWorkspaceAddin *self,
                                IdeWorkspace *workspace);

Unloads the IdeWorkspaceAddin.

This is a good place to unmodify the workspace from anything you did in `ide_workspace_addin_load()`.

#### Parameters

self | a IdeWorkspaceAddin |

Since: 3.32

### ide_workspace_addin_surface_set ()

    void
    ide_workspace_addin_surface_set (IdeWorkspaceAddin *self,
                                     IdeSurface *surface);

This function is called to notify the addin of the current surface. It may be set to `NULL` before unloading the addin to allow addins to do surface change state handling and cleanup in one function.

#### Parameters

self | an IdeWorkspaceAddin |
surface | an IdeSurface or `NULL`. | [nullable]

Since: 3.32

### ide_workspace_addin_can_close ()

    gboolean
    ide_workspace_addin_can_close (IdeWorkspaceAddin *self);

This method is called to determine if the workspace can close. If the addin needs to prevent the workspace closing, then return `FALSE`; otherwise `TRUE`.

#### Parameters

self | an IdeWorkspaceAddin |

#### Returns

`TRUE` if the workspace can close; otherwise `FALSE`.

Since: 3.34

## Types and Values

### IDE_TYPE_WORKSPACE_ADDIN

    #define IDE_TYPE_WORKSPACE_ADDIN (ide_workspace_addin_get_type())

### struct IdeWorkspaceAddinInterface

    struct IdeWorkspaceAddinInterface {
      GTypeInterface parent_iface;

      void     (*load)        (IdeWorkspaceAddin *self,
                               IdeWorkspace      *workspace);
      void     (*unload)      (IdeWorkspaceAddin *self,
                               IdeWorkspace      *workspace);
      void     (*surface_set) (IdeWorkspaceAddin *self,
                               IdeSurface        *surface);
      gboolean (*can_close)   (IdeWorkspaceAddin *self);
    };

### IdeWorkspaceAddin

    typedef struct _IdeWorkspaceAddin IdeWorkspaceAddin;