implemented G_TYPE_GTPYE. applied patch from matthias which implements

Thu Dec 22 14:59:24 2005  Tim Janik  <timj@imendio.com>

        * gvaluetypes.[hc]: implemented G_TYPE_GTPYE. applied patch
        from matthias which implements GType accessors for GValue.

        * gparamspecs.[hc]: applied patch from matthias which
        implements G_TYPE_PARAM_GTYPE.

        * gobject.[hc]:
        GUnowned: introduced a new object type that has an initially
        floating reference.
        g_object_compat_control(): allow setting of a floating flag handler.
This commit is contained in:
Tim Janik
2005-12-22 15:07:03 +00:00
committed by Tim Janik
parent 513be6bbae
commit 6f01d0c34f
8 changed files with 221 additions and 20 deletions

View File

@@ -818,6 +818,35 @@ g_value_get_pointer (const GValue *value)
return value->data[0].v_pointer;
}
GType
g_gtype_get_type (void)
{
static const GTypeInfo type_info = { 0, };
static GType type;
if (!type)
type = g_type_register_static (G_TYPE_POINTER, g_intern_static_string ("GType"), &type_info, 0);
return type;
}
void
g_value_set_gtype (GValue *value,
GType v_gtype)
{
g_return_if_fail (G_VALUE_HOLDS_GTYPE (value));
value->data[0].v_long = v_gtype;
}
GType
g_value_get_gtype (const GValue *value)
{
g_return_val_if_fail (G_VALUE_HOLDS_GTYPE (value), 0);
return value->data[0].v_long;
}
/* need extra includes for g_strdup_value_contents() ;( */
#include "gobject.h"
#include "gparam.h"