diff options
author | Jee-Yong Um <jc9.um@samsung.com> | 2017-11-08 19:04:26 +0900 |
---|---|---|
committer | Jean-Philippe Andre <jp.andre@samsung.com> | 2017-11-08 19:17:59 +0900 |
commit | 2f838acd4ef0f3f914bb5d03081aef2fd1f412b5 (patch) | |
tree | 09798675bf1d50eca0498e4213f0eae47527fe7d | |
parent | d5dbcdabd14c1ddf01f22b4865487ecce272c055 (diff) |
Efl: add class interfaces (color/text/size)
Summary: implement Efl.Gfx.Class interface
Reviewers: jpeg, cedric
Subscribers: taxi2se, herdsman
Differential Revision: https://phab.enlightenment.org/D4403
-rw-r--r-- | src/Makefile_Edje.am | 1 | ||||
-rw-r--r-- | src/Makefile_Efl.am | 3 | ||||
-rw-r--r-- | src/lib/edje/Edje_Eo.h | 1 | ||||
-rw-r--r-- | src/lib/edje/Edje_Legacy.h | 143 | ||||
-rw-r--r-- | src/lib/edje/edje_global.eo | 12 | ||||
-rw-r--r-- | src/lib/edje/edje_main.c | 5 | ||||
-rw-r--r-- | src/lib/edje/edje_object.eo | 226 | ||||
-rw-r--r-- | src/lib/edje/edje_private.h | 2 | ||||
-rw-r--r-- | src/lib/edje/edje_smart.c | 10 | ||||
-rw-r--r-- | src/lib/edje/edje_types.eot | 9 | ||||
-rw-r--r-- | src/lib/edje/edje_util.c | 231 | ||||
-rw-r--r-- | src/lib/efl/Efl.h | 3 | ||||
-rw-r--r-- | src/lib/efl/interfaces/efl_gfx_color_class.eo | 85 | ||||
-rw-r--r-- | src/lib/efl/interfaces/efl_gfx_size_class.eo | 49 | ||||
-rw-r--r-- | src/lib/efl/interfaces/efl_gfx_text_class.eo | 43 | ||||
-rw-r--r-- | src/lib/efl/interfaces/efl_gfx_types.eot | 8 | ||||
-rw-r--r-- | src/lib/efl/interfaces/efl_interfaces_main.c | 4 | ||||
-rw-r--r-- | src/lib/efl/interfaces/efl_text_properties.eo | 4 |
18 files changed, 545 insertions, 294 deletions
diff --git a/src/Makefile_Edje.am b/src/Makefile_Edje.am index b4299f171e..cf7d9f2655 100644 --- a/src/Makefile_Edje.am +++ b/src/Makefile_Edje.am @@ -5,6 +5,7 @@ edje_eolian_files = \ lib/edje/efl_canvas_layout_calc.eo \ lib/edje/efl_canvas_layout_signal.eo \ lib/edje/efl_canvas_layout_group.eo \ + lib/edje/edje_global.eo \ lib/edje/edje_object.eo \ lib/edje/efl_canvas_layout_part.eo \ lib/edje/efl_canvas_layout_part_box.eo \ diff --git a/src/Makefile_Efl.am b/src/Makefile_Efl.am index c4e866aaa3..f9cdc7fe3c 100644 --- a/src/Makefile_Efl.am +++ b/src/Makefile_Efl.am @@ -76,6 +76,9 @@ efl_eolian_files = \ lib/efl/interfaces/efl_ui_menu.eo \ lib/efl/interfaces/efl_ui_autorepeat.eo \ lib/efl/interfaces/efl_ui_format.eo \ + lib/efl/interfaces/efl_gfx_color_class.eo \ + lib/efl/interfaces/efl_gfx_text_class.eo \ + lib/efl/interfaces/efl_gfx_size_class.eo \ $(efl_eolian_legacy_files) \ $(NULL) diff --git a/src/lib/edje/Edje_Eo.h b/src/lib/edje/Edje_Eo.h index 877f3bea07..37c5db5ce0 100644 --- a/src/lib/edje/Edje_Eo.h +++ b/src/lib/edje/Edje_Eo.h @@ -3,6 +3,7 @@ #include "efl_canvas_layout_calc.eo.h" #include "efl_canvas_layout_signal.eo.h" #include "efl_canvas_layout_group.eo.h" +#include "edje_global.eo.h" #include "edje_object.eo.h" #include "edje_edit.eo.h" diff --git a/src/lib/edje/Edje_Legacy.h b/src/lib/edje/Edje_Legacy.h index 24a913675f..edd30e25da 100644 --- a/src/lib/edje/Edje_Legacy.h +++ b/src/lib/edje/Edje_Legacy.h @@ -1213,6 +1213,147 @@ EAPI Eina_Bool edje_object_color_class_set(Evas_Object *obj, const char * color_ EAPI 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); /** + * @brief 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. + * + * @param[in] color_class The color class to be deleted. + * + * @ingroup Edje_Object + */ +EAPI void edje_object_color_class_del(Evas_Object *obj, const char *color_class); + +/** + * @brief 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. + * + * @return @c true, on success or @c false, on error + * + * @since 1.17.0 + * + * @ingroup Edje_Object + */ +EAPI Eina_Bool edje_object_color_class_clear(const Evas_Object *obj); + +/** + * @brief Sets Edje text class. + * + * This function sets the text class for the Edje. + * + * @param[in] text_class The text class name + * @param[in] font Font name + * @param[in] size Font Size + * + * @return @c true, on success or @c false, on error + * + * @ingroup Edje_Object + */ +EAPI Eina_Bool edje_object_text_class_set(Evas_Object *obj, const char * text_class, const char *font, Evas_Font_Size size); + +/** + * @brief Gets font and font size from edje text class. + * + * This function gets the font and the font size from the object text class. + * The font string will only be valid until the text class is changed or the + * edje object is deleted. + * + * @param[in] text_class The text class name + * @param[out] font Font name + * @param[out] size Font Size + * + * @return @c true, on success or @c false, on error + * + * @ingroup Edje_Object + */ +EAPI Eina_Bool edje_object_text_class_get(const Evas_Object *obj, const char * text_class, const char **font, Evas_Font_Size *size); + +/** + * @brief Delete the object text class. + * + * This function deletes any values at the object level for the specified + * object and text class. + * + * Deleting the text class will revert it to the values defined by + * edje_text_class_set() or the text class defined in the theme file. + * + * @param[in] text_class The color class to be deleted. + * + * @since 1.17 + * + * @ingroup Edje_Object + */ +EAPI void edje_object_text_class_del(Evas_Object *obj, const char *text_class); + +/** + * @brief Sets the object size class. + * + * This function sets the min and max values for an object level size class. + * This will make all edje parts in the specified object that have the + * specified size class update their min and max size with given values. + * + * @param[in] size_class The size class name + * @param[in] minw The min width + * @param[in] minh The min height + * @param[in] maxw The max width + * @param[in] maxh The max height + * + * @return @c true, on success or @c false, on error + * + * @since 1.17 + * + * @ingroup Edje_Object + */ +EAPI Eina_Bool edje_object_size_class_set(Evas_Object *obj, const char * size_class, int minw, int minh, int maxw, int maxh); + +/** + * @brief Gets the object size class. + * + * This function gets the min and max values for an object level size class. + * These values will only be valid until the size class is changed or the edje + * object is deleted. + * + * @param[in] size_class The size class name + * @param[out] minw The min width + * @param[out] minh The min height + * @param[out] maxw The max width + * @param[out] maxh The max height + * + * @return @c true, on success or @c false, on error + * + * @since 1.17 + * + * @ingroup Edje_Object + */ +EAPI Eina_Bool edje_object_size_class_get(const Evas_Object *obj, const char * size_class, int *minw, int *minh, int *maxw, int *maxh); + +/** + * @brief Delete the object size class. + * + * This function deletes any values at the object level for the specified + * object and size class. + * + * Deleting the size class will revert it to the values defined by + * edje_size_class_set() or the color class defined in the theme file. + * + * @param[in] size_class Size class name + * + * @since 1.17 + * + * @ingroup Edje_Object + */ +EAPI void edje_object_size_class_del(Evas_Object *obj, const char *size_class); + +/** * @brief Enables selection if the entry is an EXPLICIT selection mode type. * * The default is to not allow selection. This function only affects user @@ -1224,7 +1365,7 @@ EAPI Eina_Bool edje_object_color_class_get(const Evas_Object *obj, const char * * * @ingroup Edje_Object */ -EAPI void edje_object_part_text_select_allow_set(const Edje_Object *obj, const char *part, Eina_Bool allow); +EAPI void edje_object_part_text_select_allow_set(const Evas_Object *obj, const char *part, Eina_Bool allow); /** * @brief Sets the RTL orientation for this object. diff --git a/src/lib/edje/edje_global.eo b/src/lib/edje/edje_global.eo new file mode 100644 index 0000000000..07ebba5130 --- /dev/null +++ b/src/lib/edje/edje_global.eo @@ -0,0 +1,12 @@ +class Edje.Global (Efl.Object, Efl.Gfx.Color_Class, Efl.Gfx.Text_Class, Efl.Gfx.Size_Class) +{ + data: null; + implements { + Efl.Gfx.Color_Class.color_class { get; set; } + Efl.Gfx.Color_Class.color_class_del; + Efl.Gfx.Text_Class.text_class { get; set; } + Efl.Gfx.Text_Class.text_class_del; + Efl.Gfx.Size_Class.size_class { get; set; } + Efl.Gfx.Size_Class.size_class_del; + } +} diff --git a/src/lib/edje/edje_main.c b/src/lib/edje/edje_main.c index 3c6adeb840..f5980cc67e 100644 --- a/src/lib/edje/edje_main.c +++ b/src/lib/edje/edje_main.c @@ -81,6 +81,7 @@ edje_init(void) } _edje_scale = FROM_DOUBLE(1.0); + _edje_global_obj = efl_add(EDJE_GLOBAL_CLASS, NULL); _edje_edd_init(); _edje_text_init(); @@ -140,6 +141,8 @@ shutdown_all: _edje_text_class_hash_free(); _edje_size_class_hash_free(); _edje_edd_shutdown(); + efl_del(_edje_global_obj); + _edje_global_obj = NULL; efreet_shutdown(); shutdown_evas: evas_shutdown(); @@ -192,6 +195,8 @@ _edje_shutdown_core(void) _edje_text_class_hash_free(); _edje_size_class_hash_free(); _edje_edd_shutdown(); + efl_del(_edje_global_obj); + _edje_global_obj = NULL; eina_cow_del(_edje_calc_params_map_cow); eina_cow_del(_edje_calc_params_physics_cow); diff --git a/src/lib/edje/edje_object.eo b/src/lib/edje/edje_object.eo index b1e1f062db..895f06d0cd 100644 --- a/src/lib/edje/edje_object.eo +++ b/src/lib/edje/edje_object.eo @@ -5,7 +5,8 @@ import edje_types; class Edje.Object (Efl.Canvas.Group, Efl.File, Efl.Container, Efl.Part, Efl.Observer, Efl.Ui.Base, Efl.Canvas.Layout_Calc, Efl.Canvas.Layout_Signal, Efl.Canvas.Layout_Group, - Efl.Player) + Efl.Player, Efl.Gfx.Color_Class, Efl.Gfx.Text_Class, + Efl.Gfx.Size_Class) { [[Edje object class]] legacy_prefix: edje_object; @@ -101,221 +102,6 @@ class Edje.Object (Efl.Canvas.Group, Efl.File, Efl.Container, Efl.Part, } } - /* CLASS APIS BEGIN -------------------------------------------------- */ - @property global_color_class @class { - set { - [[Sets Edje color class. - - 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). - - Setting color emits a signal "color_class,set" with source being - the given color class in all objects. - - Note: unlike Evas, Edje colors are not pre-multiplied. That is, - half-transparent white is 255 255 255 128.]] - legacy: null; - return: bool; [[$true on success, $false otherwise]] - } - get { - [[Gets Edje color class. - - 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 - @.color_class.set(). - - See also, @.global_color_class.set() - - Note: unlike Evas, Edje colors are not pre-multiplied. That is, - half-transparent white is 255 255 255 128.]] - legacy: null; - return: bool; [[$true if found or $false if not found and all values - are zeored.]] - } - keys { - color_class: string; [[The name of color class]] - mode: Edje.Color_Class.Mode; [[Edje color class mode]] - } - values { - r: int; [[Object Red value]] - g: int; [[Object Green value]] - b: int; [[Object Blue value]] - a: int; [[Object Alpha value]] - } - } - @property color_class { - set { - [[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.]] - legacy: null; - return: bool; [[$true on success, $false otherwise]] - } - get { - [[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.]] - legacy: null; - return: bool; [[$true if found or $false if not found and all - values are zeroed.]] - } - keys { - color_class: string; [[The name of color class]] - mode: Edje.Color_Class.Mode; [[Edje color class mode]] - } - values { - r: int; [[Object Red value]] - g: int; [[Object Green value]] - b: int; [[Object Blue value]] - a: int; [[Object Alpha value]] - } - } - @property color_class_description { - get { - [[Gets the description of an object color class. - - This function gets the description of a color class in use by an object.]] - return: string; [[The description of the target color class or $null if not found]] - } - keys { - color_class: string; [[Color class description]] - } - } - color_class_clear @const { - [[Clears object color classes. - - @since 1.17.0]] - return: bool; [[$true on success, or $false on error]] - } - color_class_del { - [[Deletes 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.]] - params { - @in color_class: string; [[The color class to be deleted.]] - } - } - @property text_class { - set { - [[Sets Edje text class. - - This function sets the text class for the Edje.]] - return: bool; [[$true on success, or $false on error]] - } - get { - [[Gets font and font size from edje text class. - - This function gets the font and the font size from the object - text class. The font string will only be valid until the text - class is changed or the edje object is deleted.]] - return: bool; [[$true on success, or $false on error]] - } - keys { - text_class: string; [[The text class name]] - } - values { - font: string; [[Font name]] - size: int; [[Font Size]] - } - } - text_class_del { - [[Deletes the object text class. - - This function deletes any values at the object level for the - specified object and text class. - - Deleting the text class will revert it to the values - defined by edje_text_class_set() or the text class - defined in the theme file. - - @since 1.17]] - params { - @in text_class: string; [[The color class to be deleted.]] - } - } - @property size_class { - set { - [[Sets the object size class. - - This function sets the min and max values for an object level size - class. This will make all edje parts in the specified object that - have the specified size class update their min and max size with given values. - - @since 1.17]] - return: bool; [[$true on success, or $false on error]] - } - get { - [[Gets the object size class. - - This function gets the min and max values for an object level size - class. These values will only be valid until the size class is changed - or the edje object is deleted. - - @since 1.17]] - return: bool; [[$true on success, or $false on error]] - } - keys { - size_class: string; [[The size class name]] - } - values { - minw: int; [[The min width]] - minh: int; [[The min height]] - maxw: int; [[The max width]] - maxh: int; [[The max height]] - } - } - size_class_del { - [[Deletes the object size class. - - This function deletes any values at the object level for the - specified object and size class. - - Deleting the size class will revert it to the values - defined by edje_size_class_set() or the color class - defined in the theme file. - - @since 1.17]] - params { - @in size_class: string; [[Size class name]] - } - } - /* CLASS APIS END ---------------------------------------------------- */ - access_part_iterate @beta { [[Iterates over all accessibility-enabled part names.]] legacy: null; @@ -391,6 +177,14 @@ class Edje.Object (Efl.Canvas.Group, Efl.File, Efl.Container, Efl.Part, Efl.Object.debug_name_override; Efl.Canvas.Object.no_render { set; } Efl.Canvas.Object.paragraph_direction { set; } + Efl.Gfx.Color_Class.color_class { get; set; } + Efl.Gfx.Color_Class.color_class_description { get; } + Efl.Gfx.Color_Class.color_class_del; + Efl.Gfx.Color_Class.color_class_clear; + Efl.Gfx.Text_Class.text_class { get; set; } + Efl.Gfx.Text_Class.text_class_del; + Efl.Gfx.Size_Class.size_class { get; set; } + Efl.Gfx.Size_Class.size_class_del; Efl.Canvas.Group.group_calculate; Efl.Canvas.Layout_Calc.calc_auto_update_hints { get; set; } Efl.Canvas.Layout_Calc.calc_size_min; diff --git a/src/lib/edje/edje_private.h b/src/lib/edje/edje_private.h index 5063b0080b..369dddc55a 100644 --- a/src/lib/edje/edje_private.h +++ b/src/lib/edje/edje_private.h @@ -2348,6 +2348,8 @@ const Eina_Inarray *edje_match_signal_source_hash_get(const char *signal, void edje_match_signal_source_free(Edje_Signal_Source_Char *key, void *data); void _edje_signal_callback_matches_unref(Edje_Signal_Callback_Matches *m); +extern Edje_Global *_edje_global_obj; + // FIXME remove below 3 eapi decls when edje_convert goes EAPI void _edje_edd_init(void); EAPI void _edje_data_font_list_desc_make(Eet_Data_Descriptor **_font_list_edd, Eet_Data_Descriptor **_font_edd); diff --git a/src/lib/edje/edje_smart.c b/src/lib/edje/edje_smart.c index 8b01b4eb03..fd1e2470b2 100644 --- a/src/lib/edje/edje_smart.c +++ b/src/lib/edje/edje_smart.c @@ -536,6 +536,15 @@ _edje_object_efl_player_play_speed_get(Eo *obj EINA_UNUSED, Edje *pd) return 1.0/pd->duration_scale; } +EOLIAN static Efl_Object * +_edje_object_efl_object_provider_find(Eo *obj, Edje *ed EINA_UNUSED, const Efl_Class *klass) +{ + if (klass == EDJE_GLOBAL_CLASS) + return _edje_global_obj; + + return efl_provider_find(efl_super(obj, EDJE_OBJECT_CLASS), klass); +} + /* Internal EO APIs and hidden overrides */ #define EDJE_OBJECT_EXTRA_OPS \ @@ -543,6 +552,7 @@ _edje_object_efl_player_play_speed_get(Eo *obj EINA_UNUSED, Edje *pd) EFL_OBJECT_OP_FUNC(efl_dbg_info_get, _edje_object_efl_object_dbg_info_get) #include "edje_object.eo.c" +#include "edje_global.eo.c" #include "efl_canvas_layout_calc.eo.c" #include "efl_canvas_layout_signal.eo.c" #include "efl_canvas_layout_group.eo.c" diff --git a/src/lib/edje/edje_types.eot b/src/lib/edje/edje_types.eot index ca09839c3a..885798ac41 100644 --- a/src/lib/edje/edje_types.eot +++ b/src/lib/edje/edje_types.eot @@ -134,15 +134,6 @@ enum Edje.Input_Panel.Layout { struct Edje.Perspective; [[Perspective info for maps inside edje objects]] -enum Edje.Color_Class.Mode { - [[Selector to access one color among the colors belonging to a color class. - - @since 1.18]] - color = 0, [[The default color. For instance, the color of the text itself.]] - color2, [[The 2nd color. For instance, the outline of the text.]] - color3 [[The 3rd color. For instance, the shadow of the text.]] -} - /* FIXME-cb: Ignore cb types that should be fixed. */ type Edje.Signal_Cb: __undefined_type; [[Edje signal callback type]] type Edje.Markup_Filter_Cb: __undefined_type; [[Edje markup filter callback type]] diff --git a/src/lib/edje/edje_util.c b/src/lib/edje/edje_util.c index 1b772d4be7..da6d413411 100644 --- a/src/lib/edje/edje_util.c +++ b/src/lib/edje/edje_util.c @@ -16,6 +16,8 @@ struct _Edje_Box_Layout char name[]; }; +Edje_Global *_edje_global_obj = NULL; + static Eina_Hash *_edje_color_class_hash = NULL; static Eina_Hash *_edje_text_class_hash = NULL; static Eina_Hash *_edje_size_class_hash = NULL; @@ -500,7 +502,7 @@ _edje_object_efl_canvas_layout_calc_calc_thaw(Eo *obj EINA_UNUSED, Edje *ed) } static Eina_Bool -_edje_color_class_set_internal(Eina_Hash *hash, const char *color_class, Edje_Color_Class_Mode mode, int r, int g, int b, int a, Eina_Bool *need_update) +_edje_color_class_set_internal(Eina_Hash *hash, const char *color_class, Efl_Gfx_Color_Class_Layer layer, int r, int g, int b, int a, Eina_Bool *need_update) { Edje_Color_Class *cc; @@ -523,9 +525,9 @@ _edje_color_class_set_internal(Eina_Hash *hash, const char *color_class, Edje_Co cc = eina_hash_find(hash, color_class); if (cc) { - switch (mode) + switch (layer) { - case EDJE_COLOR_CLASS_MODE_COLOR: + case EFL_GFX_COLOR_CLASS_LAYER_NORMAL: if ((cc->r == r) && (cc->g == g) && (cc->b == b) && (cc->a == a)) { @@ -534,7 +536,7 @@ _edje_color_class_set_internal(Eina_Hash *hash, const char *color_class, Edje_Co } break; - case EDJE_COLOR_CLASS_MODE_COLOR2: + case EFL_GFX_COLOR_CLASS_LAYER_OUTLINE: if ((cc->r2 == r) && (cc->g2 == g) && (cc->b2 == b) && (cc->a2 == a)) { @@ -543,7 +545,7 @@ _edje_color_class_set_internal(Eina_Hash *hash, const char *color_class, Edje_Co } break; - case EDJE_COLOR_CLASS_MODE_COLOR3: + case EFL_GFX_COLOR_CLASS_LAYER_SHADOW: if ((cc->r3 == r) && (cc->g3 == g) && (cc->b3 == b) && (cc->a3 == a)) { @@ -571,23 +573,23 @@ _edje_color_class_set_internal(Eina_Hash *hash, const char *color_class, Edje_Co eina_hash_direct_add(hash, cc->name, cc); } - switch (mode) + switch (layer) { - case EDJE_COLOR_CLASS_MODE_COLOR: + case EFL_GFX_COLOR_CLASS_LAYER_NORMAL: cc->r = r; cc->g = g; cc->b = b; cc->a = a; break; - case EDJE_COLOR_CLASS_MODE_COLOR2: + case EFL_GFX_COLOR_CLASS_LAYER_OUTLINE: cc->r2 = r; cc->g2 = g; cc->b2 = b; cc->a2 = a; break; - case EDJE_COLOR_CLASS_MODE_COLOR3: + case EFL_GFX_COLOR_CLASS_LAYER_SHADOW: cc->r3 = r; cc->g3 = g; cc->b3 = b; @@ -601,27 +603,27 @@ _edje_color_class_set_internal(Eina_Hash *hash, const char *color_class, Edje_Co } static Eina_Bool -_edje_color_class_get_internal(Edje_Color_Class *cc, Edje_Color_Class_Mode mode, int *r, int *g, int *b, int *a) +_edje_color_class_get_internal(Edje_Color_Class *cc, Efl_Gfx_Color_Class_Layer layer, int *r, int *g, int *b, int *a) { if (cc) { - switch (mode) + switch (layer) { - case EDJE_COLOR_CLASS_MODE_COLOR: + case EFL_GFX_COLOR_CLASS_LAYER_NORMAL: if (r) *r = cc->r; if (g) *g = cc->g; if (b) *b = cc->b; if (a) *a = cc->a; break; - case EDJE_COLOR_CLASS_MODE_COLOR2: + case EFL_GFX_COLOR_CLASS_LAYER_OUTLINE: if (r) *r = cc->r2; if (g) *g = cc->g2; if (b) *b = cc->b2; if (a) *a = cc->a2; break; - case EDJE_COLOR_CLASS_MODE_COLOR3: + case EFL_GFX_COLOR_CLASS_LAYER_SHADOW: if (r) *r = cc->r3; if (g) *g = cc->g3; if (b) *b = cc->b3; @@ -644,18 +646,18 @@ _edje_color_class_get_internal(Edje_Color_Class *cc, Edje_Color_Class_Mode mode, EAPI 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) { - Eina_Bool int_ret; + Eina_Bool int_ret = EINA_TRUE; - int_ret = edje_obj_global_color_class_set(EDJE_OBJECT_CLASS, color_class, EDJE_COLOR_CLASS_MODE_COLOR, r, g, b, a); - int_ret &= edje_obj_global_color_class_set(EDJE_OBJECT_CLASS, color_class, EDJE_COLOR_CLASS_MODE_COLOR2, r2, g2, b2, a2); - int_ret &= edje_obj_global_color_class_set(EDJE_OBJECT_CLASS, color_class, EDJE_COLOR_CLASS_MODE_COLOR3, r3, g3, b3, a3); + int_ret &= efl_gfx_color_class_set(_edje_global_obj, color_class, EFL_GFX_COLOR_CLASS_LAYER_NORMAL, r, g, b, a); + int_ret &= efl_gfx_color_class_set(_edje_global_obj, color_class, EFL_GFX_COLOR_CLASS_LAYER_OUTLINE, r2, g2, b2, a2); + int_ret &= efl_gfx_color_class_set(_edje_global_obj, color_class, EFL_GFX_COLOR_CLASS_LAYER_SHADOW, r3, g3, b3, a3); return int_ret; } EOLIAN Eina_Bool -_edje_object_global_color_class_set(Efl_Class *klass EINA_UNUSED, void *pd EINA_UNUSED, - const char *color_class, Edje_Color_Class_Mode mode, int r, int g, int b, int a) +_edje_global_efl_gfx_color_class_color_class_set(Eo *obj EINA_UNUSED, void *pd EINA_UNUSED, + const char *color_class, Efl_Gfx_Color_Class_Layer layer, int r, int g, int b, int a) { Eina_Bool int_ret; Eina_Bool need_update = EINA_FALSE; @@ -663,7 +665,7 @@ _edje_object_global_color_class_set(Efl_Class *klass EINA_UNUSED, void *pd EINA_ if (!_edje_color_class_hash) _edje_color_class_hash = eina_hash_string_superfast_new(NULL); - int_ret = _edje_color_class_set_internal(_edje_color_class_hash, color_class, mode, r, g, b, a, &need_update); + int_ret = _edje_color_class_set_internal(_edje_color_class_hash, color_class, layer, r, g, b, a, &need_update); if ((int_ret) && (need_update)) efl_observable_observers_update(_edje_color_class_member, color_class, "color_class,set"); @@ -674,18 +676,18 @@ _edje_object_global_color_class_set(Efl_Class *klass EINA_UNUSED, void *pd EINA_ EAPI 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) { - Eina_Bool int_ret; + Eina_Bool int_ret = EINA_TRUE; - int_ret = edje_obj_global_color_class_get(EDJE_OBJECT_CLASS, color_class, EDJE_COLOR_CLASS_MODE_COLOR, r, g, b, a); - int_ret &= edje_obj_global_color_class_get(EDJE_OBJECT_CLASS, color_class, EDJE_COLOR_CLASS_MODE_COLOR2, r2, g2, b2, a2); - int_ret &= edje_obj_global_color_class_get(EDJE_OBJECT_CLASS, color_class, EDJE_COLOR_CLASS_MODE_COLOR3, r3, g3, b3, a3); + int_ret &= efl_gfx_color_class_get(_edje_global_obj, color_class, EFL_GFX_COLOR_CLASS_LAYER_NORMAL, r, g, b, a); + int_ret &= efl_gfx_color_class_get(_edje_global_obj, color_class, EFL_GFX_COLOR_CLASS_LAYER_OUTLINE, r2, g2, b2, a2); + int_ret &= efl_gfx_color_class_get(_edje_global_obj, color_class, EFL_GFX_COLOR_CLASS_LAYER_SHADOW, r3, g3, b3, a3); return int_ret; } EOLIAN Eina_Bool -_edje_object_global_color_class_get(Efl_Class *klass EINA_UNUSED, void *pd EINA_UNUSED, - const char *color_class, Edje_Color_Class_Mode mode, int *r, int *g, int *b, int *a) +_edje_global_efl_gfx_color_class_color_class_get(Eo *obj EINA_UNUSED, void *pd EINA_UNUSED, + const char *color_class, Efl_Gfx_Color_Class_Layer layer, int *r, int *g, int *b, int *a) { Edje_Color_Class *cc; @@ -694,12 +696,18 @@ _edje_object_global_color_class_get(Efl_Class *klass EINA_UNUSED, void *pd EINA_ else cc = eina_hash_find(_edje_color_class_hash, color_class); - return _edje_color_class_get_internal(cc, mode, r, g, b, a); + return _edje_color_class_get_internal(cc, layer, r, g, b, a); } EAPI void edje_color_class_del(const char *color_class) { + efl_gfx_color_class_del(_edje_global_obj, color_class); +} + +EOLIAN void +_edje_global_efl_gfx_color_class_color_class_del(Eo *obj EINA_UNUSED, void *pd EINA_UNUSED, const char *color_class) +{ Edje_Color_Class *cc; if (!color_class) return; @@ -826,22 +834,22 @@ _edje_color_class_list_foreach(const Eina_Hash *hash EINA_UNUSED, const void *ke EAPI 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) { - Eina_Bool int_ret; + Eina_Bool int_ret = EINA_TRUE; - int_ret = edje_obj_color_class_set(obj, color_class, EDJE_COLOR_CLASS_MODE_COLOR, r, g, b, a); - int_ret &= edje_obj_color_class_set(obj, color_class, EDJE_COLOR_CLASS_MODE_COLOR2, r2, g2, b2, a2); - int_ret &= edje_obj_color_class_set(obj, color_class, EDJE_COLOR_CLASS_MODE_COLOR3, r3, g3, b3, a3); + int_ret &= efl_gfx_color_class_set(obj, color_class, EFL_GFX_COLOR_CLASS_LAYER_NORMAL, r, g, b, a); + int_ret &= efl_gfx_color_class_set(obj, color_class, EFL_GFX_COLOR_CLASS_LAYER_OUTLINE, r2, g2, b2, a2); + int_ret &= efl_gfx_color_class_set(obj, color_class, EFL_GFX_COLOR_CLASS_LAYER_SHADOW, r3, g3, b3, a3); return int_ret; } EOLIAN Eina_Bool -_edje_object_color_class_set(Eo *obj EINA_UNUSED, Edje *ed, const char *color_class, Edje_Color_Class_Mode mode, int r, int g, int b, int a) +_edje_object_efl_gfx_color_class_color_class_set(Eo *obj EINA_UNUSED, Edje *ed, const char *color_class, Efl_Gfx_Color_Class_Layer layer, int r, int g, int b, int a) { Eina_Bool int_ret; Eina_Bool need_update; - int_ret = _edje_color_class_set_internal(ed->color_classes, color_class, mode, r, g, b, a, &need_update); + int_ret = _edje_color_class_set_internal(ed->color_classes, color_class, layer, r, g, b, a, &need_update); if ((int_ret) && (need_update)) { @@ -860,8 +868,8 @@ _edje_object_color_class_set(Eo *obj EINA_UNUSED, Edje *ed, const char *color_cl ((rp->type == EDJE_RP_TYPE_SWALLOW) && (rp->typedata.swallow)) && (rp->typedata.swallow->swallowed_object)) - edje_obj_color_class_set(rp->typedata.swallow->swallowed_object, - color_class, mode, r, g, b, a); + efl_gfx_color_class_set(rp->typedata.swallow->swallowed_object, + color_class, layer, r, g, b, a); } _edje_recalc(ed); @@ -874,17 +882,17 @@ _edje_object_color_class_set(Eo *obj EINA_UNUSED, Edje *ed, const char *color_cl EAPI 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) { - Eina_Bool int_ret; + Eina_Bool int_ret = EINA_TRUE; - int_ret = edje_obj_color_class_get(obj, color_class, EDJE_COLOR_CLASS_MODE_COLOR, r, g, b, a); - int_ret &= edje_obj_color_class_get(obj, color_class, EDJE_COLOR_CLASS_MODE_COLOR2, r2, g2, b2, a2); - int_ret &= edje_obj_color_class_get(obj, color_class, EDJE_COLOR_CLASS_MODE_COLOR3, r3, g3, b3, a3); + int_ret &= efl_gfx_color_class_get(obj, color_class, EFL_GFX_COLOR_CLASS_LAYER_NORMAL, r, g, b, a); + int_ret &= efl_gfx_color_class_get(obj, color_class, EFL_GFX_COLOR_CLASS_LAYER_OUTLINE, r2, g2, b2, a2); + int_ret &= efl_gfx_color_class_get(obj, color_class, EFL_GFX_COLOR_CLASS_LAYER_SHADOW, r3, g3, b3, a3); return int_ret; } EOLIAN Eina_Bool -_edje_object_color_class_get(Eo *obj EINA_UNUSED, Edje *ed, const char *color_class, Edje_Color_Class_Mode mode, int *r, int *g, int *b, int *a) +_edje_object_efl_gfx_color_class_color_class_get(Eo *obj EINA_UNUSED, Edje *ed, const char *color_class, Efl_Gfx_Color_Class_Layer layer, int *r, int *g, int *b, int *a) { Edje_Color_Class *cc; @@ -893,18 +901,30 @@ _edje_object_color_class_get(Eo *obj EINA_UNUSED, Edje *ed, const char *color_cl else cc = _edje_color_class_find(ed, color_class); - return _edje_color_class_get_internal(cc, mode, r, g, b, a); + return _edje_color_class_get_internal(cc, layer, r, g, b, a); +} + +EAPI const char * +edje_objcet_color_class_description_get(const Evas_Object *obj, const char *color_class) +{ + return efl_gfx_color_class_description_get(obj, color_class); } -EOLIAN Eina_Stringshare * -_edje_object_color_class_description_get(Eo *obj EINA_UNUSED, Edje *ed, const char *color_class) +EOLIAN const char * +_edje_object_efl_gfx_color_class_color_class_description_get(Eo *obj EINA_UNUSED, Edje *ed, const char *color_class) { Edje_Color_Class *cc = _edje_color_class_find(ed, color_class); return cc ? cc->desc : NULL; } +EAPI void +edje_object_color_class_del(Evas_Object *obj, const char *color_class) +{ + efl_gfx_color_class_del(obj, color_class); +} + EOLIAN void -_edje_object_color_class_del(Eo *obj EINA_UNUSED, Edje *ed, const char *color_class) +_edje_object_efl_gfx_color_class_color_class_del(Eo *obj EINA_UNUSED, Edje *ed, const char *color_class) { Edje_Color_Class *cc = NULL; unsigned short i; @@ -922,7 +942,7 @@ _edje_object_color_class_del(Eo *obj EINA_UNUSED, Edje *ed, const char *color_cl ((rp->type == EDJE_RP_TYPE_SWALLOW) && (rp->typedata.swallow)) && (rp->typedata.swallow->swallowed_object)) - edje_object_color_class_del(rp->typedata.swallow->swallowed_object, color_class); + efl_gfx_color_class_del(rp->typedata.swallow->swallowed_object, color_class); } ed->dirty = EINA_TRUE; @@ -934,17 +954,22 @@ _edje_object_color_class_del(Eo *obj EINA_UNUSED, Edje *ed, const char *color_cl _edje_emit(ed, "color_class,del", color_class); } -EOLIAN Eina_Bool -_edje_object_color_class_clear(const Eo *obj EINA_UNUSED, Edje *ed) +EAPI Eina_Bool +edje_object_color_class_clear(const Evas_Object *obj) +{ + efl_gfx_color_class_clear((Eo *)obj); + + return EINA_TRUE; +} + +EOLIAN void +_edje_object_efl_gfx_color_class_color_class_clear(Eo *obj EINA_UNUSED, Edje *ed) { Edje_List_Foreach_Data fdata; Edje_Color_Class *cc = NULL; Eina_List *l; char *color_class; unsigned short i; - Eina_Bool int_ret = EINA_TRUE; - - if (!ed) return EINA_FALSE; memset(&fdata, 0, sizeof(Edje_List_Foreach_Data)); eina_hash_foreach(ed->color_classes, _edje_color_class_list_foreach, &fdata); @@ -961,7 +986,7 @@ _edje_object_color_class_clear(const Eo *obj EINA_UNUSED, Edje *ed) ((rp->type == EDJE_RP_TYPE_SWALLOW) && (rp->typedata.swallow)) && (rp->typedata.swallow->swallowed_object)) - int_ret &= edje_object_color_class_clear(rp->typedata.swallow->swallowed_object); + efl_gfx_color_class_clear(rp->typedata.swallow->swallowed_object); } ed->dirty = EINA_TRUE; @@ -976,8 +1001,6 @@ _edje_object_color_class_clear(const Eo *obj EINA_UNUSED, Edje *ed) _edje_emit(ed, "color_class,del", color_class); free(color_class); } - - return int_ret; } typedef struct _Edje_File_Color_Class_Iterator Edje_File_Color_Class_Iterator; @@ -1057,6 +1080,13 @@ on_error: EAPI Eina_Bool edje_text_class_set(const char *text_class, const char *font, Evas_Font_Size size) { + return efl_gfx_text_class_set(_edje_global_obj, text_class, font, (Efl_Font_Size)size); +} + +EOLIAN Eina_Bool +_edje_global_efl_gfx_text_class_text_class_set(Eo *obj EINA_UNUSED, void *pd EINA_UNUSED, + const char *text_class, const char *font, Efl_Font_Size size) +{ Edje_Text_Class *tc; if (!text_class) return EINA_FALSE; @@ -1101,6 +1131,13 @@ edje_text_class_set(const char *text_class, const char *font, Evas_Font_Size siz EAPI Eina_Bool edje_text_class_get(const char *text_class, const char **font, Evas_Font_Size *size) { + return efl_gfx_text_class_get(_edje_global_obj, text_class, font, (Efl_Font_Size *)size); +} + +EOLIAN Eina_Bool +_edje_global_efl_gfx_text_class_text_class_get(Eo *obj EINA_UNUSED, void *pd EINA_UNUSED, + const char *text_class, const char **font, Efl_Font_Size *size) +{ Edje_Text_Class *tc; if (!text_class) return EINA_FALSE; @@ -1125,6 +1162,12 @@ edje_text_class_get(const char *text_class, const char **font, Evas_Font_Size *s EAPI void edje_text_class_del(const char *text_class) { + efl_gfx_text_class_del(_edje_global_obj, text_class); +} + +EOLIAN void +_edje_global_efl_gfx_text_class_text_class_del(Eo *obj EINA_UNUSED, void *pd EINA_UNUSED, const char *text_class) +{ Edje_Text_Class *tc; if (!text_class) return; @@ -1237,8 +1280,14 @@ _edje_text_class_list_foreach(const Eina_Hash *hash EINA_UNUSED, const void *key return EINA_TRUE; } +EAPI Eina_Bool +edje_object_text_class_set(Evas_Object *obj, const char *text_class, const char *font, Evas_Font_Size size) +{ + return efl_gfx_text_class_set(obj, text_class, font, (Efl_Font_Size)size); +} + EOLIAN Eina_Bool -_edje_object_text_class_set(Eo *obj EINA_UNUSED, Edje *ed, const char *text_class, const char *font, Evas_Font_Size size) +_edje_object_efl_gfx_text_class_text_class_set(Eo *obj EINA_UNUSED, Edje *ed, const char *text_class, const char *font, Efl_Font_Size size) { Edje_Text_Class *tc = NULL; unsigned short i; @@ -1292,8 +1341,8 @@ _edje_object_text_class_set(Eo *obj EINA_UNUSED, Edje *ed, const char *text_clas ((rp->type == EDJE_RP_TYPE_SWALLOW) && (rp->typedata.swallow)) && (rp->typedata.swallow->swallowed_object)) - edje_object_text_class_set(rp->typedata.swallow->swallowed_object, - text_class, font, size); + efl_gfx_text_class_set(rp->typedata.swallow->swallowed_object, + text_class, font, size); } efl_observer_update(obj, _edje_text_class_member, text_class, NULL); @@ -1301,8 +1350,14 @@ _edje_object_text_class_set(Eo *obj EINA_UNUSED, Edje *ed, const char *text_clas return EINA_TRUE; } +EAPI Eina_Bool +edje_object_text_class_get(const Evas_Object *obj, const char *text_class, const char **font, Evas_Font_Size *size) +{ + return efl_gfx_text_class_get(obj, text_class, font, (Efl_Font_Size *)size); +} + EOLIAN Eina_Bool -_edje_object_text_class_get(Eo *obj EINA_UNUSED, Edje *ed, const char *text_class, const char **font, Evas_Font_Size *size) +_edje_object_efl_gfx_text_class_text_class_get(Eo *obj EINA_UNUSED, Edje *ed, const char *text_class, const char **font, Efl_Font_Size *size) { Edje_Text_Class *tc = _edje_text_class_find(ed, text_class); @@ -1321,8 +1376,14 @@ _edje_object_text_class_get(Eo *obj EINA_UNUSED, Edje *ed, const char *text_clas return EINA_TRUE; } +EAPI void +edje_object_text_class_del(Evas_Object *obj, const char *text_class) +{ + efl_gfx_text_class_del(obj, text_class); +} + EOLIAN void -_edje_object_text_class_del(Eo *obj EINA_UNUSED, Edje *ed, const char *text_class) +_edje_object_efl_gfx_text_class_text_class_del(Eo *obj EINA_UNUSED, Edje *ed, const char *text_class) { Edje_Text_Class *tc = NULL; unsigned short i; @@ -1340,7 +1401,7 @@ _edje_object_text_class_del(Eo *obj EINA_UNUSED, Edje *ed, const char *text_clas ((rp->type == EDJE_RP_TYPE_SWALLOW) && (rp->typedata.swallow)) && (rp->typedata.swallow->swallowed_object)) - edje_object_text_class_del(rp->typedata.swallow->swallowed_object, text_class); + efl_gfx_text_class_del(rp->typedata.swallow->swallowed_object, text_class); } efl_observer_update(obj, _edje_text_class_member, text_class, NULL); @@ -1423,6 +1484,13 @@ on_error: EAPI Eina_Bool edje_size_class_set(const char *size_class, Evas_Coord minw, Evas_Coord minh, Evas_Coord maxw, Evas_Coord maxh) { + return efl_gfx_size_class_set(_edje_global_obj, size_class, minw, minh, maxw, maxh); +} + +EOLIAN Eina_Bool +_edje_global_efl_gfx_size_class_size_class_set(Eo *obj EINA_UNUSED, void *pd EINA_UNUSED, const char *size_class, + Evas_Coord minw, Evas_Coord minh, Evas_Coord maxw, Evas_Coord maxh) +{ Edje_Size_Class *sc; if (!size_class) return EINA_FALSE; @@ -1470,6 +1538,13 @@ edje_size_class_set(const char *size_class, Evas_Coord minw, Evas_Coord minh, Ev EAPI Eina_Bool edje_size_class_get(const char *size_class, Evas_Coord *minw, Evas_Coord *minh, Evas_Coord *maxw, Evas_Coord *maxh) { + return efl_gfx_size_class_get(_edje_global_obj, size_class, minw, minh, maxw, maxh); +} + +EOLIAN Eina_Bool +_edje_global_efl_gfx_size_class_size_class_get(Eo *obj EINA_UNUSED, void *pd EINA_UNUSED, const char *size_class, + Evas_Coord *minw, Evas_Coord *minh, Evas_Coord *maxw, Evas_Coord *maxh) +{ Edje_Size_Class *sc; if (!size_class) return EINA_FALSE; @@ -1498,6 +1573,12 @@ edje_size_class_get(const char *size_class, Evas_Coord *minw, Evas_Coord *minh, EAPI void edje_size_class_del(const char *size_class) { + efl_gfx_size_class_del(_edje_global_obj, size_class); +} + +EOLIAN void +_edje_global_efl_gfx_size_class_size_class_del(Eo *obj EINA_UNUSED, void *pd EINA_UNUSED, const char *size_class) +{ Edje_Size_Class *sc; if (!size_class) return; @@ -1609,8 +1690,14 @@ _edje_size_class_list_foreach(const Eina_Hash *hash EINA_UNUSED, const void *key return EINA_TRUE; } +EAPI Eina_Bool +edje_object_size_class_set(Evas_Object *obj, const char *size_class, Evas_Coord minw, Evas_Coord minh, Evas_Coord maxw, Evas_Coord maxh) +{ + return efl_gfx_size_class_set(obj, size_class, minw, minh, maxw, maxh); +} + EOLIAN Eina_Bool -_edje_object_size_class_set(Eo *obj EINA_UNUSED, Edje *ed, const char *size_class, Evas_Coord minw, Evas_Coord minh, Evas_Coord maxw, Evas_Coord maxh) +_edje_object_efl_gfx_size_class_size_class_set(Eo *obj EINA_UNUSED, Edje *ed, const char *size_class, Evas_Coord minw, Evas_Coord minh, Evas_Coord maxw, Evas_Coord maxh) { Edje_Size_Class *sc = NULL; unsigned short i; @@ -1662,8 +1749,8 @@ _edje_object_size_class_set(Eo *obj EINA_UNUSED, Edje *ed, const char *size_clas ((rp->type == EDJE_RP_TYPE_SWALLOW) && (rp->typedata.swallow)) && (rp->typedata.swallow->swallowed_object)) - edje_object_size_class_set(rp->typedata.swallow->swallowed_object, - size_class, minw, minh, maxw, maxh); + efl_gfx_size_class_set(rp->typedata.swallow->swallowed_object, + size_class, minw, minh, maxw, maxh); } efl_observable_observers_update(_edje_size_class_member, size_class, NULL); @@ -1671,8 +1758,14 @@ _edje_object_size_class_set(Eo *obj EINA_UNUSED, Edje *ed, const char *size_clas return EINA_TRUE; } +EAPI Eina_Bool +edje_object_size_class_get(const Evas_Object *obj, const char *size_class, Evas_Coord *minw, Evas_Coord *minh, Evas_Coord *maxw, Evas_Coord *maxh) +{ + return efl_gfx_size_class_get(obj, size_class, minw, minh, maxw, maxh); +} + EOLIAN Eina_Bool -_edje_object_size_class_get(Eo *obj EINA_UNUSED, Edje *ed, const char *size_class, Evas_Coord *minw, Evas_Coord *minh, Evas_Coord *maxw, Evas_Coord *maxh) +_edje_object_efl_gfx_size_class_size_class_get(Eo *obj EINA_UNUSED, Edje *ed, const char *size_class, Evas_Coord *minw, Evas_Coord *minh, Evas_Coord *maxw, Evas_Coord *maxh) { Edje_Size_Class *sc = _edje_size_class_find(ed, size_class); @@ -1695,8 +1788,14 @@ _edje_object_size_class_get(Eo *obj EINA_UNUSED, Edje *ed, const char *size_clas return EINA_TRUE; } +EAPI void +edje_object_size_class_del(Evas_Object *obj, const char *size_class) +{ + efl_gfx_size_class_del(obj, size_class); +} + EOLIAN void -_edje_object_size_class_del(Eo *obj EINA_UNUSED, Edje *ed, const char *size_class) +_edje_object_efl_gfx_size_class_size_class_del(Eo *obj EINA_UNUSED, Edje *ed, const char *size_class) { Edje_Size_Class *sc = NULL; unsigned short i; @@ -1714,7 +1813,7 @@ _edje_object_size_class_del(Eo *obj EINA_UNUSED, Edje *ed, const char *size_clas ((rp->type == EDJE_RP_TYPE_SWALLOW) && (rp->typedata.swallow)) && (rp->typedata.swallow->swallowed_object)) - edje_object_size_class_del(rp->typedata.swallow->swallowed_object, size_class); + efl_gfx_size_class_del(rp->typedata.swallow->swallowed_object, size_class); } efl_observable_observers_update(_edje_size_class_member, size_class, NULL); diff --git a/src/lib/efl/Efl.h b/src/lib/efl/Efl.h index e4c76495fe..32b43717b5 100644 --- a/src/lib/efl/Efl.h +++ b/src/lib/efl/Efl.h @@ -124,6 +124,9 @@ typedef Efl_Gfx_Path_Command_Type Efl_Gfx_Path_Command; #include "interfaces/efl_gfx_gradient_radial.eo.h" #include "interfaces/efl_gfx_filter.eo.h" #include "interfaces/efl_gfx_size_hint.eo.h" +#include "interfaces/efl_gfx_color_class.eo.h" +#include "interfaces/efl_gfx_text_class.eo.h" +#include "interfaces/efl_gfx_size_class.eo.h" /* Input events */ #include "interfaces/efl_input_types.eot.h" diff --git a/src/lib/efl/interfaces/efl_gfx_color_class.eo b/src/lib/efl/interfaces/efl_gfx_color_class.eo new file mode 100644 index 0000000000..0f9b89badc --- /dev/null +++ b/src/lib/efl/interfaces/efl_gfx_color_class.eo @@ -0,0 +1,85 @@ +import efl_gfx_types; + +interface Efl.Gfx.Color_Class +{ + methods { + @property color_class { + set { + [[Set the color 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 \@p a.]] + return: bool; + } + get { + [[Get the color 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). + + Note: These color values are expected to be premultiplied by \@p a.]] + return: bool; + } + keys { + color_class: string; [[The name of color class]] + layer: Efl.Gfx.Color_Class.Layer @optional; [[The layer to set the color]] + } + values { + r: int; [[The intensity of the red color]] + g: int; [[The intensity of the green color]] + b: int; [[The intensity of the blue color]] + a: int; [[The alpha value]] + } + } + @property color_class_description { + get { + [[Get the description of a color class. + + This function gets the description of a color class in use by an object.]] + } + keys { + color_class: string; [[The name of color class]] + } + values { + description: string; [[The description of the target color class or $null if not found]] + } + } + color_class_del { + [[Delete the color class. + + This function deletes any values for the specified color class. + + Deleting the color class will revert it to the values defined + by @.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.]] + params { + @in color_class: string; [[The name of color_class]] + } + } + color_class_clear { + [[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. + + @since 1.17.0]] + } + } +} diff --git a/src/lib/efl/interfaces/efl_gfx_size_class.eo b/src/lib/efl/interfaces/efl_gfx_size_class.eo new file mode 100644 index 0000000000..1fa3dad5da --- /dev/null +++ b/src/lib/efl/interfaces/efl_gfx_size_class.eo @@ -0,0 +1,49 @@ +interface Efl.Gfx.Size_Class +{ + methods { + @property size_class { + set { + [[Set width and height of size class. + + This function sets width and height for a size class. + This will make all edje parts in the specified object that have + the specified size class update their size with given values. + + @since 1.17]] + return: bool; [[$true, on success or $false, on error]] + } + get { + [[Get width and height of size class. + + This function gets width and height for a size class. + These values will only be valid until the size class is changed + or the edje object is deleted. + + @since 1.17]] + return: bool; [[$true, on success or $false, on error]] + } + keys { + size_class: string; [[The name of size class]] + } + values { + minw: int; [[minimum width]] + minh: int; [[minimum height]] + maxw: int; [[maximum width]] + maxh: int; [[maximum height]] + } + } + size_class_del { + [[Delete the size class. + + This function deletes any values for the specified size class. + + Deleting the size class will revert it to the values defined + by @.size_class.set() or the size class defined in the theme file. + + @since 1.17]] + params { + @in size_class: string; [[The size class to be deleted.]] + } + } + } +} diff --git a/src/lib/efl/interfaces/efl_gfx_text_class.eo b/src/lib/efl/interfaces/efl_gfx_text_class.eo new file mode 100644 index 0000000000..481202403d --- /dev/null +++ b/src/lib/efl/interfaces/efl_gfx_text_class.eo @@ -0,0 +1,43 @@ +import efl_gfx_types; + +interface Efl.Gfx.Text_Class +{ + methods { + @property text_class { + set { + [[Set Edje text class. + + This function sets the text class for the Edje.]] + return: bool; [[$true, on success or $false, on error]] + } + get { + [[Get font and font size from edje text class. + + This function gets the font and the font size from text class. + The font string will only be valid until the text class is changed + or the edje object is deleted.]] + return: bool; [[$true, on success or $false, on error]] + } + keys { + text_class: string; [[The text class name]] + } + values { + font: string; [[Font name]] + size: Efl.Font.Size; [[Font Size]] + } + } + text_class_del { + [[Delete the text class. + + This function deletes any values for the specified text class. + + Deleting the text class will revert it to the values defined + by @.text_class.set() or the text class defined in the theme file. + + @since 1.17]] + params { + @in text_class: string; [[The text class to be deleted.]] + } + } + } +} diff --git a/src/lib/efl/interfaces/efl_gfx_types.eot b/src/lib/efl/interfaces/efl_gfx_types.eot index 1250d43130..58ccdfca49 100644 --- a/src/lib/efl/interfaces/efl_gfx_types.eot +++ b/src/lib/efl/interfaces/efl_gfx_types.eot @@ -196,3 +196,11 @@ enum Efl.Image.Load.Error unknown_collection = 9, [[(Edje only) The group/collection set to load from was not found in the file]] recursive_reference = 10 [[(Edje only) The group/collection set to load from had recursive references on its components]] } + +enum Efl.Gfx.Color_Class.Layer { + normal = 0, [[Default color]] + outline, [[Outline color]] + shadow [[Shadow color]] +} + +type Efl.Font.Size: int; [[Efl font size type]] diff --git a/src/lib/efl/interfaces/efl_interfaces_main.c b/src/lib/efl/interfaces/efl_interfaces_main.c index 778108e699..30769e6433 100644 --- a/src/lib/efl/interfaces/efl_interfaces_main.c +++ b/src/lib/efl/interfaces/efl_interfaces_main.c @@ -26,6 +26,10 @@ #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" + #include "interfaces/efl_gfx_gradient.eo.c" #include "interfaces/efl_gfx_gradient_linear.eo.c" #include "interfaces/efl_gfx_gradient_radial.eo.c" diff --git a/src/lib/efl/interfaces/efl_text_properties.eo b/src/lib/efl/interfaces/efl_text_properties.eo index 3383fa444f..1d755761ed 100644 --- a/src/lib/efl/interfaces/efl_text_properties.eo +++ b/src/lib/efl/interfaces/efl_text_properties.eo @@ -1,4 +1,4 @@ -type Efl_Font_Size: int; [[Efl font size type]] +import efl_gfx_types; interface Efl.Text.Properties { @@ -31,7 +31,7 @@ interface Efl.Text.Properties } values { font: string; [[The font family name or filename.]] - size: Efl_Font_Size; [[The font size, in points.]] + size: Efl.Font.Size; [[The font size, in points.]] } } @property font_source { |