2009-01-31 10:33:39 -08:00
|
|
|
#ifdef HAVE_CONFIG_H
|
2009-01-31 10:56:17 -08:00
|
|
|
# include <config.h>
|
2009-01-31 10:33:39 -08:00
|
|
|
#endif
|
|
|
|
|
2011-12-06 14:33:01 -08:00
|
|
|
#include <stdlib.h>
|
2009-01-31 10:33:39 -08:00
|
|
|
#include <sys/types.h>
|
|
|
|
#include <dirent.h>
|
|
|
|
|
2013-03-11 13:11:44 -07:00
|
|
|
#include <Eina.h>
|
2009-04-14 13:04:16 -07:00
|
|
|
#include <Ecore.h>
|
2013-03-11 13:11:44 -07:00
|
|
|
#include "ecore_private.h"
|
|
|
|
#include <Ecore_Input.h>
|
|
|
|
#include <Ecore_Input_Evas.h>
|
2009-04-14 13:04:16 -07:00
|
|
|
#include <Ecore_Fb.h>
|
2013-03-11 13:11:44 -07:00
|
|
|
#include "ecore_fb_private.h"
|
2003-09-23 01:09:32 -07:00
|
|
|
|
2013-03-11 13:11:44 -07:00
|
|
|
#include <Ecore_Evas.h>
|
|
|
|
#include "ecore_evas_private.h"
|
2013-03-12 07:17:00 -07:00
|
|
|
#include <Evas_Engine_FB.h>
|
2009-03-16 09:24:43 -07:00
|
|
|
|
2003-09-23 01:09:32 -07:00
|
|
|
static int _ecore_evas_init_count = 0;
|
|
|
|
|
2006-08-02 14:41:11 -07:00
|
|
|
static char *ecore_evas_default_display = "0";
|
* estickies,
* etk,
* PROTO/exalt,
* E-MODULES-EXTRA/diskio,
* E-MODULES-EXTRA/drawer,
* E-MODULES-EXTRA/penguins,
* E-MODULES-EXTRA/slideshow,
* E-MODULES-EXTRA/mail,
* E-MODULES-EXTRA/forecasts,
* E-MODULES-EXTRA/iiirk,
* E-MODULES-EXTRA/places,
* e,
* ewl,
* ecore,
* elitaire,
* entrance,
* e_dbus,
* efreet: Here we go, move from Ecore_List to Eina_List.
NOTE: This patch is huge, I did test it a lot, and I hope nothing is
broken. But if you think something change after this commit, please
contact me ASAP.
SVN revision: 39200
2009-02-25 03:03:47 -08:00
|
|
|
static Eina_List *ecore_evas_input_devices = NULL;
|
2011-10-27 12:29:08 -07:00
|
|
|
static Ecore_Event_Handler *ecore_evas_event_handlers[4] = {NULL, NULL, NULL, NULL};
|
2003-09-23 01:09:32 -07:00
|
|
|
|
2012-12-05 13:15:42 -08:00
|
|
|
typedef struct _Ecore_Evas_Engine_FB_Data Ecore_Evas_Engine_FB_Data;
|
|
|
|
|
|
|
|
struct _Ecore_Evas_Engine_FB_Data {
|
|
|
|
int real_w;
|
|
|
|
int real_h;
|
|
|
|
};
|
|
|
|
|
2003-09-23 01:09:32 -07:00
|
|
|
static void
|
2011-10-27 12:29:08 -07:00
|
|
|
_ecore_evas_mouse_move_process_fb(Ecore_Evas *ee, int x, int y)
|
2003-09-23 01:09:32 -07:00
|
|
|
{
|
|
|
|
int fbw, fbh;
|
2009-03-19 00:59:59 -07:00
|
|
|
|
2003-09-23 01:09:32 -07:00
|
|
|
ee->mouse.x = x;
|
|
|
|
ee->mouse.y = y;
|
|
|
|
ecore_fb_size_get(&fbw, &fbh);
|
|
|
|
if (ee->prop.cursor.object)
|
|
|
|
{
|
2010-09-29 10:03:38 -07:00
|
|
|
evas_object_show(ee->prop.cursor.object);
|
2003-09-23 01:09:32 -07:00
|
|
|
if (ee->rotation == 0)
|
2010-09-29 10:03:38 -07:00
|
|
|
evas_object_move(ee->prop.cursor.object,
|
|
|
|
x - ee->prop.cursor.hot.x,
|
|
|
|
y - ee->prop.cursor.hot.y);
|
|
|
|
else if (ee->rotation == 90)
|
|
|
|
evas_object_move(ee->prop.cursor.object,
|
|
|
|
(fbh - ee->h) + ee->h - y - 1 - ee->prop.cursor.hot.x,
|
|
|
|
x - ee->prop.cursor.hot.y);
|
|
|
|
else if (ee->rotation == 180)
|
|
|
|
evas_object_move(ee->prop.cursor.object,
|
|
|
|
(fbw - ee->w) + ee->w - x - 1 - ee->prop.cursor.hot.x,
|
|
|
|
(fbh - ee->h) + ee->h - y - 1 - ee->prop.cursor.hot.y);
|
|
|
|
else if (ee->rotation == 270)
|
|
|
|
evas_object_move(ee->prop.cursor.object,
|
|
|
|
y - ee->prop.cursor.hot.x,
|
|
|
|
(fbw - ee->w) + ee->w - x - 1 - ee->prop.cursor.hot.y);
|
2003-09-23 01:09:32 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-12-05 13:15:42 -08:00
|
|
|
_ecore_evas_fb_lose(void *data)
|
2003-09-23 01:09:32 -07:00
|
|
|
{
|
2012-12-05 13:15:42 -08:00
|
|
|
Ecore_Evas *ee = data;
|
* estickies,
* etk,
* PROTO/exalt,
* E-MODULES-EXTRA/diskio,
* E-MODULES-EXTRA/drawer,
* E-MODULES-EXTRA/penguins,
* E-MODULES-EXTRA/slideshow,
* E-MODULES-EXTRA/mail,
* E-MODULES-EXTRA/forecasts,
* E-MODULES-EXTRA/iiirk,
* E-MODULES-EXTRA/places,
* e,
* ewl,
* ecore,
* elitaire,
* entrance,
* e_dbus,
* efreet: Here we go, move from Ecore_List to Eina_List.
NOTE: This patch is huge, I did test it a lot, and I hope nothing is
broken. But if you think something change after this commit, please
contact me ASAP.
SVN revision: 39200
2009-02-25 03:03:47 -08:00
|
|
|
Eina_List *ll;
|
2006-08-02 14:41:11 -07:00
|
|
|
Ecore_Fb_Input_Device *dev;
|
2003-09-23 01:09:32 -07:00
|
|
|
|
2012-12-05 13:15:42 -08:00
|
|
|
if (ee) ee->visible = 0;
|
2009-04-19 08:47:32 -07:00
|
|
|
|
|
|
|
EINA_LIST_FOREACH(ecore_evas_input_devices, ll, dev)
|
|
|
|
ecore_fb_input_device_listen(dev, 0);
|
2003-09-23 01:09:32 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-12-05 13:15:42 -08:00
|
|
|
_ecore_evas_fb_gain(void *data)
|
2003-09-23 01:09:32 -07:00
|
|
|
{
|
2012-12-05 13:15:42 -08:00
|
|
|
Ecore_Evas *ee = data;
|
2009-02-25 23:33:55 -08:00
|
|
|
Eina_List *ll;
|
2006-08-02 14:41:11 -07:00
|
|
|
Ecore_Fb_Input_Device *dev;
|
2003-09-23 01:09:32 -07:00
|
|
|
|
2012-12-05 13:15:42 -08:00
|
|
|
if (ee)
|
2003-09-23 01:09:32 -07:00
|
|
|
{
|
2010-09-29 10:03:38 -07:00
|
|
|
ee->visible = 1;
|
2014-01-18 05:26:10 -08:00
|
|
|
if (ECORE_EVAS_PORTRAIT(ee))
|
2010-09-29 10:03:38 -07:00
|
|
|
evas_damage_rectangle_add(ee->evas, 0, 0, ee->w, ee->h);
|
2014-01-18 05:26:10 -08:00
|
|
|
else
|
|
|
|
evas_damage_rectangle_add(ee->evas, 0, 0, ee->h, ee->w);
|
2003-09-23 01:09:32 -07:00
|
|
|
}
|
2009-04-19 08:47:32 -07:00
|
|
|
|
|
|
|
EINA_LIST_FOREACH(ecore_evas_input_devices, ll, dev)
|
|
|
|
ecore_fb_input_device_listen(dev, 1);
|
2003-09-23 01:09:32 -07:00
|
|
|
}
|
|
|
|
|
Fix callback signatures
The change from returning int to Eina_Bool left several call sites with
warnings because they were not updated. Here they are fixed by using
Coccinelle, a tool that allows us to automate tasks like that. This
commit was generated from the following semantic patch:
virtual org
@r1@
identifier fn!=NULL, fn2;
expression E1, E2, E3;
@@
(
ecore_event_handler_add(E1, fn, ...)
|
ecore_event_filter_add(E1, fn, ...)
|
ecore_idler_add(fn, ...)
|
ecore_idle_enterer_add(E1, fn, ...)
|
ecore_idle_enterer_before_add(E1, fn, ...)
|
ecore_idle_exiter_add(E1, fn, ...)
|
ecore_main_fd_handler_add(E1, E2, fn, E3, fn2, ...)
|
ecore_main_win32_handler_add(E1, fn, ...)
|
ecore_timer_add(E1, fn, ...)
|
ecore_timer_loop_add(E1, fn, ...)
|
ecore_animator_add(fn, ...)
|
ecore_poller_add(E1, E2, fn, ...)
)
@r2@
identifier r1.fn;
identifier ret;
typedef Eina_Bool;
position p;
@@
- int
+ Eina_Bool
fn@p(...) {
<...
(
- return 1;
+ return EINA_TRUE;
|
- return 0;
+ return EINA_FALSE;
|
- int
+ Eina_Bool
ret;
...
return <+...ret...+>;
|
return ...;
)
...>
}
@r3@
identifier r1.fn2;
identifier ret;
position p;
@@
- int
+ Eina_Bool
fn2@p(...) {
...
(
- return 1;
+ return EINA_TRUE;
|
- return 0;
+ return EINA_FALSE;
|
- int
+ Eina_Bool
ret;
...
return <+...ret...+>;
|
return ...;
)
...
}
@r4@
identifier r1.fn;
@@
- int
+ Eina_Bool
fn(...);
@r5@
identifier r1.fn2;
@@
- int
+ Eina_Bool
fn2(...);
@script:python depends on org@
p << r2.p;
f << r1.fn;
@@
import sys
msg="WARNING: wrong callback %s! ( %s:%s )" % (f, p[0].file,p[0].line)
print >> sys.stderr, msg
@script:python depends on org@
p << r3.p;
f << r1.fn2;
@@
import sys
msg="WARNING: wrong callback %s! ( %s:%s )" % (f, p[0].file,p[0].line)
print >> sys.stderr, msg
SVN revision: 49985
2010-07-01 18:38:05 -07:00
|
|
|
static Eina_Bool
|
2012-12-05 13:15:42 -08:00
|
|
|
_ecore_evas_event_mouse_button_down(void *data, int type EINA_UNUSED, void *event)
|
2003-09-23 01:09:32 -07:00
|
|
|
{
|
2012-12-05 13:15:42 -08:00
|
|
|
Ecore_Evas *ee = data;
|
2011-10-27 12:29:08 -07:00
|
|
|
Ecore_Event_Mouse_Button *e;
|
2009-03-19 00:59:59 -07:00
|
|
|
|
2003-09-23 01:09:32 -07:00
|
|
|
e = event;
|
2011-11-21 21:51:06 -08:00
|
|
|
if (!ee) return ECORE_CALLBACK_PASS_ON;
|
2011-10-27 12:29:08 -07:00
|
|
|
_ecore_evas_mouse_move_process_fb(ee, e->x, e->y);
|
2011-11-21 21:51:06 -08:00
|
|
|
return ECORE_CALLBACK_PASS_ON;
|
2003-09-23 01:09:32 -07:00
|
|
|
}
|
|
|
|
|
Fix callback signatures
The change from returning int to Eina_Bool left several call sites with
warnings because they were not updated. Here they are fixed by using
Coccinelle, a tool that allows us to automate tasks like that. This
commit was generated from the following semantic patch:
virtual org
@r1@
identifier fn!=NULL, fn2;
expression E1, E2, E3;
@@
(
ecore_event_handler_add(E1, fn, ...)
|
ecore_event_filter_add(E1, fn, ...)
|
ecore_idler_add(fn, ...)
|
ecore_idle_enterer_add(E1, fn, ...)
|
ecore_idle_enterer_before_add(E1, fn, ...)
|
ecore_idle_exiter_add(E1, fn, ...)
|
ecore_main_fd_handler_add(E1, E2, fn, E3, fn2, ...)
|
ecore_main_win32_handler_add(E1, fn, ...)
|
ecore_timer_add(E1, fn, ...)
|
ecore_timer_loop_add(E1, fn, ...)
|
ecore_animator_add(fn, ...)
|
ecore_poller_add(E1, E2, fn, ...)
)
@r2@
identifier r1.fn;
identifier ret;
typedef Eina_Bool;
position p;
@@
- int
+ Eina_Bool
fn@p(...) {
<...
(
- return 1;
+ return EINA_TRUE;
|
- return 0;
+ return EINA_FALSE;
|
- int
+ Eina_Bool
ret;
...
return <+...ret...+>;
|
return ...;
)
...>
}
@r3@
identifier r1.fn2;
identifier ret;
position p;
@@
- int
+ Eina_Bool
fn2@p(...) {
...
(
- return 1;
+ return EINA_TRUE;
|
- return 0;
+ return EINA_FALSE;
|
- int
+ Eina_Bool
ret;
...
return <+...ret...+>;
|
return ...;
)
...
}
@r4@
identifier r1.fn;
@@
- int
+ Eina_Bool
fn(...);
@r5@
identifier r1.fn2;
@@
- int
+ Eina_Bool
fn2(...);
@script:python depends on org@
p << r2.p;
f << r1.fn;
@@
import sys
msg="WARNING: wrong callback %s! ( %s:%s )" % (f, p[0].file,p[0].line)
print >> sys.stderr, msg
@script:python depends on org@
p << r3.p;
f << r1.fn2;
@@
import sys
msg="WARNING: wrong callback %s! ( %s:%s )" % (f, p[0].file,p[0].line)
print >> sys.stderr, msg
SVN revision: 49985
2010-07-01 18:38:05 -07:00
|
|
|
static Eina_Bool
|
2012-12-05 13:15:42 -08:00
|
|
|
_ecore_evas_event_mouse_button_up(void *data, int type EINA_UNUSED, void *event)
|
2003-09-23 01:09:32 -07:00
|
|
|
{
|
2012-12-05 13:15:42 -08:00
|
|
|
Ecore_Evas *ee = data;
|
2011-10-27 12:29:08 -07:00
|
|
|
Ecore_Event_Mouse_Button *e;
|
2009-03-19 00:59:59 -07:00
|
|
|
|
2003-09-23 01:09:32 -07:00
|
|
|
e = event;
|
2011-11-21 21:51:06 -08:00
|
|
|
if (!ee) return ECORE_CALLBACK_PASS_ON;
|
2011-10-27 12:29:08 -07:00
|
|
|
_ecore_evas_mouse_move_process_fb(ee, e->x, e->y);
|
2011-11-21 21:51:06 -08:00
|
|
|
return ECORE_CALLBACK_PASS_ON;
|
2003-09-23 01:09:32 -07:00
|
|
|
}
|
|
|
|
|
Fix callback signatures
The change from returning int to Eina_Bool left several call sites with
warnings because they were not updated. Here they are fixed by using
Coccinelle, a tool that allows us to automate tasks like that. This
commit was generated from the following semantic patch:
virtual org
@r1@
identifier fn!=NULL, fn2;
expression E1, E2, E3;
@@
(
ecore_event_handler_add(E1, fn, ...)
|
ecore_event_filter_add(E1, fn, ...)
|
ecore_idler_add(fn, ...)
|
ecore_idle_enterer_add(E1, fn, ...)
|
ecore_idle_enterer_before_add(E1, fn, ...)
|
ecore_idle_exiter_add(E1, fn, ...)
|
ecore_main_fd_handler_add(E1, E2, fn, E3, fn2, ...)
|
ecore_main_win32_handler_add(E1, fn, ...)
|
ecore_timer_add(E1, fn, ...)
|
ecore_timer_loop_add(E1, fn, ...)
|
ecore_animator_add(fn, ...)
|
ecore_poller_add(E1, E2, fn, ...)
)
@r2@
identifier r1.fn;
identifier ret;
typedef Eina_Bool;
position p;
@@
- int
+ Eina_Bool
fn@p(...) {
<...
(
- return 1;
+ return EINA_TRUE;
|
- return 0;
+ return EINA_FALSE;
|
- int
+ Eina_Bool
ret;
...
return <+...ret...+>;
|
return ...;
)
...>
}
@r3@
identifier r1.fn2;
identifier ret;
position p;
@@
- int
+ Eina_Bool
fn2@p(...) {
...
(
- return 1;
+ return EINA_TRUE;
|
- return 0;
+ return EINA_FALSE;
|
- int
+ Eina_Bool
ret;
...
return <+...ret...+>;
|
return ...;
)
...
}
@r4@
identifier r1.fn;
@@
- int
+ Eina_Bool
fn(...);
@r5@
identifier r1.fn2;
@@
- int
+ Eina_Bool
fn2(...);
@script:python depends on org@
p << r2.p;
f << r1.fn;
@@
import sys
msg="WARNING: wrong callback %s! ( %s:%s )" % (f, p[0].file,p[0].line)
print >> sys.stderr, msg
@script:python depends on org@
p << r3.p;
f << r1.fn2;
@@
import sys
msg="WARNING: wrong callback %s! ( %s:%s )" % (f, p[0].file,p[0].line)
print >> sys.stderr, msg
SVN revision: 49985
2010-07-01 18:38:05 -07:00
|
|
|
static Eina_Bool
|
2012-12-05 13:15:42 -08:00
|
|
|
_ecore_evas_event_mouse_move(void *data, int type EINA_UNUSED, void *event)
|
2003-09-23 01:09:32 -07:00
|
|
|
{
|
2012-12-05 13:15:42 -08:00
|
|
|
Ecore_Evas *ee = data;
|
2011-10-27 12:29:08 -07:00
|
|
|
Ecore_Event_Mouse_Move *e;
|
2009-03-19 00:59:59 -07:00
|
|
|
|
2003-09-23 01:09:32 -07:00
|
|
|
e = event;
|
2011-11-21 21:51:06 -08:00
|
|
|
if (!ee) return ECORE_CALLBACK_PASS_ON;
|
2011-10-27 12:29:08 -07:00
|
|
|
_ecore_evas_mouse_move_process_fb(ee, e->x, e->y);
|
2011-11-21 21:51:06 -08:00
|
|
|
return ECORE_CALLBACK_PASS_ON;
|
2006-07-30 21:13:51 -07:00
|
|
|
}
|
|
|
|
|
Fix callback signatures
The change from returning int to Eina_Bool left several call sites with
warnings because they were not updated. Here they are fixed by using
Coccinelle, a tool that allows us to automate tasks like that. This
commit was generated from the following semantic patch:
virtual org
@r1@
identifier fn!=NULL, fn2;
expression E1, E2, E3;
@@
(
ecore_event_handler_add(E1, fn, ...)
|
ecore_event_filter_add(E1, fn, ...)
|
ecore_idler_add(fn, ...)
|
ecore_idle_enterer_add(E1, fn, ...)
|
ecore_idle_enterer_before_add(E1, fn, ...)
|
ecore_idle_exiter_add(E1, fn, ...)
|
ecore_main_fd_handler_add(E1, E2, fn, E3, fn2, ...)
|
ecore_main_win32_handler_add(E1, fn, ...)
|
ecore_timer_add(E1, fn, ...)
|
ecore_timer_loop_add(E1, fn, ...)
|
ecore_animator_add(fn, ...)
|
ecore_poller_add(E1, E2, fn, ...)
)
@r2@
identifier r1.fn;
identifier ret;
typedef Eina_Bool;
position p;
@@
- int
+ Eina_Bool
fn@p(...) {
<...
(
- return 1;
+ return EINA_TRUE;
|
- return 0;
+ return EINA_FALSE;
|
- int
+ Eina_Bool
ret;
...
return <+...ret...+>;
|
return ...;
)
...>
}
@r3@
identifier r1.fn2;
identifier ret;
position p;
@@
- int
+ Eina_Bool
fn2@p(...) {
...
(
- return 1;
+ return EINA_TRUE;
|
- return 0;
+ return EINA_FALSE;
|
- int
+ Eina_Bool
ret;
...
return <+...ret...+>;
|
return ...;
)
...
}
@r4@
identifier r1.fn;
@@
- int
+ Eina_Bool
fn(...);
@r5@
identifier r1.fn2;
@@
- int
+ Eina_Bool
fn2(...);
@script:python depends on org@
p << r2.p;
f << r1.fn;
@@
import sys
msg="WARNING: wrong callback %s! ( %s:%s )" % (f, p[0].file,p[0].line)
print >> sys.stderr, msg
@script:python depends on org@
p << r3.p;
f << r1.fn2;
@@
import sys
msg="WARNING: wrong callback %s! ( %s:%s )" % (f, p[0].file,p[0].line)
print >> sys.stderr, msg
SVN revision: 49985
2010-07-01 18:38:05 -07:00
|
|
|
static Eina_Bool
|
2012-12-05 13:15:42 -08:00
|
|
|
_ecore_evas_event_mouse_wheel(void *data, int type EINA_UNUSED, void *event)
|
2006-07-30 21:13:51 -07:00
|
|
|
{
|
2012-12-05 13:15:42 -08:00
|
|
|
Ecore_Evas *ee = data;
|
2011-10-27 12:29:08 -07:00
|
|
|
Ecore_Event_Mouse_Wheel *e;
|
2009-03-19 00:59:59 -07:00
|
|
|
|
2006-07-30 21:13:51 -07:00
|
|
|
e = event;
|
2011-11-21 21:51:06 -08:00
|
|
|
if (!ee) return ECORE_CALLBACK_PASS_ON;
|
2011-10-27 12:29:08 -07:00
|
|
|
_ecore_evas_mouse_move_process_fb(ee, e->x, e->y);
|
2011-11-21 21:51:06 -08:00
|
|
|
return ECORE_CALLBACK_PASS_ON;
|
2003-09-23 01:09:32 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
2010-01-06 21:29:06 -08:00
|
|
|
_ecore_evas_fb_render(Ecore_Evas *ee)
|
2003-09-23 01:09:32 -07:00
|
|
|
{
|
2010-01-06 21:29:06 -08:00
|
|
|
int rend = 0;
|
2010-01-14 09:52:29 -08:00
|
|
|
|
2010-01-06 21:29:06 -08:00
|
|
|
if (ee->visible)
|
2003-09-23 01:09:32 -07:00
|
|
|
{
|
2010-01-06 21:29:06 -08:00
|
|
|
Eina_List *updates;
|
|
|
|
Eina_List *ll;
|
|
|
|
Ecore_Evas *ee2;
|
2011-12-26 15:27:20 -08:00
|
|
|
|
2010-01-06 21:29:06 -08:00
|
|
|
if (ee->func.fn_pre_render) ee->func.fn_pre_render(ee);
|
2011-10-05 15:11:00 -07:00
|
|
|
|
2010-01-06 21:29:06 -08:00
|
|
|
EINA_LIST_FOREACH(ee->sub_ecore_evas, ll, ee2)
|
|
|
|
{
|
|
|
|
if (ee2->func.fn_pre_render) ee2->func.fn_pre_render(ee2);
|
2011-10-05 15:52:41 -07:00
|
|
|
if (ee2->engine.func->fn_render)
|
2012-12-05 13:15:42 -08:00
|
|
|
rend |= ee2->engine.func->fn_render(ee2);
|
2010-01-06 21:29:06 -08:00
|
|
|
if (ee2->func.fn_post_render) ee2->func.fn_post_render(ee2);
|
|
|
|
}
|
2011-10-05 15:11:00 -07:00
|
|
|
|
2010-01-06 21:29:06 -08:00
|
|
|
updates = evas_render_updates(ee->evas);
|
|
|
|
if (updates)
|
|
|
|
{
|
|
|
|
evas_render_updates_free(updates);
|
|
|
|
_ecore_evas_idle_timeout_update(ee);
|
|
|
|
rend = 1;
|
|
|
|
}
|
|
|
|
if (ee->func.fn_post_render) ee->func.fn_post_render(ee);
|
2003-09-23 01:09:32 -07:00
|
|
|
}
|
2010-01-06 21:29:06 -08:00
|
|
|
else
|
|
|
|
evas_norender(ee->evas);
|
|
|
|
return rend;
|
2003-09-23 01:09:32 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static int
|
2011-10-27 12:29:08 -07:00
|
|
|
_ecore_evas_fb_init(Ecore_Evas *ee, int w, int h)
|
2003-09-23 01:09:32 -07:00
|
|
|
{
|
2012-01-11 07:30:40 -08:00
|
|
|
Eina_File_Direct_Info *info;
|
|
|
|
Eina_Iterator *ls;
|
2006-08-02 14:41:11 -07:00
|
|
|
Ecore_Fb_Input_Device *device;
|
|
|
|
Ecore_Fb_Input_Device_Cap caps;
|
|
|
|
int mouse_handled = 0;
|
2009-03-19 00:59:59 -07:00
|
|
|
|
2003-09-23 01:09:32 -07:00
|
|
|
_ecore_evas_init_count++;
|
|
|
|
if (_ecore_evas_init_count > 1) return _ecore_evas_init_count;
|
2009-03-19 00:59:59 -07:00
|
|
|
|
2011-10-27 12:29:08 -07:00
|
|
|
ecore_event_evas_init();
|
|
|
|
|
2006-08-02 14:41:11 -07:00
|
|
|
/* register all input devices */
|
2012-01-11 07:30:40 -08:00
|
|
|
ls = eina_file_direct_ls("/dev/input/");
|
2009-03-19 00:59:59 -07:00
|
|
|
|
2012-01-11 07:30:40 -08:00
|
|
|
EINA_ITERATOR_FOREACH(ls, info)
|
2007-11-19 15:16:29 -08:00
|
|
|
{
|
2012-01-11 07:30:40 -08:00
|
|
|
if (strncmp(info->path + info->name_start, "event", 5) != 0)
|
2010-09-29 10:03:38 -07:00
|
|
|
continue;
|
2009-03-19 00:59:59 -07:00
|
|
|
|
2012-01-11 07:30:40 -08:00
|
|
|
if (!(device = ecore_fb_input_device_open(info->path)))
|
2010-09-29 10:03:38 -07:00
|
|
|
continue;
|
2011-11-24 13:08:22 -08:00
|
|
|
ecore_fb_input_device_window_set(device, ee);
|
2009-03-19 00:59:59 -07:00
|
|
|
|
2010-09-29 10:03:38 -07:00
|
|
|
caps = ecore_fb_input_device_cap_get(device);
|
2007-11-19 15:16:29 -08:00
|
|
|
|
2010-09-29 10:03:38 -07:00
|
|
|
/* Mouse */
|
2009-03-13 02:47:43 -07:00
|
|
|
#ifdef HAVE_TSLIB
|
2010-09-29 10:03:38 -07:00
|
|
|
if (caps & ECORE_FB_INPUT_DEVICE_CAP_RELATIVE)
|
2009-03-13 02:47:43 -07:00
|
|
|
#else
|
2010-09-29 10:03:38 -07:00
|
|
|
if ((caps & ECORE_FB_INPUT_DEVICE_CAP_RELATIVE) || (caps & ECORE_FB_INPUT_DEVICE_CAP_ABSOLUTE))
|
2009-03-13 02:47:43 -07:00
|
|
|
#endif
|
2010-09-29 10:03:38 -07:00
|
|
|
{
|
|
|
|
ecore_fb_input_device_axis_size_set(device, w, h);
|
|
|
|
ecore_fb_input_device_listen(device,1);
|
|
|
|
ecore_evas_input_devices = eina_list_append(ecore_evas_input_devices, device);
|
|
|
|
if (!mouse_handled)
|
|
|
|
{
|
2011-10-27 12:29:08 -07:00
|
|
|
ecore_evas_event_handlers[0] = ecore_event_handler_add(ECORE_EVENT_MOUSE_BUTTON_DOWN, _ecore_evas_event_mouse_button_down, NULL);
|
|
|
|
ecore_evas_event_handlers[1] = ecore_event_handler_add(ECORE_EVENT_MOUSE_BUTTON_UP, _ecore_evas_event_mouse_button_up, NULL);
|
|
|
|
ecore_evas_event_handlers[2] = ecore_event_handler_add(ECORE_EVENT_MOUSE_MOVE, _ecore_evas_event_mouse_move, NULL);
|
|
|
|
ecore_evas_event_handlers[3] = ecore_event_handler_add(ECORE_EVENT_MOUSE_WHEEL, _ecore_evas_event_mouse_wheel, NULL);
|
2010-09-29 10:03:38 -07:00
|
|
|
mouse_handled = 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
/* Keyboard */
|
|
|
|
else if ((caps & ECORE_FB_INPUT_DEVICE_CAP_KEYS_OR_BUTTONS) && !(caps & ECORE_FB_INPUT_DEVICE_CAP_ABSOLUTE))
|
|
|
|
{
|
|
|
|
ecore_fb_input_device_listen(device,1);
|
|
|
|
ecore_evas_input_devices = eina_list_append(ecore_evas_input_devices, device);
|
|
|
|
}
|
2007-11-19 15:16:29 -08:00
|
|
|
}
|
2012-01-11 07:30:40 -08:00
|
|
|
eina_iterator_free(ls);
|
2011-04-20 07:15:33 -07:00
|
|
|
|
2008-01-23 18:23:14 -08:00
|
|
|
if (!mouse_handled)
|
|
|
|
{
|
2010-09-29 10:03:38 -07:00
|
|
|
if (ecore_fb_ts_init())
|
|
|
|
{
|
2011-11-23 08:52:14 -08:00
|
|
|
ecore_fb_ts_event_window_set(ee);
|
2011-10-27 12:29:08 -07:00
|
|
|
ecore_evas_event_handlers[0] = ecore_event_handler_add(ECORE_EVENT_MOUSE_BUTTON_DOWN, _ecore_evas_event_mouse_button_down, NULL);
|
|
|
|
ecore_evas_event_handlers[1] = ecore_event_handler_add(ECORE_EVENT_MOUSE_BUTTON_UP, _ecore_evas_event_mouse_button_up, NULL);
|
|
|
|
ecore_evas_event_handlers[2] = ecore_event_handler_add(ECORE_EVENT_MOUSE_MOVE, _ecore_evas_event_mouse_move, NULL);
|
2010-09-29 10:03:38 -07:00
|
|
|
mouse_handled = 1;
|
|
|
|
}
|
2008-01-23 18:23:14 -08:00
|
|
|
}
|
2003-09-23 01:09:32 -07:00
|
|
|
return _ecore_evas_init_count;
|
|
|
|
}
|
|
|
|
|
2012-12-05 13:15:42 -08:00
|
|
|
int
|
|
|
|
_ecore_evas_fb_shutdown(void)
|
|
|
|
{
|
|
|
|
_ecore_evas_init_count--;
|
|
|
|
if (_ecore_evas_init_count == 0)
|
|
|
|
{
|
|
|
|
int i;
|
|
|
|
|
|
|
|
for (i = 0; i < 4; i++)
|
|
|
|
{
|
|
|
|
if (ecore_evas_event_handlers[i])
|
|
|
|
ecore_event_handler_del(ecore_evas_event_handlers[i]);
|
|
|
|
}
|
|
|
|
ecore_fb_ts_shutdown();
|
|
|
|
ecore_event_evas_shutdown();
|
|
|
|
}
|
|
|
|
if (_ecore_evas_init_count < 0) _ecore_evas_init_count = 0;
|
|
|
|
return _ecore_evas_init_count;
|
|
|
|
}
|
|
|
|
|
2003-09-23 01:09:32 -07:00
|
|
|
static void
|
|
|
|
_ecore_evas_fb_free(Ecore_Evas *ee)
|
|
|
|
{
|
2012-12-05 13:15:42 -08:00
|
|
|
Ecore_Evas_Engine_FB_Data *idata = ee->engine.data;
|
|
|
|
|
2011-10-27 12:29:08 -07:00
|
|
|
ecore_evas_input_event_unregister(ee);
|
2012-12-05 13:15:42 -08:00
|
|
|
free(idata);
|
2003-09-23 01:09:32 -07:00
|
|
|
_ecore_evas_fb_shutdown();
|
|
|
|
ecore_fb_shutdown();
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_ecore_evas_resize(Ecore_Evas *ee, int w, int h)
|
|
|
|
{
|
2011-11-01 23:55:12 -07:00
|
|
|
ee->req.w = w;
|
|
|
|
ee->req.h = h;
|
2003-09-23 01:09:32 -07:00
|
|
|
if ((w == ee->w) && (h == ee->h)) return;
|
|
|
|
ee->w = w;
|
|
|
|
ee->h = h;
|
2014-01-18 05:26:10 -08:00
|
|
|
if (ECORE_EVAS_PORTRAIT(ee))
|
2007-03-02 09:02:49 -08:00
|
|
|
{
|
|
|
|
evas_output_size_set(ee->evas, ee->w, ee->h);
|
|
|
|
evas_output_viewport_set(ee->evas, 0, 0, ee->w, ee->h);
|
|
|
|
evas_damage_rectangle_add(ee->evas, 0, 0, ee->w, ee->h);
|
|
|
|
}
|
2014-01-18 05:26:10 -08:00
|
|
|
else
|
|
|
|
{
|
|
|
|
evas_output_size_set(ee->evas, ee->h, ee->w);
|
|
|
|
evas_output_viewport_set(ee->evas, 0, 0, ee->h, ee->w);
|
|
|
|
evas_damage_rectangle_add(ee->evas, 0, 0, ee->h, ee->w);
|
|
|
|
}
|
2009-03-19 00:59:59 -07:00
|
|
|
if (ee->func.fn_resize) ee->func.fn_resize(ee);
|
2003-09-23 01:09:32 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-11-25 01:55:32 -08:00
|
|
|
_ecore_evas_move_resize(Ecore_Evas *ee, int x EINA_UNUSED, int y EINA_UNUSED, int w, int h)
|
2003-09-23 01:09:32 -07:00
|
|
|
{
|
2011-11-01 23:55:12 -07:00
|
|
|
ee->req.w = w;
|
|
|
|
ee->req.h = h;
|
2003-09-23 01:09:32 -07:00
|
|
|
if ((w == ee->w) && (h == ee->h)) return;
|
|
|
|
ee->w = w;
|
|
|
|
ee->h = h;
|
2014-01-18 05:26:10 -08:00
|
|
|
if (ECORE_EVAS_PORTRAIT(ee))
|
2007-03-02 09:02:49 -08:00
|
|
|
{
|
|
|
|
evas_output_size_set(ee->evas, ee->w, ee->h);
|
|
|
|
evas_output_viewport_set(ee->evas, 0, 0, ee->w, ee->h);
|
|
|
|
evas_damage_rectangle_add(ee->evas, 0, 0, ee->w, ee->h);
|
|
|
|
}
|
2014-01-18 05:26:10 -08:00
|
|
|
else
|
|
|
|
{
|
|
|
|
evas_output_size_set(ee->evas, ee->h, ee->w);
|
|
|
|
evas_output_viewport_set(ee->evas, 0, 0, ee->h, ee->w);
|
|
|
|
evas_damage_rectangle_add(ee->evas, 0, 0, ee->h, ee->w);
|
|
|
|
}
|
2009-03-19 00:59:59 -07:00
|
|
|
if (ee->func.fn_resize) ee->func.fn_resize(ee);
|
2003-09-23 01:09:32 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2012-11-25 01:55:32 -08:00
|
|
|
_ecore_evas_rotation_set(Ecore_Evas *ee, int rotation, int resize EINA_UNUSED)
|
2003-09-23 01:09:32 -07:00
|
|
|
{
|
|
|
|
Evas_Engine_Info_FB *einfo;
|
|
|
|
int rot_dif;
|
2009-03-19 00:59:59 -07:00
|
|
|
|
2003-09-23 01:09:32 -07:00
|
|
|
if (ee->rotation == rotation) return;
|
|
|
|
einfo = (Evas_Engine_Info_FB *)evas_engine_info_get(ee->evas);
|
|
|
|
if (!einfo) return;
|
|
|
|
rot_dif = ee->rotation - rotation;
|
|
|
|
if (rot_dif < 0) rot_dif = -rot_dif;
|
|
|
|
if (rot_dif != 180)
|
|
|
|
{
|
2009-03-19 00:59:59 -07:00
|
|
|
|
2010-09-29 10:03:38 -07:00
|
|
|
einfo->info.rotation = rotation;
|
2010-09-29 09:45:49 -07:00
|
|
|
if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo))
|
|
|
|
{
|
|
|
|
ERR("evas_engine_info_set() for engine '%s' failed.", ee->driver);
|
|
|
|
}
|
2010-09-29 10:03:38 -07:00
|
|
|
if (!ee->prop.fullscreen)
|
|
|
|
{
|
|
|
|
int tmp;
|
|
|
|
|
|
|
|
tmp = ee->w;
|
|
|
|
ee->w = ee->h;
|
|
|
|
ee->h = tmp;
|
2011-11-01 23:55:12 -07:00
|
|
|
ee->req.w = ee->w;
|
|
|
|
ee->req.h = ee->h;
|
2010-09-29 10:03:38 -07:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2014-01-18 05:26:10 -08:00
|
|
|
if (ECORE_EVAS_PORTRAIT(ee))
|
2010-09-29 10:03:38 -07:00
|
|
|
{
|
|
|
|
evas_output_size_set(ee->evas, ee->w, ee->h);
|
|
|
|
evas_output_viewport_set(ee->evas, 0, 0, ee->w, ee->h);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
evas_output_size_set(ee->evas, ee->h, ee->w);
|
|
|
|
evas_output_viewport_set(ee->evas, 0, 0, ee->h, ee->w);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
ee->rotation = rotation;
|
2003-09-23 01:09:32 -07:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2010-09-29 10:03:38 -07:00
|
|
|
einfo->info.rotation = rotation;
|
2010-09-29 09:45:49 -07:00
|
|
|
if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo))
|
|
|
|
{
|
|
|
|
ERR("evas_engine_info_set() for engine '%s' failed.", ee->driver);
|
|
|
|
}
|
2010-09-29 10:03:38 -07:00
|
|
|
ee->rotation = rotation;
|
2003-09-23 01:09:32 -07:00
|
|
|
}
|
2014-01-18 05:26:10 -08:00
|
|
|
if (ECORE_EVAS_PORTRAIT(ee))
|
2003-09-23 01:09:32 -07:00
|
|
|
evas_damage_rectangle_add(ee->evas, 0, 0, ee->w, ee->h);
|
2014-01-18 05:26:10 -08:00
|
|
|
else
|
|
|
|
evas_damage_rectangle_add(ee->evas, 0, 0, ee->h, ee->w);
|
|
|
|
|
2011-10-27 12:29:08 -07:00
|
|
|
_ecore_evas_mouse_move_process_fb(ee, ee->mouse.x, ee->mouse.y);
|
2003-09-23 01:09:32 -07:00
|
|
|
if (ee->func.fn_resize) ee->func.fn_resize(ee);
|
|
|
|
}
|
|
|
|
|
2011-11-21 21:51:06 -08:00
|
|
|
static void
|
|
|
|
_ecore_evas_show(Ecore_Evas *ee)
|
|
|
|
{
|
|
|
|
if (ee->prop.focused) return;
|
2014-01-11 01:19:43 -08:00
|
|
|
ee->prop.focused = EINA_TRUE;
|
2011-11-21 21:51:06 -08:00
|
|
|
evas_focus_in(ee->evas);
|
|
|
|
if (ee->func.fn_focus_in) ee->func.fn_focus_in(ee);
|
|
|
|
}
|
|
|
|
|
2012-03-28 22:57:41 -07:00
|
|
|
static void
|
|
|
|
_ecore_evas_hide(Ecore_Evas *ee)
|
|
|
|
{
|
|
|
|
if (ee->prop.focused)
|
|
|
|
{
|
2014-01-11 01:19:43 -08:00
|
|
|
ee->prop.focused = EINA_FALSE;
|
2012-03-28 22:57:41 -07:00
|
|
|
evas_focus_out(ee->evas);
|
|
|
|
if (ee->func.fn_focus_out) ee->func.fn_focus_out(ee);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-02-05 02:45:52 -08:00
|
|
|
static void
|
2012-11-25 01:55:32 -08:00
|
|
|
_ecore_evas_object_cursor_del(void *data, Evas *e EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
|
2009-02-05 02:45:52 -08:00
|
|
|
{
|
|
|
|
Ecore_Evas *ee;
|
|
|
|
|
|
|
|
ee = data;
|
|
|
|
if (ee)
|
|
|
|
ee->prop.cursor.object = NULL;
|
|
|
|
}
|
|
|
|
|
2003-09-23 01:09:32 -07:00
|
|
|
static void
|
2007-09-26 07:40:02 -07:00
|
|
|
_ecore_evas_object_cursor_set(Ecore_Evas *ee, Evas_Object *obj, int layer, int hot_x, int hot_y)
|
2003-09-23 01:09:32 -07:00
|
|
|
{
|
|
|
|
int x, y;
|
2009-03-19 00:59:59 -07:00
|
|
|
|
2007-09-26 07:40:02 -07:00
|
|
|
if (ee->prop.cursor.object) evas_object_del(ee->prop.cursor.object);
|
|
|
|
|
2010-08-21 06:52:25 -07:00
|
|
|
if (!obj)
|
2003-09-23 01:09:32 -07:00
|
|
|
{
|
2010-09-29 10:03:38 -07:00
|
|
|
ee->prop.cursor.object = NULL;
|
|
|
|
ee->prop.cursor.layer = 0;
|
|
|
|
ee->prop.cursor.hot.x = 0;
|
|
|
|
ee->prop.cursor.hot.y = 0;
|
|
|
|
return;
|
2003-09-23 01:09:32 -07:00
|
|
|
}
|
2007-09-26 07:40:02 -07:00
|
|
|
|
|
|
|
ee->prop.cursor.object = obj;
|
2003-09-23 01:09:32 -07:00
|
|
|
ee->prop.cursor.layer = layer;
|
|
|
|
ee->prop.cursor.hot.x = hot_x;
|
|
|
|
ee->prop.cursor.hot.y = hot_y;
|
|
|
|
evas_pointer_output_xy_get(ee->evas, &x, &y);
|
|
|
|
evas_object_layer_set(ee->prop.cursor.object, ee->prop.cursor.layer);
|
2009-03-19 00:59:59 -07:00
|
|
|
evas_object_move(ee->prop.cursor.object,
|
2010-09-29 10:03:38 -07:00
|
|
|
x - ee->prop.cursor.hot.x,
|
|
|
|
y - ee->prop.cursor.hot.y);
|
2003-09-23 01:09:32 -07:00
|
|
|
evas_object_pass_events_set(ee->prop.cursor.object, 1);
|
|
|
|
if (evas_pointer_inside_get(ee->evas))
|
|
|
|
evas_object_show(ee->prop.cursor.object);
|
2009-02-05 02:45:52 -08:00
|
|
|
|
|
|
|
evas_object_event_callback_add(obj, EVAS_CALLBACK_DEL, _ecore_evas_object_cursor_del, ee);
|
2003-09-23 01:09:32 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2014-01-12 21:26:36 -08:00
|
|
|
_ecore_evas_fullscreen_set(Ecore_Evas *ee, Eina_Bool on)
|
2003-09-23 01:09:32 -07:00
|
|
|
{
|
* estickies,
* etk,
* PROTO/exalt,
* E-MODULES-EXTRA/diskio,
* E-MODULES-EXTRA/drawer,
* E-MODULES-EXTRA/penguins,
* E-MODULES-EXTRA/slideshow,
* E-MODULES-EXTRA/mail,
* E-MODULES-EXTRA/forecasts,
* E-MODULES-EXTRA/iiirk,
* E-MODULES-EXTRA/places,
* e,
* ewl,
* ecore,
* elitaire,
* entrance,
* e_dbus,
* efreet: Here we go, move from Ecore_List to Eina_List.
NOTE: This patch is huge, I did test it a lot, and I hope nothing is
broken. But if you think something change after this commit, please
contact me ASAP.
SVN revision: 39200
2009-02-25 03:03:47 -08:00
|
|
|
Eina_List *l;
|
2009-04-19 08:47:32 -07:00
|
|
|
Ecore_Fb_Input_Device *dev;
|
2012-12-05 13:15:42 -08:00
|
|
|
Ecore_Evas_Engine_FB_Data *idata = ee->engine.data;
|
2003-09-23 01:09:32 -07:00
|
|
|
int resized = 0;
|
2009-03-19 00:59:59 -07:00
|
|
|
|
2003-09-23 01:09:32 -07:00
|
|
|
if (((ee->prop.fullscreen) && (on)) ||
|
|
|
|
((!ee->prop.fullscreen) && (!on))) return;
|
|
|
|
if (on)
|
|
|
|
{
|
2010-09-29 10:03:38 -07:00
|
|
|
int w, h;
|
|
|
|
|
2012-12-05 13:15:42 -08:00
|
|
|
idata->real_w = ee->w;
|
|
|
|
idata->real_h = ee->h;
|
2010-09-29 10:03:38 -07:00
|
|
|
w = ee->w;
|
|
|
|
h = ee->h;
|
|
|
|
ecore_fb_size_get(&w, &h);
|
|
|
|
if ((w == 0) && (h == 0))
|
|
|
|
{
|
|
|
|
w = ee->w;
|
|
|
|
h = ee->h;
|
|
|
|
}
|
|
|
|
if ((w != ee->w) || (h != ee->h)) resized = 1;
|
|
|
|
ee->w = w;
|
|
|
|
ee->h = h;
|
2011-11-01 23:55:12 -07:00
|
|
|
ee->req.w = ee->w;
|
|
|
|
ee->req.h = ee->h;
|
2010-09-29 10:03:38 -07:00
|
|
|
evas_output_size_set(ee->evas, ee->w, ee->h);
|
|
|
|
evas_output_viewport_set(ee->evas, 0, 0, ee->w, ee->h);
|
|
|
|
evas_damage_rectangle_add(ee->evas, 0, 0, ee->w, ee->h);
|
2003-09-23 01:09:32 -07:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2012-12-05 13:15:42 -08:00
|
|
|
if ((idata->real_w != ee->w) || (idata->real_h != ee->h)) resized = 1;
|
|
|
|
ee->w = idata->real_w;
|
|
|
|
ee->h = idata->real_h;
|
2011-11-01 23:55:12 -07:00
|
|
|
ee->req.w = ee->w;
|
|
|
|
ee->req.h = ee->h;
|
2010-09-29 10:03:38 -07:00
|
|
|
evas_output_size_set(ee->evas, ee->w, ee->h);
|
|
|
|
evas_output_viewport_set(ee->evas, 0, 0, ee->w, ee->h);
|
|
|
|
evas_damage_rectangle_add(ee->evas, 0, 0, ee->w, ee->h);
|
2003-09-23 01:09:32 -07:00
|
|
|
}
|
|
|
|
ee->prop.fullscreen = on;
|
2009-04-19 08:47:32 -07:00
|
|
|
EINA_LIST_FOREACH(ecore_evas_input_devices, l, dev)
|
|
|
|
ecore_fb_input_device_axis_size_set(dev, ee->w, ee->h);
|
2006-07-30 21:13:51 -07:00
|
|
|
/* rescale the input device area */
|
2003-09-23 01:09:32 -07:00
|
|
|
if (resized)
|
|
|
|
{
|
2010-09-29 10:03:38 -07:00
|
|
|
if (ee->func.fn_resize) ee->func.fn_resize(ee);
|
2003-09-23 01:09:32 -07:00
|
|
|
}
|
|
|
|
}
|
2009-03-19 00:59:59 -07:00
|
|
|
|
2010-01-06 21:29:06 -08:00
|
|
|
static Ecore_Evas_Engine_Func _ecore_fb_engine_func =
|
2003-09-23 01:09:32 -07:00
|
|
|
{
|
|
|
|
_ecore_evas_fb_free,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
2005-11-03 03:32:59 -08:00
|
|
|
NULL,
|
2006-07-27 09:14:33 -07:00
|
|
|
NULL,
|
|
|
|
NULL,
|
2003-09-23 01:09:32 -07:00
|
|
|
_ecore_evas_resize,
|
|
|
|
_ecore_evas_move_resize,
|
|
|
|
_ecore_evas_rotation_set,
|
|
|
|
NULL,
|
2011-11-21 21:51:06 -08:00
|
|
|
_ecore_evas_show,
|
2012-03-28 22:57:41 -07:00
|
|
|
_ecore_evas_hide,
|
2003-09-23 01:09:32 -07:00
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
2008-06-30 01:39:36 -07:00
|
|
|
NULL,
|
2007-09-26 07:40:02 -07:00
|
|
|
_ecore_evas_object_cursor_set,
|
2003-09-23 01:09:32 -07:00
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
2009-04-16 18:53:37 -07:00
|
|
|
_ecore_evas_fullscreen_set,
|
2003-09-23 01:09:32 -07:00
|
|
|
NULL,
|
2003-11-15 18:29:10 -08:00
|
|
|
NULL,
|
2009-03-16 09:24:43 -07:00
|
|
|
NULL,
|
2007-11-19 10:27:11 -08:00
|
|
|
NULL,
|
2010-01-06 21:29:06 -08:00
|
|
|
NULL,
|
2010-02-11 21:31:26 -08:00
|
|
|
NULL, //transparent
|
2012-07-03 00:44:17 -07:00
|
|
|
NULL, // profiles_set
|
2012-12-04 22:48:46 -08:00
|
|
|
NULL, // profile_set
|
2011-04-20 07:15:33 -07:00
|
|
|
|
2012-02-27 22:43:59 -08:00
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
|
2011-05-27 12:31:11 -07:00
|
|
|
NULL, // render
|
2012-07-05 05:51:05 -07:00
|
|
|
NULL, // screen_geometry_get
|
2013-02-15 01:32:40 -08:00
|
|
|
NULL, // screen_dpi_get
|
|
|
|
NULL,
|
|
|
|
NULL // msg_send
|
2012-12-05 13:15:42 -08:00
|
|
|
};
|
2003-09-23 01:09:32 -07:00
|
|
|
|
2012-12-28 19:56:54 -08:00
|
|
|
EAPI Ecore_Evas *
|
2012-12-05 13:15:42 -08:00
|
|
|
ecore_evas_fb_new_internal(const char *disp_name, int rotation, int w, int h)
|
2003-09-23 01:09:32 -07:00
|
|
|
{
|
|
|
|
Evas_Engine_Info_FB *einfo;
|
2012-12-05 13:15:42 -08:00
|
|
|
Ecore_Evas_Engine_FB_Data *idata;
|
2003-09-23 01:09:32 -07:00
|
|
|
Ecore_Evas *ee;
|
2006-08-02 14:41:11 -07:00
|
|
|
|
2003-09-23 01:09:32 -07:00
|
|
|
int rmethod;
|
|
|
|
|
2006-08-02 14:41:11 -07:00
|
|
|
if (!disp_name)
|
|
|
|
disp_name = ecore_evas_default_display;
|
|
|
|
|
2003-09-23 01:09:32 -07:00
|
|
|
rmethod = evas_render_method_lookup("fb");
|
|
|
|
if (!rmethod) return NULL;
|
2009-03-19 00:59:59 -07:00
|
|
|
|
2003-09-23 01:09:32 -07:00
|
|
|
if (!ecore_fb_init(disp_name)) return NULL;
|
|
|
|
ee = calloc(1, sizeof(Ecore_Evas));
|
|
|
|
if (!ee) return NULL;
|
2012-12-05 13:15:42 -08:00
|
|
|
idata = calloc(1, sizeof(Ecore_Evas_Engine_FB_Data));
|
|
|
|
|
|
|
|
ee->engine.data = idata;
|
2003-09-23 01:09:32 -07:00
|
|
|
|
|
|
|
ECORE_MAGIC_SET(ee, ECORE_MAGIC_EVAS);
|
2009-03-19 00:59:59 -07:00
|
|
|
|
2011-10-27 12:29:08 -07:00
|
|
|
_ecore_evas_fb_init(ee, w, h);
|
2009-03-19 00:59:59 -07:00
|
|
|
|
2012-12-05 13:15:42 -08:00
|
|
|
ecore_fb_callback_gain_set(_ecore_evas_fb_gain, ee);
|
|
|
|
ecore_fb_callback_lose_set(_ecore_evas_fb_lose, ee);
|
|
|
|
|
2003-09-23 01:09:32 -07:00
|
|
|
ee->engine.func = (Ecore_Evas_Engine_Func *)&_ecore_fb_engine_func;
|
2009-03-19 00:59:59 -07:00
|
|
|
|
2006-10-19 18:46:41 -07:00
|
|
|
ee->driver = "fb";
|
2003-09-23 01:09:32 -07:00
|
|
|
if (disp_name) ee->name = strdup(disp_name);
|
|
|
|
|
|
|
|
if (w < 1) w = 1;
|
|
|
|
if (h < 1) h = 1;
|
|
|
|
ee->rotation = rotation;
|
|
|
|
ee->visible = 1;
|
|
|
|
ee->w = w;
|
|
|
|
ee->h = h;
|
2011-11-01 23:55:12 -07:00
|
|
|
ee->req.w = ee->w;
|
|
|
|
ee->req.h = ee->h;
|
2003-09-23 01:09:32 -07:00
|
|
|
|
2005-01-08 10:40:32 -08:00
|
|
|
ee->prop.max.w = 0;
|
|
|
|
ee->prop.max.h = 0;
|
2003-09-23 01:09:32 -07:00
|
|
|
ee->prop.layer = 0;
|
2014-01-11 01:19:43 -08:00
|
|
|
ee->prop.focused = EINA_FALSE;
|
2014-01-12 21:26:36 -08:00
|
|
|
ee->prop.borderless = EINA_TRUE;
|
|
|
|
ee->prop.override = EINA_TRUE;
|
|
|
|
ee->prop.maximized = EINA_TRUE;
|
|
|
|
ee->prop.fullscreen = EINA_FALSE;
|
|
|
|
ee->prop.withdrawn = EINA_FALSE;
|
|
|
|
ee->prop.sticky = EINA_FALSE;
|
2009-03-19 00:59:59 -07:00
|
|
|
|
2003-09-23 01:09:32 -07:00
|
|
|
/* init evas here */
|
|
|
|
ee->evas = evas_new();
|
2005-11-06 01:47:28 -08:00
|
|
|
evas_data_attach_set(ee->evas, ee);
|
2003-09-23 01:09:32 -07:00
|
|
|
evas_output_method_set(ee->evas, rmethod);
|
2007-03-02 09:02:49 -08:00
|
|
|
|
2014-01-18 05:26:10 -08:00
|
|
|
if (ECORE_EVAS_PORTRAIT(ee))
|
2007-03-02 09:02:49 -08:00
|
|
|
{
|
2014-01-18 05:26:10 -08:00
|
|
|
evas_output_size_set(ee->evas, w, h);
|
|
|
|
evas_output_viewport_set(ee->evas, 0, 0, w, h);
|
2007-03-02 09:02:49 -08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2014-01-18 05:26:10 -08:00
|
|
|
evas_output_size_set(ee->evas, h, w);
|
|
|
|
evas_output_viewport_set(ee->evas, 0, 0, h, w);
|
2007-03-02 09:02:49 -08:00
|
|
|
}
|
|
|
|
|
2003-09-23 01:09:32 -07:00
|
|
|
einfo = (Evas_Engine_Info_FB *)evas_engine_info_get(ee->evas);
|
2012-06-14 08:01:54 -07:00
|
|
|
if (einfo && disp_name)
|
2003-09-23 01:09:32 -07:00
|
|
|
{
|
2010-09-29 10:03:38 -07:00
|
|
|
einfo->info.virtual_terminal = 0;
|
|
|
|
einfo->info.device_number = strtol(disp_name, NULL, 10);
|
|
|
|
einfo->info.refresh = 0;
|
|
|
|
einfo->info.rotation = ee->rotation;
|
2010-09-29 09:45:49 -07:00
|
|
|
if (!evas_engine_info_set(ee->evas, (Evas_Engine_Info *)einfo))
|
|
|
|
{
|
|
|
|
ERR("evas_engine_info_set() for engine '%s' failed.", ee->driver);
|
2011-07-28 23:20:55 -07:00
|
|
|
ecore_evas_free(ee);
|
|
|
|
return NULL;
|
2010-09-29 09:45:49 -07:00
|
|
|
}
|
2003-09-23 01:09:32 -07:00
|
|
|
}
|
2011-07-28 23:20:55 -07:00
|
|
|
else
|
|
|
|
{
|
|
|
|
ERR("evas_engine_info_set() init engine '%s' failed.", ee->driver);
|
|
|
|
ecore_evas_free(ee);
|
|
|
|
return NULL;
|
|
|
|
}
|
2011-10-27 12:29:08 -07:00
|
|
|
|
|
|
|
ecore_evas_input_event_register(ee);
|
2009-03-19 00:59:59 -07:00
|
|
|
|
2011-10-21 09:07:29 -07:00
|
|
|
ee->engine.func->fn_render = _ecore_evas_fb_render;
|
2010-01-06 21:29:06 -08:00
|
|
|
_ecore_evas_register(ee);
|
2013-05-09 18:43:33 -07:00
|
|
|
ecore_event_window_register(1, ee, ee->evas,
|
|
|
|
(Ecore_Event_Mouse_Move_Cb)_ecore_evas_mouse_move_process,
|
|
|
|
(Ecore_Event_Multi_Move_Cb)_ecore_evas_mouse_multi_move_process,
|
|
|
|
(Ecore_Event_Multi_Down_Cb)_ecore_evas_mouse_multi_down_process,
|
|
|
|
(Ecore_Event_Multi_Up_Cb)_ecore_evas_mouse_multi_up_process);
|
2010-02-01 06:13:48 -08:00
|
|
|
evas_event_feed_mouse_in(ee->evas, (unsigned int)((unsigned long long)(ecore_time_get() * 1000.0) & 0xffffffff), NULL);
|
2003-09-23 01:09:32 -07:00
|
|
|
return ee;
|
2009-04-11 03:31:42 -07:00
|
|
|
}
|