diff options
author | Tim Janik <timj@gtk.org> | 2001-03-08 16:34:59 +0000 |
---|---|---|
committer | Tim Janik <timj@src.gnome.org> | 2001-03-08 16:34:59 +0000 |
commit | 617332234d4426ed0941ec1e2cb9f0736bd796c3 (patch) | |
tree | 096311062437edd7f702200e6d8b1f9486f6dcad /gobject/gsignal.h | |
parent | c811ed93d3e7b64b3fcf5aab7ac405e0a8d36a59 (diff) |
destruction cleanup. there's one ->finalize_hook member in the hooklist
Thu Mar 8 16:23:34 2001 Tim Janik <timj@gtk.org>
* ghook.[hc]: destruction cleanup. there's one
->finalize_hook member in the hooklist now that gets
called when a hook should be destroyed, that's it.
that function is guarranteed to be called only when
all ref_counts to the hook vanished, thus also when
the hook is not in call.
Thu Mar 8 16:35:48 2001 Tim Janik <timj@gtk.org>
* gparamspecs.[hc]: s/g_param_spec_string_c/g_param_spec_stringc/.
* gsignal.[hc]: fixed accumulator invocation, implemented emission
hooks. and no, neither of these callbacks are called via a closure,
language bindings can wrap the accumulator and emission hook
interface, they already get parameters marshalled into a GValue array.
(g_signal_connect): removed this function as its C specific, doesn't
cover the swapped argument, is too close to its broken original
gtk_signal_connect() and creates demand for _swapped, _after and
_swapped_after variants <brrr>.
(g_signal_connectc): convenience macro to connect a C handler
func with data, like the old g_signal_connect() plus swapped
argument.
* gtype.h:
* gboxed.c: added G_TYPE_VALUE boxed type.
Diffstat (limited to 'gobject/gsignal.h')
-rw-r--r-- | gobject/gsignal.h | 48 |
1 files changed, 29 insertions, 19 deletions
diff --git a/gobject/gsignal.h b/gobject/gsignal.h index a1434da7a..476178e7c 100644 --- a/gobject/gsignal.h +++ b/gobject/gsignal.h @@ -37,10 +37,12 @@ typedef struct _GSignalInvocationHint GSignalInvocationHint; typedef GClosureMarshal GSignalCMarshaller; typedef gboolean (*GSignalEmissionHook) (GSignalInvocationHint *ihint, guint n_param_values, - const GValue *param_values); + const GValue *param_values, + gpointer data); typedef gboolean (*GSignalAccumulator) (GSignalInvocationHint *ihint, GValue *return_accu, - const GValue *return_value); + const GValue *handler_return, + gpointer data); /* --- run & match types --- */ @@ -92,7 +94,8 @@ guint g_signal_newv (const gchar *signal_name, GType itype, GSignalFlags signal_flags, GClosure *class_closure, - GSignalAccumulator accumulator, + GSignalAccumulator accumulator, + gpointer accu_data, GSignalCMarshaller c_marshaller, GType return_type, guint n_params, @@ -101,7 +104,8 @@ guint g_signal_new_valist (const gchar *signal_name, GType itype, GSignalFlags signal_flags, GClosure *class_closure, - GSignalAccumulator accumulator, + GSignalAccumulator accumulator, + gpointer accu_data, GSignalCMarshaller c_marshaller, GType return_type, guint n_params, @@ -110,7 +114,8 @@ guint g_signal_newc (const gchar *signal_name, GType itype, GSignalFlags signal_flags, guint class_offset, - GSignalAccumulator accumulator, + GSignalAccumulator accumulator, + gpointer accu_data, GSignalCMarshaller c_marshaller, GType return_type, guint n_params, @@ -137,16 +142,24 @@ void g_signal_query (guint signal_id, GSignalQuery *query); guint* g_signal_list_ids (GType itype, guint *n_ids); +gboolean g_signal_parse_name (const gchar *detailed_signal, + GType itype, + guint *signal_id_p, + GQuark *detail_p, + gboolean force_detail_quark); /* --- signal emissions --- */ -void g_signal_stop_emission (gpointer instance, - guint signal_id, - GQuark detail); -guint g_signal_add_emission_hook_full (guint signal_id, - GClosure *closure); -void g_signal_remove_emission_hook (guint signal_id, - guint hook_id); +void g_signal_stop_emission (gpointer instance, + guint signal_id, + GQuark detail); +guint g_signal_add_emission_hook (guint signal_id, + GQuark quark, + GSignalEmissionHook hook_func, + gpointer hook_data, + GDestroyNotify data_destroy); +void g_signal_remove_emission_hook (guint signal_id, + guint hook_id); /* --- signal handlers --- */ @@ -154,8 +167,6 @@ gboolean g_signal_has_handler_pending (gpointer instance, guint signal_id, GQuark detail, gboolean may_be_blocked); -#define g_signal_connect(instance, detailed_signal, c_handler, data) \ - g_signal_connect_data (instance, detailed_signal, c_handler, data, NULL, FALSE, FALSE) guint g_signal_connect_closure_by_id (gpointer instance, guint signal_id, GQuark detail, @@ -206,13 +217,12 @@ guint g_signal_handlers_disconnect_matched (gpointer instance, GClosure *closure, gpointer func, gpointer data); -gboolean g_signal_parse_name (const gchar *detailed_signal, - GType itype, - guint *signal_id_p, - GQuark *detail_p, - gboolean force_detail_quark); +/* --- convenience --- */ +#define g_signal_connectc(instance, detailed_signal, c_handler, data, swapped) \ + g_signal_connect_data ((instance), (detailed_signal), (c_handler), (data), NULL, (swapped), FALSE) + /*< private >*/ void g_signal_handlers_destroy (gpointer instance); void _g_signals_destroy (GType itype); |