Trac is being migrated to new services! Issues can be found in our new YouTrack instance and WIKI pages can be found on our website.

Changes between Version 4 and Version 5 of DbusHowto


Ignore:
Timestamp:
Dec 13, 2008, 9:00:57 PM (15 years ago)
Author:
darkrain42
Comment:

Updated the C code because apparently UINT changed to INT at some point... *grumble*

Legend:

Unmodified
Added
Removed
Modified
  • DbusHowto

    v4 v5  
    272272{{{
    273273signal sender=:1.21 -> dest=(null destination) path=/im/pidgin/purple/PurpleObject; interface=im.pidgin.purple.PurpleInterface; member=ReceivedImMsg
    274    uint32 1097
     274   int32 1097
    275275   string "mybuddy@hotmail.com"
    276276   string "<FONT FACE="Times"><FONT COLOR="#000000">Hi!</FONT></FONT>"
    277    uint32 8728
     277   int32 8728
    278278   uint32 0
    279279}}}
     
    281281 Now you know that the parameters associated with signal '''''!ReceivedImMsg''''' are:
    282282{{{
    283 UINT32,
     283INT32,
    284284STRING,
    285285STRING,
    286 UINT32,
     286INT32,
    287287UINT32
    288288}}}
     
    290290 Then we can create file '''marshal.list''' with the one line marshaller function definition:
    291291{{{
    292 VOID:UINT,STRING,STRING,UINT,UINT
    293 }}}
    294 
    295  * The above event seems to have changed to( ver 2.4.1 ), INT,STRING,STRING,INT,UINT. Please use dbus-monitor to confirm the same for your version and modify marshal.list accordingly.
     292VOID:INT,STRING,STRING,INT,UINT
     293}}}
     294
     295 * '''Please note, apparently the types for these functions may have changed accidentally at one point. The original examples here had the types {{{ VOID:UINT,STRING,STRING,UINT,UINT }}}. Make sure to check the types with dbus-monitor and use the appropriate types or your callbacks will mysteriously not be triggered! '''
    296296
    297297 * Second, generate '''marshal.h''' and '''marshal.c'''[[BR]]After create your own file '''marshal.list''', you can then use tool '''glib-genmarshal''' to generate '''marshal.h''' and '''marshal.c''' in the following way:
     
    324324
    325325/* Signal callback handling routing */
    326 void received_im_msg_cb (DBusGProxy *purple_proxy, unsigned int account_id,
     326void received_im_msg_cb (DBusGProxy *purple_proxy, int account_id,
    327327                         const char *sender, const char *message,
    328                          unsigned int conv_id, unsigned int flags,
     328                         int conv_id, unsigned int flags,
    329329                         gpointer user_data)
    330330{
     
    366366
    367367    /* Register dbus signal marshaller */
    368     dbus_g_object_register_marshaller(marshal_VOID__UINT_STRING_STRING_UINT_UINT,
    369                                       G_TYPE_NONE, G_TYPE_UINT, G_TYPE_STRING,
    370                                       G_TYPE_STRING, G_TYPE_UINT, G_TYPE_UINT,
     368    dbus_g_object_register_marshaller(marshal_VOID__INT_STRING_STRING_INT_UINT,
     369                                      G_TYPE_NONE, G_TYPE_INT, G_TYPE_STRING,
     370                                      G_TYPE_STRING, G_TYPE_INT, G_TYPE_UINT,
    371371                                      G_TYPE_INVALID);
    372372       
    373373    /* Add the signal to the proxy */
    374374    dbus_g_proxy_add_signal(purple_proxy, "ReceivedImMsg",
    375                             G_TYPE_UINT, G_TYPE_STRING, G_TYPE_STRING,
    376                             G_TYPE_UINT, G_TYPE_UINT, G_TYPE_INVALID);
     375                            G_TYPE_INT, G_TYPE_STRING, G_TYPE_STRING,
     376                            G_TYPE_INT, G_TYPE_UINT, G_TYPE_INVALID);
    377377
    378378    /* Connect the signal handler to the proxy */
All information, including names and email addresses, entered onto this website or sent to mailing lists affiliated with this website will be public. Do not post confidential information, especially passwords!