1 #ifndef _ECORE_WAYLAND_PRIVATE_H
2 # define _ECORE_WAYLAND_PRIVATE_H
8 # include "Ecore_Input.h"
9 # include "Ecore_Wayland.h"
11 # include "ivi-application-client-protocol.h"
12 # define IVI_SURFACE_ID 6000
15 # include "tizen-policy-client-protocol.h"
16 # include "tizen-extension-client-protocol.h"
18 # include "keyrouter-client-protocol.h"
24 # define LOGFN(fl, ln, fn) printf("-ECORE-WL: %25s: %5i - %s\n", fl, ln, fn);
26 # define LOGFN(fl, ln, fn)
29 extern int _ecore_wl_log_dom;
31 # ifdef ECORE_WL_DEFAULT_LOG_COLOR
32 # undef ECORE_WL_DEFAULT_LOG_COLOR
34 # define ECORE_WL_DEFAULT_LOG_COLOR EINA_COLOR_BLUE
39 # define ERR(...) EINA_LOG_DOM_ERR(_ecore_wl_log_dom, __VA_ARGS__)
44 # define DBG(...) EINA_LOG_DOM_DBG(_ecore_wl_log_dom, __VA_ARGS__)
49 # define INF(...) EINA_LOG_DOM_INFO(_ecore_wl_log_dom, __VA_ARGS__)
54 # define WRN(...) EINA_LOG_DOM_WARN(_ecore_wl_log_dom, __VA_ARGS__)
59 # define CRI(...) EINA_LOG_DOM_CRIT(_ecore_wl_log_dom, __VA_ARGS__)
61 # ifdef ECORE_WL_DEFAULT_CURSOR_SIZE
62 # undef ECORE_WL_DEFAULT_CURSOR_SIZE
64 # define ECORE_WL_DEFAULT_CURSOR_SIZE 32
66 typedef struct _Ecore_Wl_Display Ecore_Wl_Display;
68 struct _Ecore_Wl_Display
72 struct wl_display *display;
73 struct wl_registry *registry;
74 struct wl_compositor *compositor;
75 struct wl_subcompositor *subcompositor;
76 struct wl_shell *shell;
77 struct xdg_shell *xdg_shell;
78 struct wl_shell *desktop_shell;
80 struct ivi_application *ivi_application;
83 struct wl_data_device_manager *data_device_manager;
84 struct tizen_policy *tz_policy;
85 struct tizen_surface_extension *tz_surf_ext;
86 struct wl_keyrouter *keyrouter;
93 Ecore_Fd_Handler *fd_hdl;
94 Ecore_Idle_Enterer *idle_enterer;
98 Eina_Inlist *globals; /** @since 1.7.6 */
104 struct xkb_context *context;
107 struct wl_cursor_theme *cursor_theme;
109 Ecore_Wl_Output *output;
110 Ecore_Wl_Input *input;
112 void (*output_configure)(Ecore_Wl_Output *output, void *data);
116 struct _Ecore_Wl_Window
118 Ecore_Wl_Display *display;
119 Ecore_Wl_Window *parent;
121 struct wl_surface *surface;
122 struct wl_shell_surface *shell_surface;
123 # ifdef USE_IVI_SHELL
124 struct ivi_surface *ivi_surface;
127 struct tizen_visibility *tz_visibility;
128 struct tizen_resource *tz_resource;
129 unsigned int resource_id;
131 struct wl_region *opaque_region;
132 struct wl_region *input_region;
134 struct xdg_surface *xdg_surface;
135 struct xdg_popup *xdg_popup;
136 Eina_Bool visible : 1;
137 Eina_Bool focused : 1;
138 Eina_Bool resizing : 1;
140 Eina_Bool fullscreen : 1;
141 Eina_Bool maximized : 1;
142 Eina_Bool minimized : 1;
146 struct wl_surface *surface;
155 const char *class_name;
157 Eina_Rectangle allocation;
169 /* Eina_Bool redraw_scheduled : 1; */
170 /* Eina_Bool resize_scheduled : 1; */
172 Eina_Bool transparent : 1;
173 Eina_Bool has_buffer : 1;
175 Ecore_Wl_Window_Type type;
176 Ecore_Wl_Window_Buffer_Type buffer_type;
178 Ecore_Wl_Input *pointer_device;
179 Ecore_Wl_Input *keyboard_device;
181 Eina_Bool anim_pending : 1;
182 struct wl_callback *anim_callback;
184 const char *cursor_name;
186 Ecore_Wl_Subsurf *subsurfs;
191 struct _Ecore_Wl_Input
194 Ecore_Wl_Display *display;
195 struct wl_seat *seat;
196 struct wl_pointer *pointer;
197 struct wl_keyboard *keyboard;
199 struct wl_touch *touch;
201 const char *cursor_name;
202 struct wl_cursor *cursor;
203 struct wl_surface *cursor_surface;
204 struct wl_callback *cursor_frame_cb;
205 Ecore_Timer *cursor_timer;
206 unsigned int cursor_current_index;
207 unsigned int cursor_size;
208 const char *cursor_theme_name;
210 struct wl_data_device *data_device;
211 struct wl_data_source *data_source;
212 struct wl_array data_types;
214 Ecore_Wl_Window *pointer_focus;
215 Ecore_Wl_Window *keyboard_focus;
216 Ecore_Wl_Window *touch_focus;
219 unsigned int timestamp;
220 unsigned int modifiers;
221 unsigned int pointer_enter_serial;
224 Ecore_Wl_Window *grab;
225 unsigned int grab_button;
226 unsigned int grab_timestamp;
227 unsigned int grab_count;
229 Ecore_Wl_Dnd_Source *drag_source;
230 Ecore_Wl_Dnd_Source *selection_source;
234 struct xkb_keymap *keymap;
235 struct xkb_state *state;
236 xkb_mod_mask_t control_mask;
237 xkb_mod_mask_t alt_mask;
238 xkb_mod_mask_t shift_mask;
239 xkb_mod_mask_t win_mask;
240 xkb_mod_mask_t scroll_mask;
241 xkb_mod_mask_t num_mask;
242 xkb_mod_mask_t caps_mask;
243 xkb_mod_mask_t altgr_mask;
244 unsigned int mods_depressed;
245 unsigned int mods_latched;
246 unsigned int mods_locked;
247 unsigned int mods_group;
253 unsigned int sym, key, time;
257 struct _Ecore_Wl_Output
260 Ecore_Wl_Display *display;
261 struct wl_output *output;
262 Eina_Rectangle allocation;
266 void (*destroy) (Ecore_Wl_Output *output, void *data);
272 Ecore_Wl_Display *ewd;
273 Ecore_Wl_Input *input;
276 struct _Ecore_Wl_Dnd_Source
278 Ecore_Wl_Input *input;
280 struct wl_data_offer *data_offer;
281 struct wl_array types;
288 struct _Ecore_Wl_Dnd_Target
290 Ecore_Wl_Dnd_Source *source;
293 extern Ecore_Wl_Display *_ecore_wl_disp;
295 void _ecore_wl_window_init(void);
296 void _ecore_wl_window_shutdown(void);
297 Eina_Hash *_ecore_wl_window_hash_get(void);
299 void _ecore_wl_output_add(Ecore_Wl_Display *ewd, unsigned int id);
300 void _ecore_wl_output_del(Ecore_Wl_Output *output);
302 void _ecore_wl_input_add(Ecore_Wl_Display *ewd, unsigned int id);
303 void _ecore_wl_input_del(Ecore_Wl_Input *input);
304 void _ecore_wl_input_pointer_xy_get(int *x, int *y);
305 void _ecore_wl_input_grab_release(Ecore_Wl_Input *input, Ecore_Wl_Window *win);
307 void _ecore_wl_dnd_add(Ecore_Wl_Input *input, struct wl_data_device *data_device, struct wl_data_offer *offer);
308 void _ecore_wl_dnd_enter(void *data, struct wl_data_device *data_device, unsigned int timestamp, struct wl_surface *surface, int x, int y, struct wl_data_offer *offer);
309 void _ecore_wl_dnd_leave(void *data, struct wl_data_device *data_device);
310 void _ecore_wl_dnd_motion(void *data, struct wl_data_device *data_device, unsigned int timestamp, int x, int y);
311 void _ecore_wl_dnd_drop(void *data, struct wl_data_device *data_device);
312 void _ecore_wl_dnd_selection(void *data, struct wl_data_device *data_device, struct wl_data_offer *offer);
313 void _ecore_wl_dnd_del(Ecore_Wl_Dnd_Source *source);
315 void _ecore_wl_events_init(void);
316 void _ecore_wl_events_shutdown(void);
318 void _ecore_wl_subsurfs_del_all(Ecore_Wl_Window *win);
320 struct wl_compositor *_ecore_wl_compositor_get(void);
321 struct wl_subcompositor *_ecore_wl_subcompositor_get(void);