summaryrefslogtreecommitdiff
path: root/src/ico_window_animation.c
diff options
context:
space:
mode:
authorHayato Nakamura <hayato.nakamura@mail.toyota-td.jp>2013-10-03 10:54:37 +0900
committerHayato Nakamura <hayato.nakamura@mail.toyota-td.jp>2013-10-03 10:54:37 +0900
commite54b6d90ab34953e2e3bfdcd7ae4803002cb983f (patch)
tree5539caf411cacc14aa36b3f5da3824f88ebc1ef3 /src/ico_window_animation.c
parent966005bb288bee88c44760890a1de14e282276ba (diff)
downloadico-uxf-weston-plugin-accepted/tizen/20131004.164441.tar.gz
ico-uxf-weston-plugin-accepted/tizen/20131004.164441.tar.bz2
ico-uxf-weston-plugin-accepted/tizen/20131004.164441.zip
Change-Id: I14aaf988fd97b8e83ae0cdc21c8c225e14f30f40 Signed-off-by: Hayato Nakamura <hayato.nakamura@mail.toyota-td.jp>
Diffstat (limited to 'src/ico_window_animation.c')
-rw-r--r--src/ico_window_animation.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/ico_window_animation.c b/src/ico_window_animation.c
index a5f497d..5db60eb 100644
--- a/src/ico_window_animation.c
+++ b/src/ico_window_animation.c
@@ -79,6 +79,7 @@ static struct weston_compositor *weston_ec; /* Weston compositor
static char *default_animation; /* default animation name */
static int animation_fps; /* animation frame rate(frame/sec) */
static int animation_time; /* default animation time(ms) */
+static int animation_count; /* current number of animations */
static struct animation_data *free_data; /* free data list */
/* support animation names */
@@ -206,6 +207,7 @@ ico_window_animation(const int op, void *data)
struct weston_output, link);
wl_list_insert(output->animation_list.prev,
&usurf->animation.animation.link);
+ animation_count ++;
}
}
else if (((usurf->animation.state == ICO_WINDOW_MGR_ANIMATION_STATE_SHOW) &&
@@ -399,7 +401,8 @@ animation_cont(struct weston_animation *animation, struct weston_output *output,
}
if ((par >= 100) ||
(abs(usurf->animation.current - par) >=
- (((1000 * 100) / animation_fps) / usurf->animation.time))) {
+ (((1000 * 100) / animation_fps) / usurf->animation.time)) ||
+ ((animation_count > 1) && (par != usurf->animation.current))) {
usurf->animation.current = par;
return 0;
}
@@ -423,6 +426,10 @@ animation_end(struct uifw_win_surface *usurf, const int disp)
usurf->animation.state = ICO_WINDOW_MGR_ANIMATION_STATE_NONE;
animadata = (struct animation_data *)usurf->animation.animadata;
+ if (animation_count > 0) {
+ animation_count --;
+ }
+
if (animadata) {
if (animadata->end_function) {
(*animadata->end_function)(&usurf->animation.animation);
@@ -537,8 +544,7 @@ animation_slide(struct weston_animation *animation,
}
break;
case ANIMA_SLIDE_TOLEFT: /* slide in right to left */
- dwidth = (container_of(weston_ec->output_list.next,
- struct weston_output, link))->width;
+ dwidth = usurf->node_tbl->disp_width;
if (usurf->animation.state == ICO_WINDOW_MGR_ANIMATION_STATE_SHOW) {
/* slide in right to left */
x = usurf->animation.pos_x +
@@ -562,8 +568,7 @@ animation_slide(struct weston_animation *animation,
}
break;
default: /*ANIMA_SLIDE_TOTOP*/ /* slide in bottom to top */
- dheight = (container_of(weston_ec->output_list.next,
- struct weston_output, link))->height;
+ dheight = usurf->node_tbl->disp_height;
if (usurf->animation.state == ICO_WINDOW_MGR_ANIMATION_STATE_SHOW) {
/* slide in bottom to top */
y = usurf->animation.pos_y +
@@ -1175,6 +1180,7 @@ module_init(struct weston_compositor *ec, int *argc, char *argv[])
default_animation = (char *)ico_ivi_default_animation_name();
animation_time = ico_ivi_default_animation_time();
animation_fps = ico_ivi_default_animation_fps();
+ animation_count = 0;
ico_window_mgr_set_hook_animation(ico_window_animation);