mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-09-27 17:52:58 +02:00
destruction cleanup. there's one ->finalize_hook member in the hooklist
Thu Mar 8 16:23:34 2001 Tim Janik <timj@gtk.org> * ghook.[hc]: destruction cleanup. there's one ->finalize_hook member in the hooklist now that gets called when a hook should be destroyed, that's it. that function is guarranteed to be called only when all ref_counts to the hook vanished, thus also when the hook is not in call. Thu Mar 8 16:35:48 2001 Tim Janik <timj@gtk.org> * gparamspecs.[hc]: s/g_param_spec_string_c/g_param_spec_stringc/. * gsignal.[hc]: fixed accumulator invocation, implemented emission hooks. and no, neither of these callbacks are called via a closure, language bindings can wrap the accumulator and emission hook interface, they already get parameters marshalled into a GValue array. (g_signal_connect): removed this function as its C specific, doesn't cover the swapped argument, is too close to its broken original gtk_signal_connect() and creates demand for _swapped, _after and _swapped_after variants <brrr>. (g_signal_connectc): convenience macro to connect a C handler func with data, like the old g_signal_connect() plus swapped argument. * gtype.h: * gboxed.c: added G_TYPE_VALUE boxed type.
This commit is contained in:
@@ -64,6 +64,30 @@ value_meminit (GValue *value,
|
||||
memset (value->data, 0, sizeof (value->data));
|
||||
}
|
||||
|
||||
static gpointer
|
||||
value_copy (gpointer boxed)
|
||||
{
|
||||
const GValue *src_value = boxed;
|
||||
GValue *dest_value = g_new0 (GValue, 1);
|
||||
|
||||
if (G_VALUE_TYPE (src_value))
|
||||
{
|
||||
g_value_init (dest_value, G_VALUE_TYPE (src_value));
|
||||
g_value_copy (src_value, dest_value);
|
||||
}
|
||||
return dest_value;
|
||||
}
|
||||
|
||||
static void
|
||||
value_free (gpointer boxed)
|
||||
{
|
||||
GValue *value = boxed;
|
||||
|
||||
if (G_VALUE_TYPE (value))
|
||||
g_value_unset (value);
|
||||
g_free (value);
|
||||
}
|
||||
|
||||
static gpointer
|
||||
value_array_init (void)
|
||||
{
|
||||
@@ -103,6 +127,15 @@ g_boxed_type_init (void) /* sync with gtype.c */
|
||||
TRUE);
|
||||
g_assert (type == G_TYPE_CLOSURE);
|
||||
|
||||
/* boxed: G_TYPE_VALUE
|
||||
*/
|
||||
type = g_boxed_type_register_static ("GValue",
|
||||
(GBoxedInitFunc) NULL,
|
||||
value_copy,
|
||||
value_free,
|
||||
FALSE);
|
||||
g_assert (type == G_TYPE_VALUE);
|
||||
|
||||
/* boxed: G_TYPE_VALUE_ARRAY
|
||||
*/
|
||||
type = g_boxed_type_register_static ("GValueArray",
|
||||
|
Reference in New Issue
Block a user