]> git.0d.be Git - empathy.git/commitdiff
Update extensions dir based on the example in tp-glib
authorXavier Claessens <xclaesse@src.gnome.org>
Fri, 11 Apr 2008 13:11:27 +0000 (13:11 +0000)
committerXavier Claessens <xclaesse@src.gnome.org>
Fri, 11 Apr 2008 13:11:27 +0000 (13:11 +0000)
svn path=/trunk/; revision=917

extensions/Makefile.am
extensions/all.xml
extensions/extensions-cli.c
extensions/misc.xml

index 356211e71488809ccc45d94499cf196ef00f1762..1e765b88838700762f489247965dccadb341646c 100644 (file)
@@ -15,7 +15,7 @@ EXTRA_DIST = \
 noinst_LTLIBRARIES = libemp-extensions.la
 
 libemp_extensions_la_LIBADD = \
-    $(TELEPATHY_GLIB_LIBS)
+    $(TP_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
@@ -52,7 +52,7 @@ XSLTPROCFLAGS = --nonet --novalid
 
 # Generated files which can be generated for all categories simultaneously
 
-_gen/%.xml: %.xml $(wildcard *.xml)
+_gen/all.xml: all.xml $(wildcard *.xml)
        $(mkdir_p) _gen
        $(XSLTPROC) $(XSLTPROCFLAGS) --xinclude $(tools_dir)/identity.xsl \
                $< > $@
@@ -71,14 +71,12 @@ _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
+_gen/signals-marshal.h: _gen/signals-marshal.list Makefile.am
        $(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/signals-marshal.c: _gen/signals-marshal.list Makefile.am
+       { echo '#include "_gen/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
@@ -111,11 +109,19 @@ _gen/interfaces-body.h: _gen/all.xml \
 # 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)
+       $(mkdir_p) _gen
+       $(XSLTPROC) $(XSLTPROCFLAGS) --xinclude $(tools_dir)/identity.xsl \
+               $< > $@
+
 _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 \
+               --subclass=TpProxy \
+               --subclass-assert=TP_IS_PROXY \
                --iface-quark-prefix=EMP_IFACE_QUARK \
+               --tp-proxy-api=0.7.6 \
                $< Emp_Cli _gen/cli-misc
 
 _gen/svc-misc.c _gen/svc-misc.h: _gen/misc.xml \
index 2a0e109e87e08408806f545b484f25ef1c1bb9b1..d4986ff08bf8bda25684a3cec472ccaa16ee1885 100644 (file)
@@ -2,13 +2,21 @@
   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>
+<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:external-type name="DBus_Bus_Name" type="s"
+    from="Telepathy specification"/>
+  <tp:external-type name="DBus_Interface" type="s"
+    from="Telepathy specification"/>
+  <tp:external-type name="Handle_Type" type="u"
+    from="Telepathy specification"/>
+  <tp:external-type name="Handle" type="u"
+    from="Telepathy specification"/>
 </tp:generic-types>
 
 </tp:spec>
index 354f4c6dd49020f50cccc1acc6ccd59e7d9ed844..9a72da148fa61546b14ddf72d731e60928a4bcec 100644 (file)
@@ -9,17 +9,23 @@ static void _emp_ext_register_dbus_glib_marshallers (void);
 #include "_gen/cli-misc-body.h"
 #include "_gen/register-dbus-glib-marshallers-body.h"
 
+static gpointer
+emp_cli_once (gpointer data)
+{
+  _emp_ext_register_dbus_glib_marshallers ();
+
+  tp_proxy_init_known_interfaces ();
+
+  tp_proxy_or_subclass_hook_on_interface_add (TP_TYPE_PROXY,
+      emp_cli_misc_add_signals);
+
+  return NULL;
+}
+
 void
 emp_cli_init (void)
 {
-  static gboolean initialized = FALSE;
-
-  if (!initialized)
-    {
-      _emp_ext_register_dbus_glib_marshallers ();
+  static GOnce once = G_ONCE_INIT;
 
-      tp_proxy_or_subclass_hook_on_interface_add (TP_TYPE_PROXY,
-          emp_cli_misc_add_signals);
-      initialized = TRUE;
-    }
+  g_once (&once, emp_cli_once, NULL);
 }
index 070ae85c3a8f7373225a44d12fcaa9fb9a3760db..2bca333bf22de9833b39a86ef4739d623ec0fc2c 100644 (file)
@@ -2,7 +2,7 @@
   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>
+<tp:title>Misc extensions for Empathy</tp:title>
 
 <xi:include href="Stream_Engine.xml"/>
 <xi:include href="Channel_Handler.xml"/>