| GObject Reference Manual | |||
|---|---|---|---|
| <<< Previous Page | Home | Up | |
#include <gobject.h> #define G_CLOSURE_NEEDS_MARSHAL (closure) #define G_CCLOSURE_SWAP_DATA (cclosure) #define G_CALLBACK (f) void (*GCallback) (void); struct GClosure; struct GCClosure; void (*GClosureMarshal) (GClosure *closure, GValue *return_value, guint n_param_values, const GValue *param_values, gpointer invocation_hint, gpointer marshal_data); void (*GClosureNotify) (gpointer data, GClosure *closure); struct GClosureNotifyData; GClosure* g_cclosure_new (GCallback callback_func, gpointer user_data, GClosureNotify destroy_data); GClosure* g_cclosure_new_swap (GCallback callback_func, gpointer user_data, GClosureNotify destroy_data); GClosure* g_cclosure_new_object (GCallback callback_func, gpointer object); GClosure* g_cclosure_new_object_swap (GCallback callback_func, gpointer object); GClosure* g_closure_new_object (guint sizeof_closure, GObject *object); GClosure* g_closure_ref (GClosure *closure); void g_closure_unref (GClosure *closure); void g_closure_invoke (GClosure *closure, GValue *return_value, guint n_param_values, const GValue *param_values, gpointer invocation_hint); void g_closure_invalidate (GClosure *closure); GClosure* g_closure_new_simple (guint sizeof_closure, gpointer data); void g_closure_set_marshal (GClosure *closure, GClosureMarshal marshal); void g_closure_add_marshal_guards (GClosure *closure, gpointer pre_marshal_data, GClosureNotify pre_marshal_notify, gpointer post_marshal_data, GClosureNotify post_marshal_notify); void g_closure_set_meta_marshal (GClosure *closure, gpointer marshal_data, GClosureMarshal meta_marshal); |
#define G_CLOSURE_NEEDS_MARSHAL(closure) (((GClosure*) (closure))->marshal == NULL) |
#define G_CCLOSURE_SWAP_DATA(cclosure) (((GClosure*) (closure))->derivative_flag) |
struct GClosure
{
/*< private >*/ guint ref_count : 15;
/*< private >*/ guint meta_marshal : 1;
/*< private >*/ guint n_guards : 1;
/*< private >*/ guint n_fnotifiers : 2; /* finalization notifiers */
/*< private >*/ guint n_inotifiers : 8; /* invalidation notifiers */
/*< private >*/ guint in_inotify : 1;
/*< private >*/ guint floating : 1;
/*< protected >*/ guint derivative_flag : 1;
/*< puplic >*/ guint in_marshal : 1;
/*< public >*/ guint is_invalid : 1;
/*< private >*/ void (*marshal) (GClosure *closure,
GValue /*out*/ *return_value,
guint n_param_values,
const GValue *param_values,
gpointer invocation_hint,
gpointer marshal_data);
/*< protected >*/ gpointer data;
/*< private >*/ GClosureNotifyData *notifiers;
/* invariants/constrains:
* - ->marshal and ->data are _invalid_ as soon as ->is_invalid==TRUE
* - invocation of all inotifiers occours prior to fnotifiers
* - order of inotifiers is random
* inotifiers may _not_ free/invalidate parameter values (e.g. ->data)
* - order of fnotifiers is random
* - each notifier may only be removed before or during its invocation
* - reference counting may only happen prior to fnotify invocation
* (in that sense, fnotifiers are really finalization handlers)
*/
}; |
void (*GClosureMarshal) (GClosure *closure, GValue *return_value, guint n_param_values, const GValue *param_values, gpointer invocation_hint, gpointer marshal_data); |
GClosure* g_cclosure_new (GCallback callback_func, gpointer user_data, GClosureNotify destroy_data); |
GClosure* g_cclosure_new_swap (GCallback callback_func, gpointer user_data, GClosureNotify destroy_data); |
GClosure* g_cclosure_new_object_swap (GCallback callback_func, gpointer object); |
void g_closure_invoke (GClosure *closure, GValue *return_value, guint n_param_values, const GValue *param_values, gpointer invocation_hint); |
void g_closure_add_marshal_guards (GClosure *closure, gpointer pre_marshal_data, GClosureNotify pre_marshal_notify, gpointer post_marshal_data, GClosureNotify post_marshal_notify); |
void g_closure_set_meta_marshal (GClosure *closure, gpointer marshal_data, GClosureMarshal meta_marshal); |