Top | ![]() |
![]() |
![]() |
![]() |
IdeWorkbenchAddin * | ide_workbench_addin_find_by_module_name () |
gchar * | ide_workbench_addin_get_id () |
void | ide_workbench_addin_load () |
void | ide_workbench_addin_unload () |
gboolean | ide_workbench_addin_can_open () |
void | ide_workbench_addin_open_async () |
gboolean | ide_workbench_addin_open_finish () |
void | ide_workbench_addin_perspective_set () |
#define | IDE_TYPE_WORKBENCH_ADDIN |
struct | IdeWorkbenchAddinInterface |
IdeWorkbenchAddin |
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.
Since: 3.26
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.
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.
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.
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.
self |
||
uri |
An IdeUri. |
|
content_type |
A content-type or |
[nullable] |
priority |
the priority at which this loader should be used. |
[out] |
void ide_workbench_addin_open_async (IdeWorkbenchAddin *self
,IdeUri *uri
,const gchar *content_type
,IdeWorkbenchOpenFlags flags
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
gboolean ide_workbench_addin_open_finish (IdeWorkbenchAddin *self
,GAsyncResult *result
,GError **error
);
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.
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); };