mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-28 16:36:14 +01:00
5e45a337b8
* glib/gmain.c: Remove references to nonexisting functions g_source_set_callback_closure(), g_source_poll(), g_source_add() from docs. * glib/gdir.c (g_dir_open): Typo fix in docs. * glib/gasyncqueue.c (g_async_queue_lock): (g_async_queue_unref_and_unlock): Fix markup to avoid erroneous <link>s in docs. * glib/gwin32.c: Escape #'s leading to erroneous <link>s in docs. * glib/gtree.c: Replace some occurances of Gtree by GTree in docs. * glib/gstring.c (g_string_insert_unichar): Typo fix in docs. * glib/tmpl/conversions.sgml: Add GIConv. * glib/tmpl/main.sgml: Fix references to nonexisting functions g_main_loop_destroy(), g_source_add(), g_source_connect(). * glib/glib-sections.txt: Add GIConv, g_str_has_prefix, g_str_has_suffix. * glib/tmpl/linked_lists_single.sgml: * glib/tmpl/linked_lists_double.sgml: GListAllocator doesn't exist. * glib/glib-docs.sgml: Declare hash entity. * glib/tmpl/macros.sgml: Escape # in #ifdef to suppress erroneous links. * gobject/Makefile.am, gobject/gobject-docs.sgml, gobject/tmpl/*: * glib/Makefile.am, glib/glib-docs.sgml, glib/tmpl/*: Produce XML, not SGML.
343 lines
5.2 KiB
Plaintext
343 lines
5.2 KiB
Plaintext
<!-- ##### SECTION Title ##### -->
|
|
Closures
|
|
|
|
<!-- ##### SECTION Short_Description ##### -->
|
|
|
|
|
|
<!-- ##### SECTION Long_Description ##### -->
|
|
<para>
|
|
|
|
</para>
|
|
|
|
<!-- ##### SECTION See_Also ##### -->
|
|
<para>
|
|
|
|
</para>
|
|
|
|
<!-- ##### MACRO G_CLOSURE_NEEDS_MARSHAL ##### -->
|
|
<para>
|
|
|
|
</para>
|
|
|
|
@closure:
|
|
|
|
|
|
<!-- ##### MACRO G_CLOSURE_N_NOTIFIERS ##### -->
|
|
<para>
|
|
|
|
</para>
|
|
|
|
@cl:
|
|
|
|
|
|
<!-- ##### MACRO G_CCLOSURE_SWAP_DATA ##### -->
|
|
<para>
|
|
|
|
</para>
|
|
|
|
@cclosure:
|
|
|
|
|
|
<!-- ##### MACRO G_CALLBACK ##### -->
|
|
<para>
|
|
|
|
</para>
|
|
|
|
@f:
|
|
|
|
|
|
<!-- ##### USER_FUNCTION GCallback ##### -->
|
|
<para>
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<!-- ##### STRUCT GClosure ##### -->
|
|
<para>
|
|
|
|
</para>
|
|
|
|
@in_marshal:
|
|
@is_invalid: Indicates whether the closure has been invalidated by g_closure_invalidate()
|
|
|
|
<!-- ##### MACRO G_TYPE_CLOSURE ##### -->
|
|
<para>
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<!-- ##### STRUCT GCClosure ##### -->
|
|
<para>
|
|
|
|
</para>
|
|
|
|
@closure:
|
|
@callback:
|
|
|
|
<!-- ##### USER_FUNCTION GClosureMarshal ##### -->
|
|
<para>
|
|
|
|
</para>
|
|
|
|
@closure:
|
|
@return_value:
|
|
@n_param_values:
|
|
@param_values:
|
|
@invocation_hint:
|
|
@marshal_data:
|
|
|
|
|
|
<!-- ##### USER_FUNCTION GClosureNotify ##### -->
|
|
<para>
|
|
|
|
</para>
|
|
|
|
@data:
|
|
@closure:
|
|
|
|
|
|
<!-- ##### STRUCT GClosureNotifyData ##### -->
|
|
<para>
|
|
|
|
</para>
|
|
|
|
@data:
|
|
@notify:
|
|
|
|
<!-- ##### FUNCTION g_cclosure_new ##### -->
|
|
<para>
|
|
|
|
</para>
|
|
|
|
@callback_func:
|
|
@user_data:
|
|
@destroy_data:
|
|
@Returns:
|
|
|
|
|
|
<!-- ##### FUNCTION g_cclosure_new_swap ##### -->
|
|
<para>
|
|
|
|
</para>
|
|
|
|
@callback_func:
|
|
@user_data:
|
|
@destroy_data:
|
|
@Returns:
|
|
|
|
|
|
<!-- ##### FUNCTION g_cclosure_new_object ##### -->
|
|
<para>
|
|
|
|
</para>
|
|
|
|
@callback_func:
|
|
@object:
|
|
@Returns:
|
|
|
|
|
|
<!-- ##### FUNCTION g_cclosure_new_object_swap ##### -->
|
|
<para>
|
|
|
|
</para>
|
|
|
|
@callback_func:
|
|
@object:
|
|
@Returns:
|
|
|
|
|
|
<!-- ##### FUNCTION g_closure_new_object ##### -->
|
|
<para>
|
|
|
|
</para>
|
|
|
|
@sizeof_closure:
|
|
@object:
|
|
@Returns:
|
|
|
|
|
|
<!-- ##### FUNCTION g_closure_ref ##### -->
|
|
<para>
|
|
Increment the reference count on a closure to force it staying
|
|
alive while the caller holds a pointer to it.
|
|
</para>
|
|
|
|
@closure: #GClosure to increment the reference count on
|
|
@Returns: The @closure passed in, for convenience
|
|
|
|
|
|
<!-- ##### FUNCTION g_closure_sink ##### -->
|
|
<para>
|
|
Take over the initial ownership of a closure.
|
|
When closures are newly created, they get an initial reference count
|
|
of 1, eventhough no caller has yet invoked g_closure_ref() on the @closure.
|
|
Code entities that store closures for notification purposes are supposed
|
|
to call this function, for example like this:
|
|
<informalexample><programlisting>
|
|
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);
|
|
}
|
|
}
|
|
</programlisting></informalexample>
|
|
Because g_closure_sink() may decrement the reference count of a closure
|
|
(if it hasn't been called on @closure yet) just like g_closure_unref(),
|
|
g_closure_ref() should be called prior to this function.
|
|
</para>
|
|
|
|
@closure: #GClosure to decrement the initial reference count on, if it's
|
|
still being held
|
|
|
|
|
|
<!-- ##### FUNCTION g_closure_unref ##### -->
|
|
<para>
|
|
Decrement the reference count of a closure after it was
|
|
previously incremented by the same caller. The closure
|
|
will most likely be destroyed and freed after this function
|
|
returns.
|
|
</para>
|
|
|
|
@closure: #GClosure to decrement the reference count on
|
|
|
|
|
|
<!-- ##### FUNCTION g_closure_invoke ##### -->
|
|
<para>
|
|
|
|
</para>
|
|
|
|
@closure:
|
|
@return_value:
|
|
@n_param_values:
|
|
@param_values:
|
|
@invocation_hint:
|
|
|
|
|
|
<!-- ##### FUNCTION g_closure_invalidate ##### -->
|
|
<para>
|
|
This function sets a flag on the closure to indicate that it's
|
|
calling environment has become invalid, and thus causes any future
|
|
invocations of g_closure_invoke() on this @closure to be ignored.
|
|
Also, invalidation notifiers installed on the closure will be called
|
|
at this point, and since invalidation notifiers may unreference
|
|
the closure, @closure should be considered an invalidated pointer
|
|
atfer this function, unles g_closure_ref() was called beforehand.
|
|
</para>
|
|
|
|
@closure: GClosure to invalidate
|
|
|
|
|
|
<!-- ##### FUNCTION g_closure_add_finalize_notifier ##### -->
|
|
<para>
|
|
|
|
</para>
|
|
|
|
@closure:
|
|
@notify_data:
|
|
@notify_func:
|
|
|
|
|
|
<!-- ##### FUNCTION g_closure_add_invalidate_notifier ##### -->
|
|
<para>
|
|
|
|
</para>
|
|
|
|
@closure:
|
|
@notify_data:
|
|
@notify_func:
|
|
|
|
|
|
<!-- ##### FUNCTION g_closure_remove_finalize_notifier ##### -->
|
|
<para>
|
|
|
|
</para>
|
|
|
|
@closure:
|
|
@notify_data:
|
|
@notify_func:
|
|
|
|
|
|
<!-- ##### FUNCTION g_closure_remove_invalidate_notifier ##### -->
|
|
<para>
|
|
|
|
</para>
|
|
|
|
@closure:
|
|
@notify_data:
|
|
@notify_func:
|
|
|
|
|
|
<!-- ##### FUNCTION g_closure_new_simple ##### -->
|
|
<para>
|
|
|
|
</para>
|
|
|
|
@sizeof_closure:
|
|
@data:
|
|
@Returns:
|
|
|
|
|
|
<!-- ##### FUNCTION g_closure_set_marshal ##### -->
|
|
<para>
|
|
|
|
</para>
|
|
|
|
@closure:
|
|
@marshal:
|
|
|
|
|
|
<!-- ##### FUNCTION g_closure_add_marshal_guards ##### -->
|
|
<para>
|
|
|
|
</para>
|
|
|
|
@closure:
|
|
@pre_marshal_data:
|
|
@pre_marshal_notify:
|
|
@post_marshal_data:
|
|
@post_marshal_notify:
|
|
|
|
|
|
<!-- ##### FUNCTION g_closure_set_meta_marshal ##### -->
|
|
<para>
|
|
|
|
</para>
|
|
|
|
@closure:
|
|
@marshal_data:
|
|
@meta_marshal:
|
|
|
|
|
|
<!-- ##### FUNCTION g_source_set_closure ##### -->
|
|
<para>
|
|
|
|
</para>
|
|
|
|
@source:
|
|
@closure:
|
|
|
|
|
|
<!-- ##### MACRO G_TYPE_IO_CHANNEL ##### -->
|
|
<para>
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<!-- ##### MACRO G_TYPE_IO_CONDITION ##### -->
|
|
<para>
|
|
|
|
</para>
|
|
|
|
|
|
|