summaryrefslogtreecommitdiff
path: root/src/bin/elementary
diff options
context:
space:
mode:
authorXavi Artigas <xavierartigas@yahoo.es>2019-12-04 17:25:45 +0100
committerXavi Artigas <xavierartigas@yahoo.es>2019-12-04 17:43:31 +0100
commitb179e397d66c29712a7c38254b8c67daa6a77dc0 (patch)
treee34a69af8c9a172e84aee4dbe70c2f573b8495f3 /src/bin/elementary
parent44b532425915aeaf97637db96053e03b2b97bfa7 (diff)
Efl.Canvas.Animation: Rename repeat_count to play_count
Summary: play_count is a tad simpler to understand, since it means the TOTAL number of times the animation will play. The default value is now 1, and 0 means INFINITE (instead of -1). This allows removing yet another constant from header files. Depends on D10799 Test Plan: Everything builds and passes tests. Elm_test Animation.Repeat has been adjusted accordingly. Reviewers: bu5hm4n Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D10800
Diffstat (limited to 'src/bin/elementary')
-rw-r--r--src/bin/elementary/test_efl_anim_repeat.c38
1 files changed, 19 insertions, 19 deletions
diff --git a/src/bin/elementary/test_efl_anim_repeat.c b/src/bin/elementary/test_efl_anim_repeat.c
index 0f72882..b3dddcd 100644
--- a/src/bin/elementary/test_efl_anim_repeat.c
+++ b/src/bin/elementary/test_efl_anim_repeat.c
@@ -10,7 +10,7 @@ typedef struct _App_Data
10 Elm_Button *button; 10 Elm_Button *button;
11 11
12 Evas_Object *start_btn; 12 Evas_Object *start_btn;
13 Evas_Object *repeat_count_spin; 13 Evas_Object *play_count_spin;
14 Evas_Object *repeat_mode_spin; 14 Evas_Object *repeat_mode_spin;
15 15
16 Eina_Bool is_btn_visible; 16 Eina_Bool is_btn_visible;
@@ -44,8 +44,8 @@ _anim_changed_cb(void *data, const Efl_Event *event EINA_UNUSED)
44 Efl_Canvas_Animation_Repeat_Mode repeat_mode = _anim_repeat_mode_get(ad->repeat_mode_spin); 44 Efl_Canvas_Animation_Repeat_Mode repeat_mode = _anim_repeat_mode_get(ad->repeat_mode_spin);
45 if (repeat_mode == EFL_CANVAS_ANIMATION_REPEAT_MODE_REVERSE) 45 if (repeat_mode == EFL_CANVAS_ANIMATION_REPEAT_MODE_REVERSE)
46 { 46 {
47 int repeat_count = elm_spinner_value_get(ad->repeat_count_spin); 47 int play_count = elm_spinner_value_get(ad->play_count_spin);
48 if (repeat_count % 2 == 1) 48 if (play_count % 2 == 0)
49 { 49 {
50 ad->is_btn_visible = !(ad->is_btn_visible); 50 ad->is_btn_visible = !(ad->is_btn_visible);
51 if (ad->is_btn_visible) 51 if (ad->is_btn_visible)
@@ -54,7 +54,7 @@ _anim_changed_cb(void *data, const Efl_Event *event EINA_UNUSED)
54 elm_object_text_set(ad->start_btn, "Start Alpha Animation from 0.0 to 1.0"); 54 elm_object_text_set(ad->start_btn, "Start Alpha Animation from 0.0 to 1.0");
55 } 55 }
56 } 56 }
57 elm_object_disabled_set(ad->repeat_count_spin, EINA_FALSE); 57 elm_object_disabled_set(ad->play_count_spin, EINA_FALSE);
58 elm_object_disabled_set(ad->repeat_mode_spin, EINA_FALSE); 58 elm_object_disabled_set(ad->repeat_mode_spin, EINA_FALSE);
59 } 59 }
60} 60}
@@ -78,16 +78,16 @@ _start_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info EINA_UNUSED
78 78
79 ad->is_btn_visible = !(ad->is_btn_visible); 79 ad->is_btn_visible = !(ad->is_btn_visible);
80 80
81 int repeat_count = elm_spinner_value_get(ad->repeat_count_spin); 81 int play_count = elm_spinner_value_get(ad->play_count_spin);
82 elm_object_disabled_set(ad->repeat_count_spin, EINA_TRUE); 82 elm_object_disabled_set(ad->play_count_spin, EINA_TRUE);
83 83
84 Efl_Canvas_Animation_Repeat_Mode repeat_mode = _anim_repeat_mode_get(ad->repeat_mode_spin); 84 Efl_Canvas_Animation_Repeat_Mode repeat_mode = _anim_repeat_mode_get(ad->repeat_mode_spin);
85 elm_object_disabled_set(ad->repeat_mode_spin, EINA_TRUE); 85 elm_object_disabled_set(ad->repeat_mode_spin, EINA_TRUE);
86 86
87 if (ad->is_btn_visible) 87 if (ad->is_btn_visible)
88 { 88 {
89 //Set animation repeat count 89 //Set animation play count
90 efl_animation_repeat_count_set(ad->show_anim, repeat_count); 90 efl_animation_play_count_set(ad->show_anim, play_count);
91 91
92 //Set animation repeat mode 92 //Set animation repeat mode
93 efl_animation_repeat_mode_set(ad->show_anim, repeat_mode); 93 efl_animation_repeat_mode_set(ad->show_anim, repeat_mode);
@@ -99,7 +99,7 @@ _start_btn_clicked_cb(void *data, Evas_Object *obj, void *event_info EINA_UNUSED
99 else 99 else
100 { 100 {
101 //Set animation repeat count 101 //Set animation repeat count
102 efl_animation_repeat_count_set(ad->hide_anim, repeat_count); 102 efl_animation_play_count_set(ad->hide_anim, play_count);
103 103
104 //Set animation repeat mode 104 //Set animation repeat mode
105 efl_animation_repeat_mode_set(ad->hide_anim, repeat_mode); 105 efl_animation_repeat_mode_set(ad->hide_anim, repeat_mode);
@@ -158,15 +158,15 @@ test_efl_anim_repeat(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void
158 evas_object_move(start_btn, 100, 300); 158 evas_object_move(start_btn, 100, 300);
159 evas_object_show(start_btn); 159 evas_object_show(start_btn);
160 160
161 //Spinner to set animation repeat count 161 //Spinner to set animation play count
162 Evas_Object *repeat_count_spin = elm_spinner_add(win); 162 Evas_Object *play_count_spin = elm_spinner_add(win);
163 elm_spinner_label_format_set(repeat_count_spin, "Repeat Count: %d"); 163 elm_spinner_label_format_set(play_count_spin, "Play Count (0 is infinite): %d");
164 elm_spinner_editable_set(repeat_count_spin, EINA_FALSE); 164 elm_spinner_editable_set(play_count_spin, EINA_FALSE);
165 elm_spinner_min_max_set(repeat_count_spin, 0, 3); 165 elm_spinner_min_max_set(play_count_spin, 0, 3);
166 elm_spinner_value_set(repeat_count_spin, 0); 166 elm_spinner_value_set(play_count_spin, 1);
167 evas_object_resize(repeat_count_spin, 200, 50); 167 evas_object_resize(play_count_spin, 200, 50);
168 evas_object_move(repeat_count_spin, 100, 350); 168 evas_object_move(play_count_spin, 100, 350);
169 evas_object_show(repeat_count_spin); 169 evas_object_show(play_count_spin);
170 170
171 //Spinner to set animation repeat mode 171 //Spinner to set animation repeat mode
172 Evas_Object *repeat_mode_spin = elm_spinner_add(win); 172 Evas_Object *repeat_mode_spin = elm_spinner_add(win);
@@ -184,7 +184,7 @@ test_efl_anim_repeat(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void
184 ad->show_anim = show_anim; 184 ad->show_anim = show_anim;
185 ad->hide_anim = hide_anim; 185 ad->hide_anim = hide_anim;
186 ad->start_btn = start_btn; 186 ad->start_btn = start_btn;
187 ad->repeat_count_spin = repeat_count_spin; 187 ad->play_count_spin = play_count_spin;
188 ad->repeat_mode_spin = repeat_mode_spin; 188 ad->repeat_mode_spin = repeat_mode_spin;
189 ad->is_btn_visible = EINA_TRUE; 189 ad->is_btn_visible = EINA_TRUE;
190 ad->button = btn; 190 ad->button = btn;