diff options
author | David Walter Seikel | 2012-04-22 09:19:23 +1000 |
---|---|---|
committer | David Walter Seikel | 2012-04-22 09:19:23 +1000 |
commit | c963d75dfdeec11f82e79e727062fbf89afa2c04 (patch) | |
tree | 895633dbf641110be46f117c29890c49b3ffc0bd /libraries/ecore/src/lib/ecore_wayland/Ecore_Wayland.h | |
parent | Adding the new extantz viewer and grid manager. (diff) | |
download | SledjHamr-c963d75dfdeec11f82e79e727062fbf89afa2c04.zip SledjHamr-c963d75dfdeec11f82e79e727062fbf89afa2c04.tar.gz SledjHamr-c963d75dfdeec11f82e79e727062fbf89afa2c04.tar.bz2 SledjHamr-c963d75dfdeec11f82e79e727062fbf89afa2c04.tar.xz |
Update EFL to latest beta.
Diffstat (limited to '')
-rw-r--r-- | libraries/ecore/src/lib/ecore_wayland/Ecore_Wayland.h | 271 |
1 files changed, 226 insertions, 45 deletions
diff --git a/libraries/ecore/src/lib/ecore_wayland/Ecore_Wayland.h b/libraries/ecore/src/lib/ecore_wayland/Ecore_Wayland.h index fdf6314..7dab37c 100644 --- a/libraries/ecore/src/lib/ecore_wayland/Ecore_Wayland.h +++ b/libraries/ecore/src/lib/ecore_wayland/Ecore_Wayland.h | |||
@@ -1,8 +1,13 @@ | |||
1 | #ifndef _ECORE_WAYLAND_H_ | 1 | #ifndef _ECORE_WAYLAND_H_ |
2 | # define _ECORE_WAYLAND_H_ | 2 | # define _ECORE_WAYLAND_H_ |
3 | 3 | ||
4 | # define GL_GLEXT_PROTOTYPES | ||
5 | |||
4 | # include <Eina.h> | 6 | # include <Eina.h> |
5 | # include <wayland-client.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> | ||
6 | 11 | ||
7 | # ifdef EAPI | 12 | # ifdef EAPI |
8 | # undef EAPI | 13 | # undef EAPI |
@@ -18,71 +23,233 @@ | |||
18 | # define EAPI | 23 | # define EAPI |
19 | # endif | 24 | # endif |
20 | 25 | ||
26 | typedef enum _Ecore_Wl_Window_Type Ecore_Wl_Window_Type; | ||
27 | typedef enum _Ecore_Wl_Window_Buffer_Type Ecore_Wl_Window_Buffer_Type; | ||
28 | |||
29 | typedef struct _Ecore_Wl_Display Ecore_Wl_Display; | ||
30 | typedef struct _Ecore_Wl_Output Ecore_Wl_Output; | ||
31 | typedef struct _Ecore_Wl_Input Ecore_Wl_Input; | ||
32 | # ifndef _ECORE_WAYLAND_WINDOW_PREDEF | ||
33 | typedef struct _Ecore_Wl_Window Ecore_Wl_Window; | ||
34 | # endif | ||
35 | typedef struct _Ecore_Wl_Dnd_Source Ecore_Wl_Dnd_Source; | ||
36 | typedef struct _Ecore_Wl_Dnd_Target Ecore_Wl_Dnd_Target; | ||
37 | |||
21 | typedef struct _Ecore_Wl_Event_Mouse_In Ecore_Wl_Event_Mouse_In; | 38 | typedef struct _Ecore_Wl_Event_Mouse_In Ecore_Wl_Event_Mouse_In; |
22 | typedef struct _Ecore_Wl_Event_Mouse_Out Ecore_Wl_Event_Mouse_Out; | 39 | typedef struct _Ecore_Wl_Event_Mouse_Out Ecore_Wl_Event_Mouse_Out; |
23 | typedef struct _Ecore_Wl_Event_Focus_In Ecore_Wl_Event_Focus_In; | 40 | typedef struct _Ecore_Wl_Event_Focus_In Ecore_Wl_Event_Focus_In; |
24 | typedef struct _Ecore_Wl_Event_Focus_Out Ecore_Wl_Event_Focus_Out; | 41 | typedef struct _Ecore_Wl_Event_Focus_Out Ecore_Wl_Event_Focus_Out; |
42 | typedef struct _Ecore_Wl_Event_Window_Configure Ecore_Wl_Event_Window_Configure; | ||
43 | typedef struct _Ecore_Wl_Event_Dnd_Enter Ecore_Wl_Event_Dnd_Enter; | ||
44 | typedef struct _Ecore_Wl_Event_Dnd_Position Ecore_Wl_Event_Dnd_Position; | ||
45 | typedef struct _Ecore_Wl_Event_Dnd_Leave Ecore_Wl_Event_Dnd_Leave; | ||
46 | typedef struct _Ecore_Wl_Event_Dnd_Drop Ecore_Wl_Event_Dnd_Drop; | ||
47 | typedef struct _Ecore_Wl_Event_Interfaces_Bound Ecore_Wl_Event_Interfaces_Bound; | ||
25 | 48 | ||
26 | typedef struct _Ecore_Wl_Drag_Source Ecore_Wl_Drag_Source; | 49 | enum _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 | }; | ||
27 | 58 | ||
28 | typedef struct _Ecore_Wl_Event_Drag_Start Ecore_Wl_Event_Drag_Start; | 59 | enum _Ecore_Wl_Window_Buffer_Type |
29 | typedef struct _Ecore_Wl_Event_Drag_Stop Ecore_Wl_Event_Drag_Stop; | 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 | }; | ||
30 | 65 | ||
31 | struct _Ecore_Wl_Event_Mouse_In | 66 | struct _Ecore_Wl_Display |
32 | { | 67 | { |
33 | int modifiers; | 68 | struct |
34 | int x, y; | 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; | ||
35 | 76 | ||
36 | struct | 77 | struct |
37 | { | 78 | { |
38 | int x, y; | 79 | EGLDisplay display; |
39 | } root; | 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 | |||
104 | struct _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 | |||
115 | struct _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 | }; | ||
40 | 137 | ||
41 | unsigned int window; | 138 | struct _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; | ||
42 | 152 | ||
43 | unsigned int time; | 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; | ||
44 | }; | 164 | }; |
45 | 165 | ||
46 | struct _Ecore_Wl_Event_Mouse_Out | 166 | struct _Ecore_Wl_Event_Mouse_In |
47 | { | 167 | { |
48 | int modifiers; | 168 | int modifiers; |
49 | int x, y; | 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 | }; | ||
50 | 179 | ||
180 | struct _Ecore_Wl_Event_Mouse_Out | ||
181 | { | ||
182 | int modifiers; | ||
183 | int x, y; | ||
51 | struct | 184 | struct |
52 | { | 185 | { |
53 | int x, y; | 186 | int x, y; |
54 | } root; | 187 | } root; |
188 | unsigned int win; | ||
189 | unsigned int event_win; | ||
190 | unsigned int root_win; | ||
191 | unsigned int timestamp; | ||
192 | }; | ||
55 | 193 | ||
56 | unsigned int window; | 194 | struct _Ecore_Wl_Event_Focus_In |
195 | { | ||
196 | unsigned int win; | ||
197 | unsigned int timestamp; | ||
198 | }; | ||
57 | 199 | ||
58 | unsigned int time; | 200 | struct _Ecore_Wl_Event_Focus_Out |
201 | { | ||
202 | unsigned int win; | ||
203 | unsigned int timestamp; | ||
59 | }; | 204 | }; |
60 | 205 | ||
61 | struct _Ecore_Wl_Event_Focus_In | 206 | struct _Ecore_Wl_Event_Window_Configure |
62 | { | 207 | { |
63 | unsigned int window; | 208 | unsigned int win; |
64 | /* TODO: mode & detail */ | 209 | unsigned int event_win; |
65 | unsigned int time; | 210 | int x, y, w, h; |
211 | unsigned int timestamp; | ||
66 | }; | 212 | }; |
67 | 213 | ||
68 | struct _Ecore_Wl_Event_Focus_Out | 214 | struct _Ecore_Wl_Event_Dnd_Enter |
69 | { | 215 | { |
70 | unsigned int window; | 216 | unsigned int win, source; |
71 | /* TODO: mode & detail */ | 217 | char **types; |
72 | unsigned int time; | 218 | int num_types; |
219 | struct | ||
220 | { | ||
221 | int x, y; | ||
222 | } position; | ||
73 | }; | 223 | }; |
74 | 224 | ||
75 | struct _Ecore_Wl_Event_Drag_Start | 225 | struct _Ecore_Wl_Event_Dnd_Position |
76 | { | 226 | { |
77 | struct wl_data_device *device; | 227 | unsigned int win, source; |
78 | struct wl_surface *surface; | 228 | struct |
79 | const char *mime_type; | 229 | { |
80 | uint32_t timestamp; | 230 | int x, y; |
231 | } position; | ||
81 | }; | 232 | }; |
82 | 233 | ||
83 | struct _Ecore_Wl_Event_Drag_Stop | 234 | struct _Ecore_Wl_Event_Dnd_Leave |
84 | { | 235 | { |
236 | unsigned int win, source; | ||
237 | }; | ||
85 | 238 | ||
239 | struct _Ecore_Wl_Event_Dnd_Drop | ||
240 | { | ||
241 | unsigned int win, source; | ||
242 | struct | ||
243 | { | ||
244 | int x, y; | ||
245 | } position; | ||
246 | }; | ||
247 | |||
248 | struct _Ecore_Wl_Event_Interfaces_Bound | ||
249 | { | ||
250 | Eina_Bool compositor : 1; | ||
251 | Eina_Bool shm : 1; | ||
252 | Eina_Bool shell : 1; | ||
86 | }; | 253 | }; |
87 | 254 | ||
88 | /** | 255 | /** |
@@ -92,32 +259,46 @@ struct _Ecore_Wl_Event_Drag_Stop | |||
92 | * Ecore_Wl provides a wrapper and convenience functions for using the | 259 | * Ecore_Wl provides a wrapper and convenience functions for using the |
93 | * Wayland window system. Function groups for this part of the library | 260 | * Wayland window system. Function groups for this part of the library |
94 | * include the following: | 261 | * include the following: |
262 | * | ||
95 | * @li @ref Ecore_Wl_Init_Group | 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 | ||
96 | */ | 267 | */ |
97 | 268 | ||
269 | EAPI extern int ECORE_WL_EVENT_MOUSE_IN; | ||
270 | EAPI extern int ECORE_WL_EVENT_MOUSE_OUT; | ||
271 | EAPI extern int ECORE_WL_EVENT_FOCUS_IN; | ||
272 | EAPI extern int ECORE_WL_EVENT_FOCUS_OUT; | ||
273 | EAPI extern int ECORE_WL_EVENT_WINDOW_CONFIGURE; | ||
274 | EAPI extern int ECORE_WL_EVENT_DND_ENTER; | ||
275 | EAPI extern int ECORE_WL_EVENT_DND_POSITION; | ||
276 | EAPI extern int ECORE_WL_EVENT_DND_LEAVE; | ||
277 | EAPI extern int ECORE_WL_EVENT_DND_DROP; | ||
278 | EAPI extern int ECORE_WL_EVENT_INTERFACES_BOUND; | ||
279 | |||
98 | EAPI int ecore_wl_init(const char *name); | 280 | EAPI int ecore_wl_init(const char *name); |
99 | EAPI int ecore_wl_shutdown(void); | 281 | EAPI int ecore_wl_shutdown(void); |
100 | |||
101 | EAPI struct wl_display *ecore_wl_display_get(void); | ||
102 | EAPI struct wl_shm *ecore_wl_shm_get(void); | ||
103 | EAPI struct wl_compositor *ecore_wl_compositor_get(void); | ||
104 | EAPI struct wl_shell *ecore_wl_shell_get(void); | ||
105 | EAPI struct wl_input_device *ecore_wl_input_device_get(void); | ||
106 | EAPI void ecore_wl_screen_size_get(int *w, int *h); | ||
107 | EAPI unsigned int ecore_wl_format_get(void); | ||
108 | EAPI void ecore_wl_flush(void); | 282 | EAPI void ecore_wl_flush(void); |
109 | EAPI void ecore_wl_sync(void); | 283 | EAPI void ecore_wl_sync(void); |
284 | EAPI struct wl_shm *ecore_wl_shm_get(void); | ||
285 | EAPI struct wl_display *ecore_wl_display_get(void); | ||
286 | EAPI void ecore_wl_screen_size_get(int *w, int *h); | ||
110 | EAPI void ecore_wl_pointer_xy_get(int *x, int *y); | 287 | EAPI void ecore_wl_pointer_xy_get(int *x, int *y); |
111 | 288 | ||
112 | EAPI Ecore_Wl_Drag_Source *ecore_wl_drag_source_create(int hotspot_x, int hotspot_y, int offset_x, int offset_y, const char *mimetype, unsigned int timestamp, void *data); | 289 | EAPI Ecore_Wl_Window *ecore_wl_window_new(Ecore_Wl_Window *parent, int x, int y, int w, int h, int buffer_type); |
113 | EAPI void ecore_wl_drag_start(Ecore_Wl_Drag_Source *source, struct wl_surface *surface, struct wl_buffer *buffer); | 290 | EAPI void ecore_wl_window_free(Ecore_Wl_Window *win); |
114 | EAPI void ecore_wl_drag_stop(void); | 291 | EAPI void ecore_wl_window_move(Ecore_Wl_Window *win, int x, int y); |
115 | 292 | EAPI void ecore_wl_window_resize(Ecore_Wl_Window *win, int w, int h, int location); | |
116 | EAPI extern int ECORE_WL_EVENT_MOUSE_IN; | 293 | EAPI void ecore_wl_window_damage(Ecore_Wl_Window *win, int x, int y, int w, int h); |
117 | EAPI extern int ECORE_WL_EVENT_MOUSE_OUT; | 294 | EAPI void ecore_wl_window_buffer_attach(Ecore_Wl_Window *win, struct wl_buffer *buffer, int x, int y); |
118 | EAPI extern int ECORE_WL_EVENT_FOCUS_IN; | 295 | EAPI void ecore_wl_window_show(Ecore_Wl_Window *win); |
119 | EAPI extern int ECORE_WL_EVENT_FOCUS_OUT; | 296 | EAPI void ecore_wl_window_hide(Ecore_Wl_Window *win); |
120 | EAPI extern int ECORE_WL_EVENT_DRAG_START; | 297 | EAPI void ecore_wl_window_raise(Ecore_Wl_Window *win); |
121 | EAPI extern int ECORE_WL_EVENT_DRAG_STOP; | 298 | EAPI void ecore_wl_window_maximized_set(Ecore_Wl_Window *win, Eina_Bool maximized); |
299 | EAPI void ecore_wl_window_fullscreen_set(Ecore_Wl_Window *win, Eina_Bool fullscreen); | ||
300 | EAPI void ecore_wl_window_update_size(Ecore_Wl_Window *win, int w, int h); | ||
301 | EAPI struct wl_surface *ecore_wl_window_surface_get(Ecore_Wl_Window *win); | ||
302 | EAPI Ecore_Wl_Window *ecore_wl_window_find(unsigned int id); | ||
122 | 303 | ||
123 | #endif | 304 | #endif |