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
|
|
|
|
|
|
|
|
#include <sys/types.h>
|
|
|
|
#include <dirent.h>
|
|
|
|
|
2009-04-14 13:04:16 -07:00
|
|
|
#include <Ecore.h>
|
2009-12-22 13:15:12 -08:00
|
|
|
#include "ecore_private.h"
|
2003-12-15 21:54:46 -08:00
|
|
|
#ifdef BUILD_ECORE_EVAS_FB
|
2009-04-14 13:04:16 -07:00
|
|
|
#include <Ecore_Fb.h>
|
|
|
|
#include <ecore_fb_private.h>
|
2003-09-23 01:09:32 -07:00
|
|
|
#endif
|
|
|
|
|
2009-03-16 09:24:43 -07:00
|
|
|
#include "ecore_evas_private.h"
|
2009-04-14 13:04:16 -07:00
|
|
|
#include "Ecore_Evas.h"
|
2009-03-16 09:24:43 -07:00
|
|
|
|
2003-12-15 21:54:46 -08:00
|
|
|
#ifdef BUILD_ECORE_EVAS_FB
|
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
|
|
|
|
|
|
|
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
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-01-06 21:29:06 -08:00
|
|
|
static Ecore_Evas *fb_ee = NULL;
|
|
|
|
|
2003-09-23 01:09:32 -07:00
|
|
|
static Ecore_Evas *
|
|
|
|
_ecore_evas_fb_match(void)
|
|
|
|
{
|
2010-01-06 21:29:06 -08:00
|
|
|
return fb_ee;
|
2003-09-23 01:09:32 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2005-03-01 23:06:44 -08:00
|
|
|
_ecore_evas_fb_lose(void *data __UNUSED__)
|
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 *ll;
|
2006-08-02 14:41:11 -07:00
|
|
|
Ecore_Fb_Input_Device *dev;
|
2003-09-23 01:09:32 -07:00
|
|
|
|
2010-01-06 21:29:06 -08:00
|
|
|
if (fb_ee) fb_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
|
2005-03-01 23:06:44 -08:00
|
|
|
_ecore_evas_fb_gain(void *data __UNUSED__)
|
2003-09-23 01:09:32 -07:00
|
|
|
{
|
2009-06-17 04:42:02 -07:00
|
|
|
Ecore_Evas *ee;
|
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
|
|
|
|
2011-04-20 07:15:33 -07:00
|
|
|
if (fb_ee)
|
2003-09-23 01:09:32 -07:00
|
|
|
{
|
2010-01-06 21:29:06 -08:00
|
|
|
ee = fb_ee;
|
2011-04-20 07:15:33 -07:00
|
|
|
|
2010-09-29 10:03:38 -07:00
|
|
|
ee->visible = 1;
|
|
|
|
if ((ee->rotation == 90) || (ee->rotation == 270))
|
|
|
|
evas_damage_rectangle_add(ee->evas, 0, 0, ee->h, ee->w);
|
|
|
|
else
|
|
|
|
evas_damage_rectangle_add(ee->evas, 0, 0, ee->w, ee->h);
|
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
|
2005-03-01 23:06:44 -08:00
|
|
|
_ecore_evas_event_mouse_button_down(void *data __UNUSED__, int type __UNUSED__, void *event)
|
2003-09-23 01:09:32 -07:00
|
|
|
{
|
|
|
|
Ecore_Evas *ee;
|
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;
|
|
|
|
ee = _ecore_evas_fb_match();
|
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
|
|
|
if (!ee) return EINA_TRUE; /* pass on event */
|
2011-10-27 12:29:08 -07:00
|
|
|
_ecore_evas_mouse_move_process_fb(ee, e->x, e->y);
|
|
|
|
return EINA_TRUE; /* dont pass it 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
|
2005-03-01 23:06:44 -08:00
|
|
|
_ecore_evas_event_mouse_button_up(void *data __UNUSED__, int type __UNUSED__, void *event)
|
2003-09-23 01:09:32 -07:00
|
|
|
{
|
|
|
|
Ecore_Evas *ee;
|
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;
|
|
|
|
ee = _ecore_evas_fb_match();
|
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
|
|
|
if (!ee) return EINA_TRUE; /* pass on event */
|
2011-10-27 12:29:08 -07:00
|
|
|
_ecore_evas_mouse_move_process_fb(ee, e->x, e->y);
|
|
|
|
return EINA_TRUE; /* dont pass it 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
|
2005-03-01 23:06:44 -08:00
|
|
|
_ecore_evas_event_mouse_move(void *data __UNUSED__, int type __UNUSED__, void *event)
|
2003-09-23 01:09:32 -07:00
|
|
|
{
|
|
|
|
Ecore_Evas *ee;
|
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;
|
|
|
|
ee = _ecore_evas_fb_match();
|
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
|
|
|
if (!ee) return EINA_TRUE; /* pass on event */
|
2011-10-27 12:29:08 -07:00
|
|
|
_ecore_evas_mouse_move_process_fb(ee, e->x, e->y);
|
|
|
|
return EINA_TRUE; /* dont pass it 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
|
2006-07-30 21:13:51 -07:00
|
|
|
_ecore_evas_event_mouse_wheel(void *data __UNUSED__, int type __UNUSED__, void *event)
|
|
|
|
{
|
|
|
|
Ecore_Evas *ee;
|
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;
|
|
|
|
ee = _ecore_evas_fb_match();
|
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
|
|
|
if (!ee) return EINA_TRUE; /* pass on event */
|
2011-10-27 12:29:08 -07:00
|
|
|
_ecore_evas_mouse_move_process_fb(ee, e->x, e->y);
|
|
|
|
return EINA_TRUE; /* dont pass it 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;
|
2010-01-14 09:52:29 -08:00
|
|
|
|
2010-01-06 21:29:06 -08:00
|
|
|
Eina_List *ll;
|
|
|
|
Ecore_Evas *ee2;
|
|
|
|
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)
|
|
|
|
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
|
|
|
{
|
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
|
|
|
|
2006-08-02 14:41:11 -07:00
|
|
|
DIR *input_dir;
|
|
|
|
struct dirent *input_entry;
|
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 */
|
|
|
|
input_dir = opendir("/dev/input/");
|
2007-11-19 15:16:29 -08:00
|
|
|
if (!input_dir) return _ecore_evas_init_count;
|
2009-03-19 00:59:59 -07:00
|
|
|
|
2007-11-19 15:16:29 -08:00
|
|
|
while ((input_entry = readdir(input_dir)))
|
|
|
|
{
|
2010-09-29 10:03:38 -07:00
|
|
|
char device_path[256];
|
2009-03-19 00:59:59 -07:00
|
|
|
|
2010-09-29 10:03:38 -07:00
|
|
|
if (strncmp(input_entry->d_name, "event", 5) != 0)
|
|
|
|
continue;
|
2009-03-19 00:59:59 -07:00
|
|
|
|
2010-09-29 10:03:38 -07:00
|
|
|
snprintf(device_path, 256, "/dev/input/%s", input_entry->d_name);
|
2011-10-27 12:29:08 -07:00
|
|
|
if (!(device = ecore_fb_input_device_open(ee, device_path)))
|
2010-09-29 10:03:38 -07:00
|
|
|
continue;
|
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
|
|
|
}
|
2010-08-28 07:56:14 -07:00
|
|
|
closedir(input_dir);
|
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-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;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_ecore_evas_fb_free(Ecore_Evas *ee)
|
|
|
|
{
|
2011-10-27 12:29:08 -07:00
|
|
|
ecore_evas_input_event_unregister(ee);
|
2010-01-06 21:29:06 -08:00
|
|
|
if (fb_ee == ee) fb_ee = NULL;
|
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)
|
|
|
|
{
|
|
|
|
if ((w == ee->w) && (h == ee->h)) return;
|
|
|
|
ee->w = w;
|
|
|
|
ee->h = h;
|
2007-03-02 09:02:49 -08:00
|
|
|
if ((ee->rotation == 90) || (ee->rotation == 270))
|
|
|
|
{
|
|
|
|
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);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
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);
|
|
|
|
}
|
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
|
2005-03-01 23:06:44 -08:00
|
|
|
_ecore_evas_move_resize(Ecore_Evas *ee, int x __UNUSED__, int y __UNUSED__, int w, int h)
|
2003-09-23 01:09:32 -07:00
|
|
|
{
|
|
|
|
if ((w == ee->w) && (h == ee->h)) return;
|
|
|
|
ee->w = w;
|
|
|
|
ee->h = h;
|
2007-03-02 09:02:49 -08:00
|
|
|
if ((ee->rotation == 90) || (ee->rotation == 270))
|
|
|
|
{
|
|
|
|
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);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
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);
|
|
|
|
}
|
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
|
2010-09-18 20:51:56 -07:00
|
|
|
_ecore_evas_rotation_set(Ecore_Evas *ee, int rotation, int resize __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;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if ((rotation == 0) || (rotation == 180))
|
|
|
|
{
|
|
|
|
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
|
|
|
}
|
|
|
|
if ((ee->rotation == 90) || (ee->rotation == 270))
|
|
|
|
evas_damage_rectangle_add(ee->evas, 0, 0, ee->h, ee->w);
|
|
|
|
else
|
|
|
|
evas_damage_rectangle_add(ee->evas, 0, 0, ee->w, ee->h);
|
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);
|
|
|
|
}
|
|
|
|
|
2009-02-05 02:45:52 -08:00
|
|
|
static void
|
2009-04-11 03:31:42 -07:00
|
|
|
_ecore_evas_object_cursor_del(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED__, void *event_info __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
|
|
|
|
_ecore_evas_fullscreen_set(Ecore_Evas *ee, int on)
|
|
|
|
{
|
* 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;
|
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;
|
|
|
|
|
|
|
|
ee->engine.fb.real_w = ee->w;
|
|
|
|
ee->engine.fb.real_h = ee->h;
|
|
|
|
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;
|
|
|
|
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
|
|
|
|
{
|
2010-09-29 10:03:38 -07:00
|
|
|
if ((ee->engine.fb.real_w != ee->w) || (ee->engine.fb.real_h != ee->h)) resized = 1;
|
|
|
|
ee->w = ee->engine.fb.real_w;
|
|
|
|
ee->h = ee->engine.fb.real_h;
|
|
|
|
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
|
|
|
|
2003-09-23 01:09:32 -07:00
|
|
|
int
|
|
|
|
_ecore_evas_fb_shutdown(void)
|
|
|
|
{
|
|
|
|
_ecore_evas_init_count--;
|
|
|
|
if (_ecore_evas_init_count == 0)
|
|
|
|
{
|
2010-09-29 10:03:38 -07:00
|
|
|
int i;
|
2009-03-19 00:59:59 -07:00
|
|
|
|
2011-10-27 12:29:08 -07:00
|
|
|
for (i = 0; i < 4; i++)
|
2010-01-28 14:23:00 -08:00
|
|
|
{
|
|
|
|
if (ecore_evas_event_handlers[i])
|
|
|
|
ecore_event_handler_del(ecore_evas_event_handlers[i]);
|
|
|
|
}
|
2010-09-29 10:03:38 -07:00
|
|
|
ecore_fb_ts_shutdown();
|
2011-10-27 12:29:08 -07:00
|
|
|
ecore_event_evas_shutdown();
|
2003-09-23 01:09:32 -07:00
|
|
|
}
|
|
|
|
if (_ecore_evas_init_count < 0) _ecore_evas_init_count = 0;
|
|
|
|
return _ecore_evas_init_count;
|
|
|
|
}
|
|
|
|
|
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,
|
|
|
|
NULL,
|
|
|
|
NULL,
|
|
|
|
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
|
2011-04-20 07:15:33 -07:00
|
|
|
|
2011-05-27 12:31:11 -07:00
|
|
|
NULL, // render
|
|
|
|
NULL // screen_geometry_get
|
2003-09-23 01:09:32 -07:00
|
|
|
};
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/**
|
|
|
|
* To be documented.
|
|
|
|
*
|
|
|
|
* FIXME: To be fixed.
|
|
|
|
*/
|
2009-04-11 03:31:42 -07:00
|
|
|
#ifdef BUILD_ECORE_EVAS_FB
|
2006-01-06 10:47:56 -08:00
|
|
|
EAPI Ecore_Evas *
|
2008-10-29 13:12:45 -07:00
|
|
|
ecore_evas_fb_new(const char *disp_name, int rotation, int w, int h)
|
2003-09-23 01:09:32 -07:00
|
|
|
{
|
|
|
|
Evas_Engine_Info_FB *einfo;
|
|
|
|
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;
|
|
|
|
ecore_fb_callback_gain_set(_ecore_evas_fb_gain, NULL);
|
|
|
|
ecore_fb_callback_lose_set(_ecore_evas_fb_lose, NULL);
|
|
|
|
ee = calloc(1, sizeof(Ecore_Evas));
|
|
|
|
if (!ee) return NULL;
|
|
|
|
|
|
|
|
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
|
|
|
|
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;
|
|
|
|
|
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;
|
|
|
|
ee->prop.focused = 1;
|
|
|
|
ee->prop.borderless = 1;
|
|
|
|
ee->prop.override = 1;
|
|
|
|
ee->prop.maximized = 1;
|
|
|
|
ee->prop.fullscreen = 0;
|
|
|
|
ee->prop.withdrawn = 0;
|
2003-11-15 18:29:10 -08:00
|
|
|
ee->prop.sticky = 0;
|
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
|
|
|
|
|
|
|
if ((rotation == 90) || (rotation == 270))
|
|
|
|
{
|
|
|
|
evas_output_size_set(ee->evas, h, w);
|
|
|
|
evas_output_viewport_set(ee->evas, 0, 0, h, w);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
evas_output_size_set(ee->evas, w, h);
|
|
|
|
evas_output_viewport_set(ee->evas, 0, 0, w, h);
|
|
|
|
}
|
|
|
|
|
2003-09-23 01:09:32 -07:00
|
|
|
einfo = (Evas_Engine_Info_FB *)evas_engine_info_get(ee->evas);
|
|
|
|
if (einfo)
|
|
|
|
{
|
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);
|
|
|
|
fb_ee = ee;
|
2011-04-20 07:15:33 -07:00
|
|
|
|
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);
|
|
|
|
evas_focus_in(ee->evas);
|
|
|
|
|
2003-09-23 01:09:32 -07:00
|
|
|
return ee;
|
2009-04-11 03:31:42 -07:00
|
|
|
}
|
2003-09-23 01:09:32 -07:00
|
|
|
#else
|
2009-04-11 03:31:42 -07:00
|
|
|
EAPI Ecore_Evas *
|
|
|
|
ecore_evas_fb_new(const char *disp_name __UNUSED__, int rotation __UNUSED__, int w __UNUSED__, int h __UNUSED__)
|
|
|
|
{
|
2003-09-23 01:09:32 -07:00
|
|
|
return NULL;
|
|
|
|
}
|
2009-04-11 03:31:42 -07:00
|
|
|
#endif
|