summaryrefslogtreecommitdiff
path: root/src/lib
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
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')
-rw-r--r--src/lib/ecore_directfb/Ecore_DirectFB.h181
-rw-r--r--src/lib/ecore_directfb/ecore_directfb.c758
-rw-r--r--src/lib/ecore_directfb/ecore_directfb_keys.h184
-rw-r--r--src/lib/ecore_directfb/ecore_directfb_private.h52
-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
-rw-r--r--src/lib/evas/Evas.h3
-rw-r--r--src/lib/evas/file/evas_module.c4
10 files changed, 7 insertions, 1808 deletions
diff --git a/src/lib/ecore_directfb/Ecore_DirectFB.h b/src/lib/ecore_directfb/Ecore_DirectFB.h
deleted file mode 100644
index 3b94816d96..0000000000
--- a/src/lib/ecore_directfb/Ecore_DirectFB.h
+++ /dev/null
@@ -1,181 +0,0 @@
1#ifndef _ECORE_DIRECTFB_H
2#define _ECORE_DIRECTFB_H
3
4#include <Eina.h>
5
6#include <directfb.h>
7
8#ifdef EAPI
9# undef EAPI
10#endif /* ifdef EAPI */
11
12#ifdef __GNUC__
13# if __GNUC__ >= 4
14# define EAPI __attribute__ ((visibility("default")))
15# else /* if __GNUC__ >= 4 */
16# define EAPI
17# endif /* if __GNUC__ >= 4 */
18#else /* ifdef __GNUC__ */
19# define EAPI
20#endif /* ifdef __GNUC__ */
21
22#ifdef __cplusplus
23extern "C" {
24#endif /* ifdef __cplusplus */
25
26EAPI extern int ECORE_DIRECTFB_EVENT_POSITION;
27EAPI extern int ECORE_DIRECTFB_EVENT_SIZE;
28EAPI extern int ECORE_DIRECTFB_EVENT_CLOSE;
29EAPI extern int ECORE_DIRECTFB_EVENT_DESTROYED;
30EAPI extern int ECORE_DIRECTFB_EVENT_GOT_FOCUS;
31EAPI extern int ECORE_DIRECTFB_EVENT_LOST_FOCUS;
32EAPI extern int ECORE_DIRECTFB_EVENT_KEY_DOWN;
33EAPI extern int ECORE_DIRECTFB_EVENT_KEY_UP;
34EAPI extern int ECORE_DIRECTFB_EVENT_BUTTON_DOWN;
35EAPI extern int ECORE_DIRECTFB_EVENT_BUTTON_UP;
36EAPI extern int ECORE_DIRECTFB_EVENT_MOTION;
37EAPI extern int ECORE_DIRECTFB_EVENT_ENTER;
38EAPI extern int ECORE_DIRECTFB_EVENT_LEAVE;
39EAPI extern int ECORE_DIRECTFB_EVENT_WHEEL;
40
41#ifndef _ECORE_DIRECTFB_WINDOW_PREDEF
42typedef struct _Ecore_DirectFB_Window Ecore_DirectFB_Window;
43#endif /* ifndef _ECORE_DIRECTFB_WINDOW_PREDEF */
44typedef struct _Ecore_DirectFB_Cursor Ecore_DirectFB_Cursor;
45
46typedef struct _Ecore_DirectFB_Event_Key_Down Ecore_DirectFB_Event_Key_Down;
47typedef struct _Ecore_DirectFB_Event_Key_Up Ecore_DirectFB_Event_Key_Up;
48typedef struct _Ecore_DirectFB_Event_Button_Down Ecore_DirectFB_Event_Button_Down;
49typedef struct _Ecore_DirectFB_Event_Button_Up Ecore_DirectFB_Event_Button_Up;
50typedef struct _Ecore_DirectFB_Event_Motion Ecore_DirectFB_Event_Motion;
51typedef struct _Ecore_DirectFB_Event_Enter Ecore_DirectFB_Event_Enter;
52typedef struct _Ecore_DirectFB_Event_Leave Ecore_DirectFB_Event_Leave;
53typedef struct _Ecore_DirectFB_Event_Wheel Ecore_DirectFB_Event_Wheel;
54typedef struct _Ecore_DirectFB_Event_Got_Focus Ecore_DirectFB_Event_Got_Focus;
55typedef struct _Ecore_DirectFB_Event_Lost_Focus Ecore_DirectFB_Event_Lost_Focus;
56
57/* this struct is to keep windows data (id, window itself and surface) in memory as every call
58 * to DirectFB for this values (e.g window->GetSurface(window,&surface)) will increment the
59 * reference count, then we will have to release N times the data, so better we just ask for
60 them once */
61struct _Ecore_DirectFB_Window
62{
63 DFBWindowID id;
64 IDirectFBWindow *window;
65 IDirectFBSurface *surface;
66 Ecore_DirectFB_Cursor *cursor;
67};
68
69struct _Ecore_DirectFB_Cursor
70{
71 IDirectFBSurface *surface;
72 int hot_x;
73 int hot_y;
74};
75
76struct _Ecore_DirectFB_Event_Key_Down /** DirectFB Key Down event */
77{
78 char *name; /**< The name of the key that was released */
79 char *string; /**< The logical symbol of the key that was pressed */
80 char *key_compose; /**< The UTF-8 string conversion if any */
81 unsigned int time;
82 DFBWindowID win;
83};
84
85struct _Ecore_DirectFB_Event_Key_Up /** DirectFB Key Up event */
86{
87 char *name; /**< The name of the key that was released */
88 char *string; /**< The logical symbol of the key that was pressed */
89 char *key_compose; /**< The UTF-8 string conversion if any */
90 unsigned int time;
91 DFBWindowID win;
92};
93
94struct _Ecore_DirectFB_Event_Button_Down
95{
96 int button;
97 int modifiers;
98 int x, y;
99 unsigned int time;
100 int double_click : 1;
101 int triple_click : 1;
102 DFBWindowID win;
103};
104struct _Ecore_DirectFB_Event_Button_Up
105{
106 int button;
107 int modifiers;
108 int x, y;
109 unsigned int time;
110 DFBWindowID win;
111 int double_click : 1;
112 int triple_click : 1;
113};
114struct _Ecore_DirectFB_Event_Motion
115{
116 int modifiers;
117 int x, y;
118 unsigned int time;
119 DFBWindowID win;
120};
121
122struct _Ecore_DirectFB_Event_Enter
123{
124 int modifiers;
125 int x, y;
126 unsigned int time;
127 DFBWindowID win;
128};
129
130struct _Ecore_DirectFB_Event_Leave
131{
132 int modifiers;
133 int x, y;
134 unsigned int time;
135 DFBWindowID win;
136};
137
138struct _Ecore_DirectFB_Event_Wheel
139{
140 int direction;
141 int z;
142 int modifiers;
143 unsigned int time;
144 DFBWindowID win;
145};
146
147struct _Ecore_DirectFB_Event_Got_Focus
148{
149 unsigned int time;
150 DFBWindowID win;
151};
152
153struct _Ecore_DirectFB_Event_Lost_Focus
154{
155 unsigned int time;
156 DFBWindowID win;
157};
158
159/* main functions */
160EAPI int ecore_directfb_init(const char *name);
161EAPI int ecore_directfb_shutdown(void);
162EAPI IDirectFB * ecore_directfb_interface_get(void);
163
164/* window operations */
165EAPI Ecore_DirectFB_Window *ecore_directfb_window_new(int x, int y, int w, int h);
166EAPI void ecore_directfb_window_free(Ecore_DirectFB_Window *window);
167EAPI void ecore_directfb_window_move(Ecore_DirectFB_Window *window, int x, int y);
168EAPI void ecore_directfb_window_resize(Ecore_DirectFB_Window *window, int w, int h);
169EAPI void ecore_directfb_window_focus(Ecore_DirectFB_Window *window);
170EAPI void ecore_directfb_window_show(Ecore_DirectFB_Window *window);
171EAPI void ecore_directfb_window_hide(Ecore_DirectFB_Window *window);
172EAPI void ecore_directfb_window_shaped_set(Ecore_DirectFB_Window *window, Eina_Bool set);
173EAPI void ecore_directfb_window_fullscreen_set(Ecore_DirectFB_Window *window, Eina_Bool set);
174EAPI void ecore_directfb_window_size_get(Ecore_DirectFB_Window *window, int *w, int *h);
175EAPI void ecore_directfb_window_cursor_show(Ecore_DirectFB_Window *window, Eina_Bool show);
176
177#ifdef __cplusplus
178}
179#endif /* ifdef __cplusplus */
180
181#endif /* ifndef _ECORE_DIRECTFB_H */
diff --git a/src/lib/ecore_directfb/ecore_directfb.c b/src/lib/ecore_directfb/ecore_directfb.c
deleted file mode 100644
index 008fa1d6f9..0000000000
--- a/src/lib/ecore_directfb/ecore_directfb.c
+++ /dev/null
@@ -1,758 +0,0 @@
1#ifdef HAVE_CONFIG_H
2# include <config.h>
3#endif /* ifdef HAVE_CONFIG_H */
4
5#include <stdio.h>
6#include <string.h>
7#include <unistd.h>
8
9#include "Ecore_DirectFB.h"
10#include "ecore_directfb_private.h"
11#include "ecore_directfb_keys.h"
12#include "Ecore.h"
13#include "ecore_private.h"
14
15/* ecore_directfb */
16/******************/
17/* About */
18/* with this you can create windows of directfb and handle events through ecore
19 * TODO:
20 * - handle all event types
21 * -
22 * */
23int _ecore_directfb_log_dom = -1;
24
25static int _ecore_directfb_init_count = 0;
26
27static int _window_event_fd = 0;
28static int _input_event_fd = 0;
29
30static int _ecore_directfb_fullscreen_window_id = 0;
31static int _cursor_x = 0;
32static int _cursor_y = 0;
33
34EAPI int ECORE_DIRECTFB_EVENT_POSITION = 0;
35EAPI int ECORE_DIRECTFB_EVENT_SIZE = 0;
36EAPI int ECORE_DIRECTFB_EVENT_CLOSE = 0;
37EAPI int ECORE_DIRECTFB_EVENT_DESTROYED = 0;
38EAPI int ECORE_DIRECTFB_EVENT_GOT_FOCUS = 0;
39EAPI int ECORE_DIRECTFB_EVENT_LOST_FOCUS = 0;
40EAPI int ECORE_DIRECTFB_EVENT_KEY_DOWN = 0;
41EAPI int ECORE_DIRECTFB_EVENT_KEY_UP = 0;
42EAPI int ECORE_DIRECTFB_EVENT_BUTTON_DOWN = 0;
43EAPI int ECORE_DIRECTFB_EVENT_BUTTON_UP = 0;
44EAPI int ECORE_DIRECTFB_EVENT_MOTION = 0;
45EAPI int ECORE_DIRECTFB_EVENT_ENTER = 0;
46EAPI int ECORE_DIRECTFB_EVENT_LEAVE = 0;
47EAPI int ECORE_DIRECTFB_EVENT_WHEEL = 0;
48
49static Ecore_Fd_Handler *_window_event_fd_handler_handle = NULL;
50static Ecore_Fd_Handler *_input_event_fd_handler_handle = NULL;
51
52/* this hash is to store all the possible key names for fast lookup */
53static Eina_Hash *_ecore_directfb_key_symbols_hash = NULL;
54
55static IDirectFB *_dfb = NULL; // the main interface
56static IDirectFBEventBuffer *_window_event; // the main event buffer (all windows are attached to this)
57static IDirectFBEventBuffer *_input_event; // the main event buffer (all windows are attached to this)
58static IDirectFBDisplayLayer *_layer; // the main layer
59static DFBResult _err; // useful for DFBCHECK
60
61/*******************/
62/* local functions */
63/*******************/
64
65/* free ecore directfb events functions */
66/****************************************/
67
68static void
69_ecore_directfb_event_free_key_down(void *data EINA_UNUSED, void *ev)
70{
71 Ecore_DirectFB_Event_Key_Down *e;
72
73 e = ev;
74 if(e->name)
75 free(e->name);
76
77 if (e->string)
78 free(e->string);
79
80 if (e->key_compose)
81 free(e->key_compose);
82
83 free(e);
84}
85
86static void
87_ecore_directfb_event_free_key_up(void *data EINA_UNUSED, void *ev)
88{
89 Ecore_DirectFB_Event_Key_Up *e;
90
91 e = ev;
92 if(e->name)
93 free(e->name);
94
95 if (e->string)
96 free(e->string);
97
98 if (e->key_compose)
99 free(e->key_compose);
100
101 free(e);
102}
103
104/* directfb window input events handler */
105/****************************************/
106
107static void
108_ecore_directfb_event_handle_motion(DFBEvent *evt)
109{
110 Ecore_DirectFB_Event_Motion *e;
111 e = calloc(1, sizeof(Ecore_DirectFB_Event_Motion));
112
113 switch(evt->clazz)
114 {
115 case DFEC_INPUT:
116 e->modifiers = 0;
117 switch(evt->input.axis)
118 {
119 case DIAI_X:
120 e->x = _cursor_x = evt->input.axisabs;
121 e->y = _cursor_y;
122 break;
123
124 case DIAI_Y:
125 e->y = _cursor_y = evt->input.axisabs;
126 e->x = _cursor_x;
127 break;
128
129 case DIAI_Z:
130 //_ecore_directfb_event_handle_wheel(evt);
131 return;
132
133 default:
134 return;
135 }
136 e->win = _ecore_directfb_fullscreen_window_id;
137 e->time = 0;
138 break;
139
140 case DFEC_WINDOW:
141 e->modifiers = 0;
142 e->x = evt->window.x;
143 e->y = evt->window.y;
144 e->win = evt->window.window_id;
145 e->time = 0;
146 break;
147
148 default:
149 break;
150 }
151 ecore_event_add(ECORE_DIRECTFB_EVENT_MOTION, e, NULL, NULL);
152}
153
154static void
155_ecore_directfb_event_handle_key_down(DFBEvent *evt)
156{
157 Ecore_DirectFB_Event_Key_Down *e;
158 unsigned int key_symbol;
159 struct keymap *k;
160
161 e = calloc(1, sizeof(Ecore_DirectFB_Event_Key_Down));
162
163 switch(evt->clazz)
164 {
165 case DFEC_INPUT:
166 key_symbol = evt->input.key_symbol;
167 k = eina_hash_find(_ecore_directfb_key_symbols_hash, &key_symbol);
168
169 if(!k)
170 {
171 ERR("Symbol %0X of class DFEC_INPUT not found.", evt->input.key_symbol);
172 return;
173 }
174
175 e->name = strdup(k->name);
176 e->string = strdup(k->string);
177 e->key_compose = NULL;
178 e->win = _ecore_directfb_fullscreen_window_id;
179 e->time = 0;
180 break;
181
182 case DFEC_WINDOW:
183 key_symbol = evt->window.key_symbol;
184 k = eina_hash_find(_ecore_directfb_key_symbols_hash, &key_symbol);
185
186 if(!k)
187 {
188 ERR("Symbol %0X of class DFEC_WINDOW not found.", evt->window.key_symbol);
189 return;
190 }
191
192 e->name = strdup(k->name);
193 e->string = strdup(k->string);
194 e->key_compose = NULL;
195 e->win = evt->window.window_id;
196 e->time = 0;
197 break;
198
199 default:
200 break;
201 }
202
203 ecore_event_add(ECORE_DIRECTFB_EVENT_KEY_DOWN, e, _ecore_directfb_event_free_key_down, NULL);
204}
205
206static void
207_ecore_directfb_event_handle_key_up(DFBEvent *evt)
208{
209 Ecore_DirectFB_Event_Key_Up *e;
210 unsigned int key_symbol;
211 struct keymap *k;
212
213 e = calloc(1, sizeof(Ecore_DirectFB_Event_Key_Up));
214
215 switch(evt->clazz)
216 {
217 case DFEC_INPUT:
218 key_symbol = evt->input.key_symbol;
219 k = eina_hash_find(_ecore_directfb_key_symbols_hash, &key_symbol);
220
221 if(!k)
222 {
223 ERR("Symbol %0X of class DFEC_INPUT not found.", evt->input.key_symbol);
224 return;
225 }
226
227 e->name = strdup(k->name);
228 e->string = strdup(k->string);
229 e->key_compose = NULL;
230 e->win = _ecore_directfb_fullscreen_window_id;
231 e->time = 0;
232 break;
233
234 case DFEC_WINDOW:
235 key_symbol = evt->window.key_symbol;
236 k = eina_hash_find(_ecore_directfb_key_symbols_hash, &key_symbol);
237
238 if(!k)
239 {
240 ERR("Symbol %0X of class DFEC_WINDOW not found.", evt->window.key_symbol);
241 return;
242 }
243
244 e->name = strdup(k->name);
245 e->string = strdup(k->string);
246 e->key_compose = NULL;
247 e->win = evt->window.window_id;
248 e->time = 0;
249 break;
250
251 default:
252 break;
253 }
254 ecore_event_add(ECORE_DIRECTFB_EVENT_KEY_UP, e, _ecore_directfb_event_free_key_up, NULL);
255}
256
257static void
258_ecore_directfb_event_handle_button_down(DFBEvent *evt)
259{
260 Ecore_DirectFB_Event_Button_Down *e;
261 e = calloc(1, sizeof(Ecore_DirectFB_Event_Button_Down));
262
263 switch(evt->clazz)
264 {
265 case DFEC_INPUT:
266 e->button = evt->input.button + 1;
267 e->modifiers = 0;
268 DFBCHECK(_layer->GetCursorPosition(_layer,&e->x,&e->y));
269 e->x = _cursor_x;
270 e->y = _cursor_y;
271 e->win = _ecore_directfb_fullscreen_window_id;
272 e->time = 0;
273
274 break;
275
276 case DFEC_WINDOW:
277 e->button = evt->window.button + 1;
278 e->modifiers = 0;
279 e->x = evt->window.x;
280 e->y = evt->window.y;
281 e->win = evt->window.window_id;
282 e->time = 0;
283 break;
284
285 default:
286 break;
287 }
288
289 ecore_event_add(ECORE_DIRECTFB_EVENT_BUTTON_DOWN, e, NULL, NULL);
290}
291
292static void
293_ecore_directfb_event_handle_button_up(DFBEvent *evt)
294{
295 Ecore_DirectFB_Event_Button_Up *e;
296 e = calloc(1, sizeof(Ecore_DirectFB_Event_Button_Up));
297
298 switch(evt->clazz)
299 {
300 case DFEC_INPUT:
301 e->button = evt->input.button + 1;
302 e->modifiers = 0;
303 e->x = _cursor_x;
304 e->y = _cursor_y;
305 e->win = _ecore_directfb_fullscreen_window_id;
306 e->time = 0;
307
308 break;
309
310 case DFEC_WINDOW:
311 e->button = evt->window.button + 1;
312 e->modifiers = 0;
313 e->x = evt->window.x;
314 e->y = evt->window.y;
315 e->win = evt->window.window_id;
316 e->time = 0;
317 break;
318
319 default:
320 break;
321 }
322 ecore_event_add(ECORE_DIRECTFB_EVENT_BUTTON_UP, e, NULL, NULL);
323}
324
325static void
326_ecore_directfb_event_handle_enter(DFBWindowEvent *evt)
327{
328 Ecore_DirectFB_Event_Enter *e;
329 e = calloc(1, sizeof(Ecore_DirectFB_Event_Enter));
330
331 e->modifiers = 0;
332 e->x = evt->x;
333 e->y = evt->y;
334 e->win = evt->window_id;
335 e->time = 0;
336
337 ecore_event_add(ECORE_DIRECTFB_EVENT_ENTER, e, NULL, NULL);
338}
339
340static void
341_ecore_directfb_event_handle_leave(DFBWindowEvent *evt)
342{
343 Ecore_DirectFB_Event_Leave *e;
344 e = calloc(1, sizeof(Ecore_DirectFB_Event_Leave));
345
346 e->modifiers = 0;
347 e->x = evt->x;
348 e->y = evt->y;
349 e->win = evt->window_id;
350 e->time = 0;
351
352 ecore_event_add(ECORE_DIRECTFB_EVENT_LEAVE, e, NULL, NULL);
353}
354
355static void
356_ecore_directfb_event_handle_wheel(DFBWindowEvent *evt)
357{
358 Ecore_DirectFB_Event_Wheel *e;
359 e = calloc(1, sizeof(Ecore_DirectFB_Event_Wheel));
360
361 // currently there's no direction (only up/down);
362 e->direction = 0;
363 e->z = evt->step;
364 e->modifiers = 0;
365 e->win = evt->window_id;
366 e->time = 0;
367
368 ecore_event_add(ECORE_DIRECTFB_EVENT_WHEEL, e, NULL, NULL);
369}
370
371static void
372_ecore_directfb_event_handle_got_focus(DFBWindowEvent *evt)
373{
374 Ecore_DirectFB_Event_Got_Focus *e;
375 e = calloc(1, sizeof(Ecore_DirectFB_Event_Got_Focus));
376
377 e->win = evt->window_id;
378 e->time = 0;
379
380 ecore_event_add(ECORE_DIRECTFB_EVENT_GOT_FOCUS, e, NULL, NULL);
381}
382
383static void
384_ecore_directfb_event_handle_lost_focus(DFBWindowEvent *evt)
385{
386 Ecore_DirectFB_Event_Lost_Focus *e;
387 e = calloc(1, sizeof(Ecore_DirectFB_Event_Lost_Focus));
388
389 e->win = evt->window_id;
390 e->time = 0;
391
392 ecore_event_add(ECORE_DIRECTFB_EVENT_LOST_FOCUS, e, NULL, NULL);
393}
394
395/* inputs and windows fds handlers */
396/***********************************/
397/* TODO fix this to handle windows and input events (fullscreen/window mode)
398 * in fullscreen theres no window_id so get the id from a global var (only one fullscreen
399 * window at a time */
400
401static Eina_Bool
402_ecore_directfb_input_event_fd_handler(void *data EINA_UNUSED,Ecore_Fd_Handler *fd_handler EINA_UNUSED)
403{
404 DFBEvent evt;
405 int v = 0;
406
407 v = read(_input_event_fd, &evt, sizeof(DFBEvent));
408 if (v < 0)
409 return EINA_TRUE;
410
411 if (v < 1)
412 return EINA_TRUE;
413
414 /* we are getting duplicate events, only parse if we are in fullscreen */
415 //if(_ecore_directfb_fullscreen_window_id == 0) break;
416 if(evt.input.type == DIET_KEYPRESS)
417 _ecore_directfb_event_handle_key_down(&evt);
418
419 if(evt.input.type == DIET_KEYRELEASE)
420 _ecore_directfb_event_handle_key_up(&evt);
421
422 if(evt.input.type == DIET_BUTTONPRESS)
423 _ecore_directfb_event_handle_button_down(&evt);
424
425 if(evt.input.type == DIET_BUTTONRELEASE)
426 _ecore_directfb_event_handle_button_up(&evt);
427
428 if(evt.input.type == DIET_AXISMOTION)
429 _ecore_directfb_event_handle_motion(&evt);
430
431 return EINA_TRUE;
432}
433
434static Eina_Bool
435_ecore_directfb_window_event_fd_handler(void *data EINA_UNUSED,Ecore_Fd_Handler *fd_handler EINA_UNUSED)
436{
437 DFBEvent evt;
438 int v = 0;
439
440 v = read(_window_event_fd, &evt, sizeof(DFBEvent));
441 if (v < 0)
442 return EINA_TRUE;
443
444 if (v < 1)
445 return EINA_TRUE;
446
447 if(evt.window.type & DWET_POSITION)
448 INF("position");
449
450 if(evt.window.type & DWET_SIZE)
451 INF("size");
452
453 if(evt.window.type & DWET_CLOSE)
454 INF("close");
455
456 if(evt.window.type & DWET_DESTROYED)
457 INF("destroyed");
458
459 if(evt.window.type & DWET_GOTFOCUS)
460 _ecore_directfb_event_handle_got_focus(&evt.window);
461
462 if(evt.window.type & DWET_LOSTFOCUS)
463 _ecore_directfb_event_handle_lost_focus(&evt.window);
464
465 if(evt.window.type & DWET_KEYDOWN)
466 _ecore_directfb_event_handle_key_down(&evt);
467
468 if(evt.window.type & DWET_KEYUP)
469 _ecore_directfb_event_handle_key_up(&evt);
470
471 if(evt.window.type & DWET_BUTTONDOWN)
472 _ecore_directfb_event_handle_button_down(&evt);
473
474 if(evt.window.type & DWET_BUTTONUP)
475 _ecore_directfb_event_handle_button_up(&evt);
476
477 if(evt.window.type & DWET_MOTION)
478 _ecore_directfb_event_handle_motion(&evt);
479
480 if(evt.window.type & DWET_ENTER)
481 _ecore_directfb_event_handle_enter(&evt.window);
482
483 if(evt.window.type & DWET_LEAVE)
484 _ecore_directfb_event_handle_leave(&evt.window);
485
486 if(evt.window.type & DWET_WHEEL)
487 _ecore_directfb_event_handle_wheel(&evt.window);
488
489 return EINA_TRUE;
490}
491
492/* api functions */
493/*****************/
494
495EAPI IDirectFB *
496ecore_directfb_interface_get(void)
497{
498 return _dfb;
499}
500
501EAPI Ecore_DirectFB_Window *
502ecore_directfb_window_new(int x, int y, int w, int h)
503{
504 Ecore_DirectFB_Window *window;
505 IDirectFBWindow *dfb_window;
506 IDirectFBSurface *dfb_surface = NULL;
507 DFBWindowDescription desc;
508 DFBWindowID id;
509
510 memset(&desc, 0, sizeof(DFBWindowDescription));
511 desc.flags = (DWDESC_POSX | DWDESC_POSY | DWDESC_WIDTH | DWDESC_HEIGHT | DWDESC_CAPS);
512 desc.posx = x;
513 desc.posy = y;
514 desc.width = w;
515 desc.height = h;
516 desc.caps = DWCAPS_ALPHACHANNEL;
517
518 DFBCHECK(_layer->CreateWindow(_layer, &desc, &dfb_window));
519
520 dfb_window->AttachEventBuffer(dfb_window, _window_event);
521 dfb_window->SetOptions(dfb_window,DWOP_NONE);
522 dfb_window->SetOpacity(dfb_window, 0xFF);
523
524 DFBCHECK(dfb_window->GetID(dfb_window, &id));
525 DFBCHECK(dfb_window->GetSurface(dfb_window,&dfb_surface));
526
527 window = malloc(sizeof(Ecore_DirectFB_Window));
528 window->id = id;
529 window->window = dfb_window;
530 window->surface = dfb_surface;
531 window->cursor = NULL;
532
533 return window;
534}
535
536EAPI void
537ecore_directfb_window_free(Ecore_DirectFB_Window *ecore_window)
538{
539 DFBCHECK(ecore_window->surface->Release(ecore_window->surface));
540 DFBCHECK(ecore_window->window->Release(ecore_window->window));
541 free(ecore_window);
542}
543
544EAPI void
545ecore_directfb_window_move(Ecore_DirectFB_Window *ecore_window, int x, int y)
546{
547 DFBCHECK(ecore_window->window->MoveTo(ecore_window->window, x, y));
548}
549
550EAPI void
551ecore_directfb_window_resize(Ecore_DirectFB_Window *ecore_window, int w, int h)
552{
553 DFBCHECK(ecore_window->window->Resize(ecore_window->window, w, h));
554}
555
556EAPI void
557ecore_directfb_window_focus(Ecore_DirectFB_Window *ecore_window)
558{
559 DFBCHECK(ecore_window->window->RequestFocus(ecore_window->window));
560}
561
562EAPI void
563ecore_directfb_window_hide(Ecore_DirectFB_Window *ecore_window)
564{
565 DFBCHECK(ecore_window->window->SetOpacity(ecore_window->window, 0));
566}
567
568EAPI void
569ecore_directfb_window_show(Ecore_DirectFB_Window *ecore_window)
570{
571 DFBCHECK(ecore_window->window->SetOpacity(ecore_window->window, 0xFF));
572}
573
574EAPI void
575ecore_directfb_window_shaped_set(Ecore_DirectFB_Window *ecore_window, Eina_Bool set)
576{
577 DFBWindowOptions opts;
578
579 DFBCHECK(ecore_window->window->GetOptions(ecore_window->window, &opts));
580 if(set)
581 {
582 opts |= DWOP_SHAPED;
583 opts |= DWOP_ALPHACHANNEL;
584 DFBCHECK(ecore_window->window->SetOptions(ecore_window->window, opts));
585 }
586 else
587 {
588 opts &= ~DWOP_SHAPED;
589 opts &= ~DWOP_ALPHACHANNEL;
590 DFBCHECK(ecore_window->window->SetOptions(ecore_window->window, opts));
591 }
592}
593
594EAPI void
595ecore_directfb_window_cursor_show(Ecore_DirectFB_Window *ecore_window, Eina_Bool show)
596{
597 if(!show)
598 {
599 /* create an empty cursor and set it */
600 IDirectFBSurface *cursor;
601 DFBSurfaceDescription desc;
602
603 memset(&desc, 0, sizeof(DFBSurfaceDescription));
604 desc.flags = (DSDESC_HEIGHT | DSDESC_WIDTH | DSDESC_PIXELFORMAT);
605 desc.width = 1;
606 desc.height = 1;
607 desc.pixelformat = DSPF_A1;
608
609 DFBCHECK(_dfb->CreateSurface(_dfb,&desc,&cursor));
610 DFBCHECK(cursor->Clear(cursor,0,0,0,0));
611 DFBCHECK(ecore_window->window->SetCursorShape(ecore_window->window, cursor, 0, 0));
612 }
613 else
614 {
615 /* we already have a cursor surface so set it*/
616 if(ecore_window->cursor)
617 {
618 DFBCHECK(ecore_window->window->SetCursorShape(ecore_window->window, ecore_window->cursor->surface, ecore_window->cursor->hot_x, ecore_window->cursor->hot_y));
619 }
620 /* or just set the default directfb cursor */
621 else
622 {
623 DFBCHECK(ecore_window->window->SetCursorShape(ecore_window->window, NULL, 0, 0));
624 }
625 }
626}
627
628EAPI void
629ecore_directfb_window_cursor_set(Ecore_DirectFB_Window *ecore_window, Ecore_DirectFB_Cursor *cursor)
630{
631 if((!cursor) && (ecore_window->cursor))
632 {
633 ecore_window->cursor = NULL;
634 DFBCHECK(ecore_window->window->SetCursorShape(ecore_window->window, NULL, 0, 0));
635 return;
636 }
637
638 if(cursor)
639 {
640 ecore_window->cursor = cursor;
641 DFBCHECK(ecore_window->window->SetCursorShape(ecore_window->window, cursor->surface, cursor->hot_x, cursor->hot_y));
642 }
643}
644
645EAPI void
646ecore_directfb_window_fullscreen_set(Ecore_DirectFB_Window *ecore_window, Eina_Bool on)
647{
648 // always release the surface (we are going to get a new one in both cases)
649 DFBCHECK(ecore_window->surface->Release(ecore_window->surface));
650 if(on)
651 {
652 DFBCHECK(_layer->SetCooperativeLevel(_layer,DLSCL_EXCLUSIVE));
653 DFBCHECK(_layer->GetSurface(_layer,&ecore_window->surface));
654 DFBCHECK(_dfb->CreateInputEventBuffer(_dfb, DICAPS_ALL, DFB_FALSE, &_input_event));
655 DFBCHECK(_input_event->CreateFileDescriptor(_input_event,&_input_event_fd));
656 /* the event of axismove sends one axis at a time, so we must store both */
657 DFBCHECK(_layer->GetCursorPosition(_layer,&_cursor_x,&_cursor_y));
658
659 _input_event_fd_handler_handle = ecore_main_fd_handler_add(_input_event_fd,ECORE_FD_READ,_ecore_directfb_input_event_fd_handler, NULL,NULL,NULL);
660 _ecore_directfb_fullscreen_window_id = ecore_window->id;
661 }
662 else
663 {
664 ecore_main_fd_handler_del(_input_event_fd_handler_handle);
665 DFBCHECK(_input_event->Release(_input_event));
666 DFBCHECK(_layer->SetCooperativeLevel(_layer,DLSCL_SHARED));
667 DFBCHECK(ecore_window->window->GetSurface(ecore_window->window, &ecore_window->surface));
668 _ecore_directfb_fullscreen_window_id = 0;
669 }
670}
671
672EAPI void
673ecore_directfb_window_size_get(Ecore_DirectFB_Window *ecore_window, int *w, int *h)
674{
675 DFBCHECK(ecore_window->surface->GetSize(ecore_window->surface,w,h));
676 return;
677}
678
679EAPI int
680ecore_directfb_init(const char *name EINA_UNUSED)
681{
682 int i = 0;
683
684 if (++_ecore_directfb_init_count != 1)
685 return _ecore_directfb_init_count;
686
687 _ecore_directfb_log_dom = eina_log_domain_register
688 ("ecore_directfb", ECORE_DIRECTFB_DEFAULT_LOG_COLOR);
689 if(_ecore_directfb_log_dom < 0)
690 {
691 EINA_LOG_ERR("Impossible to create a log domain for the Ecore directFB module.");
692 return _ecore_directfb_init_count--;
693 }
694
695 DFBCHECK(DirectFBInit(NULL,NULL));
696 DFBCHECK(DirectFBCreate(&_dfb));
697
698 DFBCHECK(_dfb->GetDisplayLayer(_dfb, DLID_PRIMARY, &_layer));
699 DFBCHECK(_layer->SetCooperativeLevel(_layer, DLSCL_SHARED));
700
701 /* window events and fd */
702 DFBCHECK(_dfb->CreateEventBuffer(_dfb, &_window_event));
703 DFBCHECK(_window_event->CreateFileDescriptor(_window_event,&_window_event_fd));
704 _window_event_fd_handler_handle = ecore_main_fd_handler_add(_window_event_fd,ECORE_FD_READ,_ecore_directfb_window_event_fd_handler, NULL,NULL,NULL);
705
706 /* register ecore directfb events */
707 ECORE_DIRECTFB_EVENT_POSITION = ecore_event_type_new();
708 ECORE_DIRECTFB_EVENT_SIZE = ecore_event_type_new();
709 ECORE_DIRECTFB_EVENT_CLOSE = ecore_event_type_new();
710 ECORE_DIRECTFB_EVENT_DESTROYED = ecore_event_type_new();
711 ECORE_DIRECTFB_EVENT_GOT_FOCUS = ecore_event_type_new();
712 ECORE_DIRECTFB_EVENT_LOST_FOCUS = ecore_event_type_new();
713 ECORE_DIRECTFB_EVENT_KEY_DOWN = ecore_event_type_new();
714 ECORE_DIRECTFB_EVENT_KEY_UP = ecore_event_type_new();
715 ECORE_DIRECTFB_EVENT_BUTTON_DOWN = ecore_event_type_new();
716 ECORE_DIRECTFB_EVENT_BUTTON_UP = ecore_event_type_new();
717 ECORE_DIRECTFB_EVENT_MOTION = ecore_event_type_new();
718 ECORE_DIRECTFB_EVENT_ENTER = ecore_event_type_new();
719 ECORE_DIRECTFB_EVENT_LEAVE = ecore_event_type_new();
720 ECORE_DIRECTFB_EVENT_WHEEL = ecore_event_type_new();
721
722 /* create the hash table for the keynames */
723 _ecore_directfb_key_symbols_hash = eina_hash_int32_new(free);
724 for(i = 0; i < _ecore_directfb_key_symbols_count; i++)
725 {
726 struct keymap *k;
727 k = malloc(sizeof(struct keymap));
728 k->name = _ecore_directfb_key_symbols[i].name;
729 k->string = _ecore_directfb_key_symbols[i].string;
730 eina_hash_add(_ecore_directfb_key_symbols_hash, &_ecore_directfb_key_symbols[i].id, k);
731 }
732 /* create the hash for the windows(key = windowid, val = Ecore_DirectFB_Window struct) */
733 return _ecore_directfb_init_count;
734}
735
736EAPI int
737ecore_directfb_shutdown(void)
738{
739 if (--_ecore_directfb_init_count != 0)
740 return _ecore_directfb_init_count;
741
742 ecore_main_fd_handler_del(_window_event_fd_handler_handle);
743 eina_hash_free(_ecore_directfb_key_symbols_hash);
744
745 if(_ecore_directfb_fullscreen_window_id)
746 {
747 DFBCHECK(_input_event->Release(_input_event));
748 ecore_main_fd_handler_del(_input_event_fd_handler_handle);
749 }
750
751 DFBCHECK(_window_event->Release(_window_event));
752 DFBCHECK(_layer->Release(_layer));
753 DFBCHECK(_dfb->Release(_dfb));
754 eina_log_domain_unregister(_ecore_directfb_log_dom);
755 _ecore_directfb_log_dom = -1;
756 return _ecore_directfb_init_count;
757}
758
diff --git a/src/lib/ecore_directfb/ecore_directfb_keys.h b/src/lib/ecore_directfb/ecore_directfb_keys.h
deleted file mode 100644
index 19cca46e57..0000000000
--- a/src/lib/ecore_directfb/ecore_directfb_keys.h
+++ /dev/null
@@ -1,184 +0,0 @@
1typedef struct _Ecore_DirectFB_Key_Symbols Ecore_DirectFB_Key_Symbols;
2struct _Ecore_DirectFB_Key_Symbols
3{
4 char *string;
5 char *name;
6 unsigned int id;
7};
8
9static const Ecore_DirectFB_Key_Symbols _ecore_directfb_key_symbols[] = {
10 {"\010", "BackSpace",DIKS_BACKSPACE},
11 {"\011", "Tab", DIKS_TAB},
12 {"\015", "Return", DIKS_RETURN},
13 {"", "Cancel", DIKS_CANCEL},
14 {"", "Escape", DIKS_ESCAPE},
15 {" ", "space", DIKS_SPACE},
16 {"!", "exclam", DIKS_EXCLAMATION_MARK},
17 {"\"", "quotedbl", DIKS_QUOTATION},
18 {"#", "numbersign", DIKS_NUMBER_SIGN},
19 {"$", "dollar", DIKS_DOLLAR_SIGN},
20 {"%", "percent", DIKS_PERCENT_SIGN},
21 {"&", "ampersand", DIKS_AMPERSAND},
22 {"'", "apostrophe", DIKS_APOSTROPHE},
23 {"(", "parenleft", DIKS_PARENTHESIS_LEFT},
24 {")", "parenright", DIKS_PARENTHESIS_RIGHT},
25 {"*", "asterisk", DIKS_ASTERISK},
26 {"+", "plus", DIKS_PLUS_SIGN},
27 {",", "comma", DIKS_COMMA},
28 {"-", "minus", DIKS_MINUS_SIGN},
29 {".", "period", DIKS_PERIOD},
30 {"/", "slash", DIKS_SLASH},
31 {"0", "0", DIKS_0},
32 {"1", "1", DIKS_1},
33 {"2", "2", DIKS_2},
34 {"3", "3", DIKS_3},
35 {"4", "4", DIKS_4},
36 {"5", "5", DIKS_5},
37 {"6", "6", DIKS_6},
38 {"7", "7", DIKS_7},
39 {"8", "8", DIKS_8},
40 {"9", "9", DIKS_9},
41 {":", "colon", DIKS_COLON},
42 {";", "semicolon", DIKS_SEMICOLON},
43 {"<", "less", DIKS_LESS_THAN_SIGN},
44 {"=", "equal", DIKS_EQUALS_SIGN},
45 {">", "greater", DIKS_GREATER_THAN_SIGN},
46 {"?", "question", DIKS_QUESTION_MARK},
47 {"@", "at", DIKS_AT},
48 {"A", "A", DIKS_CAPITAL_A },
49 {"B", "B", DIKS_CAPITAL_B },
50 {"C", "C", DIKS_CAPITAL_C },
51 {"D", "D", DIKS_CAPITAL_D },
52 {"E", "E", DIKS_CAPITAL_E },
53 {"F", "F", DIKS_CAPITAL_F },
54 {"G", "G", DIKS_CAPITAL_G },
55 {"H", "H", DIKS_CAPITAL_H },
56 {"I", "I", DIKS_CAPITAL_I },
57 {"J", "J", DIKS_CAPITAL_J },
58 {"K", "K", DIKS_CAPITAL_K },
59 {"L", "L", DIKS_CAPITAL_L },
60 {"M", "M", DIKS_CAPITAL_M },
61 {"N", "N", DIKS_CAPITAL_N },
62 {"O", "O", DIKS_CAPITAL_O },
63 {"P", "P", DIKS_CAPITAL_P },
64 {"Q", "Q", DIKS_CAPITAL_Q },
65 {"R", "R", DIKS_CAPITAL_R },
66 {"S", "S", DIKS_CAPITAL_S },
67 {"T", "T", DIKS_CAPITAL_T },
68 {"U", "U", DIKS_CAPITAL_U },
69 {"V", "V", DIKS_CAPITAL_V },
70 {"W", "W", DIKS_CAPITAL_W },
71 {"X", "X", DIKS_CAPITAL_X },
72 {"Y", "Y", DIKS_CAPITAL_Y },
73 {"Z", "Z", DIKS_CAPITAL_Z },
74 {"[", "bracketleft", DIKS_SQUARE_BRACKET_LEFT },
75 {"\\", "backslash", DIKS_BACKSLASH },
76 {"]", "bracketright", DIKS_SQUARE_BRACKET_RIGHT },
77 {"^", "asciicircum", DIKS_CIRCUMFLEX_ACCENT },
78 {"_", "underscore", DIKS_UNDERSCORE },
79 {"`", "grave", DIKS_GRAVE_ACCENT},
80 {"a", "a", DIKS_SMALL_A },
81 {"b","b", DIKS_SMALL_B },
82 {"c","c", DIKS_SMALL_C },
83 {"d","d", DIKS_SMALL_D },
84 {"e","e", DIKS_SMALL_E },
85 {"f","f", DIKS_SMALL_F },
86 {"g","g", DIKS_SMALL_G },
87 {"h","h", DIKS_SMALL_H },
88 {"i","i", DIKS_SMALL_I },
89 {"j","j", DIKS_SMALL_J },
90 {"k","k", DIKS_SMALL_K },
91 {"l","l", DIKS_SMALL_L },
92 {"m","m", DIKS_SMALL_M },
93 {"n","n", DIKS_SMALL_N },
94 {"o", "o", DIKS_SMALL_O },
95 {"p", "p", DIKS_SMALL_P },
96 {"q", "q", DIKS_SMALL_Q },
97 {"r", "r", DIKS_SMALL_R },
98 {"s", "s", DIKS_SMALL_S },
99 {"t", "t", DIKS_SMALL_T },
100 {"u", "u", DIKS_SMALL_U },
101 {"v", "v", DIKS_SMALL_V },
102 {"w", "w", DIKS_SMALL_W },
103 {"x", "x", DIKS_SMALL_X },
104 {"y", "y", DIKS_SMALL_Y },
105 {"z", "z", DIKS_SMALL_Z },
106 {"{", "braceleft",DIKS_CURLY_BRACKET_LEFT },
107 {"|", "bar", DIKS_VERTICAL_BAR },
108 {"}", "braceright", DIKS_CURLY_BRACKET_RIGHT },
109 {"~", "asciitilde", DIKS_TILDE },
110 {"\177", "Delete", DIKS_DELETE },
111 {"", "Left", DIKS_CURSOR_LEFT },
112 {"", "Right", DIKS_CURSOR_RIGHT},
113 {"", "Up", DIKS_CURSOR_UP},
114 {"", "Down", DIKS_CURSOR_DOWN},
115 {"", "Insert", DIKS_INSERT},
116 {"", "Home", DIKS_HOME},
117 {"", "End", DIKS_END},
118 {"", "Page_Up", DIKS_PAGE_UP},
119 {"", "Page_Down", DIKS_PAGE_DOWN},
120 {"", "Print", DIKS_PRINT},
121 {"", "Pause", DIKS_PAUSE},
122 /* ok */
123 {"", "Select",DIKS_SELECT},
124 /* goto */
125 {"", "Clear", DIKS_CLEAR},
126 /* power */
127 /* power 2 */
128 /* option */
129 {"", "Menu",DIKS_MENU},
130 {"", "Help",DIKS_HELP},
131 /* info */
132 /* time */
133 /* vendor */
134 /* archive */
135 /* program */
136 /* channel */
137 /* favorites */
138 /* hasta next */
139 {"", "Next",DIKS_NEXT},
140 {"", "Begin",DIKS_BEGIN},
141 /* digits */
142 /* teen */
143 /* twen */
144 {"", "Break", DIKS_BREAK},
145 /* exit */
146 /* setup */
147 {"", "upleftcorner", DIKS_CURSOR_LEFT_UP },
148 {"", "lowleftcorner", DIKS_CURSOR_LEFT_DOWN },
149 {"", "uprightcorner", DIKS_CURSOR_UP_RIGHT },
150 {"", "lowrightcorner",DIKS_CURSOR_DOWN_RIGHT },
151 {"", "F1",DIKS_F1},
152 {"", "F2",DIKS_F2},
153 {"", "F3",DIKS_F3},
154 {"", "F4",DIKS_F4},
155 {"", "F5",DIKS_F5},
156 {"", "F6",DIKS_F6},
157 {"", "F7",DIKS_F7},
158 {"", "F8",DIKS_F8},
159 {"", "F9",DIKS_F9},
160 {"", "F10",DIKS_F10},
161 {"", "F11",DIKS_F11},
162 {"", "F12",DIKS_F12},
163 /* this are only mapped to one, not left right */
164 {"", "Shift_L", DIKS_SHIFT},
165 /*{"Shift_R",0xFFE2},*/
166 {"", "Control_L", DIKS_CONTROL},
167 /*{"Control_R",0xFFE4},*/
168 {"", "Meta_L", DIKS_META},
169 /* {"Meta_R",0xFFE8},*/
170 {"", "Alt_L", DIKS_ALT},
171 {"", "Alt_R", DIKS_ALTGR},
172 {"", "Super_L", DIKS_SUPER},
173 /*{"Super_R",0xFFEC},*/
174 {"", "Hyper_L", DIKS_HYPER},
175 /*{"Hyper_R",0xFFEE},*/
176
177 {"", "Caps_Lock", DIKS_CAPS_LOCK},
178 {"", "Num_Lock", DIKS_NUM_LOCK},
179 {"", "Scroll_Lock", DIKS_SCROLL_LOCK},
180 /* not included the dead keys */
181 /* not included the custom keys */
182 {"", "VoidSymbol", DIKS_NULL}
183};
184static int _ecore_directfb_key_symbols_count = sizeof(_ecore_directfb_key_symbols) / sizeof(Ecore_DirectFB_Key_Symbols);
diff --git a/src/lib/ecore_directfb/ecore_directfb_private.h b/src/lib/ecore_directfb/ecore_directfb_private.h
deleted file mode 100644
index ed34587ab5..0000000000
--- a/src/lib/ecore_directfb/ecore_directfb_private.h
+++ /dev/null
@@ -1,52 +0,0 @@
1#ifndef _ECORE_DIRECTFB_PRIVATE_H
2#define _ECORE_DIRECTFB_PRIVATE_H
3/* eina_log related things */
4
5extern int _ecore_directfb_log_dom;
6
7#ifdef ECORE_DIRECTFB_DEFAULT_LOG_COLOR
8#undef ECORE_DIRECTFB_DEFAULT_LOG_COLOR
9#endif /* ifdef ECORE_DIRECTFB_DEFAULT_LOG_COLOR */
10#define ECORE_DIRECTFB_DEFAULT_LOG_COLOR EINA_COLOR_BLUE
11
12#ifdef ERR
13# undef ERR
14#endif /* ifdef ERR */
15#define ERR(...) EINA_LOG_DOM_ERR(_ecore_directfb_log_dom, __VA_ARGS__)
16
17#ifdef DBG
18# undef DBG
19#endif /* ifdef DBG */
20#define DBG(...) EINA_LOG_DOM_DBG(_ecore_directfb_log_dom, __VA_ARGS__)
21
22#ifdef INF
23# undef INF
24#endif /* ifdef INF */
25#define INF(...) EINA_LOG_DOM_INFO(_ecore_directfb_log_dom, __VA_ARGS__)
26
27#ifdef WRN
28# undef WRN
29#endif /* ifdef WRN */
30#define WRN(...) EINA_LOG_DOM_WARN(_ecore_directfb_log_dom, __VA_ARGS__)
31
32#ifdef CRIT
33# undef CRIT
34#endif /* ifdef CRIT */
35#define CRIT(...) EINA_LOG_DOM_CRIT(_ecore_directfb_log_dom, __VA_ARGS__)
36
37/* macro for a safe call to DirectFB functions */
38#define DFBCHECK(x ...)\
39 {\
40 _err = x;\
41 if (_err != DFB_OK) {\
42 CRIT("%s <%d>:\n\t", __FILE__, __LINE__ );\
43 DirectFBErrorFatal( # x, _err );\
44 }\
45 }
46
47struct keymap
48{
49 char *name;
50 char *string;
51};
52#endif /* ifndef _ECORE_DIRECTFB_PRIVATE_H */
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
diff --git a/src/lib/evas/Evas.h b/src/lib/evas/Evas.h
index acd28866e4..8c30a1dde6 100644
--- a/src/lib/evas/Evas.h
+++ b/src/lib/evas/Evas.h
@@ -8639,8 +8639,7 @@ EAPI void evas_object_image_data_set(Evas_Object *obj,
8639 * Each time you call this function on an image object, its data 8639 * Each time you call this function on an image object, its data
8640 * buffer will have an internal reference counter 8640 * buffer will have an internal reference counter
8641 * incremented. Decrement it back by using 8641 * incremented. Decrement it back by using
8642 * evas_object_image_data_set(). This is specially important for the 8642 * evas_object_image_data_set().
8643 * directfb Evas engine.
8644 * 8643 *
8645 * This is best suited for when you want to modify an existing image, 8644 * This is best suited for when you want to modify an existing image,
8646 * without changing its dimensions. 8645 * without changing its dimensions.
diff --git a/src/lib/evas/file/evas_module.c b/src/lib/evas/file/evas_module.c
index 8c693ad2d9..cae88d8818 100644
--- a/src/lib/evas/file/evas_module.c
+++ b/src/lib/evas/file/evas_module.c
@@ -93,7 +93,6 @@ evas_module_paths_init(void)
93 { evas_##Tn##_##Name##_init, evas_##Tn##_##Name##_shutdown } 93 { evas_##Tn##_##Name##_init, evas_##Tn##_##Name##_shutdown }
94 94
95EVAS_EINA_STATIC_MODULE_DEFINE(engine, buffer); 95EVAS_EINA_STATIC_MODULE_DEFINE(engine, buffer);
96EVAS_EINA_STATIC_MODULE_DEFINE(engine, directfb);
97EVAS_EINA_STATIC_MODULE_DEFINE(engine, fb); 96EVAS_EINA_STATIC_MODULE_DEFINE(engine, fb);
98EVAS_EINA_STATIC_MODULE_DEFINE(engine, gl_x11); 97EVAS_EINA_STATIC_MODULE_DEFINE(engine, gl_x11);
99EVAS_EINA_STATIC_MODULE_DEFINE(engine, gl_sdl); 98EVAS_EINA_STATIC_MODULE_DEFINE(engine, gl_sdl);
@@ -131,9 +130,6 @@ static const struct {
131#ifdef EVAS_STATIC_BUILD_BUFFER 130#ifdef EVAS_STATIC_BUILD_BUFFER
132 EVAS_EINA_STATIC_MODULE_USE(engine, buffer), 131 EVAS_EINA_STATIC_MODULE_USE(engine, buffer),
133#endif 132#endif
134#ifdef EVAS_STATIC_BUILD_DIRECTFB
135 EVAS_EINA_STATIC_MODULE_USE(engine, directfb),
136#endif
137#ifdef EVAS_STATIC_BUILD_FB 133#ifdef EVAS_STATIC_BUILD_FB
138 EVAS_EINA_STATIC_MODULE_USE(engine, fb), 134 EVAS_EINA_STATIC_MODULE_USE(engine, fb),
139#endif 135#endif