+2007-05-25 Matthew Allum <mallum@openedhand.com>
+
+ * clutter/clutter-color.c: (clutter_color_parse):
+ Handle #rrggbbaa color setting strings (i.e with alpha).
+ Set alpha to 0xff if it is not specified.
+
+ * clutter/clutter-stage.c: (clutter_stage_get_actor_at_pos)
+ Increase select buffer.
+
+ * examples/super-oh.c:
+ Fix up use of clutter_group_show_all()
+
2007-05-25 Tomas Frydrych <tf@openedhand.com>
* clutter/clutter-actor.c:
/**
* clutter_color_parse:
- * @color: a string specifiying a color
+ * @color: a string specifiying a color (named color or #RRGGBBAA)
* @dest: return location for a #ClutterColor
*
* Parses a string definition of a color, filling the
- * <structfield>red</structfield>, <structfield>green</structfield> and
- * <structfield>blue</structfield> channels of @dest. The
- * <structfield>alpha</structfield> channel is not changed. The
- * color in @dest is not allocated.
+ * <structfield>red</structfield>, <structfield>green</structfield>,
+ * <structfield>blue</structfield> and <structfield>alpha</structfield>
+ * channels of @dest. If alpha is not specified it will be set full opaque.
+ * The color in @dest is not allocated.
*
* The color may be defined by any of the formats understood by
- * <function>XParseColor</function>; these include literal color
+ * <function>pango_color_parse</function>; these include literal color
* names, like <literal>Red</literal> or <literal>DarkSlateGray</literal>,
* or hexadecimal specifications like <literal>#3050b2</literal> or
* <literal>#333</literal>.
{
PangoColor pango_color;
+ /* parse ourselves to get alpha */
+ if (color[0] == '#')
+ {
+ gint32 result;
+
+ if (sscanf (color+1, "%x", &result))
+ {
+ if (strlen(color) == 9)
+ {
+ dest->red = result >> 24 & 0xff;
+ dest->green = (result >> 16) & 0xff;
+ dest->blue = (result >> 8) & 0xff;
+ dest->alpha = result & 0xff;
+ return TRUE;
+ }
+ else if (strlen(color) == 7)
+ {
+ dest->red = (result >> 16) & 0xff;
+ dest->green = (result >> 8) & 0xff;
+ dest->blue = result & 0xff;
+ dest->alpha = 0xff;
+ return TRUE;
+ }
+ }
+ }
+
+ /* Fall back to pango for named colors - note pango does not handle alpha */
if (pango_color_parse (&pango_color, color))
{
- dest->red = pango_color.red;
+ dest->red = pango_color.red;
dest->green = pango_color.green;
- dest->blue = pango_color.blue;
-
+ dest->blue = pango_color.blue;
+ dest->alpha = 0xff;
return TRUE;
}
- else
- return FALSE;
+
+ return FALSE;
}
/**
*/
ClutterActor *found = NULL;
- GLuint buff[64] = { 0 };
+ GLuint buff[512] = { 0 };
GLint hits;
GLint view[4];
- ClutterMainContext *ctx;
g_return_val_if_fail (CLUTTER_IS_STAGE (stage), NULL);
- ctx = clutter_context_get_default ();
-
- glSelectBuffer (sizeof (buff), buff);
+ glSelectBuffer (512, buff);
glGetIntegerv (GL_VIEWPORT, view);
glRenderMode (GL_SELECT);
glInitNames ();
-
glPushName (0);
glMatrixMode (GL_PROJECTION);