## ide-workbench ide-workbench |

## Functions

void | ide_workbench_open_project_async ()
gboolean | ide_workbench_open_project_finish ()
void | ide_workbench_open_uri_async ()
gboolean | ide_workbench_open_uri_finish ()
void | ide_workbench_open_files_async ()
gboolean | ide_workbench_open_files_finish ()
void | ide_workbench_save_all_async ()
gboolean | ide_workbench_save_all_finish ()
void | ide_workbench_focus ()
void | ide_workbench_close ()
IdeContext * | ide_workbench_get_context ()
void | ide_workbench_add_perspective ()
void | ide_workbench_remove_perspective ()
IdePerspective * | ide_workbench_get_perspective_by_name ()
IdePerspective * | ide_workbench_get_visible_perspective ()
void | ide_workbench_set_visible_perspective ()
const gchar * | ide_workbench_get_visible_perspective_name ()
void | ide_workbench_set_visible_perspective_name ()
void | ide_workbench_views_foreach ()
IdeWorkbenchHeaderBar * | ide_workbench_get_headerbar ()
void | ide_workbench_push_message ()
gboolean | ide_workbench_pop_message ()
gboolean | ide_workbench_get_focus_mode ()
void | ide_workbench_set_focus_mode ()

## Properties

IdeContext * | context | Read
gboolean | disable-greeter | Read / Write / Construct Only
IdePerspective * | visible-perspective | Read / Write
gchar * | visible-perspective-name | Read / Write

## Signals

void | action | Action
void | set-perspective | Action
void | unload | Run Last

## Types and Values

enum | IdeWorkbenchOpenFlags
#define | IDE_TYPE_WORKBENCH
| IdeWorkbench

## Object Hierarchy

        GObject
        ╰── GInitiallyUnowned
            ╰── GtkWidget
                ╰── GtkContainer
                    ╰── GtkBin
                        ╰── GtkWindow
                            ╰── GtkApplicationWindow
                                ╰── DzlApplicationWindow
                                    ╰── IdeWorkbench

## Implemented Interfaces

IdeWorkbench implements AtkImplementorIface, GtkBuildable, GActionGroup and GActionMap.

## Description

## Functions

### ide_workbench_open_project_async ()

    void
    ide_workbench_open_project_async (IdeWorkbench *self,
                                      GFile *file_or_directory,
                                      GCancellable *cancellable,
                                      GAsyncReadyCallback callback,
                                      gpointer user_data);

### ide_workbench_open_project_finish ()

    gboolean
    ide_workbench_open_project_finish (IdeWorkbench *self,
                                       GAsyncResult *result,
                                       GError **error);

### ide_workbench_open_uri_async ()

    void
    ide_workbench_open_uri_async (IdeWorkbench *self,
                                  IdeUri *uri,
                                  const gchar *hint,
                                  IdeWorkbenchOpenFlags flags,
                                  GCancellable *cancellable,
                                  GAsyncReadyCallback callback,
                                  gpointer user_data);

### ide_workbench_open_uri_finish ()

    gboolean
    ide_workbench_open_uri_finish (IdeWorkbench *self,
                                   GAsyncResult *result,
                                   GError **error);

### ide_workbench_open_files_async ()

    void
    ide_workbench_open_files_async (IdeWorkbench *self,
                                    GFile **files,
                                    guint n_files,
                                    const gchar *hint,
                                    IdeWorkbenchOpenFlags flags,
                                    GCancellable *cancellable,
                                    GAsyncReadyCallback callback,
                                    gpointer user_data);

Starts the process of loading the buffers for the given `files` , possibly creating an IdeEditorView for each depending on `flags` .

#### Parameters

self | An IdeWorkbench. |
files | An array of GFile objects to be opened. | [array length=n_files]
n_files | The number of files given. |
hint | The id of an IdeWorkbenchAddin that should be preferred as a loader. |
flags | an IdeWorkbenchOpenFlags (if WORKBENCH_OPEN_FLAGS_BG is set, the buffer is loaded but not made visible in the UI). |
cancellable | a GCancellable. | [nullable]
callback | a GAsyncReadyCallback or `NULL`. | [scope async][closure user_data]
user_data | User data for `callback` |

### ide_workbench_open_files_finish ()

    gboolean
    ide_workbench_open_files_finish (IdeWorkbench *self,
                                     GAsyncResult *result,
                                     GError **error);

### ide_workbench_save_all_async ()

    void
    ide_workbench_save_all_async (IdeWorkbench *self,
                                  GCancellable *cancellable,
                                  GAsyncReadyCallback callback,
                                  gpointer user_data);

### ide_workbench_save_all_finish ()

    gboolean
    ide_workbench_save_all_finish (IdeWorkbench *self,
                                   GAsyncResult *result,
                                   GError **error);

### ide_workbench_focus ()

    void
    ide_workbench_focus (IdeWorkbench *self,
                         GtkWidget *widget);

### ide_workbench_close ()

    void
    ide_workbench_close (IdeWorkbench *self);

### ide_workbench_get_context ()

    IdeContext *
    ide_workbench_get_context (IdeWorkbench *self);

Gets the context associated with the workbench, or `NULL`.

#### Parameters

self | An IdeWorkbench. |

#### Returns

An IdeContext or `NULL`.

[transfer none][nullable]

### ide_workbench_add_perspective ()

    void
    ide_workbench_add_perspective (IdeWorkbench *self,
                                   IdePerspective *perspective);

