summaryrefslogtreecommitdiff
path: root/src/lib/evas
diff options
context:
space:
mode:
authorAbdullehGhujeh <a.ghujeh@samsung.com>2020-08-18 18:10:04 +0900
committerWooHyun Jung <wh0705.jung@samsung.com>2020-08-18 18:10:04 +0900
commiteb0f7183ddfdaa83b12e2cc0c7ee4b29f54b5a3e (patch)
tree3dbf654561c94e2967e7a4285bc6e5492dd0a4ef /src/lib/evas
parent4ad272a8c3183790a65b7f2c0ccfb57b4688219a (diff)
Efl Canvas Text : canvas textblock changed not fired for shadow format (style_apply)
Summary: If shadow format changed using style_apply , the event EFL_CANVAS_TEXTBLOCK_EVENT_CHANGED will not be fired. also added tests for it. Reviewers: ali.alzyod, woohyun Reviewed By: ali.alzyod Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D11078
Diffstat (limited to 'src/lib/evas')
-rw-r--r--src/lib/evas/canvas/evas_object_textblock.c27
1 files changed, 21 insertions, 6 deletions
diff --git a/src/lib/evas/canvas/evas_object_textblock.c b/src/lib/evas/canvas/evas_object_textblock.c
index f8ddf1cee6..7a4a37134c 100644
--- a/src/lib/evas/canvas/evas_object_textblock.c
+++ b/src/lib/evas/canvas/evas_object_textblock.c
@@ -1489,11 +1489,15 @@ _style_string_split(const char *str, char* part1, char* part2)
1489 *temp = 0; 1489 *temp = 0;
1490} 1490}
1491 1491
1492#define FORMAT_SHADOW_SET(evas, efl) {fmt->style = evas; if (set_default) _FMT_INFO(effect) = efl;} 1492#define FORMAT_SHADOW_SET(evas, efl) { \
1493 if (fmt->style != evas) { fmt->style = evas; changed = EINA_TRUE; } \
1494 if (set_default && (_FMT_INFO(effect) != efl)) {_FMT_INFO(effect) = efl; changed = EINA_TRUE;}}
1493 1495
1494void 1496Eina_Bool
1495_format_shadow_set(Evas_Object_Textblock_Format *fmt, char *str, Eina_Bool set_default, Efl_Canvas_Textblock_Data *o) 1497_format_shadow_set(Evas_Object_Textblock_Format *fmt, char *str, Eina_Bool set_default, Efl_Canvas_Textblock_Data *o)
1496{ 1498{
1499 Eina_Bool changed = EINA_FALSE;
1500
1497 if (!strcmp(str, "shadow")) 1501 if (!strcmp(str, "shadow"))
1498 FORMAT_SHADOW_SET(EVAS_TEXT_STYLE_SHADOW, EFL_TEXT_STYLE_EFFECT_TYPE_SHADOW) 1502 FORMAT_SHADOW_SET(EVAS_TEXT_STYLE_SHADOW, EFL_TEXT_STYLE_EFFECT_TYPE_SHADOW)
1499 else if (!strcmp(str, "outline")) 1503 else if (!strcmp(str, "outline"))
@@ -1514,13 +1518,22 @@ _format_shadow_set(Evas_Object_Textblock_Format *fmt, char *str, Eina_Bool set_d
1514 FORMAT_SHADOW_SET(EVAS_TEXT_STYLE_FAR_SOFT_SHADOW, EFL_TEXT_STYLE_EFFECT_TYPE_FAR_SOFT_SHADOW) 1518 FORMAT_SHADOW_SET(EVAS_TEXT_STYLE_FAR_SOFT_SHADOW, EFL_TEXT_STYLE_EFFECT_TYPE_FAR_SOFT_SHADOW)
1515 else /*off none plain */ 1519 else /*off none plain */
1516 FORMAT_SHADOW_SET(EVAS_TEXT_STYLE_PLAIN, EFL_TEXT_STYLE_EFFECT_TYPE_NONE) 1520 FORMAT_SHADOW_SET(EVAS_TEXT_STYLE_PLAIN, EFL_TEXT_STYLE_EFFECT_TYPE_NONE)
1521
1522 return changed;
1517} 1523}
1518 1524
1519#define FORMAT_SHADOW_DIRECTION_SET(direction) {EVAS_TEXT_STYLE_SHADOW_DIRECTION_SET(fmt->style, EVAS_TEXT_STYLE_SHADOW_DIRECTION_##direction); if (set_default) _FMT_INFO(shadow_direction) = EFL_TEXT_STYLE_SHADOW_DIRECTION_##direction;} 1525#define FORMAT_SHADOW_DIRECTION_SET(direction) { \
1526 unsigned char temp = fmt->style; \
1527 EVAS_TEXT_STYLE_SHADOW_DIRECTION_SET(fmt->style, EVAS_TEXT_STYLE_SHADOW_DIRECTION_##direction); \
1528 changed = (fmt->style != temp); \
1529 if (set_default && (_FMT_INFO(shadow_direction) != EFL_TEXT_STYLE_SHADOW_DIRECTION_##direction)) \
1530 {_FMT_INFO(shadow_direction) = EFL_TEXT_STYLE_SHADOW_DIRECTION_##direction; changed = EINA_TRUE;}}
1520 1531
1521void 1532Eina_Bool
1522_format_shadow_direction_set(Evas_Object_Textblock_Format *fmt, char *str, Eina_Bool set_default, Efl_Canvas_Textblock_Data *o) 1533_format_shadow_direction_set(Evas_Object_Textblock_Format *fmt, char *str, Eina_Bool set_default, Efl_Canvas_Textblock_Data *o)
1523{ 1534{
1535 Eina_Bool changed = EINA_FALSE;
1536
1524 if (!strcmp(str, "bottom_right")) 1537 if (!strcmp(str, "bottom_right"))
1525 FORMAT_SHADOW_DIRECTION_SET(BOTTOM_RIGHT) 1538 FORMAT_SHADOW_DIRECTION_SET(BOTTOM_RIGHT)
1526 else if (!strcmp(str, "bottom")) 1539 else if (!strcmp(str, "bottom"))
@@ -1539,6 +1552,8 @@ _format_shadow_direction_set(Evas_Object_Textblock_Format *fmt, char *str, Eina_
1539 FORMAT_SHADOW_DIRECTION_SET(RIGHT) 1552 FORMAT_SHADOW_DIRECTION_SET(RIGHT)
1540 else 1553 else
1541 FORMAT_SHADOW_DIRECTION_SET(BOTTOM_RIGHT) 1554 FORMAT_SHADOW_DIRECTION_SET(BOTTOM_RIGHT)
1555
1556 return changed;
1542} 1557}
1543 1558
1544/** 1559/**
@@ -3169,10 +3184,10 @@ _default_format_command(Evas_Object *eo_obj, Evas_Object_Textblock_Format *fmt,
3169 *part2 = 0; 3184 *part2 = 0;
3170 3185
3171 _style_string_split(param, part1, part2); 3186 _style_string_split(param, part1, part2);
3172 _format_shadow_set(fmt, part1, EINA_TRUE, o); 3187 changed = _format_shadow_set(fmt, part1, EINA_TRUE, o);
3173 3188
3174 if (*part2) 3189 if (*part2)
3175 _format_shadow_direction_set(fmt, part2, EINA_TRUE, o); 3190 changed = _format_shadow_direction_set(fmt, part2, EINA_TRUE, o) || changed;
3176 } 3191 }
3177 else 3192 else
3178 { 3193 {