summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonny Lamb <jonny.lamb@collabora.co.uk>2011-02-07 11:44:15 +0000
committerJonny Lamb <jonny.lamb@collabora.co.uk>2011-02-07 11:44:15 +0000
commitaacd617f299de8836b41383634c452060f0dcf4f (patch)
treebfd600b8701b490f04b65ec6f94ff121f791aa88
parentfc8261c9098be490635c7f6eea3fa47d0a134263 (diff)
downloadtelepathy-salut-aacd617f299de8836b41383634c452060f0dcf4f.tar.gz
plugins: start defining SalutPlugin interface
Signed-off-by: Jonny Lamb <jonny.lamb@collabora.co.uk>
-rw-r--r--.gitignore3
-rw-r--r--Makefile.am2
-rw-r--r--configure.ac3
-rw-r--r--salut/Makefile.am9
-rw-r--r--salut/plugin.h76
-rw-r--r--salut/telepathy-salut-uninstalled.pc.in15
-rw-r--r--salut/telepathy-salut.pc.in15
7 files changed, 122 insertions, 1 deletions
diff --git a/.gitignore b/.gitignore
index 43195e47..a48cf548 100644
--- a/.gitignore
+++ b/.gitignore
@@ -143,3 +143,6 @@ lib/gibber/tests/outputs
lib/gibber/tests/sasl-test.db
lib/gibber/tests/test-xmpp-connection
lib/gibber/tests/test-r-multicast-transport-io
+
+salut/telepathy-salut.pc
+salut/telepathy-salut-uninstalled.pc
diff --git a/Makefile.am b/Makefile.am
index e4278cdf..a797140d 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,6 +1,6 @@
ACLOCAL_AMFLAGS = -I m4
-SUBDIRS = tools extensions lib src data m4 tests docs
+SUBDIRS = tools extensions lib src data m4 tests docs salut
DISTCHECK_CONFIGURE_FLAGS = --disable-debug --enable-gtk-doc
diff --git a/configure.ac b/configure.ac
index bdc374ce..5012aece 100644
--- a/configure.ac
+++ b/configure.ac
@@ -259,4 +259,7 @@ AC_OUTPUT( Makefile \
tests/Makefile \
tests/twisted/Makefile \
tests/twisted/tools/Makefile \
+ salut/Makefile \
+ salut/telepathy-salut-uninstalled.pc \
+ salut/telepathy-salut.pc
)
diff --git a/salut/Makefile.am b/salut/Makefile.am
new file mode 100644
index 00000000..c4e4b1aa
--- /dev/null
+++ b/salut/Makefile.am
@@ -0,0 +1,9 @@
+if ENABLE_PLUGIN_API
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = telepathy-salut.pc
+
+salutincludedir = $(includedir)/telepathy-salut-0/salut
+salutinclude_HEADERS = \
+ plugin.h
+
+endif
diff --git a/salut/plugin.h b/salut/plugin.h
new file mode 100644
index 00000000..83ba6a8c
--- /dev/null
+++ b/salut/plugin.h
@@ -0,0 +1,76 @@
+/*
+ * plugin.h — plugin API for telepathy-salut plugins
+ * Copyright © 2009-2011 Collabora Ltd.
+ * Copyright © 2009 Nokia Corporation
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef SALUT_PLUGINS_PLUGIN_H
+#define SALUT_PLUGINS_PLUGIN_H
+
+#include <glib-object.h>
+
+G_BEGIN_DECLS
+
+#define SALUT_TYPE_PLUGIN (salut_plugin_get_type ())
+#define SALUT_PLUGIN(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST ((obj), SALUT_TYPE_PLUGIN, SalutPlugin))
+#define SALUT_IS_PLUGIN(obj) \
+ (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SALUT_TYPE_PLUGIN))
+#define SALUT_PLUGIN_GET_INTERFACE(obj) \
+ (G_TYPE_INSTANCE_GET_INTERFACE ((obj), SALUT_TYPE_PLUGIN, \
+ SalutPluginInterface))
+
+typedef struct _SalutPlugin SalutPlugin;
+typedef struct _SalutPluginInterface SalutPluginInterface;
+
+struct _SalutPluginInterface
+{
+ GTypeInterface parent;
+
+ /**
+ * The plugin's version, conventionally a "."-separated sequence of
+ * numbers.
+ */
+ const gchar *version;
+
+ /**
+ * An arbitrary human-readable name identifying this plugin.
+ */
+ const gchar *name;
+};
+
+GType salut_plugin_get_type (void);
+
+const gchar * salut_plugin_get_name (
+ SalutPlugin *plugin);
+const gchar * salut_plugin_get_version (
+ SalutPlugin *plugin);
+
+/**
+ * salut_plugin_create:
+ *
+ * Prototype for the plugin entry point.
+ *
+ * Returns: a new instance of this plugin, which must not be %NULL.
+ */
+SalutPlugin * salut_plugin_create (void);
+
+typedef SalutPlugin * (*SalutPluginCreateImpl) (void);
+
+G_END_DECLS
+
+#endif
diff --git a/salut/telepathy-salut-uninstalled.pc.in b/salut/telepathy-salut-uninstalled.pc.in
new file mode 100644
index 00000000..869c16b9
--- /dev/null
+++ b/salut/telepathy-salut-uninstalled.pc.in
@@ -0,0 +1,15 @@
+prefix=
+exec_prefix=
+abs_top_srcdir=@abs_top_srcdir@
+abs_top_builddir=@abs_top_builddir@
+libdir=@libdir@
+
+plugindir=${libdir}/telepathy/salut-0
+salutpath=@abs_top_builddir@/src/telepathy-salut # For plugins' tests
+
+Name: Telepathy-Salut
+Description: XMPP backend for the Telepathy framework
+Version: @VERSION@
+Requires: pkg-config >= 0.21
+Requires.private: glib-2.0 >= 2.16, gobject-2.0 >= 2.16, gio-2.0, telepathy-glib >= 0.7.37
+Cflags: -I${abs_top_srcdir} -I${abs_top_srcdir}/lib/ext/wocky
diff --git a/salut/telepathy-salut.pc.in b/salut/telepathy-salut.pc.in
new file mode 100644
index 00000000..9af1def1
--- /dev/null
+++ b/salut/telepathy-salut.pc.in
@@ -0,0 +1,15 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+libexecdir=@libexecdir@
+
+plugindir=${libdir}/telepathy/salut-0
+salutpath=${libexecdir}/telepathy-salut # For plugins' tests
+
+Name: Telepathy-Salut
+Description: XMPP backend for the Telepathy framework
+Version: @VERSION@
+Requires: pkg-config >= 0.21
+Requires.private: glib-2.0 >= 2.16, gobject-2.0 >= 2.16, gio-2.0, telepathy-glib >= 0.7.37
+Cflags: -I${includedir}/telepathy-salut-0