IdeContextAddin

IdeContextAddin

Functions

Signals

Types and Values

Object Hierarchy

    GInterface
    ╰── IdeContextAddin

Prerequisites

IdeContextAddin requires GObject.

Description

Functions

ide_context_addin_find_by_module_name ()

IdeContextAddin *
ide_context_addin_find_by_module_name (IdeContext *context,
                                       const gchar *module_name);

Finds the addin (if any) matching the plugin's module_name .

Parameters

context

an IdeContext

 

module_name

the name of the addin module

 

Returns

an IdeContextAddin or NULL.

[transfer none][nullable]

Since: 3.40


ide_context_addin_load_project_async ()

void
ide_context_addin_load_project_async (IdeContextAddin *self,
                                      IdeContext *context,
                                      GCancellable *cancellable,
                                      GAsyncReadyCallback callback,
                                      gpointer user_data);

Requests to load a project with the IdeContextAddin.

This function is called when the IdeContext requests loading a project.

Parameters

self

an IdeContextAddin

 

context

an IdeContext

 

cancellable

a GCancellable or NULL.

[nullable]

callback

a callback to execute upon completion

 

user_data

closure data for callback

 

Since: 3.32


ide_context_addin_load_project_finish ()

gboolean
ide_context_addin_load_project_finish (IdeContextAddin *self,
                                       GAsyncResult *result,
                                       GError **error);

Completes a request to load a project with the IdeContextAddin.

This function will be called from the callback provided to ide_context_addin_load_project_async().

Parameters

self

an IdeContextAddin

 

result

a GAsyncResult

 

error

a location for a GError, or NULL

 

Returns

TRUE if successful; otherwise FALSE and error is set.

Since: 3.32


ide_context_addin_load ()

void
ide_context_addin_load (IdeContextAddin *self,
                        IdeContext *context);

Requests that the IdeContextAddin loads any necessary runtime features.

This is called when the IdeContext is created. If you would rather wait until a project is loaded, then use “project-loaded” to load runtime features.

Parameters

self

an IdeContextAddin

 

context

an IdeContext

 

Since: 3.32


ide_context_addin_unload ()

void
ide_context_addin_unload (IdeContextAddin *self,
                          IdeContext *context);

Requests that the IdeContextAddin unloads any previously loaded resources.

Parameters

self

an IdeContextAddin

 

context

an IdeContext

 

Since: 3.32


ide_context_addin_project_loaded ()

void
ide_context_addin_project_loaded (IdeContextAddin *self,
                                  IdeContext *context);

Emits the “project-loaded” signal.

This is called when the context has completed loading a project.

Parameters

self

an IdeContextAddin

 

context

an IdeContext

 

Since: 3.32

Types and Values

IDE_TYPE_CONTEXT_ADDIN

#define IDE_TYPE_CONTEXT_ADDIN (ide_context_addin_get_type())

struct IdeContextAddinInterface

struct IdeContextAddinInterface {
  GTypeInterface parent_iface;

  void     (*load)                (IdeContextAddin      *self,
                                   IdeContext           *context);
  void     (*unload)              (IdeContextAddin      *self,
                                   IdeContext           *context);
  void     (*load_project_async)  (IdeContextAddin      *self,
                                   IdeContext           *context,
                                   GCancellable         *cancellable,
                                   GAsyncReadyCallback   callback,
                                   gpointer              user_data);
  gboolean (*load_project_finish) (IdeContextAddin      *self,
                                   GAsyncResult         *result,
                                   GError              **error);
  void     (*project_loaded)      (IdeContextAddin      *self,
                                   IdeContext           *context);
};

IdeContextAddin

typedef struct _IdeContextAddin IdeContextAddin;

Signal Details

The “project-loaded” signal

void
user_function (IdeContextAddin *self,
               IdeContext      *context,
               gpointer         user_data)

The "project-loaded" signal is emitted after a project has been loaded in the IdeContext.

You might use this to setup any runtime features that rely on the project being successfully loaded first. Every addin's ide_context_addin_load_project_async() will have been called and completed before this signal is emitted.

Parameters

self

an IdeContextAddin

 

context

an IdeContext

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last

Since: 3.32