Top | ![]() |
![]() |
![]() |
![]() |
The IdeWorkbench is a GtkWindowGroup containing the IdeContext (root data-structure for a project) and all of the windows associated with the project.
Usually, windows within the IdeWorkbench are an IdeWorkspace. They can react to changes in the IdeContext or its descendants to represent the project and it's state.
IdeWorkbench *
ide_workbench_new (void
);
Creates a new IdeWorkbench.
This does not create any windows, you'll need to request that a workspace be created based on the kind of workspace you want to display to the user.
Since: 3.32
IdeWorkbench *
ide_workbench_new_for_context (IdeContext *context
);
Creates a new IdeWorkbench using context
for the “context”.
Since: 3.32
void
ide_workbench_activate (IdeWorkbench *self
);
This function will attempt to raise the most recently focused workspace.
Since: 3.32
IdeProjectInfo *
ide_workbench_get_project_info (IdeWorkbench *self
);
Gets the IdeProjectInfo for the workbench, if a project has been or is currently, loading.
Since: 3.32
gboolean
ide_workbench_has_project (IdeWorkbench *self
);
Returns TRUE
if a project is loaded (or currently loading) in the
workbench.
Since: 3.32
IdeContext *
ide_workbench_get_context (IdeWorkbench *self
);
Gets the IdeContext for the workbench.
Since: 3.32
IdeWorkspace *
ide_workbench_get_current_workspace (IdeWorkbench *self
);
Gets the most recently focused workspace, which may be used to deliver events such as opening new pages.
Since: 3.32
IdeWorkspace * ide_workbench_get_workspace_by_type (IdeWorkbench *self
,GType type
);
Gets the most-recently-used workspace that matches type
.
Since: 3.32
IdeSearchEngine *
ide_workbench_get_search_engine (IdeWorkbench *self
);
Gets the search engine for the workbench, if any.
Since: 3.32
IdeWorkbench *
ide_workbench_from_widget (GtkWidget *widget
);
Finds the IdeWorkbench associated with a widget.
Since: 3.32
void ide_workbench_add_workspace (IdeWorkbench *self
,IdeWorkspace *workspace
);
Adds workspace
to workbench
.
Since: 3.32
void ide_workbench_remove_workspace (IdeWorkbench *self
,IdeWorkspace *workspace
);
Removes workspace
from workbench
.
Since: 3.32
void ide_workbench_focus_workspace (IdeWorkbench *self
,IdeWorkspace *workspace
);
Requests that workspace
be raised in the windows of self
, and
displayed to the user.
Since: 3.32
void ide_workbench_foreach_workspace (IdeWorkbench *self
,GtkCallback callback
,gpointer user_data
);
Iterates the available workspaces in the workbench. Workspaces are iterated in most-recently-used order.
self |
an IdeWorkbench |
|
callback |
a GtkCallback to call for each IdeWorkspace. |
[scope call] |
user_data |
user data for |
Since: 3.32
void ide_workbench_foreach_page (IdeWorkbench *self
,GtkCallback callback
,gpointer user_data
);
Calls callback
for every page loaded in the workbench, by iterating
workspaces in order of most-recently-used.
self |
||
callback |
a callback to execute for each page. |
[scope call] |
user_data |
closure data for |
Since: 3.32
void ide_workbench_load_project_async (IdeWorkbench *self
,IdeProjectInfo *project_info
,GType workspace_type
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Requests that a project be opened in the workbench.
project_info
should contain enough information to discover and load the
project. Depending on the various fields of the IdeProjectInfo,
different plugins may become active as part of loading the project.
Note that this may only be called once for an IdeWorkbench. If you need to open a second project, you need to create and register a second workbench first, and then open using that secondary workbench.
callback
should call ide_workbench_load_project_finish()
to obtain the
result of the open request.
self |
||
project_info |
an IdeProjectInfo describing the project to open |
|
cancellable |
a GCancellable or |
[nullable] |
callback |
a GAsyncReadyCallback to execute upon completion. |
[nullable] |
user_data |
user data for |
Since: 3.32
gboolean ide_workbench_load_project_finish (IdeWorkbench *self
,GAsyncResult *result
,GError **error
);
Completes an asynchronous request to open a project using
ide_workbench_load_project_async()
.
Since: 3.32
void ide_workbench_unload_async (IdeWorkbench *self
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Asynchronously unloads the workbench.
All IdeWorkspace windows will be closed after calling this function.
self |
an IdeWorkbench |
|
cancellable |
a GCancellable. |
[nullable] |
callback |
a GAsyncReadyCallback to execute upon completion |
|
user_data |
closure data for |
Since: 3.32
gboolean ide_workbench_unload_finish (IdeWorkbench *self
,GAsyncResult *result
,GError **error
);
Completes a request to unload the workbench.
self |
an IdeWorkbench |
|
result |
a GAsyncResult provided to callback |
|
error |
a location for a GError, or |
Since: 3.32
void ide_workbench_open_async (IdeWorkbench *self
,GFile *file
,const gchar *hint
,IdeBufferOpenFlags flags
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Requests that the workbench open file
.
If hint
is provided, that will be used to determine what workbench
addin to use when opening the file. The hint
name should match the
module name of the plugin.
flags
may be ignored by some backends.
self |
an IdeWorkbench |
|
file |
a GFile |
|
hint |
an optional hint about what addin to use. |
[nullable] |
flags |
optional flags when opening the file |
|
cancellable |
a GCancellable. |
[nullable] |
callback |
a GAsyncReadyCallback to execute upon completion |
|
user_data |
closure data for |
Since: 3.32
void ide_workbench_open_at_async (IdeWorkbench *self
,GFile *file
,const gchar *hint
,gint at_line
,gint at_line_offset
,IdeBufferOpenFlags flags
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Like ide_workbench_open_async()
, this allows opening a file
within the workbench. However, it also allows specifying a
line and column offset within the file to focus. Usually, this
only makes sense for files that can be opened in an editor.
at_line
and at_line_offset
may be < 0 to ignore the parameters.
flags
may be ignored by some backends
Use ide_workbench_open_finish()
to receive teh result of this
asynchronous operation.
self |
an IdeWorkbench |
|
file |
a GFile |
|
hint |
an optional hint about what addin to use. |
[nullable] |
at_line |
the line number to open at, or -1 to ignore |
|
at_line_offset |
the line offset to open at, or -1 to ignore |
|
flags |
optional IdeBufferOpenFlags |
|
cancellable |
a GCancellable. |
[nullable] |
callback |
a GAsyncReadyCallback to execute upon completion |
|
user_data |
closure data for |
Since: 3.32
void ide_workbench_open_all_async (IdeWorkbench *self
,GFile **files
,guint n_files
,const gchar *hint
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Requests that the workbench open all of the GFile denoted by files
.
If hint
is provided, that will be used to determine what workbench
addin to use when opening the file. The hint
name should match the
module name of the plugin.
Call ide_workbench_open_finish()
from callback
to complete this
operation.
self |
an IdeWorkbench |
|
files |
an array of GFile. |
[array length=n_files] |
n_files |
number of GFiles contained in |
|
hint |
an optional hint about what addin to use. |
[nullable] |
cancellable |
a GCancellable. |
[nullable] |
callback |
a GAsyncReadyCallback to execute upon completion |
|
user_data |
closure data for |
Since: 3.32
gboolean ide_workbench_open_finish (IdeWorkbench *self
,GAsyncResult *result
,GError **error
);
Completes a request to open a file using either
ide_workbench_open_async()
or ide_workbench_open_at_async()
.
self |
an IdeWorkbench |
|
result |
a GAsyncResult provided to callback |
|
error |
a location for a GError, or |
Since: 3.32
IdeVcs *
ide_workbench_get_vcs (IdeWorkbench *self
);
Gets the IdeVcs that has been loaded for the workbench, if any.
Since: 3.32
void ide_workbench_set_vcs (IdeWorkbench *self
,IdeVcs *vcs
);
Sets the IdeVcs for the workbench.
Since: 3.32
IdeVcsMonitor *
ide_workbench_get_vcs_monitor (IdeWorkbench *self
);
Gets the IdeVcsMonitor for the workbench, if any.
Since: 3.32
IdeBuildSystem *
ide_workbench_get_build_system (IdeWorkbench *self
);
Gets the IdeBuildSystem for the workbench, if any.
Since: 3.32
void ide_workbench_set_build_system (IdeWorkbench *self
,IdeBuildSystem *build_system
);
Sets the IdeBuildSystem for the workbench.
If build_system
is NULL
, then a fallback build system will be used
instead. It does not provide building capabilities, but allows for some
components that require a build system to continue functioning.
Since: 3.32
void ide_workbench_resolve_file_async (IdeWorkbench *self
,const gchar *filename
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
This function will try to locate a given file based on the filename, possibly resolving it from a build directory, or source directory.
If no file was discovered, some attempt will be made to locate a file that matches appropriately.
Since: 3.32
GFile * ide_workbench_resolve_file_finish (IdeWorkbench *self
,GAsyncResult *result
,GError **error
);
Completes an asynchronous request to ide_workbench_resolve_file_async()
.
Since: 3.32
“context”
property“context” IdeContext *
The "context" property is the IdeContext for the project.
The IdeContext is the root IdeObject used in the tree of objects representing the project and the workings of the IDE.
Owner: IdeWorkbench
Flags: Read / Write / Construct Only
Since: 3.32
“vcs”
property“vcs” IdeVcs *
The "vcs" property contains an IdeVcs that represents the version control system that is currently loaded for the project.
The IdeVcs is registered by an IdeWorkbenchAddin when loading a project.
Owner: IdeWorkbench
Flags: Read / Write
Since: 3.32