fix pui_ani_control_buffer location
[platform/core/uifw/libpui.git] / src / PUI_internal.h
1 /*
2  * Copyright © 2019 Samsung Electronics co., Ltd. All Rights Reserved.
3  *
4  * Permission is hereby granted, free of charge, to any person obtaining
5  * a copy of this software and associated documentation files (the
6  * "Software"), to deal in the Software without restriction, including
7  * without limitation the rights to use, copy, modify, merge, publish,
8  * distribute, sublicense, and/or sell copies of the Software, and to
9  * permit persons to whom the Software is furnished to do so, subject to
10  * the following conditions:
11  *
12  * The above copyright notice and this permission notice (including the
13  * next paragraph) shall be included in all copies or substantial
14  * portions of the Software.
15  *
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19  * NONINFRINGEMENT.  IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
20  * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
21  * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
22  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23  * SOFTWARE.
24  */
25
26 #ifndef _LIBPUI_INTERNAL_H_
27 #define _LIBPUI_INTERNAL_H_
28
29 #define EFL_BETA_API_SUPPORT
30
31 #include <stdint.h>
32 #include <Ecore_Wl2.h>
33 #include <Eina.h>
34 #include <wayland-tbm-client.h>
35 #include <tbm_surface_internal.h>
36 #include "PUI_common.h"
37
38 #ifndef PATH_MAX
39 #define PATH_MAX 4096
40 #endif
41
42 struct _pui_ani
43 {
44         pui_h pui_handle;
45         pui_ani_t *ani;
46
47         Eina_Array *ecore_event_hdls;
48         Ecore_Wl2_Frame_Cb_Handle *frame_done_cb;
49
50         pui_id id;
51 };
52
53 struct _pui_ani_t
54 {
55         pui_ani_h ani_h;
56
57         pui_id id;
58         pui_ani_cmd cmd;
59         int repeat;
60         pui_ani_status status;
61
62         int serial;
63         pui_ani_control_buffer *buffer;
64
65         Eina_Bool (*frame_cb)(void *data);
66         pui_bool (*backend_frame_cb)(void *data, int serial);
67         void *frame_cb_data;
68         double frame_interval;
69         Ecore_Timer *frame_cb_timer;
70
71         pui_backend_ani_data *ani_data;
72 };
73
74 struct _pui
75 {
76         Ecore_Wl2_Window *win;
77         Ecore_Wl2_Display *ewd;
78         int visibility;
79
80         struct wayland_tbm_client *wl_tbm_client;
81         tbm_surface_queue_h tbm_queue;
82
83         tbm_surface_info_s current_sinfo;
84         tbm_surface_h current_surface;
85         int is_buffer_set;
86
87         Eina_List *ani_handles;
88
89         pui_backend_module_data *backend_module_data;
90 };
91
92 struct _pui_module_data
93 {
94         void *module_info;
95         pui_backend_module *backend_module_info;
96         pui_backend_module_data *backend_module_data;
97 };
98
99 #ifdef __cplusplus
100 extern "C" {
101 #endif
102
103 pui_ani_control_buffer *
104 pui_ani_get_buffer(pui_ani_h ani_h);
105
106 pui_int_error
107 pui_ani_set_buffer(pui_ani_h ani_h, pui_ani_control_buffer *buffer);
108
109 pui_int_error
110 pui_ani_update(pui_ani_h ani_h);
111
112 pui_bool
113 pui_ani_add_frame_cb(pui_ani_t *ani, pui_bool (*frame_cb)(void *data, int serial), double frame_interval);
114
115 void
116 pui_ani_remove_frame_cb(pui_ani_t *ani);
117
118 void
119 pui_ani_status_update(pui_ani_t *ani, pui_ani_status status);
120
121 pui_ani_status
122 pui_ani_status_get(pui_ani_t *ani);
123
124 pui_backend_ani_data *
125 pui_ani_get_ani_data(pui_ani_t *ani);
126
127 #ifdef __cplusplus
128 }
129 #endif
130
131 #endif//_LIBPUI_INTERNAL_H_