static default_frame_info_t *
_ani_backend_error_get_frame(default_ani_info *ani_info)
{
+/* FIXME: ALAMR_FRAME need to changed after we imply animation type, suchas ease function */
#define BLINK_FRAME 2
default_frame_info_t *frame, *key_frame;
ani_info->frame_idx++;
if (ani_info->frame_idx >= BLINK_FRAME)
+ {
+ if (ani_info->repeat >= 0)
+ ani_info->repeat_cur++;
ani_info->frame_idx = 0;
+ }
return frame;
}
pui_ani_control_buffer *buffer = NULL;
default_frame_info_t *frame;
unsigned int r = 0x0, g = 0x0, b = 0x0;
- double now;
ani_data = pui_backend_ani_get_ani_data(ani);
default_ani_info *ani_info = (default_ani_info *)ani_data->ani_info;
- now = ecore_time_unix_get();
- pui_info("[time:%.3f] serial=%d\n", now, serial);
-
/* TODO : make use of ani_info */
//(void) ani_info;
return (pui_bool)0;
}
- pui_info("... update (serial=%d)\n", serial);
+ pui_info("... update (serial=%d), (repeat| cur: %d, want: %d)\n",
+ serial, ani_info->repeat_cur, ani_info->repeat);
+
+ if (ani_info->repeat >= 0 &&
+ ani_info->repeat_cur >= ani_info->repeat)
+ {
+ ani_data->ani_func->ani_stop(ani, EINA_FALSE);
+ }
return (pui_bool)1;
}
ani_data = pui_backend_ani_get_ani_data(ani);
default_ani_info *info = (default_ani_info *)ani_data->ani_info;
- //TODO
- (void) info;
-
pui_info("... info->id: %s, repeat : %d, interval: %d\n", info->id, repeat, info->interval);
pui_backend_ani_status_update(ani, PUI_ANI_STATUS_STARTED);
- ret = pui_backend_ani_add_frame_cb(ani, _ani_backend_error_frame_cb, info->interval / 1000.0);
+ if (repeat == 0) info->repeat = 1;
+ else info->repeat = repeat;
+ info->key_frame_cur = 0;
+ info->frame_idx = 0;
+ info->repeat_cur = 0;
+
+ ret = pui_backend_ani_add_frame_cb(ani, _ani_backend_error_frame_cb, info->interval / 1000.0);
if (!ret)
{
pui_err("Failed to add frame callback !\n");
}
pui_error
-_ani_error_stop(pui_ani_t *ani)
+_ani_error_stop(pui_ani_t *ani, pui_bool force)
{
pui_int_error e = PUI_INT_ERROR_NONE;
pui_backend_ani_data *ani_data = NULL;
//TODO
(void) info;
- pui_info("... info->id: %s\n", info->id);
+ pui_info("... info->id: %s, force=%d\n", info->id, force);
pui_backend_ani_remove_frame_cb(ani);
- pui_backend_ani_status_update(ani, PUI_ANI_STATUS_STOPPED);
+
+ if (force)
+ pui_backend_ani_status_update(ani, PUI_ANI_STATUS_PAUSED);
+ else
+ pui_backend_ani_status_update(ani, PUI_ANI_STATUS_STOPPED);
+
return e;
}