### ide_workbench_remove_perspective ()

    void
    ide_workbench_remove_perspective (IdeWorkbench *self,
                                      IdePerspective *perspective);

### ide_workbench_get_perspective_by_name ()

    IdePerspective *
    ide_workbench_get_perspective_by_name (IdeWorkbench *self,
                                           const gchar *name);

Gets the perspective by its registered name as defined in `ide_perspective_get_id()`.

#### Returns

An IdePerspective or `NULL`.

[nullable][transfer none]

### ide_workbench_get_visible_perspective ()

    IdePerspective *
    ide_workbench_get_visible_perspective (IdeWorkbench *self);

Gets the current perspective.

#### Parameters

self | An IdeWorkbench. |

#### Returns

An IdePerspective.

[transfer none]

### ide_workbench_set_visible_perspective ()

    void
    ide_workbench_set_visible_perspective (IdeWorkbench *self,
                                           IdePerspective *perspective);

### ide_workbench_get_visible_perspective_name ()

    const gchar *
    ide_workbench_get_visible_perspective_name
                                   (IdeWorkbench *self);

### ide_workbench_set_visible_perspective_name ()

    void
    ide_workbench_set_visible_perspective_name
                                   (IdeWorkbench *self,
                                    const gchar *name);

### ide_workbench_views_foreach ()

    void
    ide_workbench_views_foreach (IdeWorkbench *self,
                                 GtkCallback callback,
                                 gpointer user_data);

Executes `callback` for every IdeLayoutView across all perspectives.

#### Parameters

self | An IdeWorkbench. |
callback | The callback to execute. | [scope call]
user_data | user data for `callback` . |

### ide_workbench_get_headerbar ()

    IdeWorkbenchHeaderBar *
    ide_workbench_get_headerbar (IdeWorkbench *self);

Helper that is equivalent to calling `gtk_window_get_titlebar()` and casting to an IdeWorkbenchHeaderBar. This is convenience for plugins.

#### Returns

An IdeWorkbenchHeaderBar.

[transfer none]

### ide_workbench_push_message ()

    void
    ide_workbench_push_message (IdeWorkbench *self,
                                IdeWorkbenchMessage *message);

### ide_workbench_pop_message ()

    gboolean
    ide_workbench_pop_message (IdeWorkbench *self,
                               const gchar *message_id);

### ide_workbench_get_focus_mode ()

    gboolean
    ide_workbench_get_focus_mode (IdeWorkbench *self);

### ide_workbench_set_focus_mode ()

    void
    ide_workbench_set_focus_mode (IdeWorkbench *self,
                                  gboolean focus_mode);

## Types and Values

### enum IdeWorkbenchOpenFlags

The IdeWorkbenchOpenFlags enumeration is used to specify how a document should be opened by the workbench. Plugins may want to have a bit of control over where the document is opened, and this provides a some control over that.

The `IDE_WORKBENCH_OPEN_FLAGS_NO_VIEW` enum value was added in 3.26

#### Members

IDE_WORKBENCH_OPEN_FLAGS_NONE | No special processing will be performed |
IDE_WORKBENCH_OPEN_FLAGS_BACKGROUND | Open the document in the background (behind current view) |
IDE_WORKBENCH_OPEN_FLAGS_NO_VIEW | Open the document but do not create a new view for it |

Since: 3.24

### IDE_TYPE_WORKBENCH

    #define IDE_TYPE_WORKBENCH (ide_workbench_get_type())

### IdeWorkbench

    typedef struct _IdeWorkbench IdeWorkbench;

## Property Details

### The `“context”` property

      “context”                  IdeContext *

The “context” property contains the IdeContext for the loaded project. Loading a project consists of creating an IdeContext, so there is a 1:1 mapping between "loaded project" and an IdeContext.

The IdeContext contains many of the important components of a project. For example, it contains the IdeVcs representing the active version control system and an IdeBuildSystem representing the current build system.

The creation of IdeWorkbenchAddin addins are deferred until this property has been set.

Flags: Read

### The `“disable-greeter”` property

      “disable-greeter”          gboolean

This property is used internally by Builder to avoid creating the greeter when opening a new workspace that is only for loading a project.

This should not be used by application plugins.

Flags: Read / Write / Construct Only

Default value: FALSE

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

      “visible-perspective”      IdePerspective *

This property contains the IdePerspective that is currently selected. Connect to the "notify::visible-perspective" signal to be notified when the perspective has been changed.

Flags: Read / Write

### The `“visible-perspective-name”` property

      “visible-perspective-name” gchar *

This property is just like “visible-perspective” except that it contains the name of the perspective as a string.

Flags: Read / Write

Default value: NULL

## Signal Details

### The `“action”` signal

    void
    user_function (IdeWorkbench *ideworkbench,
                   gchar        *arg1,
                   gchar        *arg2,
                   gchar        *arg3,
                   gpointer      user_data)

Flags: Action

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

    void
    user_function (IdeWorkbench *self,
                   gchar        *name,
                   gpointer      user_data)

This signal is meant for keybindings to change the current perspective.

#### Parameters

self | An IdeWorkbench |
name | the name of the perspective |
user_data | user data set when the signal handler was connected. |

Flags: Action

### The `“unload”` signal

    void
    user_function (IdeWorkbench *ideworkbench,
                   IdeContext   *arg1,
                   gpointer      user_data)

Flags: Run Last