summaryrefslogtreecommitdiff
path: root/src/lib/edje
diff options
context:
space:
mode:
authorWoochanlee <wc0917.lee@samsung.com>2019-11-26 13:57:16 +0900
committerHermet Park <hermetpark@gmail.com>2019-11-26 13:57:16 +0900
commit4ebbe0ad0444f31a6c58ec37e9fcdf6dde31fd8b (patch)
treedd0ba2cac89b7fb299e9ce68d9ad315373928dd4 /src/lib/edje
parent256c79283797f9540e2834542e5e49ecb38c8238 (diff)
edje_calc: Creation macro that perform edje calc, regardless of the edje size.
Summary: edje_recalc_do() needs to be executed regardless of the size of edje in order to deliver edje properties for the API that the user calls. Reviewers: cedric, Hermet, Jaehyun_Cho, smohanty Reviewed By: Hermet Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D10724
Diffstat (limited to '')
-rw-r--r--src/lib/edje/edje_calc.c33
-rw-r--r--src/lib/edje/edje_util.c22
2 files changed, 20 insertions, 35 deletions
diff --git a/src/lib/edje/edje_calc.c b/src/lib/edje/edje_calc.c
index 5e1ce0bcae..cadadb5f72 100644
--- a/src/lib/edje/edje_calc.c
+++ b/src/lib/edje/edje_calc.c
@@ -1003,30 +1003,6 @@ _edje_recalc_table_parts(Edje *ed
1003#endif 1003#endif
1004} 1004}
1005 1005
1006// Defined in edje_textblock.c
1007Eina_Bool
1008_edje_part_textblock_style_text_set(Edje *ed,
1009 Edje_Real_Part *ep,
1010 Edje_Part_Description_Text *chosen_desc);
1011
1012void
1013_edje_recalc_textblock_style_text_set(Edje *ed)
1014{
1015 unsigned short i;
1016 Edje_Real_Part *ep;
1017
1018 for (i = 0; i < ed->table_parts_size; i++)
1019 {
1020 ep = ed->table_parts[i];
1021
1022 if (ep->part->type == EDJE_PART_TYPE_TEXTBLOCK)
1023 {
1024 _edje_part_textblock_style_text_set
1025 (ed, ep, (Edje_Part_Description_Text *)ep->chosen_description);
1026 }
1027 }
1028}
1029
1030void 1006void
1031_edje_recalc_do(Edje *ed) 1007_edje_recalc_do(Edje *ed)
1032{ 1008{
@@ -1037,14 +1013,9 @@ _edje_recalc_do(Edje *ed)
1037#endif 1013#endif
1038 1014
1039 1015
1040 //Do nothing if the edje has no size, Regardless of the edje part size calc, 1016 //Do nothing if the edje has no size,
1041 //the text and style has to be set.
1042 if ((EINA_UNLIKELY(!ed->has_size)) && (!ed->calc_only) && (ed->w == 0) && (ed->h == 0)) 1017 if ((EINA_UNLIKELY(!ed->has_size)) && (!ed->calc_only) && (ed->w == 0) && (ed->h == 0))
1043 { 1018 return;
1044 _edje_recalc_textblock_style_text_set(ed);
1045
1046 return;
1047 }
1048 ed->has_size = EINA_TRUE; 1019 ed->has_size = EINA_TRUE;
1049 1020
1050 need_calc = evas_object_smart_need_recalculate_get(ed->obj); 1021 need_calc = evas_object_smart_need_recalculate_get(ed->obj);
diff --git a/src/lib/edje/edje_util.c b/src/lib/edje/edje_util.c
index 38de6f3c3f..2acfce3282 100644
--- a/src/lib/edje/edje_util.c
+++ b/src/lib/edje/edje_util.c
@@ -4,6 +4,20 @@
4#include "../evas/canvas/evas_line_eo.h" 4#include "../evas/canvas/evas_line_eo.h"
5#include "../evas/canvas/evas_text_eo.h" 5#include "../evas/canvas/evas_text_eo.h"
6 6
7//In implementations that gets properties for user-created edje,
8//edje calculation should be performed regardless of the size of edje.
9#define EDJE_RECALC_DO(ed) \
10 do { \
11 Eina_Bool calc_flag = EINA_FALSE; \
12 if (!ed->has_size) \
13 { \
14 ed->has_size = EINA_TRUE; \
15 calc_flag = EINA_TRUE; \
16 } \
17 _edje_recalc_do(ed); \
18 if (calc_flag) ed->has_size = EINA_FALSE; \
19 } while (0)
20
7typedef struct _Edje_Box_Layout Edje_Box_Layout; 21typedef struct _Edje_Box_Layout Edje_Box_Layout;
8struct _Edje_Box_Layout 22struct _Edje_Box_Layout
9{ 23{
@@ -1945,7 +1959,7 @@ edje_object_part_object_get(const Eo *obj, const char *part)
1945 if ((!ed) || (!part)) return NULL; 1959 if ((!ed) || (!part)) return NULL;
1946 1960
1947 /* Need to recalc before providing the object. */ 1961 /* Need to recalc before providing the object. */
1948 if (!ed->freeze) _edje_recalc_do(ed); 1962 if (!ed->freeze) EDJE_RECALC_DO(ed);
1949 1963
1950 rp = _edje_real_part_recursive_get(&ed, part); 1964 rp = _edje_real_part_recursive_get(&ed, part);
1951 if (!rp) return NULL; 1965 if (!rp) return NULL;
@@ -2187,7 +2201,7 @@ _edje_efl_text_text_get(const Eo *obj EINA_UNUSED, Edje *ed, const char *part,
2187#else 2201#else
2188 if (ed->dirty) 2202 if (ed->dirty)
2189#endif 2203#endif
2190 _edje_recalc_do(ed); 2204 EDJE_RECALC_DO(ed);
2191 entry = evas_object_textblock_text_markup_get(rp->object); 2205 entry = evas_object_textblock_text_markup_get(rp->object);
2192 } 2206 }
2193 } 2207 }
@@ -2200,7 +2214,7 @@ _edje_efl_text_text_get(const Eo *obj EINA_UNUSED, Edje *ed, const char *part,
2200#else 2214#else
2201 if (ed->dirty) 2215 if (ed->dirty)
2202#endif 2216#endif
2203 _edje_recalc_do(ed); 2217 EDJE_RECALC_DO(ed);
2204 entry = efl_text_markup_get(rp->object); 2218 entry = efl_text_markup_get(rp->object);
2205 } 2219 }
2206 else 2220 else
@@ -3580,7 +3594,7 @@ _efl_canvas_layout_efl_layout_group_group_size_max_get(const Eo *obj EINA_UNUSED
3580 return EINA_SIZE2D(0, 0); 3594 return EINA_SIZE2D(0, 0);
3581 3595
3582 /* Need to recalc before providing the object. */ 3596 /* Need to recalc before providing the object. */
3583 if (!ed->freeze) _edje_recalc_do(ed); 3597 if (!ed->freeze) EDJE_RECALC_DO(ed);
3584 3598
3585 sz = ed->collection->prop.max; 3599 sz = ed->collection->prop.max;
3586 3600