Exposing DBus signals as Glib signals

मयंक जैन (makuchaku) mayank.gnu at gmail.com
Wed Apr 4 00:06:22 PDT 2007


Hi,

Is it a good methodology to expose DBus signals as GLib signals?
The objective here is to make only GLib signals available to the end
developer. The DBus functionality should be hidden from him.

So for example, if my object.xml says

<interface name="org.test.Makuchaku">
    <signal name="echo">
      <arg type="s" name="word"/>
    </signal>
</interface>

Can I make this DBus "echo" signal available as a GLib signal, so a
developer can do g_signal_connect for "echo", knowing nothing that its
a DBus signal. He should only be concerned with connecting to "echo" &
running his signal handler.

One example I could find over internet was
http://svn.gnome.org/viewcvs/xchat-gnome/trunk/src/common/dbus/example.c?revision=2484&view=markup
which uses dbus_g_proxy_connect_signal and dbus_g_proxy_add_signal.
dbus-glib's doc says for dbus_g_proxy_connect_signal, when the remote
interface emits the specified signal, the proxy will emit a
corresponding GLib signal.

I'm pretty new to DBus-glib & am doing my research based on the code I
can read in projects which already use DBus-glib.

Any suggestions on how this could be implemented, how good/bad is this
idea, any code-pointers... in this regard would be really helpful.

Many thanks in advance,

Makuchaku
http://www.makuchaku.info/blog


More information about the dbus mailing list