clutter-color: Don't directly read the contents of GValue structs
authorNeil Roberts <neil@linux.intel.com>
Wed, 7 Apr 2010 23:20:18 +0000 (00:20 +0100)
committerNeil Roberts <neil@linux.intel.com>
Wed, 5 May 2010 17:49:09 +0000 (18:49 +0100)
commitf4ee7dc0e185e7b5348539513a7fb7705a168849
tree500fcdc82d70ef3e9a6d6e34519a60b42b956703
parentfa1638c0ab5e825830f987ac9ed8d1adcdff3859
clutter-color: Don't directly read the contents of GValue structs

The code for implementing ClutterColor as GParamSpec and the
color↔string transformation functions were assuming that ClutterColor
owns the data in the GValue struct and directly reading
data[0].v_pointer to get a pointer to the color. However ClutterColor
is actually a boxed type and the format of the data array is meant to
be internal to GObject so it is not safe to poke around in it
directly. This patch changes it to use g_value_get_boxed to get the
pointer.

Also, boxed types allow a NULL value to be stored and not all of the
code was coping with this. This patch also attempts to fix that.

http://bugzilla.openedhand.com/show_bug.cgi?id=2068
clutter/clutter-color.c