+_ani_play(app_data_t *app, const char *ani_type, int repeat)
+{
+ pui_error e = PUI_ERROR_NONE;
+ pui_ani_h ani_h = NULL;
+ int idx = -1;
+
+ if (!app->ph)
+ {
+ debug_error("Invalid pui_h handle !\n");
+ return;
+ }
+
+ for (int i = 0; i < app->n_animation; i++)
+ {
+ if (!strncmp(ani_collection[i].id, ani_type, strlen(ani_type)))
+ {
+ idx = i;
+ break;
+ }
+ }
+ if (idx < 0)
+ {
+ debug_error("%s is not supported animation id.\n", ani_type);
+ return;
+ }
+
+ debug_info("Animation(%s) will be started !\n", pui_ani_get_id(ani_handles[idx]));
+
+ /* play animation */
+ ani_h = ani_handles[idx];
+ e = pui_ani_control(ani_h, PUI_ANI_CMD_START, repeat);
+
+ if (PUI_ERROR_NONE != e)
+ {
+ debug_error("Failed on playing an animation ! (cmd:%d, repeat:%d)\n", PUI_ANI_CMD_START, repeat);
+ return;
+ }
+
+ app->manual_idx = idx;
+}
+
+static void
+_ani_stop(app_data_t *app)
+{
+ pui_error e = PUI_ERROR_NONE;
+ pui_ani_h ani_h = NULL;
+ int idx = -1;
+
+ if (!app->ph)
+ {
+ debug_error("Invalid pui_h handle !\n");
+ return;
+ }
+
+ if (app->manual_idx < 0)
+ {
+ debug_info("manual animation is not started\n");
+ return;
+ }
+
+ debug_info("Animation(%s) will be stop !\n", pui_ani_get_id(ani_handles[app->manual_idx]));
+
+ /* play animation */
+ ani_h = ani_handles[app->manual_idx];
+ e = pui_ani_control(ani_h, PUI_ANI_CMD_STOP, -1);
+
+ if (PUI_ERROR_NONE != e)
+ {
+ debug_error("Failed on stop an animation ! (cmd:%d)\n", PUI_ANI_CMD_STOP);
+ }
+
+ app->manual_idx = -1;
+}
+
+
+static void
+_usage(void)
+{
+ printf(" Supported commands: help (Print this help text)\n");
+ printf(" : q/quit (Quit program)\n");
+ printf(" : play {ani_id} {repeat} (play manual animation)\n");
+ printf(" ex> play system/processing 2\n");
+ printf(" : stop (stop manual animation)\n");
+ printf("\n");
+}
+
+static void
+_process_options(app_data_t *app, char *options)
+{
+ char *tmp, *buf_ptr;
+ int count = 0;
+ char ani_type[MAX_STR] = {0, };
+ int repeat = 0;
+
+ tmp = strtok_r(options, " ", &buf_ptr);
+ if (!tmp) return;
+
+ if (!strncmp(options, "q", MAX_STR) || !strncmp(options, "quit", MAX_STR)) {
+ ecore_main_loop_quit();
+ }
+ else if (!strncmp(options, "help", MAX_STR)) {
+ _usage();
+ }
+ else if (!strncmp(tmp, "play", sizeof("play"))) {
+ while (tmp) {
+ tmp = strtok_r(NULL, " ", &buf_ptr);
+ if (tmp) {
+ switch (count) {
+ case 0:
+ strncpy(ani_type, tmp, MAX_STR - 1);
+ break;
+ case 1:
+ repeat = atoi(tmp);
+ break;
+ default:
+ break;
+ }
+ }
+ count++;
+ }
+ if (strlen(ani_type) <= 0) {
+ printf("Please input valid arguments for ani type\n");
+ _usage();
+ }
+ else
+ _ani_play(app, ani_type, repeat);
+ }
+ else if (!strncmp(tmp, "stop", sizeof("stop"))) {
+ _ani_stop(app);
+ }
+ else {
+ printf("Invalid arguments\n");
+ _usage();
+ }
+}
+
+static Eina_Bool
+_stdin_cb(void *data, Ecore_Fd_Handler *handler EINA_UNUSED)
+{
+ app_data_t *app = (app_data_t *)data;
+ char c, buf[MAX_STR] = {0, };
+ int count = 0;
+
+ while ((c = getchar()) != EOF) {
+ if (c == '\n') break;
+ if (count >= MAX_STR) break;
+
+ buf[count] = c;
+ count++;
+ }
+
+ _process_options(app, buf);
+
+ return ECORE_CALLBACK_RENEW;
+}
+
+
+static void