Functions
Edje Class: Color

Functions that deal with Color Classes. More...

Functions

Eina_Bool edje_color_class_set (const char *color_class, int r, int g, int b, int a, int r2, int g2, int b2, int a2, int r3, int g3, int b3, int a3)
 Sets Edje color class. More...
 
void edje_color_class_apply (void)
 Applies changes mad when setting Edje color classes. More...
 
Eina_Bool edje_color_class_get (const char *color_class, int *r, int *g, int *b, int *a, int *r2, int *g2, int *b2, int *a2, int *r3, int *g3, int *b3, int *a3)
 Gets Edje color class. More...
 
void edje_color_class_del (const char *color_class)
 Deletes edje color class. More...
 
Eina_Listedje_color_class_list (void)
 Lists color classes. More...
 
Eina_Iteratoredje_color_class_active_iterator_new (void)
 Iterates over all the active class of an application. More...
 
Eina_Iteratoredje_mmap_color_class_iterator_new (Eina_File *f)
 Iterates over all the color class provided by an Edje file. More...
 
Eina_Bool edje_object_color_class_set (Evas_Object *obj, const char *color_class, int r, int g, int b, int a, int r2, int g2, int b2, int a2, int r3, int g3, int b3, int a3)
 Sets the object color class. More...
 
Eina_Bool edje_object_color_class_get (const Evas_Object *obj, const char *color_class, int *r, int *g, int *b, int *a, int *r2, int *g2, int *b2, int *a2, int *r3, int *g3, int *b3, int *a3)
 Gets the object color class. More...
 
void edje_object_color_class_del (Evas_Object *obj, const char *color_class)
 Delete the object color class. More...
 
Eina_Bool edje_object_color_class_clear (const Evas_Object *obj)
 Delete all color classes defined in object level. More...
 
const char * edje_object_color_class_description_get (const Edje_Object *obj, const char *color_class)
 Gets the description of an object color class. More...
 

Detailed Description

Functions that deal with Color Classes.

Sometimes we want to change the color of two or more parts equally and that's when we use color classes.

If one or more parts are assigned with a color class, when we set color values to this class it will cause all these parts to have their colors multiplied by the values. Setting values to a color class at a process level will affect all parts with that color class, while at a object level will affect only the parts inside an specified object.

Function Documentation

◆ edje_color_class_set()

Eina_Bool edje_color_class_set ( const char *  color_class,
int  r,
int  g,
int  b,
int  a,
int  r2,
int  g2,
int  b2,
int  a2,
int  r3,
int  g3,
int  b3,
int  a3 
)

Sets Edje color class.

Parameters
color_class
rObject Red value
gObject Green value
bObject Blue value
aObject Alpha value
r2Outline Red value
g2Outline Green value
b2Outline Blue value
a2Outline Alpha value
r3Shadow Red value
g3Shadow Green value
b3Shadow Blue value
a3Shadow Alpha value

This function sets the color values for a process level color class. This will cause all edje parts in the current process that have the specified color class to have their colors multiplied by these values. (Object level color classes set by edje_object_color_class_set() will override the values set by this function).

The first color is the object, the second is the text outline, and the third is the text shadow. (Note that the second two only apply to text parts).

Setting color emits a signal "color_class,set" with source being the given color class in all objects.

See also
edje_color_class_set().
Note
Unlike Evas, Edje colors are not pre-multiplied. That is, half-transparent white is 255 255 255 128.
Returns
Eina_Bool, EINA_TRUE on success and EINA_FALSE on failure.
Examples
edje-color-class.c.

References EINA_FALSE, eina_hash_string_superfast_new(), and EINA_TRUE.

Referenced by elm_color_class_editor_add().

◆ edje_color_class_apply()

void edje_color_class_apply ( void  )

Applies changes mad when setting Edje color classes.

This forces all changes to color classes made by (for example) edje_color_class_set() to actually take effect.

Since
1.26

References EINA_INLIST_FOREACH, and EINA_TRUE.

◆ edje_color_class_get()

Eina_Bool edje_color_class_get ( const char *  color_class,
int *  r,
int *  g,
int *  b,
int *  a,
int *  r2,
int *  g2,
int *  b2,
int *  a2,
int *  r3,
int *  g3,
int *  b3,
int *  a3 
)

Gets Edje color class.

Parameters
color_class
rObject Red value
gObject Green value
bObject Blue value
aObject Alpha value
r2Outline Red value
g2Outline Green value
b2Outline Blue value
a2Outline Alpha value
r3Shadow Red value
g3Shadow Green value
b3Shadow Blue value
a3Shadow Alpha value
Returns
EINA_TRUE if found or EINA_FALSE if not found and all values are zeroed.

This function gets the color values for a process level color class. This value is the globally set and not per-object, that is, the value that would be used by objects if they did not override with edje_object_color_class_set().

The first color is the object, the second is the text outline, and the third is the text shadow. (Note that the second two only apply to text parts).

See also
edje_color_class_set().
Note
Unlike Evas, Edje colors are not pre-multiplied. That is, half-transparent white is 255 255 255 128.
Examples
edje-color-class.c.

