summaryrefslogtreecommitdiff
path: root/legacy
diff options
context:
space:
mode:
authorEduardo Lima (Etrunko) <eduardo.lima@intel.com>2012-10-08 14:09:53 +0000
committerEduardo de Barros Lima <eblima@gmail.com>2012-10-08 14:09:53 +0000
commit352926829efe25f7d4bcaf344ad80d98676c5fe9 (patch)
tree0e0fc87eb0c07c2639bcacb57d99895e2f2ca0f6 /legacy
parente505eb5584fc21fd0aa934e614451db43a4d665a (diff)
Ecore_Evas: Share code between SHM and EGL
implementations Signed-off-by: Eduardo Lima (Etrunko) <eduardo.lima@intel.com> SVN revision: 77579
Diffstat (limited to 'legacy')
-rw-r--r--legacy/ecore/src/lib/ecore_evas/Makefile.am5
-rw-r--r--legacy/ecore/src/lib/ecore_evas/ecore_evas.c16
-rw-r--r--legacy/ecore/src/lib/ecore_evas/ecore_evas_private.h34
-rw-r--r--legacy/ecore/src/lib/ecore_evas/ecore_evas_wayland_common.c631
-rw-r--r--legacy/ecore/src/lib/ecore_evas/ecore_evas_wayland_egl.c795
-rw-r--r--legacy/ecore/src/lib/ecore_evas/ecore_evas_wayland_shm.c805
6 files changed, 767 insertions, 1519 deletions
diff --git a/legacy/ecore/src/lib/ecore_evas/Makefile.am b/legacy/ecore/src/lib/ecore_evas/Makefile.am
index cd7f37b..db77449 100644
--- a/legacy/ecore/src/lib/ecore_evas/Makefile.am
+++ b/legacy/ecore/src/lib/ecore_evas/Makefile.am
@@ -132,6 +132,11 @@ ecore_evas_wayland_shm.c \
132ecore_evas_wayland_egl.c \ 132ecore_evas_wayland_egl.c \
133ecore_evas_extn.c 133ecore_evas_extn.c
134 134
135if BUILD_ECORE_WAYLAND
136libecore_evas_la_SOURCES += \
137ecore_evas_wayland_common.c
138endif
139
135libecore_evas_la_LIBADD = \ 140libecore_evas_la_LIBADD = \
136$(ECORE_X_LIB) \ 141$(ECORE_X_LIB) \
137$(ECORE_FB_LIB) \ 142$(ECORE_FB_LIB) \
diff --git a/legacy/ecore/src/lib/ecore_evas/ecore_evas.c b/legacy/ecore/src/lib/ecore_evas/ecore_evas.c
index 0cafe92..7943520 100644
--- a/legacy/ecore/src/lib/ecore_evas/ecore_evas.c
+++ b/legacy/ecore/src/lib/ecore_evas/ecore_evas.c
@@ -2789,17 +2789,13 @@ EAPI void
2789ecore_evas_wayland_move(Ecore_Evas *ee, int x, int y) 2789ecore_evas_wayland_move(Ecore_Evas *ee, int x, int y)
2790{ 2790{
2791 if (!ee) return; 2791 if (!ee) return;
2792 if (!strcmp(ee->driver, "wayland_shm")) 2792 if (!strncmp(ee->driver, "wayland", 7))
2793 {
2794#ifdef BUILD_ECORE_EVAS_WAYLAND_SHM
2795 _ecore_evas_wayland_shm_move(ee, x, y);
2796#endif
2797 }
2798 else if (!strcmp(ee->driver, "wayland_egl"))
2799 { 2793 {
2800#ifdef BUILD_ECORE_EVAS_WAYLAND_EGL 2794 if (ee->engine.wl.win)
2801 _ecore_evas_wayland_egl_move(ee, x, y); 2795 {
2802#endif 2796 ee->engine.wl.win->moving = EINA_TRUE;
2797 ecore_wl_window_move(ee->engine.wl.win, x, y);
2798 }
2803 } 2799 }
2804} 2800}
2805 2801
diff --git a/legacy/ecore/src/lib/ecore_evas/ecore_evas_private.h b/legacy/ecore/src/lib/ecore_evas/ecore_evas_private.h
index f79863b..be90327 100644
--- a/legacy/ecore/src/lib/ecore_evas/ecore_evas_private.h
+++ b/legacy/ecore/src/lib/ecore_evas/ecore_evas_private.h
@@ -431,14 +431,44 @@ void _ecore_evas_ews_events_init(void);
431int _ecore_evas_ews_shutdown(void); 431int _ecore_evas_ews_shutdown(void);
432#endif 432#endif
433 433
434#if defined(BUILD_ECORE_EVAS_WAYLAND_SHM) || defined(BUILD_ECORE_EVAS_WAYLAND_EGL)
435int _ecore_evas_wl_common_init(void);
436int _ecore_evas_wl_common_shutdown(void);
437void _ecore_evas_wl_common_pre_free(Ecore_Evas *ee);
438void _ecore_evas_wl_common_free(Ecore_Evas *ee);
439void _ecore_evas_wl_common_callback_resize_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee));
440void _ecore_evas_wl_common_callback_move_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee));
441void _ecore_evas_wl_common_callback_delete_request_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee));
442void _ecore_evas_wl_common_callback_focus_in_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee));
443void _ecore_evas_wl_common_callback_focus_out_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee));
444void _ecore_evas_wl_common_callback_mouse_in_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee));
445void _ecore_evas_wl_common_callback_mouse_out_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee));
446void _ecore_evas_wl_common_move(Ecore_Evas *ee, int x, int y);
447void _ecore_evas_wl_common_raise(Ecore_Evas *ee);
448void _ecore_evas_wl_common_title_set(Ecore_Evas *ee, const char *title);
449void _ecore_evas_wl_common_name_class_set(Ecore_Evas *ee, const char *n, const char *c);
450void _ecore_evas_wl_common_size_min_set(Ecore_Evas *ee, int w, int h);
451void _ecore_evas_wl_common_size_max_set(Ecore_Evas *ee, int w, int h);
452void _ecore_evas_wl_common_size_base_set(Ecore_Evas *ee, int w, int h);
453void _ecore_evas_wl_common_size_step_set(Ecore_Evas *ee, int w, int h);
454void _ecore_evas_wl_common_layer_set(Ecore_Evas *ee, int layer);
455void _ecore_evas_wl_common_iconified_set(Ecore_Evas *ee, int iconify);
456void _ecore_evas_wl_common_maximized_set(Ecore_Evas *ee, int max);
457void _ecore_evas_wl_common_fullscreen_set(Ecore_Evas *ee, int full);
458void _ecore_evas_wl_common_ignore_events_set(Ecore_Evas *ee, int ignore);
459int _ecore_evas_wl_common_render(Ecore_Evas *ee);
460void _ecore_evas_wl_common_screen_geometry_get(const Ecore_Evas *ee, int *x, int *y, int *w, int *h);
461void _ecore_evas_wl_common_screen_dpi_get(const Ecore_Evas *ee, int *xdpi, int *ydpi);
462
463Evas_Object * _ecore_evas_wl_common_frame_add(Evas *evas);
464
434#ifdef BUILD_ECORE_EVAS_WAYLAND_SHM 465#ifdef BUILD_ECORE_EVAS_WAYLAND_SHM
435void _ecore_evas_wayland_shm_resize(Ecore_Evas *ee, int location); 466void _ecore_evas_wayland_shm_resize(Ecore_Evas *ee, int location);
436void _ecore_evas_wayland_shm_move(Ecore_Evas *ee, int x, int y);
437#endif 467#endif
438 468
439#ifdef BUILD_ECORE_EVAS_WAYLAND_EGL 469#ifdef BUILD_ECORE_EVAS_WAYLAND_EGL
440void _ecore_evas_wayland_egl_resize(Ecore_Evas *ee, int location); 470void _ecore_evas_wayland_egl_resize(Ecore_Evas *ee, int location);
441void _ecore_evas_wayland_egl_move(Ecore_Evas *ee, int x, int y); 471#endif
442#endif 472#endif
443 473
444void _ecore_evas_fps_debug_init(void); 474void _ecore_evas_fps_debug_init(void);
diff --git a/legacy/ecore/src/lib/ecore_evas/ecore_evas_wayland_common.c b/legacy/ecore/src/lib/ecore_evas/ecore_evas_wayland_common.c
new file mode 100644
index 0000000..748e022
--- /dev/null
+++ b/legacy/ecore/src/lib/ecore_evas/ecore_evas_wayland_common.c
@@ -0,0 +1,631 @@
1#ifdef HAVE_CONFIG_H
2# include "config.h"
3#endif
4
5#include "ecore_evas_private.h"
6#include "Ecore_Evas.h"
7
8/* local structures */
9typedef struct _EE_Wl_Smart_Data EE_Wl_Smart_Data;
10struct _EE_Wl_Smart_Data
11{
12 Evas_Object *frame;
13 Evas_Object *text;
14 Evas_Coord x, y, w, h;
15};
16
17static Evas_Smart *_ecore_evas_wl_common_smart = NULL;
18
19/* local variables */
20
21static int _ecore_evas_wl_init_count = 0;
22static Ecore_Event_Handler *_ecore_evas_wl_event_hdls[5];
23
24static Eina_Bool
25_ecore_evas_wl_common_cb_mouse_in(void *data __UNUSED__, int type __UNUSED__, void *event)
26{
27 Ecore_Evas *ee;
28 Ecore_Wl_Event_Mouse_In *ev;
29
30 ev = event;
31 ee = ecore_event_window_match(ev->window);
32 if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON;
33 if (ev->window != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
34 if (!ee->in)
35 {
36 if (ee->func.fn_mouse_in) ee->func.fn_mouse_in(ee);
37 ecore_event_evas_modifier_lock_update(ee->evas, ev->modifiers);
38 evas_event_feed_mouse_in(ee->evas, ev->timestamp, NULL);
39 ee->in = EINA_TRUE;
40 }
41 return ECORE_CALLBACK_PASS_ON;
42}
43
44static Eina_Bool
45_ecore_evas_wl_common_cb_mouse_out(void *data __UNUSED__, int type __UNUSED__, void *event)
46{
47 Ecore_Evas *ee;
48 Ecore_Wl_Event_Mouse_Out *ev;
49
50 ev = event;
51 ee = ecore_event_window_match(ev->window);
52 if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON;
53 if (ev->window != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
54 if (ee->in)
55 {
56 ecore_event_evas_modifier_lock_update(ee->evas, ev->modifiers);
57 evas_event_feed_mouse_out(ee->evas, ev->timestamp, NULL);
58 if (ee->func.fn_mouse_out) ee->func.fn_mouse_out(ee);
59 if (ee->prop.cursor.object) evas_object_hide(ee->prop.cursor.object);
60 ee->in = EINA_FALSE;
61 }
62 return ECORE_CALLBACK_PASS_ON;
63}
64
65static Eina_Bool
66_ecore_evas_wl_common_cb_focus_in(void *data __UNUSED__, int type __UNUSED__, void *event)
67{
68 Ecore_Evas *ee;
69 Ecore_Wl_Event_Focus_In *ev;
70
71 ev = event;
72 ee = ecore_event_window_match(ev->win);
73 if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON;
74 if (ev->win != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
75 ee->prop.focused = 1;
76 evas_focus_in(ee->evas);
77 if (ee->func.fn_focus_in) ee->func.fn_focus_in(ee);
78 return ECORE_CALLBACK_PASS_ON;
79}
80
81static Eina_Bool
82_ecore_evas_wl_common_cb_focus_out(void *data __UNUSED__, int type __UNUSED__, void *event)
83{
84 Ecore_Evas *ee;
85 Ecore_Wl_Event_Focus_In *ev;
86
87 ev = event;
88 ee = ecore_event_window_match(ev->win);
89 if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON;
90 if (ev->win != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
91 evas_focus_out(ee->evas);
92 ee->prop.focused = 0;
93 if (ee->func.fn_focus_out) ee->func.fn_focus_out(ee);
94 return ECORE_CALLBACK_PASS_ON;
95}
96
97static Eina_Bool
98_ecore_evas_wl_common_cb_window_configure(void *data __UNUSED__, int type __UNUSED__, void *event)
99{
100 Ecore_Evas *ee;
101 Ecore_Wl_Event_Window_Configure *ev;
102 int nw = 0, nh = 0;
103
104 ev = event;
105 ee = ecore_event_window_match(ev->win);
106 if (!ee) return ECORE_CALLBACK_PASS_ON;
107 if (ev->win != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
108
109 if (ee->prop.fullscreen)
110 {
111 _ecore_evas_wl_common_move(ee, ev->x, ev->y);
112 ee->engine.func->fn_resize(ee, ev->w, ev->h);
113
114 return ECORE_CALLBACK_PASS_ON;
115 }
116
117 if ((ee->x != ev->x) || (ee->y != ev->y))
118 {
119 ee->req.x = ee->x;
120 ee->req.y = ee->y;
121 if (ee->func.fn_move) ee->func.fn_move(ee);
122 }
123
124 nw = ev->w;
125 nh = ev->h;
126
127 if ((ee->prop.maximized) || (!ee->prop.fullscreen))
128 {
129 int fw = 0, fh = 0;
130
131 evas_output_framespace_get(ee->evas, NULL, NULL, &fw, &fh);
132 nw = ev->w - fw;
133 nh = ev->h - fh;
134 }
135
136 if (ee->prop.min.w > nw) nw = ee->prop.min.w;
137 else if (nw > ee->prop.max.w) nw = ee->prop.max.w;
138 if (ee->prop.min.h > nh) nh = ee->prop.min.h;
139 else if (nh > ee->prop.max.h) nh = ee->prop.max.h;
140
141 if ((ee->w != nw) || (ee->h != nh))
142 {
143 ee->req.w = nw;
144 ee->req.h = nh;
145 if (ee->func.fn_resize) ee->func.fn_resize(ee);
146 }
147
148 return ECORE_CALLBACK_PASS_ON;
149}
150
151int
152_ecore_evas_wl_common_init(void)
153{
154 if (++_ecore_evas_wl_init_count != 1)
155 return _ecore_evas_wl_init_count;
156
157 _ecore_evas_wl_event_hdls[0] =
158 ecore_event_handler_add(ECORE_WL_EVENT_MOUSE_IN,
159 _ecore_evas_wl_common_cb_mouse_in, NULL);
160 _ecore_evas_wl_event_hdls[1] =
161 ecore_event_handler_add(ECORE_WL_EVENT_MOUSE_OUT,
162 _ecore_evas_wl_common_cb_mouse_out, NULL);
163 _ecore_evas_wl_event_hdls[2] =
164 ecore_event_handler_add(ECORE_WL_EVENT_FOCUS_IN,
165 _ecore_evas_wl_common_cb_focus_in, NULL);
166 _ecore_evas_wl_event_hdls[3] =
167 ecore_event_handler_add(ECORE_WL_EVENT_FOCUS_OUT,
168 _ecore_evas_wl_common_cb_focus_out, NULL);
169 _ecore_evas_wl_event_hdls[4] =
170 ecore_event_handler_add(ECORE_WL_EVENT_WINDOW_CONFIGURE,
171 _ecore_evas_wl_common_cb_window_configure, NULL);
172
173 ecore_event_evas_init();
174
175 return _ecore_evas_wl_init_count;
176}
177
178int
179_ecore_evas_wl_common_shutdown(void)
180{
181 unsigned int i = 0;
182
183 if (--_ecore_evas_wl_init_count != 0)
184 return _ecore_evas_wl_init_count;
185
186 for (i = 0; i < sizeof(_ecore_evas_wl_event_hdls) / sizeof(Ecore_Event_Handler *); i++)
187 {
188 if (_ecore_evas_wl_event_hdls[i])
189 ecore_event_handler_del(_ecore_evas_wl_event_hdls[i]);
190 }
191
192 ecore_event_evas_shutdown();
193
194 return _ecore_evas_wl_init_count;
195}
196
197void
198_ecore_evas_wl_common_pre_free(Ecore_Evas *ee)
199{
200 if (!ee) return;
201 if (ee->engine.wl.frame) evas_object_del(ee->engine.wl.frame);
202}
203
204void
205_ecore_evas_wl_common_free(Ecore_Evas *ee)
206{
207 if (ee->engine.wl.win) ecore_wl_window_free(ee->engine.wl.win);
208 ee->engine.wl.win = NULL;
209
210 ecore_event_window_unregister(ee->prop.window);
211 ecore_evas_input_event_unregister(ee);
212
213 _ecore_evas_wl_common_shutdown();
214 ecore_wl_shutdown();
215}
216
217void
218_ecore_evas_wl_common_resize(Ecore_Evas *ee, int w, int h)
219{
220 if (w < 1) w = 1;
221 if (h < 1) h = 1;
222
223 ee->req.w = w;
224 ee->req.h = h;
225
226 if (!ee->prop.fullscreen)
227 {
228 int fw = 0, fh = 0;
229
230 if (ee->prop.min.w > w) w = ee->prop.min.w;
231 else if (w > ee->prop.max.w) w = ee->prop.max.w;
232 if (ee->prop.min.h > h) h = ee->prop.min.h;
233 else if (h > ee->prop.max.h) h = ee->prop.max.h;
234
235 evas_output_framespace_get(ee->evas, NULL, NULL, &fw, &fh);
236 w += fw;
237 h += fh;
238 }
239
240 if ((ee->w != w) || (ee->h != h))
241 {
242 ee->w = w;
243 ee->h = h;
244
245 if ((ee->rotation == 90) || (ee->rotation == 270))
246 {
247 evas_output_size_set(ee->evas, h, w);
248 evas_output_viewport_set(ee->evas, 0, 0, h, w);
249 }
250 else
251 {
252 evas_output_size_set(ee->evas, w, h);
253 evas_output_viewport_set(ee->evas, 0, 0, w, h);
254 }
255
256 if (ee->prop.avoid_damage)
257 {
258 int pdam = 0;
259
260 pdam = ecore_evas_avoid_damage_get(ee);
261 ecore_evas_avoid_damage_set(ee, 0);
262 ecore_evas_avoid_damage_set(ee, pdam);
263 }
264
265 if (ee->engine.wl.frame)
266 evas_object_resize(ee->engine.wl.frame, w, h);
267 }
268}
269
270void
271_ecore_evas_wl_common_callback_resize_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee))
272{
273 if (!ee) return;
274 ee->func.fn_resize = func;
275}
276
277void
278_ecore_evas_wl_common_callback_move_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee))
279{
280 if (!ee) return;
281 ee->func.fn_move = func;
282}
283
284void
285_ecore_evas_wl_common_callback_delete_request_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee))
286{
287 if (!ee) return;
288 ee->func.fn_delete_request = func;
289}
290
291void
292_ecore_evas_wl_common_callback_focus_in_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee))
293{
294 if (!ee) return;
295 ee->func.fn_focus_in = func;
296}
297
298void
299_ecore_evas_wl_common_callback_focus_out_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee))
300{
301 if (!ee) return;
302 ee->func.fn_focus_out = func;
303}
304
305void
306_ecore_evas_wl_common_callback_mouse_in_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee))
307{
308 if (!ee) return;
309 ee->func.fn_mouse_in = func;
310}
311
312void
313_ecore_evas_wl_common_callback_mouse_out_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee))
314{
315 if (!ee) return;
316 ee->func.fn_mouse_out = func;
317}
318
319void
320_ecore_evas_wl_common_move(Ecore_Evas *ee, int x, int y)
321{
322 if (!ee) return;
323
324 ee->req.x = x;
325 ee->req.y = y;
326
327 if ((ee->x != x) || (ee->y != y))
328 {
329 ee->x = x;
330 ee->y = y;
331 if (ee->engine.wl.win)
332 ecore_wl_window_update_location(ee->engine.wl.win, x, y);
333 if (ee->func.fn_move) ee->func.fn_move(ee);
334 }
335}
336
337static void
338_ecore_evas_wl_common_smart_add(Evas_Object *obj)
339{
340 EE_Wl_Smart_Data *sd;
341 Evas *evas;
342
343 if (!(sd = calloc(1, sizeof(EE_Wl_Smart_Data)))) return;
344
345 evas = evas_object_evas_get(obj);
346
347 sd->x = 0;
348 sd->y = 0;
349 sd->w = 1;
350 sd->h = 1;
351
352 sd->frame = evas_object_rectangle_add(evas);
353 evas_object_is_frame_object_set(sd->frame, EINA_TRUE);
354 evas_object_color_set(sd->frame, 249, 249, 249, 255);
355 evas_object_smart_member_add(sd->frame, obj);
356
357 sd->text = evas_object_text_add(evas);
358 evas_object_color_set(sd->text, 0, 0, 0, 255);
359 evas_object_text_style_set(sd->text, EVAS_TEXT_STYLE_PLAIN);
360 evas_object_text_font_set(sd->text, "Sans", 10);
361 evas_object_text_text_set(sd->text, "Smart Test");
362
363 evas_object_smart_data_set(obj, sd);
364}
365
366static void
367_ecore_evas_wl_common_smart_del(Evas_Object *obj)
368{
369 EE_Wl_Smart_Data *sd;
370
371 if (!(sd = evas_object_smart_data_get(obj))) return;
372 evas_object_del(sd->text);
373 evas_object_del(sd->frame);
374 free(sd);
375}
376
377static void
378_ecore_evas_wl_common_smart_resize(Evas_Object *obj, Evas_Coord w, Evas_Coord h)
379{
380 EE_Wl_Smart_Data *sd;
381
382 if (!(sd = evas_object_smart_data_get(obj))) return;
383 if ((sd->w == w) && (sd->h == h)) return;
384 sd->w = w;
385 sd->h = h;
386 evas_object_resize(sd->frame, w, h);
387}
388
389static void
390_ecore_evas_wl_common_smart_show(Evas_Object *obj)
391{
392 EE_Wl_Smart_Data *sd;
393
394 if (!(sd = evas_object_smart_data_get(obj))) return;
395 evas_object_show(sd->frame);
396 evas_object_show(sd->text);
397}
398
399static void
400_ecore_evas_wl_common_smart_hide(Evas_Object *obj)
401{
402 EE_Wl_Smart_Data *sd;
403
404 if (!(sd = evas_object_smart_data_get(obj))) return;
405 evas_object_hide(sd->text);
406 evas_object_hide(sd->frame);
407}
408
409static void
410_ecore_evas_wl_common_smart_init(void)
411{
412 if (_ecore_evas_wl_common_smart) return;
413 {
414 static const Evas_Smart_Class sc =
415 {
416 "ecore_evas_wl_frame", EVAS_SMART_CLASS_VERSION,
417 _ecore_evas_wl_common_smart_add,
418 _ecore_evas_wl_common_smart_del,
419 NULL,
420 _ecore_evas_wl_common_smart_resize,
421 _ecore_evas_wl_common_smart_show,
422 _ecore_evas_wl_common_smart_hide,
423 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
424 };
425 _ecore_evas_wl_common_smart = evas_smart_class_new(&sc);
426 }
427}
428
429Evas_Object *
430_ecore_evas_wl_common_frame_add(Evas *evas)
431{
432 _ecore_evas_wl_common_smart_init();
433 return evas_object_smart_add(evas, _ecore_evas_wl_common_smart);
434}
435
436void
437_ecore_evas_wl_common_raise(Ecore_Evas *ee)
438{
439 if ((!ee) || (!ee->visible)) return;
440 ecore_wl_window_raise(ee->engine.wl.win);
441}
442
443void
444_ecore_evas_wl_common_title_set(Ecore_Evas *ee, const char *title)
445{
446 if (!ee) return;
447 if (ee->prop.title) free(ee->prop.title);
448 ee->prop.title = NULL;
449 if (title) ee->prop.title = strdup(title);
450 if ((ee->prop.draw_frame) && (ee->engine.wl.frame))
451 {
452 EE_Wl_Smart_Data *sd;
453
454 if (!(sd = evas_object_smart_data_get(ee->engine.wl.frame))) return;
455 evas_object_text_text_set(sd->text, ee->prop.title);
456 }
457
458 if ((ee->prop.title) && (ee->engine.wl.win->shell_surface))
459 wl_shell_surface_set_title(ee->engine.wl.win->shell_surface,
460 ee->prop.title);
461}
462
463void
464_ecore_evas_wl_common_name_class_set(Ecore_Evas *ee, const char *n, const char *c)
465{
466 if (!ee) return;
467 if (ee->prop.name) free(ee->prop.name);
468 if (ee->prop.clas) free(ee->prop.clas);
469 ee->prop.name = NULL;
470 ee->prop.clas = NULL;
471 if (n) ee->prop.name = strdup(n);
472 if (c) ee->prop.clas = strdup(c);
473
474 if ((ee->prop.clas) && (ee->engine.wl.win->shell_surface))
475 wl_shell_surface_set_class(ee->engine.wl.win->shell_surface,
476 ee->prop.clas);
477}
478
479void
480_ecore_evas_wl_common_size_min_set(Ecore_Evas *ee, int w, int h)
481{
482 if (!ee) return;
483 if (w < 0) w = 0;
484 if (h < 0) h = 0;
485 if ((ee->prop.min.w == w) && (ee->prop.min.h == h)) return;
486 ee->prop.min.w = w;
487 ee->prop.min.h = h;
488}
489
490void
491_ecore_evas_wl_common_size_max_set(Ecore_Evas *ee, int w, int h)
492{
493 if (!ee) return;
494 if (w < 0) w = 0;
495 if (h < 0) h = 0;
496 if ((ee->prop.max.w == w) && (ee->prop.max.h == h)) return;
497 ee->prop.max.w = w;
498 ee->prop.max.h = h;
499}
500
501void
502_ecore_evas_wl_common_size_base_set(Ecore_Evas *ee, int w, int h)
503{
504 if (!ee) return;
505 if (w < 0) w = 0;
506 if (h < 0) h = 0;
507 if ((ee->prop.base.w == w) && (ee->prop.base.h == h)) return;
508 ee->prop.base.w = w;
509 ee->prop.base.h = h;
510}
511
512void
513_ecore_evas_wl_common_size_step_set(Ecore_Evas *ee, int w, int h)
514{
515 if (!ee) return;
516 if (w < 0) w = 0;
517 if (h < 0) h = 0;
518 if ((ee->prop.step.w == w) && (ee->prop.step.h == h)) return;
519 ee->prop.step.w = w;
520 ee->prop.step.h = h;
521}
522
523void
524_ecore_evas_wl_common_layer_set(Ecore_Evas *ee, int layer)
525{
526 if (!ee) return;
527 if (ee->prop.layer == layer) return;
528 if (layer < 1) layer = 1;
529 else if (layer > 255) layer = 255;
530 ee->prop.layer = layer;
531}
532
533void
534_ecore_evas_wl_common_iconified_set(Ecore_Evas *ee, int iconify)
535{
536 if (!ee) return;
537 if (ee->prop.iconified == iconify) return;
538 ee->prop.iconified = iconify;
539 /* FIXME: Implement this in Wayland someshow */
540}
541
542void
543_ecore_evas_wl_common_maximized_set(Ecore_Evas *ee, int max)
544{
545 if (!ee) return;
546 if (ee->prop.maximized == max) return;
547 ee->prop.maximized = max;
548 ecore_wl_window_maximized_set(ee->engine.wl.win, max);
549}
550
551void
552_ecore_evas_wl_common_fullscreen_set(Ecore_Evas *ee, int full)
553{
554 if (!ee) return;
555 if (ee->prop.fullscreen == full) return;
556 ee->prop.fullscreen = full;
557 ecore_wl_window_fullscreen_set(ee->engine.wl.win, full);
558}
559
560void
561_ecore_evas_wl_common_ignore_events_set(Ecore_Evas *ee, int ignore)
562{
563 if (!ee) return;
564 ee->ignore_events = ignore;
565 /* NB: Hmmm, may need to pass this to ecore_wl_window in the future */
566}
567
568int
569_ecore_evas_wl_common_render(Ecore_Evas *ee)
570{
571 int rend = 0;
572
573 if (!ee) return 0;
574 if (!ee->visible)
575 evas_norender(ee->evas);
576 else
577 {
578 Eina_List *ll = NULL, *updates = NULL;
579 Ecore_Evas *ee2 = NULL;
580
581 if (ee->func.fn_pre_render) ee->func.fn_pre_render(ee);
582
583 EINA_LIST_FOREACH(ee->sub_ecore_evas, ll, ee2)
584 {
585 if (ee2->func.fn_pre_render) ee2->func.fn_pre_render(ee2);
586 if (ee2->engine.func->fn_render)
587 rend |= ee2->engine.func->fn_render(ee2);
588 if (ee2->func.fn_post_render) ee2->func.fn_post_render(ee2);
589 }
590
591 if ((updates = evas_render_updates(ee->evas)))
592 {
593 Eina_List *l = NULL;
594 Eina_Rectangle *r;
595
596 EINA_LIST_FOREACH(updates, l, r)
597 ecore_wl_window_damage(ee->engine.wl.win,
598 r->x, r->y, r->w, r->h);
599
600 ecore_wl_flush();
601
602 evas_render_updates_free(updates);
603 _ecore_evas_idle_timeout_update(ee);
604 rend = 1;
605 }
606
607 if (ee->func.fn_post_render) ee->func.fn_post_render(ee);
608 }
609 return rend;
610}
611
612void
613_ecore_evas_wl_common_screen_geometry_get(const Ecore_Evas *ee __UNUSED__, int *x, int *y, int *w, int *h)
614{
615 if (x) *x = 0;
616 if (y) *y = 0;
617 ecore_wl_screen_size_get(w, h);
618}
619
620void
621_ecore_evas_wl_common_screen_dpi_get(const Ecore_Evas *ee __UNUSED__, int *xdpi, int *ydpi)
622{
623 int dpi = 0;
624
625 if (xdpi) *xdpi = 0;
626 if (ydpi) *ydpi = 0;
627 /* FIXME: Ideally this needs to get the DPI from a specific screen */
628 dpi = ecore_wl_dpi_get();
629 if (xdpi) *xdpi = dpi;
630 if (ydpi) *ydpi = dpi;
631}
diff --git a/legacy/ecore/src/lib/ecore_evas/ecore_evas_wayland_egl.c b/legacy/ecore/src/lib/ecore_evas/ecore_evas_wayland_egl.c
index 2d99524..545c295 100644
--- a/legacy/ecore/src/lib/ecore_evas/ecore_evas_wayland_egl.c
+++ b/legacy/ecore/src/lib/ecore_evas/ecore_evas_wayland_egl.c
@@ -21,8 +21,6 @@
21#endif 21#endif
22 22
23#include <Eina.h> 23#include <Eina.h>
24#include <Evas.h>
25#include <Ecore.h>
26 24
27#include "Ecore_Evas.h" 25#include "Ecore_Evas.h"
28 26
@@ -31,88 +29,31 @@
31# include <Evas_Engine_Wayland_Egl.h> 29# include <Evas_Engine_Wayland_Egl.h>
32# include <Ecore_Wayland.h> 30# include <Ecore_Wayland.h>
33 31
34/* local structures */
35typedef struct _EE_Wl_Smart_Data EE_Wl_Smart_Data;
36struct _EE_Wl_Smart_Data
37{
38 Evas_Object *frame;
39 Evas_Object *text;
40 Evas_Coord x, y, w, h;
41};
42
43/* local function prototypes */ 32/* local function prototypes */
44static int _ecore_evas_wl_init(void);
45static int _ecore_evas_wl_shutdown(void);
46static void _ecore_evas_wl_pre_free(Ecore_Evas *ee);
47static void _ecore_evas_wl_free(Ecore_Evas *ee);
48static void _ecore_evas_wl_callback_resize_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee));
49static void _ecore_evas_wl_callback_move_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee));
50static void _ecore_evas_wl_callback_delete_request_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee));
51static void _ecore_evas_wl_callback_focus_in_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee));
52static void _ecore_evas_wl_callback_focus_out_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee));
53static void _ecore_evas_wl_callback_mouse_in_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee));
54static void _ecore_evas_wl_callback_mouse_out_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee));
55static void _ecore_evas_wl_move(Ecore_Evas *ee, int x, int y);
56static void _ecore_evas_wl_resize(Ecore_Evas *ee, int w, int h); 33static void _ecore_evas_wl_resize(Ecore_Evas *ee, int w, int h);
57static void _ecore_evas_wl_show(Ecore_Evas *ee); 34static void _ecore_evas_wl_show(Ecore_Evas *ee);
58static void _ecore_evas_wl_hide(Ecore_Evas *ee); 35static void _ecore_evas_wl_hide(Ecore_Evas *ee);
59static void _ecore_evas_wl_raise(Ecore_Evas *ee);
60static void _ecore_evas_wl_title_set(Ecore_Evas *ee, const char *title);
61static void _ecore_evas_wl_name_class_set(Ecore_Evas *ee, const char *n, const char *c);
62static void _ecore_evas_wl_size_min_set(Ecore_Evas *ee, int w, int h);
63static void _ecore_evas_wl_size_max_set(Ecore_Evas *ee, int w, int h);
64static void _ecore_evas_wl_size_base_set(Ecore_Evas *ee, int w, int h);
65static void _ecore_evas_wl_size_step_set(Ecore_Evas *ee, int w, int h);
66static void _ecore_evas_wl_layer_set(Ecore_Evas *ee, int layer);
67static void _ecore_evas_wl_iconified_set(Ecore_Evas *ee, int iconify);
68static void _ecore_evas_wl_maximized_set(Ecore_Evas *ee, int max);
69static void _ecore_evas_wl_fullscreen_set(Ecore_Evas *ee, int full);
70static void _ecore_evas_wl_ignore_events_set(Ecore_Evas *ee, int ignore);
71static void _ecore_evas_wl_alpha_set(Ecore_Evas *ee, int alpha); 36static void _ecore_evas_wl_alpha_set(Ecore_Evas *ee, int alpha);
72static void _ecore_evas_wl_transparent_set(Ecore_Evas *ee, int transparent); 37static void _ecore_evas_wl_transparent_set(Ecore_Evas *ee, int transparent);
73static int _ecore_evas_wl_render(Ecore_Evas *ee);
74static void _ecore_evas_wl_screen_geometry_get(const Ecore_Evas *ee __UNUSED__, int *x, int *y, int *w, int *h);
75static void _ecore_evas_wl_screen_dpi_get(const Ecore_Evas *ee __UNUSED__, int *xdpi, int *ydpi);
76static Eina_Bool _ecore_evas_wl_cb_mouse_in(void *data __UNUSED__, int type __UNUSED__, void *event);
77static Eina_Bool _ecore_evas_wl_cb_mouse_out(void *data __UNUSED__, int type __UNUSED__, void *event);
78static Eina_Bool _ecore_evas_wl_cb_focus_in(void *data __UNUSED__, int type __UNUSED__, void *event);
79static Eina_Bool _ecore_evas_wl_cb_focus_out(void *data __UNUSED__, int type __UNUSED__, void *event);
80static Eina_Bool _ecore_evas_wl_cb_window_configure(void *data __UNUSED__, int type __UNUSED__, void *event);
81
82/* SMART stuff for frame */
83static Evas_Smart *_ecore_evas_wl_smart = NULL;
84
85static void _ecore_evas_wl_smart_init(void);
86static void _ecore_evas_wl_smart_add(Evas_Object *obj);
87static void _ecore_evas_wl_smart_del(Evas_Object *obj);
88static void _ecore_evas_wl_smart_resize(Evas_Object *obj, Evas_Coord w, Evas_Coord h);
89static void _ecore_evas_wl_smart_show(Evas_Object *obj);
90static void _ecore_evas_wl_smart_hide(Evas_Object *obj);
91
92static Evas_Object *_ecore_evas_wl_frame_add(Evas *evas);
93
94/* local variables */
95static int _ecore_evas_wl_init_count = 0;
96static Ecore_Event_Handler *_ecore_evas_wl_event_hdls[5];
97 38
98static Ecore_Evas_Engine_Func _ecore_wl_engine_func = 39static Ecore_Evas_Engine_Func _ecore_wl_engine_func =
99{ 40{
100 _ecore_evas_wl_free, 41 _ecore_evas_wl_common_free,
101 _ecore_evas_wl_callback_resize_set, 42 _ecore_evas_wl_common_callback_resize_set,
102 _ecore_evas_wl_callback_move_set, 43 _ecore_evas_wl_common_callback_move_set,
103 NULL, 44 NULL,
104 NULL, 45 NULL,
105 _ecore_evas_wl_callback_delete_request_set, 46 _ecore_evas_wl_common_callback_delete_request_set,
106 NULL, 47 NULL,
107 _ecore_evas_wl_callback_focus_in_set, 48 _ecore_evas_wl_common_callback_focus_in_set,
108 _ecore_evas_wl_callback_focus_out_set, 49 _ecore_evas_wl_common_callback_focus_out_set,
109 _ecore_evas_wl_callback_mouse_in_set, 50 _ecore_evas_wl_common_callback_mouse_in_set,
110 _ecore_evas_wl_callback_mouse_out_set, 51 _ecore_evas_wl_common_callback_mouse_out_set,
111 NULL, // sticky_set 52 NULL, // sticky_set
112 NULL, // unsticky_set 53 NULL, // unsticky_set
113 NULL, // pre_render_set 54 NULL, // pre_render_set
114 NULL, // post_render_set 55 NULL, // post_render_set
115 _ecore_evas_wl_move, 56 _ecore_evas_wl_common_move,
116 NULL, // managed_move 57 NULL, // managed_move
117 _ecore_evas_wl_resize, 58 _ecore_evas_wl_resize,
118 NULL, // move_resize 59 NULL, // move_resize
@@ -120,39 +61,39 @@ static Ecore_Evas_Engine_Func _ecore_wl_engine_func =
120 NULL, // shaped_set 61 NULL, // shaped_set
121 _ecore_evas_wl_show, 62 _ecore_evas_wl_show,
122 _ecore_evas_wl_hide, 63 _ecore_evas_wl_hide,
123 _ecore_evas_wl_raise, 64 _ecore_evas_wl_common_raise,
124 NULL, // lower 65 NULL, // lower
125 NULL, // activate 66 NULL, // activate
126 _ecore_evas_wl_title_set, 67 _ecore_evas_wl_common_title_set,
127 _ecore_evas_wl_name_class_set, 68 _ecore_evas_wl_common_name_class_set,
128 _ecore_evas_wl_size_min_set, 69 _ecore_evas_wl_common_size_min_set,
129 _ecore_evas_wl_size_max_set, 70 _ecore_evas_wl_common_size_max_set,
130 _ecore_evas_wl_size_base_set, 71 _ecore_evas_wl_common_size_base_set,
131 _ecore_evas_wl_size_step_set, 72 _ecore_evas_wl_common_size_step_set,
132 NULL, // object_cursor_set 73 NULL, // object_cursor_set
133 _ecore_evas_wl_layer_set, 74 _ecore_evas_wl_common_layer_set,
134 NULL, // focus set 75 NULL, // focus set
135 _ecore_evas_wl_iconified_set, 76 _ecore_evas_wl_common_iconified_set,
136 NULL, // borderless set 77 NULL, // borderless set
137 NULL, // override set 78 NULL, // override set
138 _ecore_evas_wl_maximized_set, 79 _ecore_evas_wl_common_maximized_set,
139 _ecore_evas_wl_fullscreen_set, 80 _ecore_evas_wl_common_fullscreen_set,
140 NULL, // func avoid_damage set 81 NULL, // func avoid_damage set
141 NULL, // func withdrawn set 82 NULL, // func withdrawn set
142 NULL, // func sticky set 83 NULL, // func sticky set
143 _ecore_evas_wl_ignore_events_set, 84 _ecore_evas_wl_common_ignore_events_set,
144 _ecore_evas_wl_alpha_set, 85 _ecore_evas_wl_alpha_set,
145 _ecore_evas_wl_transparent_set, 86 _ecore_evas_wl_transparent_set,
146 NULL, // func profiles set 87 NULL, // func profiles set
147 NULL, 88 NULL, // window group set
148 NULL, 89 NULL, // aspect set
149 NULL, 90 NULL, // urgent set
150 NULL, 91 NULL, // modal set
151 NULL, 92 NULL, // demand attention set
152 NULL, 93 NULL, // focus skip set
153 _ecore_evas_wl_render, 94 _ecore_evas_wl_common_render,
154 _ecore_evas_wl_screen_geometry_get, 95 _ecore_evas_wl_common_screen_geometry_get,
155 _ecore_evas_wl_screen_dpi_get 96 _ecore_evas_wl_common_screen_dpi_get
156}; 97};
157 98
158/* external variables */ 99/* external variables */
@@ -186,13 +127,12 @@ ecore_evas_wayland_egl_new(const char *disp_name, unsigned int parent, int x, in
186 if (!(ee = calloc(1, sizeof(Ecore_Evas)))) 127 if (!(ee = calloc(1, sizeof(Ecore_Evas))))
187 { 128 {
188 ERR("Failed to allocate Ecore_Evas"); 129 ERR("Failed to allocate Ecore_Evas");
189 ecore_wl_shutdown(); 130 goto ee_err;
190 return NULL;
191 } 131 }
192 132
193 ECORE_MAGIC_SET(ee, ECORE_MAGIC_EVAS); 133 ECORE_MAGIC_SET(ee, ECORE_MAGIC_EVAS);
194 134
195 _ecore_evas_wl_init(); 135 _ecore_evas_wl_common_init();
196 136
197 ee->engine.func = (Ecore_Evas_Engine_Func *)&_ecore_wl_engine_func; 137 ee->engine.func = (Ecore_Evas_Engine_Func *)&_ecore_wl_engine_func;
198 138
@@ -248,26 +188,20 @@ ecore_evas_wayland_egl_new(const char *disp_name, unsigned int parent, int x, in
248 if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo)) 188 if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo))
249 { 189 {
250 ERR("Failed to set Evas Engine Info for '%s'", ee->driver); 190 ERR("Failed to set Evas Engine Info for '%s'", ee->driver);
251 ecore_evas_free(ee); 191 goto err;
252 _ecore_evas_wl_shutdown();
253 ecore_wl_shutdown();
254 return NULL;
255 } 192 }
256 } 193 }
257 else 194 else
258 { 195 {
259 ERR("Failed to get Evas Engine Info for '%s'", ee->driver); 196 ERR("Failed to get Evas Engine Info for '%s'", ee->driver);
260 ecore_evas_free(ee); 197 goto err;
261 _ecore_evas_wl_shutdown();
262 ecore_wl_shutdown();
263 return NULL;
264 } 198 }
265 199
266 ecore_evas_callback_pre_free_set(ee, _ecore_evas_wl_pre_free); 200 ecore_evas_callback_pre_free_set(ee, _ecore_evas_wl_common_pre_free);
267 201
268 if (ee->prop.draw_frame) 202 if (ee->prop.draw_frame)
269 { 203 {
270 ee->engine.wl.frame = _ecore_evas_wl_frame_add(ee->evas); 204 ee->engine.wl.frame = _ecore_evas_wl_common_frame_add(ee->evas);
271 evas_object_is_frame_object_set(ee->engine.wl.frame, EINA_TRUE); 205 evas_object_is_frame_object_set(ee->engine.wl.frame, EINA_TRUE);
272 evas_object_move(ee->engine.wl.frame, 0, 0); 206 evas_object_move(ee->engine.wl.frame, 0, 0);
273 } 207 }
@@ -281,172 +215,21 @@ ecore_evas_wayland_egl_new(const char *disp_name, unsigned int parent, int x, in
281 (Ecore_Event_Multi_Down_Cb)_ecore_evas_mouse_multi_down_process, 215 (Ecore_Event_Multi_Down_Cb)_ecore_evas_mouse_multi_down_process,
282 (Ecore_Event_Multi_Up_Cb)_ecore_evas_mouse_multi_up_process); 216 (Ecore_Event_Multi_Up_Cb)_ecore_evas_mouse_multi_up_process);
283 217
284 /* evas_event_feed_mouse_in(ee->evas, (unsigned int)((unsigned long long)(ecore_time_get() * 1000.0) & 0xffffffff), NULL); */
285
286 return ee; 218 return ee;
287}
288
289/* local functions */
290static int
291_ecore_evas_wl_init(void)
292{
293 LOGFN(__FILE__, __LINE__, __FUNCTION__);
294
295 if (++_ecore_evas_wl_init_count != 1)
296 return _ecore_evas_wl_init_count;
297
298 _ecore_evas_wl_event_hdls[0] =
299 ecore_event_handler_add(ECORE_WL_EVENT_MOUSE_IN,
300 _ecore_evas_wl_cb_mouse_in, NULL);
301 _ecore_evas_wl_event_hdls[1] =
302 ecore_event_handler_add(ECORE_WL_EVENT_MOUSE_OUT,
303 _ecore_evas_wl_cb_mouse_out, NULL);
304 _ecore_evas_wl_event_hdls[2] =
305 ecore_event_handler_add(ECORE_WL_EVENT_FOCUS_IN,
306 _ecore_evas_wl_cb_focus_in, NULL);
307 _ecore_evas_wl_event_hdls[3] =
308 ecore_event_handler_add(ECORE_WL_EVENT_FOCUS_OUT,
309 _ecore_evas_wl_cb_focus_out, NULL);
310 _ecore_evas_wl_event_hdls[4] =
311 ecore_event_handler_add(ECORE_WL_EVENT_WINDOW_CONFIGURE,
312 _ecore_evas_wl_cb_window_configure, NULL);
313
314 ecore_event_evas_init();
315
316 return _ecore_evas_wl_init_count;
317}
318
319static int
320_ecore_evas_wl_shutdown(void)
321{
322 unsigned int i = 0;
323
324 LOGFN(__FILE__, __LINE__, __FUNCTION__);
325 219
326 if (--_ecore_evas_wl_init_count != 0) 220 err:
327 return _ecore_evas_wl_init_count; 221 ecore_evas_free(ee);
222 _ecore_evas_wl_common_shutdown();
328 223
329 for (i = 0; i < sizeof(_ecore_evas_wl_event_hdls) / sizeof(Ecore_Event_Handler *); i++) 224 ee_err:
330 {
331 if (_ecore_evas_wl_event_hdls[i])
332 ecore_event_handler_del(_ecore_evas_wl_event_hdls[i]);
333 }
334
335 ecore_event_evas_shutdown();
336
337 return _ecore_evas_wl_init_count;
338}
339
340static void
341_ecore_evas_wl_pre_free(Ecore_Evas *ee)
342{
343 LOGFN(__FILE__, __LINE__, __FUNCTION__);
344
345 if (!ee) return;
346 if (ee->engine.wl.frame) evas_object_del(ee->engine.wl.frame);
347}
348
349static void
350_ecore_evas_wl_free(Ecore_Evas *ee)
351{
352 LOGFN(__FILE__, __LINE__, __FUNCTION__);
353
354 if (ee->engine.wl.win) ecore_wl_window_free(ee->engine.wl.win);
355 ee->engine.wl.win = NULL;
356
357 ecore_event_window_unregister(ee->prop.window);
358 ecore_evas_input_event_unregister(ee);
359
360 _ecore_evas_wl_shutdown();
361 ecore_wl_shutdown(); 225 ecore_wl_shutdown();
362} 226 return NULL;
363
364static void
365_ecore_evas_wl_callback_resize_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee))
366{
367 LOGFN(__FILE__, __LINE__, __FUNCTION__);
368
369 if (!ee) return;
370 ee->func.fn_resize = func;
371}
372
373static void
374_ecore_evas_wl_callback_move_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee))
375{
376 LOGFN(__FILE__, __LINE__, __FUNCTION__);
377
378 if (!ee) return;
379 ee->func.fn_move = func;
380}
381
382static void
383_ecore_evas_wl_callback_delete_request_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee))
384{
385 LOGFN(__FILE__, __LINE__, __FUNCTION__);
386
387 if (!ee) return;
388 ee->func.fn_delete_request = func;
389}
390
391static void
392_ecore_evas_wl_callback_focus_in_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee))
393{
394 LOGFN(__FILE__, __LINE__, __FUNCTION__);
395
396 if (!ee) return;
397 ee->func.fn_focus_in = func;
398}
399
400static void
401_ecore_evas_wl_callback_focus_out_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee))
402{
403 LOGFN(__FILE__, __LINE__, __FUNCTION__);
404
405 if (!ee) return;
406 ee->func.fn_focus_out = func;
407}
408
409static void
410_ecore_evas_wl_callback_mouse_in_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee))
411{
412 LOGFN(__FILE__, __LINE__, __FUNCTION__);
413
414 if (!ee) return;
415 ee->func.fn_mouse_in = func;
416}
417
418static void
419_ecore_evas_wl_callback_mouse_out_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee))
420{
421 LOGFN(__FILE__, __LINE__, __FUNCTION__);
422
423 if (!ee) return;
424 ee->func.fn_mouse_out = func;
425}
426
427static void
428_ecore_evas_wl_move(Ecore_Evas *ee, int x, int y)
429{
430 LOGFN(__FILE__, __LINE__, __FUNCTION__);
431
432 if (!ee) return;
433 ee->req.x = x;
434 ee->req.y = y;
435 if ((ee->x != x) || (ee->y != y))
436 {
437 ee->x = x;
438 ee->y = y;
439 if (ee->engine.wl.win)
440 ecore_wl_window_update_location(ee->engine.wl.win, x, y);
441 if (ee->func.fn_move) ee->func.fn_move(ee);
442 }
443} 227}
444 228
445static void 229static void
446_ecore_evas_wl_resize(Ecore_Evas *ee, int w, int h) 230_ecore_evas_wl_resize(Ecore_Evas *ee, int w, int h)
447{ 231{
448 LOGFN(__FILE__, __LINE__, __FUNCTION__); 232 LOGFN(__FILE__, __LINE__, __FUNCTION__);
449 int fw = 0, fh = 0;
450 233
451 if (!ee) return; 234 if (!ee) return;
452 if (w < 1) w = 1; 235 if (w < 1) w = 1;
@@ -457,6 +240,8 @@ _ecore_evas_wl_resize(Ecore_Evas *ee, int w, int h)
457 240
458 if (!ee->prop.fullscreen) 241 if (!ee->prop.fullscreen)
459 { 242 {
243 int fw = 0, fh = 0;
244
460 if (ee->prop.min.w > w) w = ee->prop.min.w; 245 if (ee->prop.min.w > w) w = ee->prop.min.w;
461 else if (w > ee->prop.max.w) w = ee->prop.max.w; 246 else if (w > ee->prop.max.w) w = ee->prop.max.w;
462 if (ee->prop.min.h > h) h = ee->prop.min.h; 247 if (ee->prop.min.h > h) h = ee->prop.min.h;
@@ -467,8 +252,6 @@ _ecore_evas_wl_resize(Ecore_Evas *ee, int w, int h)
467 h += fh; 252 h += fh;
468 } 253 }
469 254
470// ecore_wl_window_damage(ee->engine.wl.win, 0, 0, ee->w, ee->h);
471
472 if ((ee->w != w) || (ee->h != h)) 255 if ((ee->w != w) || (ee->h != h))
473 { 256 {
474 ee->w = w; 257 ee->w = w;
@@ -479,7 +262,7 @@ _ecore_evas_wl_resize(Ecore_Evas *ee, int w, int h)
479 evas_output_size_set(ee->evas, h, w); 262 evas_output_size_set(ee->evas, h, w);
480 evas_output_viewport_set(ee->evas, 0, 0, h, w); 263 evas_output_viewport_set(ee->evas, 0, 0, h, w);
481 } 264 }
482 else 265 else
483 { 266 {
484 evas_output_size_set(ee->evas, w, h); 267 evas_output_size_set(ee->evas, w, h);
485 evas_output_viewport_set(ee->evas, 0, 0, w, h); 268 evas_output_viewport_set(ee->evas, 0, 0, w, h);
@@ -497,13 +280,6 @@ _ecore_evas_wl_resize(Ecore_Evas *ee, int w, int h)
497 if (ee->engine.wl.frame) 280 if (ee->engine.wl.frame)
498 evas_object_resize(ee->engine.wl.frame, w, h); 281 evas_object_resize(ee->engine.wl.frame, w, h);
499 282
500 /* set new engine destination */
501 /* evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo); */
502
503 /* ecore_wl_window_damage(ee->engine.wl.win, 0, 0, ee->w, ee->h); */
504
505 // WAS ACTIVE
506 /* ecore_wl_flush(); */
507 283
508 if (ee->engine.wl.win) 284 if (ee->engine.wl.win)
509 { 285 {
@@ -590,162 +366,6 @@ _ecore_evas_wl_hide(Ecore_Evas *ee)
590} 366}
591 367
592static void 368static void
593_ecore_evas_wl_raise(Ecore_Evas *ee)
594{
595 LOGFN(__FILE__, __LINE__, __FUNCTION__);
596
597 if ((!ee) || (!ee->visible)) return;
598 ecore_wl_window_raise(ee->engine.wl.win);
599}
600
601static void
602_ecore_evas_wl_title_set(Ecore_Evas *ee, const char *title)
603{
604 LOGFN(__FILE__, __LINE__, __FUNCTION__);
605
606 if (!ee) return;
607 if (ee->prop.title) free(ee->prop.title);
608 ee->prop.title = NULL;
609 if (title) ee->prop.title = strdup(title);
610 if ((ee->prop.draw_frame) && (ee->engine.wl.frame))
611 {
612 EE_Wl_Smart_Data *sd;
613
614 if (!(sd = evas_object_smart_data_get(ee->engine.wl.frame))) return;
615 evas_object_text_text_set(sd->text, ee->prop.title);
616 }
617
618 if ((ee->prop.title) && (ee->engine.wl.win->shell_surface))
619 wl_shell_surface_set_title(ee->engine.wl.win->shell_surface,
620 ee->prop.title);
621}
622
623static void
624_ecore_evas_wl_name_class_set(Ecore_Evas *ee, const char *n, const char *c)
625{
626 LOGFN(__FILE__, __LINE__, __FUNCTION__);
627
628 if (!ee) return;
629 if (ee->prop.name) free(ee->prop.name);
630 if (ee->prop.clas) free(ee->prop.clas);
631 ee->prop.name = NULL;
632 ee->prop.clas = NULL;
633 if (n) ee->prop.name = strdup(n);
634 if (c) ee->prop.clas = strdup(c);
635
636 if ((ee->prop.clas) && (ee->engine.wl.win->shell_surface))
637 wl_shell_surface_set_class(ee->engine.wl.win->shell_surface,
638 ee->prop.clas);
639}
640
641static void
642_ecore_evas_wl_size_min_set(Ecore_Evas *ee, int w, int h)
643{
644 LOGFN(__FILE__, __LINE__, __FUNCTION__);
645
646 if (!ee) return;
647 if (w < 0) w = 0;
648 if (h < 0) h = 0;
649 if ((ee->prop.min.w == w) && (ee->prop.min.h == h)) return;
650 ee->prop.min.w = w;
651 ee->prop.min.h = h;
652}
653
654static void
655_ecore_evas_wl_size_max_set(Ecore_Evas *ee, int w, int h)
656{
657 LOGFN(__FILE__, __LINE__, __FUNCTION__);
658
659 if (!ee) return;
660 if (w < 0) w = 0;
661 if (h < 0) h = 0;
662 if ((ee->prop.max.w == w) && (ee->prop.max.h == h)) return;
663 ee->prop.max.w = w;
664 ee->prop.max.h = h;
665}
666
667static void
668_ecore_evas_wl_size_base_set(Ecore_Evas *ee, int w, int h)
669{
670 LOGFN(__FILE__, __LINE__, __FUNCTION__);
671
672 if (!ee) return;
673 if (w < 0) w = 0;
674 if (h < 0) h = 0;
675 if ((ee->prop.base.w == w) && (ee->prop.base.h == h)) return;
676 ee->prop.base.w = w;
677 ee->prop.base.h = h;
678}
679
680static void
681_ecore_evas_wl_size_step_set(Ecore_Evas *ee, int w, int h)
682{
683 LOGFN(__FILE__, __LINE__, __FUNCTION__);
684
685 if (!ee) return;
686 if (w < 0) w = 0;
687 if (h < 0) h = 0;
688 if ((ee->prop.step.w == w) && (ee->prop.step.h == h)) return;
689 ee->prop.step.w = w;
690 ee->prop.step.h = h;
691}
692
693static void
694_ecore_evas_wl_layer_set(Ecore_Evas *ee, int layer)
695{
696 LOGFN(__FILE__, __LINE__, __FUNCTION__);
697
698 if (!ee) return;
699 if (ee->prop.layer == layer) return;
700 if (layer < 1) layer = 1;
701 else if (layer > 255) layer = 255;
702 ee->prop.layer = layer;
703}
704
705static void
706_ecore_evas_wl_iconified_set(Ecore_Evas *ee, int iconify)
707{
708 LOGFN(__FILE__, __LINE__, __FUNCTION__);
709
710 if (!ee) return;
711 if (ee->prop.iconified == iconify) return;
712 ee->prop.iconified = iconify;
713 /* FIXME: Implement this in Wayland someshow */
714}
715
716static void
717_ecore_evas_wl_maximized_set(Ecore_Evas *ee, int max)
718{
719 LOGFN(__FILE__, __LINE__, __FUNCTION__);
720
721 if (!ee) return;
722 if (ee->prop.maximized == max) return;
723 ee->prop.maximized = max;
724 ecore_wl_window_maximized_set(ee->engine.wl.win, max);
725}
726
727static void
728_ecore_evas_wl_fullscreen_set(Ecore_Evas *ee, int full)
729{
730 LOGFN(__FILE__, __LINE__, __FUNCTION__);
731
732 if (!ee) return;
733 if (ee->prop.fullscreen == full) return;
734 ee->prop.fullscreen = full;
735 ecore_wl_window_fullscreen_set(ee->engine.wl.win, full);
736}
737
738static void
739_ecore_evas_wl_ignore_events_set(Ecore_Evas *ee, int ignore)
740{
741 LOGFN(__FILE__, __LINE__, __FUNCTION__);
742
743 if (!ee) return;
744 ee->ignore_events = ignore;
745 /* NB: Hmmm, may need to pass this to ecore_wl_window in the future */
746}
747
748static void
749_ecore_evas_wl_alpha_set(Ecore_Evas *ee, int alpha) 369_ecore_evas_wl_alpha_set(Ecore_Evas *ee, int alpha)
750{ 370{
751 Evas_Engine_Info_Wayland_Egl *einfo; 371 Evas_Engine_Info_Wayland_Egl *einfo;
@@ -784,77 +404,6 @@ _ecore_evas_wl_transparent_set(Ecore_Evas *ee, int transparent)
784 } 404 }
785} 405}
786 406
787static int
788_ecore_evas_wl_render(Ecore_Evas *ee)
789{
790 int rend = 0;
791
792 if (!ee) return 0;
793 if (!ee->visible)
794 evas_norender(ee->evas);
795 else
796 {
797 Eina_List *ll = NULL, *updates = NULL;
798 Ecore_Evas *ee2 = NULL;
799
800 if (ee->func.fn_pre_render) ee->func.fn_pre_render(ee);
801
802 EINA_LIST_FOREACH(ee->sub_ecore_evas, ll, ee2)
803 {
804 if (ee2->func.fn_pre_render) ee2->func.fn_pre_render(ee2);
805 if (ee2->engine.func->fn_render)
806 rend |= ee2->engine.func->fn_render(ee2);
807 if (ee2->func.fn_post_render) ee2->func.fn_post_render(ee2);
808 }
809
810 if ((updates = evas_render_updates(ee->evas)))
811 {
812 Eina_List *l = NULL;
813 Eina_Rectangle *r;
814
815 LOGFN(__FILE__, __LINE__, __FUNCTION__);
816
817 EINA_LIST_FOREACH(updates, l, r)
818 ecore_wl_window_damage(ee->engine.wl.win,
819 r->x, r->y, r->w, r->h);
820
821 ecore_wl_flush();
822
823 evas_render_updates_free(updates);
824 _ecore_evas_idle_timeout_update(ee);
825 rend = 1;
826 }
827
828 if (ee->func.fn_post_render) ee->func.fn_post_render(ee);
829 }
830 return rend;
831}
832
833static void
834_ecore_evas_wl_screen_geometry_get(const Ecore_Evas *ee __UNUSED__, int *x, int *y, int *w, int *h)
835{
836 LOGFN(__FILE__, __LINE__, __FUNCTION__);
837
838 if (x) *x = 0;
839 if (y) *y = 0;
840 ecore_wl_screen_size_get(w, h);
841}
842
843static void
844_ecore_evas_wl_screen_dpi_get(const Ecore_Evas *ee __UNUSED__, int *xdpi, int *ydpi)
845{
846 int dpi = 0;
847
848 LOGFN(__FILE__, __LINE__, __FUNCTION__);
849
850 if (xdpi) *xdpi = 0;
851 if (ydpi) *ydpi = 0;
852 /* FIXME: Ideally this needs to get the DPI from a specific screen */
853 dpi = ecore_wl_dpi_get();
854 if (xdpi) *xdpi = dpi;
855 if (ydpi) *ydpi = dpi;
856}
857
858void 407void
859_ecore_evas_wayland_egl_resize(Ecore_Evas *ee, int location) 408_ecore_evas_wayland_egl_resize(Ecore_Evas *ee, int location)
860{ 409{
@@ -876,262 +425,6 @@ _ecore_evas_wayland_egl_resize(Ecore_Evas *ee, int location)
876 ecore_wl_window_resize(ee->engine.wl.win, ee->w, ee->h, location); 425 ecore_wl_window_resize(ee->engine.wl.win, ee->w, ee->h, location);
877 } 426 }
878} 427}
879
880void
881_ecore_evas_wayland_egl_move(Ecore_Evas *ee, int x, int y)
882{
883 LOGFN(__FILE__, __LINE__, __FUNCTION__);
884
885 if (!ee) return;
886 if (ee->engine.wl.win)
887 {
888 ee->engine.wl.win->moving = EINA_TRUE;
889 ecore_wl_window_move(ee->engine.wl.win, x, y);
890 }
891}
892
893static Eina_Bool
894_ecore_evas_wl_cb_mouse_in(void *data __UNUSED__, int type __UNUSED__, void *event)
895{
896 Ecore_Evas *ee;
897 Ecore_Wl_Event_Mouse_In *ev;
898
899 LOGFN(__FILE__, __LINE__, __FUNCTION__);
900
901 ev = event;
902 ee = ecore_event_window_match(ev->window);
903 if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON;
904 if (ev->window != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
905 if (ee->func.fn_mouse_in) ee->func.fn_mouse_in(ee);
906 ecore_event_evas_modifier_lock_update(ee->evas, ev->modifiers);
907 evas_event_feed_mouse_in(ee->evas, ev->timestamp, NULL);
908 _ecore_evas_mouse_move_process(ee, ev->x, ev->y, ev->timestamp);
909 return ECORE_CALLBACK_PASS_ON;
910}
911
912static Eina_Bool
913_ecore_evas_wl_cb_mouse_out(void *data __UNUSED__, int type __UNUSED__, void *event)
914{
915 Ecore_Evas *ee;
916 Ecore_Wl_Event_Mouse_Out *ev;
917
918 LOGFN(__FILE__, __LINE__, __FUNCTION__);
919
920 ev = event;
921 ee = ecore_event_window_match(ev->window);
922 if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON;
923 if (ev->window != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
924 ecore_event_evas_modifier_lock_update(ee->evas, ev->modifiers);
925 _ecore_evas_mouse_move_process(ee, ev->x, ev->y, ev->timestamp);
926 evas_event_feed_mouse_out(ee->evas, ev->timestamp, NULL);
927 if (ee->func.fn_mouse_out) ee->func.fn_mouse_out(ee);
928 if (ee->prop.cursor.object) evas_object_hide(ee->prop.cursor.object);
929 return ECORE_CALLBACK_PASS_ON;
930}
931
932static Eina_Bool
933_ecore_evas_wl_cb_focus_in(void *data __UNUSED__, int type __UNUSED__, void *event)
934{
935 Ecore_Evas *ee;
936 Ecore_Wl_Event_Focus_In *ev;
937
938 LOGFN(__FILE__, __LINE__, __FUNCTION__);
939
940 ev = event;
941 ee = ecore_event_window_match(ev->win);
942 if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON;
943 if (ev->win != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
944 ee->prop.focused = 1;
945 evas_focus_in(ee->evas);
946 if (ee->func.fn_focus_in) ee->func.fn_focus_in(ee);
947 return ECORE_CALLBACK_PASS_ON;
948}
949
950static Eina_Bool
951_ecore_evas_wl_cb_focus_out(void *data __UNUSED__, int type __UNUSED__, void *event)
952{
953 Ecore_Evas *ee;
954 Ecore_Wl_Event_Focus_In *ev;
955
956 LOGFN(__FILE__, __LINE__, __FUNCTION__);
957
958 ev = event;
959 ee = ecore_event_window_match(ev->win);
960 if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON;
961 if (ev->win != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
962 evas_focus_out(ee->evas);
963 ee->prop.focused = 0;
964 if (ee->func.fn_focus_out) ee->func.fn_focus_out(ee);
965 return ECORE_CALLBACK_PASS_ON;
966}
967
968static Eina_Bool
969_ecore_evas_wl_cb_window_configure(void *data __UNUSED__, int type __UNUSED__, void *event)
970{
971 Ecore_Evas *ee;
972 Ecore_Wl_Event_Window_Configure *ev;
973 int nw = 0, nh = 0;
974
975 LOGFN(__FILE__, __LINE__, __FUNCTION__);
976
977 ev = event;
978 ee = ecore_event_window_match(ev->win);
979 if (!ee) return ECORE_CALLBACK_PASS_ON;
980 if (ev->win != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
981
982 if (ee->prop.fullscreen)
983 {
984 _ecore_evas_wl_move(ee, ev->x, ev->y);
985 _ecore_evas_wl_resize(ee, ev->w, ev->h);
986
987 return ECORE_CALLBACK_PASS_ON;
988 }
989
990 if ((ee->x != ev->x) || (ee->y != ev->y))
991 {
992 ee->req.x = ee->x;
993 ee->req.y = ee->y;
994 if (ee->func.fn_move) ee->func.fn_move(ee);
995 }
996
997 nw = ev->w;
998 nh = ev->h;
999
1000 if ((ee->prop.maximized) || (!ee->prop.fullscreen))
1001 {
1002 int fw = 0, fh = 0;
1003
1004 evas_output_framespace_get(ee->evas, NULL, NULL, &fw, &fh);
1005 nw = ev->w - fw;
1006 nh = ev->h - fh;
1007 }
1008
1009 if (ee->prop.min.w > nw) nw = ee->prop.min.w;
1010 else if (nw > ee->prop.max.w) nw = ee->prop.max.w;
1011 if (ee->prop.min.h > nh) nh = ee->prop.min.h;
1012 else if (nh > ee->prop.max.h) nh = ee->prop.max.h;
1013
1014 if ((ee->w != nw) || (ee->h != nh))
1015 {
1016 ee->req.w = nw;
1017 ee->req.h = nh;
1018 if (ee->func.fn_resize) ee->func.fn_resize(ee);
1019 }
1020
1021 return ECORE_CALLBACK_PASS_ON;
1022}
1023
1024static void
1025_ecore_evas_wl_smart_init(void)
1026{
1027 if (_ecore_evas_wl_smart) return;
1028 {
1029 static const Evas_Smart_Class sc =
1030 {
1031 "ecore_evas_wl_frame", EVAS_SMART_CLASS_VERSION,
1032 _ecore_evas_wl_smart_add,
1033 _ecore_evas_wl_smart_del,
1034 NULL,
1035 _ecore_evas_wl_smart_resize,
1036 _ecore_evas_wl_smart_show,
1037 _ecore_evas_wl_smart_hide,
1038 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
1039 };
1040 _ecore_evas_wl_smart = evas_smart_class_new(&sc);
1041 }
1042}
1043
1044static void
1045_ecore_evas_wl_smart_add(Evas_Object *obj)
1046{
1047 EE_Wl_Smart_Data *sd;
1048 Evas *evas;
1049
1050 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1051
1052 if (!(sd = calloc(1, sizeof(EE_Wl_Smart_Data)))) return;
1053
1054 evas = evas_object_evas_get(obj);
1055
1056 sd->x = 0;
1057 sd->y = 0;
1058 sd->w = 1;
1059 sd->h = 1;
1060
1061 sd->frame = evas_object_rectangle_add(evas);
1062 evas_object_is_frame_object_set(sd->frame, EINA_TRUE);
1063 evas_object_color_set(sd->frame, 249, 249, 249, 255);
1064 evas_object_smart_member_add(sd->frame, obj);
1065
1066 sd->text = evas_object_text_add(evas);
1067 evas_object_color_set(sd->text, 0, 0, 0, 255);
1068 evas_object_text_style_set(sd->text, EVAS_TEXT_STYLE_PLAIN);
1069 evas_object_text_font_set(sd->text, "Sans", 10);
1070 evas_object_text_text_set(sd->text, "Smart Test");
1071
1072 evas_object_smart_data_set(obj, sd);
1073}
1074
1075static void
1076_ecore_evas_wl_smart_del(Evas_Object *obj)
1077{
1078 EE_Wl_Smart_Data *sd;
1079
1080 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1081
1082 if (!(sd = evas_object_smart_data_get(obj))) return;
1083 evas_object_del(sd->text);
1084 evas_object_del(sd->frame);
1085 free(sd);
1086}
1087
1088static void
1089_ecore_evas_wl_smart_resize(Evas_Object *obj, Evas_Coord w, Evas_Coord h)
1090{
1091 EE_Wl_Smart_Data *sd;
1092
1093 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1094
1095 if (!(sd = evas_object_smart_data_get(obj))) return;
1096 if ((sd->w == w) && (sd->h == h)) return;
1097 sd->w = w;
1098 sd->h = h;
1099 evas_object_resize(sd->frame, w, h);
1100}
1101
1102static void
1103_ecore_evas_wl_smart_show(Evas_Object *obj)
1104{
1105 EE_Wl_Smart_Data *sd;
1106
1107 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1108
1109 if (!(sd = evas_object_smart_data_get(obj))) return;
1110 evas_object_show(sd->frame);
1111 evas_object_show(sd->text);
1112}
1113
1114static void
1115_ecore_evas_wl_smart_hide(Evas_Object *obj)
1116{
1117 EE_Wl_Smart_Data *sd;
1118
1119 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1120
1121 if (!(sd = evas_object_smart_data_get(obj))) return;
1122 evas_object_hide(sd->text);
1123 evas_object_hide(sd->frame);
1124}
1125
1126static Evas_Object *
1127_ecore_evas_wl_frame_add(Evas *evas)
1128{
1129 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1130
1131 _ecore_evas_wl_smart_init();
1132 return evas_object_smart_add(evas, _ecore_evas_wl_smart);
1133}
1134
1135#else 428#else
1136EAPI Ecore_Evas * 429EAPI Ecore_Evas *
1137ecore_evas_wayland_egl_new(const char *disp_name __UNUSED__, unsigned int parent __UNUSED__, int x __UNUSED__, int y __UNUSED__, int w __UNUSED__, int h __UNUSED__, Eina_Bool frame __UNUSED__) 430ecore_evas_wayland_egl_new(const char *disp_name __UNUSED__, unsigned int parent __UNUSED__, int x __UNUSED__, int y __UNUSED__, int w __UNUSED__, int h __UNUSED__, Eina_Bool frame __UNUSED__)
diff --git a/legacy/ecore/src/lib/ecore_evas/ecore_evas_wayland_shm.c b/legacy/ecore/src/lib/ecore_evas/ecore_evas_wayland_shm.c
index 5e2c348..da98b32 100644
--- a/legacy/ecore/src/lib/ecore_evas/ecore_evas_wayland_shm.c
+++ b/legacy/ecore/src/lib/ecore_evas/ecore_evas_wayland_shm.c
@@ -21,8 +21,6 @@
21#endif 21#endif
22 22
23#include <Eina.h> 23#include <Eina.h>
24#include <Evas.h>
25#include <Ecore.h>
26 24
27#include "Ecore_Evas.h" 25#include "Ecore_Evas.h"
28 26
@@ -31,93 +29,37 @@
31# include <Evas_Engine_Wayland_Shm.h> 29# include <Evas_Engine_Wayland_Shm.h>
32# include <Ecore_Wayland.h> 30# include <Ecore_Wayland.h>
33 31
34/* local structures */
35typedef struct _EE_Wl_Smart_Data EE_Wl_Smart_Data;
36struct _EE_Wl_Smart_Data
37{
38 Evas_Object *frame;
39 Evas_Object *text;
40 Evas_Coord x, y, w, h;
41};
42
43/* local function prototypes */ 32/* local function prototypes */
44static int _ecore_evas_wl_init(void);
45static int _ecore_evas_wl_shutdown(void);
46static void _ecore_evas_wl_pre_free(Ecore_Evas *ee);
47static void _ecore_evas_wl_free(Ecore_Evas *ee); 33static void _ecore_evas_wl_free(Ecore_Evas *ee);
48static void _ecore_evas_wl_callback_resize_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee));
49static void _ecore_evas_wl_callback_move_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee));
50static void _ecore_evas_wl_callback_delete_request_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee));
51static void _ecore_evas_wl_callback_focus_in_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee));
52static void _ecore_evas_wl_callback_focus_out_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee));
53static void _ecore_evas_wl_callback_mouse_in_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee));
54static void _ecore_evas_wl_callback_mouse_out_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee));
55static void _ecore_evas_wl_move(Ecore_Evas *ee, int x, int y);
56static void _ecore_evas_wl_resize(Ecore_Evas *ee, int w, int h); 34static void _ecore_evas_wl_resize(Ecore_Evas *ee, int w, int h);
57static void _ecore_evas_wl_move_resize(Ecore_Evas *ee, int x, int y, int w, int h); 35static void _ecore_evas_wl_move_resize(Ecore_Evas *ee, int x, int y, int w, int h);
58static void _ecore_evas_wl_show(Ecore_Evas *ee); 36static void _ecore_evas_wl_show(Ecore_Evas *ee);
59static void _ecore_evas_wl_hide(Ecore_Evas *ee); 37static void _ecore_evas_wl_hide(Ecore_Evas *ee);
60static void _ecore_evas_wl_raise(Ecore_Evas *ee);
61static void _ecore_evas_wl_title_set(Ecore_Evas *ee, const char *title);
62static void _ecore_evas_wl_name_class_set(Ecore_Evas *ee, const char *n, const char *c);
63static void _ecore_evas_wl_size_min_set(Ecore_Evas *ee, int w, int h);
64static void _ecore_evas_wl_size_max_set(Ecore_Evas *ee, int w, int h);
65static void _ecore_evas_wl_size_base_set(Ecore_Evas *ee, int w, int h);
66static void _ecore_evas_wl_size_step_set(Ecore_Evas *ee, int w, int h);
67static void _ecore_evas_wl_layer_set(Ecore_Evas *ee, int layer);
68static void _ecore_evas_wl_iconified_set(Ecore_Evas *ee, int iconify);
69static void _ecore_evas_wl_maximized_set(Ecore_Evas *ee, int max);
70static void _ecore_evas_wl_fullscreen_set(Ecore_Evas *ee, int full);
71static void _ecore_evas_wl_ignore_events_set(Ecore_Evas *ee, int ignore);
72static void _ecore_evas_wl_alpha_set(Ecore_Evas *ee, int alpha); 38static void _ecore_evas_wl_alpha_set(Ecore_Evas *ee, int alpha);
73static void _ecore_evas_wl_transparent_set(Ecore_Evas *ee, int transparent); 39static void _ecore_evas_wl_transparent_set(Ecore_Evas *ee, int transparent);
74static int _ecore_evas_wl_render(Ecore_Evas *ee);
75static void _ecore_evas_wl_screen_geometry_get(const Ecore_Evas *ee __UNUSED__, int *x, int *y, int *w, int *h);
76static void _ecore_evas_wl_screen_dpi_get(const Ecore_Evas *ee __UNUSED__, int *xdpi, int *ydpi);
77static void _ecore_evas_wl_shm_pool_free(Ecore_Evas *ee); 40static void _ecore_evas_wl_shm_pool_free(Ecore_Evas *ee);
78static void _ecore_evas_wl_shm_pool_create(Ecore_Evas *ee, size_t size); 41static void _ecore_evas_wl_shm_pool_create(Ecore_Evas *ee, size_t size);
79static void _ecore_evas_wl_buffer_free(Ecore_Evas *ee); 42static void _ecore_evas_wl_buffer_free(Ecore_Evas *ee);
80static void _ecore_evas_wl_buffer_new(Ecore_Evas *ee, int w, int h); 43static void _ecore_evas_wl_buffer_new(Ecore_Evas *ee, int w, int h);
81static Eina_Bool _ecore_evas_wl_cb_mouse_in(void *data __UNUSED__, int type __UNUSED__, void *event);
82static Eina_Bool _ecore_evas_wl_cb_mouse_out(void *data __UNUSED__, int type __UNUSED__, void *event);
83static Eina_Bool _ecore_evas_wl_cb_focus_in(void *data __UNUSED__, int type __UNUSED__, void *event);
84static Eina_Bool _ecore_evas_wl_cb_focus_out(void *data __UNUSED__, int type __UNUSED__, void *event);
85static Eina_Bool _ecore_evas_wl_cb_window_configure(void *data __UNUSED__, int type __UNUSED__, void *event);
86
87/* SMART stuff for frame */
88static Evas_Smart *_ecore_evas_wl_smart = NULL;
89
90static void _ecore_evas_wl_smart_init(void);
91static void _ecore_evas_wl_smart_add(Evas_Object *obj);
92static void _ecore_evas_wl_smart_del(Evas_Object *obj);
93static void _ecore_evas_wl_smart_resize(Evas_Object *obj, Evas_Coord w, Evas_Coord h);
94static void _ecore_evas_wl_smart_show(Evas_Object *obj);
95static void _ecore_evas_wl_smart_hide(Evas_Object *obj);
96
97static Evas_Object *_ecore_evas_wl_frame_add(Evas *evas);
98
99/* local variables */
100static int _ecore_evas_wl_init_count = 0;
101static Ecore_Event_Handler *_ecore_evas_wl_event_hdls[5];
102 44
103static Ecore_Evas_Engine_Func _ecore_wl_engine_func = 45static Ecore_Evas_Engine_Func _ecore_wl_engine_func =
104{ 46{
105 _ecore_evas_wl_free, 47 _ecore_evas_wl_free,
106 _ecore_evas_wl_callback_resize_set, 48 _ecore_evas_wl_common_callback_resize_set,
107 _ecore_evas_wl_callback_move_set, 49 _ecore_evas_wl_common_callback_move_set,
108 NULL, 50 NULL,
109 NULL, 51 NULL,
110 _ecore_evas_wl_callback_delete_request_set, 52 _ecore_evas_wl_common_callback_delete_request_set,
111 NULL, 53 NULL,
112 _ecore_evas_wl_callback_focus_in_set, 54 _ecore_evas_wl_common_callback_focus_in_set,
113 _ecore_evas_wl_callback_focus_out_set, 55 _ecore_evas_wl_common_callback_focus_out_set,
114 _ecore_evas_wl_callback_mouse_in_set, 56 _ecore_evas_wl_common_callback_mouse_in_set,
115 _ecore_evas_wl_callback_mouse_out_set, 57 _ecore_evas_wl_common_callback_mouse_out_set,
116 NULL, // sticky_set 58 NULL, // sticky_set
117 NULL, // unsticky_set 59 NULL, // unsticky_set
118 NULL, // pre_render_set 60 NULL, // pre_render_set
119 NULL, // post_render_set 61 NULL, // post_render_set
120 _ecore_evas_wl_move, 62 _ecore_evas_wl_common_move,
121 NULL, // managed_move 63 NULL, // managed_move
122 _ecore_evas_wl_resize, 64 _ecore_evas_wl_resize,
123 _ecore_evas_wl_move_resize, 65 _ecore_evas_wl_move_resize,
@@ -125,27 +67,27 @@ static Ecore_Evas_Engine_Func _ecore_wl_engine_func =
125 NULL, // shaped_set 67 NULL, // shaped_set
126 _ecore_evas_wl_show, 68 _ecore_evas_wl_show,
127 _ecore_evas_wl_hide, 69 _ecore_evas_wl_hide,
128 _ecore_evas_wl_raise, 70 _ecore_evas_wl_common_raise,
129 NULL, // lower 71 NULL, // lower
130 NULL, // activate 72 NULL, // activate
131 _ecore_evas_wl_title_set, 73 _ecore_evas_wl_common_title_set,
132 _ecore_evas_wl_name_class_set, 74 _ecore_evas_wl_common_name_class_set,
133 _ecore_evas_wl_size_min_set, 75 _ecore_evas_wl_common_size_min_set,
134 _ecore_evas_wl_size_max_set, 76 _ecore_evas_wl_common_size_max_set,
135 _ecore_evas_wl_size_base_set, 77 _ecore_evas_wl_common_size_base_set,
136 _ecore_evas_wl_size_step_set, 78 _ecore_evas_wl_common_size_step_set,
137 NULL, // object_cursor_set 79 NULL, // object_cursor_set
138 _ecore_evas_wl_layer_set, 80 _ecore_evas_wl_common_layer_set,
139 NULL, // focus set 81 NULL, // focus set
140 _ecore_evas_wl_iconified_set, 82 _ecore_evas_wl_common_iconified_set,
141 NULL, // borderless set 83 NULL, // borderless set
142 NULL, // override set 84 NULL, // override set
143 _ecore_evas_wl_maximized_set, 85 _ecore_evas_wl_common_maximized_set,
144 _ecore_evas_wl_fullscreen_set, 86 _ecore_evas_wl_common_fullscreen_set,
145 NULL, // func avoid_damage set 87 NULL, // func avoid_damage set
146 NULL, // func withdrawn set 88 NULL, // func withdrawn set
147 NULL, // func sticky set 89 NULL, // func sticky set
148 _ecore_evas_wl_ignore_events_set, 90 _ecore_evas_wl_common_ignore_events_set,
149 _ecore_evas_wl_alpha_set, 91 _ecore_evas_wl_alpha_set,
150 _ecore_evas_wl_transparent_set, 92 _ecore_evas_wl_transparent_set,
151 NULL, // func profiles set 93 NULL, // func profiles set
@@ -155,9 +97,9 @@ static Ecore_Evas_Engine_Func _ecore_wl_engine_func =
155 NULL, // modal set 97 NULL, // modal set
156 NULL, // demand attention set 98 NULL, // demand attention set
157 NULL, // focus skip set 99 NULL, // focus skip set
158 _ecore_evas_wl_render, 100 _ecore_evas_wl_common_render,
159 _ecore_evas_wl_screen_geometry_get, 101 _ecore_evas_wl_common_screen_geometry_get,
160 _ecore_evas_wl_screen_dpi_get 102 _ecore_evas_wl_common_screen_dpi_get
161}; 103};
162 104
163/* external variables */ 105/* external variables */
@@ -191,13 +133,12 @@ ecore_evas_wayland_shm_new(const char *disp_name, unsigned int parent, int x, in
191 if (!(ee = calloc(1, sizeof(Ecore_Evas)))) 133 if (!(ee = calloc(1, sizeof(Ecore_Evas))))
192 { 134 {
193 ERR("Failed to allocate Ecore_Evas"); 135 ERR("Failed to allocate Ecore_Evas");
194 ecore_wl_shutdown(); 136 goto ee_err;
195 return NULL;
196 } 137 }
197 138
198 ECORE_MAGIC_SET(ee, ECORE_MAGIC_EVAS); 139 ECORE_MAGIC_SET(ee, ECORE_MAGIC_EVAS);
199 140
200 _ecore_evas_wl_init(); 141 _ecore_evas_wl_common_init();
201 142
202 ee->engine.func = (Ecore_Evas_Engine_Func *)&_ecore_wl_engine_func; 143 ee->engine.func = (Ecore_Evas_Engine_Func *)&_ecore_wl_engine_func;
203 144
@@ -234,7 +175,8 @@ ecore_evas_wayland_shm_new(const char *disp_name, unsigned int parent, int x, in
234 if (ee->prop.draw_frame) 175 if (ee->prop.draw_frame)
235 evas_output_framespace_set(ee->evas, 4, 18, 8, 22); 176 evas_output_framespace_set(ee->evas, 4, 18, 8, 22);
236 177
237 if (parent) p = ecore_wl_window_find(parent); 178 if (parent)
179 p = ecore_wl_window_find(parent);
238 180
239 /* FIXME: Get if parent is alpha, and set */ 181 /* FIXME: Get if parent is alpha, and set */
240 182
@@ -245,32 +187,25 @@ ecore_evas_wayland_shm_new(const char *disp_name, unsigned int parent, int x, in
245 187
246 if ((einfo = (Evas_Engine_Info_Wayland_Shm *)evas_engine_info_get(ee->evas))) 188 if ((einfo = (Evas_Engine_Info_Wayland_Shm *)evas_engine_info_get(ee->evas)))
247 { 189 {
248 einfo->info.rotation = ee->rotation;
249 einfo->info.destination_alpha = ee->alpha; 190 einfo->info.destination_alpha = ee->alpha;
250 einfo->info.rotation = ee->rotation; 191 einfo->info.rotation = ee->rotation;
251 if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo)) 192 if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo))
252 { 193 {
253 ERR("Failed to set Evas Engine Info for '%s'", ee->driver); 194 ERR("Failed to set Evas Engine Info for '%s'", ee->driver);
254 ecore_evas_free(ee); 195 goto err;
255 _ecore_evas_wl_shutdown();
256 ecore_wl_shutdown();
257 return NULL;
258 } 196 }
259 } 197 }
260 else 198 else
261 { 199 {
262 ERR("Failed to get Evas Engine Info for '%s'", ee->driver); 200 ERR("Failed to get Evas Engine Info for '%s'", ee->driver);
263 ecore_evas_free(ee); 201 goto err;
264 _ecore_evas_wl_shutdown();
265 ecore_wl_shutdown();
266 return NULL;
267 } 202 }
268 203
269 ecore_evas_callback_pre_free_set(ee, _ecore_evas_wl_pre_free); 204 ecore_evas_callback_pre_free_set(ee, _ecore_evas_wl_common_pre_free);
270 205
271 if (ee->prop.draw_frame) 206 if (ee->prop.draw_frame)
272 { 207 {
273 ee->engine.wl.frame = _ecore_evas_wl_frame_add(ee->evas); 208 ee->engine.wl.frame = _ecore_evas_wl_common_frame_add(ee->evas);
274 evas_object_is_frame_object_set(ee->engine.wl.frame, EINA_TRUE); 209 evas_object_is_frame_object_set(ee->engine.wl.frame, EINA_TRUE);
275 evas_object_move(ee->engine.wl.frame, 0, 0); 210 evas_object_move(ee->engine.wl.frame, 0, 0);
276 } 211 }
@@ -284,170 +219,23 @@ ecore_evas_wayland_shm_new(const char *disp_name, unsigned int parent, int x, in
284 (Ecore_Event_Multi_Down_Cb)_ecore_evas_mouse_multi_down_process, 219 (Ecore_Event_Multi_Down_Cb)_ecore_evas_mouse_multi_down_process,
285 (Ecore_Event_Multi_Up_Cb)_ecore_evas_mouse_multi_up_process); 220 (Ecore_Event_Multi_Up_Cb)_ecore_evas_mouse_multi_up_process);
286 221
287// evas_event_feed_mouse_in(ee->evas, (unsigned int)((unsigned long long)(ecore_time_get() * 1000.0) & 0xffffffff), NULL);
288
289 return ee; 222 return ee;
290}
291
292/* local functions */
293static int
294_ecore_evas_wl_init(void)
295{
296 LOGFN(__FILE__, __LINE__, __FUNCTION__);
297
298 if (++_ecore_evas_wl_init_count != 1)
299 return _ecore_evas_wl_init_count;
300
301 _ecore_evas_wl_event_hdls[0] =
302 ecore_event_handler_add(ECORE_WL_EVENT_MOUSE_IN,
303 _ecore_evas_wl_cb_mouse_in, NULL);
304 _ecore_evas_wl_event_hdls[1] =
305 ecore_event_handler_add(ECORE_WL_EVENT_MOUSE_OUT,
306 _ecore_evas_wl_cb_mouse_out, NULL);
307 _ecore_evas_wl_event_hdls[2] =
308 ecore_event_handler_add(ECORE_WL_EVENT_FOCUS_IN,
309 _ecore_evas_wl_cb_focus_in, NULL);
310 _ecore_evas_wl_event_hdls[3] =
311 ecore_event_handler_add(ECORE_WL_EVENT_FOCUS_OUT,
312 _ecore_evas_wl_cb_focus_out, NULL);
313 _ecore_evas_wl_event_hdls[4] =
314 ecore_event_handler_add(ECORE_WL_EVENT_WINDOW_CONFIGURE,
315 _ecore_evas_wl_cb_window_configure, NULL);
316
317 ecore_event_evas_init();
318
319 return _ecore_evas_wl_init_count;
320}
321
322static int
323_ecore_evas_wl_shutdown(void)
324{
325 unsigned int i = 0;
326
327 LOGFN(__FILE__, __LINE__, __FUNCTION__);
328
329 if (--_ecore_evas_wl_init_count != 0)
330 return _ecore_evas_wl_init_count;
331 223
332 for (i = 0; i < sizeof(_ecore_evas_wl_event_hdls) / sizeof(Ecore_Event_Handler *); i++) 224 err:
333 { 225 ecore_evas_free(ee);
334 if (_ecore_evas_wl_event_hdls[i]) 226 _ecore_evas_wl_common_shutdown();
335 ecore_event_handler_del(_ecore_evas_wl_event_hdls[i]);
336 }
337
338 ecore_event_evas_shutdown();
339 227
340 return _ecore_evas_wl_init_count; 228 ee_err:
341} 229 ecore_wl_shutdown();
342 230 return NULL;
343static void
344_ecore_evas_wl_pre_free(Ecore_Evas *ee)
345{
346 LOGFN(__FILE__, __LINE__, __FUNCTION__);
347
348 if (!ee) return;
349 if (ee->engine.wl.frame) evas_object_del(ee->engine.wl.frame);
350} 231}
351 232
352static void 233static void
353_ecore_evas_wl_free(Ecore_Evas *ee) 234_ecore_evas_wl_free(Ecore_Evas *ee)
354{ 235{
355 LOGFN(__FILE__, __LINE__, __FUNCTION__);
356
357 _ecore_evas_wl_buffer_free(ee); 236 _ecore_evas_wl_buffer_free(ee);
358 _ecore_evas_wl_shm_pool_free(ee); 237 _ecore_evas_wl_shm_pool_free(ee);
359 238 _ecore_evas_wl_common_free(ee);
360 if (ee->engine.wl.win) ecore_wl_window_free(ee->engine.wl.win);
361 ee->engine.wl.win = NULL;
362
363 ecore_event_window_unregister(ee->prop.window);
364 ecore_evas_input_event_unregister(ee);
365
366 _ecore_evas_wl_shutdown();
367 ecore_wl_shutdown();
368}
369
370static void
371_ecore_evas_wl_callback_resize_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee))
372{
373 LOGFN(__FILE__, __LINE__, __FUNCTION__);
374
375 if (!ee) return;
376 ee->func.fn_resize = func;
377}
378
379static void
380_ecore_evas_wl_callback_move_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee))
381{
382 LOGFN(__FILE__, __LINE__, __FUNCTION__);
383
384 if (!ee) return;
385 ee->func.fn_move = func;
386}
387
388static void
389_ecore_evas_wl_callback_delete_request_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee))
390{
391 LOGFN(__FILE__, __LINE__, __FUNCTION__);
392
393 if (!ee) return;
394 ee->func.fn_delete_request = func;
395}
396
397static void
398_ecore_evas_wl_callback_focus_in_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee))
399{
400 LOGFN(__FILE__, __LINE__, __FUNCTION__);
401
402 if (!ee) return;
403 ee->func.fn_focus_in = func;
404}
405
406static void
407_ecore_evas_wl_callback_focus_out_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee))
408{
409 LOGFN(__FILE__, __LINE__, __FUNCTION__);
410
411 if (!ee) return;
412 ee->func.fn_focus_out = func;
413}
414
415static void
416_ecore_evas_wl_callback_mouse_in_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee))
417{
418 LOGFN(__FILE__, __LINE__, __FUNCTION__);
419
420 if (!ee) return;
421 ee->func.fn_mouse_in = func;
422}
423
424static void
425_ecore_evas_wl_callback_mouse_out_set(Ecore_Evas *ee, void (*func)(Ecore_Evas *ee))
426{
427 LOGFN(__FILE__, __LINE__, __FUNCTION__);
428
429 if (!ee) return;
430 ee->func.fn_mouse_out = func;
431}
432
433static void
434_ecore_evas_wl_move(Ecore_Evas *ee, int x, int y)
435{
436 LOGFN(__FILE__, __LINE__, __FUNCTION__);
437
438 if (!ee) return;
439
440 ee->req.x = x;
441 ee->req.y = y;
442
443 if ((ee->x != x) || (ee->y != y))
444 {
445 ee->x = x;
446 ee->y = y;
447 if (ee->engine.wl.win)
448 ecore_wl_window_update_location(ee->engine.wl.win, x, y);
449 if (ee->func.fn_move) ee->func.fn_move(ee);
450 }
451} 239}
452 240
453static void 241static void
@@ -520,8 +308,7 @@ _ecore_evas_wl_resize(Ecore_Evas *ee, int w, int h)
520 308
521 if (ee->engine.wl.win) 309 if (ee->engine.wl.win)
522 { 310 {
523// if (!ee->prop.fullscreen) 311 ecore_wl_window_update_size(ee->engine.wl.win, w, h);
524 ecore_wl_window_update_size(ee->engine.wl.win, w, h);
525 ecore_wl_window_buffer_attach(ee->engine.wl.win, 312 ecore_wl_window_buffer_attach(ee->engine.wl.win,
526 ee->engine.wl.buffer, 0, 0); 313 ee->engine.wl.buffer, 0, 0);
527 } 314 }
@@ -537,7 +324,7 @@ _ecore_evas_wl_move_resize(Ecore_Evas *ee, int x, int y, int w, int h)
537 324
538 if (!ee) return; 325 if (!ee) return;
539 if ((ee->x != x) || (ee->y != y)) 326 if ((ee->x != x) || (ee->y != y))
540 _ecore_evas_wl_move(ee, x, y); 327 _ecore_evas_wl_common_move(ee, x, y);
541 if ((ee->w != w) || (ee->h != h)) 328 if ((ee->w != w) || (ee->h != h))
542 _ecore_evas_wl_resize(ee, w, h); 329 _ecore_evas_wl_resize(ee, w, h);
543} 330}
@@ -563,8 +350,6 @@ _ecore_evas_wl_show(Ecore_Evas *ee)
563 einfo->info.dest = ee->engine.wl.pool_data; 350 einfo->info.dest = ee->engine.wl.pool_data;
564 evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo); 351 evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo);
565 352
566 /* ecore_wl_flush(); */
567
568 if (ee->engine.wl.win) 353 if (ee->engine.wl.win)
569 { 354 {
570 ecore_wl_window_show(ee->engine.wl.win); 355 ecore_wl_window_show(ee->engine.wl.win);
@@ -610,7 +395,8 @@ _ecore_evas_wl_hide(Ecore_Evas *ee)
610 evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo); 395 evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo);
611 } 396 }
612 397
613 ecore_wl_window_hide(ee->engine.wl.win); 398 if (ee->engine.wl.win)
399 ecore_wl_window_hide(ee->engine.wl.win);
614 400
615 ee->visible = 0; 401 ee->visible = 0;
616 ee->should_be_visible = 0; 402 ee->should_be_visible = 0;
@@ -619,166 +405,10 @@ _ecore_evas_wl_hide(Ecore_Evas *ee)
619} 405}
620 406
621static void 407static void
622_ecore_evas_wl_raise(Ecore_Evas *ee)
623{
624 LOGFN(__FILE__, __LINE__, __FUNCTION__);
625
626 if ((!ee) || (!ee->visible)) return;
627 ecore_wl_window_raise(ee->engine.wl.win);
628}
629
630static void
631_ecore_evas_wl_title_set(Ecore_Evas *ee, const char *title)
632{
633 LOGFN(__FILE__, __LINE__, __FUNCTION__);
634
635 if (!ee) return;
636 if (ee->prop.title) free(ee->prop.title);
637 ee->prop.title = NULL;
638 if (title) ee->prop.title = strdup(title);
639 if ((ee->prop.draw_frame) && (ee->engine.wl.frame))
640 {
641 EE_Wl_Smart_Data *sd;
642
643 if (!(sd = evas_object_smart_data_get(ee->engine.wl.frame))) return;
644 evas_object_text_text_set(sd->text, ee->prop.title);
645 }
646
647 if ((ee->prop.title) && (ee->engine.wl.win->shell_surface))
648 wl_shell_surface_set_title(ee->engine.wl.win->shell_surface,
649 ee->prop.title);
650}
651
652static void
653_ecore_evas_wl_name_class_set(Ecore_Evas *ee, const char *n, const char *c)
654{
655 LOGFN(__FILE__, __LINE__, __FUNCTION__);
656
657 if (!ee) return;
658 if (ee->prop.name) free(ee->prop.name);
659 if (ee->prop.clas) free(ee->prop.clas);
660 ee->prop.name = NULL;
661 ee->prop.clas = NULL;
662 if (n) ee->prop.name = strdup(n);
663 if (c) ee->prop.clas = strdup(c);
664
665 if ((ee->prop.clas) && (ee->engine.wl.win->shell_surface))
666 wl_shell_surface_set_class(ee->engine.wl.win->shell_surface,
667 ee->prop.clas);
668}
669
670static void
671_ecore_evas_wl_size_min_set(Ecore_Evas *ee, int w, int h)
672{
673 LOGFN(__FILE__, __LINE__, __FUNCTION__);
674
675 if (!ee) return;
676 if (w < 0) w = 0;
677 if (h < 0) h = 0;
678 if ((ee->prop.min.w == w) && (ee->prop.min.h == h)) return;
679 ee->prop.min.w = w;
680 ee->prop.min.h = h;
681}
682
683static void
684_ecore_evas_wl_size_max_set(Ecore_Evas *ee, int w, int h)
685{
686 LOGFN(__FILE__, __LINE__, __FUNCTION__);
687
688 if (!ee) return;
689 if (w < 0) w = 0;
690 if (h < 0) h = 0;
691 if ((ee->prop.max.w == w) && (ee->prop.max.h == h)) return;
692 ee->prop.max.w = w;
693 ee->prop.max.h = h;
694}
695
696static void
697_ecore_evas_wl_size_base_set(Ecore_Evas *ee, int w, int h)
698{
699 LOGFN(__FILE__, __LINE__, __FUNCTION__);
700
701 if (!ee) return;
702 if (w < 0) w = 0;
703 if (h < 0) h = 0;
704 if ((ee->prop.base.w == w) && (ee->prop.base.h == h)) return;
705 ee->prop.base.w = w;
706 ee->prop.base.h = h;
707}
708
709static void
710_ecore_evas_wl_size_step_set(Ecore_Evas *ee, int w, int h)
711{
712 LOGFN(__FILE__, __LINE__, __FUNCTION__);
713
714 if (!ee) return;
715 if (w < 0) w = 0;
716 if (h < 0) h = 0;
717 if ((ee->prop.step.w == w) && (ee->prop.step.h == h)) return;
718 ee->prop.step.w = w;
719 ee->prop.step.h = h;
720}
721
722static void
723_ecore_evas_wl_layer_set(Ecore_Evas *ee, int layer)
724{
725 LOGFN(__FILE__, __LINE__, __FUNCTION__);
726
727 if (!ee) return;
728 if (ee->prop.layer == layer) return;
729 if (layer < 1) layer = 1;
730 else if (layer > 255) layer = 255;
731 ee->prop.layer = layer;
732}
733
734static void
735_ecore_evas_wl_iconified_set(Ecore_Evas *ee, int iconify)
736{
737 LOGFN(__FILE__, __LINE__, __FUNCTION__);
738
739 if (!ee) return;
740 if (ee->prop.iconified == iconify) return;
741 ee->prop.iconified = iconify;
742 /* FIXME: Implement this in Wayland someshow */
743}
744
745static void
746_ecore_evas_wl_maximized_set(Ecore_Evas *ee, int max)
747{
748 LOGFN(__FILE__, __LINE__, __FUNCTION__);
749
750 if (!ee) return;
751 if (ee->prop.maximized == max) return;
752 ee->prop.maximized = max;
753 ecore_wl_window_maximized_set(ee->engine.wl.win, max);
754}
755
756static void
757_ecore_evas_wl_fullscreen_set(Ecore_Evas *ee, int full)
758{
759 LOGFN(__FILE__, __LINE__, __FUNCTION__);
760
761 if (!ee) return;
762 if (ee->prop.fullscreen == full) return;
763 ee->prop.fullscreen = full;
764 ecore_wl_window_fullscreen_set(ee->engine.wl.win, full);
765}
766
767static void
768_ecore_evas_wl_ignore_events_set(Ecore_Evas *ee, int ignore)
769{
770 LOGFN(__FILE__, __LINE__, __FUNCTION__);
771
772 if (!ee) return;
773 ee->ignore_events = ignore;
774 /* NB: Hmmm, may need to pass this to ecore_wl_window in the future */
775}
776
777static void
778_ecore_evas_wl_alpha_set(Ecore_Evas *ee, int alpha) 408_ecore_evas_wl_alpha_set(Ecore_Evas *ee, int alpha)
779{ 409{
780 Evas_Engine_Info_Wayland_Shm *einfo; 410 Evas_Engine_Info_Wayland_Shm *einfo;
781 Ecore_Wl_Window *win; 411 Ecore_Wl_Window *win = NULL;
782 412
783 LOGFN(__FILE__, __LINE__, __FUNCTION__); 413 LOGFN(__FILE__, __LINE__, __FUNCTION__);
784 414
@@ -806,11 +436,10 @@ _ecore_evas_wl_alpha_set(Ecore_Evas *ee, int alpha)
806 evas_damage_rectangle_add(ee->evas, 0, 0, ee->w, ee->h); 436 evas_damage_rectangle_add(ee->evas, 0, 0, ee->w, ee->h);
807 } 437 }
808 438
809 if (ee->engine.wl.win) 439 if (win)
810 { 440 {
811 ecore_wl_window_update_size(ee->engine.wl.win, ee->w, ee->h); 441 ecore_wl_window_update_size(win, ee->w, ee->h);
812 ecore_wl_window_buffer_attach(ee->engine.wl.win, 442 ecore_wl_window_buffer_attach(win, ee->engine.wl.buffer, 0, 0);
813 ee->engine.wl.buffer, 0, 0);
814 } 443 }
815} 444}
816 445
@@ -847,77 +476,6 @@ _ecore_evas_wl_transparent_set(Ecore_Evas *ee, int transparent)
847 } 476 }
848} 477}
849 478
850static int
851_ecore_evas_wl_render(Ecore_Evas *ee)
852{
853 int rend = 0;
854
855 if (!ee) return 0;
856 if (!ee->visible)
857 evas_norender(ee->evas);
858 else
859 {
860 Eina_List *ll = NULL, *updates = NULL;
861 Ecore_Evas *ee2 = NULL;
862
863 if (ee->func.fn_pre_render) ee->func.fn_pre_render(ee);
864
865 EINA_LIST_FOREACH(ee->sub_ecore_evas, ll, ee2)
866 {
867 if (ee2->func.fn_pre_render) ee2->func.fn_pre_render(ee2);
868 if (ee2->engine.func->fn_render)
869 rend |= ee2->engine.func->fn_render(ee2);
870 if (ee2->func.fn_post_render) ee2->func.fn_post_render(ee2);
871 }
872
873 if ((updates = evas_render_updates(ee->evas)))
874 {
875 Eina_List *l = NULL;
876 Eina_Rectangle *r;
877
878 LOGFN(__FILE__, __LINE__, __FUNCTION__);
879
880 EINA_LIST_FOREACH(updates, l, r)
881 ecore_wl_window_damage(ee->engine.wl.win,
882 r->x, r->y, r->w, r->h);
883
884 ecore_wl_flush();
885
886 evas_render_updates_free(updates);
887 _ecore_evas_idle_timeout_update(ee);
888 rend = 1;
889 }
890
891 if (ee->func.fn_post_render) ee->func.fn_post_render(ee);
892 }
893 return rend;
894}
895
896static void
897_ecore_evas_wl_screen_geometry_get(const Ecore_Evas *ee __UNUSED__, int *x, int *y, int *w, int *h)
898{
899 LOGFN(__FILE__, __LINE__, __FUNCTION__);
900
901 if (x) *x = 0;
902 if (y) *y = 0;
903 ecore_wl_screen_size_get(w, h);
904}
905
906static void
907_ecore_evas_wl_screen_dpi_get(const Ecore_Evas *ee __UNUSED__, int *xdpi, int *ydpi)
908{
909 int dpi = 0;
910
911 LOGFN(__FILE__, __LINE__, __FUNCTION__);
912
913 if (xdpi) *xdpi = 0;
914 if (ydpi) *ydpi = 0;
915 /* FIXME: Ideally this needs to get the DPI from a specific screen */
916 dpi = ecore_wl_dpi_get();
917 if (xdpi) *xdpi = dpi;
918 if (ydpi) *ydpi = dpi;
919}
920
921static void 479static void
922_ecore_evas_wl_shm_pool_free(Ecore_Evas *ee) 480_ecore_evas_wl_shm_pool_free(Ecore_Evas *ee)
923{ 481{
@@ -961,8 +519,7 @@ _ecore_evas_wl_shm_pool_create(Ecore_Evas *ee, size_t size)
961 if (ftruncate(fd, size) < 0) 519 if (ftruncate(fd, size) < 0)
962 { 520 {
963 ERR("Could not truncate temporary file."); 521 ERR("Could not truncate temporary file.");
964 close(fd); 522 goto end;
965 return;
966 } 523 }
967 524
968 data = mmap(NULL, size, (PROT_READ | PROT_WRITE), MAP_SHARED, fd, 0); 525 data = mmap(NULL, size, (PROT_READ | PROT_WRITE), MAP_SHARED, fd, 0);
@@ -971,14 +528,14 @@ _ecore_evas_wl_shm_pool_create(Ecore_Evas *ee, size_t size)
971 if (data == MAP_FAILED) 528 if (data == MAP_FAILED)
972 { 529 {
973 ERR("mmap of temporary file failed."); 530 ERR("mmap of temporary file failed.");
974 close(fd); 531 goto end;
975 return;
976 } 532 }
977 533
978 ee->engine.wl.pool_size = size; 534 ee->engine.wl.pool_size = size;
979 ee->engine.wl.pool_data = data; 535 ee->engine.wl.pool_data = data;
980 ee->engine.wl.pool = wl_shm_create_pool(shm, fd, size); 536 ee->engine.wl.pool = wl_shm_create_pool(shm, fd, size);
981 537
538 end:
982 close(fd); 539 close(fd);
983} 540}
984 541
@@ -1023,270 +580,6 @@ _ecore_evas_wayland_shm_resize(Ecore_Evas *ee, int location)
1023 ecore_wl_window_resize(ee->engine.wl.win, ee->w, ee->h, location); 580 ecore_wl_window_resize(ee->engine.wl.win, ee->w, ee->h, location);
1024 } 581 }
1025} 582}
1026
1027void
1028_ecore_evas_wayland_shm_move(Ecore_Evas *ee, int x, int y)
1029{
1030 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1031
1032 if (!ee) return;
1033 if (ee->engine.wl.win)
1034 {
1035 ee->engine.wl.win->moving = EINA_TRUE;
1036 ecore_wl_window_move(ee->engine.wl.win, x, y);
1037 }
1038}
1039
1040static Eina_Bool
1041_ecore_evas_wl_cb_mouse_in(void *data __UNUSED__, int type __UNUSED__, void *event)
1042{
1043 Ecore_Evas *ee;
1044 Ecore_Wl_Event_Mouse_In *ev;
1045
1046 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1047
1048 ev = event;
1049 ee = ecore_event_window_match(ev->window);
1050 if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON;
1051 if (ev->window != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
1052 if (!ee->in)
1053 {
1054 if (ee->func.fn_mouse_in) ee->func.fn_mouse_in(ee);
1055 ecore_event_evas_modifier_lock_update(ee->evas, ev->modifiers);
1056 evas_event_feed_mouse_in(ee->evas, ev->timestamp, NULL);
1057// _ecore_evas_mouse_move_process(ee, ev->x, ev->y, ev->timestamp);
1058 ee->in = EINA_TRUE;
1059 }
1060 return ECORE_CALLBACK_PASS_ON;
1061}
1062
1063static Eina_Bool
1064_ecore_evas_wl_cb_mouse_out(void *data __UNUSED__, int type __UNUSED__, void *event)
1065{
1066 Ecore_Evas *ee;
1067 Ecore_Wl_Event_Mouse_Out *ev;
1068
1069 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1070
1071 ev = event;
1072 ee = ecore_event_window_match(ev->window);
1073 if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON;
1074 if (ev->window != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
1075 if (ee->in)
1076 {
1077 ecore_event_evas_modifier_lock_update(ee->evas, ev->modifiers);
1078// _ecore_evas_mouse_move_process(ee, ev->x, ev->y, ev->timestamp);
1079 evas_event_feed_mouse_out(ee->evas, ev->timestamp, NULL);
1080 if (ee->func.fn_mouse_out) ee->func.fn_mouse_out(ee);
1081 if (ee->prop.cursor.object) evas_object_hide(ee->prop.cursor.object);
1082 ee->in = EINA_FALSE;
1083 }
1084 return ECORE_CALLBACK_PASS_ON;
1085}
1086
1087static Eina_Bool
1088_ecore_evas_wl_cb_focus_in(void *data __UNUSED__, int type __UNUSED__, void *event)
1089{
1090 Ecore_Evas *ee;
1091 Ecore_Wl_Event_Focus_In *ev;
1092
1093 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1094
1095 ev = event;
1096 ee = ecore_event_window_match(ev->win);
1097 if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON;
1098 if (ev->win != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
1099 ee->prop.focused = 1;
1100 evas_focus_in(ee->evas);
1101 if (ee->func.fn_focus_in) ee->func.fn_focus_in(ee);
1102 return ECORE_CALLBACK_PASS_ON;
1103}
1104
1105static Eina_Bool
1106_ecore_evas_wl_cb_focus_out(void *data __UNUSED__, int type __UNUSED__, void *event)
1107{
1108 Ecore_Evas *ee;
1109 Ecore_Wl_Event_Focus_In *ev;
1110
1111 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1112
1113 ev = event;
1114 ee = ecore_event_window_match(ev->win);
1115 if ((!ee) || (ee->ignore_events)) return ECORE_CALLBACK_PASS_ON;
1116 if (ev->win != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
1117 evas_focus_out(ee->evas);
1118 ee->prop.focused = 0;
1119 if (ee->func.fn_focus_out) ee->func.fn_focus_out(ee);
1120 return ECORE_CALLBACK_PASS_ON;
1121}
1122
1123static Eina_Bool
1124_ecore_evas_wl_cb_window_configure(void *data __UNUSED__, int type __UNUSED__, void *event)
1125{
1126 Ecore_Evas *ee;
1127 Ecore_Wl_Event_Window_Configure *ev;
1128 int nw = 0, nh = 0;
1129
1130 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1131
1132 ev = event;
1133 ee = ecore_event_window_match(ev->win);
1134 if (!ee) return ECORE_CALLBACK_PASS_ON;
1135 if (ev->win != ee->prop.window) return ECORE_CALLBACK_PASS_ON;
1136
1137 if (ee->prop.fullscreen)
1138 {
1139 _ecore_evas_wl_move(ee, ev->x, ev->y);
1140 _ecore_evas_wl_resize(ee, ev->w, ev->h);
1141
1142 return ECORE_CALLBACK_PASS_ON;
1143 }
1144
1145 if ((ee->x != ev->x) || (ee->y != ev->y))
1146 {
1147 ee->req.x = ee->x;
1148 ee->req.y = ee->y;
1149 if (ee->func.fn_move) ee->func.fn_move(ee);
1150 }
1151
1152 nw = ev->w;
1153 nh = ev->h;
1154
1155 if ((ee->prop.maximized) || (!ee->prop.fullscreen))
1156 {
1157 int fw = 0, fh = 0;
1158
1159 evas_output_framespace_get(ee->evas, NULL, NULL, &fw, &fh);
1160 nw = ev->w - fw;
1161 nh = ev->h - fh;
1162 }
1163
1164 if (ee->prop.min.w > nw) nw = ee->prop.min.w;
1165 else if (nw > ee->prop.max.w) nw = ee->prop.max.w;
1166 if (ee->prop.min.h > nh) nh = ee->prop.min.h;
1167 else if (nh > ee->prop.max.h) nh = ee->prop.max.h;
1168
1169 if ((ee->w != nw) || (ee->h != nh))
1170 {
1171 ee->req.w = nw;
1172 ee->req.h = nh;
1173 if (ee->func.fn_resize) ee->func.fn_resize(ee);
1174 }
1175
1176 return ECORE_CALLBACK_PASS_ON;
1177}
1178
1179static void
1180_ecore_evas_wl_smart_init(void)
1181{
1182 if (_ecore_evas_wl_smart) return;
1183 {
1184 static const Evas_Smart_Class sc =
1185 {
1186 "ecore_evas_wl_frame", EVAS_SMART_CLASS_VERSION,
1187 _ecore_evas_wl_smart_add,
1188 _ecore_evas_wl_smart_del,
1189 NULL,
1190 _ecore_evas_wl_smart_resize,
1191 _ecore_evas_wl_smart_show,
1192 _ecore_evas_wl_smart_hide,
1193 NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL
1194 };
1195 _ecore_evas_wl_smart = evas_smart_class_new(&sc);
1196 }
1197}
1198
1199static void
1200_ecore_evas_wl_smart_add(Evas_Object *obj)
1201{
1202 EE_Wl_Smart_Data *sd;
1203 Evas *evas;
1204
1205 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1206
1207 if (!(sd = calloc(1, sizeof(EE_Wl_Smart_Data)))) return;
1208
1209 evas = evas_object_evas_get(obj);
1210
1211 sd->x = 0;
1212 sd->y = 0;
1213 sd->w = 1;
1214 sd->h = 1;
1215
1216 sd->frame = evas_object_rectangle_add(evas);
1217 evas_object_is_frame_object_set(sd->frame, EINA_TRUE);
1218 evas_object_color_set(sd->frame, 249, 249, 249, 255);
1219 evas_object_smart_member_add(sd->frame, obj);
1220
1221 sd->text = evas_object_text_add(evas);
1222 evas_object_color_set(sd->text, 0, 0, 0, 255);
1223 evas_object_text_style_set(sd->text, EVAS_TEXT_STYLE_PLAIN);
1224 evas_object_text_font_set(sd->text, "Sans", 10);
1225 evas_object_text_text_set(sd->text, "Smart Test");
1226
1227 evas_object_smart_data_set(obj, sd);
1228}
1229
1230static void
1231_ecore_evas_wl_smart_del(Evas_Object *obj)
1232{
1233 EE_Wl_Smart_Data *sd;
1234
1235 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1236
1237 if (!(sd = evas_object_smart_data_get(obj))) return;
1238 evas_object_del(sd->text);
1239 evas_object_del(sd->frame);
1240 free(sd);
1241}
1242
1243static void
1244_ecore_evas_wl_smart_resize(Evas_Object *obj, Evas_Coord w, Evas_Coord h)
1245{
1246 EE_Wl_Smart_Data *sd;
1247
1248 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1249
1250 if (!(sd = evas_object_smart_data_get(obj))) return;
1251 if ((sd->w == w) && (sd->h == h)) return;
1252 sd->w = w;
1253 sd->h = h;
1254 evas_object_resize(sd->frame, w, h);
1255}
1256
1257static void
1258_ecore_evas_wl_smart_show(Evas_Object *obj)
1259{
1260 EE_Wl_Smart_Data *sd;
1261
1262 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1263
1264 if (!(sd = evas_object_smart_data_get(obj))) return;
1265 evas_object_show(sd->frame);
1266 evas_object_show(sd->text);
1267}
1268
1269static void
1270_ecore_evas_wl_smart_hide(Evas_Object *obj)
1271{
1272 EE_Wl_Smart_Data *sd;
1273
1274 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1275
1276 if (!(sd = evas_object_smart_data_get(obj))) return;
1277 evas_object_hide(sd->text);
1278 evas_object_hide(sd->frame);
1279}
1280
1281static Evas_Object *
1282_ecore_evas_wl_frame_add(Evas *evas)
1283{
1284 LOGFN(__FILE__, __LINE__, __FUNCTION__);
1285
1286 _ecore_evas_wl_smart_init();
1287 return evas_object_smart_add(evas, _ecore_evas_wl_smart);
1288}
1289
1290#else 583#else
1291EAPI Ecore_Evas * 584EAPI Ecore_Evas *
1292ecore_evas_wayland_shm_new(const char *disp_name __UNUSED__, unsigned int parent __UNUSED__, int x __UNUSED__, int y __UNUSED__, int w __UNUSED__, int h __UNUSED__, Eina_Bool frame __UNUSED__) 585ecore_evas_wayland_shm_new(const char *disp_name __UNUSED__, unsigned int parent __UNUSED__, int x __UNUSED__, int y __UNUSED__, int w __UNUSED__, int h __UNUSED__, Eina_Bool frame __UNUSED__)