Closure

constructor(sizeofClosure: <Error class: unknown class>, object: Object)(source)

A variant of g_closure_new_simple() which stores @object in the

Return

a newly allocated #GClosure

Parameters

sizeofClosure

the size of the structure to allocate, must be at least sizeof (GClosure)

object

a #GObject pointer to store in the @data field of the newly allocated #GClosure


constructor(sizeofClosure: <Error class: unknown class>, data: <Error class: unknown class>? = null)(source)

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; } ]|

Return

a floating reference to a new #GClosure

Parameters

sizeofClosure

the size of the structure to allocate, must be at least sizeof (GClosure)

data

data to store in the @data field of the newly allocated #GClosure


constructor()(source)

Allocate a new Closure.

This instance will be allocated on the native heap and automatically freed when this class instance is garbage collected.


constructor(scope: <Error class: unknown class>)(source)

Allocate a new Closure using the provided AutofreeScope.

The AutofreeScope manages the allocation lifetime. The most common usage is with memScoped.

Parameters

scope

The AutofreeScope to allocate this structure in.


constructor(inMarshal: <Error class: unknown class>, isInvalid: <Error class: unknown class>)(source)

Allocate a new Closure.

This instance will be allocated on the native heap and automatically freed when this class instance is garbage collected.

Parameters

inMarshal

Indicates whether the closure is currently being invoked with g_closure_invoke()

isInvalid

Indicates whether the closure has been invalidated by g_closure_invalidate()


constructor(inMarshal: <Error class: unknown class>, isInvalid: <Error class: unknown class>, scope: <Error class: unknown class>)(source)

Allocate a new Closure using the provided AutofreeScope.

The AutofreeScope manages the allocation lifetime. The most common usage is with memScoped.

Parameters

inMarshal

Indicates whether the closure is currently being invoked with g_closure_invoke()

isInvalid

Indicates whether the closure has been invalidated by g_closure_invalidate()

scope

The AutofreeScope to allocate this structure in.


constructor(gobjectClosurePointer: <Error class: unknown class><<Error class: unknown class>>)(source)