summaryrefslogtreecommitdiff
path: root/telepathy-logger
diff options
context:
space:
mode:
Diffstat (limited to 'telepathy-logger')
-rw-r--r--telepathy-logger/Makefile.am5
-rw-r--r--telepathy-logger/dbus-service.c2
-rw-r--r--telepathy-logger/extensions/Logger.xml153
-rw-r--r--telepathy-logger/extensions/Makefile.am169
-rw-r--r--telepathy-logger/extensions/all.xml34
-rw-r--r--telepathy-logger/extensions/extensions-cli.c33
-rw-r--r--telepathy-logger/extensions/extensions.c9
-rw-r--r--telepathy-logger/extensions/extensions.h20
-rw-r--r--telepathy-logger/extensions/misc.xml10
-rw-r--r--telepathy-logger/extensions/tpl-extensions.pc.in11
-rw-r--r--telepathy-logger/test-api.c2
11 files changed, 444 insertions, 4 deletions
diff --git a/telepathy-logger/Makefile.am b/telepathy-logger/Makefile.am
index b6668c3d5..bc775b465 100644
--- a/telepathy-logger/Makefile.am
+++ b/telepathy-logger/Makefile.am
@@ -1,5 +1,7 @@
include $(top_srcdir)/tools/flymake.mk
+SUBDIRS = extensions .
+
if HAVE_INTROSPECTION
include $(INTROSPECTION_MAKEFILE)
endif
@@ -9,7 +11,6 @@ INTROSPECTION_COMPILER_ARGS = --includedir=$(srcdir) --includedir=$(top_srcdir)
AM_CPPFLAGS = \
-I$(top_builddir) \
- -I$(top_builddir)/extensions \
-I$(top_srcdir) \
$(ERROR_CFLAGS) \
-DG_LOG_DOMAIN=\"tp-logger\" \
@@ -112,7 +113,7 @@ nodist_libtelepathy_logger_1_la_SOURCES = \
$(BUILT_SOURCES)
libtelepathy_logger_1_la_LIBADD = \
- $(top_builddir)/extensions/libtpl-extensions-convenience.la
+ extensions/libtpl-extensions-convenience.la
check_c_sources = \
$(libtelepathy_logger_1_la_SOURCES) \
diff --git a/telepathy-logger/dbus-service.c b/telepathy-logger/dbus-service.c
index d76b76e7b..1e0d4ff5d 100644
--- a/telepathy-logger/dbus-service.c
+++ b/telepathy-logger/dbus-service.c
@@ -34,7 +34,7 @@
#include <telepathy-logger/log-manager-internal.h>
#include <telepathy-logger/client-factory-internal.h>
-#include <extensions/extensions.h>
+#include "telepathy-logger/extensions/extensions.h"
#define DEBUG_FLAG TPL_DEBUG_DBUS_SERVICE
#include <telepathy-logger/action-chain-internal.h>
diff --git a/telepathy-logger/extensions/Logger.xml b/telepathy-logger/extensions/Logger.xml
new file mode 100644
index 000000000..fcfd36de7
--- /dev/null
+++ b/telepathy-logger/extensions/Logger.xml
@@ -0,0 +1,153 @@
+<?xml version="1.0" ?>
+<node name="/Logger"
+ xmlns:tp="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0">
+ <tp:copyright>Copyright © 2009-2011 Collabora Ltd.</tp:copyright>
+ <tp:license xmlns="http://www.w3.org/1999/xhtml">
+ <p>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.</p>
+
+<p>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.</p>
+
+<p>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 Street, Fifth Floor, Boston, MA 02110-1301, USA.</p>
+ </tp:license>
+ <interface name="im.telepathy1.Logger1"
+ tp:causes-havoc="experimental">
+ <tp:added version="0.3">(as a draft)</tp:added>
+
+ <tp:docstring>
+ An interface for requesting information from the Telepathy Logger
+ service.
+ </tp:docstring>
+
+ <method name="GetFavouriteContacts"
+ tp:name-for-bindings="Get_Favourite_Contacts">
+ <arg direction="out" name="Favourite_Contacts" type="a(oas)">
+ <tp:docstring>
+ The favourite contacts, as an array of TpAccounts and their contact
+ identifiers.
+ </tp:docstring>
+ </arg>
+
+ <tp:docstring>
+ Returns the favourite contacts.
+ </tp:docstring>
+ </method>
+
+ <method name="AddFavouriteContact"
+ tp:name-for-bindings="Add_Favourite_Contact">
+ <arg direction="in" name="Account" type="o" tp:type="Account">
+ <tp:docstring>
+ The object path for the TpAccount to which the contact belongs
+ </tp:docstring>
+ </arg>
+
+ <arg direction="in" name="Identifier" type="s">
+ <tp:docstring>
+ The favourite contact's identifier
+ </tp:docstring>
+ </arg>
+
+ <tp:docstring>
+ Add a contact's designation as a favourite.
+ </tp:docstring>
+ </method>
+
+ <method name="RemoveFavouriteContact"
+ tp:name-for-bindings="Remove_Favourite_Contact">
+ <arg direction="in" name="Account" type="o" tp:type="Account">
+ <tp:docstring>
+ The object path for the TpAccount to which the contact belongs
+ </tp:docstring>
+ </arg>
+
+ <arg direction="in" name="Identifier" type="s">
+ <tp:docstring>
+ The favourite contact's identifier
+ </tp:docstring>
+ </arg>
+
+ <tp:docstring>
+ Remove a contact's designation as a favourite.
+ </tp:docstring>
+ </method>
+
+ <method name="Clear"
+ tp:name-for-bindings="Clear">
+ <tp:docstring>
+ Clear all the logs. This will not erase the favourite contacts.
+ </tp:docstring>
+ </method>
+
+ <method name="ClearAccount"
+ tp:name-for-bindings="Clear_Account">
+ <arg direction="in" name="Account" type="o" tp:type="Account">
+ <tp:docstring>
+ The object path for the TpAccount in which logs will be cleared.
+ </tp:docstring>
+ </arg>
+
+ <tp:docstring>
+ Clear all logs stored for specified account.
+ </tp:docstring>
+ </method>
+
+ <method name="ClearEntity"
+ tp:name-for-bindings="Clear_Entity">
+ <arg direction="in" name="Account" type="o" tp:type="Account">
+ <tp:docstring>
+ The object path for the TpAccount in which logs will be cleared.
+ </tp:docstring>
+ </arg>
+
+ <arg direction="in" name="Identifier" type="s">
+ <tp:docstring>
+ The entity identifier.
+ </tp:docstring>
+ </arg>
+
+ <arg direction="in" name="Type" type="i">
+ <tp:docstring>
+ The entity type, should be one of TPL_ENTITY_CONTACT (1) or TPL_ENTITY_ROOM (2).
+ </tp:docstring>
+ </arg>
+
+ <tp:docstring>
+ Clear all logs stored for discussions with entity in account.
+ </tp:docstring>
+ </method>
+
+ <signal name="FavouriteContactsChanged"
+ tp:name-for-bindings="Favourite_Contacts_Changed">
+ <tp:docstring>
+ The set of favourite contacts has changed.
+ </tp:docstring>
+
+ <arg name="Account" type="o" tp:type="Account">
+ <tp:docstring>
+ An account associated with the contact.
+ </tp:docstring>
+ </arg>
+
+ <arg name="Added" type="as">
+ <tp:docstring>
+ List of contact identifiers of contacts which are now favourites.
+ </tp:docstring>
+ </arg>
+
+ <arg name="Removed" type="as">
+ <tp:docstring>
+ List of contact identifiers of contacts which are no longer favourites.
+ </tp:docstring>
+ </arg>
+ </signal>
+
+ </interface>
+</node>
+<!-- vim:set sw=2 sts=2 et ft=xml: -->
diff --git a/telepathy-logger/extensions/Makefile.am b/telepathy-logger/extensions/Makefile.am
new file mode 100644
index 000000000..3efa706bf
--- /dev/null
+++ b/telepathy-logger/extensions/Makefile.am
@@ -0,0 +1,169 @@
+tools_dir = $(top_srcdir)/tools
+
+pkgconfigdir = $(libdir)/pkgconfig
+
+AM_CPPFLAGS = \
+ -I$(top_srcdir) \
+ -I$(top_builddir) \
+ $(NULL)
+
+pkgconfig_DATA =
+if ENABLE_PUBLIC_EXTENSIONS
+pkgconfig_DATA += tpl-extensions.pc
+endif # ENABLE_PUBLIC_EXTENSIONS
+
+$(pkgconfig_DATA): $(top_builddir)/config.status
+
+EXTRA_DIST = \
+ all.xml \
+ misc.xml \
+ Logger.xml \
+ $(pkgconfig_DATA:.pc=.pc.in) \
+ $(NULL)
+
+noinst_LTLIBRARIES = libtpl-extensions-convenience.la
+libtpl_extensions_convenience_la_LIBADD = \
+ @TPL_LIBS@
+
+gen_headers = \
+ _gen/cli-misc.h \
+ _gen/enums.h \
+ _gen/gtypes.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/register-dbus-glib-marshallers-body.h \
+ _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 \
+ _gen/misc.xml \
+ $(nodist_libtpl_extensions_convenience_la_SOURCES) \
+ $(gen_headers) \
+ $(NULL)
+
+CLEANFILES = \
+ $(BUILT_SOURCES) \
+ $(gen_headers:.h=-gtk-doc.h) \
+ $(pkgconfig_DATA) \
+ $(NULL)
+
+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
+libtpl_extensions_la_LDFLAGS = \
+ -version-info "$(TPL_EXT_LT_CURRENT)":"$(TPL_EXT_LT_REVISION)":"$(TPL_EXT_LT_AGE)"
+endif # ENABLE_PUBLIC_EXTENSIONS
+
+AM_CFLAGS = \
+ $(ERROR_CFLAGS) \
+ @TPL_CFLAGS@ \
+ -DTP_DISABLE_SINGLE_INCLUDE \
+ $(NULL)
+
+# Generated stuff
+
+DROP_NAMESPACE = sed -e 's@xmlns:tp="http://telepathy\.freedesktop\.org/wiki/DbusSpec.extensions-v0"@@g'
+XSLTPROCFLAGS = --nonet --novalid
+
+# Generated files which can be generated for all categories simultaneously
+
+_gen/all.xml: all.xml $(wildcard *.xml) $(tools_dir)/xincludator.py
+ $(MKDIR_P) _gen
+ $(AM_V_GEN)$(PYTHON) $(tools_dir)/xincludator.py $< > $@
+
+doc/index.html: _gen/all.xml $(tools_dir)/doc-generator.xsl
+ $(AM_V_GEN)$(XSLTPROC) $(XSLTPROCFLAGS) \
+ $(tools_dir)/doc-generator.xsl \
+ $< > $@
+
+# do nothing, output as a side-effect
+_gen/gtypes.h: _gen/gtypes-body.h
+ @:
+
+_gen/gtypes-body.h: _gen/all.xml \
+ $(top_srcdir)/tools/glib-gtypes-generator.py
+ $(AM_V_GEN)$(PYTHON) $(top_srcdir)/tools/glib-gtypes-generator.py \
+ $< _gen/gtypes Tpl
+
+_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
+ $(AM_V_GEN)$(PYTHON) $(tools_dir)/c-constants-gen.py \
+ Tpl \
+ $< _gen/enums
+
+# do nothing, output as a side-effect
+_gen/interfaces-body.h: _gen/interfaces.h
+ @:
+
+_gen/interfaces.h: _gen/all.xml \
+ $(tools_dir)/glib-interfaces-gen.py
+ $(AM_V_GEN)$(PYTHON) $(tools_dir)/glib-interfaces-gen.py \
+ Tpl _gen/interfaces-body.h _gen/interfaces.h $<
+
+# Generated files which must be generated per "category". Each TpProxy
+# subclass you want to use with --subclass will need to have its own category,
+# although you can subdivide further if you want.
+
+_gen/misc.xml: misc.xml $(wildcard *.xml) $(tools_dir)/xincludator.py
+ $(MKDIR_P) _gen
+ $(AM_V_GEN)$(PYTHON) $(tools_dir)/xincludator.py $< > $@
+
+# do nothing, output as a side-effect
+_gen/cli-misc.h: _gen/cli-misc-body.h
+ @:
+
+_gen/cli-misc-body.h: _gen/misc.xml \
+ $(tools_dir)/glib-client-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.10.0 \
+ $< Tpl_Cli _gen/cli-misc
+
+# do nothing, output as a side-effect
+_gen/svc-misc.h: _gen/svc-misc.c
+ @:
+
+_gen/svc-misc.c: _gen/misc.xml \
+ $(tools_dir)/glib-ginterface-gen.py
+ $(AM_V_GEN)$(PYTHON) $(tools_dir)/glib-ginterface-gen.py \
+ --filename=_gen/svc-misc \
+ --signal-marshal-prefix=_tpl_ext \
+ --include='<telepathy-glib/telepathy-glib.h>' \
+ --not-implemented-func='tp_dbus_g_method_return_not_implemented' \
+ --allow-unstable \
+ $< Tpl_Svc_
diff --git a/telepathy-logger/extensions/all.xml b/telepathy-logger/extensions/all.xml
new file mode 100644
index 000000000..efe90b06c
--- /dev/null
+++ b/telepathy-logger/extensions/all.xml
@@ -0,0 +1,34 @@
+<tp:spec
+ xmlns:tp="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0"
+ xmlns:xi="http://www.w3.org/2001/XInclude">
+
+<tp:title>TelepathyLogger-specific extensions to the Telepathy interfaces</tp:title>
+
+<tp:copyright>Copyright (C) 2009-2010 Collabora Limited</tp:copyright>
+
+<tp:license xmlns="http://www.w3.org/1999/xhtml">
+<p>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.</p>
+
+<p>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.</p>
+
+<p>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</p>
+</tp:license>
+
+<tp:generic-types>
+ <tp:external-type name="Account" type="o"
+ from="Telepathy specification"/>
+ <tp:external-type name="Unix_Timestamp64" type="x"
+ from="Telepathy specification"/>
+</tp:generic-types>
+
+<xi:include href="misc.xml"/>
+
+</tp:spec>
diff --git a/telepathy-logger/extensions/extensions-cli.c b/telepathy-logger/extensions/extensions-cli.c
new file mode 100644
index 000000000..62e06bdea
--- /dev/null
+++ b/telepathy-logger/extensions/extensions-cli.c
@@ -0,0 +1,33 @@
+#include "config.h"
+
+#include "telepathy-logger/extensions/extensions.h"
+
+#include <telepathy-glib/telepathy-glib.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/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/telepathy-logger/extensions/extensions.c b/telepathy-logger/extensions/extensions.c
new file mode 100644
index 000000000..f5a276f2d
--- /dev/null
+++ b/telepathy-logger/extensions/extensions.c
@@ -0,0 +1,9 @@
+#include "config.h"
+
+#include "telepathy-logger/extensions/extensions.h"
+
+#include <telepathy-glib/proxy-subclass.h>
+
+/* auto-generated stubs */
+#include "_gen/gtypes-body.h"
+#include "_gen/interfaces-body.h"
diff --git a/telepathy-logger/extensions/extensions.h b/telepathy-logger/extensions/extensions.h
new file mode 100644
index 000000000..c80827dd0
--- /dev/null
+++ b/telepathy-logger/extensions/extensions.h
@@ -0,0 +1,20 @@
+#ifndef _TPL_EXTENSIONS_H
+#define _TPL_EXTENSIONS_H
+
+#include <telepathy-glib/telepathy-glib.h>
+
+#include "telepathy-logger/extensions/_gen/enums.h"
+#include "telepathy-logger/extensions/_gen/cli-misc.h"
+#include "telepathy-logger/extensions/_gen/svc-misc.h"
+
+G_BEGIN_DECLS
+
+#include "telepathy-logger/extensions/_gen/gtypes.h"
+#include "telepathy-logger/extensions/_gen/interfaces.h"
+
+G_END_DECLS
+
+void tpl_cli_init (void);
+
+#endif /* _TPL_EXTENSIONS_H */
+
diff --git a/telepathy-logger/extensions/misc.xml b/telepathy-logger/extensions/misc.xml
new file mode 100644
index 000000000..3b3bc0ea6
--- /dev/null
+++ b/telepathy-logger/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/telepathy-logger/extensions/tpl-extensions.pc.in b/telepathy-logger/extensions/tpl-extensions.pc.in
new file mode 100644
index 000000000..a24903c6f
--- /dev/null
+++ b/telepathy-logger/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@
diff --git a/telepathy-logger/test-api.c b/telepathy-logger/test-api.c
index ef5a3c999..564e25888 100644
--- a/telepathy-logger/test-api.c
+++ b/telepathy-logger/test-api.c
@@ -28,7 +28,7 @@
#include <telepathy-glib/proxy-subclass.h>
#include <telepathy-logger/dbus-service-internal.h>
-#include <extensions/extensions.h>
+#include "telepathy-logger/extensions/extensions.h"
static GMainLoop *mainloop = NULL;