summaryrefslogtreecommitdiff
path: root/extensions
diff options
context:
space:
mode:
authorSjoerd Simons <sjoerd@luon.net>2007-04-17 19:43:01 +0000
committerSjoerd Simons <sjoerd@luon.net>2007-04-17 19:43:01 +0000
commitce582772460d886c73f0eb58bcbd2581ed85bf51 (patch)
treee2e54a629ebfe248df59d413b4ceaba0e24997c0 /extensions
parentf08a86ab088b7a9c5016c978de3e93212db874a1 (diff)
downloadtelepathy-salut-ce582772460d886c73f0eb58bcbd2581ed85bf51.tar.gz
Add codegeneration and build infrastructure for OLPC
20070417194301-93b9a-f4bb96a6c6ae35d9a4354d0f099860b0c32c9df6.gz
Diffstat (limited to 'extensions')
-rw-r--r--extensions/.git-darcs-dir0
-rw-r--r--extensions/Makefile.am83
-rw-r--r--extensions/OLPC_Activity_Properties.xml99
-rw-r--r--extensions/OLPC_Buddy_Info.xml232
-rw-r--r--extensions/all.xml28
-rw-r--r--extensions/spec-gen.am6
6 files changed, 448 insertions, 0 deletions
diff --git a/extensions/.git-darcs-dir b/extensions/.git-darcs-dir
new file mode 100644
index 00000000..e69de29b
--- /dev/null
+++ b/extensions/.git-darcs-dir
diff --git a/extensions/Makefile.am b/extensions/Makefile.am
new file mode 100644
index 00000000..3dd9d332
--- /dev/null
+++ b/extensions/Makefile.am
@@ -0,0 +1,83 @@
+if ENABLE_OLPC
+
+tools_dir = $(srcdir)/../lib/tools
+
+# This is a derived file but must be checked-in to Darcs anyway,
+# for bootstrapping.
+spec-gen.am: Makefile.am all.xml $(SPEC_INTERFACE_XMLS) \
+ $(tools_dir)/ls-interfaces.xsl
+ $(XSLTPROC) $(XSLTPROCFLAGS) --xinclude \
+ $(tools_dir)/ls-interfaces.xsl \
+ $(srcdir)/all.xml > spec-gen.tmp
+ @echo Interfaces to be generated are:
+ @cat spec-gen.tmp ; echo
+ @echo end of interfaces list
+ (\
+ echo SPEC_INTERFACES = `cat spec-gen.tmp` && \
+ echo SPEC_INTERFACE_XMLS = `sed -e 's,[A-Za-z_][A-Za-z_]*,./&.xml,g' spec-gen.tmp` && \
+ echo SPEC_GENERATED_CS = `sed -e 's,[A-Za-z_][A-Za-z_]*,_gen/svc-&.c,g' spec-gen.tmp` && \
+ echo SPEC_GENERATED_HS = `sed -e 's,[A-Za-z_][A-Za-z_]*,_gen/svc-&.h,g' spec-gen.tmp` && \
+ echo SPEC_GLUE_HS = `sed -e 's,[A-Za-z_][A-Za-z_]*,_gen/svc-&-glue.h,g' spec-gen.tmp` && \
+ echo SPEC_GENERATED_LISTS = `sed -e 's,[A-Za-z_][A-Za-z_]*,_gen/svc-&-signals-marshal.list,g' spec-gen.tmp` \
+ ) > spec-gen.am
+ rm -f spec-gen.tmp
+
+include spec-gen.am
+
+SPEC_GENERATED_SOURCES = $(SPEC_GENERATED_CS) $(SPEC_GENERATED_HS) \
+ $(SPEC_GENERATED_LISTS) $(SPEC_GLUE_HS)
+
+noinst_LTLIBRARIES = libsalut-extensions.la
+
+nodist_libsalut_extensions_la_SOURCES = \
+ _gen/signals-marshal.c \
+ _gen/signals-marshal.h \
+ _gen/signals-marshal.list \
+ $(SPEC_GENERATED_SOURCES)
+
+BUILT_SOURCES = $(nodist_libsalut_extensions_la_SOURCES)
+
+CLEANFILES = $(BUILT_SOURCES) _gen/.exists
+
+clean-local:
+ -rmdir _gen
+
+AM_CFLAGS = $(ERROR_CFLAGS) @DBUS_CFLAGS@ @GLIB_CFLAGS@ \
+ @TELEPATHY_GLIB_CFLAGS@
+
+AM_LDFLAGS = @DBUS_LIBS@ @GLIB_LIBS@ @TELEPATHY_GLIB_LIBS@
+# Generated stuff
+
+DROP_NAMESPACE = sed -e 's@xmlns:tp="http://telepathy\.freedesktop\.org/wiki/DbusSpec.extensions-v0"@@g'
+XSLTPROCFLAGS = --nonet --novalid
+
+_gen/.exists:
+ $(INSTALL) -d _gen
+ touch $@
+
+_gen/%.xml: %.xml $(tools_dir)/spec-to-introspect.xsl _gen/.exists
+ $(XSLTPROC) $(XSLTPROCFLAGS) \
+ $(tools_dir)/spec-to-introspect.xsl $< \
+ | $(DROP_NAMESPACE) > $@
+
+_gen/async-%.xml: _gen/%.xml $(tools_dir)/make-all-async.xsl _gen/.exists
+ $(XSLTPROC) $(XSLTPROCFLAGS) $(tools_dir)/make-all-async.xsl $< > $@
+
+_gen/svc-%-glue.h: _gen/async-%.xml _gen/.exists
+ $(DBUS_BINDING_TOOL) --mode=glib-server --output=$@ \
+ --prefix=tp_svc_`echo $* | tr A-Z a-z` $<
+
+_gen/svc-%.c _gen/svc-%.h _gen/svc-%-signals-marshal.list: %.xml $(tools_dir)/genginterface.py _gen/.exists
+ $(PYTHON) $(tools_dir)/genginterface.py $< \
+ TpSvc`echo $* | tr -d _` _gen/svc-$* _salut_ext
+
+_gen/signals-marshal.list: $(SPEC_GENERATED_LISTS)
+ sort $^ | uniq > $@
+
+_gen/signals-marshal.h: _gen/signals-marshal.list _gen/.exists
+ $(GLIB_GENMARSHAL) --header --prefix=_salut_ext_marshal $< > $@
+
+_gen/signals-marshal.c: _gen/signals-marshal.list _gen/.exists
+ $(GLIB_GENMARSHAL) --body --prefix=_salut_ext_marshal $< > $@
+
+endif
diff --git a/extensions/OLPC_Activity_Properties.xml b/extensions/OLPC_Activity_Properties.xml
new file mode 100644
index 00000000..dc848677
--- /dev/null
+++ b/extensions/OLPC_Activity_Properties.xml
@@ -0,0 +1,99 @@
+<?xml version="1.0" ?>
+<node name="/OLPC_Activity_Properties" 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA</p>
+ </tp:license>
+ <interface name="org.laptop.Telepathy.ActivityProperties">
+ <tp:requires interface="org.freedesktop.Telepathy.Connection"/>
+
+ <method name="SetProperties">
+ <arg direction="in" name="room" type="u">
+ <tp:docstring>
+ An integer handle representing the room of the activity
+ </tp:docstring>
+ </arg>
+ <arg direction="in" name="properties" type="a{sv}">
+ <tp:docstring>
+ A dictionary mapping properties names to the desired values
+ </tp:docstring>
+ </arg>
+ <tp:docstring>
+ Set the properties of the activity associated to the given room for this connection.
+ You have to be the owner of this activity.
+ </tp:docstring>
+ <tp:possible-errors>
+ <tp:error name="org.freedesktop.Telepathy.Error.Disconnected"/>
+ <tp:error name="org.freedesktop.Telepathy.Error.InvalidArgument"/>
+ <tp:error name="org.freedesktop.Telepathy.Error.PermissionDenied"/>
+ </tp:possible-errors>
+ </method>
+
+ <method name="GetProperties">
+ <arg direction="in" name="room" type="u">
+ <tp:docstring>
+ An integer handle for the activity's room to request his properties for
+ </tp:docstring>
+ </arg>
+ <arg direction="out" name="properties" type="a{sv}">
+ <tp:docstring>
+ A dictionary mapping properties names to their values
+ </tp:docstring>
+ </arg>
+ <tp:docstring>
+ Get the properties of a particular activity.
+ </tp:docstring>
+ <tp:possible-errors>
+ <tp:error name="org.freedesktop.Telepathy.Error.Disconnected"/>
+ <tp:error name="org.freedesktop.Telepathy.Error.InvalidArgument"/>
+ </tp:possible-errors>
+ </method>
+
+ <signal name="ActivityPropertiesChanged">
+ <arg name="room" type="u">
+ <tp:docstring>
+ An integer handle representing the room of the activity
+ </tp:docstring>
+ </arg>
+ <arg name="properties" type="a{sv}">
+ <tp:docstring>
+ A dictionary mapping properties names to their new values
+ </tp:docstring>
+ </arg>
+ <tp:docstring>
+ Signal emitted when the properties of an activity are changed.
+ </tp:docstring>
+ </signal>
+
+ <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
+ <p>An interface on connections to associate OLPC activity properties
+ with rooms.</p>
+
+ <p>The following types and names are used to request and set properties:</p>
+ <dl>
+ <dt>s:color</dt>
+ <dd>The color of the activity. Format used is #RRGGBB,#RRGGBB (stroke,fill).</dd>
+
+ <dt>s:name</dt>
+ <dd>The name of the activity.</dd>
+
+ <dt>s:type</dt>
+ <dd>The type of the activity.</dd>
+ </dl>
+
+ </tp:docstring>
+ </interface>
+</node>
+<!-- vim:set sw=2 sts=2 et ft=xml: -->
diff --git a/extensions/OLPC_Buddy_Info.xml b/extensions/OLPC_Buddy_Info.xml
new file mode 100644
index 00000000..dd8e7212
--- /dev/null
+++ b/extensions/OLPC_Buddy_Info.xml
@@ -0,0 +1,232 @@
+<?xml version="1.0" ?>
+<node name="/OLPC_Buddy_Info" 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA</p>
+ </tp:license>
+ <interface name="org.laptop.Telepathy.BuddyInfo">
+ <tp:requires interface="org.freedesktop.Telepathy.Connection"/>
+
+ <method name="SetProperties">
+ <arg direction="in" name="properties" type="a{sv}">
+ <tp:docstring>
+ A dictionary mapping information names to the desired values
+ </tp:docstring>
+ </arg>
+ <tp:docstring>
+ Set the information of the local user for this connection.
+ </tp:docstring>
+ <tp:possible-errors>
+ <tp:error name="org.freedesktop.Telepathy.Error.Disconnected"/>
+ <tp:error name="org.freedesktop.Telepathy.Error.InvalidArgument"/>
+ </tp:possible-errors>
+ </method>
+
+ <method name="GetProperties">
+ <arg direction="in" name="contact" type="u">
+ <tp:docstring>
+ An integer handle for the contact to request his properties for
+ </tp:docstring>
+ </arg>
+ <arg direction="out" name="properties" type="a{sv}">
+ <tp:docstring>
+ A dictionary mapping information names to their values
+ </tp:docstring>
+ </arg>
+ <tp:docstring>
+ Get the properties of a particular contact.
+ </tp:docstring>
+ <tp:possible-errors>
+ <tp:error name="org.freedesktop.Telepathy.Error.Disconnected"/>
+ <tp:error name="org.freedesktop.Telepathy.Error.InvalidArgument"/>
+ </tp:possible-errors>
+ </method>
+
+ <signal name="PropertiesChanged">
+ <arg name="contact" type="u">
+ <tp:docstring>
+ An integer handle representing the contact
+ </tp:docstring>
+ </arg>
+ <arg name="properties" type="a{sv}">
+ <tp:docstring>
+ A dictionary mapping information names to their new values
+ </tp:docstring>
+ </arg>
+ <tp:docstring>
+ Signal emitted when the properties of a contact from your 'subscribed'
+ contact list are changed.
+ </tp:docstring>
+ </signal>
+
+ <method name="SetActivities">
+ <arg direction="in" name="activities" type="a(su)">
+ <tp:docstring>
+ An array of structs containing:
+ <ul>
+ <li>the identifier of the activity</li>
+ <li>the handle of the activity channel</li>
+ </ul>
+ </tp:docstring>
+ </arg>
+ <tp:docstring>
+ Set the activities of the local user for this connection.
+ </tp:docstring>
+ <tp:possible-errors>
+ <tp:error name="org.freedesktop.Telepathy.Error.Disconnected"/>
+ <tp:error name="org.freedesktop.Telepathy.Error.InvalidArgument"/>
+ </tp:possible-errors>
+ </method>
+
+ <method name="GetActivities">
+ <arg direction="in" name="contact" type="u">
+ <tp:docstring>
+ An integer handle for the contact to request his activities for
+ </tp:docstring>
+ </arg>
+ <arg direction="out" name="activities" type="a(su)">
+ <tp:docstring>
+ An array of structs containing:
+ <ul>
+ <li>the identifier of the activity</li>
+ <li>the handle of the activity channel</li>
+ </ul>
+ </tp:docstring>
+ </arg>
+ <tp:docstring>
+ Get the activities of a particular contact.
+ </tp:docstring>
+ <tp:possible-errors>
+ <tp:error name="org.freedesktop.Telepathy.Error.Disconnected"/>
+ <tp:error name="org.freedesktop.Telepathy.Error.InvalidArgument"/>
+ </tp:possible-errors>
+ </method>
+
+ <signal name="ActivitiesChanged">
+ <arg name="contact" type="u">
+ <tp:docstring>
+ An integer handle representing the contact
+ </tp:docstring>
+ </arg>
+ <arg name="activities" type="a(su)">
+ <tp:docstring>
+ An array of structs containing:
+ <ul>
+ <li>the identifier of the activity</li>
+ <li>the handle of the activity channel</li>
+ </ul>
+ </tp:docstring>
+ </arg>
+ <tp:docstring>
+ Signal emitted when the activities of a contact from your 'subscribed'
+ contact list are changed.
+ </tp:docstring>
+ </signal>
+
+ <method name="SetCurrentActivity">
+ <arg direction="in" name="activity" type="s">
+ <tp:docstring>
+ The identifier of the activity
+ </tp:docstring>
+ </arg>
+ <arg direction="in" name="channel" type="u">
+ <tp:docstring>
+ The handle of the activity channel
+ </tp:docstring>
+ </arg>
+ <tp:docstring>
+ Set the current activity of the local user for this connection.
+ </tp:docstring>
+ <tp:possible-errors>
+ <tp:error name="org.freedesktop.Telepathy.Error.Disconnected"/>
+ <tp:error name="org.freedesktop.Telepathy.Error.InvalidArgument"/>
+ </tp:possible-errors>
+ </method>
+
+ <method name="GetCurrentActivity">
+ <arg direction="in" name="contact" type="u">
+ <tp:docstring>
+ An integer handle for the contact to request his activities for
+ </tp:docstring>
+ </arg>
+ <arg direction="out" name="activity" type="s">
+ <tp:docstring>
+ The identifier of the activity
+ </tp:docstring>
+ </arg>
+ <arg direction="out" name="channel" type="u">
+ <tp:docstring>
+ The handle of the activity channel
+ </tp:docstring>
+ </arg>
+ <tp:docstring>
+ Get the current activity of a particular contact.
+ </tp:docstring>
+ <tp:possible-errors>
+ <tp:error name="org.freedesktop.Telepathy.Error.Disconnected"/>
+ <tp:error name="org.freedesktop.Telepathy.Error.InvalidArgument"/>
+ </tp:possible-errors>
+ </method>
+
+ <signal name="CurrentActivityChanged">
+ <arg name="contact" type="u">
+ <tp:docstring>
+ An integer handle representing the contact
+ </tp:docstring>
+ </arg>
+ <arg name="activity" type="s">
+ <tp:docstring>
+ The identifier of the activity
+ </tp:docstring>
+ </arg>
+ <arg name="channel" type="u">
+ <tp:docstring>
+ The handle of the activity channel
+ </tp:docstring>
+ </arg>
+ <tp:docstring>
+ Signal emitted when the current activity of a contact from your 'subscribed'
+ contact list is changed.
+ </tp:docstring>
+ </signal>
+
+ <tp:docstring xmlns="http://www.w3.org/1999/xhtml">
+ <p>An interface on connections to associate OLPC buddy information
+ with contacts. Provides methods for the user to set their own information and
+ retrieve information of contacts.
+ User is automatically notified when information of contacts that are in his 'subscribe'
+ contact list change.</p>
+
+ <p>The following types and names are used to request and set information (except
+ for activities):</p>
+ <dl>
+ <dt>s:color</dt>
+ <dd>The color name of the buddy. Format used is #RRGGBB,#RRGGBB (stroke,fill).</dd>
+
+ <dt>ay:key</dt>
+ <dd>The public key of the buddy.</dd>
+ </dl>
+
+ <p>Activities are represented by a struct containing:</p>
+ <ul>
+ <li>the identifier of the activity</li>
+ <li>the handle of the activity channel</li>
+ </ul>
+
+ <p>If the activity identifier is empty (""), the handle is ignored and there is no current activity.</p>
+ </tp:docstring>
+ </interface>
+</node>
+<!-- vim:set sw=2 sts=2 et ft=xml: -->
diff --git a/extensions/all.xml b/extensions/all.xml
new file mode 100644
index 00000000..5a8071ef
--- /dev/null
+++ b/extensions/all.xml
@@ -0,0 +1,28 @@
+<tp:spec
+ xmlns:tp="http://telepathy.freedesktop.org/wiki/DbusSpec#extensions-v0"
+ xmlns:xi="http://www.w3.org/2001/XInclude">
+
+<tp:version>0.14.1.1</tp:version>
+
+<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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA</p>
+</tp:license>
+
+<xi:include href="OLPC_Buddy_Info.xml"/>
+<xi:include href="OLPC_Activity_Properties.xml"/>
+
+</tp:spec>
diff --git a/extensions/spec-gen.am b/extensions/spec-gen.am
new file mode 100644
index 00000000..7be0da8b
--- /dev/null
+++ b/extensions/spec-gen.am
@@ -0,0 +1,6 @@
+SPEC_INTERFACES = OLPC_Buddy_Info OLPC_Activity_Properties
+SPEC_INTERFACE_XMLS = ./OLPC_Buddy_Info.xml ./OLPC_Activity_Properties.xml
+SPEC_GENERATED_CS = _gen/svc-OLPC_Buddy_Info.c _gen/svc-OLPC_Activity_Properties.c
+SPEC_GENERATED_HS = _gen/svc-OLPC_Buddy_Info.h _gen/svc-OLPC_Activity_Properties.h
+SPEC_GLUE_HS = _gen/svc-OLPC_Buddy_Info-glue.h _gen/svc-OLPC_Activity_Properties-glue.h
+SPEC_GENERATED_LISTS = _gen/svc-OLPC_Buddy_Info-signals-marshal.list _gen/svc-OLPC_Activity_Properties-signals-marshal.list