diff options
Diffstat (limited to 'extensions')
-rw-r--r-- | extensions/.gitignore | 2 | ||||
-rw-r--r-- | extensions/Channel_Handler.xml | 62 | ||||
-rw-r--r-- | extensions/Makefile.am | 130 | ||||
-rw-r--r-- | extensions/Stream_Engine.xml | 44 | ||||
-rw-r--r-- | extensions/all.xml | 14 | ||||
-rw-r--r-- | extensions/extensions-cli.c | 19 | ||||
-rw-r--r-- | extensions/extensions.c | 6 | ||||
-rw-r--r-- | extensions/extensions.h | 20 | ||||
-rw-r--r-- | extensions/misc.xml | 10 |
9 files changed, 307 insertions, 0 deletions
diff --git a/extensions/.gitignore b/extensions/.gitignore new file mode 100644 index 000000000..09d7dbf50 --- /dev/null +++ b/extensions/.gitignore @@ -0,0 +1,2 @@ +_gen +extensions.html diff --git a/extensions/Channel_Handler.xml b/extensions/Channel_Handler.xml new file mode 100644 index 000000000..80233e97d --- /dev/null +++ b/extensions/Channel_Handler.xml @@ -0,0 +1,62 @@ +<?xml version="1.0" ?> +<node name="/Channel_Handler" xmlns:tp="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0"> + <tp:copyright>Copyright (C) 2007 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 +Library 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="org.freedesktop.Telepathy.ChannelHandler"> + + <method name="HandleChannel"> + <arg direction="in" type="s" name="Bus_Name" tp:type="DBus_Bus_Name"> + <tp:docstring> + The bus name of the connection and channel + </tp:docstring> + </arg> + <arg direction="in" type="o" name="Connection"> + <tp:docstring> + The object-path of the connection that owns the channel + </tp:docstring> + </arg> + <arg direction="in" type="s" tp:type="DBus_Interface" name="Channel_Type"> + <tp:docstring> + The channel type + </tp:docstring> + </arg> + <arg direction="in" type="o" name="Channel"> + <tp:docstring> + The object-path of the channel + </tp:docstring> + </arg> + <arg direction="in" type="u" tp:type="Handle_Type" name="Handle_Type"> + <tp:docstring>The type of the handle that the channel communicates + with, or 0 if there is no associated handle</tp:docstring> + </arg> + <arg direction="in" type="u" tp:type="Handle" name="Handle"> + <tp:docstring>The handle that the channel communicates with, + or 0 if there is no associated handle</tp:docstring> + </arg> + <tp:docstring> + Called when a channel handler should handle a new channel. + </tp:docstring> + <!-- FIXME: possible errors? --> + </method> + <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> + <p>An interface exported by client applications which are able to + handle incoming channels.</p> + </tp:docstring> + </interface> +</node> +<!-- vim:set sw=2 sts=2 et ft=xml: --> + diff --git a/extensions/Makefile.am b/extensions/Makefile.am new file mode 100644 index 000000000..ccf7bb593 --- /dev/null +++ b/extensions/Makefile.am @@ -0,0 +1,130 @@ +tools_dir = $(top_srcdir)/tools + +AM_CFLAGS = \ + -I$(top_srcdir) \ + -I$(top_builddir) \ + $(WARN_CFLAGS) \ + $(LIBEMPATHY_CFLAGS) + +EXTRA_DIST = \ + all.xml \ + misc.xml \ + Channel_Handler.xml \ + Stream_Engine.xml + +noinst_LTLIBRARIES = libemp-extensions.la + +libemp_extensions_la_LIBADD = \ + $(TELEPATHY_GLIB_LIBS) + +# The client-specific parts are built into a separate .o file, so the linker +# can discard them when linking services. The service-specific parts are +# in svc-*.c, so we don't need an extensions-svc.c. +libemp_extensions_la_SOURCES = \ + extensions.c \ + extensions-cli.c \ + extensions.h + +nodist_libemp_extensions_la_SOURCES = \ + _gen/signals-marshal.c \ + _gen/signals-marshal.h \ + _gen/signals-marshal.list \ + _gen/register-dbus-glib-marshallers-body.h \ + _gen/enums.h \ + _gen/gtypes.h \ + _gen/gtypes-body.h \ + _gen/interfaces.h \ + _gen/interfaces-body.h \ + _gen/cli-misc.h \ + _gen/cli-misc-body.h \ + _gen/svc-misc.h \ + _gen/svc-misc.c + +BUILT_SOURCES = \ + _gen/all.xml \ + _gen/misc.xml \ + $(nodist_libemp_extensions_la_SOURCES) \ + extensions.html + +CLEANFILES = $(BUILT_SOURCES) + +XSLTPROCFLAGS = --nonet --novalid + +# Generated files which can be generated for all categories simultaneously + +_gen/%.xml: %.xml $(wildcard *.xml) + $(mkdir_p) _gen + $(XSLTPROC) $(XSLTPROCFLAGS) --xinclude $(tools_dir)/identity.xsl \ + $< > $@ + +extensions.html: _gen/all.xml $(tools_dir)/doc-generator.xsl + $(XSLTPROC) $(XSLTPROCFLAGS) \ + $(tools_dir)/doc-generator.xsl \ + $< > $@ + +_gen/gtypes.h _gen/gtypes-body.h: _gen/all.xml \ + $(top_srcdir)/tools/glib-gtypes-generator.py + $(PYTHON) $(top_srcdir)/tools/glib-gtypes-generator.py \ + $< _gen/gtypes Emp + +_gen/signals-marshal.list: _gen/all.xml \ + $(tools_dir)/glib-signals-marshal-gen.py + $(PYTHON) $(tools_dir)/glib-signals-marshal-gen.py $< > $@ + +_gen/signals-marshal.h: _gen/signals-marshal.list + $(GLIB_GENMARSHAL) --header --prefix=_emp_ext_marshal $< > $@ + +_gen/signals-marshal.c: _gen/signals-marshal.list + ( \ + echo '#include "signals-marshal.h"' && \ + $(GLIB_GENMARSHAL) --body --prefix=_emp_ext_marshal $< \ + ) >> $@ + +_gen/register-dbus-glib-marshallers-body.h: _gen/all.xml \ + $(tools_dir)/glib-client-marshaller-gen.py + $(PYTHON) $(tools_dir)/glib-client-marshaller-gen.py $< \ + _emp_ext > $@ + +_gen/enums.h: _gen/all.xml $(tools_dir)/c-constants-generator.xsl + $(XSLTPROC) $(XSLTPROCFLAGS) \ + --stringparam mixed-case-prefix Emp \ + $(tools_dir)/c-constants-generator.xsl \ + $< > $@ + +_gen/interfaces.h: _gen/all.xml \ + $(tools_dir)/glib-interfaces-generator.xsl \ + $(tools_dir)/c-interfaces-generator.xsl + $(XSLTPROC) $(XSLTPROCFLAGS) \ + --stringparam mixed-case-prefix Emp \ + $(tools_dir)/glib-interfaces-generator.xsl \ + $< > $@ + +_gen/interfaces-body.h: _gen/all.xml \ + $(tools_dir)/glib-interfaces-body-generator.xsl \ + $(tools_dir)/c-interfaces-generator.xsl + $(XSLTPROC) $(XSLTPROCFLAGS) \ + --stringparam mixed-case-prefix Emp \ + $(tools_dir)/glib-interfaces-body-generator.xsl \ + $< > $@ + +# 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/cli-misc-body.h _gen/cli-misc.h: _gen/misc.xml \ + $(tools_dir)/glib-client-gen.py + $(PYTHON) $(tools_dir)/glib-client-gen.py \ + --group=misc \ + --iface-quark-prefix=EMP_IFACE_QUARK \ + $< Emp_Cli _gen/cli-misc + +_gen/svc-misc.c _gen/svc-misc.h: _gen/misc.xml \ + $(tools_dir)/glib-ginterface-gen.py + $(PYTHON) $(tools_dir)/glib-ginterface-gen.py \ + --filename=_gen/svc-misc \ + --signal-marshal-prefix=_emp_ext \ + --include='<telepathy-glib/dbus.h>' \ + --include='"_gen/signals-marshal.h"' \ + --not-implemented-func='tp_dbus_g_method_return_not_implemented' \ + --allow-unstable \ + $< Emp_Svc_ diff --git a/extensions/Stream_Engine.xml b/extensions/Stream_Engine.xml new file mode 100644 index 000000000..0303a516d --- /dev/null +++ b/extensions/Stream_Engine.xml @@ -0,0 +1,44 @@ +<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd"> +<node name="/Stream_Engine"> + <interface name="org.freedesktop.Telepathy.StreamEngine"> + <method name="SetOutputVolume"> + <arg direction="in" type="o" name="channel_path" /> + <arg direction="in" type="u" name="stream_id" /> + <arg direction="in" type="u" name="volume" /> + </method> + <method name="MuteInput"> + <arg direction="in" type="o" name="channel_path" /> + <arg direction="in" type="u" name="stream_id" /> + <arg direction="in" type="b" name="mute_state" /> + </method> + <method name="MuteOutput"> + <arg direction="in" type="o" name="channel_path" /> + <arg direction="in" type="u" name="stream_id" /> + <arg direction="in" type="b" name="mute_state" /> + </method> + <method name="SetOutputWindow"> + <arg direction="in" type="o" name="channel_path" /> + <arg direction="in" type="u" name="stream_id" /> + <arg direction="in" type="u" name="window" /> + </method> + <method name="AddPreviewWindow"> + <arg direction="in" type="u" name="window" /> + </method> + <method name="RemovePreviewWindow"> + <arg direction="in" type="u" name="window" /> + </method> + <signal name="Receiving"> + <arg type="o" name="channel_path" /> + <arg type="u" name="stream_id" /> + <arg type="b" name="state" /> + </signal> + <signal name="StreamStateChanged"> + <arg type="o" name="channel_path" /> + <arg type="u" name="stream_id" /> + <arg type="u" name="state" /> + <arg type="u" name="direction" /> + </signal> + <method name="Shutdown"> + </method> + </interface> +</node> diff --git a/extensions/all.xml b/extensions/all.xml new file mode 100644 index 000000000..2a0e109e8 --- /dev/null +++ b/extensions/all.xml @@ -0,0 +1,14 @@ +<tp:spec + xmlns:tp="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0" + xmlns:xi="http://www.w3.org/2001/XInclude"> + +<tp:title>Extensions for Empathy</tp:title> + +<xi:include href="misc.xml"/> + +<tp:generic-types> + <tp:external-type name="Contact_Handle" type="u" + from="Telepathy specification"/> +</tp:generic-types> + +</tp:spec> diff --git a/extensions/extensions-cli.c b/extensions/extensions-cli.c new file mode 100644 index 000000000..98a174478 --- /dev/null +++ b/extensions/extensions-cli.c @@ -0,0 +1,19 @@ +#include "extensions.h" + +#include <telepathy-glib/proxy-subclass.h> + +static void _emp_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" + +void +emp_cli_init (void) +{ + _emp_ext_register_dbus_glib_marshallers (); + + tp_proxy_or_subclass_hook_on_interface_add (TP_TYPE_PROXY, + emp_cli_misc_add_signals); +} diff --git a/extensions/extensions.c b/extensions/extensions.c new file mode 100644 index 000000000..eeda4623c --- /dev/null +++ b/extensions/extensions.c @@ -0,0 +1,6 @@ +#include "extensions.h" + +/* include auto-generated stubs for things common to service and client */ +#include "_gen/gtypes-body.h" +#include "_gen/interfaces-body.h" +#include "_gen/signals-marshal.h" diff --git a/extensions/extensions.h b/extensions/extensions.h new file mode 100644 index 000000000..d97dc830c --- /dev/null +++ b/extensions/extensions.h @@ -0,0 +1,20 @@ +#ifndef __EMP_EXTENSIONS_H__ +#define __EMP_EXTENSIONS_H__ + +#include <glib-object.h> +#include <telepathy-glib/channel.h> + +#include "extensions/_gen/enums.h" +#include "extensions/_gen/cli-misc.h" +#include "extensions/_gen/svc-misc.h" + +G_BEGIN_DECLS + +#include "extensions/_gen/gtypes.h" +#include "extensions/_gen/interfaces.h" + +void emp_cli_init (void); + +G_END_DECLS + +#endif diff --git a/extensions/misc.xml b/extensions/misc.xml new file mode 100644 index 000000000..070ae85c3 --- /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>Channel extensions for Empathy</tp:title> + +<xi:include href="Stream_Engine.xml"/> +<xi:include href="Channel_Handler.xml"/> + +</tp:spec> |