ide-application: Builder SDK Reference

## ide-application ide-application |

## Functions

gboolean | ide_application_has_network ()
gchar ** | ide_application_get_argv ()
GDateTime * | ide_application_get_started_at ()
gboolean | ide_application_get_command_line_handled ()
void | ide_application_set_command_line_handled ()
void | ide_application_open_project_async ()
IdeWorkbench * | ide_application_open_project_finish ()
void | ide_application_set_workspace_type ()
void | ide_application_add_workbench ()
void | ide_application_remove_workbench ()
void | ide_application_foreach_workbench ()
void | ide_application_get_worker_async ()
GDBusProxy * | ide_application_get_worker_finish ()
IdeWorkbench * | ide_application_find_workbench_for_file ()

## Types and Values

#define | IDE_TYPE_APPLICATION
#define | IDE_APPLICATION_DEFAULT
| IdeApplication

## Object Hierarchy

        GObject
        ╰── GApplication
            ╰── GtkApplication
                ╰── DzlApplication
                    ╰── IdeApplication

## Implemented Interfaces

IdeApplication implements GActionGroup and GActionMap.

## Description

## Functions

### ide_application_has_network ()

    gboolean
    ide_application_has_network (IdeApplication *self);

This is a helper that uses an internal GNetworkMonitor to track if we have access to the network. It works around some issues we've seen in the wild that make determining if we have network access difficult.

#### Parameters

self | a IdeApplication. | [nullable]

#### Returns

`TRUE` if we think there is network access.

Since: 3.32

### ide_application_get_argv ()

    gchar **
    ide_application_get_argv (IdeApplication *self,
                              GApplicationCommandLine *cmdline);

Gets the commandline for `cmdline` as it was before any processing. This is useful to handle both local and remote processing of argv when you need to know what the arguments were before further options parsing.

#### Parameters

self | an IdeApplication |
cmdline | a GApplicationCommandLine |

#### Returns

an array of strings or `NULL`.

[transfer full][nullable][array zero-terminated=1]

Since: 3.32

### ide_application_get_started_at ()

    GDateTime *
    ide_application_get_started_at (IdeApplication *self);

Gets the time the application was started.

#### Parameters

self | a IdeApplication |

#### Returns

a GDateTime.

[transfer none]

Since: 3.32

### ide_application_get_command_line_handled ()

    gboolean
    ide_application_get_command_line_handled
                                   (IdeApplication *self,
                                    GApplicationCommandLine *cmdline);

### ide_application_set_command_line_handled ()

    void
    ide_application_set_command_line_handled
                                   (IdeApplication *self,
                                    GApplicationCommandLine *cmdline,
                                    gboolean handled);

### ide_application_open_project_async ()

    void
    ide_application_open_project_async (IdeApplication *self,
                                        IdeProjectInfo *project_info,
                                        GType workspace_type,
                                        GCancellable *cancellable,
                                        GAsyncReadyCallback callback,
                                        gpointer user_data);

### ide_application_open_project_finish ()

    IdeWorkbench *
    ide_application_open_project_finish (IdeApplication *self,
                                         GAsyncResult *result,
                                         GError **error);

Completes a request to open a project.

The workbench containing the project is returned, which may be an existing workbench if the project was already opened.

#### Parameters

self | a IdeApplication |
result | a GAsyncResult |
error | a location for a GError |

#### Returns

an IdeWorkbench or `NULL` on failure and `error` is set.

[transfer full]

Since: 3.32

### ide_application_set_workspace_type ()

    void
    ide_application_set_workspace_type (IdeApplication *self,
                                        GType workspace_type);

Sets the GType of an IdeWorkspace that should be used when creating the next workspace upon handling files from command-line arguments. This is reset after the files are opened and is generally only useful from IdeApplicationAddin's who need to alter the default workspace.

#### Parameters

self | a IdeApplication |

Since: 3.32

### ide_application_add_workbench ()

    void
    ide_application_add_workbench (IdeApplication *self,
                                   IdeWorkbench *workbench);

### ide_application_remove_workbench ()

    void
    ide_application_remove_workbench (IdeApplication *self,
                                      IdeWorkbench *workbench);

### ide_application_foreach_workbench ()

    void
    ide_application_foreach_workbench (IdeApplication *self,
                                       GFunc callback,
                                       gpointer user_data);

Calls `callback` for each of the registered workbenches.

#### Parameters

self | an IdeApplication |
callback | a GFunc callback. | [scope call]
user_data | user data for `callback` |

Since: 3.32

### ide_application_get_worker_async ()

    void
    ide_application_get_worker_async (IdeApplication *self,
                                      const gchar *plugin_name,
                                      GCancellable *cancellable,
                                      GAsyncReadyCallback callback,
                                      gpointer user_data);

Asynchronously requests a GDBusProxy to a service provided in a worker process. The worker should be an IdeWorker implemented by the plugin named `plugin_name` . The IdeWorker is responsible for created both the service registered on the bus and the proxy to it.

The IdeApplication is responsible for spawning a subprocess for the worker.

`callback` should call `ide_application_get_worker_finish()` with the result provided to retrieve the result.

#### Parameters

self | an IdeApplication |
plugin_name | The name of the plugin. |
cancellable | a GCancellable or `NULL`. | [allow-none]
callback | a GAsyncReadyCallback or `NULL`. |
user_data | user data for `callback` . |

Since: 3.32

### ide_application_get_worker_finish ()

    GDBusProxy *
    ide_application_get_worker_finish (IdeApplication *self,
                                       GAsyncResult *result,
                                       GError **error);

Completes an asynchronous request to get a proxy to a worker process.

#### Parameters

self | an IdeApplication. |
result | a GAsyncResult |
error | a location for a GError, or `NULL`. |

#### Returns

a GDBusProxy or `NULL`.

[transfer full]

Since: 3.32

### ide_application_find_workbench_for_file ()

    IdeWorkbench *
    ide_application_find_workbench_for_file
                                   (IdeApplication *self,
                                    GFile *file);

Looks for the workbench that is the closest match to `file` .

If no workbench is the root of `file` , then `NULL` is returned.

#### Parameters

self | a IdeApplication |
file | a GFile |

#### Returns

an IdeWorkbench or `NULL`.

[transfer none][nullable]

Since: 3.32

## Types and Values

### IDE_TYPE_APPLICATION

    #define IDE_TYPE_APPLICATION    (ide_application_get_type())

### IDE_APPLICATION_DEFAULT

    #define IDE_APPLICATION_DEFAULT IDE_APPLICATION(g_application_get_default())

### IdeApplication

    typedef struct _IdeApplication IdeApplication;