References EINA_TRUE.

◆ edje_color_class_del()

void edje_color_class_del ( const char *  color_class)

Deletes edje color class.

Parameters
color_class

This function deletes any values at the process level for the specified color class.

Note
Deleting the color class will revert it to the values defined in the theme file.

Deleting the color class will emit the signal "color_class,del" to all the Edje objects in the running program.

Examples
edje-color-class.c.

◆ edje_color_class_list()

Eina_List * edje_color_class_list ( void  )

Lists color classes.

Returns
A list of color class names (strings). These strings and the list must be free()'d by the caller.

This function lists all color classes known about by the current process.

Examples
edje-color-class.c.

References eina_hash_foreach().

◆ edje_color_class_active_iterator_new()

Eina_Iterator * edje_color_class_active_iterator_new ( void  )

Iterates over all the active class of an application.

Returns
an iterator of Edje_Color_Class of the currently active color class

This function only iterate over the Edje_Color_Class in use by an application.

Since
1.14

References EINA_MAGIC_SET.

Referenced by elm_color_class_editor_add().

◆ edje_mmap_color_class_iterator_new()

Eina_Iterator * edje_mmap_color_class_iterator_new ( Eina_File f)

Iterates over all the color class provided by an Edje file.

Parameters
fThe mapped edje file.
Returns
an iterator of Edje_Color_Class provided by the Edje file.
Since
1.14

References eina_hash_iterator_tuple_new(), and EINA_MAGIC_SET.

Referenced by elm_color_class_util_edje_file_list().

◆ edje_object_color_class_set()

Eina_Bool edje_object_color_class_set ( Evas_Object obj,
const char *  color_class,
int  r,
int  g,
int  b,
int  a,
int  r2,
int  g2,
int  b2,
int  a2,
int  r3,
int  g3,
int  b3,
int  a3 
)

Sets the object color class.

This function sets the color values for an object level color class. This will cause all edje parts in the specified object that have the specified color class to have their colors multiplied by these values.

The first color is the object, the second is the text outline, and the third is the text shadow. (Note that the second two only apply to text parts).

Setting color emits a signal "color_class,set" with source being the given color.

Note
unlike Evas, Edje colors are not pre-multiplied. That is, half-transparent white is 255 255 255 128.
Parameters
[in]color_classThe name of color class
[in]rObject Red value
[in]gObject Green value
[in]bObject Blue value
[in]aObject Alpha value
[in]r2Outline Red value
[in]g2Outline Green value
[in]b2Outline Blue value
[in]a2Outline Alpha value
[in]r3Shadow Red value
[in]g3Shadow Green value
[in]b3Shadow Blue value
[in]a3Shadow Alpha value
Examples
edje-color-class.c.

References EINA_TRUE.

◆ edje_object_color_class_get()

Eina_Bool edje_object_color_class_get ( const Evas_Object obj,
const char *  color_class,
int *  r,
int *  g,
int *  b,
int *  a,
int *  r2,
int *  g2,
int *  b2,
int *  a2,
int *  r3,
int *  g3,
int *  b3,
int *  a3 
)

Gets the object color class.

This function gets the color values for an object level color class. If no explicit object color is set, then global values will be used.

The first color is the object, the second is the text outline, and the third is the text shadow. (Note that the second two only apply to text parts).

Note
unlike Evas, Edje colors are not pre-multiplied. That is, half-transparent white is 255 255 255 128.
Parameters
[in]color_classThe name of color class
[out]rObject Red value
[out]gObject Green value
[out]bObject Blue value
[out]aObject Alpha value
[out]r2Outline Red value
[out]g2Outline Green value
[out]b2Outline Blue value
[out]a2Outline Alpha value
[out]r3Shadow Red value
[out]g3Shadow Green value
[out]b3Shadow Blue value
[out]a3Shadow Alpha value
Returns
true if found or false if not found and all values are zeroed.

References EINA_TRUE.

◆ edje_object_color_class_del()

void edje_object_color_class_del ( Evas_Object obj,
const char *  color_class 
)

Delete the object color class.

This function deletes any values at the object level for the specified object and color class.

Deleting the color class will revert it to the values defined by edje_color_class_set() or the color class defined in the theme file.

Deleting the color class will emit the signal "color_class,del" for the given Edje object.

Parameters
[in]color_classThe color class to be deleted.
Examples
edje-color-class.c.

◆ edje_object_color_class_clear()

Eina_Bool edje_object_color_class_clear ( const Evas_Object obj)

Delete all color classes defined in object level.

This function deletes any color classes defined in object level. Clearing color classes will revert the color of all edje parts to the values defined in global level or theme file.

Returns
true, on success or false, on error
Since
1.17.0

References EINA_TRUE.

◆ edje_object_color_class_description_get()

const char * edje_object_color_class_description_get ( const Edje_Object *  obj,
const char *  color_class 
)

Gets the description of an object color class.

This function gets the description of a color class in use by an object.

Parameters
[in]color_classColor class description
Returns
The description of the target color class or null if not found