## IdeWorkspace IdeWorkspace |

## Functions

void | ide_workspace_class_set_kind ()
IdeHeaderBar * | ide_workspace_get_header_bar ()
IdeContext * | ide_workspace_get_context ()
GCancellable * | ide_workspace_get_cancellable ()
void | ide_workspace_foreach_page ()
void | ide_workspace_foreach_surface ()
void | ide_workspace_add_surface ()
IdeSurface * | ide_workspace_get_surface_by_name ()
void | ide_workspace_set_visible_surface_name ()
IdeSurface * | ide_workspace_get_visible_surface ()
void | ide_workspace_set_visible_surface ()
GtkOverlay * | ide_workspace_get_overlay ()
IdePage * | ide_workspace_get_most_recent_page ()

## Properties

IdeContext * | context | Read
IdeSurface * | visible-surface | Read / Write

## Signals

void | surface-set | Run Last

## Types and Values

#define | IDE_TYPE_WORKSPACE
struct | IdeWorkspaceClass
| IdeWorkspace

## Object Hierarchy

        GObject
        ╰── GInitiallyUnowned
            ╰── GtkWidget
                ╰── GtkContainer
                    ╰── GtkBin
                        ╰── GtkWindow
                            ╰── GtkApplicationWindow
                                ╰── DzlApplicationWindow
                                    ╰── IdeWorkspace
                                        ├── IdeEditorWorkspace
                                        ├── IdeGreeterWorkspace
                                        ├── IdePrimaryWorkspace
                                        ╰── IdeTerminalWorkspace

## Implemented Interfaces

IdeWorkspace implements AtkImplementorIface, GtkBuildable, GActionGroup and GActionMap.

## Description

## Functions

### ide_workspace_class_set_kind ()

    void
    ide_workspace_class_set_kind (IdeWorkspaceClass *klass,
                                  const gchar *kind);

Sets the shorthand name for the kind of workspace. This is used to limit what IdeWorkspaceAddin may load within the workspace.

#### Parameters

klass | a IdeWorkspaceClass |

Since: 3.32

### ide_workspace_get_header_bar ()

    IdeHeaderBar *
    ide_workspace_get_header_bar (IdeWorkspace *self);

Gets the headerbar for the workspace, if it is an IdeHeaderBar. Also works around Gtk giving back a GtkStack for the header bar.

#### Parameters

self | a IdeWorkspace |

#### Returns

an IdeHeaderBar or `NULL`.

[nullable][transfer none]

Since: 3.32

### ide_workspace_get_context ()

    IdeContext *
    ide_workspace_get_context (IdeWorkspace *self);

Gets the IdeContext for the IdeWorkspace, which is set when the workspace joins an IdeWorkbench.

#### Returns

an IdeContext or `NULL`.

[transfer none][nullable]

Since: 3.32

### ide_workspace_get_cancellable ()

    GCancellable *
    ide_workspace_get_cancellable (IdeWorkspace *self);

Gets a cancellable for a window. This is useful when you want operations to be cancelled if a window is closed.

#### Parameters

self | a IdeWorkspace |

#### Returns

a GCancellable.

[transfer none]

Since: 3.32

### ide_workspace_foreach_page ()

    void
    ide_workspace_foreach_page (IdeWorkspace *self,
                                GtkCallback callback,
                                gpointer user_data);

Calls `callback` for each IdePage found within the workspace.

#### Parameters

self | a IdeWorkspace |
callback | a callback to execute for each view. | [scope call]
user_data | closure data for `callback` |

Since: 3.32

### ide_workspace_foreach_surface ()

    void
    ide_workspace_foreach_surface (IdeWorkspace *self,
                                   GtkCallback callback,
                                   gpointer user_data);

Calls callback for every IdeSurface based GtkWidget that is registered in the workspace.

#### Parameters

self | a IdeWorkspace |
callback | a GtkCallback to execute for every surface. | [scope call]
user_data | user data for `callback` |

Since: 3.32

### ide_workspace_add_surface ()

    void
    ide_workspace_add_surface (IdeWorkspace *self,
                               IdeSurface *surface);

