summaryrefslogtreecommitdiff
path: root/src/lib/ecore_evas
diff options
context:
space:
mode:
authorGustavo Sverzut Barbieri <barbieri@gmail.com>2012-12-05 12:24:01 +0000
committerGustavo Sverzut Barbieri <barbieri@gmail.com>2012-12-05 12:24:01 +0000
commitdfe93a7f0ada3ced637309dc9f6d7a76270f85d6 (patch)
tree9e5e6b4e1994834125226d4f0aaaed8a33dcaa90 /src/lib/ecore_evas
parentaa53580814e5315586cdd4a68ba9f2bf7bfa2d07 (diff)
directfb says bye...
After agreement in the mail list, core developers agree to remove this engine that was not being supported for a long time. Given that most operations Evas uses are not accelerated in DirectFB, or at least hardware that exclusively supports DirectFB, it's better for those people to just use Evas/Ecore software (buffer) rendering and expose DirectFB's framebuffer as destination surface. SVN revision: 80232
Diffstat (limited to 'src/lib/ecore_evas')
-rw-r--r--src/lib/ecore_evas/Ecore_Evas.h6
-rw-r--r--src/lib/ecore_evas/ecore_evas.c28
-rw-r--r--src/lib/ecore_evas/ecore_evas_directfb.c586
-rw-r--r--src/lib/ecore_evas/ecore_evas_private.h13
4 files changed, 6 insertions, 627 deletions
diff --git a/src/lib/ecore_evas/Ecore_Evas.h b/src/lib/ecore_evas/Ecore_Evas.h
index b701aeec8f..01f13b6fc6 100644
--- a/src/lib/ecore_evas/Ecore_Evas.h
+++ b/src/lib/ecore_evas/Ecore_Evas.h
@@ -93,7 +93,7 @@ extern "C" {
93#define HAVE_ECORE_EVAS_FB 1 93#define HAVE_ECORE_EVAS_FB 1
94#define HAVE_ECORE_EVAS_X11_GL 1 94#define HAVE_ECORE_EVAS_X11_GL 1
95//#define HAVE_ECORE_EVAS_X11_16 1 95//#define HAVE_ECORE_EVAS_X11_16 1
96#define HAVE_ECORE_EVAS_DIRECTFB 1 96//#define HAVE_ECORE_EVAS_DIRECTFB 1
97#define HAVE_ECORE_EVAS_WIN32 1 97#define HAVE_ECORE_EVAS_WIN32 1
98#define HAVE_ECORE_EVAS_COCOA 1 98#define HAVE_ECORE_EVAS_COCOA 1
99#define HAVE_ECORE_EVAS_SDL 1 99#define HAVE_ECORE_EVAS_SDL 1
@@ -935,8 +935,8 @@ EAPI void ecore_evas_software_x11_16_extra_event_window_add(Ecore_Eva
935 935
936EAPI Ecore_Evas *ecore_evas_fb_new(const char *disp_name, int rotation, int w, int h); 936EAPI Ecore_Evas *ecore_evas_fb_new(const char *disp_name, int rotation, int w, int h);
937 937
938EAPI Ecore_Evas *ecore_evas_directfb_new(const char *disp_name, int windowed, int x, int y, int w, int h); 938EAPI Ecore_Evas *ecore_evas_directfb_new(const char *disp_name, int windowed, int x, int y, int w, int h) EINA_DEPRECATED;
939EAPI Ecore_DirectFB_Window *ecore_evas_directfb_window_get(const Ecore_Evas *ee); 939EAPI Ecore_DirectFB_Window *ecore_evas_directfb_window_get(const Ecore_Evas *ee) EINA_DEPRECATED;
940 940
941 941
942EAPI Ecore_Evas *ecore_evas_wayland_shm_new(const char *disp_name, unsigned int parent, int x, int y, int w, int h, Eina_Bool frame); 942EAPI Ecore_Evas *ecore_evas_wayland_shm_new(const char *disp_name, unsigned int parent, int x, int y, int w, int h, Eina_Bool frame);
diff --git a/src/lib/ecore_evas/ecore_evas.c b/src/lib/ecore_evas/ecore_evas.c
index 9a665fd581..49d90fb607 100644
--- a/src/lib/ecore_evas/ecore_evas.c
+++ b/src/lib/ecore_evas/ecore_evas.c
@@ -146,11 +146,7 @@ ecore_evas_engine_type_supported_get(Ecore_Evas_Engine_Type engine)
146 return EINA_FALSE; 146 return EINA_FALSE;
147#endif 147#endif
148 case ECORE_EVAS_ENGINE_DIRECTFB: 148 case ECORE_EVAS_ENGINE_DIRECTFB:
149#ifdef BUILD_ECORE_EVAS_DIRECTFB
150 return EINA_TRUE;
151#else
152 return EINA_FALSE; 149 return EINA_FALSE;
153#endif
154 case ECORE_EVAS_ENGINE_SOFTWARE_FB: 150 case ECORE_EVAS_ENGINE_SOFTWARE_FB:
155#ifdef BUILD_ECORE_EVAS_FB 151#ifdef BUILD_ECORE_EVAS_FB
156 return EINA_TRUE; 152 return EINA_TRUE;
@@ -304,9 +300,6 @@ ecore_evas_shutdown(void)
304#ifdef BUILD_ECORE_EVAS_SOFTWARE_BUFFER 300#ifdef BUILD_ECORE_EVAS_SOFTWARE_BUFFER
305 while (_ecore_evas_buffer_shutdown()); 301 while (_ecore_evas_buffer_shutdown());
306#endif 302#endif
307#ifdef BUILD_ECORE_EVAS_DIRECTFB
308 while (_ecore_evas_directfb_shutdown());
309#endif
310 303
311 if (_ecore_evas_async_events_fd) 304 if (_ecore_evas_async_events_fd)
312 ecore_main_fd_handler_del(_ecore_evas_async_events_fd); 305 ecore_main_fd_handler_del(_ecore_evas_async_events_fd);
@@ -518,24 +511,6 @@ _ecore_evas_constructor_opengl_sdl(int x EINA_UNUSED, int y EINA_UNUSED, int w,
518} 511}
519#endif 512#endif
520 513
521#ifdef BUILD_ECORE_EVAS_DIRECTFB
522static Ecore_Evas *
523_ecore_evas_constructor_directfb(int x, int y, int w, int h, const char *extra_options)
524{
525 Ecore_Evas *ee;
526 char *disp_name = NULL;
527 unsigned int windowed = 1;
528
529 _ecore_evas_parse_extra_options_str(extra_options, "display=", &disp_name);
530 _ecore_evas_parse_extra_options_uint(extra_options, "windowed=", &windowed);
531
532 ee = ecore_evas_directfb_new(disp_name, windowed, x, y, w, h);
533 free(disp_name);
534
535 return ee;
536}
537#endif
538
539#ifdef BUILD_ECORE_EVAS_FB 514#ifdef BUILD_ECORE_EVAS_FB
540static Ecore_Evas * 515static Ecore_Evas *
541_ecore_evas_constructor_fb(int x EINA_UNUSED, int y EINA_UNUSED, int w, int h, const char *extra_options) 516_ecore_evas_constructor_fb(int x EINA_UNUSED, int y EINA_UNUSED, int w, int h, const char *extra_options)
@@ -667,9 +642,6 @@ static const struct ecore_evas_engine _engines[] = {
667#ifdef BUILD_ECORE_EVAS_SOFTWARE_8_X11 642#ifdef BUILD_ECORE_EVAS_SOFTWARE_8_X11
668 {"software_8_x11", _ecore_evas_constructor_software_8_x11}, 643 {"software_8_x11", _ecore_evas_constructor_software_8_x11},
669#endif 644#endif
670#ifdef BUILD_ECORE_EVAS_DIRECTFB
671 {"directfb", _ecore_evas_constructor_directfb},
672#endif
673#ifdef BUILD_ECORE_EVAS_FB 645#ifdef BUILD_ECORE_EVAS_FB
674 {"fb", _ecore_evas_constructor_fb}, 646 {"fb", _ecore_evas_constructor_fb},
675#endif 647#endif
diff --git a/src/lib/ecore_evas/ecore_evas_directfb.c b/src/lib/ecore_evas/ecore_evas_directfb.c
index caeed21def..9557d12722 100644
--- a/src/lib/ecore_evas/ecore_evas_directfb.c
+++ b/src/lib/ecore_evas/ecore_evas_directfb.c
@@ -6,602 +6,22 @@
6 6
7#include <Ecore.h> 7#include <Ecore.h>
8#include "ecore_private.h" 8#include "ecore_private.h"
9#ifdef BUILD_ECORE_EVAS_DIRECTFB
10#include <Ecore_DirectFB.h>
11#endif
12 9
13#include "ecore_evas_private.h" 10#include "ecore_evas_private.h"
14#include "Ecore_Evas.h" 11#include "Ecore_Evas.h"
15 12
16#ifdef BUILD_ECORE_EVAS_DIRECTFB 13/* Ecore_Evas DirectFB support was removed. However we keep the functions
17static int _ecore_evas_init_count = 0; 14 * to not break ABI.
18static Ecore_Event_Handler *ecore_evas_event_handlers[13]; 15 */
19
20static Eina_Hash *ecore_evases_hash = NULL;
21
22static int
23_ecore_evas_directfb_render(Ecore_Evas *ee)
24{
25 Eina_List *updates, *ll;
26 Ecore_Evas *ee2;
27 int rend = 0;
28
29 EINA_LIST_FOREACH(ee->sub_ecore_evas, ll, ee2)
30 {
31 if (ee2->func.fn_pre_render) ee2->func.fn_pre_render(ee2);
32 if (ee2->engine.func->fn_render)
33 rend |= ee2->engine.func->fn_render(ee2);
34 if (ee2->func.fn_post_render) ee2->func.fn_post_render(ee2);
35 }
36
37 if (ee->func.fn_pre_render) ee->func.fn_pre_render(ee);
38 updates = evas_render_updates(ee->evas);
39 if (updates)
40 {
41 evas_render_updates_free(updates);
42 _ecore_evas_idle_timeout_update(ee);
43 }
44 if (ee->func.fn_post_render) ee->func.fn_post_render(ee);
45
46 return updates ? 1 : rend;
47}
48
49static char *
50_ecore_evas_directfb_winid_str_get(Ecore_X_Window win)
51{
52 const char *vals = "qWeRtYuIoP5$&<~";
53 static char id[9];
54 unsigned int val;
55 val = (unsigned int)win;
56 id[0] = vals[(val >> 28) & 0xf];
57 id[1] = vals[(val >> 24) & 0xf];
58 id[2] = vals[(val >> 20) & 0xf];
59 id[3] = vals[(val >> 16) & 0xf];
60 id[4] = vals[(val >> 12) & 0xf];
61 id[5] = vals[(val >> 8) & 0xf];
62 id[6] = vals[(val >> 4) & 0xf];
63 id[7] = vals[(val ) & 0xf];
64 id[8] = 0;
65 return id;
66}
67
68static Ecore_Evas *
69_ecore_evas_directfb_match(DFBWindowID win)
70{
71 Ecore_Evas *ee;
72
73 ee = eina_hash_find(ecore_evases_hash, _ecore_evas_directfb_winid_str_get(win));
74 return ee;
75}
76
77static Eina_Bool
78_ecore_evas_directfb_event_key_down(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
79{
80 Ecore_Evas *ee;
81 Ecore_DirectFB_Event_Key_Down *e;
82
83 e = event;
84 ee = _ecore_evas_directfb_match(e->win);
85
86 if (!ee) return EINA_TRUE; /* pass on event */
87 evas_event_feed_key_down(ee->evas, e->name, e->name, e->string,
88 e->key_compose, e->time, NULL);
89 return EINA_TRUE;
90}
91
92static Eina_Bool
93_ecore_evas_directfb_event_key_up(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
94{
95 Ecore_Evas *ee;
96 Ecore_DirectFB_Event_Key_Up *e;
97
98 e = event;
99 ee = _ecore_evas_directfb_match(e->win);
100
101 if (!ee) return EINA_TRUE; /* pass on event */
102 evas_event_feed_key_up(ee->evas, e->name, e->name, e->string,
103 e->key_compose, e->time, NULL);
104 return EINA_TRUE;
105}
106
107static Eina_Bool
108_ecore_evas_directfb_event_motion(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
109{
110 Ecore_Evas *ee;
111 Ecore_DirectFB_Event_Motion *e;
112
113 e = event;
114 ee = _ecore_evas_directfb_match(e->win);
115
116 if (!ee) return EINA_TRUE; /* pass on event */
117 _ecore_evas_mouse_move_process(ee, e->x, e->y, e->time);
118 return EINA_TRUE;
119}
120
121static Eina_Bool
122_ecore_evas_directfb_event_button_down(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
123{
124 Ecore_Evas *ee;
125 Ecore_DirectFB_Event_Button_Down *e;
126
127 e = event;
128 ee = _ecore_evas_directfb_match(e->win);
129
130 if (!ee) return EINA_TRUE; /* pass on event */
131 // _ecore_evas_mouse_move_process(ee, e->x, e->y, e->time);
132 evas_event_feed_mouse_down(ee->evas, e->button, EVAS_BUTTON_NONE, e->time, NULL);
133 return EINA_TRUE;
134}
135
136static Eina_Bool
137_ecore_evas_directfb_event_button_up(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
138{
139 Ecore_Evas *ee;
140 Ecore_DirectFB_Event_Button_Up *e;
141 Evas_Button_Flags flags = EVAS_BUTTON_NONE;
142
143 e = event;
144 ee = _ecore_evas_directfb_match(e->win);
145
146 if (!ee) return EINA_TRUE; /* pass on event */
147 //_ecore_evas_mouse_move_process(ee, e->x, e->y, e->time);
148 evas_event_feed_mouse_up(ee->evas, e->button, flags, e->time, NULL);
149 return EINA_TRUE;
150}
151
152static Eina_Bool
153_ecore_evas_directfb_event_enter(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
154{
155 Ecore_Evas *ee;
156 Ecore_DirectFB_Event_Enter *e;
157
158 e = event;
159 ee = _ecore_evas_directfb_match(e->win);
160
161 if (!ee) return EINA_TRUE; /* pass on event */
162 evas_event_feed_mouse_in(ee->evas, e->time, NULL);
163 //_ecore_evas_mouse_move_process(ee, e->x, e->y, e->time);
164 return EINA_TRUE;
165}
166
167static Eina_Bool
168_ecore_evas_directfb_event_leave(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
169{
170 Ecore_Evas *ee;
171 Ecore_DirectFB_Event_Leave *e;
172
173 e = event;
174 ee = _ecore_evas_directfb_match(e->win);
175
176 if (!ee) return EINA_TRUE; /* pass on event */
177 evas_event_feed_mouse_out(ee->evas, e->time, NULL);
178 //_ecore_evas_mouse_move_process(ee, e->x, e->y, e->time);
179 if (ee->func.fn_mouse_out) ee->func.fn_mouse_out(ee);
180 if (ee->prop.cursor.object) evas_object_hide(ee->prop.cursor.object);
181 return EINA_TRUE;
182}
183
184static Eina_Bool
185_ecore_evas_directfb_event_wheel(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
186{
187 Ecore_Evas *ee;
188 Ecore_DirectFB_Event_Wheel *e;
189
190 e = event;
191 ee = _ecore_evas_directfb_match(e->win);
192
193 if (!ee) return EINA_TRUE; /* pass on event */
194 evas_event_feed_mouse_wheel(ee->evas, e->direction, e->z, e->time, NULL);
195 return EINA_TRUE;
196}
197
198static Eina_Bool
199_ecore_evas_directfb_event_got_focus(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
200{
201 Ecore_Evas *ee;
202 Ecore_DirectFB_Event_Got_Focus *e;
203
204 e = event;
205 ee = _ecore_evas_directfb_match(e->win);
206
207 if (!ee) return EINA_TRUE; /* pass on event */
208 ee->prop.focused = 1;
209 return EINA_TRUE;
210}
211
212static Eina_Bool
213_ecore_evas_directfb_event_lost_focus(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
214{
215 Ecore_Evas *ee;
216 Ecore_DirectFB_Event_Lost_Focus *e;
217
218 e = event;
219 ee = _ecore_evas_directfb_match(e->win);
220
221 if (!ee) return EINA_TRUE; /* pass on event */
222 ee->prop.focused = 0;
223 return EINA_TRUE;
224}
225
226int
227_ecore_evas_directfb_shutdown(void)
228{
229 _ecore_evas_init_count--;
230 if (_ecore_evas_init_count == 0)
231 {
232 int i;
233
234 for (i = 0; i < 8; i++)
235 ecore_event_handler_del(ecore_evas_event_handlers[i]);
236 }
237 if (_ecore_evas_init_count < 0) _ecore_evas_init_count = 0;
238 return _ecore_evas_init_count;
239}
240
241
242
243
244
245int
246_ecore_evas_directfb_init(void)
247{
248 _ecore_evas_init_count++;
249 if (_ecore_evas_init_count > 1) return _ecore_evas_init_count;
250
251 ecore_evas_event_handlers[0] = ecore_event_handler_add(ECORE_DIRECTFB_EVENT_KEY_DOWN, _ecore_evas_directfb_event_key_down, NULL);
252 ecore_evas_event_handlers[1] = ecore_event_handler_add(ECORE_DIRECTFB_EVENT_KEY_UP, _ecore_evas_directfb_event_key_up, NULL);
253 ecore_evas_event_handlers[2] = ecore_event_handler_add(ECORE_DIRECTFB_EVENT_BUTTON_DOWN, _ecore_evas_directfb_event_button_down, NULL);
254 ecore_evas_event_handlers[3] = ecore_event_handler_add(ECORE_DIRECTFB_EVENT_BUTTON_UP, _ecore_evas_directfb_event_button_up, NULL);
255 ecore_evas_event_handlers[4] = ecore_event_handler_add(ECORE_DIRECTFB_EVENT_MOTION, _ecore_evas_directfb_event_motion, NULL);
256 ecore_evas_event_handlers[5] = ecore_event_handler_add(ECORE_DIRECTFB_EVENT_ENTER, _ecore_evas_directfb_event_enter, NULL);
257 ecore_evas_event_handlers[6] = ecore_event_handler_add(ECORE_DIRECTFB_EVENT_LEAVE, _ecore_evas_directfb_event_leave, NULL);
258 ecore_evas_event_handlers[7] = ecore_event_handler_add(ECORE_DIRECTFB_EVENT_WHEEL, _ecore_evas_directfb_event_wheel, NULL);
259 ecore_evas_event_handlers[8] = ecore_event_handler_add(ECORE_DIRECTFB_EVENT_GOT_FOCUS, _ecore_evas_directfb_event_got_focus, NULL);
260 ecore_evas_event_handlers[9] = ecore_event_handler_add(ECORE_DIRECTFB_EVENT_LOST_FOCUS, _ecore_evas_directfb_event_lost_focus, NULL);
261 ecore_evas_event_handlers[10] = NULL;
262 ecore_evas_event_handlers[11] = NULL;
263 ecore_evas_event_handlers[12] = NULL;
264
265 return _ecore_evas_init_count;
266}
267
268/* engine functions */
269/********************/
270
271static void
272_ecore_evas_directfb_free(Ecore_Evas *ee)
273{
274 eina_hash_del(ecore_evases_hash, _ecore_evas_directfb_winid_str_get(ee->engine.directfb.window->id), ee);
275 ecore_directfb_window_free(ee->engine.directfb.window);
276 _ecore_evas_directfb_shutdown();
277 ecore_directfb_shutdown();
278}
279
280static void
281_ecore_evas_directfb_move(Ecore_Evas *ee, int x, int y)
282{
283 ecore_directfb_window_move(ee->engine.directfb.window, x, y);
284}
285
286static void
287_ecore_evas_directfb_resize(Ecore_Evas *ee, int w, int h)
288{
289 ee->req.w = w;
290 ee->req.h = h;
291 if ((w == ee->w) && (h == ee->h)) return;
292 ecore_directfb_window_resize(ee->engine.directfb.window, w, h);
293 ee->w = w;
294 ee->h = h;
295 if ((ee->rotation == 90) || (ee->rotation == 270))
296 {
297 evas_output_size_set(ee->evas, ee->h, ee->w);
298 evas_output_viewport_set(ee->evas, 0, 0, ee->h, ee->w);
299 }
300 else
301 {
302 evas_output_size_set(ee->evas, ee->w, ee->h);
303 evas_output_viewport_set(ee->evas, 0, 0, ee->w, ee->h);
304 }
305}
306
307static void
308_ecore_evas_directfb_focus_set(Ecore_Evas *ee, int on EINA_UNUSED)
309{
310 ecore_directfb_window_focus(ee->engine.directfb.window);
311}
312
313static void
314_ecore_evas_directfb_hide(Ecore_Evas *ee)
315{
316 ecore_directfb_window_hide(ee->engine.directfb.window);
317 ee->should_be_visible = 0;
318}
319
320static void
321_ecore_evas_directfb_show(Ecore_Evas *ee)
322{
323 ecore_directfb_window_show(ee->engine.directfb.window);
324 ee->should_be_visible = 1;
325}
326
327static void
328_ecore_evas_directfb_shaped_set(Ecore_Evas *ee, int shaped)
329{
330 if (((ee->shaped) && (shaped)) || ((!ee->shaped) && (!shaped)))
331 return;
332 ee->shaped = shaped;
333 if(ee->shaped)
334 ecore_directfb_window_shaped_set(ee->engine.directfb.window, 1);
335 else
336 ecore_directfb_window_shaped_set(ee->engine.directfb.window, 0);
337
338}
339
340static void
341_ecore_evas_object_cursor_del(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
342{
343 Ecore_Evas *ee;
344
345 ee = data;
346 if (ee)
347 ee->prop.cursor.object = NULL;
348}
349
350static void
351_ecore_evas_directfb_object_cursor_set(Ecore_Evas *ee, Evas_Object *obj, int layer, int hot_x, int hot_y)
352{
353 int x, y;
354
355 if (ee->prop.cursor.object) evas_object_del(ee->prop.cursor.object);
356
357 if (!obj)
358 {
359 ee->prop.cursor.object = NULL;
360 ee->prop.cursor.layer = 0;
361 ee->prop.cursor.hot.x = 0;
362 ee->prop.cursor.hot.y = 0;
363 ecore_directfb_window_cursor_show(ee->engine.directfb.window, 1);
364 return;
365
366 }
367
368 ee->prop.cursor.object = obj;
369 ee->prop.cursor.layer = layer;
370 ee->prop.cursor.hot.x = hot_x;
371 ee->prop.cursor.hot.y = hot_y;
372 16
373 ecore_directfb_window_cursor_show(ee->engine.directfb.window, 0);
374
375 evas_pointer_output_xy_get(ee->evas, &x, &y);
376 evas_object_layer_set(ee->prop.cursor.object, ee->prop.cursor.layer);
377 evas_object_move(ee->prop.cursor.object,x - ee->prop.cursor.hot.x,y - ee->prop.cursor.hot.y);
378 evas_object_pass_events_set(ee->prop.cursor.object, 1);
379 if (evas_pointer_inside_get(ee->evas))
380 evas_object_show(ee->prop.cursor.object);
381
382 evas_object_event_callback_add(obj, EVAS_CALLBACK_DEL, _ecore_evas_object_cursor_del, ee);
383}
384
385static void
386_ecore_evas_directfb_fullscreen_set(Ecore_Evas *ee, int on)
387{
388 Evas_Engine_Info_DirectFB *einfo;
389 int w;
390 int h;
391 int resized = 0;
392
393 if (((ee->prop.fullscreen) && (on)) || ((!ee->prop.fullscreen) && (!on)))
394 return;
395
396 if (on)
397 ecore_directfb_window_fullscreen_set(ee->engine.directfb.window, 1);
398 else
399 ecore_directfb_window_fullscreen_set(ee->engine.directfb.window, 0);
400 /* set the new size of the evas */
401 ecore_directfb_window_size_get(ee->engine.directfb.window, &w, &h);
402 if( (ee->w != w) || (ee->h != h))
403 {
404 resized = 1;
405 ee->w = w;
406 ee->h = h;
407 ee->req.w = ee->w;
408 ee->req.h = ee->h;
409 if ((ee->rotation == 90) || (ee->rotation == 270))
410 {
411 evas_output_size_set(ee->evas, ee->h, ee->w);
412 evas_output_viewport_set(ee->evas, 0, 0, ee->h, ee->w);
413 }
414 else
415 {
416 evas_output_size_set(ee->evas, ee->w, ee->h);
417 evas_output_viewport_set(ee->evas, 0, 0, ee->w, ee->h);
418 }
419 }
420 einfo = (Evas_Engine_Info_DirectFB *)evas_engine_info_get(ee->evas);
421 if (einfo)
422 {
423 einfo->info.surface = ee->engine.directfb.window->surface;
424 if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo))
425 {
426 ERR("evas_engine_info_set() for engine '%s' failed.", ee->driver);
427 }
428 }
429 ee->prop.fullscreen = on;
430 if (resized)
431 {
432 if(ee->func.fn_resize) ee->func.fn_resize(ee);
433 }
434}
435
436static void *
437_ecore_evas_directfb_window_get(const Ecore_Evas *ee)
438{
439 return ee->engine.directfb.window;
440}
441#endif
442
443#ifdef BUILD_ECORE_EVAS_DIRECTFB
444static Ecore_Evas_Engine_Func _ecore_directfb_engine_func =
445{
446 _ecore_evas_directfb_free, /* free an ecore_evas */
447 NULL, /* cb resize */
448 NULL, /* cb move */
449 NULL, /* cb show */
450 NULL, /* cb hide */
451 NULL, /* cb delete request */
452 NULL, /* cb destroy */
453 NULL, /* cb focus in */
454 NULL, /* cb focus out */
455 NULL, /* cb sticky */
456 NULL, /* cb unsticky */
457 NULL, /* cb mouse in */
458 NULL, /* cb mouse out */
459 NULL, /* cb pre render */
460 NULL, /* cb post render */
461 _ecore_evas_directfb_move, /* move */
462 NULL, /* managed move */
463 _ecore_evas_directfb_resize, /* resize */
464 NULL, /* move resize */
465 NULL,//_ecore_evas_directfb_rotation_set,/* rotation */
466 _ecore_evas_directfb_shaped_set, /* shaped */
467 _ecore_evas_directfb_show, /* show */
468 _ecore_evas_directfb_hide, /* hide */
469 NULL, /* raise */
470 NULL, /* lower */
471 NULL, /* activate */
472 NULL, /* title set */
473 NULL, /* name class set */
474 NULL, /* size min */
475 NULL, /* size max */
476 NULL, /* size base */
477 NULL, /* size step */
478 _ecore_evas_directfb_object_cursor_set, /* set cursor to an evas object */
479 NULL, /* layer set */
480 _ecore_evas_directfb_focus_set, /* focus */
481 NULL, /* iconified */
482 NULL, /* borderless */
483 NULL, /* override */
484 NULL, /* maximized */
485 _ecore_evas_directfb_fullscreen_set,/* fullscreen */
486 NULL, /* avoid damage */
487 NULL, /* withdrawn */
488 NULL, /* sticky */
489 NULL, /* ignore events */
490 NULL, /* alpha */
491 NULL, //transparent
492 NULL, // profiles_set
493 NULL, // profile_set
494
495 NULL,
496 NULL,
497 NULL,
498 NULL,
499 NULL,
500 NULL,
501
502 NULL, // render
503 NULL, // screen_geometry_get
504 NULL // screen_dpi_get
505};
506#endif
507
508/* api */
509/*******/
510
511#ifdef BUILD_ECORE_EVAS_DIRECTFB
512EAPI Ecore_Evas *
513ecore_evas_directfb_new(const char *disp_name, int windowed, int x, int y, int w, int h)
514{
515 Evas_Engine_Info_DirectFB *einfo;
516 Ecore_Evas *ee;
517 Ecore_DirectFB_Window *window;
518 int rmethod;
519
520 rmethod = evas_render_method_lookup("directfb");
521 if (!rmethod) return NULL;
522 if (!ecore_directfb_init(disp_name)) return NULL;
523 ee = calloc(1, sizeof(Ecore_Evas));
524 if (!ee) return NULL;
525
526 ECORE_MAGIC_SET(ee, ECORE_MAGIC_EVAS);
527 _ecore_evas_directfb_init();
528 ee->engine.func = (Ecore_Evas_Engine_Func *)&_ecore_directfb_engine_func;
529
530 ee->driver = "directfb";
531 if (disp_name) ee->name = strdup(disp_name);
532
533 if (w < 1) w = 1;
534 if (h < 1) h = 1;
535
536 ee->rotation = 0;
537 ee->visible = 1;
538 ee->x = x;
539 ee->y = y;
540 ee->w = w;
541 ee->h = h;
542 ee->req.x = ee->x;
543 ee->req.y = ee->y;
544 ee->req.w = ee->w;
545 ee->req.h = ee->h;
546 ee->prop.layer = 1;
547 ee->prop.fullscreen = 0;
548
549 /* init evas here */
550 ee->evas = evas_new();
551 evas_data_attach_set(ee->evas, ee);
552 evas_output_method_set(ee->evas, rmethod);
553 evas_output_size_set(ee->evas, w, h);
554 evas_output_viewport_set(ee->evas, 0, 0, w, h);
555 einfo = (Evas_Engine_Info_DirectFB *)evas_engine_info_get(ee->evas);
556
557 window = ecore_directfb_window_new(x,y,w,h);
558 ee->engine.directfb.window = window;
559 if (einfo)
560 {
561 einfo->info.dfb = ecore_directfb_interface_get();
562 einfo->info.surface = window->surface;
563 if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo))
564 {
565 ERR("evas_engine_info_set() for engine '%s' failed.", ee->driver);
566 ecore_evas_free(ee);
567 return NULL;
568 }
569 }
570 else
571 {
572 ERR("evas_engine_info_set() init engine '%s' failed.", ee->driver);
573 ecore_evas_free(ee);
574 return NULL;
575 }
576
577 ee->engine.func->fn_render = _ecore_evas_directfb_render;
578 _ecore_evas_register(ee);
579
580 if (!ecore_evases_hash)
581 ecore_evases_hash = eina_hash_string_superfast_new(NULL);
582 eina_hash_add(ecore_evases_hash, _ecore_evas_directfb_winid_str_get(ee->engine.directfb.window->id), ee);
583
584 return ee;
585}
586#else
587EAPI Ecore_Evas * 17EAPI Ecore_Evas *
588ecore_evas_directfb_new(const char *disp_name EINA_UNUSED, int windowed EINA_UNUSED, int x EINA_UNUSED, int y EINA_UNUSED, int w EINA_UNUSED, int h EINA_UNUSED) 18ecore_evas_directfb_new(const char *disp_name EINA_UNUSED, int windowed EINA_UNUSED, int x EINA_UNUSED, int y EINA_UNUSED, int w EINA_UNUSED, int h EINA_UNUSED)
589{ 19{
590 return NULL; 20 return NULL;
591} 21}
592#endif
593 22
594#ifdef BUILD_ECORE_EVAS_DIRECTFB
595EAPI Ecore_DirectFB_Window *
596ecore_evas_directfb_window_get(const Ecore_Evas *ee)
597{
598 if (!(!strcmp(ee->driver, "directfb"))) return 0;
599 return (Ecore_DirectFB_Window *) _ecore_evas_directfb_window_get(ee);
600}
601#else
602EAPI Ecore_DirectFB_Window * 23EAPI Ecore_DirectFB_Window *
603ecore_evas_directfb_window_get(const Ecore_Evas *ee EINA_UNUSED) 24ecore_evas_directfb_window_get(const Ecore_Evas *ee EINA_UNUSED)
604{ 25{
605 return NULL; 26 return NULL;
606} 27}
607#endif
diff --git a/src/lib/ecore_evas/ecore_evas_private.h b/src/lib/ecore_evas/ecore_evas_private.h
index 2d9cb016b8..d6cff8f023 100644
--- a/src/lib/ecore_evas/ecore_evas_private.h
+++ b/src/lib/ecore_evas/ecore_evas_private.h
@@ -33,11 +33,6 @@
33# include <Evas_Engine_FB.h> 33# include <Evas_Engine_FB.h>
34#endif 34#endif
35 35
36#ifdef BUILD_ECORE_EVAS_DIRECTFB
37# include <Evas_Engine_DirectFB.h>
38# include "Ecore_DirectFB.h"
39#endif
40
41#if defined(BUILD_ECORE_EVAS_SOFTWARE_BUFFER) || defined(BUILD_ECORE_EVAS_EWS) 36#if defined(BUILD_ECORE_EVAS_SOFTWARE_BUFFER) || defined(BUILD_ECORE_EVAS_EWS)
42# include <Evas_Engine_Buffer.h> 37# include <Evas_Engine_Buffer.h>
43#endif 38#endif
@@ -242,11 +237,6 @@ struct _Ecore_Evas_Engine
242 void *data; 237 void *data;
243 } buffer; 238 } buffer;
244#endif 239#endif
245#ifdef BUILD_ECORE_EVAS_DIRECTFB
246 struct {
247 Ecore_DirectFB_Window *window;
248 } directfb;
249#endif
250#ifdef BUILD_ECORE_EVAS_WIN32 240#ifdef BUILD_ECORE_EVAS_WIN32
251 struct { 241 struct {
252 Ecore_Win32_Window *parent; 242 Ecore_Win32_Window *parent;
@@ -404,9 +394,6 @@ int _ecore_evas_fb_shutdown(void);
404int _ecore_evas_buffer_shutdown(void); 394int _ecore_evas_buffer_shutdown(void);
405int _ecore_evas_buffer_render(Ecore_Evas *ee); 395int _ecore_evas_buffer_render(Ecore_Evas *ee);
406#endif 396#endif
407#ifdef BUILD_ECORE_EVAS_DIRECTFB
408int _ecore_evas_directfb_shutdown(void);
409#endif
410#ifdef BUILD_ECORE_EVAS_WIN32 397#ifdef BUILD_ECORE_EVAS_WIN32
411int _ecore_evas_win32_shutdown(void); 398int _ecore_evas_win32_shutdown(void);
412#endif 399#endif