Top |
Functions
gboolean | peas_plugin_info_is_loaded () |
gboolean | peas_plugin_info_is_available () |
gboolean | peas_plugin_info_is_builtin () |
gboolean | peas_plugin_info_is_hidden () |
const gchar * | peas_plugin_info_get_module_name () |
const gchar * | peas_plugin_info_get_module_dir () |
const gchar * | peas_plugin_info_get_data_dir () |
GSettings * | peas_plugin_info_get_settings () |
const gchar ** | peas_plugin_info_get_dependencies () |
gboolean | peas_plugin_info_has_dependency () |
const gchar * | peas_plugin_info_get_name () |
const gchar * | peas_plugin_info_get_description () |
const gchar * | peas_plugin_info_get_icon_name () |
const gchar * | peas_plugin_info_get_help_uri () |
const gchar ** | peas_plugin_info_get_authors () |
const gchar * | peas_plugin_info_get_website () |
const gchar * | peas_plugin_info_get_copyright () |
const gchar * | peas_plugin_info_get_version () |
const gchar * | peas_plugin_info_get_external_data () |
Description
A PeasPluginInfo contains all the information available about a plugin.
All this information comes from the related plugin info file, whose file extension is ".plugin". Here is an example of such a plugin file, in the GKeyFile format:
1 2 3 4 5 6 7 8 9 10 11 |
[Plugin] Module=helloworld Depends=foo;bar;baz Loader=python3 Name=Hello World Description=Displays "Hello World" Authors=Steve Frécinaux <code@istique.net> Copyright=Copyright © 2009-10 Steve Frécinaux Website=https://wiki.gnome.org/Projects/Libpeas Help=http://library.gnome.org/devel/libpeas/stable/ Hidden=false |
Functions
peas_plugin_info_is_loaded ()
gboolean
peas_plugin_info_is_loaded (const PeasPluginInfo *info
);
Check if the plugin is loaded.
peas_plugin_info_is_available ()
gboolean peas_plugin_info_is_available (const PeasPluginInfo *info
,GError **error
);
Check if the plugin is available.
A plugin is marked as not available when there is no loader available to
load it, or when there has been an error when trying to load it previously.
If not available then error
will be set.
peas_plugin_info_is_builtin ()
gboolean
peas_plugin_info_is_builtin (const PeasPluginInfo *info
);
Check if the plugin is a builtin plugin.
A builtin plugin is a plugin which cannot be enabled or disabled by the user through a plugin manager (like PeasGtkPluginManager). Loading or unloading such plugins is the responsibility of the application alone. Most applications will usually load those plugins immediately after the initialization of the PeasEngine.
The relevant key in the plugin info file is "Builtin".
peas_plugin_info_is_hidden ()
gboolean
peas_plugin_info_is_hidden (const PeasPluginInfo *info
);
Check if the plugin is a hidden plugin.
A hidden plugin is a plugin which cannot be seen by a user through a plugin manager (like PeasGtkPluginManager). Loading and unloading such plugins is the responsibility of the application alone or through plugins that depend on them.
The relevant key in the plugin info file is "Hidden".
peas_plugin_info_get_module_name ()
const gchar *
peas_plugin_info_get_module_name (const PeasPluginInfo *info
);
Gets the module name.
The module name will be used to find the actual plugin. The way this value will be used depends on the loader (i.e. on the language) of the plugin. This value is also used to uniquely identify a particular plugin.
The relevant key in the plugin info file is "Module".
peas_plugin_info_get_module_dir ()
const gchar *
peas_plugin_info_get_module_dir (const PeasPluginInfo *info
);
Gets the module directory.
The module directory is the directory where the plugin file was found. This is not a value from the GKeyFile, but rather a value provided by the PeasEngine.
peas_plugin_info_get_data_dir ()
const gchar *
peas_plugin_info_get_data_dir (const PeasPluginInfo *info
);
Gets the data dir of the plugin.
The module data directory is the directory where a plugin should find its runtime data. This is not a value read from the GKeyFile, but rather a value provided by the PeasEngine, depending on where the plugin file was found.
peas_plugin_info_get_settings ()
GSettings * peas_plugin_info_get_settings (const PeasPluginInfo *info
,const gchar *schema_id
);
Creates a new GSettings for the given schema_id
and if
gschemas.compiled is not in the module directory an attempt
will be made to create it.
Since: 1.4
peas_plugin_info_get_dependencies ()
const gchar **
peas_plugin_info_get_dependencies (const PeasPluginInfo *info
);
Gets the dependencies of the plugin.
The PeasEngine will always ensure that the dependencies of a plugin are loaded when the said plugin is loaded. It means that dependencies are loaded before the plugin, and unloaded after it. Circular dependencies of plugins lead to undefined loading order.
The relevant key in the plugin info file is "Depends".
peas_plugin_info_has_dependency ()
gboolean peas_plugin_info_has_dependency (const PeasPluginInfo *info
,const gchar *module_name
);
Check if the plugin depends on another plugin.
peas_plugin_info_get_name ()
const gchar *
peas_plugin_info_get_name (const PeasPluginInfo *info
);
Gets the name of the plugin.
The name of a plugin should be a nice short string to be presented in UIs.
The relevant key in the plugin info file is "Name".
peas_plugin_info_get_description ()
const gchar *
peas_plugin_info_get_description (const PeasPluginInfo *info
);
Gets the description of the plugin.
The description of the plugin should be a string presenting the purpose of the plugin. It will typically be presented in a plugin's about box.
The relevant key in the plugin info file is "Description".
peas_plugin_info_get_icon_name ()
const gchar *
peas_plugin_info_get_icon_name (const PeasPluginInfo *info
);
Gets the icon name of the plugin.
The icon of the plugin will be presented in the plugin manager UI. If no icon is specified, the default green puzzle icon will be used.
The relevant key in the plugin info file is "Icon".
peas_plugin_info_get_help_uri ()
const gchar *
peas_plugin_info_get_help_uri (const PeasPluginInfo *info
);
Gets the help URI of the plugin.
The Help URI of a plugin will typically be presented by the plugin manager as a "Help" button linking to the URI. It can either be a HTTP URL on some website or a ghelp: URI if a Gnome help page is available for the plugin.
The relevant key in the plugin info file is "Help". Other platform-specific keys exist for platform-specific help files. Those are "Help-GNOME", "Help-Windows" and "Help-MacOS-X".
peas_plugin_info_get_authors ()
const gchar **
peas_plugin_info_get_authors (const PeasPluginInfo *info
);
Gets a NULL
-terminated array of strings with the authors of the plugin.
The relevant key in the plugin info file is "Authors".
peas_plugin_info_get_website ()
const gchar *
peas_plugin_info_get_website (const PeasPluginInfo *info
);
Gets the website of the plugin.
The relevant key in the plugin info file is "Website".
peas_plugin_info_get_copyright ()
const gchar *
peas_plugin_info_get_copyright (const PeasPluginInfo *info
);
Gets the copyright of the plugin.
The relevant key in the plugin info file is "Copyright".
peas_plugin_info_get_version ()
const gchar *
peas_plugin_info_get_version (const PeasPluginInfo *info
);
Gets the version of the plugin.
The relevant key in the plugin info file is "Version".
peas_plugin_info_get_external_data ()
const gchar * peas_plugin_info_get_external_data (const PeasPluginInfo *info
,const gchar *key
);
Gets external data specified for the plugin.
External data is specified in the plugin info file prefixed with X-. For
example, if a key/value pair X-Peas=1 is specified in the key file, you
can use "Peas" for key
to retrieve the value "1".
Note: that you can omit the X- prefix when retrieving the value, but not when specifying the value in the file.
Since: 1.6
Types and Values
PeasPluginInfo
typedef struct _PeasPluginInfo PeasPluginInfo;
The PeasPluginInfo structure contains only private data and should only be accessed using the provided API.