Adds a new IdeSurface to the workspace.

#### Parameters

self | a IdeWorkspace |

Since: 3.32

### ide_workspace_get_surface_by_name ()

    IdeSurface *
    ide_workspace_get_surface_by_name (IdeWorkspace *self,
                                       const gchar *name);

Locates an IdeSurface that has been added to the workspace by the name that was registered for the widget using `gtk_widget_set_name()`.

#### Parameters

self | a IdeWorkspace |
name | the name of the surface |

#### Returns

an IdeSurface or `NULL`.

[transfer none][nullable]

Since: 3.32

### ide_workspace_set_visible_surface_name ()

    void
    ide_workspace_set_visible_surface_name
                                   (IdeWorkspace *self,
                                    const gchar *visible_surface_name);

Sets the visible surface based on the name of the surface. The name of the surface comes from `gtk_widget_get_name()`, which should be set when creating the surface using `gtk_widget_set_name()`.

#### Parameters

self | a IdeWorkspace |
visible_surface_name | the name of the IdeSurface |

Since: 3.32

### ide_workspace_get_visible_surface ()

    IdeSurface *
    ide_workspace_get_visible_surface (IdeWorkspace *self);

Gets the currently visible IdeSurface, or `NULL`

#### Parameters

self | a IdeWorkspace |

#### Returns

an IdeSurface or `NULL`.

[transfer none][nullable]

Since: 3.32

### ide_workspace_set_visible_surface ()

    void
    ide_workspace_set_visible_surface (IdeWorkspace *self,
                                       IdeSurface *surface);

Sets the “visible-surface” property which is the currently visible IdeSurface in the workspace.

#### Parameters

self | a IdeWorkspace |
surface | an IdeSurface |

Since: 3.32

### ide_workspace_get_overlay ()

    GtkOverlay *
    ide_workspace_get_overlay (IdeWorkspace *self);

Gets a GtkOverlay that contains all of the primary contents of the window (everything except the headerbar). This can be used by plugins to draw above the workspace contents.

#### Parameters

self | a IdeWorkspace |

#### Returns

a GtkOverlay.

[transfer none]

Since: 3.32

### ide_workspace_get_most_recent_page ()

    IdePage *
    ide_workspace_get_most_recent_page (IdeWorkspace *self);

Gets the most recently focused IdePage.

#### Parameters

self | a IdeWorkspace |

#### Returns

an IdePage or `NULL`.

[transfer none][nullable]

Since: 3.32

## Types and Values

### IDE_TYPE_WORKSPACE

    #define IDE_TYPE_WORKSPACE (ide_workspace_get_type())

### struct IdeWorkspaceClass

    struct IdeWorkspaceClass {
      DzlApplicationWindowClass parent_class;

      const gchar *kind;

      void (*context_set)  (IdeWorkspace *self,
                            IdeContext   *context);
      void (*foreach_page) (IdeWorkspace *self,
                            GtkCallback   callback,
                            gpointer      user_data);
      void (*surface_set)  (IdeWorkspace *self,
                            IdeSurface   *surface);
    };

### IdeWorkspace

    typedef struct _IdeWorkspace IdeWorkspace;

## Property Details

### The `“context”` property

      “context”                  IdeContext *

The "context" property is the IdeContext for the workspace. This is set when the workspace joins a workbench.

Owner: IdeWorkspace

Flags: Read

Since: 3.32

### The `“visible-surface”` property

      “visible-surface”          IdeSurface *

The "visible-surface" property contains the currently foremost surface in the workspaces stack of surfaces. Usually, this is the editor surface, but may be other surfaces such as build preferences, profiler, etc.

Owner: IdeWorkspace

Flags: Read / Write

Since: 3.32

## Signal Details

### The `“surface-set”` signal

    void
    user_function (IdeWorkspace *self,
                   IdeSurface   *surface,
                   gpointer      user_data)

The "surface-set" signal is emitted when the current surface changes within the workspace.

#### Parameters

self | an IdeWorkspace |
surface | an IdeSurface. | [nullable]
user_data | user data set when the signal handler was connected. |

Flags: Run Last

Since: 3.32