GtkSharp/glue/value.c
Vladimir Vukicevic dd061f70b1 * glib/ObjectManager.cs, glue/type.c: If there isn't
an exact match for a C GObject class (i.e. BluecurveStyle),
walk up the gobject type hierarchy until we find a type
that we do have a wrapper for, and return that.  This means
that you'll always, worst-case, end up with a GObject.

* glib/Value.cs, glue/value.c: Added default constructor
to GLib.Value() that creates a new value with a type of
INVALID, and changed the glue function to not call
gtk_type_init if INVALID is passed.

svn path=/trunk/gtk-sharp/; revision=7994
2002-10-05 05:12:00 +00:00

26 lines
550 B
C

/* value.c : Glue to allocate GValues on the heap.
*
* Author: Mike Kestner <mkestner@speakeasy.net>
*
* <c> 2002 Mike Kestner
*/
#include <glib-object.h>
GValue *
gtksharp_value_create (GType g_type)
{
GValue *val = g_new0 (GValue, 1);
if (g_type != G_TYPE_INVALID)
val = g_value_init (val, g_type);
return val;
}
GValue *
gtksharp_value_create_from_property (GObject *obj, const gchar* name)
{
GParamSpec *spec = g_object_class_find_property (
G_OBJECT_GET_CLASS (obj), name);
return gtksharp_value_create (spec->value_type);
}