GtkSharp/glib/glue/value.c
Mike Kestner e83c55a242 2004-03-12 Mike Kestner <mkestner@ximian.com>
* */Makefile.am : automakify the build
	* */Makefile.in : kill
	* *.custom : remove System.Drawing dependencies
	* *.cs : remove System.Drawing dependencies
	* *-api.xml : mv to *-api.raw
	* glue/* : mv to lib specific gluelibs for glib, gdk, gtk, and glade.
	* gtk/gtk-symbols : alias GtkType to GType
	* sources/gtk-sharp-sources.xml : create .raw files. They are now
	transformed to .xml files by the metadata compilation step.

svn path=/trunk/gtk-sharp/; revision=23967
2004-03-12 21:18:11 +00:00

39 lines
911 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>
/* Forward declarations */
GValue *gtksharp_value_create (GType g_type);
GValue *gtksharp_value_create_from_property (GObject *obj, const gchar* name);
/* */
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);
}
GType
gtksharp_value_get_value_type (GValue *value) {
g_return_val_if_fail (value != NULL, G_TYPE_INVALID);
g_return_val_if_fail (G_IS_VALUE (value), G_TYPE_INVALID);
return G_VALUE_TYPE (value);
}