mirror of
https://github.com/Ryujinx/GtkSharp.git
synced 2024-12-26 13:45:29 +00:00
e83c55a242
* */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
39 lines
911 B
C
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);
|
|
}
|
|
|