renew pui prototype
[platform/core/uifw/libpui.git] / include / PUI_internal.h
1 #ifndef _LIBPUI_INTERNAL_H_
2 #define _LIBPUI_INTERNAL_H_
3
4 #include "PUI.h"
5 #include "PUI_backend.h"
6
7 #ifndef PATH_MAX
8 #define PATH_MAX 4096
9 #endif
10
11 enum {
12         PUI_INT_ERROR_NONE,
13         PUI_INT_ERROR_INVALID_HANDLE,
14         PUI_INT_ERROR_INVALID_SURFACE,
15         PUI_INT_ERROR_INVALID_BUFFER,
16         PUI_INT_ERROR_ID_NOT_SUPPORTED,
17         PUI_INT_ERROR_INVALID_BACKEND_MGR,
18         PUI_NIT_ERROR_NO__ANI_AVAILABLE,
19         PUI_INT_ERROR_BACKEND_FUNC_ERROR,
20 } pui_int_error;
21
22 typedef struct _PUI_Event_Animation_Status
23 {
24    unsigned int win;
25    pui_ani_status status;
26 };
27
28 struct _pui_ani_control_buffer
29 {
30         unsigned char *ptr;
31         uint32_t size;
32 };
33
34 struct _pui_ani
35 {
36         pui_h pui_handle;
37         pui_ani_mgr *ani_mgr;
38
39         Eina_Array *ecore_event_hdls;
40         Ecore_Wl2_Frame_Cb_Handle *frame_cb;
41
42         pui_id id;
43         pui_ani_cmd cmd;
44         pui_ani_opt opt;
45         pui_ani_status status;
46 };
47
48 struct _pui_ani_mgr
49 {
50         pui_ani_h ani_h;
51
52         pui_id id;
53         pui_ani_status status;
54
55         pui_ani_control_buffer *buffer
56
57         Eina_Bool (*frame_cb)(void *data);
58         void *frame_cb_data;
59         double expire;
60         Ecore_Timer *frame_cb_timer;
61
62         pui_backend_ani_func *ani_func;
63         pui_backend_ani_data *ani_data;
64 };
65
66 struct _pui
67 {
68         Ecore_Wl2_Window *win;
69         Ecore_Wl2_Display *ewd;
70         int visibility;
71
72         struct wayland_tbm_client *wl_tbm_client;
73         tbm_surface_queue_h tbm_queue;
74
75         tbm_surface_info_s current_sinfo;
76         tbm_surface_h current_surface;
77         int is_buffer_set;
78
79         Eina_List *ani_handles;
80
81         pui_backend_module_data *backend_module_data;
82 };
83
84 struct _pui_module_data
85 {
86         void *module_info;
87         pui_backend_module *backend_module_info;
88         pui_backend_module_data *backend_module_data;
89 };
90
91 #ifdef __cplusplus
92 extern "C" {
93 #endif
94
95 pui_ani_control_buffer *
96 get_buffer(pui_ani_h handle);
97
98 pui_int_error
99 set_buffer(pui_ani_h handle, pui_ani_control_buffer *buffer);
100
101 pui_int_error
102 pui_ani_update(pui_ani_h handle);
103
104 #ifdef __cplusplus
105 }
106 #endif
107
108 #endif//_LIBPUI_INTERNAL_H_