Package ch.bailu.gtk.gobject
Class CClosure
java.lang.Object
ch.bailu.gtk.type.Type
ch.bailu.gtk.type.Pointer
ch.bailu.gtk.type.Record
ch.bailu.gtk.gobject.CClosure
- All Implemented Interfaces:
PointerInterface
A #GCClosure is a specialization of #GClosure for C function callbacks.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfacestatic interface -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Closure_new(CClosure.OnCallback callback_func, Pointer user_data, CClosure.OnClosureNotify destroy_data) Creates a new closure which invokes @callback_func with @user_data as
the last parameter.static ClassHandlerthe callback functionstatic voidmarshalBooleanBoxedBoxed(Closure closure, Value return_value, int n_param_values, Value param_values, Pointer invocation_hint, Pointer marshal_data) A #GClosureMarshal function for use with signals with handlers that
take two boxed pointers as arguments and return a boolean.static voidmarshalBooleanFlags(Closure closure, Value return_value, int n_param_values, Value param_values, Pointer invocation_hint, Pointer marshal_data) A marshaller for a #GCClosure with a callback of type
`gboolean (*callback) (gpointer instance, gint arg1, gpointer user_data)` where the #gint parameter
denotes a flags type.static voidmarshalGeneric(Closure closure, Value return_gvalue, int n_param_values, Value param_values, Pointer invocation_hint, Pointer marshal_data) A generic marshaller function implemented via
[libffi](http://sourceware.org/libffi/).static voidmarshalStringObjectPointer(Closure closure, Value return_value, int n_param_values, Value param_values, Pointer invocation_hint, Pointer marshal_data) A marshaller for a #GCClosure with a callback of type
`gchar* (*callback) (gpointer instance, GObject *arg1, gpointer arg2, gpointer user_data)`.static voidmarshalVoidBoolean(Closure closure, Value return_value, int n_param_values, Value param_values, Pointer invocation_hint, Pointer marshal_data) A marshaller for a #GCClosure with a callback of type
`void (*callback) (gpointer instance, gboolean arg1, gpointer user_data)`.static voidmarshalVoidBoxed(Closure closure, Value return_value, int n_param_values, Value param_values, Pointer invocation_hint, Pointer marshal_data) A marshaller for a #GCClosure with a callback of type
`void (*callback) (gpointer instance, GBoxed *arg1, gpointer user_data)`.static voidmarshalVoidChar(Closure closure, Value return_value, int n_param_values, Value param_values, Pointer invocation_hint, Pointer marshal_data) A marshaller for a #GCClosure with a callback of type
`void (*callback) (gpointer instance, gchar arg1, gpointer user_data)`.static voidmarshalVoidDouble(Closure closure, Value return_value, int n_param_values, Value param_values, Pointer invocation_hint, Pointer marshal_data) A marshaller for a #GCClosure with a callback of type
`void (*callback) (gpointer instance, gdouble arg1, gpointer user_data)`.static voidmarshalVoidEnum(Closure closure, Value return_value, int n_param_values, Value param_values, Pointer invocation_hint, Pointer marshal_data) A marshaller for a #GCClosure with a callback of type
`void (*callback) (gpointer instance, gint arg1, gpointer user_data)` where the #gint parameter denotes an enumeration type..static voidmarshalVoidFlags(Closure closure, Value return_value, int n_param_values, Value param_values, Pointer invocation_hint, Pointer marshal_data) A marshaller for a #GCClosure with a callback of type
`void (*callback) (gpointer instance, gint arg1, gpointer user_data)` where the #gint parameter denotes a flags type.static voidmarshalVoidFloat(Closure closure, Value return_value, int n_param_values, Value param_values, Pointer invocation_hint, Pointer marshal_data) A marshaller for a #GCClosure with a callback of type
`void (*callback) (gpointer instance, gfloat arg1, gpointer user_data)`.static voidmarshalVoidInt(Closure closure, Value return_value, int n_param_values, Value param_values, Pointer invocation_hint, Pointer marshal_data) A marshaller for a #GCClosure with a callback of type
`void (*callback) (gpointer instance, gint arg1, gpointer user_data)`.static voidmarshalVoidLong(Closure closure, Value return_value, int n_param_values, Value param_values, Pointer invocation_hint, Pointer marshal_data) A marshaller for a #GCClosure with a callback of type
`void (*callback) (gpointer instance, glong arg1, gpointer user_data)`.static voidmarshalVoidObject(Closure closure, Value return_value, int n_param_values, Value param_values, Pointer invocation_hint, Pointer marshal_data) A marshaller for a #GCClosure with a callback of type
`void (*callback) (gpointer instance, GObject *arg1, gpointer user_data)`.static voidmarshalVoidParam(Closure closure, Value return_value, int n_param_values, Value param_values, Pointer invocation_hint, Pointer marshal_data) A marshaller for a #GCClosure with a callback of type
`void (*callback) (gpointer instance, GParamSpec *arg1, gpointer user_data)`.static voidmarshalVoidPointer(Closure closure, Value return_value, int n_param_values, Value param_values, Pointer invocation_hint, Pointer marshal_data) A marshaller for a #GCClosure with a callback of type
`void (*callback) (gpointer instance, gpointer arg1, gpointer user_data)`.static voidmarshalVoidString(Closure closure, Value return_value, int n_param_values, Value param_values, Pointer invocation_hint, Pointer marshal_data) A marshaller for a #GCClosure with a callback of type
`void (*callback) (gpointer instance, const gchar *arg1, gpointer user_data)`.static voidmarshalVoidUchar(Closure closure, Value return_value, int n_param_values, Value param_values, Pointer invocation_hint, Pointer marshal_data) A marshaller for a #GCClosure with a callback of type
`void (*callback) (gpointer instance, guchar arg1, gpointer user_data)`.static voidmarshalVoidUint(Closure closure, Value return_value, int n_param_values, Value param_values, Pointer invocation_hint, Pointer marshal_data) A marshaller for a #GCClosure with a callback of type
`void (*callback) (gpointer instance, guint arg1, gpointer user_data)`.static voidmarshalVoidUintPointer(Closure closure, Value return_value, int n_param_values, Value param_values, Pointer invocation_hint, Pointer marshal_data) A marshaller for a #GCClosure with a callback of type
`void (*callback) (gpointer instance, guint arg1, gpointer arg2, gpointer user_data)`.static voidmarshalVoidUlong(Closure closure, Value return_value, int n_param_values, Value param_values, Pointer invocation_hint, Pointer marshal_data) A marshaller for a #GCClosure with a callback of type
`void (*callback) (gpointer instance, gulong arg1, gpointer user_data)`.static voidmarshalVoidVariant(Closure closure, Value return_value, int n_param_values, Value param_values, Pointer invocation_hint, Pointer marshal_data) A marshaller for a #GCClosure with a callback of type
`void (*callback) (gpointer instance, GVariant *arg1, gpointer user_data)`.static voidmarshalVoidVoid(Closure closure, Value return_value, int n_param_values, Value param_values, Pointer invocation_hint, Pointer marshal_data) A marshaller for a #GCClosure with a callback of type
`void (*callback) (gpointer instance, gpointer user_data)`.static ClosurenewObject(CClosure.OnCallback callback_func, Object object) A variant of g_cclosure_new() which uses @object as @user_data and
calls g_object_watch_closure() on @object and the created
closure.static ClosurenewObjectSwap(CClosure.OnCallback callback_func, Object object) A variant of g_cclosure_new_swap() which uses @object as @user_data
and calls g_object_watch_closure() on @object and the created
closure.static ClosurenewSwap(CClosure.OnCallback callback_func, Pointer user_data, CClosure.OnClosureNotify destroy_data) Creates a new closure which invokes @callback_func with @user_data as
the first parameter.voidsetFieldCallback(Pointer callback) the callback functionMethods inherited from class ch.bailu.gtk.type.Pointer
asCPointer, cast, connectSignal, disconnectSignals, disconnectSignals, equals, hashCode, throwIfNull, throwNullPointerException, toString, unregisterCallbacks, unregisterCallbacksMethods inherited from class ch.bailu.gtk.type.Type
asCPointer, asCPointer, asCPointerNotNull, asJnaPointer, asJnaPointer, asPointer, asPointer, cast, cast, throwIfNullMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface ch.bailu.gtk.type.PointerInterface
asCPointerNotNull, asJnaPointer, asPointer, isNotNull, isNull
-
Field Details
-
CLOSURE
the #GClosure
Private field: direct-type- See Also:
-
CALLBACK
the callback function- See Also:
-
-
Constructor Details
-
CClosure
-
CClosure
public CClosure()
-
-
Method Details
-
getClassHandler
-
setFieldCallback
the callback function -
getFieldCallback
the callback function -
marshalBooleanBoxedBoxed
public static void marshalBooleanBoxedBoxed(@Nonnull Closure closure, @Nonnull Value return_value, int n_param_values, @Nonnull Value param_values, @Nullable Pointer invocation_hint, @Nullable Pointer marshal_data) A #GClosureMarshal function for use with signals with handlers that
take two boxed pointers as arguments and return a boolean. If you
have such a signal, you will probably also need to use an
accumulator, such as g_signal_accumulator_true_handled().- Parameters:
closure- A #GClosure.return_value- A #GValue to store the return value. May be %NULL if the callback of closure doesn't return a value.n_param_values- The length of the @param_values array.param_values- An array of #GValues holding the arguments on which to invoke the callback of closure.invocation_hint- The invocation hint given as the last argument to g_closure_invoke().marshal_data- Additional data specified when registering the marshaller, see g_closure_set_marshal() and g_closure_set_meta_marshal()
-
marshalBooleanFlags
public static void marshalBooleanFlags(@Nonnull Closure closure, @Nonnull Value return_value, int n_param_values, @Nonnull Value param_values, @Nullable Pointer invocation_hint, @Nullable Pointer marshal_data) A marshaller for a #GCClosure with a callback of type
`gboolean (*callback) (gpointer instance, gint arg1, gpointer user_data)` where the #gint parameter
denotes a flags type.- Parameters:
closure- the #GClosure to which the marshaller belongsreturn_value- a #GValue which can store the returned #gbooleann_param_values- 2param_values- a #GValue array holding instance and arg1invocation_hint- the invocation hint given as the last argument to g_closure_invoke()marshal_data- additional data specified when registering the marshaller
-
marshalStringObjectPointer
public static void marshalStringObjectPointer(@Nonnull Closure closure, @Nonnull Value return_value, int n_param_values, @Nonnull Value param_values, @Nullable Pointer invocation_hint, @Nullable Pointer marshal_data) A marshaller for a #GCClosure with a callback of type
`gchar* (*callback) (gpointer instance, GObject *arg1, gpointer arg2, gpointer user_data)`.- Parameters:
closure- the #GClosure to which the marshaller belongsreturn_value- a #GValue, which can store the returned stringn_param_values- 3param_values- a #GValue array holding instance, arg1 and arg2invocation_hint- the invocation hint given as the last argument to g_closure_invoke()marshal_data- additional data specified when registering the marshaller
-
marshalVoidBoolean
public static void marshalVoidBoolean(@Nonnull Closure closure, @Nonnull Value return_value, int n_param_values, @Nonnull Value param_values, @Nullable Pointer invocation_hint, @Nullable Pointer marshal_data) A marshaller for a #GCClosure with a callback of type
`void (*callback) (gpointer instance, gboolean arg1, gpointer user_data)`.- Parameters:
closure- the #GClosure to which the marshaller belongsreturn_value- ignoredn_param_values- 2param_values- a #GValue array holding the instance and the #gboolean parameterinvocation_hint- the invocation hint given as the last argument to g_closure_invoke()marshal_data- additional data specified when registering the marshaller
-
marshalVoidBoxed
public static void marshalVoidBoxed(@Nonnull Closure closure, @Nonnull Value return_value, int n_param_values, @Nonnull Value param_values, @Nullable Pointer invocation_hint, @Nullable Pointer marshal_data) A marshaller for a #GCClosure with a callback of type
`void (*callback) (gpointer instance, GBoxed *arg1, gpointer user_data)`.- Parameters:
closure- the #GClosure to which the marshaller belongsreturn_value- ignoredn_param_values- 2param_values- a #GValue array holding the instance and the #GBoxed* parameterinvocation_hint- the invocation hint given as the last argument to g_closure_invoke()marshal_data- additional data specified when registering the marshaller
-
marshalVoidChar
public static void marshalVoidChar(@Nonnull Closure closure, @Nonnull Value return_value, int n_param_values, @Nonnull Value param_values, @Nullable Pointer invocation_hint, @Nullable Pointer marshal_data) A marshaller for a #GCClosure with a callback of type
`void (*callback) (gpointer instance, gchar arg1, gpointer user_data)`.- Parameters:
closure- the #GClosure to which the marshaller belongsreturn_value- ignoredn_param_values- 2param_values- a #GValue array holding the instance and the #gchar parameterinvocation_hint- the invocation hint given as the last argument to g_closure_invoke()marshal_data- additional data specified when registering the marshaller
-
marshalVoidDouble
public static void marshalVoidDouble(@Nonnull Closure closure, @Nonnull Value return_value, int n_param_values, @Nonnull Value param_values, @Nullable Pointer invocation_hint, @Nullable Pointer marshal_data) A marshaller for a #GCClosure with a callback of type
`void (*callback) (gpointer instance, gdouble arg1, gpointer user_data)`.- Parameters:
closure- the #GClosure to which the marshaller belongsreturn_value- ignoredn_param_values- 2param_values- a #GValue array holding the instance and the #gdouble parameterinvocation_hint- the invocation hint given as the last argument to g_closure_invoke()marshal_data- additional data specified when registering the marshaller
-
marshalVoidEnum
public static void marshalVoidEnum(@Nonnull Closure closure, @Nonnull Value return_value, int n_param_values, @Nonnull Value param_values, @Nullable Pointer invocation_hint, @Nullable Pointer marshal_data) A marshaller for a #GCClosure with a callback of type
`void (*callback) (gpointer instance, gint arg1, gpointer user_data)` where the #gint parameter denotes an enumeration type..- Parameters:
closure- the #GClosure to which the marshaller belongsreturn_value- ignoredn_param_values- 2param_values- a #GValue array holding the instance and the enumeration parameterinvocation_hint- the invocation hint given as the last argument to g_closure_invoke()marshal_data- additional data specified when registering the marshaller
-
marshalVoidFlags
public static void marshalVoidFlags(@Nonnull Closure closure, @Nonnull Value return_value, int n_param_values, @Nonnull Value param_values, @Nullable Pointer invocation_hint, @Nullable Pointer marshal_data) A marshaller for a #GCClosure with a callback of type
`void (*callback) (gpointer instance, gint arg1, gpointer user_data)` where the #gint parameter denotes a flags type.- Parameters:
closure- the #GClosure to which the marshaller belongsreturn_value- ignoredn_param_values- 2param_values- a #GValue array holding the instance and the flags parameterinvocation_hint- the invocation hint given as the last argument to g_closure_invoke()marshal_data- additional data specified when registering the marshaller
-
marshalVoidFloat
public static void marshalVoidFloat(@Nonnull Closure closure, @Nonnull Value return_value, int n_param_values, @Nonnull Value param_values, @Nullable Pointer invocation_hint, @Nullable Pointer marshal_data) A marshaller for a #GCClosure with a callback of type
`void (*callback) (gpointer instance, gfloat arg1, gpointer user_data)`.- Parameters:
closure- the #GClosure to which the marshaller belongsreturn_value- ignoredn_param_values- 2param_values- a #GValue array holding the instance and the #gfloat parameterinvocation_hint- the invocation hint given as the last argument to g_closure_invoke()marshal_data- additional data specified when registering the marshaller
-
marshalVoidInt
public static void marshalVoidInt(@Nonnull Closure closure, @Nonnull Value return_value, int n_param_values, @Nonnull Value param_values, @Nullable Pointer invocation_hint, @Nullable Pointer marshal_data) A marshaller for a #GCClosure with a callback of type
`void (*callback) (gpointer instance, gint arg1, gpointer user_data)`.- Parameters:
closure- the #GClosure to which the marshaller belongsreturn_value- ignoredn_param_values- 2param_values- a #GValue array holding the instance and the #gint parameterinvocation_hint- the invocation hint given as the last argument to g_closure_invoke()marshal_data- additional data specified when registering the marshaller
-
marshalVoidLong
public static void marshalVoidLong(@Nonnull Closure closure, @Nonnull Value return_value, int n_param_values, @Nonnull Value param_values, @Nullable Pointer invocation_hint, @Nullable Pointer marshal_data) A marshaller for a #GCClosure with a callback of type
`void (*callback) (gpointer instance, glong arg1, gpointer user_data)`.- Parameters:
closure- the #GClosure to which the marshaller belongsreturn_value- ignoredn_param_values- 2param_values- a #GValue array holding the instance and the #glong parameterinvocation_hint- the invocation hint given as the last argument to g_closure_invoke()marshal_data- additional data specified when registering the marshaller
-
marshalVoidObject
public static void marshalVoidObject(@Nonnull Closure closure, @Nonnull Value return_value, int n_param_values, @Nonnull Value param_values, @Nullable Pointer invocation_hint, @Nullable Pointer marshal_data) A marshaller for a #GCClosure with a callback of type
`void (*callback) (gpointer instance, GObject *arg1, gpointer user_data)`.- Parameters:
closure- the #GClosure to which the marshaller belongsreturn_value- ignoredn_param_values- 2param_values- a #GValue array holding the instance and the #GObject* parameterinvocation_hint- the invocation hint given as the last argument to g_closure_invoke()marshal_data- additional data specified when registering the marshaller
-
marshalVoidParam
public static void marshalVoidParam(@Nonnull Closure closure, @Nonnull Value return_value, int n_param_values, @Nonnull Value param_values, @Nullable Pointer invocation_hint, @Nullable Pointer marshal_data) A marshaller for a #GCClosure with a callback of type
`void (*callback) (gpointer instance, GParamSpec *arg1, gpointer user_data)`.- Parameters:
closure- the #GClosure to which the marshaller belongsreturn_value- ignoredn_param_values- 2param_values- a #GValue array holding the instance and the #GParamSpec* parameterinvocation_hint- the invocation hint given as the last argument to g_closure_invoke()marshal_data- additional data specified when registering the marshaller
-
marshalVoidPointer
public static void marshalVoidPointer(@Nonnull Closure closure, @Nonnull Value return_value, int n_param_values, @Nonnull Value param_values, @Nullable Pointer invocation_hint, @Nullable Pointer marshal_data) A marshaller for a #GCClosure with a callback of type
`void (*callback) (gpointer instance, gpointer arg1, gpointer user_data)`.- Parameters:
closure- the #GClosure to which the marshaller belongsreturn_value- ignoredn_param_values- 2param_values- a #GValue array holding the instance and the #gpointer parameterinvocation_hint- the invocation hint given as the last argument to g_closure_invoke()marshal_data- additional data specified when registering the marshaller
-
marshalVoidString
public static void marshalVoidString(@Nonnull Closure closure, @Nonnull Value return_value, int n_param_values, @Nonnull Value param_values, @Nullable Pointer invocation_hint, @Nullable Pointer marshal_data) A marshaller for a #GCClosure with a callback of type
`void (*callback) (gpointer instance, const gchar *arg1, gpointer user_data)`.- Parameters:
closure- the #GClosure to which the marshaller belongsreturn_value- ignoredn_param_values- 2param_values- a #GValue array holding the instance and the #gchar* parameterinvocation_hint- the invocation hint given as the last argument to g_closure_invoke()marshal_data- additional data specified when registering the marshaller
-
marshalVoidUchar
public static void marshalVoidUchar(@Nonnull Closure closure, @Nonnull Value return_value, int n_param_values, @Nonnull Value param_values, @Nullable Pointer invocation_hint, @Nullable Pointer marshal_data) A marshaller for a #GCClosure with a callback of type
`void (*callback) (gpointer instance, guchar arg1, gpointer user_data)`.- Parameters:
closure- the #GClosure to which the marshaller belongsreturn_value- ignoredn_param_values- 2param_values- a #GValue array holding the instance and the #guchar parameterinvocation_hint- the invocation hint given as the last argument to g_closure_invoke()marshal_data- additional data specified when registering the marshaller
-
marshalVoidUint
public static void marshalVoidUint(@Nonnull Closure closure, @Nonnull Value return_value, int n_param_values, @Nonnull Value param_values, @Nullable Pointer invocation_hint, @Nullable Pointer marshal_data) A marshaller for a #GCClosure with a callback of type
`void (*callback) (gpointer instance, guint arg1, gpointer user_data)`.- Parameters:
closure- the #GClosure to which the marshaller belongsreturn_value- ignoredn_param_values- 2param_values- a #GValue array holding the instance and the #guint parameterinvocation_hint- the invocation hint given as the last argument to g_closure_invoke()marshal_data- additional data specified when registering the marshaller
-
marshalVoidUintPointer
public static void marshalVoidUintPointer(@Nonnull Closure closure, @Nonnull Value return_value, int n_param_values, @Nonnull Value param_values, @Nullable Pointer invocation_hint, @Nullable Pointer marshal_data) A marshaller for a #GCClosure with a callback of type
`void (*callback) (gpointer instance, guint arg1, gpointer arg2, gpointer user_data)`.- Parameters:
closure- the #GClosure to which the marshaller belongsreturn_value- ignoredn_param_values- 3param_values- a #GValue array holding instance, arg1 and arg2invocation_hint- the invocation hint given as the last argument to g_closure_invoke()marshal_data- additional data specified when registering the marshaller
-
marshalVoidUlong
public static void marshalVoidUlong(@Nonnull Closure closure, @Nonnull Value return_value, int n_param_values, @Nonnull Value param_values, @Nullable Pointer invocation_hint, @Nullable Pointer marshal_data) A marshaller for a #GCClosure with a callback of type
`void (*callback) (gpointer instance, gulong arg1, gpointer user_data)`.- Parameters:
closure- the #GClosure to which the marshaller belongsreturn_value- ignoredn_param_values- 2param_values- a #GValue array holding the instance and the #gulong parameterinvocation_hint- the invocation hint given as the last argument to g_closure_invoke()marshal_data- additional data specified when registering the marshaller
-
marshalVoidVariant
public static void marshalVoidVariant(@Nonnull Closure closure, @Nonnull Value return_value, int n_param_values, @Nonnull Value param_values, @Nullable Pointer invocation_hint, @Nullable Pointer marshal_data) A marshaller for a #GCClosure with a callback of type
`void (*callback) (gpointer instance, GVariant *arg1, gpointer user_data)`.- Parameters:
closure- the #GClosure to which the marshaller belongsreturn_value- ignoredn_param_values- 2param_values- a #GValue array holding the instance and the #GVariant* parameterinvocation_hint- the invocation hint given as the last argument to g_closure_invoke()marshal_data- additional data specified when registering the marshaller
-
marshalVoidVoid
public static void marshalVoidVoid(@Nonnull Closure closure, @Nonnull Value return_value, int n_param_values, @Nonnull Value param_values, @Nullable Pointer invocation_hint, @Nullable Pointer marshal_data) A marshaller for a #GCClosure with a callback of type
`void (*callback) (gpointer instance, gpointer user_data)`.- Parameters:
closure- the #GClosure to which the marshaller belongsreturn_value- ignoredn_param_values- 1param_values- a #GValue array holding only the instanceinvocation_hint- the invocation hint given as the last argument to g_closure_invoke()marshal_data- additional data specified when registering the marshaller
-
marshalGeneric
public static void marshalGeneric(@Nonnull Closure closure, @Nonnull Value return_gvalue, int n_param_values, @Nonnull Value param_values, @Nullable Pointer invocation_hint, @Nullable Pointer marshal_data) A generic marshaller function implemented via
[libffi](http://sourceware.org/libffi/).
Normally this function is not passed explicitly to g_signal_new(),
but used automatically by GLib when specifying a %NULL marshaller.- Parameters:
closure- A #GClosure.return_gvalue- A #GValue to store the return value. May be %NULL if the callback of closure doesn't return a value.n_param_values- The length of the @param_values array.param_values- An array of #GValues holding the arguments on which to invoke the callback of closure.invocation_hint- The invocation hint given as the last argument to g_closure_invoke().marshal_data- Additional data specified when registering the marshaller, see g_closure_set_marshal() and g_closure_set_meta_marshal()
-
_new
public static Closure _new(CClosure.OnCallback callback_func, @Nullable Pointer user_data, CClosure.OnClosureNotify destroy_data) Creates a new closure which invokes @callback_func with @user_data as
the last parameter.
@destroy_data will be called as a finalize notifier on the #GClosure.- Parameters:
callback_func- the function to invokeuser_data- user data to pass to @callback_funcdestroy_data- destroy notify to be called when @user_data is no longer used- Returns:
- a floating reference to a new #GCClosure
-
newObject
A variant of g_cclosure_new() which uses @object as @user_data and
calls g_object_watch_closure() on @object and the created
closure. This function is useful when you have a callback closely
associated with a #GObject, and want the callback to no longer run
after the object is is freed.- Parameters:
callback_func- the function to invokeobject- a #GObject pointer to pass to @callback_func- Returns:
- a new #GCClosure
-
newObjectSwap
A variant of g_cclosure_new_swap() which uses @object as @user_data
and calls g_object_watch_closure() on @object and the created
closure. This function is useful when you have a callback closely
associated with a #GObject, and want the callback to no longer run
after the object is is freed.- Parameters:
callback_func- the function to invokeobject- a #GObject pointer to pass to @callback_func- Returns:
- a new #GCClosure
-
newSwap
public static Closure newSwap(CClosure.OnCallback callback_func, @Nullable Pointer user_data, CClosure.OnClosureNotify destroy_data) Creates a new closure which invokes @callback_func with @user_data as
the first parameter.
@destroy_data will be called as a finalize notifier on the #GClosure.- Parameters:
callback_func- the function to invokeuser_data- user data to pass to @callback_funcdestroy_data- destroy notify to be called when @user_data is no longer used- Returns:
- a floating reference to a new #GCClosure
-