gplugin/gplugin

Merged in bugfix/docs-cleanup (pull request #30)
develop
2019-08-16, Gary Kramlich
07041918dfcd
Merged in bugfix/docs-cleanup (pull request #30)

Bugfix/docs cleanup

Approved-by: Elliott Sales de Andrade
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/HISTORY.md Fri Aug 16 04:23:26 2019 +0000
@@ -0,0 +1,41 @@
+GPlugin is a GObject based library that implements a reusable plugin system
+that supports loading plugins in other languages via loaders. GPlugin also
+implements dependencies among the plugins.
+
+It was started due to the infamous "Plugin Problem" for Guifications 3, which
+was that I needed plugins that could depend on each other, be able to be
+written in other languages, have plugins that are loaded before the main load
+phase, and allow plugins to register types into the GObject type system.
+
+After trying to fix this numerous times in the Guifications 3 tree, I decided
+I should really do this the UNIX way and write it as a stand alone library.
+
+During this time, I also got the idea that there was a good chance that someone
+probably beat me to this... So I started searching and came across libpeas.
+
+Libpeas looked promising, but there was a few things about it that I really
+didn't care for. First of all, the plugin information (id, name, author, etc)
+are in a separate data file that gets stored in a separate location on disk.
+
+Getting people to write good plugins is difficult enough as it is, why bother
+throwing more obstacles in their way? This data file is a essentially a
+GKeyFile, which means you can store the translations of all the fields right in
+it. Now this is great if your plugin doesn't have any strings to display at
+runtime, but if it does, you still need to install the translation file itself.
+So as long as your plugin has to display strings at runtime, all that data file
+gave you was more work. So there was STRIKE ONE!
+
+So I continued to look at libpeas and noticed something odd in the earlier
+mentioned data file. One of the fields you have to set is the Loader!? Yes,
+the libpeas authors explicitly expect you to call out which loader you need. I
+personally find this to be very lazy. I realize it makes it easier to code,
+but come on, that should be a one time cost to the library author, instead of
+an additional startup cost to the plugin author. STRIKE TWO!
+
+So with two strikes down, I continued researching libpeas, by now working on a
+plugin for rhythmbox, and just found the API to be clunky and poorly
+documented. Now maybe I just wasn't finding the write documentation, but this
+was STRIKE THREE!
+
+Libpeas had struck out for me, and as such I started GPlugin the very next day!
+
--- a/README Wed Aug 14 05:55:03 2019 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,41 +0,0 @@
-GPlugin is a GObject based library that implements a reusable plugin system
-that supports loading plugins in other languages via loaders. GPlugin also
-implements dependencies among the plugins.
-
-It was started due to the infamous "Plugin Problem" for Guifications 3, which
-was that I needed plugins that could depend on each other, be able to be
-written in other languages, have plugins that are loaded before the main load
-phase, and allow plugins to register types into the GObject type system.
-
-After trying to fix this numerous times in the Guifications 3 tree, I decided
-I should really do this the UNIX way and write it as a stand alone library.
-
-During this time, I also got the idea that there was a good chance that someone
-probably beat me to this... So I started searching and came across libpeas.
-
-Libpeas looked promising, but there was a few things about it that I really
-didn't care for. First of all, the plugin information (id, name, author, etc)
-are in a separate data file that gets stored in a separate location on disk.
-
-Getting people to write good plugins is difficult enough as it is, why bother
-throwing more obstacles in their way? This data file is a essentially a
-GKeyFile, which means you can store the translations of all the fields right in
-it. Now this is great if your plugin doesn't have any strings to display at
-runtime, but if it does, you still need to install the translation file itself.
-So as long as your plugin has to display strings at runtime, all that data file
-gave you was more work. So there was STRIKE ONE!
-
-So I continued to look at libpeas and noticed something odd in the earlier
-mentioned data file. One of the fields you have to set is the Loader!? Yes,
-the libpeas authors explicitly expect you to call out which loader you need. I
-personally find this to be very lazy. I realize it makes it easier to code,
-but come on, that should be a one time cost to the library author, instead of
-an additional startup cost to the plugin author. STRIKE TWO!
-
-So with two strikes down, I continued researching libpeas, by now working on a
-plugin for rhythmbox, and just found the API to be clunky and poorly
-documented. Now maybe I just wasn't finding the write documentation, but this
-was STRIKE THREE!
-
-Libpeas had struck out for me, and as such I started GPlugin the very next day!
-
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/README.md Fri Aug 16 04:23:26 2019 +0000
@@ -0,0 +1,32 @@
+# GPlugin
+
+GPlugin is a GObject based library that implements a reusable plugin system.
+It supports loading plugins in multiple other languages via loaders. It relies
+heavily on [GObjectIntrospection](https://gi.readthedocs.io/) to expose its API
+to the other languages.
+
+It has a simple API which makes it very easy to use in your application.
+For more information on using GPlugin in your application, please see the
+[embedding](Embedding) page.
+
+## Build Status
+
+Default: [![Default Build Status](https://bamboo.pidgin.im/plugins/servlet/wittified/build-status/GPLUG-GPLUGIN)](https://bamboo.pidgin.im/browse/GPLUG-GPLUGIN)
+
+Develop: [![Develop Build Status](https://bamboo.pidgin.im/plugins/servlet/wittified/build-status/GPLUG-GPLUGIN0)](https://bamboo.pidgin.im/browse/GPLUG-GPLUGIN0/)
+
+## History
+
+GPlugin has a bit of history, you can read more about it in [HISTORY.md](HISTORY.md)
+
+## Language Support
+
+GPlugin currently supports plugins written in C/C++, Lua, Python, and Vala.
+
+## API Reference
+
+The API reference for the `default` branch can be found at
+[docs.pidgin.im/gplugin/default](https://docs.pidgin.im/gplugin/default).
+
+The in-development API reference for the `develop` branch can be found at
+[docs.pidgin.im/gplugin/develop](https://docs.pidgin.im/gplugin/develop).
--- a/gplugin-gtk/gplugin-gtk-plugin-info.c Wed Aug 14 05:55:03 2019 +0000
+++ b/gplugin-gtk/gplugin-gtk-plugin-info.c Fri Aug 16 04:23:26 2019 +0000
@@ -27,6 +27,18 @@
* #GPluginGtkPluginInfo is a Gtk+ widget that shows information about plugins.
*/
+/**
+ * GPLUGIN_GTK_TYPE_PLUGIN_INFO:
+ *
+ * The standard _get_type macro for #GPluginGtkPluginInfo.
+ */
+
+/**
+ * GPluginGtkPluginInfo:
+ *
+ * A widget that displays a #GPluginPluginInfo in a user friendly way.
+ */
+
/******************************************************************************
* Structs
*****************************************************************************/
--- a/gplugin-gtk/gplugin-gtk-store.c Wed Aug 14 05:55:03 2019 +0000
+++ b/gplugin-gtk/gplugin-gtk-store.c Fri Aug 16 04:23:26 2019 +0000
@@ -27,6 +27,27 @@
* #GPluginGtkStore is a GtkTreeModel populated with gplugins.
*/
+/**
+ * GPLUGIN_GTK_TYPE_STORE:
+ *
+ * The standard _get_type macro for #GPluginGtkStore.
+ */
+
+/**
+ * GPluginGtkStoreColumns:
+ * @GPLUGIN_GTK_STORE_LOADED_COLUMN: The loaded column.
+ * @GPLUGIN_GTK_STORE_PLUGIN_COLUMN: The plugin column.
+ * @GPLUGIN_GTK_STORE_MARKUP_COLUMN: The markup column.
+ *
+ * An enum declaring the columns in a #GPluginGtkStore.
+ */
+
+/**
+ * GPluginGtkStore:
+ *
+ * A #GtkListStore that contains all of the known plugins in GPlugin.
+ */
+
struct _GPluginGtkStore {
GtkListStore parent;
};
--- a/gplugin-gtk/gplugin-gtk-store.h Wed Aug 14 05:55:03 2019 +0000
+++ b/gplugin-gtk/gplugin-gtk-store.h Fri Aug 16 04:23:26 2019 +0000
@@ -36,6 +36,8 @@
GPLUGIN_GTK_STORE_LOADED_COLUMN,
GPLUGIN_GTK_STORE_PLUGIN_COLUMN,
GPLUGIN_GTK_STORE_MARKUP_COLUMN,
+
+ /*< private >*/
GPLUGIN_GTK_STORE_N_COLUMNS,
} GPluginGtkStoreColumns;
--- a/gplugin-gtk/gplugin-gtk-view.c Wed Aug 14 05:55:03 2019 +0000
+++ b/gplugin-gtk/gplugin-gtk-view.c Fri Aug 16 04:23:26 2019 +0000
@@ -26,6 +26,19 @@
* #GPluginGtkView is a display widget for a list of GPlugins.
*/
+/**
+ * GPLUGIN_GTK_TYPE_VIEW:
+ *
+ * The standard _get_type macro for #GPluginGtkView.
+ */
+
+/**
+ * GPluginGtkView:
+ *
+ * A #GtkTreeView widget that displays all the plugins and some basic
+ * information about them.
+ */
+
/******************************************************************************
* Structs
*****************************************************************************/
--- a/gplugin-gtk/reference/meson.build Wed Aug 14 05:55:03 2019 +0000
+++ b/gplugin-gtk/reference/meson.build Fri Aug 16 04:23:26 2019 +0000
@@ -3,6 +3,7 @@
# Header files or dirs to ignore when scanning. Use base file/dir names
ignore_hfiles = [
'gplugin-gtk.h',
+ 'gplugin-gtk-resources.h',
]
ignore_hfiles += GPLUGIN_GTK_PRIVATE_HEADERS
@@ -11,12 +12,10 @@
'--deprecated-guards=GPLUGIN_GTK_DISABLE_DEPRECATED',
'--rebuild-types',
'--rebuild-sections',
- '--ignore-headers=' + ' '.join(ignore_hfiles),
]
-# Extra options to supply to gtkdoc-mkdb.
-mkdb_args = [
- '--ignore-files=' + ' '.join(ignore_hfiles),
+fixxref_args = [
+ '--extra-dir', join_paths(meson.current_build_dir(), '../../gplugin/reference')
]
gplugin_gtk_version_xml = configure_file(
@@ -31,9 +30,10 @@
main_xml : DOC_MODULE + '-docs.xml',
src_dir : gplugin_gtk_inc,
dependencies : gplugin_gtk_dep,
+ ignore_headers : ignore_hfiles,
install : true,
scan_args : scan_args,
- mkdb_args : mkdb_args,
gobject_typesfile : DOC_MODULE + '.types',
content_files : content_files,
+ fixxref_args : fixxref_args,
)
--- a/gplugin/gplugin-loader.c Wed Aug 14 05:55:03 2019 +0000
+++ b/gplugin/gplugin-loader.c Fri Aug 16 04:23:26 2019 +0000
@@ -20,6 +20,12 @@
#include <gplugin/gplugin-core.h>
/**
+ * GPLUGIN_TYPE_LOADER:
+ *
+ * The standard _get_type macro for #GPluginLoader.
+ */
+
+/**
* SECTION:gplugin-loader
* @Title: Plugin Loader Interface
* @Short_description: interface for loading plugins
@@ -28,6 +34,27 @@
* be able to use it to load plugins.
*/
+/**
+ * GPluginLoader:
+ *
+ * An abstract data type that should not be accessed directly.
+ */
+
+/**
+ * GPluginLoaderClass:
+ * @supported_extensions: The supported_extensions vfunc returns a #GList of
+ * file extensions that this loader supports without the
+ * leading dot. For example: 'so', 'dll', 'py', etc.
+ * @query: The query vfunc is called when the plugin manager needs to query a
+ * plugin that has a file extension from @supported_extensions.
+ * @load: The load vfunc is called when the plugin manager wants to load a
+ * plugin that was previously queried by this loader.
+ * @unload: The unload vfunc is called when the plugin manager wants to unload
+ * a previously loaded plugin from this loader.
+ *
+ * #GPluginLoader class defines the behavior for loading plugins.
+ */
+
/******************************************************************************
* GObject Stuff
*****************************************************************************/
--- a/gplugin/gplugin-loader.h Wed Aug 14 05:55:03 2019 +0000
+++ b/gplugin/gplugin-loader.h Fri Aug 16 04:23:26 2019 +0000
@@ -34,15 +34,18 @@
#include <gplugin/gplugin-plugin.h>
struct _GPluginLoaderClass {
+ /*< private >*/
GObjectClass gparent;
- GSList *(*supported_extensions)(const GPluginLoaderClass *klass);
+ /*< public >*/
+ GSList *(*supported_extensions)(GPluginLoaderClass *klass);
GPluginPlugin *(*query)(GPluginLoader *loader, const gchar *filename, GError **error);
gboolean (*load)(GPluginLoader *loader, GPluginPlugin *plugin, GError **error);
gboolean (*unload)(GPluginLoader *loader, GPluginPlugin *plugin, GError **error);
+ /*< private >*/
gpointer reserved[4];
};
--- a/gplugin/gplugin-native-loader.c Wed Aug 14 05:55:03 2019 +0000
+++ b/gplugin/gplugin-native-loader.c Fri Aug 16 04:23:26 2019 +0000
@@ -39,6 +39,18 @@
*/
/**
+ * GPLUGIN_TYPE_NATIVE_LOADER:
+ *
+ * The standard _get_type macro for #GPluginNativeLoader.
+ */
+
+/**
+ * GPluginNativeLoader:
+ *
+ * A #GPluginLoader subclass that is able to load native plugins.
+ */
+
+/**
* GPLUGIN_NATIVE_PLUGIN_ABI_VERSION:
*
* The ABI version of the #GPluginNativeLoader. Your plugin should use this
--- a/gplugin/gplugin-native-plugin.c Wed Aug 14 05:55:03 2019 +0000
+++ b/gplugin/gplugin-native-plugin.c Fri Aug 16 04:23:26 2019 +0000
@@ -35,6 +35,19 @@
* language.
*/
+/**
+ * GPLUGIN_TYPE_NATIVE_PLUGIN:
+ *
+ * The standard _get_type macro for #GPluginNativePlugin.
+ */
+
+/**
+ * GPluginNativePlugin:
+ *
+ * An instance of a loaded native plugin. A native plugin is a plugin that was
+ * compiled to machine native code, typically these are written in C/C++.
+ */
+
/******************************************************************************
* Structs
*****************************************************************************/
--- a/gplugin/gplugin-plugin-info.c Wed Aug 14 05:55:03 2019 +0000
+++ b/gplugin/gplugin-plugin-info.c Fri Aug 16 04:23:26 2019 +0000
@@ -29,6 +29,25 @@
* #GPluginPluginInfo holds metadata for plugins.
*/
+/**
+ * GPLUGIN_TYPE_PLUGIN_INFO:
+ *
+ * The standard _get_type macro for #GPluginPluginInfo.
+ */
+
+/**
+ * GPluginPluginInfo:
+ *
+ * #GPluginPluginInfo holds all of the data about a plugin. It is created when
+ * a plugin is queried.
+ */
+
+/**
+ * GPluginPluginInfoClass:
+ *
+ * The class structure for #GPluginPluginInfo.
+ */
+
/******************************************************************************
* Structs
*****************************************************************************/
--- a/gplugin/gplugin-plugin-info.h Wed Aug 14 05:55:03 2019 +0000
+++ b/gplugin/gplugin-plugin-info.h Fri Aug 16 04:23:26 2019 +0000
@@ -34,6 +34,7 @@
#include <gplugin/gplugin-version.h>
struct _GPluginPluginInfoClass {
+ /*< private >*/
GInitiallyUnownedClass gparent;
gpointer reserved[4];
--- a/gplugin/gplugin-plugin.c Wed Aug 14 05:55:03 2019 +0000
+++ b/gplugin/gplugin-plugin.c Fri Aug 16 04:23:26 2019 +0000
@@ -43,6 +43,26 @@
* The expected states of a plugin.
*/
+/**
+ * GPLUGIN_TYPE_PLUGIN:
+ *
+ * The standard _get_type macro for #GPluginPlugin.
+ */
+
+/**
+ * GPluginPlugin:
+ *
+ * #GPluginPlugin is an opaque data structure and should not be used directly.
+ */
+
+/**
+ * GPluginPluginInterface:
+ * @state_changed: The class closure for the #GPluginPlugin::state-changed signal.
+ *
+ * The interface that defines the behavior of plugins, including properties and
+ * signals.
+ */
+
/******************************************************************************
* Enums
*****************************************************************************/
--- a/gplugin/gplugin-plugin.h Wed Aug 14 05:55:03 2019 +0000
+++ b/gplugin/gplugin-plugin.h Fri Aug 16 04:23:26 2019 +0000
@@ -50,6 +50,7 @@
/*< private >*/
GTypeInterface parent;
+ /*< public >*/
void (*state_changed)(GPluginPlugin *plugin, GPluginPluginState oldstate, GPluginPluginState newstate);
/*< private >*/
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/gplugin/reference/embedding.xml Fri Aug 16 04:23:26 2019 +0000
@@ -0,0 +1,54 @@
+<?xml version='1.0' encoding="UTF-8"?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
+ "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" [
+]>
+<chapter id="chapter-embedding">
+ <title>Embedding GPlugin</title>
+
+ <simplesect id="intro">
+ <para>
+ You can embed GPlugin into any language that has GObject-Introspection
+ support, but in this example we're going to look at embedding GPlugin
+ into a C based project.
+ </para>
+
+ <para>
+ Using GPlugin is pretty simple and I'd like to think straight forward
+ since that's the way I designed it.
+ </para>
+ </simplesect>
+
+ <simplesect id="initialization">
+ <para>
+ During the start up of your application you need to add the following
+ code:
+ <informalexample><programlisting>
+ /* Initialize the GPlugin library */
+ gplugin_init();
+
+ /* Tell GPlugin to look for plugins in its default paths */
+ gplugin_manager_add_default_paths();
+
+ /* Optionally tell GPlugin to look for plugins in application specific
+ * paths.
+ */
+ gplugin_manager_add_app_paths(PREFIX, "application");
+
+ /* Once you're ready to find/load plugins call g_plugin_manager_refresh.
+ */
+ gplugin_manager_refresh();
+
+ </programlisting></informalexample>
+ </para>
+ </simplesect>
+
+ <simplesect id="shutdown">
+ <para>
+ When your application is shutting down you need to uninitialize GPlugin
+ by calling
+ <informalexample><programlisting>
+ gplugin_uninit();
+ </programlisting></informalexample>
+ </para>
+ </simplesect>
+</chapter>
\ No newline at end of file
--- a/gplugin/reference/gplugin-docs.xml Wed Aug 14 05:55:03 2019 +0000
+++ b/gplugin/reference/gplugin-docs.xml Fri Aug 16 04:23:26 2019 +0000
@@ -19,6 +19,15 @@
</abstract>
</bookinfo>
+ <part id="tutorials">
+ <title>Tutorials</title>
+
+ <xi:include href="embedding.xml"/>
+ <xi:include href="native-plugins.xml"/>
+ <xi:include href="lua.xml"/>
+ <xi:include href="python.xml"/>
+ </part>
+
<part id="object-hierarchy">
<title>Object Hierarchy</title>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/gplugin/reference/lua.xml Fri Aug 16 04:23:26 2019 +0000
@@ -0,0 +1,56 @@
+<?xml version='1.0' encoding="UTF-8"?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
+ "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" [
+]>
+<chapter id="chapter-lua">
+ <title>Lua Plugins</title>
+
+ <warning>
+ <para>
+ You <emphasis role="strong">MUST</emphasis> have the Lua loader
+ plugin installed and working as well as the gobject-introspection
+ package for GPlugin installed to use Lua plugins.
+ </para>
+ </warning>
+
+ <simplesect>
+ <title>Example Lua Plugin</title>
+
+ <para>
+ Like all plugins in GPlugin, Lua plugins must also implement
+ the <code>gplugin_query</code>, <code>gplugin_load</code>, and
+ <code>gplugin_unload</code> functions.
+ </para>
+
+ <para>
+ The following is a basic Lua plugin.
+ <informalexample><programlisting>
+ local lgi = require 'lgi'
+ local GPlugin = lgi.GPlugin
+
+ function gplugin_query()
+ return GPlugin.PluginInfo {
+ id = "gplugin-lua/basic-plugin",
+ abi_version = 0x01020304,
+ name = "basic plugin",
+ category = "test",
+ version = "0.0.10",
+ license_id = "license-id",
+ summary = "basic lua plugin",
+ description = "description of the basic lua plugin",
+ authors = { "Gary Kramlich &lt;grim@reaperworld.com&gt;" },
+ website = "https://bitbucket.org/gplugin/gplugin/"
+ }
+ end
+
+ function gplugin_load(plugin)
+ return true
+ end
+
+ function gplugin_unload(plugin)
+ return true
+ end
+ </programlisting></informalexample>
+ </para>
+ </simplesect>
+</chapter>
--- a/gplugin/reference/meson.build Wed Aug 14 05:55:03 2019 +0000
+++ b/gplugin/reference/meson.build Fri Aug 16 04:23:26 2019 +0000
@@ -2,13 +2,13 @@
# Header files or dirs to ignore when scanning. Use base file/dir names
ignore_hfiles = [
- 'gplugin.h',
- 'gplugin-private.h',
+ 'dynamic-test.h',
+ 'gplugin-enums.h',
'gplugin-loader-tests.h',
- 'gplugin-marshallers.h',
+ 'gplugin-native-private.h',
'gplugin-native.h',
- 'gplugin-native-private.h',
- 'dynamic-test.h',
+ 'gplugin-private.h',
+ 'gplugin.h',
]
ignore_hfiles += GPLUGIN_PRIVATE_HEADERS
@@ -17,12 +17,6 @@
'--deprecated-guards=GPLUGIN_DISABLE_DEPRECATED',
'--rebuild-types',
'--rebuild-sections',
- '--ignore-headers=' + ' '.join(ignore_hfiles),
-]
-
-# Extra options to supply to gtkdoc-mkdb.
-mkdb_args = [
- '--ignore-files=' + ' '.join(ignore_hfiles),
]
gplugin_version_xml = configure_file(
@@ -31,15 +25,19 @@
configuration : version_conf)
content_files = [
+ 'embedding.xml',
+ 'lua.xml',
+ 'native-plugins.xml',
+ 'python.xml',
]
gnome.gtkdoc(DOC_MODULE,
main_xml : DOC_MODULE + '-docs.xml',
src_dir : gplugin_inc,
dependencies : gplugin_dep,
+ ignore_headers : ignore_hfiles,
install : true,
scan_args : scan_args,
- mkdb_args : mkdb_args,
gobject_typesfile : DOC_MODULE + '.types',
content_files : content_files,
)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/gplugin/reference/native-plugins.xml Fri Aug 16 04:23:26 2019 +0000
@@ -0,0 +1,80 @@
+<?xml version='1.0' encoding="UTF-8"?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
+ "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" [
+]>
+<chapter id="chapter-native-plugins">
+ <title>Writing Native Plugins</title>
+
+ <simplesect id="intro">
+ <para>
+ Writing Native plugins is very simple, but since it's C/C++ it's a bit
+ more complicated.
+ </para>
+
+ <para>
+ There are currently no C++ bindings and no intention to write them, but
+ the C API is still usable from C++.
+ </para>
+ </simplesect>
+
+ <simplesect id="example">
+ <para>
+ <informalexample><programlisting>
+ #include &lt;gplugin.h&gt;
+ #include &lt;gplugin-native.h&gt;
+
+ /* gplugin_plugin_query is called by the native loader to determine if
+ * the plugin is loadable. It must have this signature and should
+ * return a valid GPluginPluginInfo if everything is fine. If something
+ * went wrong, error should be set to a valid GError and NULL should be
+ * returned.
+ */
+ G_MODULE_EXPORT GPluginPluginInfo *
+ gplugin_plugin_query(GError **error) {
+ /* Authors is a list of authors of the plugin. Generally these are
+ * in the "Name Surname &lt;user@domain.com&gt;" format.
+ */
+ const gchar * const authors[] = {
+ "author",
+ NULL
+ };
+
+ /* gplugin_plugin_info_new only requires that the id be set, and the
+ * rest are here for demonstration purposes.
+ */
+ return gplugin_plugin_info_new(
+ "gplugin/basic-native-plugin",
+ GPLUGIN_NATIVE_PLUGIN_ABI_VERSION,
+ "name", "name",
+ "version", "version",
+ "summary", "summary",
+ "description", "description",
+ "authors", authors,
+ "website", "website",
+ NULL
+ );
+ }
+
+ /* gplugin_plugin_load is called by the loader when the plugin should
+ * be loaded. It must have this exact signature and return TRUE if
+ * loading was successful, otherwise it should return FALSE with error
+ * set to a valid GError.
+ */
+ G_MODULE_EXPORT gboolean
+ gplugin_plugin_load(GPluginNativePlugin *plugin, GError **error) {
+ return TRUE;
+ }
+
+ /* gplugin_plugin_unload is called by the loader when the plugin should
+ * be unloaded. It must have this exact signature and should return TRUE
+ * if unloading was successful, otherwise it should return FALSE with
+ * error set to a valid GError.
+ */
+ G_MODULE_EXPORT gboolean
+ gplugin_plugin_unload(GPluginNativePlugin *plugin, GError **error) {
+ return TRUE;
+ }
+ </programlisting></informalexample>
+ </para>
+ </simplesect>
+</chapter>
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/gplugin/reference/python.xml Fri Aug 16 04:23:26 2019 +0000
@@ -0,0 +1,56 @@
+<?xml version='1.0' encoding="UTF-8"?>
+<!DOCTYPE chapter PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
+ "http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" [
+]>
+<chapter id="chapter-python">
+ <title>Python Plugins</title>
+
+ <warning>
+ <para>
+ You <emphasis role="strong">MUST</emphasis> have the Python loader
+ plugin installed and working as well as the gobject-introspection
+ package for GPlugin installed to use Python plugins.
+ </para>
+ </warning>
+
+ <simplesect>
+ <title>Example Python Plugin</title>
+
+ <para>
+ Like all plugins in GPlugin, Python plugins must also implement
+ the <code>gplugin_query</code>, <code>gplugin_load</code>, and
+ <code>gplugin_unload</code> functions.
+ </para>
+
+ <para>
+ The following is a basic Python plugin.
+ <informalexample><programlisting>
+ import gi
+
+ gi.require_version('GPlugin', '0.0')
+ from gi.repository import GPlugin
+
+ def gplugin_plugin_query():
+ return GPlugin.PluginInfo(
+ id='gplugin-python/basic-plugin',
+ abi_version=0x01020304,
+ name='basic plugin',
+ authors=['author1'],
+ category='test',
+ version='version',
+ license_id='license',
+ summary='summary',
+ website='website',
+ description='description',
+ )
+
+ def gplugin_plugin_load(plugin):
+ return True
+
+
+ def gplugin_plugin_unload(plugin):
+ return True
+ </programlisting></informalexample>
+ </para>
+ </simplesect>
+</chapter>
--- a/meson.build Wed Aug 14 05:55:03 2019 +0000
+++ b/meson.build Fri Aug 16 04:23:26 2019 +0000
@@ -110,6 +110,6 @@
# Install stuff
###############################################################################
# documentation
-install_data('ChangeLog', 'INSTALL', 'README', 'HACKING',
+install_data('ChangeLog', 'INSTALL.md', 'README.md', 'HACKING',
install_dir : join_paths(get_option('datadir'), 'doc', 'gplugin'))
--- a/packaging/gplugin.spec.in Wed Aug 14 05:55:03 2019 +0000
+++ b/packaging/gplugin.spec.in Fri Aug 16 04:23:26 2019 +0000
@@ -195,7 +195,7 @@
%files
%defattr(-,root,root)
-%doc README ChangeLog
+%doc README.md ChangeLog
%{_bindir}/gplugin-query
%{_libdir}/gplugin/
%{_mandir}/man1/gplugin-query.1*
@@ -206,7 +206,7 @@
%files devel
%defattr(-,root,root)
-%doc HACKING README
+%doc HACKING README.md
%{_datadir}/gir-1.0/GPlugin-0.0.gir
%{_datadir}/gtk-doc/html/gplugin/
%{_includedir}/gplugin-1.0/
@@ -218,7 +218,7 @@
%files gtk3
%defattr(-,root,root)
-%doc README
+%doc README.md
%{_bindir}/gplugin-gtk-viewer
%{_libdir}/libgplugin-gtk.so.0.1.0
%{_mandir}/man1/gplugin-gtk-viewer.1*
@@ -226,7 +226,7 @@
%files gtk3-devel
%defattr(-,root,root)
%dir %{_datadir}/glade/catalogs/
-%doc README
+%doc README.md
%{_datadir}/gir-1.0/GPluginGtk-0.0.gir
%{_datadir}/glade/catalogs/gplugin-gtk.xml
%{_datadir}/gtk-doc/html/gplugin-gtk/
@@ -236,25 +236,25 @@
%files lua
%defattr(-,root,root)
-%doc README
+%doc README.md
%license COPYING
%{_libdir}/gplugin/gplugin-lua.so
%files python3
%defattr(-,root,root)
-%doc README
+%doc README.md
%{_libdir}/gplugin/gplugin-python.so
%files vala
%defattr(-,root,root)
-%doc README
+%doc README.md
%license COPYING
%{_datadir}/vala/vapi/gplugin.vapi
%{_datadir}/vala/vapi/gplugin.deps
%files gtk3-vala
%defattr(-,root,root)
-%doc README
+%doc README.md
%license COPYING
%{_datadir}/vala/vapi/gplugin-gtk.vapi
%{_datadir}/vala/vapi/gplugin-gtk.deps