GNOME Bugzilla – Bug 534806
Support interfaces for D-Bus services
Last modified: 2008-05-25 21:06:56 UTC
It should be possible to use Vala interfaces instead of classes to define D-Bus services. Usage should be exactly the same.
Created attachment 111521 [details] [review] Experimental implementation This is not yet tested, for preview purposes. Please let me know if this is heading in the right direction, Jürg.
Created attachment 111523 [details] Test being used to test this feature pvanhoof@nerts:~/repos/gnome/vala/trunk/tests$ /opt/vala-trunk/bin/valac test-dbus-interfaces.vala --pkg=dbus-glib-1 ** (valac:22206): CRITICAL **: vala_ccode_fragment_append: assertion `VALA_IS_CCODE_FRAGMENT (self)' failed ** (valac:22206): CRITICAL **: vala_ccode_fragment_append: assertion `VALA_IS_CCODE_FRAGMENT (self)' failed ** (valac:22206): CRITICAL **: vala_ccode_fragment_append: assertion `VALA_IS_CCODE_FRAGMENT (self)' failed pvanhoof@nerts:~/repos/gnome/vala/trunk/tests$
pvanhoof@nerts:~/repos/gnome/vala/trunk/tests$ gdb /opt/vala-trunk/bin/valac test-dbus-interfaces.vala --pkg=dbus-glib-1 pvanhoof@nerts:~/repos/gnome/vala/trunk/tests$ gdb /opt/vala-trunk/bin/valac GNU gdb 6.8-debian Copyright (C) 2008 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "i486-linux-gnu"... (gdb) set args test-dbus-interfaces.vala --pkg=dbus-glib-1 (gdb) break g_log Function "g_log" not defined. Make breakpoint pending on future shared library load? (y or [n]) y Breakpoint 1 (g_log) pending. (gdb) run Starting program: /opt/vala-trunk/bin/valac test-dbus-interfaces.vala --pkg=dbus-glib-1 Breakpoint 1, 0xb7f21e66 in g_log () from /usr/lib/libglib-2.0.so.0 (gdb) bt
+ Trace 198617
Created attachment 111525 [details] [review] Improvement This removes the warning
Created attachment 111526 [details] [review] Improvement This removes the warning
Created attachment 111527 [details] Generated code Generated code added for review
Comment on attachment 111526 [details] [review] Improvement Obsolete
Created attachment 111528 [details] [review] Improvement No more tricks with class_init_fragment
Created attachment 111529 [details] [review] Improvement, fixed overwriting the codegen.class_init_fragment Fixes a bug
Created attachment 111530 [details] [review] Nitpicking by Jürg :) Fixes ordering on filename in the Makefile.ams and a copyright year issue
Term-1 pvanhoof@nerts:~/repos/gnome/vala/trunk/tests$ ./test-dbus-interfaces ** Message: Hello from Vala ** Message: Hello from Vala ** Message: Hello from Vala ** Message: Hello from Vala ** Message: Hello from Vala Term-2 pvanhoof@nerts:~/repos/gnome/vala/trunk/tests$ ./test-dbus-interfaces ** Message: 0 pvanhoof@nerts:~/repos/gnome/vala/trunk/tests$ ./test-dbus-interfaces ** Message: 1 pvanhoof@nerts:~/repos/gnome/vala/trunk/tests$ ./test-dbus-interfaces ** Message: 2 pvanhoof@nerts:~/repos/gnome/vala/trunk/tests$ ./test-dbus-interfaces ** Message: 3 pvanhoof@nerts:~/repos/gnome/vala/trunk/tests$ ./test-dbus-interfaces ** Message: 4 pvanhoof@nerts:~/repos/gnome/vala/trunk/tests$
Committed as rev. 1440