aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/libraries/ecore/src/lib/ecore_wayland/Ecore_Wayland.h
diff options
context:
space:
mode:
Diffstat (limited to 'libraries/ecore/src/lib/ecore_wayland/Ecore_Wayland.h')
-rw-r--r--libraries/ecore/src/lib/ecore_wayland/Ecore_Wayland.h304
1 files changed, 0 insertions, 304 deletions
diff --git a/libraries/ecore/src/lib/ecore_wayland/Ecore_Wayland.h b/libraries/ecore/src/lib/ecore_wayland/Ecore_Wayland.h
deleted file mode 100644
index 7dab37c..0000000
--- a/libraries/ecore/src/lib/ecore_wayland/Ecore_Wayland.h
+++ /dev/null
@@ -1,304 +0,0 @@
1#ifndef _ECORE_WAYLAND_H_
2# define _ECORE_WAYLAND_H_
3
4# define GL_GLEXT_PROTOTYPES
5
6# include <Eina.h>
7# include <wayland-client.h>
8# include <wayland-egl.h> // NB: already includes wayland-client.h
9# include <EGL/egl.h>
10# include <EGL/eglext.h>
11
12# ifdef EAPI
13# undef EAPI
14# endif
15
16# ifdef __GNUC__
17# if __GNUC__ >= 4
18# define EAPI __attribute__ ((visibility("default")))
19# else
20# define EAPI
21# endif
22# else
23# define EAPI
24# endif
25
26typedef enum _Ecore_Wl_Window_Type Ecore_Wl_Window_Type;
27typedef enum _Ecore_Wl_Window_Buffer_Type Ecore_Wl_Window_Buffer_Type;
28
29typedef struct _Ecore_Wl_Display Ecore_Wl_Display;
30typedef struct _Ecore_Wl_Output Ecore_Wl_Output;
31typedef struct _Ecore_Wl_Input Ecore_Wl_Input;
32# ifndef _ECORE_WAYLAND_WINDOW_PREDEF
33typedef struct _Ecore_Wl_Window Ecore_Wl_Window;
34# endif
35typedef struct _Ecore_Wl_Dnd_Source Ecore_Wl_Dnd_Source;
36typedef struct _Ecore_Wl_Dnd_Target Ecore_Wl_Dnd_Target;
37
38typedef struct _Ecore_Wl_Event_Mouse_In Ecore_Wl_Event_Mouse_In;
39typedef struct _Ecore_Wl_Event_Mouse_Out Ecore_Wl_Event_Mouse_Out;
40typedef struct _Ecore_Wl_Event_Focus_In Ecore_Wl_Event_Focus_In;
41typedef struct _Ecore_Wl_Event_Focus_Out Ecore_Wl_Event_Focus_Out;
42typedef struct _Ecore_Wl_Event_Window_Configure Ecore_Wl_Event_Window_Configure;
43typedef struct _Ecore_Wl_Event_Dnd_Enter Ecore_Wl_Event_Dnd_Enter;
44typedef struct _Ecore_Wl_Event_Dnd_Position Ecore_Wl_Event_Dnd_Position;
45typedef struct _Ecore_Wl_Event_Dnd_Leave Ecore_Wl_Event_Dnd_Leave;
46typedef struct _Ecore_Wl_Event_Dnd_Drop Ecore_Wl_Event_Dnd_Drop;
47typedef struct _Ecore_Wl_Event_Interfaces_Bound Ecore_Wl_Event_Interfaces_Bound;
48
49enum _Ecore_Wl_Window_Type
50{
51 ECORE_WL_WINDOW_TYPE_TOPLEVEL,
52 ECORE_WL_WINDOW_TYPE_FULLSCREEN,
53 ECORE_WL_WINDOW_TYPE_MAXIMIZED,
54 ECORE_WL_WINDOW_TYPE_TRANSIENT,
55 ECORE_WL_WINDOW_TYPE_MENU,
56 ECORE_WL_WINDOW_TYPE_CUSTOM
57};
58
59enum _Ecore_Wl_Window_Buffer_Type
60{
61 ECORE_WL_WINDOW_BUFFER_TYPE_EGL_WINDOW,
62 ECORE_WL_WINDOW_BUFFER_TYPE_EGL_IMAGE,
63 ECORE_WL_WINDOW_BUFFER_TYPE_SHM
64};
65
66struct _Ecore_Wl_Display
67{
68 struct
69 {
70 struct wl_display *display;
71 struct wl_compositor *compositor;
72 struct wl_shell *shell;
73 struct wl_shm *shm;
74 struct wl_data_device_manager *data_device_manager;
75 } wl;
76
77 struct
78 {
79 EGLDisplay display;
80 EGLConfig rgb_config;
81 EGLConfig argb_config;
82 EGLContext rgb_context;
83 EGLContext argb_context;
84 } egl;
85
86 int fd;
87 unsigned int mask;
88 Ecore_Fd_Handler *fd_hdl;
89
90 struct wl_list inputs;
91 struct wl_list outputs;
92
93 struct xkb_desc *xkb;
94
95 Ecore_Wl_Output *output;
96
97 PFNEGLCREATEIMAGEKHRPROC create_image;
98 PFNEGLDESTROYIMAGEKHRPROC destroy_image;
99
100 void (*output_configure)(Ecore_Wl_Output *output, void *data);
101 void *data;
102};
103
104struct _Ecore_Wl_Output
105{
106 Ecore_Wl_Display *display;
107 struct wl_output *output;
108 Eina_Rectangle allocation;
109 struct wl_list link;
110
111 void (*destroy) (Ecore_Wl_Output *output, void *data);
112 void *data;
113};
114
115struct _Ecore_Wl_Input
116{
117 Ecore_Wl_Display *display;
118 struct wl_input_device *input_device;
119 struct wl_data_device *data_device;
120
121 Ecore_Wl_Window *pointer_focus;
122 Ecore_Wl_Window *keyboard_focus;
123
124 unsigned int button;
125 unsigned int timestamp;
126 unsigned int modifiers;
127 int sx, sy;
128
129 struct wl_list link;
130
131 /* TODO: grab */
132 unsigned int grab_button;
133
134 Ecore_Wl_Dnd_Source *drag_source;
135 Ecore_Wl_Dnd_Source *selection_source;
136};
137
138struct _Ecore_Wl_Window
139{
140 Ecore_Wl_Display *display;
141 Ecore_Wl_Window *parent;
142
143 struct wl_surface *surface;
144 struct wl_shell_surface *shell_surface;
145
146 int id;
147 int x, y;
148 int edges;
149
150 Eina_Rectangle allocation, pending_allocation;
151 Eina_Rectangle saved_allocation, server_allocation;
152
153 /* Eina_Bool redraw_scheduled : 1; */
154 /* Eina_Bool resize_scheduled : 1; */
155 Eina_Bool transparent : 1;
156
157 Ecore_Wl_Window_Type type;
158 Ecore_Wl_Window_Buffer_Type buffer_type;
159
160 Ecore_Wl_Input *pointer_device;
161 Ecore_Wl_Input *keyboard_device;
162
163 void *data;
164};
165
166struct _Ecore_Wl_Event_Mouse_In
167{
168 int modifiers;
169 int x, y;
170 struct
171 {
172 int x, y;
173 } root;
174 unsigned int win;
175 unsigned int event_win;
176 unsigned int root_win;
177 unsigned int timestamp;
178};
179
180struct _Ecore_Wl_Event_Mouse_Out
181{
182 int modifiers;
183 int x, y;
184 struct
185 {
186 int x, y;
187 } root;
188 unsigned int win;
189 unsigned int event_win;
190 unsigned int root_win;
191 unsigned int timestamp;
192};
193
194struct _Ecore_Wl_Event_Focus_In
195{
196 unsigned int win;
197 unsigned int timestamp;
198};
199
200struct _Ecore_Wl_Event_Focus_Out
201{
202 unsigned int win;
203 unsigned int timestamp;
204};
205
206struct _Ecore_Wl_Event_Window_Configure
207{
208 unsigned int win;
209 unsigned int event_win;
210 int x, y, w, h;
211 unsigned int timestamp;
212};
213
214struct _Ecore_Wl_Event_Dnd_Enter
215{
216 unsigned int win, source;
217 char **types;
218 int num_types;
219 struct
220 {
221 int x, y;
222 } position;
223};
224
225struct _Ecore_Wl_Event_Dnd_Position
226{
227 unsigned int win, source;
228 struct
229 {
230 int x, y;
231 } position;
232};
233
234struct _Ecore_Wl_Event_Dnd_Leave
235{
236 unsigned int win, source;
237};
238
239struct _Ecore_Wl_Event_Dnd_Drop
240{
241 unsigned int win, source;
242 struct
243 {
244 int x, y;
245 } position;
246};
247
248struct _Ecore_Wl_Event_Interfaces_Bound
249{
250 Eina_Bool compositor : 1;
251 Eina_Bool shm : 1;
252 Eina_Bool shell : 1;
253};
254
255/**
256 * @file
257 * @brief Ecore functions for dealing with the Wayland window system
258 *
259 * Ecore_Wl provides a wrapper and convenience functions for using the
260 * Wayland window system. Function groups for this part of the library
261 * include the following:
262 *
263 * @li @ref Ecore_Wl_Init_Group
264 * @li @ref Ecore_Wl_Display_Group
265 * @li @ref Ecore_Wl_Flush_Group
266 * @li @ref Ecore_Wl_Window_Group
267 */
268
269EAPI extern int ECORE_WL_EVENT_MOUSE_IN;
270EAPI extern int ECORE_WL_EVENT_MOUSE_OUT;
271EAPI extern int ECORE_WL_EVENT_FOCUS_IN;
272EAPI extern int ECORE_WL_EVENT_FOCUS_OUT;
273EAPI extern int ECORE_WL_EVENT_WINDOW_CONFIGURE;
274EAPI extern int ECORE_WL_EVENT_DND_ENTER;
275EAPI extern int ECORE_WL_EVENT_DND_POSITION;
276EAPI extern int ECORE_WL_EVENT_DND_LEAVE;
277EAPI extern int ECORE_WL_EVENT_DND_DROP;
278EAPI extern int ECORE_WL_EVENT_INTERFACES_BOUND;
279
280EAPI int ecore_wl_init(const char *name);
281EAPI int ecore_wl_shutdown(void);
282EAPI void ecore_wl_flush(void);
283EAPI void ecore_wl_sync(void);
284EAPI struct wl_shm *ecore_wl_shm_get(void);
285EAPI struct wl_display *ecore_wl_display_get(void);
286EAPI void ecore_wl_screen_size_get(int *w, int *h);
287EAPI void ecore_wl_pointer_xy_get(int *x, int *y);
288
289EAPI Ecore_Wl_Window *ecore_wl_window_new(Ecore_Wl_Window *parent, int x, int y, int w, int h, int buffer_type);
290EAPI void ecore_wl_window_free(Ecore_Wl_Window *win);
291EAPI void ecore_wl_window_move(Ecore_Wl_Window *win, int x, int y);
292EAPI void ecore_wl_window_resize(Ecore_Wl_Window *win, int w, int h, int location);
293EAPI void ecore_wl_window_damage(Ecore_Wl_Window *win, int x, int y, int w, int h);
294EAPI void ecore_wl_window_buffer_attach(Ecore_Wl_Window *win, struct wl_buffer *buffer, int x, int y);
295EAPI void ecore_wl_window_show(Ecore_Wl_Window *win);
296EAPI void ecore_wl_window_hide(Ecore_Wl_Window *win);
297EAPI void ecore_wl_window_raise(Ecore_Wl_Window *win);
298EAPI void ecore_wl_window_maximized_set(Ecore_Wl_Window *win, Eina_Bool maximized);
299EAPI void ecore_wl_window_fullscreen_set(Ecore_Wl_Window *win, Eina_Bool fullscreen);
300EAPI void ecore_wl_window_update_size(Ecore_Wl_Window *win, int w, int h);
301EAPI struct wl_surface *ecore_wl_window_surface_get(Ecore_Wl_Window *win);
302EAPI Ecore_Wl_Window *ecore_wl_window_find(unsigned int id);
303
304#endif