summaryrefslogtreecommitdiff
path: root/extensions
diff options
context:
space:
mode:
authorTravis Reitter <treitter@gmail.com>2010-03-30 08:45:00 -0700
committerTravis Reitter <treitter@gmail.com>2010-03-30 08:45:00 -0700
commit9b3ed1a9306af4e1f6f893ea2163f98c926fb9ea (patch)
treebd8244884413fc446e34d616d02452c14e1d672f /extensions
parentdaa60e413c9f8473b3a92c12dc60f33d54e25342 (diff)
downloadtelepathy-logger-9b3ed1a9306af4e1f6f893ea2163f98c926fb9ea.tar.gz
Make the extensions library public and perform some minor reorganization.
Diffstat (limited to 'extensions')
-rw-r--r--extensions/Makefile.am97
-rw-r--r--extensions/all.xml2
-rw-r--r--extensions/extensions-cli.c32
-rw-r--r--extensions/extensions.c1
-rw-r--r--extensions/extensions.h14
-rw-r--r--extensions/misc.xml10
-rw-r--r--extensions/tpl-extensions.pc.in11
7 files changed, 137 insertions, 30 deletions
diff --git a/extensions/Makefile.am b/extensions/Makefile.am
index 1080110..d52c199 100644
--- a/extensions/Makefile.am
+++ b/extensions/Makefile.am
@@ -1,36 +1,78 @@
tools_dir = $(top_srcdir)/tools
+pkgconfigdir = $(libdir)/pkgconfig
+
+pkgconfig_DATA =
+if ENABLE_PUBLIC_EXTENSIONS
+pkgconfig_DATA += tpl-extensions.pc
+endif # ENABLE_PUBLIC_EXTENSIONS
+
+$(pkgconfig_DATA): $(top_srcdir)/config.status
+
EXTRA_DIST = \
all.xml \
+ misc.xml \
Logger.xml \
+ $(pkgconfig_DATA:.pc=.pc.in) \
$(NULL)
-noinst_LTLIBRARIES = libtpl-extensions.la
-
-libtpl_extensions_la_SOURCES = \
- extensions.c \
- extensions.h
+noinst_LTLIBRARIES = libtpl-extensions-convenience.la
-nodist_libtpl_extensions_la_SOURCES = \
- _gen/signals-marshal.c \
- _gen/signals-marshal.h \
- _gen/signals-marshal.list \
+gen_headers = \
+ _gen/cli-misc.h \
_gen/enums.h \
_gen/gtypes.h \
- _gen/gtypes-body.h \
_gen/interfaces.h \
+ _gen/svc-misc.h \
+ $(NULL)
+
+nodist_libtpl_extensions_convenience_la_SOURCES = \
+ _gen/cli-misc-body.h \
+ _gen/gtypes-body.h \
_gen/interfaces-body.h \
- _gen/cli.h \
- _gen/cli-body.h \
- _gen/svc.h \
- _gen/svc.c
+ _gen/register-dbus-glib-marshallers-body.h \
+ _gen/signals-marshal.c \
+ _gen/signals-marshal.h \
+ _gen/signals-marshal.list \
+ _gen/svc-misc.c \
+ $(gen_headers) \
+ $(NULL)
+
+extension_headers = \
+ extensions.h \
+ $(NULL)
+
+libtpl_extensions_convenience_la_SOURCES = \
+ extensions.c \
+ extensions-cli.c \
+ $(extension_headers) \
+ $(NULL)
BUILT_SOURCES = \
_gen/all.xml \
- $(nodist_libtpl_extensions_la_SOURCES)
+ _gen/misc.xml \
+ $(nodist_libtpl_extensions_convenience_la_SOURCES) \
+ $(gen_headers) \
+ $(NULL)
+
+CLEANFILES = \
+ $(BUILT_SOURCES) \
+ $(pkgconfig_DATA) \
+ $(NULL)
-CLEANFILES = $(BUILT_SOURCES) \
- _gen/
+if ENABLE_PUBLIC_EXTENSIONS
+tplincludedir=$(includedir)/tpl-extensions
+genincludedir=$(tplincludedir)/_gen
+
+tplinclude_HEADERS = $(extension_headers)
+geninclude_HEADERS = $(gen_headers)
+
+# copy the core library and make it installable
+lib_LTLIBRARIES = libtpl-extensions.la
+
+libtpl_extensions_la_SOURCES =
+libtpl_extensions_la_LIBADD = libtpl-extensions-convenience.la
+endif # ENABLE_PUBLIC_EXTENSIONS
AM_CFLAGS = $(ERROR_CFLAGS) @LIBTPL_CFLAGS@ @HANDLE_LEAK_DEBUG_CFLAGS@
AM_LDFLAGS = @LIBTPL_LIBS@
@@ -49,24 +91,30 @@ doc/index.html: _gen/all.xml $(tools_dir)/specparser.py $(tools_dir)/doc-generat
$(AM_V_GEN)$(PYTHON) $(tools_dir)/doc-generator.py all.xml doc/ \
telepathy-spec org.freedesktop.Telepathy
-_gen/svc.c _gen/svc.h: _gen/all.xml $(tools_dir)/glib-ginterface-gen.py \
+_gen/misc.xml: misc.xml $(wildcard *.xml)
+ @$(mkdir_p) _gen
+ $(AM_V_GEN)$(XSLTPROC) $(XSLTPROCFLAGS) --xinclude $(tools_dir)/identity.xsl \
+ $< > $@
+
+_gen/svc-misc.c _gen/svc-misc.h: _gen/misc.xml $(tools_dir)/glib-ginterface-gen.py \
Makefile.am
$(AM_V_GEN)$(PYTHON) $(tools_dir)/glib-ginterface-gen.py \
- --filename=_gen/svc --signal-marshal-prefix=_tpl_ext \
+ --filename=_gen/svc-misc --signal-marshal-prefix=_tpl_ext \
--include='<telepathy-glib/dbus.h>' \
--include='"_gen/signals-marshal.h"' \
--allow-unstable \
--not-implemented-func='tp_dbus_g_method_return_not_implemented' \
$< Tpl_Svc_
-_gen/cli-body.h _gen/cli.h: _gen/all.xml $(tools_dir)/glib-ginterface-gen.py \
+_gen/cli-misc-body.h _gen/cli-misc.h: _gen/misc.xml $(tools_dir)/glib-ginterface-gen.py \
Makefile.am
$(AM_V_GEN)$(PYTHON) $(tools_dir)/glib-client-gen.py \
+ --group=misc \
--subclass=TpProxy \
--subclass-assert=TP_IS_PROXY \
--iface-quark-prefix=TPL_IFACE_QUARK \
- --tp-proxy-api=0.7.6 \
- $< Tpl_Cli _gen/cli
+ --tp-proxy-api=0.10.0 \
+ $< Tpl_Cli _gen/cli-misc
_gen/signals-marshal.list: _gen/all.xml \
$(tools_dir)/glib-signals-marshal-gen.py \
@@ -80,6 +128,11 @@ _gen/signals-marshal.c: _gen/signals-marshal.list Makefile.am
$(AM_V_GEN){ echo '#include "_gen/signals-marshal.h"' && \
$(GLIB_GENMARSHAL) --body --prefix=_tpl_ext_marshal $< ; } > $@
+_gen/register-dbus-glib-marshallers-body.h: _gen/all.xml \
+ $(tools_dir)/glib-client-marshaller-gen.py
+ $(AM_V_GEN)$(PYTHON) $(tools_dir)/glib-client-marshaller-gen.py $< \
+ _tpl_ext > $@
+
_gen/enums.h: _gen/all.xml $(tools_dir)/c-constants-gen.py \
Makefile.am
$(AM_V_GEN)$(PYTHON) $(tools_dir)/c-constants-gen.py Tpl $< > $@
diff --git a/extensions/all.xml b/extensions/all.xml
index cff8af8..efe90b0 100644
--- a/extensions/all.xml
+++ b/extensions/all.xml
@@ -29,6 +29,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA</p>
from="Telepathy specification"/>
</tp:generic-types>
-<xi:include href="Logger.xml"/>
+<xi:include href="misc.xml"/>
</tp:spec>
diff --git a/extensions/extensions-cli.c b/extensions/extensions-cli.c
new file mode 100644
index 0000000..6c8dc96
--- /dev/null
+++ b/extensions/extensions-cli.c
@@ -0,0 +1,32 @@
+#include "extensions.h"
+
+#include <telepathy-glib/connection.h>
+#include <telepathy-glib/proxy-subclass.h>
+
+static void _tpl_ext_register_dbus_glib_marshallers (void);
+
+/* include auto-generated stubs for client-specific code */
+#include "_gen/signals-marshal.h"
+#include "_gen/cli-misc-body.h"
+#include "_gen/register-dbus-glib-marshallers-body.h"
+
+static gpointer
+tpl_cli_once (gpointer data)
+{
+ _tpl_ext_register_dbus_glib_marshallers ();
+
+ tp_proxy_init_known_interfaces ();
+
+ tp_proxy_or_subclass_hook_on_interface_add (TP_TYPE_PROXY,
+ tpl_cli_misc_add_signals);
+
+ return NULL;
+}
+
+void
+tpl_cli_init (void)
+{
+ static GOnce once = G_ONCE_INIT;
+
+ g_once (&once, tpl_cli_once, NULL);
+}
diff --git a/extensions/extensions.c b/extensions/extensions.c
index d18b085..a47e0e1 100644
--- a/extensions/extensions.c
+++ b/extensions/extensions.c
@@ -5,4 +5,3 @@
/* auto-generated stubs */
#include "_gen/gtypes-body.h"
#include "_gen/interfaces-body.h"
-#include "_gen/cli-body.h"
diff --git a/extensions/extensions.h b/extensions/extensions.h
index 65b4a2e..5c47b59 100644
--- a/extensions/extensions.h
+++ b/extensions/extensions.h
@@ -3,16 +3,18 @@
#include <telepathy-glib/proxy.h>
-#include "extensions/_gen/enums.h"
-#include "extensions/_gen/svc.h"
-#include "extensions/_gen/cli.h"
+#include "_gen/enums.h"
+#include "_gen/cli-misc.h"
+#include "_gen/svc-misc.h"
G_BEGIN_DECLS
-#include "extensions/_gen/gtypes.h"
-#include "extensions/_gen/interfaces.h"
+#include "_gen/gtypes.h"
+#include "_gen/interfaces.h"
G_END_DECLS
-#endif /* _GABBLE_EXTENSIONS_H */
+void tpl_cli_init (void);
+
+#endif /* _TPL_EXTENSIONS_H */
diff --git a/extensions/misc.xml b/extensions/misc.xml
new file mode 100644
index 0000000..3b3bc0e
--- /dev/null
+++ b/extensions/misc.xml
@@ -0,0 +1,10 @@
+<tp:spec
+ xmlns:tp="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0"
+ xmlns:xi="http://www.w3.org/2001/XInclude">
+
+<tp:title>Misc extensions for the logger (which will eventually be moved into their own interfaces)</tp:title>
+
+<xi:include href="Logger.xml" />
+
+</tp:spec>
+
diff --git a/extensions/tpl-extensions.pc.in b/extensions/tpl-extensions.pc.in
new file mode 100644
index 0000000..a24903c
--- /dev/null
+++ b/extensions/tpl-extensions.pc.in
@@ -0,0 +1,11 @@
+prefix=@prefix@
+exec_prefix=${prefix}
+libdir=${exec_prefix}/lib
+includedir=${prefix}/include
+
+Name: tpl-extensions
+Description: Telepathy Logger GLib convenience library
+Version: @VERSION@
+Libs: -L${libdir} -ltpl-extensions
+Cflags: -I${includedir}
+Requires: @LIBTPL_MODULES@