Software: Apache/2.0.54 (Fedora). PHP/5.0.4 uname -a: Linux mina-info.me 2.6.17-1.2142_FC4smp #1 SMP Tue Jul 11 22:57:02 EDT 2006 i686 uid=48(apache) gid=48(apache) groups=48(apache) Safe-mode: OFF (not secure) /usr/share/gtk-doc/html/gobject/ drwxr-xr-x |
Viewing file: Select action/file-type:
Synopsis#include <glib-object.h> #define G_CLOSURE_NEEDS_MARSHAL (closure) #define G_CLOSURE_N_NOTIFIERS (cl) #define G_CCLOSURE_SWAP_DATA (cclosure) #define G_CALLBACK (f) void (*GCallback) (void); GClosure; #define G_TYPE_CLOSURE 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); 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, GObject *object); GClosure* g_cclosure_new_object_swap (GCallback callback_func, GObject *object); GClosure* g_closure_new_object (guint sizeof_closure, GObject *object); GClosure* g_closure_ref (GClosure *closure); void g_closure_sink (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); void g_closure_add_finalize_notifier (GClosure *closure, gpointer notify_data, GClosureNotify notify_func); void g_closure_add_invalidate_notifier (GClosure *closure, gpointer notify_data, GClosureNotify notify_func); void g_closure_remove_finalize_notifier (GClosure *closure, gpointer notify_data, GClosureNotify notify_func); void g_closure_remove_invalidate_notifier (GClosure *closure, gpointer notify_data, GClosureNotify notify_func); 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); void g_source_set_closure (GSource *source, GClosure *closure); #define G_TYPE_IO_CHANNEL #define G_TYPE_IO_CONDITION void g_cclosure_marshal_VOID__VOID (GClosure *closure, GValue *return_value, guint n_param_values, const GValue *param_values, gpointer invocation_hint, gpointer marshal_data); void g_cclosure_marshal_VOID__BOOLEAN (GClosure *closure, GValue *return_value, guint n_param_values, const GValue *param_values, gpointer invocation_hint, gpointer marshal_data); void g_cclosure_marshal_VOID__CHAR (GClosure *closure, GValue *return_value, guint n_param_values, const GValue *param_values, gpointer invocation_hint, gpointer marshal_data); void g_cclosure_marshal_VOID__UCHAR (GClosure *closure, GValue *return_value, guint n_param_values, const GValue *param_values, gpointer invocation_hint, gpointer marshal_data); void g_cclosure_marshal_VOID__INT (GClosure *closure, GValue *return_value, guint n_param_values, const GValue *param_values, gpointer invocation_hint, gpointer marshal_data); void g_cclosure_marshal_VOID__UINT (GClosure *closure, GValue *return_value, guint n_param_values, const GValue *param_values, gpointer invocation_hint, gpointer marshal_data); void g_cclosure_marshal_VOID__LONG (GClosure *closure, GValue *return_value, guint n_param_values, const GValue *param_values, gpointer invocation_hint, gpointer marshal_data); void g_cclosure_marshal_VOID__ULONG (GClosure *closure, GValue *return_value, guint n_param_values, const GValue *param_values, gpointer invocation_hint, gpointer marshal_data); void g_cclosure_marshal_VOID__ENUM (GClosure *closure, GValue *return_value, guint n_param_values, const GValue *param_values, gpointer invocation_hint, gpointer marshal_data); void g_cclosure_marshal_VOID__FLAGS (GClosure *closure, GValue *return_value, guint n_param_values, const GValue *param_values, gpointer invocation_hint, gpointer marshal_data); void g_cclosure_marshal_VOID__FLOAT (GClosure *closure, GValue *return_value, guint n_param_values, const GValue *param_values, gpointer invocation_hint, gpointer marshal_data); void g_cclosure_marshal_VOID__DOUBLE (GClosure *closure, GValue *return_value, guint n_param_values, const GValue *param_values, gpointer invocation_hint, gpointer marshal_data); void g_cclosure_marshal_VOID__STRING (GClosure *closure, GValue *return_value, guint n_param_values, const GValue *param_values, gpointer invocation_hint, gpointer marshal_data); void g_cclosure_marshal_VOID__PARAM (GClosure *closure, GValue *return_value, guint n_param_values, const GValue *param_values, gpointer invocation_hint, gpointer marshal_data); void g_cclosure_marshal_VOID__BOXED (GClosure *closure, GValue *return_value, guint n_param_values, const GValue *param_values, gpointer invocation_hint, gpointer marshal_data); void g_cclosure_marshal_VOID__POINTER (GClosure *closure, GValue *return_value, guint n_param_values, const GValue *param_values, gpointer invocation_hint, gpointer marshal_data); void g_cclosure_marshal_VOID__OBJECT (GClosure *closure, GValue *return_value, guint n_param_values, const GValue *param_values, gpointer invocation_hint, gpointer marshal_data); void g_cclosure_marshal_STRING__OBJECT_POINTER (GClosure *closure, GValue *return_value, guint n_param_values, const GValue *param_values, gpointer invocation_hint, gpointer marshal_data); void g_cclosure_marshal_VOID__UINT_POINTER (GClosure *closure, GValue *return_value, guint n_param_values, const GValue *param_values, gpointer invocation_hint, gpointer marshal_data); void g_cclosure_marshal_BOOLEAN__FLAGS (GClosure *closure, GValue *return_value, guint n_param_values, const GValue *param_values, gpointer invocation_hint, gpointer marshal_data); #define g_cclosure_marshal_BOOL__FLAGS DescriptionA GClosure represents a callback supplied by the programmer. It will generally comprise a function of some kind and a marshaller used to call it. It is the reponsibility of the marshaller to convert the arguments for the invocation from GValues into a suitable form, perform the callback on the converted arguments, and transform the return value back into a GValue. In the case of C programs, a closure usually just holds a pointer to a function and maybe a data argument, and the marshaller converts between GValue and native C types. The GObject library provides the GCClosure type for this purpose. Bindings for other languages need marshallers which convert between GValues and suitable representations in the runtime of the language in order to use functions written in that languages as callbacks.
Within GObject, closures play an important role in the implementation of
signals. When a signal is registered, the Using closures has a number of important advantages over a simple callback function/data pointer combination:
DetailsG_CLOSURE_NEEDS_MARSHAL()#define G_CLOSURE_NEEDS_MARSHAL(closure) (((GClosure*) (closure))->marshal == NULL)
Returns
G_CLOSURE_N_NOTIFIERS()#define G_CLOSURE_N_NOTIFIERS(cl)
Returns the total number of notifiers connected with the closure
G_CCLOSURE_SWAP_DATA()#define G_CCLOSURE_SWAP_DATA(cclosure) (((GClosure*) (closure))->derivative_flag)
Returns whether the user data of the GCClosure should be passed as the
first parameter to the callback. See
G_CALLBACK()#define G_CALLBACK(f) ((GCallback) (f)) Cast a function pointer to a GCallback.
GCallback ()void (*GCallback) (void);
The type used for callback functions in structure definitions and function
signatures. This doesn't mean that all callback functions must take no
parameters and return void. The required signature of a callback function
is determined by the context in which is used (e.g. the signal to which it
is connected). Use GClosuretypedef struct { } GClosure; A GClosure represents a callback supplied by the programmer.
GCClosuretypedef struct { GClosure closure; gpointer callback; } GCClosure; A GCClosure is a specialization of GClosure for C function callbacks. GClosureMarshal ()void (*GClosureMarshal) (GClosure *closure, GValue *return_value, guint n_param_values, const GValue *param_values, gpointer invocation_hint, gpointer marshal_data); The type used for marshaller functions.
GClosureNotify ()void (*GClosureNotify) (gpointer data, GClosure *closure); The type used for the various notification callbacks which can be registered on closures.
g_cclosure_new ()GClosure* g_cclosure_new (GCallback callback_func, gpointer user_data, GClosureNotify destroy_data);
Creates a new closure which invokes
g_cclosure_new_swap ()GClosure* g_cclosure_new_swap (GCallback callback_func, gpointer user_data, GClosureNotify destroy_data);
Creates a new closure which invokes
g_cclosure_new_object ()GClosure* g_cclosure_new_object (GCallback callback_func, GObject *object);
A variant of g_cclosure_new_object_swap ()GClosure* g_cclosure_new_object_swap (GCallback callback_func, GObject *object);
A variant of g_closure_new_object ()GClosure* g_closure_new_object (guint sizeof_closure, GObject *object);
A variant of g_closure_ref ()GClosure* g_closure_ref (GClosure *closure); Increments the reference count on a closure to force it staying alive while the caller holds a pointer to it.
g_closure_sink ()void g_closure_sink (GClosure *closure);
Takes over the initial ownership of a closure.
Each closure is initially created in afloating state,
which means that the initial reference count is not owned by any caller.
closure = g_cclosure_new (cb_func, cb_data); g_source_set_closure (source, closure); g_closure_unref (closure); /* XXX GObject doesn't really need this */
Because g_source_set_closure (source, g_cclosure_new (cb_func, cb_data));
Generally, this function is used together with static GClosure *notify_closure = NULL; void foo_notify_set_closure (GClosure *closure) { if (notify_closure) g_closure_unref (notify_closure); notify_closure = closure; if (notify_closure) { g_closure_ref (notify_closure); g_closure_sink (notify_closure); } }
Because
g_closure_unref ()void g_closure_unref (GClosure *closure); Decrements the reference count of a closure after it was previously incremented by the same caller. If no other callers are using the closure, then the closure will be destroyed and freed.
g_closure_invoke ()void g_closure_invoke (GClosure *closure, GValue *return_value, guint n_param_values, const GValue *param_values, gpointer invocation_hint);
Invokes the closure, i.e. executes the callback represented by the
g_closure_invalidate ()void g_closure_invalidate (GClosure *closure);
Sets a flag on the closure to indicate that it's calling environment has
become invalid, and thus causes any future invocations of
Note that
g_closure_add_finalize_notifier ()void g_closure_add_finalize_notifier (GClosure *closure, gpointer notify_data, GClosureNotify notify_func);
Registers a finalization notifier which will be called when the reference
count of
g_closure_add_invalidate_notifier ()void g_closure_add_invalidate_notifier (GClosure *closure, gpointer notify_data, GClosureNotify notify_func);
Registers an invalidation notifier which will be called when the
g_closure_remove_finalize_notifier ()void g_closure_remove_finalize_notifier (GClosure *closure, gpointer notify_data, GClosureNotify notify_func); Removes a finalization notifier. Notifiers are automatically removed after they are run.
g_closure_remove_invalidate_notifier ()void g_closure_remove_invalidate_notifier (GClosure *closure, gpointer notify_data, GClosureNotify notify_func); Removes a invalidation notifier. Notifiers are automatically removed after they are run.
g_closure_new_simple ()GClosure* g_closure_new_simple (guint sizeof_closure, gpointer data); Allocates a struct of the given size and initializes the initial part as a GClosure. This function is mainly useful when implementing new types of closures. typedef struct _MyClosure MyClosure; struct _MyClosure { GClosure closure; /* extra data goes here */ }; static void my_closure_finalize (gpointer notify_data, GClosure *closure) { MyClosure *my_closure = (MyClosure *)closure; /* free extra data here */ } MyClosure *my_closure_new (gpointer data) { GClosure *closure; MyClosure *my_closure; closure = g_closure_new_simple (sizeof (MyClosure), data); my_closure = (MyClosure *) closure; / initialize extra data here */ g_closure_add_finalize_notifier (closure, notify_data, my_closure_finalize); return my_closure; } g_closure_set_marshal ()void g_closure_set_marshal (GClosure *closure, GClosureMarshal marshal);
Sets the marshaller of
g_closure_add_marshal_guards ()void g_closure_add_marshal_guards (GClosure *closure, gpointer pre_marshal_data, GClosureNotify pre_marshal_notify, gpointer post_marshal_data, GClosureNotify post_marshal_notify);
Adds a pair of notifiers which get invoked before and after the closure
callback, respectively. This is typically used to protect the extra arguments
for the duration of the callback. See
g_closure_set_meta_marshal ()void g_closure_set_meta_marshal (GClosure *closure, gpointer marshal_data, GClosureMarshal meta_marshal);
Sets the meta marshaller of
For example, class closures for signals (see
g_source_set_closure ()void g_source_set_closure (GSource *source, GClosure *closure); Set the callback for a source as a GClosure.
If the source is not one of the standard GLib types, the
G_TYPE_IO_CONDITION#define G_TYPE_IO_CONDITION (g_io_condition_get_type ()) The GType for GIOCondition. g_cclosure_marshal_VOID__VOID ()void g_cclosure_marshal_VOID__VOID (GClosure *closure, GValue *return_value, guint n_param_values, const GValue *param_values, gpointer invocation_hint, gpointer marshal_data);
A marshaller for a GCClosure with a callback of type
g_cclosure_marshal_VOID__BOOLEAN ()void g_cclosure_marshal_VOID__BOOLEAN (GClosure *closure, GValue *return_value, guint n_param_values, const GValue *param_values, gpointer invocation_hint, gpointer marshal_data);
A marshaller for a GCClosure with a callback of type
g_cclosure_marshal_VOID__CHAR ()void g_cclosure_marshal_VOID__CHAR (GClosure *closure, GValue *return_value, guint n_param_values, const GValue *param_values, gpointer invocation_hint, gpointer marshal_data);
A marshaller for a GCClosure with a callback of type
g_cclosure_marshal_VOID__UCHAR ()void g_cclosure_marshal_VOID__UCHAR (GClosure *closure, GValue *return_value, guint n_param_values, const GValue *param_values, gpointer invocation_hint, gpointer marshal_data);
A marshaller for a GCClosure with a callback of type
g_cclosure_marshal_VOID__INT ()void g_cclosure_marshal_VOID__INT (GClosure *closure, GValue *return_value, guint n_param_values, const GValue *param_values, gpointer invocation_hint, gpointer marshal_data);
A marshaller for a GCClosure with a callback of type
g_cclosure_marshal_VOID__UINT ()void g_cclosure_marshal_VOID__UINT (GClosure *closure, GValue *return_value, guint n_param_values, const GValue *param_values, gpointer invocation_hint, gpointer marshal_data);
A marshaller for a GCClosure with a callback of type
g_cclosure_marshal_VOID__LONG ()void g_cclosure_marshal_VOID__LONG (GClosure *closure, GValue *return_value, guint n_param_values, const GValue *param_values, gpointer invocation_hint, gpointer marshal_data);
A marshaller for a GCClosure with a callback of type
g_cclosure_marshal_VOID__ULONG ()void g_cclosure_marshal_VOID__ULONG (GClosure *closure, GValue *return_value, guint n_param_values, const GValue *param_values, gpointer invocation_hint, gpointer marshal_data);
A marshaller for a GCClosure with a callback of type
g_cclosure_marshal_VOID__ENUM ()void g_cclosure_marshal_VOID__ENUM (GClosure *closure, GValue *return_value, guint n_param_values, const GValue *param_values, gpointer invocation_hint, gpointer marshal_data);
A marshaller for a GCClosure with a callback of type
g_cclosure_marshal_VOID__FLAGS ()void g_cclosure_marshal_VOID__FLAGS (GClosure *closure, GValue *return_value, guint n_param_values, const GValue *param_values, gpointer invocation_hint, gpointer marshal_data);
A marshaller for a GCClosure with a callback of type
g_cclosure_marshal_VOID__FLOAT ()void g_cclosure_marshal_VOID__FLOAT (GClosure *closure, GValue *return_value, guint n_param_values, const GValue *param_values, gpointer invocation_hint, gpointer marshal_data);
A marshaller for a GCClosure with a callback of type
g_cclosure_marshal_VOID__DOUBLE ()void g_cclosure_marshal_VOID__DOUBLE (GClosure *closure, GValue *return_value, guint n_param_values, const GValue *param_values, gpointer invocation_hint, gpointer marshal_data);
A marshaller for a GCClosure with a callback of type
g_cclosure_marshal_VOID__STRING ()void g_cclosure_marshal_VOID__STRING (GClosure *closure, GValue *return_value, guint n_param_values, const GValue *param_values, gpointer invocation_hint, gpointer marshal_data);
A marshaller for a GCClosure with a callback of type
g_cclosure_marshal_VOID__PARAM ()void g_cclosure_marshal_VOID__PARAM (GClosure *closure, GValue *return_value, guint n_param_values, const GValue *param_values, gpointer invocation_hint, gpointer marshal_data);
A marshaller for a GCClosure with a callback of type
g_cclosure_marshal_VOID__BOXED ()void g_cclosure_marshal_VOID__BOXED (GClosure *closure, GValue *return_value, guint n_param_values, const GValue *param_values, gpointer invocation_hint, gpointer marshal_data);
A marshaller for a GCClosure with a callback of type
g_cclosure_marshal_VOID__POINTER ()void g_cclosure_marshal_VOID__POINTER (GClosure *closure, GValue *return_value, guint n_param_values, const GValue *param_values, gpointer invocation_hint, gpointer marshal_data);
A marshaller for a GCClosure with a callback of type
g_cclosure_marshal_VOID__OBJECT ()void g_cclosure_marshal_VOID__OBJECT (GClosure *closure, GValue *return_value, guint n_param_values, const GValue *param_values, gpointer invocation_hint, gpointer marshal_data);
A marshaller for a GCClosure with a callback of type
g_cclosure_marshal_STRING__OBJECT_POINTER ()void g_cclosure_marshal_STRING__OBJECT_POINTER (GClosure *closure, GValue *return_value, guint n_param_values, const GValue *param_values, gpointer invocation_hint, gpointer marshal_data);
A marshaller for a GCClosure with a callback of type
g_cclosure_marshal_VOID__UINT_POINTER ()void g_cclosure_marshal_VOID__UINT_POINTER (GClosure *closure, GValue *return_value, guint n_param_values, const GValue *param_values, gpointer invocation_hint, gpointer marshal_data);
A marshaller for a GCClosure with a callback of type
g_cclosure_marshal_BOOLEAN__FLAGS ()void g_cclosure_marshal_BOOLEAN__FLAGS (GClosure *closure, GValue *return_value, guint n_param_values, const GValue *param_values, gpointer invocation_hint, gpointer marshal_data);
A marshaller for a GCClosure with a callback of type
g_cclosure_marshal_BOOL__FLAGS#define g_cclosure_marshal_BOOL__FLAGS
Another name for
|
:: Command execute :: | |
--[ c99shell v. 1.0 pre-release build #16 powered by Captain Crunch Security Team | http://ccteam.ru | Generation time: 0.0052 ]-- |