empathy r917 - trunk/extensions



Author: xclaesse
Date: Fri Apr 11 14:11:27 2008
New Revision: 917
URL: http://svn.gnome.org/viewvc/empathy?rev=917&view=rev

Log:
Update extensions dir based on the example in tp-glib


Modified:
   trunk/extensions/Makefile.am
   trunk/extensions/all.xml
   trunk/extensions/extensions-cli.c
   trunk/extensions/misc.xml

Modified: trunk/extensions/Makefile.am
==============================================================================
--- trunk/extensions/Makefile.am	(original)
+++ trunk/extensions/Makefile.am	Fri Apr 11 14:11:27 2008
@@ -15,7 +15,7 @@
 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 @@
 
 # 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 @@
 	$(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 @@
 # 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 \

Modified: trunk/extensions/all.xml
==============================================================================
--- trunk/extensions/all.xml	(original)
+++ trunk/extensions/all.xml	Fri Apr 11 14:11:27 2008
@@ -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>

Modified: trunk/extensions/extensions-cli.c
==============================================================================
--- trunk/extensions/extensions-cli.c	(original)
+++ trunk/extensions/extensions-cli.c	Fri Apr 11 14:11:27 2008
@@ -9,17 +9,23 @@
 #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;
+  static GOnce once = G_ONCE_INIT;
 
-  if (!initialized)
-    {
-      _emp_ext_register_dbus_glib_marshallers ();
-
-      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);
 }

Modified: trunk/extensions/misc.xml
==============================================================================
--- trunk/extensions/misc.xml	(original)
+++ trunk/extensions/misc.xml	Fri Apr 11 14:11:27 2008
@@ -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"/>



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]