IdeWorkbenchAddin

IdeWorkbenchAddin

Functions

Types and Values

Object Hierarchy

    GInterface
    ╰── IdeWorkbenchAddin

Prerequisites

IdeWorkbenchAddin requires GObject.

Description

Functions

ide_workbench_addin_find_by_module_name ()

IdeWorkbenchAddin *
ide_workbench_addin_find_by_module_name
                               (IdeWorkbench *workbench,
                                const gchar *addin_name);

This locates a loaded IdeWorkbenchAddin based on the module name. If the module is missing or has not been loaded, NULL is returned.

Parameters

workbench

a IdeWorkbench

 

addin_name

the name of the addin

 

Returns

An IdeWorkbenchAddin or NULL.

[transfer none][nullable]

Since: 3.26


ide_workbench_addin_get_id ()

gchar *
ide_workbench_addin_get_id (IdeWorkbenchAddin *self);

Gets the identifier for this workbench addin. By default this is the name of the classes GType (such as "MyObject").

This can be used as the hint to various open operations in IdeWorkbench to prefer a given loader.

Parameters

self

An IdeWorkbenchAddin.

 

Returns

a newly allocated string.

[transfer full]


ide_workbench_addin_load ()

void
ide_workbench_addin_load (IdeWorkbenchAddin *self,
                          IdeWorkbench *workbench);

This interface method is called to load self . Addin implementations should add any required UI or actions to workbench here. You should remove anything you've added in ide_workbench_addin_unload(), as that will be called when your plugin is deactivated or the workbench is in the destruction process.

Parameters

self

An IdeWorkbenchAddin

 

workbench

An IdeWorkbench

 

ide_workbench_addin_unload ()

void
ide_workbench_addin_unload (IdeWorkbenchAddin *self,
                            IdeWorkbench *workbench);

This interface method should cleanup after anything added to workbench in ide_workbench_addin_load().

This might be called when a plugin is deactivated, or the workbench is in the destruction process.

Parameters

self

An IdeWorkbenchAddin

 

workbench

An IdeWorkbench

 

ide_workbench_addin_can_open ()

gboolean
ide_workbench_addin_can_open (IdeWorkbenchAddin *self,
                              IdeUri *uri,
                              const gchar *content_type,
                              gint *priority);

This interface method indicates if the workbench addin can load the content found at uri . If so, priority should be set to an integer priority indicating how important it is for this addin to load uri .

The lowest integer value wins. However, a load fails, the next addin which returned TRUE from this method will be consulted.

Parameters

self

An IdeWorkbenchAddin.

 

uri

An IdeUri.

 

content_type

A content-type or NULL.

[nullable]

priority

the priority at which this loader should be used.

[out]

Returns

TRUE if self and open uri .


ide_workbench_addin_open_async ()

void
ide_workbench_addin_open_async (IdeWorkbenchAddin *self,
                                IdeUri *uri,
                                const gchar *content_type,
                                IdeWorkbenchOpenFlags flags,
                                GCancellable *cancellable,
                                GAsyncReadyCallback callback,
                                gpointer user_data);

ide_workbench_addin_open_finish ()

gboolean
ide_workbench_addin_open_finish (IdeWorkbenchAddin *self,
                                 GAsyncResult *result,
                                 GError **error);

ide_workbench_addin_perspective_set ()

void
ide_workbench_addin_perspective_set (IdeWorkbenchAddin *self,
                                     IdePerspective *perspective);

This function is called when the workbench changes the perspective.

Addins that wish to add buttons to the header bar may want to show or hide the widgets in this vfunc.

Parameters

self

an IdeWorkbenchAddin

 

perspective

An IdePerspective

 

Types and Values

IDE_TYPE_WORKBENCH_ADDIN

#define IDE_TYPE_WORKBENCH_ADDIN (ide_workbench_addin_get_type())

struct IdeWorkbenchAddinInterface

struct IdeWorkbenchAddinInterface {
  GTypeInterface parent;

  gchar    *(*get_id)          (IdeWorkbenchAddin      *self);
  void      (*load)            (IdeWorkbenchAddin      *self,
                                IdeWorkbench           *workbench);
  void      (*unload)          (IdeWorkbenchAddin      *self,
                                IdeWorkbench           *workbench);
  gboolean  (*can_open)        (IdeWorkbenchAddin      *self,
                                IdeUri                 *uri,
                                const gchar            *content_type,
                                gint                   *priority);
  void      (*open_async)      (IdeWorkbenchAddin      *self,
                                IdeUri                 *uri,
                                const gchar            *content_type,
                                IdeWorkbenchOpenFlags   flags,
                                GCancellable           *cancellable,
                                GAsyncReadyCallback     callback,
                                gpointer                user_data);
  gboolean  (*open_finish)     (IdeWorkbenchAddin      *self,
                                GAsyncResult           *result,
                                GError                **error);
  void      (*perspective_set) (IdeWorkbenchAddin      *self,
                                IdePerspective         *perspective);
};

IdeWorkbenchAddin

typedef struct _IdeWorkbenchAddin IdeWorkbenchAddin;