7e8cf2c988210b71f7eb14f0573cb4c922453741
[platform/core/uifw/libds-tizen.git] / include / libds-tizen / remote_surface.h
1 #ifndef LIBDS_TIZEN_REMOTE_SURFACE_H
2 #define LIBDS_TIZEN_REMOTE_SURFACE_H
3
4 #include <stdint.h>
5 #include <wayland-server.h>
6 #include <libds/surface.h>
7
8 #ifdef __cplusplus
9 extern "C" {
10 #endif
11
12 enum ds_tizen_remote_surface_visibility_type {
13     DS_TIZEN_REMOTE_SURFACE_VISIBILITY_TYPE_INVISIBLE = 0,
14     DS_TIZEN_REMOTE_SURFACE_VISIBILITY_TYPE_VISIBLE = 1,
15 };
16
17 enum ds_tizen_remote_surface_input_event_type {
18     DS_TIZEN_REMOTE_SURFACE_INPUT_EVENT_TYPE_NONE = 0,
19     DS_TIZEN_REMOTE_SURFACE_INPUT_EVENT_TYPE_MOUSE_DOWN = 1,
20     DS_TIZEN_REMOTE_SURFACE_INPUT_EVENT_TYPE_MOUSE_UP = 2,
21     DS_TIZEN_REMOTE_SURFACE_INPUT_EVENT_TYPE_MOUSE_MOVE = 3,
22     DS_TIZEN_REMOTE_SURFACE_INPUT_EVENT_TYPE_TOUCH_DOWN = 4,
23     DS_TIZEN_REMOTE_SURFACE_INPUT_EVENT_TYPE_TOUCH_UP = 5,
24     DS_TIZEN_REMOTE_SURFACE_INPUT_EVENT_TYPE_TOUCH_MOVE = 6,
25     DS_TIZEN_REMOTE_SURFACE_INPUT_EVENT_TYPE_KEY_DOWN = 7,
26     DS_TIZEN_REMOTE_SURFACE_INPUT_EVENT_TYPE_KEY_UP = 8,
27     DS_TIZEN_REMOTE_SURFACE_INPUT_EVENT_TYPE_MOUSE_IN = 9,
28     DS_TIZEN_REMOTE_SURFACE_INPUT_EVENT_TYPE_MOUSE_OUT = 10,
29     DS_TIZEN_REMOTE_SURFACE_INPUT_EVENT_TYPE_KEY_CANCEL = 11,
30 };
31
32 enum ds_tizen_remote_surface_input_event_filter {
33     DS_TIZEN_REMOTE_SURFACE_INPUT_EVENT_FILITER_MOUSE_NONE = 0x00000001,
34     DS_TIZEN_REMOTE_SURFACE_INPUT_EVENT_FILITER_MOUSE_UP_DOWN = 0x00000002,
35     DS_TIZEN_REMOTE_SURFACE_INPUT_EVENT_FILITER_MOUSE_MOVE_X = 0x00000003,
36     DS_TIZEN_REMOTE_SURFACE_INPUT_EVENT_FILITER_MOUSE_MOVE_Y = 0x00000004,
37     DS_TIZEN_REMOTE_SURFACE_INPUT_EVENT_FILITER_MOUSE_MOVE_X_Y = 0x00000005,
38     DS_TIZEN_REMOTE_SURFACE_INPUT_EVENT_FILITER_MOUSE_UP_DOWN_MOVE_X = 0x00000006,
39     DS_TIZEN_REMOTE_SURFACE_INPUT_EVENT_FILITER_MOUSE_UP_DOWN_MOVE_Y = 0x00000007,
40     DS_TIZEN_REMOTE_SURFACE_INPUT_EVENT_FILITER_MOUSE_UP_DOWN_MOVE_X_Y = 0x00000008,
41     DS_TIZEN_REMOTE_SURFACE_INPUT_EVENT_FILITER_MOUSE_ALL = 0x0000000e,
42     DS_TIZEN_REMOTE_SURFACE_INPUT_EVENT_FILITER_MOUSE_FLAG = 0x0000000f,
43     DS_TIZEN_REMOTE_SURFACE_INPUT_EVENT_FILITER_MOUSE_WHEEL_NONE = 0x00000010,
44     DS_TIZEN_REMOTE_SURFACE_INPUT_EVENT_FILITER_MOUSE_WHEEL_ALL = 0x000000e0,
45     DS_TIZEN_REMOTE_SURFACE_INPUT_EVENT_FILITER_MOUSE_WHEEL_FLAG = 0x000000f0,
46     DS_TIZEN_REMOTE_SURFACE_INPUT_EVENT_FILITER_TOUCH_NONE = 0x00000100,
47     DS_TIZEN_REMOTE_SURFACE_INPUT_EVENT_FILITER_TOUCH_UP_DOWN = 0x00000200,
48     DS_TIZEN_REMOTE_SURFACE_INPUT_EVENT_FILITER_TOUCH_MOVE_X = 0x00000300,
49     DS_TIZEN_REMOTE_SURFACE_INPUT_EVENT_FILITER_TOUCH_MOVE_Y = 0x00000400,
50     DS_TIZEN_REMOTE_SURFACE_INPUT_EVENT_FILITER_TOUCH_MOVE_X_Y = 0x00000500,
51     DS_TIZEN_REMOTE_SURFACE_INPUT_EVENT_FILITER_TOUCH_UP_DOWN_MOVE_X = 0x00000600,
52     DS_TIZEN_REMOTE_SURFACE_INPUT_EVENT_FILITER_TOUCH_UP_DOWN_MOVE_Y = 0x00000700,
53     DS_TIZEN_REMOTE_SURFACE_INPUT_EVENT_FILITER_TOUCH_UP_DOWN_MOVE_X_Y = 0x00000800,
54     DS_TIZEN_REMOTE_SURFACE_INPUT_EVENT_FILITER_TOUCH_ALL = 0x00000e00,
55     DS_TIZEN_REMOTE_SURFACE_INPUT_EVENT_FILITER_TOUCH_FLAG = 0x00000f00,
56     DS_TIZEN_REMOTE_SURFACE_INPUT_EVENT_FILITER_TOUCH_CANCEL_NONE = 0x00001000,
57     DS_TIZEN_REMOTE_SURFACE_INPUT_EVENT_FILITER_TOUCH_CANCEL_ALL = 0x0000e000,
58     DS_TIZEN_REMOTE_SURFACE_INPUT_EVENT_FILITER_TOUCH_CANCEL_FLAG = 0x0000f000,
59     DS_TIZEN_REMOTE_SURFACE_INPUT_EVENT_FILITER_KEY_NONE = 0x00010000,
60     DS_TIZEN_REMOTE_SURFACE_INPUT_EVENT_FILITER_KEY_ALL = 0x000e0000,
61     DS_TIZEN_REMOTE_SURFACE_INPUT_EVENT_FILITER_KEY_FLAG = 0x000f0000,
62 };
63
64 enum ds_tizen_remote_surface_buffer_type {
65     DS_TIZEN_REMOTE_SURFACE_BUFFER_TYPE_TBM = 0,
66     DS_TIZEN_REMOTE_SURFACE_BUFFER_TYPE_IMAGE_FILE = 1,
67 };
68
69 enum ds_tizen_remote_surface_changed_buffer_event_filter {
70     DS_TIZEN_REMOTE_SURFACE_CHANGED_BUFFER_EVENT_FILTER_NONE = 0x00000000,
71     DS_TIZEN_REMOTE_SURFACE_CHANGED_BUFFER_EVENT_FILTER_TBM = 0x00000001,
72     DS_TIZEN_REMOTE_SURFACE_CHANGED_BUFFER_EVENT_FILTER_IMAGE_FILE = 0x00000002,
73 };
74
75 struct ds_tizen_remote_surface_manager_bind_surface_event {
76     struct ds_tizen_remote_surface *remote_surface;
77     struct ds_surface *surface;
78 };
79
80 struct ds_tizen_remote_surface_transfer_mouse_event {
81     struct ds_tizen_remote_surface *remote_surface;
82     enum ds_tizen_remote_surface_input_event_type event_type;
83     int32_t device;
84     int32_t button;
85     int32_t x;
86     int32_t y;
87     wl_fixed_t radius_x;
88     wl_fixed_t radius_y;
89     wl_fixed_t pressure;
90     wl_fixed_t angle;
91     uint32_t clas;
92     uint32_t subclas;
93     const char *identifier;
94     uint32_t time;
95 };
96
97 struct ds_tizen_remote_surface_transfer_mouse_wheel_event {
98     struct ds_tizen_remote_surface *remote_surface;
99     uint32_t direction;
100     int32_t z;
101     uint32_t clas;
102     uint32_t subclas;
103     const char *identifier;
104     uint32_t time;
105 };
106
107 struct ds_tizen_remote_surface_transfer_touch_event {
108     struct ds_tizen_remote_surface *remote_surface;
109     enum ds_tizen_remote_surface_input_event_type event_type;
110     int32_t device;
111     int32_t button;
112     int32_t x;
113     int32_t y;
114     wl_fixed_t radius_x;
115     wl_fixed_t radius_y;
116     wl_fixed_t pressure;
117     wl_fixed_t angle;
118     uint32_t clas;
119     uint32_t subclas;
120     const char *identifier;
121     uint32_t time;
122 };
123
124 struct ds_tizen_remote_surface_transfer_touch_cancel_event {
125     struct ds_tizen_remote_surface *remote_surface;
126 };
127
128 struct ds_tizen_remote_surface_transfer_key_event {
129     struct ds_tizen_remote_surface *remote_surface;
130     enum ds_tizen_remote_surface_input_event_type event_type;
131     int32_t keycode;
132     uint32_t clas;
133     uint32_t subclas;
134     const char *identifier;
135     uint32_t time;
136 };
137
138 struct ds_tizen_remote_surface_transfer_visibility_event {
139     struct ds_tizen_remote_surface *remote_surface;
140     enum ds_tizen_remote_surface_visibility_type visibility;
141 };
142
143 struct ds_tizen_remote_surface_buffer_release_event {
144     struct ds_tizen_remote_surface *remote_surface;
145     struct ds_buffer *buffer;
146 };
147
148 struct ds_tizen_remote_surface_current_buffer_event {
149     struct ds_tizen_remote_surface *remote_surface;
150     enum ds_tizen_remote_surface_buffer_type buffer_type;
151     uint32_t request_serial;
152 };
153
154 struct ds_tizen_remote_surface_manager;
155
156 struct ds_tizen_remote_surface_provider;
157
158 struct ds_tizen_remote_surface;
159
160 struct ds_tizen_remote_surface_region;
161
162 struct ds_tizen_remote_surface_manager *
163 ds_tizen_remote_surface_manager_create(struct wl_display *display);
164
165 void
166 ds_tizen_remote_surface_manager_add_destroy_listener(
167         struct ds_tizen_remote_surface_manager *remote_manager,
168         struct wl_listener *listener);
169
170 void
171 ds_tizen_remote_surface_manager_add_new_provider_listener(
172         struct ds_tizen_remote_surface_manager *remote_manager,
173         struct wl_listener *listener);
174
175 void
176 ds_tizen_remote_surface_manager_add_new_surface_listener(
177         struct ds_tizen_remote_surface_manager *remote_manager,
178         struct wl_listener *listener);
179
180 void
181 ds_tizen_remote_surface_manager_add_bind_surface_listener(
182         struct ds_tizen_remote_surface_manager *remote_manager,
183         struct wl_listener *listener);
184
185 void
186 ds_tizen_remote_surface_provider_add_destroy_listener(
187         struct ds_tizen_remote_surface_provider *remote_provider,
188         struct wl_listener *listener);
189
190 void
191 ds_tizen_remote_surface_provider_add_set_offscreen_listener(
192         struct ds_tizen_remote_surface_provider *remote_provider,
193         struct wl_listener *listener);
194
195 void
196 ds_tizen_remote_surface_provider_add_set_input_event_filter_listener(
197         struct ds_tizen_remote_surface_provider *remote_provider,
198         struct wl_listener *listener);
199
200 bool
201 ds_tizen_remote_surface_provider_get_offscreen(
202         struct ds_tizen_remote_surface_provider *remote_provider);
203
204 uint32_t
205 ds_tizen_remote_surface_provider_get_input_event_filter(
206         struct ds_tizen_remote_surface_provider *remote_provider);
207
208 void
209 ds_tizen_remote_surface_provider_send_visibility(
210         struct ds_tizen_remote_surface_provider *remote_provider,
211         enum ds_tizen_remote_surface_visibility_type visibility);
212
213 void
214 ds_tizen_remote_surface_add_destroy_listener(
215         struct ds_tizen_remote_surface *remote_surface,
216         struct wl_listener *listener);
217
218 struct wl_resource *
219 ds_tizen_remote_surface_get_wl_tbm_resource(
220         struct ds_tizen_remote_surface *remote_surface);
221
222 void
223 ds_tizen_remote_surface_add_set_redirect_listener(
224         struct ds_tizen_remote_surface *remote_surface,
225         struct wl_listener *listener);
226
227 bool
228 ds_tizen_remote_surface_get_redirect(
229         struct ds_tizen_remote_surface *remote_surface);
230
231 void
232 ds_tizen_remote_surface_add_set_owner_listener(
233         struct ds_tizen_remote_surface *remote_surface,
234         struct wl_listener *listener);
235
236 struct ds_surface *
237 ds_tizen_remote_surface_get_owner(
238         struct ds_tizen_remote_surface *remote_surface);
239
240 void
241 ds_tizen_remote_surface_add_buffer_release_listener(
242         struct ds_tizen_remote_surface *remote_surface,
243         struct wl_listener *listener);
244
245 void
246 ds_tizen_remote_surface_add_set_remote_render_listener(
247         struct ds_tizen_remote_surface *remote_surface,
248         struct wl_listener *listener);
249
250 bool
251 ds_tizen_remote_surface_get_remote_render(
252         struct ds_tizen_remote_surface *remote_surface);
253
254 void
255 ds_tizen_remote_surface_add_set_changed_buffer_event_filter_listener(
256         struct ds_tizen_remote_surface *remote_surface,
257         struct wl_listener *listener);
258
259 uint32_t
260 ds_tizen_remote_surface_get_changed_buffer_event_filter(
261         struct ds_tizen_remote_surface *remote_surface,
262         struct wl_listener *listener);
263
264 void
265 ds_tizen_remote_surface_add_get_current_buffer_listener(
266         struct ds_tizen_remote_surface *remote_surface,
267         struct wl_listener *listener);
268
269 void
270 ds_tizen_remote_surface_send_changed_buffer(
271         struct ds_tizen_remote_surface *remote_surface,
272         struct ds_buffer *buffer,
273         uint32_t time,
274         struct wl_array *options);
275
276 void
277 ds_tizen_remote_surface_send_changed_buffer_image_file(
278         struct ds_tizen_remote_surface *remote_surface,
279         int image_file_fd,
280         int image_file_size,
281         uint32_t time,
282         struct wl_array *options);
283
284 void
285 ds_tizen_remote_surface_send_missing(
286         struct ds_tizen_remote_surface *remote_surface);
287
288 void
289 ds_tizen_remote_surface_send_input_event_filter(
290         struct ds_tizen_remote_surface *remote_surface,
291         uint32_t input_event_filter);
292
293 void
294 ds_tizen_remote_surface_add_new_region_listener(
295         struct ds_tizen_remote_surface *remote_surface,
296         struct wl_listener *listener);
297
298 void
299 ds_tizen_remote_surface_region_add_destroy_listener(
300         struct ds_tizen_remote_surface_region *remote_region,
301         struct wl_listener *listener);
302
303 void
304 ds_tizen_remote_surface_region_add_set_geometry_listener(
305         struct ds_tizen_remote_surface_region *remote_region,
306         struct wl_listener *listener);
307
308 void
309 ds_tizen_remote_surface_region_get_geometry(
310         struct ds_tizen_remote_surface_region *remote_region,
311         int32_t *x,int32_t *y, int32_t *w, int32_t *h);
312
313 #ifdef __cplusplus
314 }
315 #endif
316
317 #endif