efl: provide Efl.Gfx.Base.color_part and implement it in top Evas_Object.

This commit is contained in:
Cedric BAIL 2015-04-03 16:30:32 +02:00
parent ac8d923090
commit cd3f8db506
3 changed files with 70 additions and 0 deletions

View File

@ -74,6 +74,51 @@ interface Efl.Gfx.Base {
int a; /*@ The alpha component of the given color. */
}
}
color_part {
set {
/*@
Sets a specifc color of the given Efl.Gfx.Base object to the given
one.
@see evas_object_color_get() (for an example)
@note These color values are expected to be premultiplied by @p a.
*/
return: bool;
}
get {
/*@
Retrieves a specific color of the given Evas object.
Retrieves a specific color's RGB component (and alpha channel)
values, <b>which range from 0 to 255</b>. For the alpha channel,
which defines the object's transparency level, 0 means totally
transparent, while 255 means opaque. These color values are
premultiplied by the alpha value.
The “main“ color being mapped to @c NULL.
Usually youll use this attribute for text and rectangle objects,
where the “main” color is their unique one. If set for objects
which themselves have colors, like the images one, those colors get
modulated by this one.
@note Use @c NULL pointers on the components you're not interested
in: they'll be ignored by the function.
*/
return: bool;
}
keys {
const (char)* part; /*@ The part you are interested in. */
}
values {
int r; /*@ The red component of the given color. */
int g; /*@ The green component of the given color. */
int b; /*@ The blue component of the given color. */
int a; /*@ The alpha component of the given color. */
}
}
visible {
set {
/*@ Makes the given Evas object visible or invisible. */

View File

@ -1292,6 +1292,8 @@ abstract Evas.Object (Eo.Base, Evas.Common_Interface, Efl.Gfx.Base, Efl.Gfx.Stac
Efl.Gfx.Base.position.get;
Efl.Gfx.Base.color.set;
Efl.Gfx.Base.color.get;
Efl.Gfx.Base.color_part.set;
Efl.Gfx.Base.color_part.get;
Efl.Gfx.Base.size.set;
Efl.Gfx.Base.size.get;
Efl.Gfx.Stack.layer.set;

View File

@ -1471,6 +1471,17 @@ _evas_object_efl_gfx_base_color_set(Eo *eo_obj, Evas_Object_Protected_Data *obj,
evas_object_change(eo_obj, obj);
}
EOLIAN static Eina_Bool
_evas_object_efl_gfx_base_color_part_set(Eo *obj, Evas_Object_Protected_Data *pd,
const char *part,
int r, int g, int b, int a)
{
if (part) return EINA_FALSE;
_evas_object_efl_gfx_base_color_set(obj, pd, r, g, b, a);
return EINA_TRUE;
}
EAPI void
evas_object_color_get(const Evas_Object *obj, int *r, int *g, int *b, int *a)
{
@ -1493,6 +1504,18 @@ _evas_object_efl_gfx_base_color_get(Eo *eo_obj EINA_UNUSED,
if (a) *a = obj->cur->color.a;
}
EOLIAN static Eina_Bool
_evas_object_efl_gfx_base_color_part_get(Eo *obj,
Evas_Object_Protected_Data *pd,
const char *part,
int *r, int *g, int *b, int *a)
{
if (part) return EINA_FALSE;
_evas_object_efl_gfx_base_color_get(obj, pd, r, g, b, a);
return EINA_TRUE;
}
EOLIAN static void
_evas_object_anti_alias_set(Eo *eo_obj, Evas_Object_Protected_Data *obj, Eina_Bool anti_alias)
{