gplugin/gplugin

Merged in feature/vala-docs (pull request #32)
develop
2019-08-27, Gary Kramlich
a8741522bdf3
Merged in feature/vala-docs (pull request #32)

Added Vala docs and mention it in the ChangeLog

Approved-by: Elliott Sales de Andrade
--- a/ChangeLog Fri Aug 23 08:31:01 2019 +0000
+++ b/ChangeLog Tue Aug 27 01:56:02 2019 +0000
@@ -14,6 +14,8 @@
(Elliott Sales de Andrade)
* Replaced GPLUGIN_UNUSED with G_GNUC_UNUSED (PR #6) (Elliott Sales de
Andrade)
+ * Created VAPI for Vala Bindings. (#76)
+ * Added docs for Vala. (#76)
Python Loader
* Use Py_CLEAR and Py_XINCREF on private attributes (PR #6) (Elliott Sales de
--- a/gplugin/reference/gplugin-docs.xml Fri Aug 23 08:31:01 2019 +0000
+++ b/gplugin/reference/gplugin-docs.xml Tue Aug 27 01:56:02 2019 +0000
@@ -26,6 +26,7 @@
<xi:include href="native-plugins.xml"/>
<xi:include href="lua.xml"/>
<xi:include href="python.xml"/>
+ <xi:include href="vala.xml"/>
</part>
<part id="object-hierarchy">
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/gplugin/reference/vala.xml Tue Aug 27 01:56:02 2019 +0000
@@ -0,0 +1,74 @@
+<?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-vala">
+ <title>Vala Plugins</title>
+
+ <warning>
+ <para>
+ You <emphasis role="strong">MUST</emphasis> have the Vala bindings
+ installed on your system for this to work. They are built by the
+ default GPlugin build.
+ </para>
+ </warning>
+
+ <simplesect>
+ <title>Example Vala Plugin</title>
+
+ <para>
+ Like all plugins in GPlugin, Vala plugins must also implement
+ the <code>gplugin_query</code>, <code>gplugin_load</code>, and
+ <code>gplugin_unload</code> functions.
+ </para>
+
+ <para>
+ Due to the way <code>GPlugin.PluginInfo</code> info works, you must
+ subclass it and set your values in the new constructor.
+ </para>
+
+ <para>
+ The following is a basic Vala plugin.
+ <informalexample><programlisting>
+ using GPlugin;
+
+ public class BasicPluginInfo : GPlugin.PluginInfo {
+ public BasicPluginInfo() {
+ string[] authors = {"author1"};
+
+ Object(
+ id: "gplugin/vala-basic-plugin",
+ abi_version: 0x01020304,
+ name: "basic plugin",
+ authors: authors,
+ category: "test",
+ version: "version",
+ license_id: "license",
+ summary: "summary",
+ website: "website",
+ description: "description"
+ );
+ }
+ }
+
+ public GPlugin.PluginInfo gplugin_query(out Error error) {
+ error = null;
+
+ return new BasicPluginInfo();
+ }
+
+ public bool gplugin_load(GPlugin.Plugin plugin, out Error error) {
+ error = null;
+
+ return true;
+ }
+
+ public bool gplugin_unload(GPlugin.Plugin plugin, out Error error) {
+ error = null;
+
+ return true;
+ }
+ </programlisting></informalexample>
+ </para>
+ </simplesect>
+</chapter>