summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/examples/ecore/ecore_evas_ews_example.c269
-rw-r--r--src/examples/ecore/meson.build1
-rw-r--r--src/lib/ecore_evas/Ecore_Evas.h17
-rw-r--r--src/lib/ecore_evas/ecore_evas.c26
-rw-r--r--src/lib/ecore_evas/ecore_evas_buffer.c1
-rw-r--r--src/lib/ecore_evas/ecore_evas_ews.c1400
-rw-r--r--src/lib/ecore_evas/ecore_evas_module.c3
-rw-r--r--src/lib/elementary/efl_ui_win.c8
-rw-r--r--src/lib/elementary/elm_config.c3
-rw-r--r--src/lib/elementary/elm_config.h1
-rw-r--r--src/lib/elementary/elm_main.c6
-rw-r--r--src/lib/elementary/elm_priv.h18
-rw-r--r--src/lib/elementary/elm_theme.c1
-rw-r--r--src/lib/elementary/elm_win.h1
-rw-r--r--src/lib/elementary/elu_ews_wm.c531
-rw-r--r--src/lib/elementary/meson.build1
-rw-r--r--src/modules/ecore_evas/meson.build2
17 files changed, 29 insertions, 2260 deletions
diff --git a/src/examples/ecore/ecore_evas_ews_example.c b/src/examples/ecore/ecore_evas_ews_example.c
deleted file mode 100644
index b4415cb5e9..0000000000
--- a/src/examples/ecore/ecore_evas_ews_example.c
+++ /dev/null
@@ -1,269 +0,0 @@
1/**
2 * Ecore example illustrating the ews of ecore evas usage.
3 *
4 * You'll need at least one Evas engine built for it (excluding the
5 * buffer one). See stdout/stderr for output.
6 *
7 * @verbatim
8 * gcc -o ecore_evas_ews_example ecore_evas_ews_example.c `pkg-config --libs --cflags ecore evas ecore-evas`
9 * @endverbatim
10 */
11
12#include <Ecore.h>
13#include <Ecore_Evas.h>
14#include <unistd.h>
15#include <stdio.h>
16#include <ctype.h>
17
18static Eina_Bool
19_wm_win_add(void *data EINA_UNUSED, int type EINA_UNUSED, void *event_info)
20{
21 Ecore_Evas *ee = event_info;
22 printf("WM: new window=%p\n", ee);
23 return EINA_TRUE;
24}
25
26static Eina_Bool
27_wm_win_move(void *data EINA_UNUSED, int type EINA_UNUSED, void *event_info)
28{
29 Ecore_Evas *ee = event_info;
30 int x, y;
31 ecore_evas_geometry_get(ee, &x, &y, NULL, NULL);
32 printf("WM: window=%p moved to %d,%d\n", ee, x, y);
33 return EINA_TRUE;
34}
35
36static Eina_Bool
37_wm_win_resize(void *data EINA_UNUSED, int type EINA_UNUSED, void *event_info)
38{
39 Ecore_Evas *ee = event_info;
40 int w, h;
41 ecore_evas_geometry_get(ee, NULL, NULL, &w, &h);
42 printf("WM: window=%p resized to %dx%d\n", ee, w, h);
43 return EINA_TRUE;
44}
45
46static Eina_Bool
47_wm_win_show(void *data EINA_UNUSED, int type EINA_UNUSED, void *event_info)
48{
49 Ecore_Evas *ee = event_info;
50 printf("WM: show window=%p\n", ee);
51 return EINA_TRUE;
52}
53
54static void
55optional_ews_window_manager_setup(void)
56{
57 ecore_event_handler_add(ECORE_EVAS_EWS_EVENT_ADD, _wm_win_add, NULL);
58 ecore_event_handler_add(ECORE_EVAS_EWS_EVENT_MOVE, _wm_win_move, NULL);
59 ecore_event_handler_add(ECORE_EVAS_EWS_EVENT_RESIZE, _wm_win_resize, NULL);
60 ecore_event_handler_add(ECORE_EVAS_EWS_EVENT_SHOW, _wm_win_show, NULL);
61
62 /* one may use any known unique identifier, like an app function pointer */
63 ecore_evas_ews_manager_set(optional_ews_window_manager_setup);
64}
65
66static void
67optional_ews_setup(void)
68{
69 Evas_Object *bg;
70 Evas *e;
71
72 ecore_evas_ews_setup(0, 0, 800, 600); /* "screen" size */
73 e = ecore_evas_ews_evas_get(); /* forces "screen" to be allocated */
74
75 bg = evas_object_rectangle_add(e);
76 evas_object_color_set(bg, 128, 32, 32, 255);
77 ecore_evas_ews_background_set(bg);
78}
79
80static Eina_Bool
81_stdin_cb(void *data EINA_UNUSED, Ecore_Fd_Handler *handler EINA_UNUSED)
82{
83 const Eina_List *l;
84 Ecore_Evas *ee;
85 int c = getchar();
86
87 if (c == EOF)
88 {
89 ecore_main_loop_quit();
90 return EINA_FALSE;
91 }
92
93 switch (c) {
94 case 'h':
95 printf("hide all windows\n");
96 EINA_LIST_FOREACH(ecore_evas_ews_children_get(), l, ee)
97 ecore_evas_hide(ee);
98 break;
99
100 case 's':
101 printf("show all windows\n");
102 EINA_LIST_FOREACH(ecore_evas_ews_children_get(), l, ee)
103 ecore_evas_show(ee);
104 break;
105
106 case 'l':
107 printf("move all windows left\n");
108 EINA_LIST_FOREACH(ecore_evas_ews_children_get(), l, ee)
109 {
110 int x, y;
111 ecore_evas_geometry_get(ee, &x, &y, NULL, NULL);
112 ecore_evas_move(ee, x - 10, y);
113 }
114 break;
115
116 case 'r':
117 printf("move all windows right\n");
118 EINA_LIST_FOREACH(ecore_evas_ews_children_get(), l, ee)
119 {
120 int x, y;
121 ecore_evas_geometry_get(ee, &x, &y, NULL, NULL);
122 ecore_evas_move(ee, x + 10, y);
123 }
124 break;
125
126 case 't':
127 printf("move all windows top\n");
128 EINA_LIST_FOREACH(ecore_evas_ews_children_get(), l, ee)
129 {
130 int x, y;
131 ecore_evas_geometry_get(ee, &x, &y, NULL, NULL);
132 ecore_evas_move(ee, x, y - 10);
133 }
134 break;
135
136 case 'b':
137 printf("move all windows bottom\n");
138 EINA_LIST_FOREACH(ecore_evas_ews_children_get(), l, ee)
139 {
140 int x, y;
141 ecore_evas_geometry_get(ee, &x, &y, NULL, NULL);
142 ecore_evas_move(ee, x, y + 10);
143 }
144 break;
145
146 case 'S':
147 printf("make all windows smaller\n");
148 EINA_LIST_FOREACH(ecore_evas_ews_children_get(), l, ee)
149 {
150 int w, h;
151 ecore_evas_geometry_get(ee, NULL, NULL, &w, &h);
152 ecore_evas_resize(ee, w - 10, h - 10);
153 }
154 break;
155
156 case 'B':
157 printf("make all windows bigger\n");
158 EINA_LIST_FOREACH(ecore_evas_ews_children_get(), l, ee)
159 {
160 int w, h;
161 ecore_evas_geometry_get(ee, NULL, NULL, &w, &h);
162 ecore_evas_resize(ee, w + 10, h + 10);
163 }
164 break;
165
166 case 'm':
167 printf("make all windows unmaximized\n");
168 EINA_LIST_FOREACH(ecore_evas_ews_children_get(), l, ee)
169 ecore_evas_maximized_set(ee, EINA_FALSE);
170 break;
171
172 case 'M':
173 printf("make all windows maximized\n");
174 EINA_LIST_FOREACH(ecore_evas_ews_children_get(), l, ee)
175 ecore_evas_maximized_set(ee, EINA_TRUE);
176 break;
177
178 case 'i':
179 printf("make all windows uniconified\n");
180 EINA_LIST_FOREACH(ecore_evas_ews_children_get(), l, ee)
181 ecore_evas_iconified_set(ee, EINA_FALSE);
182 break;
183
184 case 'I':
185 printf("make all windows iconified\n");
186 EINA_LIST_FOREACH(ecore_evas_ews_children_get(), l, ee)
187 ecore_evas_iconified_set(ee, EINA_TRUE);
188 break;
189
190 case 'f':
191 printf("make all windows unfullscreen\n");
192 EINA_LIST_FOREACH(ecore_evas_ews_children_get(), l, ee)
193 ecore_evas_fullscreen_set(ee, EINA_FALSE);
194 break;
195
196 case 'F':
197 printf("make all windows fullscreen\n");
198 EINA_LIST_FOREACH(ecore_evas_ews_children_get(), l, ee)
199 ecore_evas_fullscreen_set(ee, EINA_TRUE);
200 break;
201
202 case 'q':
203 printf("quit\n");
204 ecore_main_loop_quit();
205 break;
206
207 default:
208 if (!isspace(c))
209 printf("Unknown command: %c\n", c);
210 }
211 return ECORE_CALLBACK_RENEW;
212}
213
214static void
215_on_delete(Ecore_Evas *ee)
216{
217 free(ecore_evas_data_get(ee, "key"));
218 ecore_main_loop_quit();
219}
220
221int
222main(void)
223{
224 Ecore_Evas *ee;
225 Evas *canvas;
226 Evas_Object *bg;
227
228 if (ecore_evas_init() <= 0)
229 return 1;
230
231 optional_ews_setup();
232 optional_ews_window_manager_setup();
233
234 /* everything should look similar to ecore_evas_basic_example */
235 ee = ecore_evas_ews_new(0, 0, 200, 200);
236 ecore_evas_title_set(ee, "Ecore Evas EWS Example");
237 ecore_evas_show(ee);
238
239 ecore_evas_data_set(ee, "key", strdup("hello"));
240 ecore_evas_callback_delete_request_set(ee, _on_delete);
241
242 printf("Using %s engine!\n", ecore_evas_engine_name_get(ee));
243
244 canvas = ecore_evas_get(ee);
245 if (ecore_evas_ecore_evas_get(canvas) == ee)
246 printf("Everything is sane!\n");
247
248 bg = evas_object_rectangle_add(canvas);
249 evas_object_color_set(bg, 0, 0, 255, 255);
250 evas_object_resize(bg, 200, 200);
251 evas_object_show(bg);
252 ecore_evas_object_associate(ee, bg, ECORE_EVAS_OBJECT_ASSOCIATE_BASE);
253
254 /* moving the window should move it in the screen */
255 ecore_evas_move(ee, 50, 50);
256
257 ecore_main_fd_handler_add(STDIN_FILENO,
258 ECORE_FD_READ | ECORE_FD_ERROR,
259 _stdin_cb,
260 NULL, NULL, NULL);
261
262 ecore_main_loop_begin();
263
264 ecore_evas_free(ee);
265 ecore_evas_shutdown();
266
267 return 0;
268}
269
diff --git a/src/examples/ecore/meson.build b/src/examples/ecore/meson.build
index 197d88f083..2a7af4717a 100644
--- a/src/examples/ecore/meson.build
+++ b/src/examples/ecore/meson.build
@@ -73,7 +73,6 @@ examples = [
73 'ecore_evas_buffer_example_01', 73 'ecore_evas_buffer_example_01',
74 'ecore_evas_buffer_example_02', 74 'ecore_evas_buffer_example_02',
75 'ecore_evas_callbacks', 75 'ecore_evas_callbacks',
76 'ecore_evas_ews_example',
77 'ecore_evas_object_example', 76 'ecore_evas_object_example',
78 'ecore_evas_window_sizes_example', 77 'ecore_evas_window_sizes_example',
79] 78]
diff --git a/src/lib/ecore_evas/Ecore_Evas.h b/src/lib/ecore_evas/Ecore_Evas.h
index 89a9ff843f..dfbd7a749f 100644
--- a/src/lib/ecore_evas/Ecore_Evas.h
+++ b/src/lib/ecore_evas/Ecore_Evas.h
@@ -97,7 +97,7 @@ extern "C" {
97#define HAVE_ECORE_EVAS_COCOA 1 97#define HAVE_ECORE_EVAS_COCOA 1
98#define HAVE_ECORE_EVAS_SDL 1 98#define HAVE_ECORE_EVAS_SDL 1
99//#define HAVE_ECORE_EVAS_WINCE 1 99//#define HAVE_ECORE_EVAS_WINCE 1
100#define HAVE_ECORE_EVAS_EWS 1 100//#define HAVE_ECORE_EVAS_EWS 1 /* @deprecated */
101#define HAVE_ECORE_EVAS_PSL1GHT 1 101#define HAVE_ECORE_EVAS_PSL1GHT 1
102#define HAVE_ECORE_EVAS_WAYLAND_SHM 1 102#define HAVE_ECORE_EVAS_WAYLAND_SHM 1
103#define HAVE_ECORE_EVAS_WAYLAND_EGL 1 103#define HAVE_ECORE_EVAS_WAYLAND_EGL 1
@@ -125,7 +125,7 @@ typedef enum _Ecore_Evas_Engine_Type
125 ECORE_EVAS_ENGINE_SOFTWARE_16_DDRAW, 125 ECORE_EVAS_ENGINE_SOFTWARE_16_DDRAW,
126 ECORE_EVAS_ENGINE_SOFTWARE_16_WINCE, 126 ECORE_EVAS_ENGINE_SOFTWARE_16_WINCE,
127 ECORE_EVAS_ENGINE_OPENGL_SDL, 127 ECORE_EVAS_ENGINE_OPENGL_SDL,
128 ECORE_EVAS_ENGINE_EWS, 128 ECORE_EVAS_ENGINE_EWS, /* @deprecated */
129 ECORE_EVAS_ENGINE_PSL1GHT, 129 ECORE_EVAS_ENGINE_PSL1GHT,
130 ECORE_EVAS_ENGINE_WAYLAND_SHM, 130 ECORE_EVAS_ENGINE_WAYLAND_SHM,
131 ECORE_EVAS_ENGINE_WAYLAND_EGL, 131 ECORE_EVAS_ENGINE_WAYLAND_EGL,
@@ -1788,6 +1788,7 @@ EAPI Ecore_Evas *ecore_evas_buffer_ecore_evas_parent_get(Ecore_Evas *ee);
1788 * @see ecore_evas_ews_ecore_evas_get() 1788 * @see ecore_evas_ews_ecore_evas_get()
1789 * 1789 *
1790 * @since 1.1 1790 * @since 1.1
1791 * @deprecated - @since 1.26
1791 */ 1792 */
1792EAPI Ecore_Evas *ecore_evas_ews_new(int x, int y, int w, int h); 1793EAPI Ecore_Evas *ecore_evas_ews_new(int x, int y, int w, int h);
1793 1794
@@ -1806,6 +1807,7 @@ EAPI Ecore_Evas *ecore_evas_ews_new(int x, int y, int w, int h);
1806 * @see ecore_evas_ews_manager_set() 1807 * @see ecore_evas_ews_manager_set()
1807 * @see ecore_evas_ews_evas_get() 1808 * @see ecore_evas_ews_evas_get()
1808 * @since 1.1 1809 * @since 1.1
1810 * @deprecated - @since 1.26
1809 */ 1811 */
1810EAPI Evas_Object *ecore_evas_ews_backing_store_get(const Ecore_Evas *ee); 1812EAPI Evas_Object *ecore_evas_ews_backing_store_get(const Ecore_Evas *ee);
1811 1813
@@ -1816,6 +1818,7 @@ EAPI Evas_Object *ecore_evas_ews_backing_store_get(const Ecore_Evas *ee);
1816 * @param ee The Ecore_Evas for which window will be deleted. 1818 * @param ee The Ecore_Evas for which window will be deleted.
1817 * 1819 *
1818 * @since 1.1 1820 * @since 1.1
1821 * @deprecated - @since 1.26
1819 */ 1822 */
1820EAPI void ecore_evas_ews_delete_request(Ecore_Evas *ee); 1823EAPI void ecore_evas_ews_delete_request(Ecore_Evas *ee);
1821 1824
@@ -3216,6 +3219,7 @@ EAPI void ecore_evas_callback_new_set(Evas *(*func)(int w, int h));
3216 * ecore_evas_ews_new(). 3219 * ecore_evas_ews_new().
3217 * 3220 *
3218 * @since 1.1 3221 * @since 1.1
3222 * @deprecated - @since 1.26
3219 * @{ 3223 * @{
3220 */ 3224 */
3221 3225
@@ -3227,6 +3231,7 @@ EAPI void ecore_evas_callback_new_set(Evas *(*func)(int w, int h));
3227 * @return @c EINA_TRUE on success, @c EINA_FALSE if ews is already in use. 3231 * @return @c EINA_TRUE on success, @c EINA_FALSE if ews is already in use.
3228 * 3232 *
3229 * @since 1.1 3233 * @since 1.1
3234 * @deprecated - @since 1.26
3230 */ 3235 */
3231EAPI Eina_Bool ecore_evas_ews_engine_set(const char *engine, const char *options); 3236EAPI Eina_Bool ecore_evas_ews_engine_set(const char *engine, const char *options);
3232 3237
@@ -3240,6 +3245,7 @@ EAPI Eina_Bool ecore_evas_ews_engine_set(const char *engine, const char *options
3240 * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise. 3245 * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise.
3241 * 3246 *
3242 * @since 1.1 3247 * @since 1.1
3248 * @deprecated - @since 1.26
3243 */ 3249 */
3244EAPI Eina_Bool ecore_evas_ews_setup(int x, int y, int w, int h); 3250EAPI Eina_Bool ecore_evas_ews_setup(int x, int y, int w, int h);
3245 3251
@@ -3253,6 +3259,7 @@ EAPI Eina_Bool ecore_evas_ews_setup(int x, int y, int w, int h);
3253 * 3259 *
3254 * @see ecore_evas_ews_evas_get() 3260 * @see ecore_evas_ews_evas_get()
3255 * @since 1.1 3261 * @since 1.1
3262 * @deprecated - @since 1.26
3256 */ 3263 */
3257EAPI Ecore_Evas *ecore_evas_ews_ecore_evas_get(void); 3264EAPI Ecore_Evas *ecore_evas_ews_ecore_evas_get(void);
3258 3265
@@ -3266,11 +3273,13 @@ EAPI Ecore_Evas *ecore_evas_ews_ecore_evas_get(void);
3266 * 3273 *
3267 * @see ecore_evas_ews_ecore_evas_get() 3274 * @see ecore_evas_ews_ecore_evas_get()
3268 * @since 1.1 3275 * @since 1.1
3276 * @deprecated - @since 1.26
3269 */ 3277 */
3270EAPI Evas *ecore_evas_ews_evas_get(void); 3278EAPI Evas *ecore_evas_ews_evas_get(void);
3271 3279
3272/** 3280/**
3273 * @brief Gets the current background. 3281 * @brief Gets the current background.
3282 * @deprecated - @since 1.26
3274 */ 3283 */
3275EAPI Evas_Object *ecore_evas_ews_background_get(void); 3284EAPI Evas_Object *ecore_evas_ews_background_get(void);
3276 3285
@@ -3284,6 +3293,7 @@ EAPI Evas_Object *ecore_evas_ews_background_get(void);
3284 * rectangle. 3293 * rectangle.
3285 * 3294 *
3286 * @note previous object will be deleted! 3295 * @note previous object will be deleted!
3296 * @deprecated - @since 1.26
3287 */ 3297 */
3288EAPI void ecore_evas_ews_background_set(Evas_Object *o); 3298EAPI void ecore_evas_ews_background_set(Evas_Object *o);
3289 3299
@@ -3295,6 +3305,7 @@ EAPI void ecore_evas_ews_background_set(Evas_Object *o);
3295 * @note Do not change the returned list or its contents. 3305 * @note Do not change the returned list or its contents.
3296 * 3306 *
3297 * @since 1.1 3307 * @since 1.1
3308 * @deprecated - @since 1.26
3298 */ 3309 */
3299EAPI const Eina_List *ecore_evas_ews_children_get(void); 3310EAPI const Eina_List *ecore_evas_ews_children_get(void);
3300 3311
@@ -3309,6 +3320,7 @@ EAPI const Eina_List *ecore_evas_ews_children_get(void);
3309 * 3320 *
3310 * @see ecore_evas_ews_manager_get() 3321 * @see ecore_evas_ews_manager_get()
3311 * @since 1.1 3322 * @since 1.1
3323 * @deprecated - @since 1.26
3312 */ 3324 */
3313EAPI void ecore_evas_ews_manager_set(const void *manager); 3325EAPI void ecore_evas_ews_manager_set(const void *manager);
3314 3326
@@ -3318,6 +3330,7 @@ EAPI void ecore_evas_ews_manager_set(const void *manager);
3318 * @return the value set by ecore_evas_ews_manager_set() 3330 * @return the value set by ecore_evas_ews_manager_set()
3319 * 3331 *
3320 * @since 1.1 3332 * @since 1.1
3333 * @deprecated - @since 1.26
3321 */ 3334 */
3322EAPI const void *ecore_evas_ews_manager_get(void); 3335EAPI const void *ecore_evas_ews_manager_get(void);
3323 3336
diff --git a/src/lib/ecore_evas/ecore_evas.c b/src/lib/ecore_evas/ecore_evas.c
index a579abff97..080a2f3894 100644
--- a/src/lib/ecore_evas/ecore_evas.c
+++ b/src/lib/ecore_evas/ecore_evas.c
@@ -565,11 +565,7 @@ ecore_evas_engine_type_supported_get(Ecore_Evas_Engine_Type engine)
565 return EINA_FALSE; 565 return EINA_FALSE;
566#endif 566#endif
567 case ECORE_EVAS_ENGINE_EWS: 567 case ECORE_EVAS_ENGINE_EWS:
568#ifdef BUILD_ECORE_EVAS_EWS
569 return EINA_TRUE;
570#else
571 return EINA_FALSE; 568 return EINA_FALSE;
572#endif
573 case ECORE_EVAS_ENGINE_PSL1GHT: 569 case ECORE_EVAS_ENGINE_PSL1GHT:
574 return EINA_FALSE; 570 return EINA_FALSE;
575 case ECORE_EVAS_ENGINE_WAYLAND_SHM: 571 case ECORE_EVAS_ENGINE_WAYLAND_SHM:
@@ -632,10 +628,6 @@ ecore_evas_init(void)
632 if (getenv("ECORE_EVAS_RENDER_NOSYNC")) _ecore_evas_render_sync = 0; 628 if (getenv("ECORE_EVAS_RENDER_NOSYNC")) _ecore_evas_render_sync = 0;
633 if (_ecore_evas_fps_debug) _ecore_evas_fps_debug_init(); 629 if (_ecore_evas_fps_debug) _ecore_evas_fps_debug_init();
634 630
635#ifdef BUILD_ECORE_EVAS_EWS
636 _ecore_evas_ews_events_init();
637#endif
638
639 _ecore_evas_extn_init(); 631 _ecore_evas_extn_init();
640 632
641 _ecore_evas_engine_init(); 633 _ecore_evas_engine_init();
@@ -680,10 +672,6 @@ ecore_evas_shutdown(void)
680 EINA_LOG_STATE_START, 672 EINA_LOG_STATE_START,
681 EINA_LOG_STATE_SHUTDOWN); 673 EINA_LOG_STATE_SHUTDOWN);
682 674
683#ifdef BUILD_ECORE_EVAS_EWS
684 _ecore_evas_ews_events_flush();
685#endif
686
687 while (ecore_evases) _ecore_evas_free(ecore_evases); 675 while (ecore_evases) _ecore_evas_free(ecore_evases);
688 676
689 if (_ecore_evas_fps_debug) _ecore_evas_fps_debug_shutdown(); 677 if (_ecore_evas_fps_debug) _ecore_evas_fps_debug_shutdown();
@@ -694,9 +682,6 @@ ecore_evas_shutdown(void)
694 682
695 _ecore_evas_extn_shutdown(); 683 _ecore_evas_extn_shutdown();
696 684
697#ifdef BUILD_ECORE_EVAS_EWS
698 while (_ecore_evas_ews_shutdown());
699#endif
700 _ecore_evas_engine_shutdown(); 685 _ecore_evas_engine_shutdown();
701 686
702 eina_log_domain_unregister(_ecore_evas_log_dom); 687 eina_log_domain_unregister(_ecore_evas_log_dom);
@@ -995,14 +980,6 @@ _ecore_evas_constructor_buffer(int x EINA_UNUSED, int y EINA_UNUSED, int w, int
995 return ecore_evas_buffer_new(w, h); 980 return ecore_evas_buffer_new(w, h);
996} 981}
997 982
998#ifdef BUILD_ECORE_EVAS_EWS
999static Ecore_Evas *
1000_ecore_evas_constructor_ews(int x, int y, int w, int h, const char *extra_options EINA_UNUSED)
1001{
1002 return ecore_evas_ews_new(x, y, w, h);
1003}
1004#endif
1005
1006/* note: keep sorted by priority, highest first */ 983/* note: keep sorted by priority, highest first */
1007static const struct ecore_evas_engine _engines[] = { 984static const struct ecore_evas_engine _engines[] = {
1008 /* unix */ 985 /* unix */
@@ -1022,9 +999,6 @@ static const struct ecore_evas_engine _engines[] = {
1022 {"opengl_sdl", _ecore_evas_constructor_opengl_sdl}, 999 {"opengl_sdl", _ecore_evas_constructor_opengl_sdl},
1023 {"sdl", _ecore_evas_constructor_sdl}, 1000 {"sdl", _ecore_evas_constructor_sdl},
1024 {"buffer", _ecore_evas_constructor_buffer}, 1001 {"buffer", _ecore_evas_constructor_buffer},
1025#ifdef BUILD_ECORE_EVAS_EWS
1026 {"ews", _ecore_evas_constructor_ews},
1027#endif
1028 {NULL, NULL} 1002 {NULL, NULL}
1029}; 1003};
1030 1004
diff --git a/src/lib/ecore_evas/ecore_evas_buffer.c b/src/lib/ecore_evas/ecore_evas_buffer.c
index 2f3f2ff72b..569fe0a077 100644
--- a/src/lib/ecore_evas/ecore_evas_buffer.c
+++ b/src/lib/ecore_evas/ecore_evas_buffer.c
@@ -219,7 +219,6 @@ ecore_evas_buffer_render(Ecore_Evas *ee)
219 return r; 219 return r;
220} 220}
221 221
222// NOTE: if you fix this, consider fixing ecore_evas_ews.c as it is similar!
223static void 222static void
224_ecore_evas_buffer_coord_translate(Ecore_Evas *ee, Evas_Coord *x, Evas_Coord *y) 223_ecore_evas_buffer_coord_translate(Ecore_Evas *ee, Evas_Coord *x, Evas_Coord *y)
225{ 224{
diff --git a/src/lib/ecore_evas/ecore_evas_ews.c b/src/lib/ecore_evas/ecore_evas_ews.c
index 86e939f765..a30617f571 100644
--- a/src/lib/ecore_evas/ecore_evas_ews.c
+++ b/src/lib/ecore_evas/ecore_evas_ews.c
@@ -34,1459 +34,73 @@ EAPI int ECORE_EVAS_EWS_EVENT_LAYER_CHANGE = 0;
34EAPI int ECORE_EVAS_EWS_EVENT_FULLSCREEN_CHANGE = 0; 34EAPI int ECORE_EVAS_EWS_EVENT_FULLSCREEN_CHANGE = 0;
35EAPI int ECORE_EVAS_EWS_EVENT_CONFIG_CHANGE = 0; 35EAPI int ECORE_EVAS_EWS_EVENT_CONFIG_CHANGE = 0;
36 36
37#ifdef BUILD_ECORE_EVAS_EWS
38static int _ecore_evas_init_count = 0;
39
40static Ecore_Evas *_ews_ee = NULL;
41static Evas_Object *_ews_bg = NULL;
42static Eina_List *_ews_children = NULL;
43static const void *_ews_manager = NULL;
44static char *_ews_engine = NULL;
45static char *_ews_options = NULL;
46static int _ews_x = 0;
47static int _ews_y = 0;
48static int _ews_w = 1024;
49static int _ews_h = 768;
50static Eina_Bool _ews_defaults_engine = EINA_TRUE;
51static Eina_Bool _ews_defaults_geo = EINA_TRUE;
52
53static const char EWS_ENGINE_NAME[] = "ews";
54
55static void
56_ecore_evas_ews_pre_free(Ecore_Evas *ee EINA_UNUSED)
57{
58 DBG("EWS backing store free'd");
59 _ews_children = eina_list_free(_ews_children);
60 _ews_ee = NULL;
61 _ews_bg = NULL;
62}
63
64static void
65_ecore_evas_ews_del_request(Ecore_Evas *ee EINA_UNUSED)
66{
67 INF("EWS backing store deletion is forbidden!");
68}
69
70static Ecore_Evas *
71_ecore_evas_ews_ee_new(void)
72{
73 Ecore_Evas *ee = ecore_evas_new(_ews_engine, _ews_x, _ews_y, _ews_w, _ews_h,
74 _ews_options);
75 if (!ee)
76 ERR("Failed: ecore_evas_new(%s, %d, %d, %d, %d, %s)",
77 _ews_engine, _ews_x, _ews_y, _ews_w, _ews_h, _ews_options);
78 else
79 {
80 ecore_evas_size_min_set(ee, _ews_w, _ews_h);
81 ecore_evas_size_max_set(ee, _ews_w, _ews_h);
82 ecore_evas_callback_pre_free_set(ee, _ecore_evas_ews_pre_free);
83 ecore_evas_callback_delete_request_set(ee, _ecore_evas_ews_del_request);
84 ecore_evas_name_class_set(ee, "ecore_evas_ews", "ews");
85 ecore_evas_title_set
86 (ee, "EWS: Ecore + Evas Single Process Windowing System");
87 ecore_evas_show(ee);
88 }
89
90 return ee;
91}
92
93static void
94_ecore_evas_ews_env_setup(void)
95{
96 const char *env = getenv("ECORE_EVAS_EWS");
97 char *p, *n, *tmp;
98
99 if (_ews_defaults_engine)
100 {
101 free(_ews_engine);
102 _ews_engine = NULL;
103 free(_ews_options);
104 _ews_options = NULL;
105 }
106 if (_ews_defaults_geo)
107 {
108 _ews_x = 0;
109 _ews_y = 0;
110 _ews_w = 1024;
111 _ews_h = 768;
112 }
113
114 if ((!env) || (!*env)) return;
115
116 p = tmp = strdup(env);
117 if (!tmp) return;
118
119 n = strchr(p, ':');
120 if (n) *n = '\0';
121 if (_ews_defaults_engine) _ews_engine = strdup(p);
122 if (!n) goto end;
123
124 p = n + 1;
125 n = strchr(p, ':');
126 if (!n) goto end;
127 *n = '\0';
128 if (_ews_defaults_geo) _ews_x = atoi(p);
129
130 p = n + 1;
131 n = strchr(p, ':');
132 if (!n) goto end;
133 *n = '\0';
134 if (_ews_defaults_geo) _ews_y = atoi(p);
135
136 p = n + 1;
137 n = strchr(p, ':');
138 if (!n) goto end;
139 *n = '\0';
140 if (_ews_defaults_geo) _ews_w = atoi(p);
141
142 p = n + 1;
143 n = strchr(p, ':');
144 if (n) *n = '\0';
145 if (_ews_defaults_geo) _ews_h = atoi(p);
146 if (!n) goto end;
147
148 p = n + 1;
149 if (_ews_defaults_engine) _ews_options = strdup(p);
150
151 end:
152 free(tmp);
153}
154
155static void
156_ecore_evas_ews_event_free(void *data EINA_UNUSED, void *ev)
157{
158 Ecore_Evas *ee = ev;
159 _ecore_evas_unref(ee);
160}
161
162static void
163_ecore_evas_ews_event(Ecore_Evas *ee, int event)
164{
165 _ecore_evas_ref(ee);
166 ecore_event_add(event, ee, _ecore_evas_ews_event_free, NULL);
167}
168
169static void
170_ecore_evas_ews_event_free_del(void *data EINA_UNUSED, void *ev EINA_UNUSED)
171{
172 _ecore_evas_ews_shutdown();
173}
174
175static void
176_ecore_evas_ews_free(Ecore_Evas *ee)
177{
178 evas_object_del(ee->engine.ews.image);
179 _ews_ee->sub_ecore_evas = eina_list_remove(_ews_ee->sub_ecore_evas, ee);
180
181 ecore_event_add(ECORE_EVAS_EWS_EVENT_DEL, ee, _ecore_evas_ews_event_free_del, NULL);
182}
183
184static void
185_ecore_evas_ews_move(Ecore_Evas *ee, int x, int y)
186{
187 ee->req.x = x;
188 ee->req.y = y;
189
190 if ((x == ee->x) && (y == ee->y)) return;
191 ee->x = x;
192 ee->y = y;
193 evas_object_move(ee->engine.ews.image, x, y);
194 if (ee->func.fn_move) ee->func.fn_move(ee);
195
196 _ecore_evas_ews_event(ee, ECORE_EVAS_EWS_EVENT_MOVE);
197}
198
199static void
200_ecore_evas_ews_managed_move(Ecore_Evas *ee, int x, int y)
201{
202 ee->req.x = x;
203 ee->req.y = y;
204
205 if ((x == ee->x) && (y == ee->y)) return;
206 ee->x = x;
207 ee->y = y;
208 if (ee->func.fn_move) ee->func.fn_move(ee);
209 _ecore_evas_ews_event(ee, ECORE_EVAS_EWS_EVENT_MOVE);
210}
211
212static void
213_ecore_evas_ews_resize_internal(Ecore_Evas *ee, int w, int h)
214{
215 Evas_Engine_Info_Buffer *einfo;
216 void *pixels;
217 int stride;
218
219 evas_output_size_set(ee->evas, w, h);
220 evas_output_viewport_set(ee->evas, 0, 0, w, h);
221 evas_damage_rectangle_add(ee->evas, 0, 0, w, h);
222
223 evas_object_image_size_set(ee->engine.ews.image, w, h);
224 evas_object_image_fill_set(ee->engine.ews.image, 0, 0, w, h);
225 evas_object_resize(ee->engine.ews.image, w, h);
226
227 pixels = evas_object_image_data_get(ee->engine.ews.image, 1);
228 evas_object_image_data_set(ee->engine.ews.image, pixels); // refcount
229 stride = evas_object_image_stride_get(ee->engine.ews.image);
230
231 einfo = (Evas_Engine_Info_Buffer *)evas_engine_info_get(ee->evas);
232 EINA_SAFETY_ON_NULL_RETURN(einfo);
233
234 einfo->info.depth_type = EVAS_ENGINE_BUFFER_DEPTH_ARGB32;
235 einfo->info.dest_buffer = pixels;
236 einfo->info.dest_buffer_row_bytes = stride;
237 einfo->info.use_color_key = 0;
238 einfo->info.alpha_threshold = 0;
239 einfo->info.func.new_update_region = NULL;
240 einfo->info.func.free_update_region = NULL;
241 evas_object_image_data_set(ee->engine.ews.image, pixels);
242 if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo))
243 {
244 ERR("evas_engine_info_set() for engine '%s' failed.", ee->driver);
245 }
246}
247
248static void
249_ecore_evas_ews_resize(Ecore_Evas *ee, int w, int h)
250{
251 if (w < 1) w = 1;
252 if (h < 1) h = 1;
253
254 ee->req.w = w;
255 ee->req.h = h;
256
257 if ((w == ee->w) && (h == ee->h)) return;
258 ee->w = w;
259 ee->h = h;
260 _ecore_evas_ews_resize_internal(ee, w, h);
261 if (ee->func.fn_resize) ee->func.fn_resize(ee);
262 _ecore_evas_ews_event(ee, ECORE_EVAS_EWS_EVENT_RESIZE);
263}
264
265static void
266_ecore_evas_ews_move_resize(Ecore_Evas *ee, int x, int y, int w, int h)
267{
268 _ecore_evas_ews_move(ee, x, y);
269 _ecore_evas_ews_resize(ee, w, h);
270}
271
272static void
273_ecore_evas_ews_rotation_set(Ecore_Evas *ee, int rot, int resize EINA_UNUSED)
274{
275 if (ee->rotation == rot) return;
276 ee->rotation = rot;
277
278 ERR("TODO: rot=%d, resize=%d", rot, resize);
279
280 _ecore_evas_ews_event(ee, ECORE_EVAS_EWS_EVENT_CONFIG_CHANGE);
281}
282
283static void
284_ecore_evas_ews_shaped_set(Ecore_Evas *ee, int val)
285{
286 if (ee->shaped == val) return;
287 ee->shaped = val;
288 _ecore_evas_ews_event(ee, ECORE_EVAS_EWS_EVENT_CONFIG_CHANGE);
289}
290
291static void
292_ecore_evas_ews_show(Ecore_Evas *ee)
293{
294 ee->should_be_visible = EINA_TRUE;
295 evas_object_show(ee->engine.ews.image);
296 if (ee->prop.fullscreen)
297 evas_object_focus_set(ee->engine.ews.image, EINA_TRUE);
298
299 if (ee->func.fn_show) ee->func.fn_show(ee);
300 _ecore_evas_ews_event(ee, ECORE_EVAS_EWS_EVENT_SHOW);
301}
302
303static void
304_ecore_evas_ews_hide(Ecore_Evas *ee)
305{
306 ee->should_be_visible = EINA_FALSE;
307 evas_object_hide(ee->engine.ews.image);
308
309 if (ee->func.fn_hide) ee->func.fn_hide(ee);
310 _ecore_evas_ews_event(ee, ECORE_EVAS_EWS_EVENT_HIDE);
311}
312
313static void
314_ecore_evas_ews_raise(Ecore_Evas *ee)
315{
316 evas_object_raise(ee->engine.ews.image);
317 _ecore_evas_ews_event(ee, ECORE_EVAS_EWS_EVENT_RAISE);
318}
319
320static void
321_ecore_evas_ews_lower(Ecore_Evas *ee)
322{
323 evas_object_lower(ee->engine.ews.image);
324 evas_object_lower(_ews_bg);
325 _ecore_evas_ews_event(ee, ECORE_EVAS_EWS_EVENT_LOWER);
326}
327
328static void
329_ecore_evas_ews_activate(Ecore_Evas *ee)
330{
331 _ecore_evas_ews_event(ee, ECORE_EVAS_EWS_EVENT_ACTIVATE);
332}
333
334static void
335_ecore_evas_ews_title_set(Ecore_Evas *ee, const char *t)
336{
337 if (ee->prop.title) free(ee->prop.title);
338 ee->prop.title = NULL;
339 if (t) ee->prop.title = strdup(t);
340 _ecore_evas_ews_event(ee, ECORE_EVAS_EWS_EVENT_CONFIG_CHANGE);
341}
342
343static void
344_ecore_evas_ews_name_class_set(Ecore_Evas *ee, const char *n, const char *c)
345{
346 if (ee->prop.name) free(ee->prop.name);
347 if (ee->prop.clas) free(ee->prop.clas);
348 ee->prop.name = NULL;
349 ee->prop.clas = NULL;
350 if (n) ee->prop.name = strdup(n);
351 if (c) ee->prop.clas = strdup(c);
352 _ecore_evas_ews_event(ee, ECORE_EVAS_EWS_EVENT_CONFIG_CHANGE);
353}
354
355static void
356_ecore_evas_ews_size_min_set(Ecore_Evas *ee, int w, int h)
357{
358 if (w < 0) w = 0;
359 if (h < 0) h = 0;
360 if ((ee->prop.min.w == w) && (ee->prop.min.h == h)) return;
361 ee->prop.min.w = w;
362 ee->prop.min.h = h;
363 evas_object_size_hint_min_set(ee->engine.ews.image, w, h);
364 _ecore_evas_ews_event(ee, ECORE_EVAS_EWS_EVENT_CONFIG_CHANGE);
365}
366
367static void
368_ecore_evas_ews_size_max_set(Ecore_Evas *ee, int w, int h)
369{
370 if (w < 0) w = 0;
371 if (h < 0) h = 0;
372 if ((ee->prop.max.w == w) && (ee->prop.max.h == h)) return;
373 ee->prop.max.w = w;
374 ee->prop.max.h = h;
375 evas_object_size_hint_max_set(ee->engine.ews.image, w, h);
376 _ecore_evas_ews_event(ee, ECORE_EVAS_EWS_EVENT_CONFIG_CHANGE);
377}
378
379static void
380_ecore_evas_ews_size_base_set(Ecore_Evas *ee, int w, int h)
381{
382 if (w < 0) w = 0;
383 if (h < 0) h = 0;
384 if ((ee->prop.base.w == w) && (ee->prop.base.h == h)) return;
385 ee->prop.base.w = w;
386 ee->prop.base.h = h;
387 evas_object_size_hint_request_set(ee->engine.ews.image, w, h);
388 _ecore_evas_ews_event(ee, ECORE_EVAS_EWS_EVENT_CONFIG_CHANGE);
389}
390
391static void
392_ecore_evas_ews_size_step_set(Ecore_Evas *ee, int w, int h)
393{
394 if (w < 1) w = 1;
395 if (h < 1) h = 1;
396 if ((ee->prop.step.w == w) && (ee->prop.step.h == h)) return;
397 ee->prop.step.w = w;
398 ee->prop.step.h = h;
399 _ecore_evas_ews_event(ee, ECORE_EVAS_EWS_EVENT_CONFIG_CHANGE);
400}
401
402static void
403_ecore_evas_ews_object_cursor_set(Ecore_Evas *ee, Evas_Object *obj EINA_UNUSED,
404 int layer EINA_UNUSED, int hot_x EINA_UNUSED,
405 int hot_y EINA_UNUSED)
406{
407 _ecore_evas_ews_event(ee, ECORE_EVAS_EWS_EVENT_CONFIG_CHANGE);
408}
409
410static void
411_ecore_evas_ews_layer_set(Ecore_Evas *ee, int layer)
412{
413 if (layer < EVAS_LAYER_MIN + 2)
414 layer = EVAS_LAYER_MIN + 2;
415 else if (layer > EVAS_LAYER_MAX)
416 layer = EVAS_LAYER_MAX;
417
418 if (ee->prop.layer == layer) return;
419 ee->prop.layer = layer;
420 evas_object_layer_set(ee->engine.ews.image, layer);
421 _ecore_evas_ews_event(ee, ECORE_EVAS_EWS_EVENT_LAYER_CHANGE);
422}
423
424static void
425_ecore_evas_ews_focus_set(Ecore_Evas *ee, Eina_Bool on)
426{
427 evas_object_focus_set(ee->engine.ews.image, on);
428 _ecore_evas_focus_device_set(ee, NULL, on);
429 if (on)
430 _ecore_evas_ews_event(ee, ECORE_EVAS_EWS_EVENT_FOCUS);
431 else
432 _ecore_evas_ews_event(ee, ECORE_EVAS_EWS_EVENT_UNFOCUS);
433}
434
435static void
436_ecore_evas_ews_iconified_set(Ecore_Evas *ee, Eina_Bool on)
437{
438 if (ee->prop.iconified == on) return;
439 ee->prop.iconified = on;
440 _ecore_evas_ews_event(ee, ECORE_EVAS_EWS_EVENT_ICONIFIED_CHANGE);
441}
442
443static void
444_ecore_evas_ews_borderless_set(Ecore_Evas *ee, Eina_Bool on)
445{
446 if (ee->prop.borderless == on) return;
447 ee->prop.borderless = on;
448 _ecore_evas_ews_event(ee, ECORE_EVAS_EWS_EVENT_CONFIG_CHANGE);
449}
450
451static void
452_ecore_evas_ews_override_set(Ecore_Evas *ee, Eina_Bool on)
453{
454 if (ee->prop.override == on) return;
455 if (ee->visible) evas_object_show(ee->engine.ews.image);
456 if (ecore_evas_focus_device_get(ee, NULL))
457 evas_object_focus_set(ee->engine.ews.image, EINA_TRUE);
458 ee->prop.override = on;
459 _ecore_evas_ews_event(ee, ECORE_EVAS_EWS_EVENT_CONFIG_CHANGE);
460}
461
462static void
463_ecore_evas_ews_maximized_set(Ecore_Evas *ee, Eina_Bool on)
464{
465 if (ee->prop.maximized == on) return;
466 ee->prop.maximized = on;
467 if (on) evas_object_show(ee->engine.ews.image);
468 _ecore_evas_ews_event(ee, ECORE_EVAS_EWS_EVENT_MAXIMIZED_CHANGE);
469}
470
471static void
472_ecore_evas_ews_fullscreen_set(Ecore_Evas *ee, Eina_Bool on)
473{
474 if (ee->prop.fullscreen == on) return;
475 ee->prop.fullscreen = on;
476
477 if (!on)
478 {
479 evas_object_move(ee->engine.ews.image, ee->x, ee->y);
480 evas_object_resize(ee->engine.ews.image, ee->w, ee->h);
481 }
482 else
483 {
484 Evas_Coord w, h;
485 ecore_evas_geometry_get(_ews_ee, NULL, NULL, &w, &h);
486 evas_object_move(ee->engine.ews.image, 0, 0);
487 evas_object_resize(ee->engine.ews.image, w, h);
488 evas_object_focus_set(ee->engine.ews.image, EINA_TRUE);
489 }
490
491 if (ee->should_be_visible)
492 evas_object_show(ee->engine.ews.image);
493 else
494 evas_object_hide(ee->engine.ews.image);
495
496 _ecore_evas_ews_event(ee, ECORE_EVAS_EWS_EVENT_FULLSCREEN_CHANGE);
497}
498
499static void
500_ecore_evas_ews_avoid_damage_set(Ecore_Evas *ee, int val)
501{
502 if (ee->prop.avoid_damage == val) return;
503 ee->prop.avoid_damage = val;
504 _ecore_evas_ews_event(ee, ECORE_EVAS_EWS_EVENT_CONFIG_CHANGE);
505}
506
507static void
508_ecore_evas_ews_withdrawn_set(Ecore_Evas *ee, Eina_Bool on)
509{
510 if (ee->prop.withdrawn == on) return;
511 ee->prop.withdrawn = on;
512 _ecore_evas_ews_event(ee, ECORE_EVAS_EWS_EVENT_CONFIG_CHANGE);
513}
514
515static void
516_ecore_evas_ews_sticky_set(Ecore_Evas *ee, Eina_Bool on)
517{
518 if (ee->prop.sticky == on) return;
519 ee->prop.sticky = on;
520 if ((on) && (ee->func.fn_sticky)) ee->func.fn_sticky(ee);
521 else if ((!on) && (ee->func.fn_unsticky)) ee->func.fn_unsticky(ee);
522 _ecore_evas_ews_event(ee, ECORE_EVAS_EWS_EVENT_CONFIG_CHANGE);
523}
524
525static void
526_ecore_evas_ews_ignore_events_set(Ecore_Evas *ee, int val)
527{
528 if (ee->ignore_events == val) return;
529 ee->ignore_events = val;
530 evas_object_pass_events_set(ee->engine.ews.image, val);
531 _ecore_evas_ews_event(ee, ECORE_EVAS_EWS_EVENT_CONFIG_CHANGE);
532}
533
534static void
535_ecore_evas_ews_alpha_set(Ecore_Evas *ee, int val)
536{
537 if (ee->alpha == val) return;
538 ee->alpha = val;
539 evas_object_image_alpha_set(ee->engine.ews.image, val);
540 _ecore_evas_ews_event(ee, ECORE_EVAS_EWS_EVENT_CONFIG_CHANGE);
541}
542
543static void
544_ecore_evas_ews_transparent_set(Ecore_Evas *ee, int val)
545{
546 if (ee->transparent == val) return;
547 ee->transparent = val;
548 evas_object_image_alpha_set(ee->engine.ews.image, val);
549 _ecore_evas_ews_event(ee, ECORE_EVAS_EWS_EVENT_CONFIG_CHANGE);
550}
551
552static Eina_Bool
553_ecore_evas_ews_prepare(Ecore_Evas *ee)
554{
555 Evas_Coord w, h;
556 void *pixels;
557
558 evas_object_image_size_get(ee->engine.ews.image, &w, &h);
559 if ((w != ee->w) || (h != ee->h))
560 ecore_evas_resize(ee, w, h);
561
562 pixels = evas_object_image_data_get(ee->engine.ews.image, 1);
563 if (!pixels) return EINA_FALSE;
564
565 evas_object_data_set(ee->engine.ews.image, "_ews.pixels", pixels);
566
567 return EINA_TRUE;
568}
569
570static void
571_ecore_evas_ews_update_image(void *data, Evas *e EINA_UNUSED, void *event_info)
572{
573 Evas_Event_Render_Post *post = event_info;
574 Ecore_Evas *ee = data;
575 Eina_Rectangle *r;
576 Eina_List *l;
577 void *pixels;
578
579 pixels = evas_object_data_get(ee->engine.ews.image, "_ews.pixels");
580 if (!pixels) return ;
581
582 evas_object_image_data_set(ee->engine.ews.image, pixels);
583 EINA_LIST_FOREACH(post->updated_area, l, r)
584 evas_object_image_data_update_add(ee->engine.ews.image,
585 r->x, r->y, r->w, r->h);
586
587 evas_object_data_set(ee->engine.ews.image, "_ews.pixels", NULL);
588}
589
590static void
591_ecore_evas_ews_screen_geometry_get(const Ecore_Evas *ee EINA_UNUSED, int *x, int *y, int *w, int *h)
592{
593 ecore_evas_geometry_get(_ews_ee, x, y, w, h);
594}
595
596static const Ecore_Evas_Engine_Func _ecore_ews_engine_func =
597{
598 _ecore_evas_ews_free,
599 NULL,
600 NULL,
601 NULL,
602 NULL,
603 NULL,
604 NULL,
605 NULL,
606 NULL,
607 NULL,
608 NULL,
609 NULL,
610 NULL,
611 NULL,
612 NULL,
613 _ecore_evas_ews_move,
614 _ecore_evas_ews_managed_move,
615 _ecore_evas_ews_resize,
616 _ecore_evas_ews_move_resize,
617 _ecore_evas_ews_rotation_set,
618 _ecore_evas_ews_shaped_set,
619 _ecore_evas_ews_show,
620 _ecore_evas_ews_hide,
621 _ecore_evas_ews_raise,
622 _ecore_evas_ews_lower,
623 _ecore_evas_ews_activate,
624 _ecore_evas_ews_title_set,
625 _ecore_evas_ews_name_class_set,
626 _ecore_evas_ews_size_min_set,
627 _ecore_evas_ews_size_max_set,
628 _ecore_evas_ews_size_base_set,
629 _ecore_evas_ews_size_step_set,
630 _ecore_evas_ews_object_cursor_set,
631 NULL,
632 _ecore_evas_ews_layer_set,
633 _ecore_evas_ews_focus_set,
634 _ecore_evas_ews_iconified_set,
635 _ecore_evas_ews_borderless_set,
636 _ecore_evas_ews_override_set,
637 _ecore_evas_ews_maximized_set,
638 _ecore_evas_ews_fullscreen_set,
639 _ecore_evas_ews_avoid_damage_set,
640 _ecore_evas_ews_withdrawn_set,
641 _ecore_evas_ews_sticky_set,
642 _ecore_evas_ews_ignore_events_set,
643 _ecore_evas_ews_alpha_set,
644 _ecore_evas_ews_transparent_set,
645 NULL, // profiles_set
646 NULL, // profile_set
647
648 NULL,
649 NULL,
650 NULL,
651 NULL,
652 NULL,
653 NULL,
654
655 NULL,
656 _ecore_evas_ews_screen_geometry_get,
657 NULL, // screen_dpi_get
658 NULL,
659 NULL, // msg_send
660
661 NULL, // pointer_xy_get
662 NULL, // pointer_warp
663
664 NULL, // wm_rot_preferred_rotation_set
665 NULL, // wm_rot_available_rotations_set
666 NULL, // wm_rot_manual_rotation_done_set
667 NULL, // wm_rot_manual_rotation_done
668
669 NULL, // aux_hints_set
670
671 NULL, // fn_animator_register
672 NULL, // fn_animator_unregister
673
674 NULL, // fn_evas_changed
675 NULL, //fn_focus_device_set
676 NULL, //fn_callback_focus_device_in_set
677 NULL, //fn_callback_focus_device_out_set
678 NULL, //fn_callback_device_mouse_in_set
679 NULL, //fn_callback_device_mouse_out_set
680 NULL, //fn_pointer_device_xy_get
681 _ecore_evas_ews_prepare,
682};
683
684void
685_ecore_evas_ews_events_init(void)
686{
687 ECORE_EVAS_EWS_EVENT_MANAGER_CHANGE = ecore_event_type_new();
688 ECORE_EVAS_EWS_EVENT_ADD = ecore_event_type_new();
689 ECORE_EVAS_EWS_EVENT_DEL = ecore_event_type_new();
690 ECORE_EVAS_EWS_EVENT_RESIZE = ecore_event_type_new();
691 ECORE_EVAS_EWS_EVENT_MOVE = ecore_event_type_new();
692 ECORE_EVAS_EWS_EVENT_SHOW = ecore_event_type_new();
693 ECORE_EVAS_EWS_EVENT_HIDE = ecore_event_type_new();
694 ECORE_EVAS_EWS_EVENT_FOCUS = ecore_event_type_new();
695 ECORE_EVAS_EWS_EVENT_UNFOCUS = ecore_event_type_new();
696 ECORE_EVAS_EWS_EVENT_RAISE = ecore_event_type_new();
697 ECORE_EVAS_EWS_EVENT_LOWER = ecore_event_type_new();
698 ECORE_EVAS_EWS_EVENT_ACTIVATE = ecore_event_type_new();
699 ECORE_EVAS_EWS_EVENT_ICONIFIED_CHANGE = ecore_event_type_new();
700 ECORE_EVAS_EWS_EVENT_MAXIMIZED_CHANGE = ecore_event_type_new();
701 ECORE_EVAS_EWS_EVENT_LAYER_CHANGE = ecore_event_type_new();
702 ECORE_EVAS_EWS_EVENT_FULLSCREEN_CHANGE = ecore_event_type_new();
703 ECORE_EVAS_EWS_EVENT_CONFIG_CHANGE = ecore_event_type_new();
704}
705
706void
707_ecore_evas_ews_events_flush(void)
708{
709 ecore_event_type_flush(ECORE_EVAS_EWS_EVENT_MANAGER_CHANGE,
710 ECORE_EVAS_EWS_EVENT_ADD,
711 ECORE_EVAS_EWS_EVENT_DEL,
712 ECORE_EVAS_EWS_EVENT_RESIZE,
713 ECORE_EVAS_EWS_EVENT_MOVE,
714 ECORE_EVAS_EWS_EVENT_SHOW,
715 ECORE_EVAS_EWS_EVENT_HIDE,
716 ECORE_EVAS_EWS_EVENT_FOCUS,
717 ECORE_EVAS_EWS_EVENT_UNFOCUS,
718 ECORE_EVAS_EWS_EVENT_RAISE,
719 ECORE_EVAS_EWS_EVENT_LOWER,
720 ECORE_EVAS_EWS_EVENT_ACTIVATE,
721 ECORE_EVAS_EWS_EVENT_ICONIFIED_CHANGE,
722 ECORE_EVAS_EWS_EVENT_MAXIMIZED_CHANGE,
723 ECORE_EVAS_EWS_EVENT_LAYER_CHANGE,
724 ECORE_EVAS_EWS_EVENT_FULLSCREEN_CHANGE,
725 ECORE_EVAS_EWS_EVENT_CONFIG_CHANGE);
726}
727
728static int
729_ecore_evas_ews_init(void)
730{
731 _ecore_evas_init_count++;
732 if (_ecore_evas_init_count > 1) return _ecore_evas_init_count;
733
734 _ecore_evas_ews_env_setup();
735
736 return _ecore_evas_init_count;
737}
738
739int
740_ecore_evas_ews_shutdown(void)
741{
742 _ecore_evas_init_count--;
743 if (_ecore_evas_init_count == 0)
744 {
745 if (_ews_ee)
746 {
747 ecore_evas_free(_ews_ee);
748 _ews_ee = NULL;
749 }
750 if (_ews_children)
751 {
752 eina_list_free(_ews_children);
753 _ews_children = NULL;
754 }
755
756 free(_ews_engine);
757 _ews_engine = NULL;
758 free(_ews_options);
759 _ews_options = NULL;
760 _ews_defaults_engine = EINA_TRUE;
761 _ews_defaults_geo = EINA_TRUE;
762
763 }
764 if (_ecore_evas_init_count < 0) _ecore_evas_init_count = 0;
765 return _ecore_evas_init_count;
766}
767
768static void
769_ecore_evas_ews_coord_translate(Ecore_Evas *ee, Evas_Coord *x, Evas_Coord *y)
770{
771 Evas_Coord xx, yy, ww, hh, fx, fy, fw, fh;
772
773 evas_object_geometry_get(ee->engine.ews.image, &xx, &yy, &ww, &hh);
774 evas_object_image_fill_get(ee->engine.ews.image, &fx, &fy, &fw, &fh);
775
776 if (fw < 1) fw = 1;
777 if (fh < 1) fh = 1;
778
779 if ((fx == 0) && (fy == 0) && (fw == ww) && (fh == hh))
780 {
781 *x = (ee->w * (*x - xx)) / fw;
782 *y = (ee->h * (*y - yy)) / fh;
783 }
784 else
785 {
786 xx = (*x - xx) - fx;
787 while (xx < 0) xx += fw;
788 while (xx > fw) xx -= fw;
789 *x = (ee->w * xx) / fw;
790
791 yy = (*y - yy) - fy;
792 while (yy < 0) yy += fh;
793 while (yy > fh) yy -= fh;
794 *y = (ee->h * yy) / fh;
795 }
796}
797
798static void
799_ecore_evas_ews_modifiers_apply(Ecore_Evas *ee, const Evas_Modifier *modifier)
800{
801 Evas *e = ee->evas;
802
803 if (evas_key_modifier_is_set(modifier, "Shift"))
804 evas_key_modifier_on(e, "Shift");
805 else evas_key_modifier_off(e, "Shift");
806
807 if (evas_key_modifier_is_set(modifier, "Control"))
808 evas_key_modifier_on(e, "Control");
809 else evas_key_modifier_off(e, "Control");
810
811 if (evas_key_modifier_is_set(modifier, "Alt"))
812 evas_key_modifier_on(e, "Alt");
813 else evas_key_modifier_off(e, "Alt");
814
815 if (evas_key_modifier_is_set(modifier, "Super"))
816 evas_key_modifier_on(e, "Super");
817 else evas_key_modifier_off(e, "Super");
818
819 if (evas_key_modifier_is_set(modifier, "Hyper"))
820 evas_key_modifier_on(e, "Hyper");
821 else evas_key_modifier_off(e, "Hyper");
822
823 if (evas_key_modifier_is_set(modifier, "Scroll_Lock"))
824 evas_key_lock_on(e, "Scroll_Lock");
825 else evas_key_lock_off(e, "Scroll_Lock");
826
827 if (evas_key_modifier_is_set(modifier, "Num_Lock"))
828 evas_key_lock_on(e, "Num_Lock");
829 else evas_key_lock_off(e, "Num_Lock");
830
831 if (evas_key_modifier_is_set(modifier, "Caps_Lock"))
832 evas_key_lock_on(e, "Caps_Lock");
833 else evas_key_lock_off(e, "Caps_Lock");
834
835 if (evas_key_modifier_is_set(modifier, "Shift_Lock"))
836 evas_key_lock_on(e, "Shift_Lock");
837 else evas_key_lock_off(e, "Shift_Lock");
838}
839
840static void
841_ecore_evas_ews_cb_mouse_in(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
842{
843 Ecore_Evas *ee = data;
844 Evas_Event_Mouse_In *ev = event_info;
845 Evas_Coord x = ev->canvas.x;
846 Evas_Coord y = ev->canvas.y;
847 _ecore_evas_ews_coord_translate(ee, &x, &y);
848 if (ee->func.fn_mouse_in) ee->func.fn_mouse_in(ee);
849 _ecore_evas_ews_modifiers_apply(ee, ev->modifiers);
850 evas_event_feed_mouse_in(ee->evas, ev->timestamp, NULL);
851 _ecore_evas_mouse_move_process(ee, x, y, ev->timestamp);
852}
853
854static void
855_ecore_evas_ews_cb_mouse_out(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
856{
857 Ecore_Evas *ee = data;
858 Evas_Event_Mouse_Out *ev = event_info;
859 Evas_Coord x = ev->canvas.x;
860 Evas_Coord y = ev->canvas.y;
861 // TODO: consider grab mode in EWS
862 _ecore_evas_ews_coord_translate(ee, &x, &y);
863 if (ee->func.fn_mouse_out) ee->func.fn_mouse_out(ee);
864 _ecore_evas_ews_modifiers_apply(ee, ev->modifiers);
865 evas_event_feed_mouse_out(ee->evas, ev->timestamp, NULL);
866 _ecore_evas_default_cursor_hide(ee);
867 _ecore_evas_mouse_move_process(ee, x, y, ev->timestamp);
868}
869
870static void
871_ecore_evas_ews_cb_mouse_down(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info)
872{
873 Ecore_Evas *ee = data;
874 Evas_Event_Mouse_Down *ev = event_info;
875 _ecore_evas_ews_modifiers_apply(ee, ev->modifiers);
876 evas_event_feed_mouse_down(ee->evas, ev->button, ev->flags, ev->timestamp, NULL);
877}
878
879static void
880_ecore_evas_ews_cb_mouse_up(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info)
881{
882 Ecore_Evas *ee = data;
883 Evas_Event_Mouse_Up *ev = event_info;
884 _ecore_evas_ews_modifiers_apply(ee, ev->modifiers);
885 evas_event_feed_mouse_up(ee->evas, ev->button, ev->flags, ev->timestamp, NULL);
886}
887
888static void
889_ecore_evas_ews_cb_mouse_move(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info)
890{
891 Ecore_Evas *ee = data;
892 Evas_Event_Mouse_Move *ev = event_info;
893 Evas_Coord x = ev->cur.canvas.x;
894 Evas_Coord y = ev->cur.canvas.y;
895 _ecore_evas_ews_coord_translate(ee, &x, &y);
896 _ecore_evas_ews_modifiers_apply(ee, ev->modifiers);
897 _ecore_evas_mouse_move_process(ee, x, y, ev->timestamp);
898}
899
900static void
901_ecore_evas_ews_cb_mouse_wheel(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info)
902{
903 Ecore_Evas *ee = data;
904 Evas_Event_Mouse_Wheel *ev = event_info;
905 _ecore_evas_ews_modifiers_apply(ee, ev->modifiers);
906 evas_event_feed_mouse_wheel(ee->evas, ev->direction, ev->z, ev->timestamp, NULL);
907}
908
909static void
910_ecore_evas_ews_cb_multi_down(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info)
911{
912 Ecore_Evas *ee = data;
913 Evas_Event_Multi_Down *ev = event_info;
914 Evas_Coord x, y, xx, yy;
915 double xf, yf;
916
917 x = ev->canvas.x;
918 y = ev->canvas.y;
919 xx = x;
920 yy = y;
921 _ecore_evas_ews_coord_translate(ee, &x, &y);
922 xf = (ev->canvas.xsub - (double)xx) + (double)x;
923 yf = (ev->canvas.ysub - (double)yy) + (double)y;
924 _ecore_evas_ews_modifiers_apply(ee, ev->modifiers);
925 evas_event_feed_multi_down(ee->evas, ev->device, x, y, ev->radius, ev->radius_x, ev->radius_y, ev->pressure, ev->angle, xf, yf, ev->flags, ev->timestamp, NULL);
926}
927
928static void
929_ecore_evas_ews_cb_multi_up(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info)
930{
931 Ecore_Evas *ee = data;
932 Evas_Event_Multi_Up *ev = event_info;
933 Evas_Coord x, y, xx, yy;
934 double xf, yf;
935
936 x = ev->canvas.x;
937 y = ev->canvas.y;
938 xx = x;
939 yy = y;
940 _ecore_evas_ews_coord_translate(ee, &x, &y);
941 xf = (ev->canvas.xsub - (double)xx) + (double)x;
942 yf = (ev->canvas.ysub - (double)yy) + (double)y;
943 _ecore_evas_ews_modifiers_apply(ee, ev->modifiers);
944 evas_event_feed_multi_up(ee->evas, ev->device, x, y, ev->radius, ev->radius_x, ev->radius_y, ev->pressure, ev->angle, xf, yf, ev->flags, ev->timestamp, NULL);
945}
946
947static void
948_ecore_evas_ews_cb_multi_move(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info)
949{
950 Ecore_Evas *ee = data;
951 Evas_Event_Multi_Move *ev = event_info;
952 Evas_Coord x, y, xx, yy;
953 double xf, yf;
954
955 x = ev->cur.canvas.x;
956 y = ev->cur.canvas.y;
957 xx = x;
958 yy = y;
959 _ecore_evas_ews_coord_translate(ee, &x, &y);
960 xf = (ev->cur.canvas.xsub - (double)xx) + (double)x;
961 yf = (ev->cur.canvas.ysub - (double)yy) + (double)y;
962 _ecore_evas_ews_modifiers_apply(ee, ev->modifiers);
963 evas_event_feed_multi_move(ee->evas, ev->device, x, y, ev->radius, ev->radius_x, ev->radius_y, ev->pressure, ev->angle, xf, yf, ev->timestamp, NULL);
964}
965
966static void
967_ecore_evas_ews_cb_free(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
968{
969 Ecore_Evas *ee = data;
970 if (ee->driver) _ecore_evas_free(ee);
971}
972
973static void
974_ecore_evas_ews_cb_key_down(void *data, Evas *e, Evas_Object *obj EINA_UNUSED, void *event_info)
975{
976 Ecore_Evas *ee = data;
977 Evas_Event_Key_Down *ev = event_info;
978
979 if (evas_key_modifier_is_set(evas_key_modifier_get(e), "Shift"))
980 evas_key_modifier_on(ee->evas, "Shift");
981 else
982 evas_key_modifier_off(ee->evas, "Shift");
983 if (evas_key_modifier_is_set(evas_key_modifier_get(e), "Control"))
984 evas_key_modifier_on(ee->evas, "Control");
985 else
986 evas_key_modifier_off(ee->evas, "Control");
987 if (evas_key_modifier_is_set(evas_key_modifier_get(e), "Alt"))
988 evas_key_modifier_on(ee->evas, "Alt");
989 else
990 evas_key_modifier_off(ee->evas, "Alt");
991 if (evas_key_modifier_is_set(evas_key_modifier_get(e), "Meta"))
992 evas_key_modifier_on(ee->evas, "Meta");
993 else
994 evas_key_modifier_off(ee->evas, "Meta");
995 if (evas_key_modifier_is_set(evas_key_modifier_get(e), "Hyper"))
996 evas_key_modifier_on(ee->evas, "Hyper");
997 else
998 evas_key_modifier_off(ee->evas, "Hyper");
999 if (evas_key_modifier_is_set(evas_key_modifier_get(e), "Super"))
1000 evas_key_modifier_on(ee->evas, "Super");
1001 else
1002 evas_key_modifier_off(ee->evas, "Super");
1003 if (evas_key_lock_is_set(evas_key_lock_get(e), "Scroll_Lock"))
1004 evas_key_lock_on(ee->evas, "Scroll_Lock");
1005 else
1006 evas_key_lock_off(ee->evas, "Scroll_Lock");
1007 if (evas_key_lock_is_set(evas_key_lock_get(e), "Num_Lock"))
1008 evas_key_lock_on(ee->evas, "Num_Lock");
1009 else
1010 evas_key_lock_off(ee->evas, "Num_Lock");
1011 if (evas_key_lock_is_set(evas_key_lock_get(e), "Caps_Lock"))
1012 evas_key_lock_on(ee->evas, "Caps_Lock");
1013 else
1014 evas_key_lock_off(ee->evas, "Caps_Lock");
1015 evas_event_feed_key_down(ee->evas, ev->keyname, ev->key, ev->string, ev->compose, ev->timestamp, NULL);
1016}
1017
1018static void
1019_ecore_evas_ews_cb_key_up(void *data, Evas *e, Evas_Object *obj EINA_UNUSED, void *event_info)
1020{
1021 Ecore_Evas *ee = data;
1022 Evas_Event_Key_Up *ev = event_info;
1023
1024 if (evas_key_modifier_is_set(evas_key_modifier_get(e), "Shift"))
1025 evas_key_modifier_on(ee->evas, "Shift");
1026 else
1027 evas_key_modifier_off(ee->evas, "Shift");
1028 if (evas_key_modifier_is_set(evas_key_modifier_get(e), "Control"))
1029 evas_key_modifier_on(ee->evas, "Control");
1030 else
1031 evas_key_modifier_off(ee->evas, "Control");
1032 if (evas_key_modifier_is_set(evas_key_modifier_get(e), "Alt"))
1033 evas_key_modifier_on(ee->evas, "Alt");
1034 else
1035 evas_key_modifier_off(ee->evas, "Alt");
1036 if (evas_key_modifier_is_set(evas_key_modifier_get(e), "Meta"))
1037 evas_key_modifier_on(ee->evas, "Meta");
1038 else
1039 evas_key_modifier_off(ee->evas, "Meta");
1040 if (evas_key_modifier_is_set(evas_key_modifier_get(e), "Hyper"))
1041 evas_key_modifier_on(ee->evas, "Hyper");
1042 else
1043 evas_key_modifier_off(ee->evas, "Hyper");
1044 if (evas_key_modifier_is_set(evas_key_modifier_get(e), "Super"))
1045 evas_key_modifier_on(ee->evas, "Super");
1046 else
1047 evas_key_modifier_off(ee->evas, "Super");
1048 if (evas_key_lock_is_set(evas_key_lock_get(e), "Scroll_Lock"))
1049 evas_key_lock_on(ee->evas, "Scroll_Lock");
1050 else
1051 evas_key_lock_off(ee->evas, "Scroll_Lock");
1052 if (evas_key_lock_is_set(evas_key_lock_get(e), "Num_Lock"))
1053 evas_key_lock_on(ee->evas, "Num_Lock");
1054 else
1055 evas_key_lock_off(ee->evas, "Num_Lock");
1056 if (evas_key_lock_is_set(evas_key_lock_get(e), "Caps_Lock"))
1057 evas_key_lock_on(ee->evas, "Caps_Lock");
1058 else
1059 evas_key_lock_off(ee->evas, "Caps_Lock");
1060 evas_event_feed_key_up(ee->evas, ev->keyname, ev->key, ev->string, ev->compose, ev->timestamp, NULL);
1061}
1062
1063static void
1064_ecore_evas_ews_cb_focus_in(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
1065{
1066 Ecore_Evas *ee = data;
1067 ecore_evas_focus_set(ee, EINA_TRUE);
1068}
1069
1070static void
1071_ecore_evas_ews_cb_focus_out(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
1072{
1073 Ecore_Evas *ee = data;
1074 if (ee->deleted) return;
1075 ecore_evas_focus_set(ee, EINA_FALSE);
1076}
1077
1078static void
1079_ecore_evas_ews_cb_show(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
1080{
1081 Ecore_Evas *ee = data;
1082 ecore_evas_show(ee);
1083}
1084
1085static void
1086_ecore_evas_ews_cb_hide(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
1087{
1088 Ecore_Evas *ee = data;
1089 if (ee->deleted) return;
1090 ecore_evas_hide(ee);
1091}
1092#endif
1093
1094EAPI Ecore_Evas * 37EAPI Ecore_Evas *
1095ecore_evas_ews_new(int x, int y, int w, int h) 38ecore_evas_ews_new(int x EINA_UNUSED, int y EINA_UNUSED, int w EINA_UNUSED, int h EINA_UNUSED)
1096{ 39{
1097// basically a copy of ecore_evas_buffer_new() keep in sync...
1098#ifdef BUILD_ECORE_EVAS_EWS
1099 Evas_Object *o;
1100 Evas_Engine_Info_Buffer *einfo;
1101 Ecore_Evas *ee;
1102 int rmethod;
1103 static Eina_Bool creating = EINA_FALSE;
1104
1105 if (_ecore_evas_ews_init() < 1) return NULL;
1106
1107 if (creating) return NULL; /* avoid recursive ecore_evas_new() with ews */
1108 creating = EINA_TRUE;
1109 if (!_ews_ee) _ews_ee = _ecore_evas_ews_ee_new();
1110 creating = EINA_FALSE;
1111 if (!_ews_ee)
1112 {
1113 ERR("Could not create EWS backing store");
1114 _ecore_evas_ews_shutdown();
1115 return NULL;
1116 }
1117
1118 rmethod = evas_render_method_lookup("buffer");
1119 if (!rmethod) return NULL;
1120 ee = calloc(1, sizeof(Ecore_Evas));
1121 if (!ee) return NULL;
1122
1123 if (w < 1) w = 1;
1124 if (h < 1) h = 1;
1125
1126 o = evas_object_image_add(_ews_ee->evas);
1127 evas_object_image_content_hint_set(o, EVAS_IMAGE_CONTENT_HINT_DYNAMIC);
1128 evas_object_image_colorspace_set(o, EVAS_COLORSPACE_ARGB8888);
1129 evas_object_image_size_set(o, w, h);
1130 evas_object_image_alpha_set(o, 1);
1131
1132 ECORE_MAGIC_SET(ee, ECORE_MAGIC_EVAS);
1133
1134 ee->engine.func = (Ecore_Evas_Engine_Func *)&_ecore_ews_engine_func;
1135
1136 ee->driver = EWS_ENGINE_NAME;
1137
1138 ee->x = 0;
1139 ee->y = 0;
1140 ee->w = w;
1141 ee->h = h;
1142 ee->req.x = ee->x;
1143 ee->req.y = ee->y;
1144 ee->req.w = ee->w;
1145 ee->req.h = ee->h;
1146
1147 /* init evas here */
1148 ee->evas = evas_new();
1149 evas_data_attach_set(ee->evas, ee);
1150 evas_output_method_set(ee->evas, rmethod);
1151 evas_output_size_set(ee->evas, w, h);
1152 evas_output_viewport_set(ee->evas, 0, 0, w, h);
1153
1154 evas_object_move(o, x, y);
1155 evas_object_resize(o, w, h);
1156 evas_object_image_fill_set(o, 0, 0, w, h);
1157
1158 ee->engine.ews.image = o;
1159 evas_object_data_set(ee->engine.ews.image, "Ecore_Evas", ee);
1160 evas_event_callback_add(ee->evas, EVAS_CALLBACK_RENDER_POST, _ecore_evas_ews_update_image, ee);
1161 evas_object_event_callback_add(ee->engine.ews.image,
1162 EVAS_CALLBACK_MOUSE_IN,
1163 _ecore_evas_ews_cb_mouse_in, ee);
1164 evas_object_event_callback_add(ee->engine.ews.image,
1165 EVAS_CALLBACK_MOUSE_OUT,
1166 _ecore_evas_ews_cb_mouse_out, ee);
1167 evas_object_event_callback_add(ee->engine.ews.image,
1168 EVAS_CALLBACK_MOUSE_DOWN,
1169 _ecore_evas_ews_cb_mouse_down, ee);
1170 evas_object_event_callback_add(ee->engine.ews.image,
1171 EVAS_CALLBACK_MOUSE_UP,
1172 _ecore_evas_ews_cb_mouse_up, ee);
1173 evas_object_event_callback_add(ee->engine.ews.image,
1174 EVAS_CALLBACK_MOUSE_MOVE,
1175 _ecore_evas_ews_cb_mouse_move, ee);
1176 evas_object_event_callback_add(ee->engine.ews.image,
1177 EVAS_CALLBACK_MOUSE_WHEEL,
1178 _ecore_evas_ews_cb_mouse_wheel, ee);
1179 evas_object_event_callback_add(ee->engine.ews.image,
1180 EVAS_CALLBACK_MULTI_DOWN,
1181 _ecore_evas_ews_cb_multi_down, ee);
1182 evas_object_event_callback_add(ee->engine.ews.image,
1183 EVAS_CALLBACK_MULTI_UP,
1184 _ecore_evas_ews_cb_multi_up, ee);
1185 evas_object_event_callback_add(ee->engine.ews.image,
1186 EVAS_CALLBACK_MULTI_MOVE,
1187 _ecore_evas_ews_cb_multi_move, ee);
1188 evas_object_event_callback_add(ee->engine.ews.image,
1189 EVAS_CALLBACK_FREE,
1190 _ecore_evas_ews_cb_free, ee);
1191 evas_object_event_callback_add(ee->engine.ews.image,
1192 EVAS_CALLBACK_KEY_DOWN,
1193 _ecore_evas_ews_cb_key_down, ee);
1194 evas_object_event_callback_add(ee->engine.ews.image,
1195 EVAS_CALLBACK_KEY_UP,
1196 _ecore_evas_ews_cb_key_up, ee);
1197 evas_object_event_callback_add(ee->engine.ews.image,
1198 EVAS_CALLBACK_FOCUS_IN,
1199 _ecore_evas_ews_cb_focus_in, ee);
1200 evas_object_event_callback_add(ee->engine.ews.image,
1201 EVAS_CALLBACK_FOCUS_OUT,
1202 _ecore_evas_ews_cb_focus_out, ee);
1203 evas_object_event_callback_add(ee->engine.ews.image,
1204 EVAS_CALLBACK_SHOW,
1205 _ecore_evas_ews_cb_show, ee);
1206 evas_object_event_callback_add(ee->engine.ews.image,
1207 EVAS_CALLBACK_HIDE,
1208 _ecore_evas_ews_cb_hide, ee);
1209 einfo = (Evas_Engine_Info_Buffer *)evas_engine_info_get(ee->evas);
1210 if (einfo)
1211 {
1212 void *pixels = evas_object_image_data_get(o, 1);
1213 evas_object_image_data_set(o, pixels); // refcount
1214 einfo->info.depth_type = EVAS_ENGINE_BUFFER_DEPTH_ARGB32;
1215 einfo->info.dest_buffer = pixels;
1216 einfo->info.dest_buffer_row_bytes = evas_object_image_stride_get(o);
1217 einfo->info.use_color_key = 0;
1218 einfo->info.alpha_threshold = 0;
1219 einfo->info.func.new_update_region = NULL;
1220 einfo->info.func.free_update_region = NULL;
1221 evas_object_image_data_set(o, pixels);
1222 if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo))
1223 {
1224 ERR("evas_engine_info_set() for engine '%s' failed.", ee->driver);
1225 ecore_evas_free(ee);
1226 return NULL;
1227 }
1228 }
1229 else
1230 {
1231 ERR("evas_engine_info_set() for engine '%s' failed.", ee->driver);
1232 ecore_evas_free(ee);
1233 return NULL;
1234 }
1235 evas_key_modifier_add(ee->evas, "Shift");
1236 evas_key_modifier_add(ee->evas, "Control");
1237 evas_key_modifier_add(ee->evas, "Alt");
1238 evas_key_modifier_add(ee->evas, "Meta");
1239 evas_key_modifier_add(ee->evas, "Hyper");
1240 evas_key_modifier_add(ee->evas, "Super");
1241 evas_key_lock_add(ee->evas, "Caps_Lock");
1242 evas_key_lock_add(ee->evas, "Num_Lock");
1243 evas_key_lock_add(ee->evas, "Scroll_Lock");
1244
1245 if (!_ecore_evas_cursors_init(ee))
1246 {
1247 ERR("Could not init the Ecore Evas cursors");
1248 ecore_evas_free(ee);
1249 }
1250
1251 _ecore_evas_subregister(_ews_ee, ee);
1252 _ews_children = eina_list_append(_ews_children, ee);
1253
1254 _ecore_evas_ews_event(ee, ECORE_EVAS_EWS_EVENT_ADD);
1255
1256 return ee;
1257#else
1258 return NULL; 40 return NULL;
1259 (void)x;
1260 (void)y;
1261 (void)w;
1262 (void)h;
1263#endif
1264} 41}
1265 42
1266EAPI Evas_Object * 43EAPI Evas_Object *
1267ecore_evas_ews_backing_store_get(const Ecore_Evas *ee) 44ecore_evas_ews_backing_store_get(const Ecore_Evas *ee EINA_UNUSED)
1268{ 45{
1269#ifdef BUILD_ECORE_EVAS_EWS
1270 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1271 {
1272 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1273 "ecore_evas_ews_backing_store_get");
1274 return NULL;
1275 }
1276 return ee->engine.ews.image;
1277#else
1278 return NULL; 46 return NULL;
1279 (void)ee;
1280#endif
1281} 47}
1282 48
1283EAPI void 49EAPI void
1284ecore_evas_ews_delete_request(Ecore_Evas *ee) 50ecore_evas_ews_delete_request(Ecore_Evas *ee EINA_UNUSED)
1285{ 51{
1286#ifdef BUILD_ECORE_EVAS_EWS
1287 if (!ECORE_MAGIC_CHECK(ee, ECORE_MAGIC_EVAS))
1288 {
1289 ECORE_MAGIC_FAIL(ee, ECORE_MAGIC_EVAS,
1290 "ecore_evas_ews_delete_request");
1291 return;
1292 }
1293 if (ee->func.fn_delete_request) ee->func.fn_delete_request(ee);
1294 else ecore_evas_free(ee);
1295#else
1296 (void)ee;
1297#endif
1298} 52}
1299 53
1300 54
1301EAPI Eina_Bool 55EAPI Eina_Bool
1302ecore_evas_ews_engine_set(const char *engine, const char *options) 56ecore_evas_ews_engine_set(const char *engine EINA_UNUSED, const char *options EINA_UNUSED)
1303{ 57{
1304#ifdef BUILD_ECORE_EVAS_EWS
1305 if (_ews_ee) return EINA_FALSE;
1306
1307 free(_ews_engine);
1308 free(_ews_options);
1309
1310 _ews_engine = engine ? strdup(engine) : NULL;
1311 _ews_options = options ? strdup(options) : NULL;
1312
1313 if ((engine) && (!_ews_engine)) return EINA_FALSE;
1314 if ((options) && (!_ews_options))
1315 {
1316 free(_ews_engine);
1317 _ews_engine = NULL;
1318 _ews_defaults_engine = EINA_TRUE;
1319 return EINA_FALSE;
1320 }
1321
1322 _ews_defaults_engine = EINA_FALSE;
1323 return EINA_TRUE;
1324#else
1325 return EINA_FALSE; 58 return EINA_FALSE;
1326 (void)engine;
1327 (void)options;
1328#endif
1329} 59}
1330 60
1331EAPI Eina_Bool 61EAPI Eina_Bool
1332ecore_evas_ews_setup(int x, int y, int w, int h) 62ecore_evas_ews_setup(int x EINA_UNUSED, int y EINA_UNUSED, int w EINA_UNUSED, int h EINA_UNUSED)
1333{ 63{
1334#ifdef BUILD_ECORE_EVAS_EWS
1335 Eina_Bool ret = EINA_TRUE;
1336
1337 _ews_defaults_geo = EINA_FALSE;
1338 _ews_x = x;
1339 _ews_y = y;
1340 _ews_w = w;
1341 _ews_h = h;
1342
1343 if (!_ews_ee) return EINA_TRUE;
1344
1345 /* move-resize is not as implemented as move + resize */
1346 ecore_evas_move(_ews_ee, x, y);
1347 ecore_evas_size_min_set(_ews_ee, w, h);
1348 ecore_evas_size_max_set(_ews_ee, w, h);
1349 ecore_evas_resize(_ews_ee, w, h);
1350
1351 ecore_evas_geometry_get(_ews_ee, &x, &y, &w, &h);
1352
1353#define TST(n) if ((n != _ews_##n)) \
1354 { \
1355 WRN("Asked %d, got %d for "#n, _ews_##n, n); \
1356 ret = EINA_FALSE; \
1357 }
1358 TST(x);
1359 TST(y);
1360 TST(w);
1361 TST(h);
1362#undef TST
1363 return ret;
1364#else
1365 return EINA_FALSE; 64 return EINA_FALSE;
1366 (void)x;
1367 (void)y;
1368 (void)w;
1369 (void)h;
1370#endif
1371} 65}
1372 66
1373EAPI Ecore_Evas * 67EAPI Ecore_Evas *
1374ecore_evas_ews_ecore_evas_get(void) 68ecore_evas_ews_ecore_evas_get(void)
1375{ 69{
1376#ifdef BUILD_ECORE_EVAS_EWS
1377 if (!_ews_ee) _ews_ee = _ecore_evas_ews_ee_new();
1378 return _ews_ee;
1379#else
1380 return NULL; 70 return NULL;
1381#endif
1382} 71}
1383 72
1384EAPI Evas * 73EAPI Evas *
1385ecore_evas_ews_evas_get(void) 74ecore_evas_ews_evas_get(void)
1386{ 75{
1387#ifdef BUILD_ECORE_EVAS_EWS
1388 return ecore_evas_get(ecore_evas_ews_ecore_evas_get());
1389#else
1390 return NULL; 76 return NULL;
1391#endif
1392} 77}
1393 78
1394EAPI Evas_Object * 79EAPI Evas_Object *
1395ecore_evas_ews_background_get(void) 80ecore_evas_ews_background_get(void)
1396{ 81{
1397#ifdef BUILD_ECORE_EVAS_EWS
1398 return _ews_bg;
1399#else
1400 return NULL; 82 return NULL;
1401#endif
1402}
1403
1404#ifdef BUILD_ECORE_EVAS_EWS
1405static void
1406_ecore_evas_ews_background_free(void *data EINA_UNUSED, Evas *e EINA_UNUSED, Evas_Object *o EINA_UNUSED, void *event_info EINA_UNUSED)
1407{
1408 _ews_bg = NULL;
1409 ecore_evas_ews_background_set(NULL);
1410} 83}
1411#endif
1412 84
1413EAPI void 85EAPI void
1414ecore_evas_ews_background_set(Evas_Object *o) 86ecore_evas_ews_background_set(Evas_Object *o EINA_UNUSED)
1415{ 87{
1416#ifdef BUILD_ECORE_EVAS_EWS
1417 if ((o) && (o == _ews_bg)) return;
1418
1419 if (_ews_bg)
1420 {
1421 evas_object_del(_ews_bg);
1422 _ews_bg = NULL;
1423 }
1424
1425 if ((!o) && (_ews_ee))
1426 {
1427 o = evas_object_rectangle_add(ecore_evas_get(_ews_ee));
1428 evas_object_color_set(o, 0, 0, 0, 255);
1429 }
1430
1431 if (_ews_ee)
1432 {
1433 Evas_Coord w, h, fw, fh;
1434 Evas *e = ecore_evas_get(_ews_ee);
1435
1436 if (e != evas_object_evas_get(o))
1437 {
1438 ERR("background not in ecore_evas_ews_evas_get() canvas!");
1439 return;
1440 }
1441
1442 evas_output_viewport_get(e, NULL, NULL, &w, &h);
1443 evas_output_framespace_get(e, NULL, NULL, &fw, &fh);
1444 evas_object_move(o, 0, 0);
1445 evas_object_resize(o, w - fw, h - fh);
1446 evas_object_layer_set(o, EVAS_LAYER_MIN + 1);
1447 evas_object_lower(o);
1448 evas_object_show(o);
1449
1450 evas_object_event_callback_add
1451 (o, EVAS_CALLBACK_FREE, _ecore_evas_ews_background_free, NULL);
1452 }
1453
1454 _ews_bg = o;
1455#else
1456 return;
1457 (void)o;
1458#endif
1459} 88}
1460 89
1461 90
1462EAPI const Eina_List * 91EAPI const Eina_List *
1463ecore_evas_ews_children_get(void) 92ecore_evas_ews_children_get(void)
1464{ 93{
1465#ifdef BUILD_ECORE_EVAS_EWS
1466 return _ews_children;
1467#else
1468 return NULL; 94 return NULL;
1469#endif
1470} 95}
1471 96
1472EAPI void 97EAPI void
1473ecore_evas_ews_manager_set(const void *manager) 98ecore_evas_ews_manager_set(const void *manager EINA_UNUSED)
1474{ 99{
1475#ifdef BUILD_ECORE_EVAS_EWS
1476 if (_ews_manager == manager) return;
1477 _ews_manager = manager;
1478 ecore_event_add(ECORE_EVAS_EWS_EVENT_MANAGER_CHANGE, NULL, NULL, NULL);
1479#else
1480 (void)manager;
1481#endif
1482} 100}
1483 101
1484EAPI const void * 102EAPI const void *
1485ecore_evas_ews_manager_get(void) 103ecore_evas_ews_manager_get(void)
1486{ 104{
1487#ifdef BUILD_ECORE_EVAS_EWS
1488 return _ews_manager;
1489#else
1490 return NULL; 105 return NULL;
1491#endif
1492} 106}
diff --git a/src/lib/ecore_evas/ecore_evas_module.c b/src/lib/ecore_evas/ecore_evas_module.c
index 2b5394b06f..4fdd8f70b0 100644
--- a/src/lib/ecore_evas/ecore_evas_module.c
+++ b/src/lib/ecore_evas/ecore_evas_module.c
@@ -251,9 +251,6 @@ _ecore_evas_available_engines_get(void)
251#ifdef BUILD_ECORE_EVAS_BUFFER 251#ifdef BUILD_ECORE_EVAS_BUFFER
252 ADDENG("buffer"); 252 ADDENG("buffer");
253#endif 253#endif
254#ifdef BUILD_ECORE_EVAS_EWS
255 ADDENG("ews");
256#endif
257 } 254 }
258 else if (!strcmp(name, "cocoa")) 255 else if (!strcmp(name, "cocoa"))
259 { 256 {
diff --git a/src/lib/elementary/efl_ui_win.c b/src/lib/elementary/efl_ui_win.c
index 4ce4c0e809..4dfbbe2d1c 100644
--- a/src/lib/elementary/efl_ui_win.c
+++ b/src/lib/elementary/efl_ui_win.c
@@ -5268,11 +5268,7 @@ _elm_win_finalize_internal(Eo *obj, Efl_Ui_Win_Data *sd, const char *name, Efl_U
5268 5268
5269 default: 5269 default:
5270 disp = getenv("ELM_DISPLAY"); 5270 disp = getenv("ELM_DISPLAY");
5271 if ((disp) && (!strcmp(disp, "ews"))) 5271 if ((disp) && (!strcmp(disp, "buffer")))
5272 {
5273 enginelist[p++] = ELM_EWS;
5274 }
5275 else if ((disp) && (!strcmp(disp, "buffer")))
5276 { 5272 {
5277 enginelist[p++] = ELM_BUFFER; 5273 enginelist[p++] = ELM_BUFFER;
5278 } 5274 }
@@ -5534,8 +5530,6 @@ _elm_win_finalize_internal(Eo *obj, Efl_Ui_Win_Data *sd, const char *name, Efl_U
5534 tmp_sd.ee = ecore_evas_gl_sdl_new(NULL, 1, 1, 0, 0); 5530 tmp_sd.ee = ecore_evas_gl_sdl_new(NULL, 1, 1, 0, 0);
5535 else if (!strcmp(enginelist[i], ELM_OPENGL_COCOA)) 5531 else if (!strcmp(enginelist[i], ELM_OPENGL_COCOA))
5536 tmp_sd.ee = ecore_evas_cocoa_new(NULL, 1, 1, 0, 0); 5532 tmp_sd.ee = ecore_evas_cocoa_new(NULL, 1, 1, 0, 0);
5537 else if (!strcmp(enginelist[i], ELM_EWS))
5538 tmp_sd.ee = ecore_evas_ews_new(0, 0, 1, 1);
5539 else if (!strcmp(enginelist[i], ELM_SOFTWARE_FB)) 5533 else if (!strcmp(enginelist[i], ELM_SOFTWARE_FB))
5540 tmp_sd.ee = ecore_evas_fb_new(NULL, 0, 1, 1); 5534 tmp_sd.ee = ecore_evas_fb_new(NULL, 0, 1, 1);
5541 else if (!strcmp(enginelist[i], ELM_BUFFER)) 5535 else if (!strcmp(enginelist[i], ELM_BUFFER))
diff --git a/src/lib/elementary/elm_config.c b/src/lib/elementary/elm_config.c
index 79e0f9a998..3c8537d8b0 100644
--- a/src/lib/elementary/elm_config.c
+++ b/src/lib/elementary/elm_config.c
@@ -50,7 +50,6 @@ const char *_elm_engines[] = {
50 "sdl", 50 "sdl",
51 "opengl_sdl", 51 "opengl_sdl",
52 "buffer", 52 "buffer",
53 "ews",
54 "opengl_cocoa", 53 "opengl_cocoa",
55 "wayland_shm", 54 "wayland_shm",
56 "wayland_egl", 55 "wayland_egl",
@@ -2546,8 +2545,6 @@ _env_get(void)
2546 eina_stringshare_replace(&_elm_config->engine, ELM_BUFFER); 2545 eina_stringshare_replace(&_elm_config->engine, ELM_BUFFER);
2547 else if ((!strncmp(s, "shot:", 5))) 2546 else if ((!strncmp(s, "shot:", 5)))
2548 eina_stringshare_replace(&_elm_config->engine, s); 2547 eina_stringshare_replace(&_elm_config->engine, s);
2549 else if ((!strcasecmp(s, "ews")))
2550 eina_stringshare_replace(&_elm_config->engine, ELM_EWS);
2551 else if ((!strcasecmp(s, "wayland_shm")) || 2548 else if ((!strcasecmp(s, "wayland_shm")) ||
2552 (!strcasecmp(s, "wayland-shm"))) 2549 (!strcasecmp(s, "wayland-shm")))
2553 eina_stringshare_replace(&_elm_config->engine, ELM_WAYLAND_SHM); 2550 eina_stringshare_replace(&_elm_config->engine, ELM_WAYLAND_SHM);
diff --git a/src/lib/elementary/elm_config.h b/src/lib/elementary/elm_config.h
index 429e6aa01f..f3c6c6b5df 100644
--- a/src/lib/elementary/elm_config.h
+++ b/src/lib/elementary/elm_config.h
@@ -1190,7 +1190,6 @@ EAPI void elm_config_password_show_last_timeout_set(double password_show_la
1190 * The following are the available engines: 1190 * The following are the available engines:
1191 * @li "fb" (Framebuffer) 1191 * @li "fb" (Framebuffer)
1192 * @li "buffer" (Pixel Memory Buffer) 1192 * @li "buffer" (Pixel Memory Buffer)
1193 * @li "ews" (Ecore + Evas Single Process Windowing System)
1194 * @li NULL - no engine config 1193 * @li NULL - no engine config
1195 * 1194 *
1196 * @deprecated Please use elm_config_accel_preference_override_set() instead 1195 * @deprecated Please use elm_config_accel_preference_override_set() instead
diff --git a/src/lib/elementary/elm_main.c b/src/lib/elementary/elm_main.c
index d6a4b5dac4..bb2ec1d084 100644
--- a/src/lib/elementary/elm_main.c
+++ b/src/lib/elementary/elm_main.c
@@ -144,7 +144,6 @@ _elm_rescale(void)
144{ 144{
145 edje_scale_set(_elm_config->scale); 145 edje_scale_set(_elm_config->scale);
146 _elm_win_rescale(NULL, EINA_FALSE); 146 _elm_win_rescale(NULL, EINA_FALSE);
147 _elm_ews_wm_rescale(NULL, EINA_FALSE);
148} 147}
149 148
150static void *app_mainfunc = NULL; 149static void *app_mainfunc = NULL;
@@ -869,12 +868,8 @@ elm_quicklaunch_sub_init(int argc,
869 EINA_SAFETY_ON_FALSE_GOTO(ecore_con_init(), ql_sub_ecore_con); 868 EINA_SAFETY_ON_FALSE_GOTO(ecore_con_init(), ql_sub_ecore_con);
870 EINA_SAFETY_ON_FALSE_GOTO(ecore_con_url_init(), ql_sub_ecore_con_url); 869 EINA_SAFETY_ON_FALSE_GOTO(ecore_con_url_init(), ql_sub_ecore_con_url);
871 _elm_prefs_initted = _elm_prefs_init(); 870 _elm_prefs_initted = _elm_prefs_init();
872 EINA_SAFETY_ON_FALSE_GOTO(_elm_ews_wm_init(), ql_sub_ews);;
873 } 871 }
874 return _elm_sub_init_count; 872 return _elm_sub_init_count;
875ql_sub_ews:
876 if (_elm_prefs_initted) _elm_prefs_shutdown();
877 ecore_con_url_shutdown();
878ql_sub_ecore_con_url: 873ql_sub_ecore_con_url:
879 ecore_con_shutdown(); 874 ecore_con_shutdown();
880ql_sub_ecore_con: 875ql_sub_ecore_con:
@@ -900,7 +895,6 @@ elm_quicklaunch_sub_shutdown(void)
900 ecore_shutdown_ex(); 895 ecore_shutdown_ex();
901 896
902 _elm_win_shutdown(); 897 _elm_win_shutdown();
903 _elm_ews_wm_shutdown();
904 ecore_con_url_shutdown(); 898 ecore_con_url_shutdown();
905 ecore_con_shutdown(); 899 ecore_con_shutdown();
906 ecore_imf_shutdown(); 900 ecore_imf_shutdown();
diff --git a/src/lib/elementary/elm_priv.h b/src/lib/elementary/elm_priv.h
index aee4b4d8d6..52aee0fd26 100644
--- a/src/lib/elementary/elm_priv.h
+++ b/src/lib/elementary/elm_priv.h
@@ -288,13 +288,12 @@ extern const char *_elm_engines[];
288# define ELM_SOFTWARE_SDL (_elm_engines[4]) 288# define ELM_SOFTWARE_SDL (_elm_engines[4])
289# define ELM_OPENGL_SDL (_elm_engines[5]) 289# define ELM_OPENGL_SDL (_elm_engines[5])
290# define ELM_BUFFER (_elm_engines[6]) 290# define ELM_BUFFER (_elm_engines[6])
291# define ELM_EWS (_elm_engines[7]) 291# define ELM_OPENGL_COCOA (_elm_engines[7])
292# define ELM_OPENGL_COCOA (_elm_engines[8]) 292# define ELM_WAYLAND_SHM (_elm_engines[8])
293# define ELM_WAYLAND_SHM (_elm_engines[9]) 293# define ELM_WAYLAND_EGL (_elm_engines[9])
294# define ELM_WAYLAND_EGL (_elm_engines[10]) 294# define ELM_DRM (_elm_engines[10])
295# define ELM_DRM (_elm_engines[11]) 295# define ELM_SOFTWARE_DDRAW (_elm_engines[11])
296# define ELM_SOFTWARE_DDRAW (_elm_engines[12]) 296# define ELM_GL_DRM (_elm_engines[12])
297# define ELM_GL_DRM (_elm_engines[13])
298 297
299# define ELM_FONT_TOKEN_STYLE ":style=" 298# define ELM_FONT_TOKEN_STYLE ":style="
300 299
@@ -667,11 +666,6 @@ void _elm_prefs_data_init(void);
667void _elm_prefs_data_shutdown(void); 666void _elm_prefs_data_shutdown(void);
668 667
669/* init functions for dnd and cnp */ 668/* init functions for dnd and cnp */
670int _elm_ews_wm_init(void);
671void _elm_ews_wm_shutdown(void);
672void _elm_ews_wm_rescale(Elm_Theme *th,
673 Eina_Bool use_theme);
674
675void _elm_win_shutdown(void); 669void _elm_win_shutdown(void);
676void _elm_win_rescale(Elm_Theme *th, 670void _elm_win_rescale(Elm_Theme *th,
677 Eina_Bool use_theme); 671 Eina_Bool use_theme);
diff --git a/src/lib/elementary/elm_theme.c b/src/lib/elementary/elm_theme.c
index 8625cb6147..7a40a4d7e9 100644
--- a/src/lib/elementary/elm_theme.c
+++ b/src/lib/elementary/elm_theme.c
@@ -867,7 +867,6 @@ elm_theme_flush(Elm_Theme *th)
867 if (th->cache_style_load_failed) eina_hash_free(th->cache_style_load_failed); 867 if (th->cache_style_load_failed) eina_hash_free(th->cache_style_load_failed);
868 th->cache_style_load_failed = eina_hash_string_superfast_new(NULL); 868 th->cache_style_load_failed = eina_hash_string_superfast_new(NULL);
869 _elm_win_rescale(th, EINA_TRUE); 869 _elm_win_rescale(th, EINA_TRUE);
870 _elm_ews_wm_rescale(th, EINA_TRUE);
871 if (th->referrers) 870 if (th->referrers)
872 { 871 {
873 Eina_List *l; 872 Eina_List *l;
diff --git a/src/lib/elementary/elm_win.h b/src/lib/elementary/elm_win.h
index 5e272edebc..16d6403b0c 100644
--- a/src/lib/elementary/elm_win.h
+++ b/src/lib/elementary/elm_win.h
@@ -39,7 +39,6 @@
39 * GDI with software) 39 * GDI with software)
40 * @li "ddraw", "software-ddraw", "software_ddraw" (Windows WIN32 rendering via 40 * @li "ddraw", "software-ddraw", "software_ddraw" (Windows WIN32 rendering via
41 * DirectDraw with software) 41 * DirectDraw with software)
42 * @li "ews" (rendering to EWS - Ecore + Evas Single Process Windowing System)
43 * @li "gl-cocoa", "gl_cocoa", "opengl-cocoa", "opengl_cocoa" (OpenGL rendering in Cocoa) 42 * @li "gl-cocoa", "gl_cocoa", "opengl-cocoa", "opengl_cocoa" (OpenGL rendering in Cocoa)
44 * @li "wayland_shm" (Wayland client SHM rendering) 43 * @li "wayland_shm" (Wayland client SHM rendering)
45 * @li "wayland_egl" (Wayland client OpenGL/EGL rendering) 44 * @li "wayland_egl" (Wayland client OpenGL/EGL rendering)
diff --git a/src/lib/elementary/elu_ews_wm.c b/src/lib/elementary/elu_ews_wm.c
deleted file mode 100644
index 0120aea6ea..0000000000
--- a/src/lib/elementary/elu_ews_wm.c
+++ /dev/null
@@ -1,531 +0,0 @@
1#ifdef HAVE_CONFIG_H
2# include "elementary_config.h"
3#endif
4
5#include <Elementary.h>
6
7#include "elm_priv.h"
8
9static Eina_Bool _ews_used = EINA_FALSE;
10static Eina_List *_ews_ev_handlers = NULL;
11static Eina_Hash *_ews_borders = NULL;
12static Eina_Hash *_ews_borders_geo = NULL;
13static Evas_Object *_ews_bg = NULL;
14static Ecore_Animator *_ews_border_mover = NULL;
15static Evas_Object *_ews_border_mover_obj = NULL;
16static Evas_Point _ews_border_mover_off = {0, 0};
17
18static void
19_elm_ews_border_usable_screen_geometry_get(int *x, int *y, int *w, int *h)
20{
21 Ecore_Evas *ee = ecore_evas_ews_ecore_evas_get();
22 ecore_evas_geometry_get(ee, NULL, NULL, w, h);
23 if (x) *x = 0;
24 if (y) *y = 0;
25 // TODO: when add a shelf for iconified, subtract its area here.
26}
27
28static void
29_elm_ews_wm_border_del(void *data)
30{
31 Evas_Object *deco = data;
32 evas_object_del(deco);
33
34 if (_ews_border_mover_obj == deco)
35 {
36 ELM_SAFE_FREE(_ews_border_mover, ecore_animator_del);
37 _ews_border_mover_obj = NULL;
38 }
39}
40
41static Evas_Object *
42_elm_ews_wm_border_find(const Ecore_Evas *ee)
43{
44 return eina_hash_find(_ews_borders, &ee);
45}
46
47static Eina_Rectangle *
48_elm_ews_wm_border_geo_find(const Ecore_Evas *ee)
49{
50 return eina_hash_find(_ews_borders_geo, &ee);
51}
52
53static void
54_elm_ews_border_geo_apply(Ecore_Evas *ee, Evas_Object *o)
55{
56 int x, y, w, h;
57 ecore_evas_geometry_get(ee, &x, &y, &w, &h);
58 evas_object_geometry_set(o, x, y, w, h);
59}
60
61static void
62_elm_ews_border_focus_apply(Ecore_Evas *ee, Evas_Object *o)
63{
64 const char *sig;
65 if (ecore_evas_focus_get(ee))
66 sig = "elm,state,focus,on";
67 else
68 sig = "elm,state,focus,off";
69 edje_object_signal_emit(o, sig, "elm");
70}
71
72static void
73_elm_ews_border_stack_apply(Ecore_Evas *ee, Evas_Object *o)
74{
75 Evas_Object *bs_o = ecore_evas_ews_backing_store_get(ee);
76 evas_object_stack_below(o, bs_o);
77}
78
79static void
80_elm_ews_border_iconified_apply(Ecore_Evas *ee, Evas_Object *o)
81{
82 const char *sig;
83 if (ecore_evas_iconified_get(ee))
84 sig = "elm,state,iconified,on";
85 else
86 sig = "elm,state,iconified,off";
87 edje_object_signal_emit(o, sig, "elm");
88
89 // TODO: add to some taskbar? and actually hide it?
90 DBG("EWS does not implement iconified yet");
91}
92
93static void
94_elm_ews_border_maximized_apply(Ecore_Evas *ee, Evas_Object *o)
95{
96 int x, y, w, h;
97 if (ecore_evas_maximized_get(ee))
98 {
99 Eina_Rectangle *r;
100 int ex, ey, ew, eh;
101
102 edje_object_signal_emit(o, "elm,state,maximized,on", "elm");
103 edje_object_message_signal_process(o);
104 ecore_evas_geometry_get(ee, &x, &y, &w, &h);
105
106 r = _elm_ews_wm_border_geo_find(ee);
107 if (!r)
108 {
109 r = malloc(sizeof(Eina_Rectangle));
110 eina_hash_add(_ews_borders_geo, &ee, r);
111 }
112
113 r->x = x;
114 r->y = y;
115 r->w = w;
116 r->h = h;
117 _elm_ews_border_usable_screen_geometry_get(&x, &y, &w, &h);
118 edje_object_parts_extends_calc(o, &ex, &ey, &ew, &eh);
119 x -= ex;
120 y -= ey;
121 w -= ew - r->w;
122 h -= eh - r->h;
123 }
124 else
125 {
126 Eina_Rectangle *r = _elm_ews_wm_border_geo_find(ee);
127 edje_object_signal_emit(o, "elm,state,maximized,off", "elm");
128
129 if (!r) ecore_evas_geometry_get(ee, &x, &y, &w, &h);
130 else
131 {
132 x = r->x;
133 y = r->y;
134 w = r->w;
135 h = r->h;
136 }
137 }
138
139 ecore_evas_move_resize(ee, x, y, w, h);
140 _elm_ews_border_geo_apply(ee, o);
141}
142
143static void
144_elm_ews_border_layer_apply(Ecore_Evas *ee, Evas_Object *o)
145{
146 Evas_Object *bs_o = ecore_evas_ews_backing_store_get(ee);
147 evas_object_layer_set(o, evas_object_layer_get(bs_o));
148 _elm_ews_border_stack_apply(ee, o);
149}
150
151static void
152_elm_ews_border_fullscreen_apply(Ecore_Evas *ee, Evas_Object *o)
153{
154 const char *sig;
155 if (ecore_evas_fullscreen_get(ee))
156 sig = "elm,state,fullscreen,on";
157 else
158 sig = "elm,state,fullscreen,off";
159 edje_object_signal_emit(o, sig, "elm");
160 _elm_ews_border_geo_apply(ee, o);
161}
162
163static void
164_elm_ews_border_config_apply(Ecore_Evas *ee, Evas_Object *o, Elm_Theme *th)
165{
166 const char *title, *name = NULL, *class = NULL, *style = NULL;
167 const char *sig;
168
169 if (ecore_evas_borderless_get(ee))
170 style = "borderless";
171
172 _elm_theme_set(th, o, "ews", "decoration", style ? style : "default", EINA_TRUE);
173
174 if (ecore_evas_shaped_get(ee) || ecore_evas_alpha_get(ee) ||
175 ecore_evas_transparent_get(ee))
176 sig = "elm,state,alpha,on";
177 else
178 sig = "elm,state,alpha,off";
179 edje_object_signal_emit(o, sig, "elm");
180
181 title = ecore_evas_title_get(ee);
182 ecore_evas_name_class_get(ee, &name, &class);
183 edje_object_part_text_escaped_set(o, "elm.text.title", title);
184 edje_object_part_text_escaped_set(o, "elm.text.name", name);
185 edje_object_part_text_escaped_set(o, "elm.text.class", class);
186
187 _elm_ews_border_geo_apply(ee, o);
188 _elm_ews_border_focus_apply(ee, o);
189 _elm_ews_border_stack_apply(ee, o);
190 _elm_ews_border_iconified_apply(ee, o);
191 _elm_ews_border_maximized_apply(ee, o);
192 _elm_ews_border_layer_apply(ee, o);
193 _elm_ews_border_fullscreen_apply(ee, o);
194}
195
196static Eina_Bool
197_elm_ews_wm_border_theme_set(Ecore_Evas *ee, Evas_Object *o, Elm_Theme *th)
198{
199 _elm_ews_border_config_apply(ee, o, th);
200 return EINA_TRUE;
201}
202
203static void
204_elm_ews_border_sig_focus(void *data, Evas_Object *o EINA_UNUSED, const char *sig EINA_UNUSED, const char *source EINA_UNUSED)
205{
206 Ecore_Evas *ee = data;
207 ecore_evas_focus_set(ee, EINA_TRUE);
208}
209
210static void
211_elm_ews_border_sig_iconify(void *data, Evas_Object *o EINA_UNUSED, const char *sig EINA_UNUSED, const char *source EINA_UNUSED)
212{
213 Ecore_Evas *ee = data;
214 ecore_evas_iconified_set(ee, EINA_TRUE);
215}
216
217static void
218_elm_ews_border_sig_maximize(void *data, Evas_Object *o EINA_UNUSED, const char *sig EINA_UNUSED, const char *source EINA_UNUSED)
219{
220 Ecore_Evas *ee = data;
221 ecore_evas_maximized_set(ee, EINA_TRUE);
222}
223
224static void
225_elm_ews_border_sig_fullscreen(void *data, Evas_Object *o EINA_UNUSED, const char *sig EINA_UNUSED, const char *source EINA_UNUSED)
226{
227 Ecore_Evas *ee = data;
228 ecore_evas_fullscreen_set(ee, EINA_TRUE);
229}
230
231static void
232_elm_ews_border_sig_restore(void *data, Evas_Object *o EINA_UNUSED, const char *sig EINA_UNUSED, const char *source EINA_UNUSED)
233{
234 Ecore_Evas *ee = data;
235 ecore_evas_iconified_set(ee, EINA_FALSE);
236 ecore_evas_maximized_set(ee, EINA_FALSE);
237 ecore_evas_fullscreen_set(ee, EINA_FALSE);
238}
239
240static void
241_elm_ews_border_sig_close(void *data, Evas_Object *o EINA_UNUSED, const char *sig EINA_UNUSED, const char *source EINA_UNUSED)
242{
243 Ecore_Evas *ee = data;
244 ecore_evas_ews_delete_request(ee);
245}
246
247static void
248_elm_ews_border_sig_menu(void *data, Evas_Object *o EINA_UNUSED, const char *sig EINA_UNUSED, const char *source EINA_UNUSED)
249{
250 // TODO: show some menu?
251 ERR("EWS does not implement menu yet");
252 (void)data;
253}
254
255static Eina_Bool
256_elm_ews_border_mover(void *data)
257{
258 Ecore_Evas *ee = data;
259 Evas_Object *o = _elm_ews_wm_border_find(ee);
260 int x, y;
261
262 evas_pointer_output_xy_get(ecore_evas_ews_evas_get(), &x, &y);
263 x -= _ews_border_mover_off.x;
264 y -= _ews_border_mover_off.y;
265 ecore_evas_move(ee, x, y);
266 evas_object_move(o, x, y);
267
268 return EINA_TRUE;
269}
270
271static void
272_elm_ews_border_sig_move_start(void *data, Evas_Object *o EINA_UNUSED, const char *sig EINA_UNUSED, const char *source EINA_UNUSED)
273{
274 Ecore_Evas *ee = data;
275 Evas_Object *bs_o = ecore_evas_ews_backing_store_get(ee);
276 int x, y, ox, oy;
277
278 ELM_SAFE_FREE(_ews_border_mover, ecore_animator_del);
279
280 evas_pointer_output_xy_get(evas_object_evas_get(bs_o), &x, &y);
281 evas_object_geometry_get(bs_o, &ox, &oy, NULL, NULL);
282 _ews_border_mover_off.x = x - ox;
283 _ews_border_mover_off.y = y - oy;
284 _ews_border_mover_obj = bs_o;
285 _ews_border_mover = ecore_evas_animator_add(bs_o, _elm_ews_border_mover, ee);
286}
287
288static void
289_elm_ews_border_sig_move_stop(void *data EINA_UNUSED, Evas_Object *o EINA_UNUSED, const char *sig EINA_UNUSED, const char *source EINA_UNUSED)
290{
291 if (!_ews_border_mover) return;
292 ELM_SAFE_FREE(_ews_border_mover, ecore_animator_del);
293 _ews_border_mover_obj = NULL;
294}
295
296static Eina_Bool
297_elm_ews_wm_add_cb(void *data EINA_UNUSED, int type EINA_UNUSED, void *event_info)
298{
299 Ecore_Evas *ee = event_info;
300 Evas_Object *o = edje_object_add(ecore_evas_ews_evas_get());
301 Evas_Coord x, y, w, h, sw, sh;
302
303 edje_object_signal_callback_add
304 (o, "elm,action,focus", "elm", _elm_ews_border_sig_focus, ee);
305 edje_object_signal_callback_add
306 (o, "elm,action,iconify", "elm", _elm_ews_border_sig_iconify, ee);
307 edje_object_signal_callback_add
308 (o, "elm,action,maximize", "elm", _elm_ews_border_sig_maximize, ee);
309 edje_object_signal_callback_add
310 (o, "elm,action,fullscreen", "elm", _elm_ews_border_sig_fullscreen, ee);
311 edje_object_signal_callback_add
312 (o, "elm,action,restore", "elm", _elm_ews_border_sig_restore, ee);
313 edje_object_signal_callback_add
314 (o, "elm,action,close", "elm", _elm_ews_border_sig_close, ee);
315 edje_object_signal_callback_add
316 (o, "elm,action,menu", "elm", _elm_ews_border_sig_menu, ee);
317 edje_object_signal_callback_add
318 (o, "elm,action,move,start", "elm", _elm_ews_border_sig_move_start, ee);
319 edje_object_signal_callback_add
320 (o, "elm,action,move,stop", "elm", _elm_ews_border_sig_move_stop, ee);
321
322 eina_hash_add(_ews_borders, &ee, o);
323 _elm_ews_wm_border_theme_set(ee, o, NULL);
324
325 ecore_evas_screen_geometry_get(ee, NULL, NULL, &sw, &sh);
326 ecore_evas_geometry_get(ee, NULL, NULL, &w, &h);
327 x = (sw - w) / 2;
328 y = (sh - h) / 2;
329 ecore_evas_move(ee, x, y);
330 ecore_evas_focus_set(ee, EINA_TRUE);
331
332 return EINA_TRUE;
333}
334
335static Eina_Bool
336_elm_ews_wm_del_cb(void *data EINA_UNUSED, int type EINA_UNUSED, void *event_info)
337{
338 Ecore_Evas *ee = event_info;
339 eina_hash_del(_ews_borders, &ee, NULL);
340 eina_hash_del(_ews_borders_geo, &ee, NULL);
341 return EINA_TRUE;
342}
343
344static Eina_Bool
345_elm_ews_wm_geo_cb(void *data EINA_UNUSED, int type EINA_UNUSED, void *event_info)
346{
347 Ecore_Evas *ee = event_info;
348 Evas_Object *o = _elm_ews_wm_border_find(ee);
349 _elm_ews_border_geo_apply(ee, o);
350 return EINA_TRUE;
351}
352
353static Eina_Bool
354_elm_ews_wm_show_cb(void *data EINA_UNUSED, int type EINA_UNUSED, void *event_info)
355{
356 Ecore_Evas *ee = event_info;
357 Evas_Object *o = _elm_ews_wm_border_find(ee);
358 evas_object_show(o);
359 return EINA_TRUE;
360}
361
362static Eina_Bool
363_elm_ews_wm_hide_cb(void *data EINA_UNUSED, int type EINA_UNUSED, void *event_info)
364{
365 Ecore_Evas *ee = event_info;
366 Evas_Object *o = _elm_ews_wm_border_find(ee);
367 evas_object_hide(o);
368 return EINA_TRUE;
369}
370
371static Eina_Bool
372_elm_ews_wm_focus_cb(void *data EINA_UNUSED, int type EINA_UNUSED, void *event_info)
373{
374 Ecore_Evas *ee = event_info;
375 Evas_Object *o = _elm_ews_wm_border_find(ee);
376 _elm_ews_border_focus_apply(ee, o);
377 return EINA_TRUE;
378}
379
380static Eina_Bool
381_elm_ews_wm_stack_cb(void *data EINA_UNUSED, int type EINA_UNUSED, void *event_info)
382{
383 Ecore_Evas *ee = event_info;
384 Evas_Object *o = _elm_ews_wm_border_find(ee);
385 _elm_ews_border_stack_apply(ee, o);
386 return EINA_TRUE;
387}
388
389static Eina_Bool
390_elm_ews_wm_iconified_change_cb(void *data EINA_UNUSED, int type EINA_UNUSED, void *event_info)
391{
392 Ecore_Evas *ee = event_info;
393 Evas_Object *o = _elm_ews_wm_border_find(ee);
394 _elm_ews_border_iconified_apply(ee, o);
395 return EINA_TRUE;
396}
397
398static Eina_Bool
399_elm_ews_wm_maximized_change_cb(void *data EINA_UNUSED, int type EINA_UNUSED, void *event_info)
400{
401 Ecore_Evas *ee = event_info;
402 Evas_Object *o = _elm_ews_wm_border_find(ee);
403 _elm_ews_border_maximized_apply(ee, o);
404 return EINA_TRUE;
405}
406
407static Eina_Bool
408_elm_ews_wm_layer_change_cb(void *data EINA_UNUSED, int type EINA_UNUSED, void *event_info)
409{
410 Ecore_Evas *ee = event_info;
411 Evas_Object *o = _elm_ews_wm_border_find(ee);
412 _elm_ews_border_layer_apply(ee, o);
413 return EINA_TRUE;
414}
415
416static Eina_Bool
417_elm_ews_wm_fullscreen_change_cb(void *data EINA_UNUSED, int type EINA_UNUSED, void *event_info)
418{
419 Ecore_Evas *ee = event_info;
420 Evas_Object *o = _elm_ews_wm_border_find(ee);
421 _elm_ews_border_fullscreen_apply(ee, o);
422 return EINA_TRUE;
423}
424
425static Eina_Bool
426_elm_ews_wm_config_change_cb(void *data EINA_UNUSED, int type EINA_UNUSED, void *event_info)
427{
428 Ecore_Evas *ee = event_info;
429 Evas_Object *o = _elm_ews_wm_border_find(ee);
430 _elm_ews_border_config_apply(ee, o, NULL);
431 return EINA_TRUE;
432}
433
434void
435_elm_ews_wm_rescale(Elm_Theme *th, Eina_Bool use_theme)
436{
437 Eina_Iterator *it;
438 Eina_Hash_Tuple *tp = NULL;
439
440 if (!_ews_borders) return;
441 it = eina_hash_iterator_tuple_new(_ews_borders);
442 if (!use_theme)
443 {
444 EINA_ITERATOR_FOREACH(it, tp)
445 _elm_ews_wm_border_theme_set(*(void**)tp->key, tp->data, NULL);
446
447 if (_ews_bg)
448 _elm_theme_set(NULL, _ews_bg, "ews", "background", "default", EINA_TRUE);
449 }
450 else
451 {
452 EINA_ITERATOR_FOREACH(it, tp)
453 _elm_ews_wm_border_theme_set(*(void**)tp->key, tp->data, th);
454
455 if (_ews_bg)
456 _elm_theme_set(th, _ews_bg, "ews", "background", "default", EINA_TRUE);
457 }
458
459 eina_iterator_free(it);
460}
461
462int
463_elm_ews_wm_init(void)
464{
465 Evas *e;
466 Evas_Object *o;
467
468 if ((!_elm_config->engine) || (!(!strcmp(_elm_config->engine, ELM_EWS))))
469 {
470 _ews_used = EINA_FALSE;
471 return EINA_TRUE;
472 }
473
474 e = ecore_evas_ews_evas_get();
475 if (!e) return EINA_FALSE;
476 o = edje_object_add(e);
477 if (!o) return EINA_FALSE;
478
479 if (_elm_theme_set(NULL, o, "ews", "background", "default", EINA_TRUE) == EFL_UI_THEME_APPLY_ERROR_GENERIC)
480 {
481 ERR("Could not set background theme, fallback to rectangle");
482 evas_object_del(o);
483 _ews_bg = o = NULL;
484 }
485 else
486 _ews_bg = o;
487 ecore_evas_ews_background_set(o);
488
489#define ADD_EH(ev, cb) \
490 _ews_ev_handlers = eina_list_append \
491 (_ews_ev_handlers, ecore_event_handler_add(ev, cb, NULL))
492 ADD_EH(ECORE_EVAS_EWS_EVENT_ADD, _elm_ews_wm_add_cb);
493 ADD_EH(ECORE_EVAS_EWS_EVENT_DEL, _elm_ews_wm_del_cb);
494 ADD_EH(ECORE_EVAS_EWS_EVENT_RESIZE, _elm_ews_wm_geo_cb);
495 ADD_EH(ECORE_EVAS_EWS_EVENT_MOVE, _elm_ews_wm_geo_cb);
496 ADD_EH(ECORE_EVAS_EWS_EVENT_SHOW, _elm_ews_wm_show_cb);
497 ADD_EH(ECORE_EVAS_EWS_EVENT_HIDE, _elm_ews_wm_hide_cb);
498 ADD_EH(ECORE_EVAS_EWS_EVENT_FOCUS, _elm_ews_wm_focus_cb);
499 ADD_EH(ECORE_EVAS_EWS_EVENT_UNFOCUS, _elm_ews_wm_focus_cb);
500 ADD_EH(ECORE_EVAS_EWS_EVENT_RAISE, _elm_ews_wm_stack_cb);
501 ADD_EH(ECORE_EVAS_EWS_EVENT_LOWER, _elm_ews_wm_stack_cb);
502 ADD_EH(ECORE_EVAS_EWS_EVENT_ICONIFIED_CHANGE, _elm_ews_wm_iconified_change_cb);
503 ADD_EH(ECORE_EVAS_EWS_EVENT_MAXIMIZED_CHANGE, _elm_ews_wm_maximized_change_cb);
504 ADD_EH(ECORE_EVAS_EWS_EVENT_LAYER_CHANGE, _elm_ews_wm_layer_change_cb);
505 ADD_EH(ECORE_EVAS_EWS_EVENT_FULLSCREEN_CHANGE, _elm_ews_wm_fullscreen_change_cb);
506 ADD_EH(ECORE_EVAS_EWS_EVENT_CONFIG_CHANGE, _elm_ews_wm_config_change_cb);
507#undef ADD_EH
508
509 if (!_ews_borders)
510 _ews_borders = eina_hash_pointer_new(_elm_ews_wm_border_del);
511
512 if (!_ews_borders_geo)
513 _ews_borders_geo = eina_hash_pointer_new(free);
514
515 _ews_used = EINA_TRUE;
516 return EINA_TRUE;
517}
518
519void
520_elm_ews_wm_shutdown(void)
521{
522 Ecore_Event_Handler *eh;
523
524 ELM_SAFE_FREE(_ews_border_mover, ecore_animator_del);
525 _ews_border_mover_obj = NULL;
526
527 EINA_LIST_FREE(_ews_ev_handlers, eh) ecore_event_handler_del(eh);
528 ELM_SAFE_FREE(_ews_borders, eina_hash_free);
529 ELM_SAFE_FREE(_ews_borders_geo, ecore_animator_del);
530 _ews_bg = NULL;
531}
diff --git a/src/lib/elementary/meson.build b/src/lib/elementary/meson.build
index 06e07e3a71..09e5596e3a 100644
--- a/src/lib/elementary/meson.build
+++ b/src/lib/elementary/meson.build
@@ -858,7 +858,6 @@ elementary_src = files([
858 'els_box.c', 858 'els_box.c',
859 'els_cursor.c', 859 'els_cursor.c',
860 'els_tooltip.c', 860 'els_tooltip.c',
861 'elu_ews_wm.c',
862 'efl_ui_container_layout.c', 861 'efl_ui_container_layout.c',
863 'efl_ui_container_layout.h', 862 'efl_ui_container_layout.h',
864 'efl_ui_box.c', 863 'efl_ui_box.c',
diff --git a/src/modules/ecore_evas/meson.build b/src/modules/ecore_evas/meson.build
index 78a9b35d13..7a9d6979da 100644
--- a/src/modules/ecore_evas/meson.build
+++ b/src/modules/ecore_evas/meson.build
@@ -44,5 +44,3 @@ if get_option('vnc-server')
44 44
45 subdir(join_paths('vnc_server')) 45 subdir(join_paths('vnc_server'))
46endif 46endif
47
48config_h.set('BUILD_ECORE_EVAS_EWS', '1')