Signals with more than one parameter

Steve Kreyer steve.kreyer at web.de
Fri May 18 08:24:40 PDT 2007


Havoc Pennington wrote:
>
>
> Steve Kreyer wrote:
>> Hi,
>>
>> I'm new to DBus. I'm using the glib- binding to develop an "IPC-
>> application". I can send signals with one parameter over DBus, but it
>> doesn't seem to work with more than one parameter. Is it possible in
>> general? 
>
> Should work fine.
>
>> Also I wonder that there isn't any marshal information for a
>> particular signal in dbus_glib__object_info, like it is the case for
>> methods ...
>
> That's because the marshal info is already in the GObject; see your
> call to g_signal_new(), that is registering the signal and its
> introspection info.
>
>> Maybe you  have some hints on how I can extend the following peace of
>> code to send signals with more than 1 parameter?
>
> Did you forget to change g_signal_new() and related places also? There
> are a number of places you would need to change the code.
>
> Havoc
>
>
First, thanks for your answer ...
Ok, I see. But I didn't get it to work. I see 2 main problems here for me:
1.) glib doesnt provide a matching closure. Do I have to implement it by
myself ? If yes, is there any doc outside on how I can do this ?
2.) If I add a signal at client side:
    dbus_g_proxy_add_signal (proxy,
            "kbd_event",
            G_TYPE_INT,
            G_TYPE_INT,
            G_TYPE_INVALID);
and register the same signal on server side, like this:
    g_signal_id = g_signal_new ("kbd_event",
                        G_TYPE_OBJECT,
                        G_SIGNAL_RUN_LAST | G_SIGNAL_NO_RECURSE |
G_SIGNAL_NO_HOOKS,
                        0,
                        NULL,
                        NULL,
                        g_cclosure_marshal_VOID__INT, /* don't know what
closure to choose */
                        G_TYPE_NONE,
                        2,
                        G_TYPE_INT,
                        G_TYPE_INT);

I get an error on client side while registering the signal:
** (process:8607): WARNING **: No marshaller for signature of signal
'kbd_event'



Regards,
Steve
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3245 bytes
Desc: S/MIME Cryptographic Signature
Url : http://lists.freedesktop.org/archives/dbus/attachments/20070518/b0024c76/attachment.bin 


More information about the dbus mailing list