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.
- 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
-
|
v4
|
v5
|
|
| 272 | 272 | {{{ |
| 273 | 273 | signal sender=:1.21 -> dest=(null destination) path=/im/pidgin/purple/PurpleObject; interface=im.pidgin.purple.PurpleInterface; member=ReceivedImMsg |
| 274 | | uint32 1097 |
| | 274 | int32 1097 |
| 275 | 275 | string "mybuddy@hotmail.com" |
| 276 | 276 | string "<FONT FACE="Times"><FONT COLOR="#000000">Hi!</FONT></FONT>" |
| 277 | | uint32 8728 |
| | 277 | int32 8728 |
| 278 | 278 | uint32 0 |
| 279 | 279 | }}} |
| … |
… |
|
| 281 | 281 | Now you know that the parameters associated with signal '''''!ReceivedImMsg''''' are: |
| 282 | 282 | {{{ |
| 283 | | UINT32, |
| | 283 | INT32, |
| 284 | 284 | STRING, |
| 285 | 285 | STRING, |
| 286 | | UINT32, |
| | 286 | INT32, |
| 287 | 287 | UINT32 |
| 288 | 288 | }}} |
| … |
… |
|
| 290 | 290 | Then we can create file '''marshal.list''' with the one line marshaller function definition: |
| 291 | 291 | {{{ |
| 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. |
| | 292 | VOID: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! ''' |
| 296 | 296 | |
| 297 | 297 | * 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: |
| … |
… |
|
| 324 | 324 | |
| 325 | 325 | /* Signal callback handling routing */ |
| 326 | | void received_im_msg_cb (DBusGProxy *purple_proxy, unsigned int account_id, |
| | 326 | void received_im_msg_cb (DBusGProxy *purple_proxy, int account_id, |
| 327 | 327 | const char *sender, const char *message, |
| 328 | | unsigned int conv_id, unsigned int flags, |
| | 328 | int conv_id, unsigned int flags, |
| 329 | 329 | gpointer user_data) |
| 330 | 330 | { |
| … |
… |
|
| 366 | 366 | |
| 367 | 367 | /* 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, |
| 371 | 371 | G_TYPE_INVALID); |
| 372 | 372 | |
| 373 | 373 | /* Add the signal to the proxy */ |
| 374 | 374 | 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); |
| 377 | 377 | |
| 378 | 378 | /* 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!