void (*reserved3)(void);
void (*reserved4)(void);
void (*reserved5)(void);
- void (*reserved6)(void);
- void (*reserved7)(void);
- void (*reserved8)(void);
- void (*reserved9)(void);
- void (*reserved10)(void);
};
typedef void pui_backend_ani_info;
pui_int_error (*create_ani_collection)(void);
pui_backend_ani_data *(*ani_create)(pui_id id);
void (*ani_destroy)(pui_backend_ani_data *ani_data);
+
+ void (*reserved1)(void);
+ void (*reserved2)(void);
+ void (*reserved3)(void);
+ void (*reserved4)(void);
+ void (*reserved5)(void);
};
struct _pui_backend_module
pui_int_error
pui_backend_ani_update(pui_ani_t *ani);
-void
+pui_bool
pui_backend_ani_add_frame_cb(pui_ani_t *ani, pui_bool (*frame_cb)(void *data, int serial), double frame_interval);
void
if (!ani_h)
{
- pui_err(\r"Invalid pui ani handle !\n");
+ pui_err("Invalid pui ani handle !\n");
return NULL;
}
return;
}
- while (eina_array_count(ani_h->ecore_event_hdls))
- ecore_event_handler_del(eina_array_pop(ani_h->ecore_event_hdls));
- eina_array_free(ani_h->ecore_event_hdls);
+ if (ani_h->ecore_event_hdls)
+ {
+ while (eina_array_count(ani_h->ecore_event_hdls))
+ ecore_event_handler_del(eina_array_pop(ani_h->ecore_event_hdls));
- ani_h->ecore_event_hdls = NULL;
+ eina_array_free(ani_h->ecore_event_hdls);
+ ani_h->ecore_event_hdls = NULL;
+ }
}
-Eina_Bool _pui_ani_frame_cb(void *data)
+static Eina_Bool
+_pui_ani_frame_cb(void *data)
{
Eina_Bool ret;
return ECORE_CALLBACK_CANCEL;
}
+ if (!ani->frame_cb_timer)
+ {
+ pui_err("Invalid frame_cb timer !\n");
+ return ECORE_CALLBACK_CANCEL;
+ }
+
pui_info("frame_cb !\n");
ret = (Eina_Bool)ani->backend_frame_cb(ani, ++ani->serial);
- if (!ani->frame_cb_timer)
- return ECORE_CALLBACK_CANCEL;
-
pui_ani_status_update(ani, PUI_ANI_STATUS_RUNNING);
return ret;
}
-void
+pui_bool
pui_ani_add_frame_cb(pui_ani_t *ani, pui_bool (*frame_cb)(void *data, int serial), double frame_interval)
{
Ecore_Timer *timer = NULL;
if (!ani)
{
pui_err("Invalid put ani !\n");
- return;
+ return 0;
}
ani->frame_cb = _pui_ani_frame_cb;
ani->frame_cb_data = ani;
ani->serial = 0;
- timer = ecore_timer_add(frame_interval, (Ecore_Task_Cb)ani->frame_cb, ani->frame_cb_data);
+ timer = ecore_timer_add(frame_interval, _pui_ani_frame_cb, ani);
- if (ani->frame_cb_timer)
+ if (!timer)
{
- ecore_timer_del(ani->frame_cb_timer);
- ani->frame_cb_timer = NULL;
+ pui_err("Failed to add ecore timer !\n");
+ return 0;
}
ani->frame_cb_timer = timer;
/* call frame_cb for starting the first frame */
_pui_ani_frame_cb(ani);
+
+ return 1;
}
void
ani_func = ani->ani_data->ani_func;
+ ani->cmd = cmd;
+ ani->repeat = repeat;
+
if (cmd == PUI_ANI_CMD_START)
{
ani_func->ani_start(ani, repeat);
else//cmd == PUI_ANI_CMD_STOP
{
ani_func->ani_stop(ani);
+ return PUI_ERROR_NONE;
}
- ani->cmd = cmd;
- ani->repeat = repeat;
-
ani_h->frame_done_cb = ecore_wl2_window_frame_callback_add(handle->win, _pui_ani_cb_frame_done, handle);
if (!ani_h->frame_done_cb)
goto err;
}
+ ani_h->id = strdup(id);
+ ani_h->pui_handle = handle;
ani_h->ecore_event_hdls = NULL;
+
_pui_ani_event_handlers_init(ani_h);
ani = (pui_ani_t *)calloc(1, sizeof(pui_ani_t));
ani->ani_h = ani_h;
ani->id = id;
+ ani->cmd = PUI_ANI_CMD_NONE;
+ ani->repeat = 0;
ani->status = PUI_ANI_STATUS_INITIAL;
ani->ani_data = ani_data;
+ ani_h->ani = ani;
+
handle->ani_handles = eina_list_append(handle->ani_handles, ani_h);
return ani_h;
free(ani_h->ani);
_pui_ani_event_handlers_shutdown(ani_h);
-
+
if (ani_h->frame_done_cb)
{
ecore_wl2_window_frame_callback_del(ani_h->frame_done_cb);
handle->ani_handles = eina_list_remove(handle->ani_handles, ani_h);
+ free(ani_h->id);
free(ani_h);
}
#define pui_err(msg, ...) \
do { \
- fprintf(stderr, "[ERROR][%s] " msg, __FUNCTION__, ##__VA_ARGS__); \
+ fprintf(stderr, "[ERROR][%s][%d] " msg, __FUNCTION__, __LINE__, ##__VA_ARGS__); \
} while(0)
#define pui_warn(msg, ...) \
do { \
- fprintf(stderr, "[WARNING][%s] " msg, __FUNCTION__, ##__VA_ARGS__); \
+ fprintf(stderr, "[WARNING][%s][%d] " msg, __FUNCTION__, __LINE__, ##__VA_ARGS__); \
} while(0)
#define pui_info(msg, ...) \
do { \
- fprintf(stdout, "[INFO][%s] " msg, __FUNCTION__, ##__VA_ARGS__); \
+ fprintf(stdout, "[INFO][%s][%d] " msg, __FUNCTION__, __LINE__, ##__VA_ARGS__); \
} while(0)
#endif//_LIBPUI_COMMON_H_