1 <!-- ##### SECTION Title ##### -->
4 <!-- ##### SECTION Short_Description ##### -->
7 <!-- ##### SECTION Long_Description ##### -->
12 <!-- ##### SECTION See_Also ##### -->
17 <!-- ##### MACRO G_CLOSURE_NEEDS_MARSHAL ##### -->
25 <!-- ##### MACRO G_CLOSURE_N_NOTIFIERS ##### -->
33 <!-- ##### MACRO G_CCLOSURE_SWAP_DATA ##### -->
41 <!-- ##### MACRO G_CALLBACK ##### -->
49 <!-- ##### USER_FUNCTION GCallback ##### -->
56 <!-- ##### STRUCT GClosure ##### -->
61 @is_invalid: Indicates whether the closure has been invalidated by g_closure_invalidate()
63 <!-- ##### MACRO G_TYPE_CLOSURE ##### -->
70 <!-- ##### STRUCT GCClosure ##### -->
78 <!-- ##### USER_FUNCTION GClosureMarshal ##### -->
91 <!-- ##### USER_FUNCTION GClosureNotify ##### -->
100 <!-- ##### STRUCT GClosureNotifyData ##### -->
108 <!-- ##### FUNCTION g_cclosure_new ##### -->
119 <!-- ##### FUNCTION g_cclosure_new_swap ##### -->
130 <!-- ##### FUNCTION g_cclosure_new_object ##### -->
140 <!-- ##### FUNCTION g_cclosure_new_object_swap ##### -->
150 <!-- ##### FUNCTION g_closure_new_object ##### -->
160 <!-- ##### FUNCTION g_closure_ref ##### -->
162 Increment the reference count on a closure to force it staying
163 alive while the caller holds a pointer to it.
166 @closure: #GClosure to increment the reference count on
167 @Returns: The @closure passed in, for convenience
170 <!-- ##### FUNCTION g_closure_sink ##### -->
172 Take over the initial ownership of a closure.
173 When closures are newly created, they get an initial reference count
174 of 1, eventhough no caller has yet invoked g_closure_ref() on the @closure.
175 Code entities that store closures for notification purposes are supposed
176 to call this function, for example like this:
177 <msgtext><programlisting>
178 static GClosure *notify_closure = NULL;
180 foo_notify_set_closure (GClosure *closure)
183 g_closure_unref (notify_closure);
184 notify_closure = closure;
187 g_closure_ref (notify_closure);
188 g_closure_sink (notify_closure);
191 </programlisting></msgtext>
192 Because g_closure_sink() may decrement the reference count of a closure
193 (if it hasn't been called on @closure yet) just like g_closure_unref(),
194 g_closure_ref() should be called prior to this function.
197 @closure: #GClosure to decrement the initial reference count on, if it's
201 <!-- ##### FUNCTION g_closure_unref ##### -->
203 Decrement the reference count of a closure after it was
204 previously incremented by the same caller. The closure
205 will most likely be destroyed and freed after this function
209 @closure: #GClosure to decrement the reference count on
212 <!-- ##### FUNCTION g_closure_invoke ##### -->
224 <!-- ##### FUNCTION g_closure_invalidate ##### -->
226 This function sets a flag on the closure to indicate that it's
227 calling environment has become invalid, and thus causes any future
228 invocations of g_closure_invoke() on this @closure to be ignored.
229 Also, invalidation notifiers installed on the closure will be called
230 at this point, and since invalidation notifiers may unreference
231 the closure, @closure should be considered an invalidated pointer
232 atfer this function, unles g_closure_ref() was called beforehand.
235 @closure: GClosure to invalidate
238 <!-- ##### FUNCTION g_closure_add_finalize_notifier ##### -->
248 <!-- ##### FUNCTION g_closure_add_invalidate_notifier ##### -->
258 <!-- ##### FUNCTION g_closure_remove_finalize_notifier ##### -->
268 <!-- ##### FUNCTION g_closure_remove_invalidate_notifier ##### -->
278 <!-- ##### FUNCTION g_closure_new_simple ##### -->
288 <!-- ##### FUNCTION g_closure_set_marshal ##### -->
297 <!-- ##### FUNCTION g_closure_add_marshal_guards ##### -->
306 @post_marshal_notify:
309 <!-- ##### FUNCTION g_closure_set_meta_marshal ##### -->
319 <!-- ##### FUNCTION g_source_set_closure ##### -->
328 <!-- ##### MACRO G_TYPE_IO_CHANNEL ##### -->
335 <!-- ##### MACRO G_TYPE_IO_CONDITION ##### -->