diff options
author | Not Zed <NotZed@Ximian.com> | 2002-07-03 09:42:50 +0800 |
---|---|---|
committer | Michael Zucci <zucchi@src.gnome.org> | 2002-07-03 09:42:50 +0800 |
commit | d49a387afc10d7e43f582eda2d14cda03ae2bfe5 (patch) | |
tree | c945756ee1110a282f24e27277034bea7ef6eaaf /camel/camel-object.c | |
parent | df61377255d37dbc7d0436c46e8d679c8053176c (diff) | |
download | gsoc2013-evolution-d49a387afc10d7e43f582eda2d14cda03ae2bfe5.tar.gz gsoc2013-evolution-d49a387afc10d7e43f582eda2d14cda03ae2bfe5.tar.zst gsoc2013-evolution-d49a387afc10d7e43f582eda2d14cda03ae2bfe5.zip |
Take a void object arg. (camel_object_remove_event): "
2002-06-27 Not Zed <NotZed@Ximian.com>
* camel-object.c (camel_object_hook_event): Take a void object arg.
(camel_object_remove_event): "
(camel_object_unhook_event): "
(camel_object_trigger_event): ", also, execute events in the same
order they were added, i.e. reverse hook-list order.
svn path=/trunk/; revision=17359
Diffstat (limited to 'camel/camel-object.c')
-rw-r--r-- | camel/camel-object.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/camel/camel-object.c b/camel/camel-object.c index 5e7eac7504..6e3b5ef54b 100644 --- a/camel/camel-object.c +++ b/camel/camel-object.c @@ -694,15 +694,16 @@ static CamelHookList *camel_object_get_hooks(CamelObject *o) #endif unsigned int -camel_object_hook_event(CamelObject * obj, const char * name, CamelObjectEventHookFunc func, void *data) +camel_object_hook_event(void *vo, const char * name, CamelObjectEventHookFunc func, void *data) { + CamelObject *obj = vo; CamelHookPair *pair, *hook; CamelHookList *hooks; int id; - g_return_val_if_fail (CAMEL_IS_OBJECT (obj), 0); - g_return_val_if_fail (name != NULL, 0); - g_return_val_if_fail (func != NULL, 0); + g_return_val_if_fail(CAMEL_IS_OBJECT (obj), 0); + g_return_val_if_fail(name != NULL, 0); + g_return_val_if_fail(func != NULL, 0); hook = obj->klass->hooks; while (hook) { @@ -736,8 +737,9 @@ setup: } void -camel_object_remove_event(CamelObject * obj, unsigned int id) +camel_object_remove_event(void *vo, unsigned int id) { + CamelObject *obj = vo; CamelHookList *hooks; CamelHookPair *pair, *parent; @@ -778,8 +780,9 @@ camel_object_remove_event(CamelObject * obj, unsigned int id) } void -camel_object_unhook_event(CamelObject * obj, const char * name, CamelObjectEventHookFunc func, void *data) +camel_object_unhook_event(void *vo, const char * name, CamelObjectEventHookFunc func, void *data) { + CamelObject *obj = vo; CamelHookList *hooks; CamelHookPair *pair, *parent; @@ -823,8 +826,9 @@ camel_object_unhook_event(CamelObject * obj, const char * name, CamelObjectEvent } void -camel_object_trigger_event (CamelObject * obj, const char * name, void *event_data) +camel_object_trigger_event(void *vo, const char * name, void *event_data) { + CamelObject *obj = vo; CamelHookList *hooks; CamelHookPair *pair, **pairs, *parent, *hook; int i, size; @@ -872,7 +876,7 @@ trigger: } /* now execute the events we have, if they haven't been removed during our calls */ - for (i=0;i<size;i++) { + for (i=size-1;i>=0;i--) { pair = pairs[i]; if ((pair->flags & CAMEL_HOOK_PAIR_REMOVED) == 0) (pair->func.event) (obj, event_data, pair->data); |