summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaeun Choi <jaeun12.choi@samsung.com>2019-03-29 19:48:58 +0900
committerJaeun Choi <jaeun12.choi@samsung.com>2019-03-29 20:14:09 +0900
commit74c48f029632d2260816b4cb3de6dbb40a29f040 (patch)
tree3a58c5c3760552141dd6b473550e61ddf178062d
parent0b2cf57bbc9b067201a3e8b8b506b456e80c2e84 (diff)
efl_ui_pager: implement unpack_all/clear function
-rw-r--r--src/lib/elementary/efl_page_indicator.c13
-rw-r--r--src/lib/elementary/efl_page_indicator_icon.c20
-rw-r--r--src/lib/elementary/efl_page_transition.c11
-rw-r--r--src/lib/elementary/efl_page_transition_scroll.c20
-rw-r--r--src/lib/elementary/efl_ui_pager.c51
-rw-r--r--src/lib/elementary/elm_priv.h2
6 files changed, 109 insertions, 8 deletions
diff --git a/src/lib/elementary/efl_page_indicator.c b/src/lib/elementary/efl_page_indicator.c
index 57cd2bf9f9..6b0be267b2 100644
--- a/src/lib/elementary/efl_page_indicator.c
+++ b/src/lib/elementary/efl_page_indicator.c
@@ -43,6 +43,14 @@ _efl_page_indicator_unpack(Eo *obj EINA_UNUSED,
43} 43}
44 44
45EOLIAN static void 45EOLIAN static void
46_efl_page_indicator_unpack_all(Eo *obj EINA_UNUSED,
47 Efl_Page_Indicator_Data *pd)
48{
49 pd->cnt = 0;
50 pd->curr_idx = -1;
51}
52
53EOLIAN static void
46_efl_page_indicator_bind(Eo *obj EINA_UNUSED, 54_efl_page_indicator_bind(Eo *obj EINA_UNUSED,
47 Efl_Page_Indicator_Data *pd, 55 Efl_Page_Indicator_Data *pd,
48 Eo *pager, 56 Eo *pager,
@@ -72,6 +80,7 @@ EOAPI EFL_VOID_FUNC_BODYV(efl_page_indicator_pack,
72 EFL_FUNC_CALL(index), int index) 80 EFL_FUNC_CALL(index), int index)
73EOAPI EFL_VOID_FUNC_BODYV(efl_page_indicator_unpack, 81EOAPI EFL_VOID_FUNC_BODYV(efl_page_indicator_unpack,
74 EFL_FUNC_CALL(index), int index) 82 EFL_FUNC_CALL(index), int index)
83EOAPI EFL_VOID_FUNC_BODY(efl_page_indicator_unpack_all)
75 84
76#define EFL_PAGE_INDICATOR_EXTRA_OPS \ 85#define EFL_PAGE_INDICATOR_EXTRA_OPS \
77 EFL_OBJECT_OP_FUNC(efl_page_indicator_update, \ 86 EFL_OBJECT_OP_FUNC(efl_page_indicator_update, \
@@ -79,6 +88,8 @@ EOAPI EFL_VOID_FUNC_BODYV(efl_page_indicator_unpack,
79 EFL_OBJECT_OP_FUNC(efl_page_indicator_pack, \ 88 EFL_OBJECT_OP_FUNC(efl_page_indicator_pack, \
80 _efl_page_indicator_pack), \ 89 _efl_page_indicator_pack), \
81 EFL_OBJECT_OP_FUNC(efl_page_indicator_unpack, \ 90 EFL_OBJECT_OP_FUNC(efl_page_indicator_unpack, \
82 _efl_page_indicator_unpack) 91 _efl_page_indicator_unpack), \
92 EFL_OBJECT_OP_FUNC(efl_page_indicator_unpack_all, \
93 _efl_page_indicator_unpack_all)
83 94
84#include "efl_page_indicator.eo.c" 95#include "efl_page_indicator.eo.c"
diff --git a/src/lib/elementary/efl_page_indicator_icon.c b/src/lib/elementary/efl_page_indicator_icon.c
index 3c9c54e75e..55326cfdd6 100644
--- a/src/lib/elementary/efl_page_indicator_icon.c
+++ b/src/lib/elementary/efl_page_indicator_icon.c
@@ -110,6 +110,22 @@ _efl_page_indicator_icon_unpack(Eo *obj,
110} 110}
111 111
112EOLIAN static void 112EOLIAN static void
113_efl_page_indicator_icon_unpack_all(Eo *obj,
114 Efl_Page_Indicator_Icon_Data *pd)
115{
116 Eo *item;
117
118 EINA_LIST_FREE(pd->items, item)
119 {
120 efl_del(item);
121 }
122
123 pd->curr = NULL;
124
125 efl_page_indicator_unpack_all(efl_super(obj, MY_CLASS));
126}
127
128EOLIAN static void
113_efl_page_indicator_icon_efl_page_indicator_bind(Eo *obj, 129_efl_page_indicator_icon_efl_page_indicator_bind(Eo *obj,
114 Efl_Page_Indicator_Icon_Data *pd, 130 Efl_Page_Indicator_Icon_Data *pd,
115 Eo *pager, 131 Eo *pager,
@@ -168,6 +184,8 @@ _efl_page_indicator_icon_efl_page_indicator_bind(Eo *obj,
168 EFL_OBJECT_OP_FUNC(efl_page_indicator_pack, \ 184 EFL_OBJECT_OP_FUNC(efl_page_indicator_pack, \
169 _efl_page_indicator_icon_pack), \ 185 _efl_page_indicator_icon_pack), \
170 EFL_OBJECT_OP_FUNC(efl_page_indicator_unpack, \ 186 EFL_OBJECT_OP_FUNC(efl_page_indicator_unpack, \
171 _efl_page_indicator_icon_unpack) 187 _efl_page_indicator_icon_unpack), \
188 EFL_OBJECT_OP_FUNC(efl_page_indicator_unpack_all, \
189 _efl_page_indicator_icon_unpack_all)
172 190
173#include "efl_page_indicator_icon.eo.c" 191#include "efl_page_indicator_icon.eo.c"
diff --git a/src/lib/elementary/efl_page_transition.c b/src/lib/elementary/efl_page_transition.c
index 3740a6996d..f6d73a2c10 100644
--- a/src/lib/elementary/efl_page_transition.c
+++ b/src/lib/elementary/efl_page_transition.c
@@ -72,6 +72,14 @@ _efl_page_transition_pack(Eo *obj EINA_UNUSED,
72} 72}
73 73
74EOLIAN static void 74EOLIAN static void
75_efl_page_transition_unpack_all(Eo *obj EINA_UNUSED,
76 Efl_Page_Transition_Data *pd EINA_UNUSED,
77 int index EINA_UNUSED)
78{
79
80}
81
82EOLIAN static void
75_efl_page_transition_curr_page_change(Eo *obj EINA_UNUSED, 83_efl_page_transition_curr_page_change(Eo *obj EINA_UNUSED,
76 Efl_Page_Transition_Data *pd EINA_UNUSED, 84 Efl_Page_Transition_Data *pd EINA_UNUSED,
77 int diff EINA_UNUSED) 85 int diff EINA_UNUSED)
@@ -94,6 +102,7 @@ EOAPI EFL_VOID_FUNC_BODYV(efl_page_transition_update,
94 EFL_FUNC_CALL(move), double move) 102 EFL_FUNC_CALL(move), double move)
95EOAPI EFL_VOID_FUNC_BODYV(efl_page_transition_pack, 103EOAPI EFL_VOID_FUNC_BODYV(efl_page_transition_pack,
96 EFL_FUNC_CALL(index), int index) 104 EFL_FUNC_CALL(index), int index)
105EOAPI EFL_VOID_FUNC_BODY(efl_page_transition_unpack_all)
97EOAPI EFL_VOID_FUNC_BODYV(efl_page_transition_curr_page_change, 106EOAPI EFL_VOID_FUNC_BODYV(efl_page_transition_curr_page_change,
98 EFL_FUNC_CALL(diff), int diff) 107 EFL_FUNC_CALL(diff), int diff)
99EOAPI EFL_VOID_FUNC_BODYV(efl_page_transition_page_size_set, 108EOAPI EFL_VOID_FUNC_BODYV(efl_page_transition_page_size_set,
@@ -109,6 +118,8 @@ EOAPI EFL_FUNC_BODYV(efl_page_transition_loop_set, Eina_Bool, 0,
109 _efl_page_transition_update), \ 118 _efl_page_transition_update), \
110 EFL_OBJECT_OP_FUNC(efl_page_transition_pack, \ 119 EFL_OBJECT_OP_FUNC(efl_page_transition_pack, \
111 _efl_page_transition_pack), \ 120 _efl_page_transition_pack), \
121 EFL_OBJECT_OP_FUNC(efl_page_transition_unpack_all, \
122 _efl_page_transition_unpack_all), \
112 EFL_OBJECT_OP_FUNC(efl_page_transition_curr_page_change, \ 123 EFL_OBJECT_OP_FUNC(efl_page_transition_curr_page_change, \
113 _efl_page_transition_curr_page_change), \ 124 _efl_page_transition_curr_page_change), \
114 EFL_OBJECT_OP_FUNC(efl_page_transition_page_size_set, \ 125 EFL_OBJECT_OP_FUNC(efl_page_transition_page_size_set, \
diff --git a/src/lib/elementary/efl_page_transition_scroll.c b/src/lib/elementary/efl_page_transition_scroll.c
index 5c5cb9aa11..ac3c6dab1d 100644
--- a/src/lib/elementary/efl_page_transition_scroll.c
+++ b/src/lib/elementary/efl_page_transition_scroll.c
@@ -413,6 +413,24 @@ _efl_page_transition_scroll_pack(Eo *obj,
413} 413}
414 414
415EOLIAN static void 415EOLIAN static void
416_efl_page_transition_scroll_unpack_all(Eo *obj EINA_UNUSED,
417 Efl_Page_Transition_Scroll_Data *pd)
418{
419 Eina_List *list;
420 Page_Info *pi;
421
422 EINA_LIST_FOREACH(pd->page_infos, list, pi)
423 {
424 efl_pack_unpack(pi->obj, pi->content);
425
426 pi->content_num = -1;
427 pi->content = NULL;
428 pi->visible = EINA_FALSE;
429 }
430 return EINA_TRUE;
431}
432
433EOLIAN static void
416_efl_page_transition_scroll_curr_page_change(Eo *obj EINA_UNUSED, 434_efl_page_transition_scroll_curr_page_change(Eo *obj EINA_UNUSED,
417 Efl_Page_Transition_Scroll_Data *pd, 435 Efl_Page_Transition_Scroll_Data *pd,
418 int diff) 436 int diff)
@@ -656,6 +674,8 @@ _efl_page_transition_scroll_efl_object_invalidate(Eo *obj,
656 _efl_page_transition_scroll_update), \ 674 _efl_page_transition_scroll_update), \
657 EFL_OBJECT_OP_FUNC(efl_page_transition_pack, \ 675 EFL_OBJECT_OP_FUNC(efl_page_transition_pack, \
658 _efl_page_transition_scroll_pack), \ 676 _efl_page_transition_scroll_pack), \
677 EFL_OBJECT_OP_FUNC(efl_page_transition_unpack_all, \
678 _efl_page_transition_scroll_unpack_all), \
659 EFL_OBJECT_OP_FUNC(efl_page_transition_curr_page_change, \ 679 EFL_OBJECT_OP_FUNC(efl_page_transition_curr_page_change, \
660 _efl_page_transition_scroll_curr_page_change), \ 680 _efl_page_transition_scroll_curr_page_change), \
661 EFL_OBJECT_OP_FUNC(efl_page_transition_page_size_set, \ 681 EFL_OBJECT_OP_FUNC(efl_page_transition_page_size_set, \
diff --git a/src/lib/elementary/efl_ui_pager.c b/src/lib/elementary/efl_ui_pager.c
index 520398941c..0ce1488d8c 100644
--- a/src/lib/elementary/efl_ui_pager.c
+++ b/src/lib/elementary/efl_ui_pager.c
@@ -784,20 +784,59 @@ _efl_ui_pager_loop_mode_get(const Eo *obj EINA_UNUSED,
784 return pd->loop; 784 return pd->loop;
785} 785}
786 786
787static void
788_unpack_all(Efl_Ui_Pager_Data *pd,
789 Eina_Bool clear)
790{
791 Eo *subobj;
792
793 pd->cnt = 0;
794 pd->curr.page = -1;
795 pd->curr.pos = 0.0;
796
797 if (pd->transition)
798 {
799 efl_page_transition_unpack_all(pd->transition);
800 }
801 else
802 {
803 subobj = eina_list_nth(pd->content_list, pd->curr.page);
804 efl_pack_unpack(pd->page_box, subobj);
805 }
806
807 if (clear)
808 {
809 EINA_LIST_FREE(pd->content_list, subobj)
810 evas_object_del(subobj);
811 }
812 else
813 {
814 EINA_LIST_FREE(pd->content_list, subobj)
815 efl_canvas_object_clipper_set(subobj, NULL);
816 }
817
818 if (pd->indicator)
819 {
820 efl_page_indicator_unpack_all(pd->indicator);
821 }
822}
823
787EOLIAN static Eina_Bool 824EOLIAN static Eina_Bool
788_efl_ui_pager_efl_pack_pack_clear(Eo *obj EINA_UNUSED, 825_efl_ui_pager_efl_pack_pack_clear(Eo *obj EINA_UNUSED,
789 Efl_Ui_Pager_Data *pd EINA_UNUSED) 826 Efl_Ui_Pager_Data *pd)
790{ 827{
791 ERR("Soon to be implemented"); 828 _unpack_all(pd, EINA_TRUE);
792 return EINA_FALSE; 829
830 return EINA_TRUE;
793} 831}
794 832
795EOLIAN static Eina_Bool 833EOLIAN static Eina_Bool
796_efl_ui_pager_efl_pack_unpack_all(Eo *obj EINA_UNUSED, 834_efl_ui_pager_efl_pack_unpack_all(Eo *obj EINA_UNUSED,
797 Efl_Ui_Pager_Data *pd EINA_UNUSED) 835 Efl_Ui_Pager_Data *pd)
798{ 836{
799 ERR("Soon to be implemented"); 837 _unpack_all(pd, EINA_FALSE);
800 return EINA_FALSE; 838
839 return EINA_TRUE;
801} 840}
802 841
803static void 842static void
diff --git a/src/lib/elementary/elm_priv.h b/src/lib/elementary/elm_priv.h
index 54c32cf9a6..a1bd8be552 100644
--- a/src/lib/elementary/elm_priv.h
+++ b/src/lib/elementary/elm_priv.h
@@ -875,12 +875,14 @@ EOAPI void efl_page_transition_page_size_set(Eo *obj, Eina_Size2D sz);
875EOAPI void efl_page_transition_padding_size_set(Eo *obj, int padding); 875EOAPI void efl_page_transition_padding_size_set(Eo *obj, int padding);
876EOAPI void efl_page_transition_update(Eo *obj, double pos); 876EOAPI void efl_page_transition_update(Eo *obj, double pos);
877EOAPI void efl_page_transition_pack(Eo *obj, int index); 877EOAPI void efl_page_transition_pack(Eo *obj, int index);
878EOAPI void efl_page_transition_unpack_all(Eo *obj);
878EOAPI void efl_page_transition_curr_page_change(Eo *obj, int diff); 879EOAPI void efl_page_transition_curr_page_change(Eo *obj, int diff);
879EOAPI Eina_Bool efl_page_transition_loop_set(Eo *obj, Efl_Ui_Pager_Loop loop); 880EOAPI Eina_Bool efl_page_transition_loop_set(Eo *obj, Efl_Ui_Pager_Loop loop);
880 881
881EOAPI void efl_page_indicator_update(Eo *obj, double pos); 882EOAPI void efl_page_indicator_update(Eo *obj, double pos);
882EOAPI void efl_page_indicator_pack(Eo *obj, int index); 883EOAPI void efl_page_indicator_pack(Eo *obj, int index);
883EOAPI void efl_page_indicator_unpack(Eo *obj, int index); 884EOAPI void efl_page_indicator_unpack(Eo *obj, int index);
885EOAPI void efl_page_indicator_unpack_all(Eo *obj);
884 886
885Eina_Bool _elm_config_accel_preference_parse(const char *pref, Eina_Stringshare **accel, int *gl_depth, int *gl_stencil, int *gl_msaa); 887Eina_Bool _elm_config_accel_preference_parse(const char *pref, Eina_Stringshare **accel, int *gl_depth, int *gl_stencil, int *gl_msaa);
886 888