diff options
Diffstat (limited to 'extensions')
-rw-r--r-- | extensions/.git-darcs-dir | 0 | ||||
-rw-r--r-- | extensions/Channel_Interface_Hold.xml | 129 | ||||
-rw-r--r-- | extensions/Makefile.am | 133 | ||||
-rw-r--r-- | extensions/all.xml | 14 | ||||
-rw-r--r-- | extensions/channel.xml | 9 | ||||
-rw-r--r-- | extensions/extensions-cli.c | 19 | ||||
-rw-r--r-- | extensions/extensions.c | 6 | ||||
-rw-r--r-- | extensions/extensions.h | 20 |
8 files changed, 330 insertions, 0 deletions
diff --git a/extensions/.git-darcs-dir b/extensions/.git-darcs-dir new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/extensions/.git-darcs-dir diff --git a/extensions/Channel_Interface_Hold.xml b/extensions/Channel_Interface_Hold.xml new file mode 100644 index 0000000..6e04ffb --- /dev/null +++ b/extensions/Channel_Interface_Hold.xml @@ -0,0 +1,129 @@ +<?xml version="1.0" ?> +<node name="/Channel_Interface_Hold" xmlns:tp="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0"> + <tp:copyright> Copyright (C) 2005-2008 Collabora Limited </tp:copyright> + <tp:copyright> Copyright (C) 2005-2008 Nokia Corporation </tp:copyright> + <tp:copyright> Copyright (C) 2006 INdT </tp:copyright> + <tp:license xmlns="http://www.w3.org/1999/xhtml"> +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 Street, Fifth Floor, Boston, MA 02110-1301, USA. + </tp:license> + + <interface name="org.freedesktop.Telepathy.Channel.Interface.Hold" + tp:causes-havoc='not yet API-stable'> + <tp:requires interface="org.freedesktop.Telepathy.Channel.Type.StreamedMedia"/> + + <tp:docstring xmlns="http://www.w3.org/1999/xhtml"> + <p>Interface for channels where you or other members may put + the channel on hold. This only makes sense for channels where + you are streaming media to or from the members.</p> + + <p>If you are placed on hold, this indicates that some or all members + of the channel will no longer be receiving media streams from you. + If the channel has the MediaSignalling interface, client applications + should stop sending media to all members of the channel.</p> + + <p>Depending on the protocol, it might not be possible to tell that + you're on hold, in which case the connection manager should always + indicate that you're not on hold unless it finds out otherwise.</p> + + <p>If you place a channel on hold, this indicates that you do not wish + to be sent media streams by any of its members and will be ignoring + any media streams you continue to receive. It also requests that the + connection manager free up any resources that are only needed for + an actively used channel (e.g. in a GSM or PBX call, it will be + necessary to place an active call on hold before you can start + another call).</p> + </tp:docstring> + + <tp:enum name="Channel_Hold_State" type="u"> + <tp:docstring> + The possible hold states of a call. + </tp:docstring> + <tp:enumvalue suffix="None" value="0"> + <tp:docstring> + Neither the local user nor a remote member have placed the call on + hold. + </tp:docstring> + </tp:enumvalue> + <tp:enumvalue suffix="Local" value="1"> + <tp:docstring> + The local user has put the call on hold. + </tp:docstring> + </tp:enumvalue> + <tp:enumvalue suffix="Remote" value="2"> + <tp:docstring> + The call has been put on hold by a remote member. + </tp:docstring> + </tp:enumvalue> + <tp:enumvalue suffix="Both" value="3"> + <tp:docstring> + The local user and a remote member have both placed the call + on hold. + </tp:docstring> + </tp:enumvalue> + </tp:enum> + + <method name="GetHoldState"> + <arg direction="out" type="u" tp:type="Channel_Hold_State"> + <tp:docstring> + The channel's current hold state + </tp:docstring> + </arg> + <tp:docstring> + Return the channel's current hold state. + </tp:docstring> + </method> + + <signal name="HoldStateChanged"> + <arg name="state" type="u" tp:type="Channel_Hold_State"> + <tp:docstring> + An integer representing the new hold state + </tp:docstring> + </arg> + <tp:docstring> + Emitted to indicate that the hold state has changed for this channel. + This may occur as a consequence of you requesting a change with + RequestHold, or the state changing as a result of a request from a + remote member or another process. + </tp:docstring> + </signal> + + <method name="RequestHold"> + <arg direction="in" name="hold" type="b"> + <tp:docstring> + A boolean indicating whether or not the channel should be on hold + </tp:docstring> + </arg> + <tp:docstring> + Request that the channel be put on hold (be instructed not to send + any media streams to you) or be taken off hold. Success is indicated + by the HoldStateChanged signal being emitted and by a successful + return from this method. + </tp:docstring> + <tp:possible-errors> + <tp:error name="org.freedesktop.Telepathy.Error.Disconnected"/> + <tp:error name="org.freedesktop.Telepathy.Error.NetworkError"/> + <tp:error name="org.freedesktop.Telepathy.Error.NotAvailable"> + <tp:docstring> + The requested hold state cannot be achieved; for example, + if only a limited number of channels can be in the "not on hold" + state, attempts to exceed this number will raise NotAvailable. + </tp:docstring> + </tp:error> + </tp:possible-errors> + </method> + + </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 0000000..97e0029 --- /dev/null +++ b/extensions/Makefile.am @@ -0,0 +1,133 @@ +tools_dir = $(top_srcdir)/tools + +AM_CFLAGS = \ + $(ERROR_CFLAGS) \ + $(DBUS_CFLAGS) \ + $(GLIB_CFLAGS) \ + $(TELEPATHY_GLIB_CFLAGS) + +EXTRA_DIST = \ + all.xml \ + channel.xml \ + Channel_Interface_Hold.xml + +noinst_LTLIBRARIES = libsip-extensions.la + +libsip_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. +libsip_extensions_la_SOURCES = \ + extensions.c \ + extensions-cli.c \ + extensions.h + +nodist_libsip_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-channel.h \ + _gen/cli-channel-body.h \ + _gen/svc-channel.h \ + _gen/svc-channel.c + +BUILT_SOURCES = \ + _gen/all.xml \ + _gen/channel.xml \ + $(nodist_libsip_extensions_la_SOURCES) \ + extensions.html + +CLEANFILES = $(BUILT_SOURCES) + +XSLTPROCFLAGS = --nonet --novalid + +# Generated files which can be generated for all categories simultaneously + +_gen/all.xml: all.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 SIP + +_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=_sip_ext_marshal $< > $@ + +_gen/signals-marshal.c: _gen/signals-marshal.list + $(GLIB_GENMARSHAL) --body --prefix=_sip_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 $< \ + _sip_ext > $@ + +_gen/enums.h: _gen/all.xml $(tools_dir)/c-constants-generator.xsl + $(XSLTPROC) $(XSLTPROCFLAGS) \ + --stringparam mixed-case-prefix SIP \ + $(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 SIP \ + $(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 SIP \ + $(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/channel.xml: channel.xml $(wildcard *.xml) + $(mkdir_p) _gen + $(XSLTPROC) $(XSLTPROCFLAGS) --xinclude $(tools_dir)/identity.xsl \ + $< > $@ + +_gen/cli-channel-body.h _gen/cli-channel.h: _gen/channel.xml \ + $(tools_dir)/glib-client-gen.py + $(PYTHON) $(tools_dir)/glib-client-gen.py \ + --group=channel \ + --subclass=TpChannel \ + --subclass-assert=TP_IS_CHANNEL \ + --iface-quark-prefix=SIP_IFACE_QUARK \ + $< SIP_Cli _gen/cli-channel + +_gen/svc-channel.c _gen/svc-channel.h: _gen/channel.xml \ + $(tools_dir)/glib-ginterface-gen.py + $(PYTHON) $(tools_dir)/glib-ginterface-gen.py \ + --filename=_gen/svc-channel \ + --signal-marshal-prefix=_sip_ext \ + --include='<telepathy-glib/dbus.h>' \ + --include='"_gen/signals-marshal.h"' \ + --not-implemented-func='tp_dbus_g_method_return_not_implemented' \ + --allow-unstable \ + $< SIP_Svc_ diff --git a/extensions/all.xml b/extensions/all.xml new file mode 100644 index 0000000..0cd4295 --- /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 telepathy-sofiasip</tp:title> + +<xi:include href="channel.xml"/> + +<tp:generic-types> + <tp:external-type name="Contact_Handle" type="u" + from="Telepathy specification"/> +</tp:generic-types> + +</tp:spec> diff --git a/extensions/channel.xml b/extensions/channel.xml new file mode 100644 index 0000000..d8ecf19 --- /dev/null +++ b/extensions/channel.xml @@ -0,0 +1,9 @@ +<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 telepathy-sofiasip</tp:title> + +<xi:include href="Channel_Interface_Hold.xml"/> + +</tp:spec> diff --git a/extensions/extensions-cli.c b/extensions/extensions-cli.c new file mode 100644 index 0000000..9ccd2e3 --- /dev/null +++ b/extensions/extensions-cli.c @@ -0,0 +1,19 @@ +#include "extensions.h" + +#include <telepathy-glib/channel.h> +#include <telepathy-glib/proxy-subclass.h> + +#include "_gen/signals-marshal.h" + +/* include auto-generated stubs for client-specific code */ +#include "_gen/cli-channel-body.h" +#include "_gen/register-dbus-glib-marshallers-body.h" + +void +sip_cli_init (void) +{ + _sip_ext_register_dbus_glib_marshallers (); + + tp_proxy_or_subclass_hook_on_interface_add (TP_TYPE_CHANNEL, + sip_cli_channel_add_signals); +} diff --git a/extensions/extensions.c b/extensions/extensions.c new file mode 100644 index 0000000..eeda462 --- /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 0000000..242a07f --- /dev/null +++ b/extensions/extensions.h @@ -0,0 +1,20 @@ +#ifndef __SIP_EXTENSIONS_H__ +#define __SIP_EXTENSIONS_H__ + +#include <glib-object.h> +#include <telepathy-glib/channel.h> + +#include "extensions/_gen/enums.h" +#include "extensions/_gen/cli-channel.h" +#include "extensions/_gen/svc-channel.h" + +G_BEGIN_DECLS + +#include "extensions/_gen/gtypes.h" +#include "extensions/_gen/interfaces.h" + +void sip_cli_init (void); + +G_END_DECLS + +#endif |