## 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 ()
gboolean | ide_workbench_get_fullscreen ()
void | ide_workbench_set_fullscreen ()
void | ide_workbench_views_foreach ()

## Types and Values

#define | IDE_TYPE_WORKBENCH
| IdeWorkbench

## 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. |
n_files | The number of files given. |
hint | The id of an IdeWorkbenchAddin that should be preferred as a loader. |
flags | A IdeWorkbenchOpenFlags (if WORKBENCH_OPEN_FLAGS_BG is set, the buffer is loaded but not made visible in the UI). |
cancellable | A GCancellable. |
callback | A GASyncReadyCallback. |
user_data | A gpointer to hold user data. |

### 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_get_fullscreen ()

    gboolean
    ide_workbench_get_fullscreen (IdeWorkbench *self);

### ide_workbench_set_fullscreen ()

    void
    ide_workbench_set_fullscreen (IdeWorkbench *self,
                                  gboolean fullscreen);

### 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` . |

## Types and Values

### IDE_TYPE_WORKBENCH

    #define IDE_TYPE_WORKBENCH (ide_workbench_get_type())

### IdeWorkbench

    typedef struct {
      GtkApplicationWindow       parent;

      guint                      unloading : 1;
      guint                      disable_greeter : 1;
      guint                      early_perspectives_removed : 1;
      guint                      did_initial_editor_transition : 1;

      IdeContext                *context;
      GCancellable              *cancellable;
      PeasExtensionSet          *addins;
      /*
       * This does not contain all perspectives, just those
       * that should be visible via the perspective selector.
       */
      GListStore                *perspectives;

      GtkStack                  *header_stack;
      IdeWorkbenchHeaderBar     *header_bar;
      IdePerspectiveMenuButton  *perspective_menu_button;
      GtkStack                  *perspectives_stack;
      GtkSizeGroup              *header_size_group;

      GObject                   *selection_owner;
    } IdeWorkbench;