_edje_scale = FROM_DOUBLE(1.0);
_edje_global_obj = efl_add(EDJE_GLOBAL_CLASS, efl_main_loop_get());
EINA_SAFETY_ON_TRUE_GOTO(!_edje_global_obj, shutdown_efreet);
- EINA_SAFETY_ON_TRUE_GOTO(!efl_loop_register(efl_main_loop_get(), EFL_GFX_COLOR_CLASS_INTERFACE, _edje_global_obj), shutdown_efreet);
+ EINA_SAFETY_ON_TRUE_GOTO(!efl_loop_register(efl_main_loop_get(), EFL_GFX_COLOR_CLASS_MIXIN, _edje_global_obj), shutdown_efreet);
EINA_SAFETY_ON_TRUE_GOTO(!efl_loop_register(efl_main_loop_get(), EFL_GFX_TEXT_CLASS_INTERFACE, _edje_global_obj), shutdown_efreet);
EINA_SAFETY_ON_TRUE_GOTO(!efl_loop_register(efl_main_loop_get(), EFL_GFX_SIZE_CLASS_INTERFACE, _edje_global_obj), shutdown_efreet);
_edje_edd_shutdown();
if (_edje_global_obj)
{
- efl_loop_unregister(efl_main_loop_get(), EFL_GFX_COLOR_CLASS_INTERFACE, _edje_global_obj);
+ efl_loop_unregister(efl_main_loop_get(), EFL_GFX_COLOR_CLASS_MIXIN, _edje_global_obj);
efl_loop_unregister(efl_main_loop_get(), EFL_GFX_TEXT_CLASS_INTERFACE, _edje_global_obj);
efl_loop_unregister(efl_main_loop_get(), EFL_GFX_SIZE_CLASS_INTERFACE, _edje_global_obj);
efl_del(_edje_global_obj);
_edje_text_class_hash_free();
_edje_size_class_hash_free();
_edje_edd_shutdown();
- efl_loop_unregister(efl_main_loop_get(), EFL_GFX_COLOR_CLASS_INTERFACE, _edje_global_obj);
+ efl_loop_unregister(efl_main_loop_get(), EFL_GFX_COLOR_CLASS_MIXIN, _edje_global_obj);
efl_loop_unregister(efl_main_loop_get(), EFL_GFX_TEXT_CLASS_INTERFACE, _edje_global_obj);
efl_loop_unregister(efl_main_loop_get(), EFL_GFX_SIZE_CLASS_INTERFACE, _edje_global_obj);
efl_del(_edje_global_obj);
_edje_global(void)
{
#ifndef NDEBUG
- return efl_provider_find(efl_main_loop_get(), EFL_GFX_COLOR_CLASS_INTERFACE);
+ return efl_provider_find(efl_main_loop_get(), EFL_GFX_COLOR_CLASS_MIXIN);
#else
extern Edje_Global *_edje_global_obj;
return _edje_global_obj;
return eina_slstr_printf("#%02X%02X%02X%02X", r, g, b, a);
}
-EOLIAN static void
-_efl_gfx_color_color_class_code_set(Eo *obj, void *_pd EINA_UNUSED, const char *color_class,
+EOLIAN static Eina_Bool
+_efl_gfx_color_class_color_class_code_set(Eo *obj, void *_pd EINA_UNUSED, const char *color_class,
Efl_Gfx_Color_Class_Layer layer, const char *colorcode)
{
int len;
len = _format_clean_param(colorcode);
_format_color_parse(colorcode, len, &r, &g, &b, &a);
- efl_gfx_color_class_set(obj, color_class, layer, r, g, b, a);
+ return efl_gfx_color_class_set(obj, color_class, layer, r, g, b, a);
}
EOLIAN static const char *
-_efl_gfx_color_color_class_code_get(const Eo *obj EINA_UNUSED, void *pd EINA_UNUSED,
+_efl_gfx_color_class_color_class_code_get(const Eo *obj EINA_UNUSED, void *pd EINA_UNUSED,
const char *color_class, Efl_Gfx_Color_Class_Layer layer)
{
int r, g, b, a;
- efl_gfx_color_class_get(obj, color_class, layer, &r, &g, &b, &a);
- return eina_slstr_printf("#%02X%02X%02X%02X", r, g, b, a);
+ if (efl_gfx_color_class_get(obj, color_class, layer, &r, &g, &b, &a))
+ return eina_slstr_printf("#%02X%02X%02X%02X", r, g, b, a);
+ return NULL;
}
#include "interfaces/efl_gfx_color.eo.c"
+#include "interfaces/efl_gfx_color_class.eo.c"
colorcode: string; [[the hex color code.]]
}
}
- @property color_class_code {
- set {
- [[Set the color class color of given Evas Object to the given hex color code(#RRGGBBAA).
- e.g. efl_gfx_color_class_code_set(obj, "color_class_name", layer, "#FFCCAACC");
- ]]
- }
- get {
- [[Get hex color class code of given Evas Object.
- This returns a short lived hex color class code string.
- ]]
- }
- keys {
- color_class: string; [[The name of color class]]
- layer: Efl.Gfx.Color_Class_Layer @optional; [[The layer to set the color]]
- }
- values {
- colorcode: string; [[the hex color code.]]
- }
- }
}
}
import efl_gfx_types;
-interface Efl.Gfx.Color_Class
+mixin Efl.Gfx.Color_Class
{
- [[Efl Gfx Color Class interface]]
+ [[Efl Gfx Color Class mixin class]]
+ data: null;
methods {
- @property color_class {
+ @property color_class @pure_virtual {
set {
[[Set the color of color class.
a: int; [[The alpha value]]
}
}
- @property color_class_description {
+ @property color_class_code {
+ set {
+ [[Set the hex color string of color class.
+
+ This function sets the color values for a 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: These color values are expected to be premultiplied by the alpha.]]
+ return: bool; [[$true if setting the color succeeded, $false otherwise]]
+ }
+ get {
+ [[Get the hex color string of color class.
+
+ This function gets the color values for a 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).
+
+ Returns NULL if the color class cannot be fetched.
+
+ Note: These color values are expected to be premultiplied by $a.]]
+ }
+ keys {
+ color_class: string; [[The name of color class]]
+ layer: Efl.Gfx.Color_Class_Layer @optional; [[The layer to set the color]]
+ }
+ values {
+ colorcode: string; [[the hex color code.]]
+ }
+ }
+ @property color_class_description @pure_virtual {
get {
[[Get the description of a color class.
description: string; [[The description of the target color class or $null if not found]]
}
}
- color_class_del {
+ color_class_del @pure_virtual {
[[Delete the color class.
This function deletes any values for the specified color class.
@in color_class: string; [[The name of color_class]]
}
}
- color_class_clear {
+ color_class_clear @pure_virtual {
[[Delete all color classes defined in object level.
This function deletes any color classes defined in object level.
#include "interfaces/efl_gfx_fill.eo.c"
#include "interfaces/efl_gfx_view.eo.c"
-#include "interfaces/efl_gfx_color_class.eo.c"
#include "interfaces/efl_gfx_text_class.eo.c"
#include "interfaces/efl_gfx_size_class.eo.c"