Update AUTHORS and boiler plates
[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_control_buffer
43 {
44         unsigned char *ptr;
45         uint32_t size;
46 };
47
48 struct _pui_ani
49 {
50         pui_h pui_handle;
51         pui_ani_t *ani;
52
53         Eina_Array *ecore_event_hdls;
54         Ecore_Wl2_Frame_Cb_Handle *frame_done_cb;
55
56         pui_id id;
57 };
58
59 struct _pui_ani_t
60 {
61         pui_ani_h ani_h;
62
63         pui_id id;
64         pui_ani_cmd cmd;
65         int repeat;
66         pui_ani_status status;
67
68         int serial;
69         pui_ani_control_buffer *buffer;
70
71         Eina_Bool (*frame_cb)(void *data);
72         pui_bool (*backend_frame_cb)(void *data, int serial);
73         void *frame_cb_data;
74         double frame_interval;
75         Ecore_Timer *frame_cb_timer;
76
77         pui_backend_ani_data *ani_data;
78 };
79
80 struct _pui
81 {
82         Ecore_Wl2_Window *win;
83         Ecore_Wl2_Display *ewd;
84         int visibility;
85
86         struct wayland_tbm_client *wl_tbm_client;
87         tbm_surface_queue_h tbm_queue;
88
89         tbm_surface_info_s current_sinfo;
90         tbm_surface_h current_surface;
91         int is_buffer_set;
92
93         Eina_List *ani_handles;
94
95         pui_backend_module_data *backend_module_data;
96 };
97
98 struct _pui_module_data
99 {
100         void *module_info;
101         pui_backend_module *backend_module_info;
102         pui_backend_module_data *backend_module_data;
103 };
104
105 #ifdef __cplusplus
106 extern "C" {
107 #endif
108
109 pui_ani_control_buffer *
110 pui_ani_get_buffer(pui_ani_h ani_h);
111
112 pui_int_error
113 pui_ani_set_buffer(pui_ani_h ani_h, pui_ani_control_buffer *buffer);
114
115 pui_int_error
116 pui_ani_update(pui_ani_h ani_h);
117
118 pui_bool
119 pui_ani_add_frame_cb(pui_ani_t *ani, pui_bool (*frame_cb)(void *data, int serial), double frame_interval);
120
121 void
122 pui_ani_remove_frame_cb(pui_ani_t *ani);
123
124 void
125 pui_ani_status_update(pui_ani_t *ani, pui_ani_status status);
126
127 pui_ani_status
128 pui_ani_status_get(pui_ani_t *ani);
129
130 pui_backend_ani_data *
131 pui_ani_get_ani_data(pui_ani_t *ani);
132
133 #ifdef __cplusplus
134 }
135 #endif
136
137 #endif//_LIBPUI_INTERNAL_H_