Mercurial > pidgin
comparison src/signals.c @ 11080:f54740547c95
[gaim-migrate @ 13092]
All gaim signals are automatically relayed to dbus.
committer: Tailor Script <tailor@pidgin.im>
author | Piotr Zielinski <zielaj> |
---|---|
date | Sun, 10 Jul 2005 02:29:52 +0000 |
parents | e4459e8ccfb5 |
children | 1c5398ccbeb0 |
comparison
equal
deleted
inserted
replaced
11079:b2ace57224e2 | 11080:f54740547c95 |
---|---|
22 * along with this program; if not, write to the Free Software | 22 * along with this program; if not, write to the Free Software |
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
24 */ | 24 */ |
25 #include "internal.h" | 25 #include "internal.h" |
26 | 26 |
27 #include "dbus-maybe.h" | |
27 #include "debug.h" | 28 #include "debug.h" |
28 #include "signals.h" | 29 #include "signals.h" |
29 #include "value.h" | 30 #include "value.h" |
30 | 31 |
31 /* must include this to use G_VA_COPY */ | 32 /* must include this to use G_VA_COPY */ |
55 GList *handlers; | 56 GList *handlers; |
56 size_t handler_count; | 57 size_t handler_count; |
57 | 58 |
58 gulong next_handler_id; | 59 gulong next_handler_id; |
59 | 60 |
61 int dbus_id; | |
60 } GaimSignalData; | 62 } GaimSignalData; |
61 | 63 |
62 typedef struct | 64 typedef struct |
63 { | 65 { |
64 gulong id; | 66 gulong id; |
164 g_hash_table_insert(instance_data->signals, | 166 g_hash_table_insert(instance_data->signals, |
165 g_strdup(signal), signal_data); | 167 g_strdup(signal), signal_data); |
166 | 168 |
167 instance_data->next_signal_id++; | 169 instance_data->next_signal_id++; |
168 instance_data->signal_count++; | 170 instance_data->signal_count++; |
171 | |
172 #ifdef HAVE_DBUS | |
173 /* DBus messages are sent directly to the bus so the | |
174 marshalling function is never called. */ | |
175 signal_data->dbus_id = | |
176 gaim_dbus_signal_register_gaim(gaim_dbus_object, signal, | |
177 gaim_dbus_invalid_marshaller, | |
178 num_values, signal_data->values); | |
179 #endif /* HAVE_DBUS */ | |
169 | 180 |
170 return signal_data->id; | 181 return signal_data->id; |
171 } | 182 } |
172 | 183 |
173 void | 184 void |
485 handler_data->data, NULL); | 496 handler_data->data, NULL); |
486 } | 497 } |
487 | 498 |
488 va_end(tmp); | 499 va_end(tmp); |
489 } | 500 } |
501 | |
502 #ifdef HAVE_DBUS | |
503 gaim_dbus_signal_emit_gaim(gaim_dbus_object, signal_data->dbus_id, | |
504 signal_data->num_values, | |
505 signal_data->values, args); | |
506 #endif /* HAVE_DBUS */ | |
507 | |
490 } | 508 } |
491 | 509 |
492 void * | 510 void * |
493 gaim_signal_emit_return_1(void *instance, const char *signal, ...) | 511 gaim_signal_emit_return_1(void *instance, const char *signal, ...) |
494 { | 512 { |
530 { | 548 { |
531 gaim_debug(GAIM_DEBUG_ERROR, "signals", | 549 gaim_debug(GAIM_DEBUG_ERROR, "signals", |
532 "Signal data for %s not found!\n", signal); | 550 "Signal data for %s not found!\n", signal); |
533 return 0; | 551 return 0; |
534 } | 552 } |
553 | |
554 #ifdef HAVE_DBUS | |
555 gaim_dbus_signal_emit_gaim(gaim_dbus_object, signal_data->dbus_id, | |
556 signal_data->num_values, | |
557 signal_data->values, args); | |
558 #endif /* HAVE_DBUS */ | |
535 | 559 |
536 for (l = signal_data->handlers; l != NULL; l = l_next) | 560 for (l = signal_data->handlers; l != NULL; l = l_next) |
537 { | 561 { |
538 void *ret_val = NULL; | 562 void *ret_val = NULL; |
539 | 563 |