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
This commit is contained in:
Lucas De Marchi 2010-07-02 01:38:05 +00:00
parent 4b7cab6ed4
commit 7051feb04e
12 changed files with 106 additions and 106 deletions

View File

@ -235,7 +235,7 @@ _ecore_config_ipc_ecore_handle_request(Ecore_Ipc_Server * server,
/*****************************************************************************/
static int
static Eina_Bool
_ecore_config_ipc_client_add(void *data, int type __UNUSED__, void *event)
{
Ecore_Ipc_Server **server;
@ -245,13 +245,13 @@ _ecore_config_ipc_client_add(void *data, int type __UNUSED__, void *event)
e = (Ecore_Ipc_Event_Client_Data *) event;
if (*server != ecore_ipc_client_server_get(e->client))
return 1;
return EINA_TRUE;
INF("IPC/eCore: Client connected. @ %p", server);
return 1;
return EINA_TRUE;
}
static int
static Eina_Bool
_ecore_config_ipc_client_del(void *data, int type __UNUSED__, void *event)
{
Ecore_Ipc_Server **server;
@ -261,13 +261,13 @@ _ecore_config_ipc_client_del(void *data, int type __UNUSED__, void *event)
e = (Ecore_Ipc_Event_Client_Data *) event;
if (*server != ecore_ipc_client_server_get(e->client))
return 1;
return EINA_TRUE;
INF("IPC/eCore: Client disconnected. @ %p", server);
return 1;
return EINA_TRUE;
}
static int
static Eina_Bool
_ecore_config_ipc_client_sent(void *data, int type __UNUSED__, void *event)
{
Ecore_Ipc_Server **server;
@ -277,10 +277,10 @@ _ecore_config_ipc_client_sent(void *data, int type __UNUSED__, void *event)
e = (Ecore_Ipc_Event_Client_Data *) event;
if (*server != ecore_ipc_client_server_get(e->client))
return 1;
return EINA_TRUE;
_ecore_config_ipc_ecore_handle_request(*server, e);
return 1;
return EINA_TRUE;
}
/*****************************************************************************/

View File

@ -393,15 +393,15 @@ _ecore_directfb_event_handle_lost_focus(DFBWindowEvent *evt)
* window at a time */
static int
static Eina_Bool
_ecore_directfb_input_event_fd_handler(void *data __UNUSED__,Ecore_Fd_Handler *fd_handler __UNUSED__)
{
DFBEvent evt;
int v = 0;
v = read(_input_event_fd, &evt, sizeof(DFBEvent));
if (v < 0) return 1;
if (v < 1) return 1;
if (v < 0) return EINA_TRUE;
if (v < 1) return EINA_TRUE;
/* we are getting duplicate events, only parse if we are in fullscreen */
//if(_ecore_directfb_fullscreen_window_id == 0) break;
@ -416,18 +416,18 @@ _ecore_directfb_input_event_fd_handler(void *data __UNUSED__,Ecore_Fd_Handler *f
if(evt.input.type == DIET_AXISMOTION)
_ecore_directfb_event_handle_motion(&evt);
return 1;
return EINA_TRUE;
}
static int
static Eina_Bool
_ecore_directfb_window_event_fd_handler(void *data __UNUSED__,Ecore_Fd_Handler *fd_handler __UNUSED__)
{
DFBEvent evt;
int v = 0;
v = read(_window_event_fd, &evt, sizeof(DFBEvent));
if (v < 0) return 1;
if (v < 1) return 1;
if (v < 0) return EINA_TRUE;
if (v < 1) return EINA_TRUE;
if(evt.window.type & DWET_POSITION)
INF("position");
@ -457,7 +457,7 @@ _ecore_directfb_window_event_fd_handler(void *data __UNUSED__,Ecore_Fd_Handler *
_ecore_directfb_event_handle_leave(&evt.window);
if(evt.window.type & DWET_WHEEL)
_ecore_directfb_event_handle_wheel(&evt.window);
return 1;
return EINA_TRUE;
}
/* api functions */

View File

@ -99,20 +99,20 @@ _ecore_evas_cocoa_event_got_focus(void *data __UNUSED__, int type __UNUSED__, vo
return 0;
}
static int
static Eina_Bool
_ecore_evas_cocoa_event_lost_focus(void *data __UNUSED__, int type __UNUSED__, void *event)
{
Ecore_Evas *ee;
ee = _ecore_evas_cocoa_match();
if (!ee) return 1;
if (!ee) return EINA_TRUE;
ee->prop.focused = 0;
return 0;
return EINA_FALSE;
}
static int
static Eina_Bool
_ecore_evas_cocoa_event_video_resize(void *data __UNUSED__, int type __UNUSED__, void *event)
{
/*Ecore_Cocoa_Event_Video_Resize *e;
@ -127,7 +127,7 @@ _ecore_evas_cocoa_event_video_resize(void *data __UNUSED__, int type __UNUSED__,
return 0;*/
}
static int
static Eina_Bool
_ecore_evas_cocoa_event_video_expose(void *data __UNUSED__, int type __UNUSED__, void *event __UNUSED__)
{
Ecore_Evas *ee;
@ -136,11 +136,11 @@ _ecore_evas_cocoa_event_video_expose(void *data __UNUSED__, int type __UNUSED__,
ee = _ecore_evas_cocoa_match();
if (!ee) return 1;
if (!ee) return EINA_TRUE;
evas_output_size_get(ee->evas, &w, &h);
evas_damage_rectangle_add(ee->evas, 0, 0, w, h);
return 0;
return EINA_FALSE;
}
static int

View File

@ -93,7 +93,7 @@ _ecore_evas_directfb_event_key_down(void *data __UNUSED__, int type __UNUSED__,
return 1;
}
static int
static Eina_Bool
_ecore_evas_directfb_event_key_up(void *data __UNUSED__, int type __UNUSED__, void *event)
{
Ecore_Evas *ee;
@ -102,13 +102,13 @@ _ecore_evas_directfb_event_key_up(void *data __UNUSED__, int type __UNUSED__, vo
e = event;
ee = _ecore_evas_directfb_match(e->win);
if (!ee) return 1; /* pass on event */
if (!ee) return EINA_TRUE; /* pass on event */
evas_event_feed_key_up(ee->evas, e->name, e->name, e->string,
e->key_compose, e->time, NULL);
return 1;
return EINA_TRUE;
}
static int
static Eina_Bool
_ecore_evas_directfb_event_motion(void *data __UNUSED__, int type __UNUSED__, void *event)
{
Ecore_Evas *ee;
@ -117,12 +117,12 @@ _ecore_evas_directfb_event_motion(void *data __UNUSED__, int type __UNUSED__, vo
e = event;
ee = _ecore_evas_directfb_match(e->win);
if (!ee) return 1; /* pass on event */
if (!ee) return EINA_TRUE; /* pass on event */
_ecore_evas_mouse_move_process(ee, e->x, e->y, e->time);
return 1;
return EINA_TRUE;
}
static int
static Eina_Bool
_ecore_evas_directfb_event_button_down(void *data __UNUSED__, int type __UNUSED__, void *event)
{
Ecore_Evas *ee;
@ -131,13 +131,13 @@ _ecore_evas_directfb_event_button_down(void *data __UNUSED__, int type __UNUSED_
e = event;
ee = _ecore_evas_directfb_match(e->win);
if (!ee) return 1; /* pass on event */
if (!ee) return EINA_TRUE; /* pass on event */
// _ecore_evas_mouse_move_process(ee, e->x, e->y, e->time);
evas_event_feed_mouse_down(ee->evas, e->button, EVAS_BUTTON_NONE, e->time, NULL);
return 1;
return EINA_TRUE;
}
static int
static Eina_Bool
_ecore_evas_directfb_event_button_up(void *data __UNUSED__, int type __UNUSED__, void *event)
{
Ecore_Evas *ee;
@ -147,13 +147,13 @@ _ecore_evas_directfb_event_button_up(void *data __UNUSED__, int type __UNUSED__,
e = event;
ee = _ecore_evas_directfb_match(e->win);
if (!ee) return 1; /* pass on event */
if (!ee) return EINA_TRUE; /* pass on event */
//_ecore_evas_mouse_move_process(ee, e->x, e->y, e->time);
evas_event_feed_mouse_up(ee->evas, e->button, flags, e->time, NULL);
return 1;
return EINA_TRUE;
}
static int
static Eina_Bool
_ecore_evas_directfb_event_enter(void *data __UNUSED__, int type __UNUSED__, void *event)
{
Ecore_Evas *ee;
@ -162,13 +162,13 @@ _ecore_evas_directfb_event_enter(void *data __UNUSED__, int type __UNUSED__, voi
e = event;
ee = _ecore_evas_directfb_match(e->win);
if (!ee) return 1; /* pass on event */
if (!ee) return EINA_TRUE; /* pass on event */
evas_event_feed_mouse_in(ee->evas, e->time, NULL);
//_ecore_evas_mouse_move_process(ee, e->x, e->y, e->time);
return 1;
return EINA_TRUE;
}
static int
static Eina_Bool
_ecore_evas_directfb_event_leave(void *data __UNUSED__, int type __UNUSED__, void *event)
{
Ecore_Evas *ee;
@ -177,15 +177,15 @@ _ecore_evas_directfb_event_leave(void *data __UNUSED__, int type __UNUSED__, voi
e = event;
ee = _ecore_evas_directfb_match(e->win);
if (!ee) return 1; /* pass on event */
if (!ee) return EINA_TRUE; /* pass on event */
evas_event_feed_mouse_out(ee->evas, e->time, NULL);
//_ecore_evas_mouse_move_process(ee, e->x, e->y, e->time);
if (ee->func.fn_mouse_out) ee->func.fn_mouse_out(ee);
if (ee->prop.cursor.object) evas_object_hide(ee->prop.cursor.object);
return 1;
return EINA_TRUE;
}
static int
static Eina_Bool
_ecore_evas_directfb_event_wheel(void *data __UNUSED__, int type __UNUSED__, void *event)
{
Ecore_Evas *ee;
@ -194,12 +194,12 @@ _ecore_evas_directfb_event_wheel(void *data __UNUSED__, int type __UNUSED__, voi
e = event;
ee = _ecore_evas_directfb_match(e->win);
if (!ee) return 1; /* pass on event */
if (!ee) return EINA_TRUE; /* pass on event */
evas_event_feed_mouse_wheel(ee->evas, e->direction, e->z, e->time, NULL);
return 1;
return EINA_TRUE;
}
static int
static Eina_Bool
_ecore_evas_directfb_event_got_focus(void *data __UNUSED__, int type __UNUSED__, void *event)
{
Ecore_Evas *ee;
@ -208,12 +208,12 @@ _ecore_evas_directfb_event_got_focus(void *data __UNUSED__, int type __UNUSED__,
e = event;
ee = _ecore_evas_directfb_match(e->win);
if (!ee) return 1; /* pass on event */
if (!ee) return EINA_TRUE; /* pass on event */
ee->prop.focused = 1;
return 1;
return EINA_TRUE;
}
static int
static Eina_Bool
_ecore_evas_directfb_event_lost_focus(void *data __UNUSED__, int type __UNUSED__, void *event)
{
Ecore_Evas *ee;
@ -222,9 +222,9 @@ _ecore_evas_directfb_event_lost_focus(void *data __UNUSED__, int type __UNUSED__
e = event;
ee = _ecore_evas_directfb_match(e->win);
if (!ee) return 1; /* pass on event */
if (!ee) return EINA_TRUE; /* pass on event */
ee->prop.focused = 0;
return 1;
return EINA_TRUE;
}
int

View File

@ -107,7 +107,7 @@ _ecore_evas_fb_gain(void *data __UNUSED__)
ecore_fb_input_device_listen(dev, 1);
}
static int
static Eina_Bool
_ecore_evas_event_key_down(void *data __UNUSED__, int type __UNUSED__, void *event)
{
Ecore_Evas *ee;
@ -115,12 +115,12 @@ _ecore_evas_event_key_down(void *data __UNUSED__, int type __UNUSED__, void *eve
e = event;
ee = _ecore_evas_fb_match();
if (!ee) return 1; /* pass on event */
if (!ee) return EINA_TRUE; /* pass on event */
evas_event_feed_key_down(ee->evas, e->keyname, e->keysymbol, e->key_compose, NULL, (unsigned int)((unsigned long long)(ecore_time_get() * 1000.0) & 0xffffffff), NULL);
return 0; /* dont pass it on */
return EINA_FALSE; /* dont pass it on */
}
static int
static Eina_Bool
_ecore_evas_event_key_up(void *data __UNUSED__, int type __UNUSED__, void *event)
{
Ecore_Evas *ee;
@ -128,12 +128,12 @@ _ecore_evas_event_key_up(void *data __UNUSED__, int type __UNUSED__, void *event
e = event;
ee = _ecore_evas_fb_match();
if (!ee) return 1; /* pass on event */
if (!ee) return EINA_TRUE; /* pass on event */
evas_event_feed_key_up(ee->evas, e->keyname, e->keysymbol, e->key_compose, NULL, (unsigned int)((unsigned long long)(ecore_time_get() * 1000.0) & 0xffffffff), NULL);
return 0; /* dont pass it on */
return EINA_FALSE; /* dont pass it on */
}
static int
static Eina_Bool
_ecore_evas_event_mouse_button_down(void *data __UNUSED__, int type __UNUSED__, void *event)
{
Ecore_Evas *ee;
@ -142,15 +142,15 @@ _ecore_evas_event_mouse_button_down(void *data __UNUSED__, int type __UNUSED__,
e = event;
ee = _ecore_evas_fb_match();
if (!ee) return 1; /* pass on event */
if (!ee) return EINA_TRUE; /* pass on event */
_ecore_evas_mouse_move_process_fb(ee, e->x, e->y, (unsigned int)((unsigned long long)(ecore_time_get() * 1000.0) & 0xffffffff));
if (e->double_click) flags |= EVAS_BUTTON_DOUBLE_CLICK;
if (e->triple_click) flags |= EVAS_BUTTON_TRIPLE_CLICK;
evas_event_feed_mouse_down(ee->evas, e->button, flags, (unsigned int)((unsigned long long)(ecore_time_get() * 1000.0) & 0xffffffff), NULL);
return 0; /* dont pass it on */
return EINA_FALSE; /* dont pass it on */
}
static int
static Eina_Bool
_ecore_evas_event_mouse_button_up(void *data __UNUSED__, int type __UNUSED__, void *event)
{
Ecore_Evas *ee;
@ -158,13 +158,13 @@ _ecore_evas_event_mouse_button_up(void *data __UNUSED__, int type __UNUSED__, vo
e = event;
ee = _ecore_evas_fb_match();
if (!ee) return 1; /* pass on event */
if (!ee) return EINA_TRUE; /* pass on event */
_ecore_evas_mouse_move_process_fb(ee, e->x, e->y, (unsigned int)((unsigned long long)(ecore_time_get() * 1000.0) & 0xffffffff));
evas_event_feed_mouse_up(ee->evas, e->button, EVAS_BUTTON_NONE, (unsigned int)((unsigned long long)(ecore_time_get() * 1000.0) & 0xffffffff), NULL);
return 0; /* dont pass it on */
return EINA_FALSE; /* dont pass it on */
}
static int
static Eina_Bool
_ecore_evas_event_mouse_move(void *data __UNUSED__, int type __UNUSED__, void *event)
{
Ecore_Evas *ee;
@ -172,12 +172,12 @@ _ecore_evas_event_mouse_move(void *data __UNUSED__, int type __UNUSED__, void *e
e = event;
ee = _ecore_evas_fb_match();
if (!ee) return 1; /* pass on event */
if (!ee) return EINA_TRUE; /* pass on event */
_ecore_evas_mouse_move_process_fb(ee, e->x, e->y, (unsigned int)((unsigned long long)(ecore_time_get() * 1000.0) & 0xffffffff));
return 0; /* dont pass it on */
return EINA_FALSE; /* dont pass it on */
}
static int
static Eina_Bool
_ecore_evas_event_mouse_wheel(void *data __UNUSED__, int type __UNUSED__, void *event)
{
Ecore_Evas *ee;
@ -185,9 +185,9 @@ _ecore_evas_event_mouse_wheel(void *data __UNUSED__, int type __UNUSED__, void *
e = event;
ee = _ecore_evas_fb_match();
if (!ee) return 1; /* pass on event */
if (!ee) return EINA_TRUE; /* pass on event */
_ecore_evas_mouse_move_process_fb(ee, e->x, e->y, (unsigned int)((unsigned long long)(ecore_time_get() * 1000.0) & 0xffffffff));
return 0; /* dont pass it on */
return EINA_FALSE; /* dont pass it on */
}
static int

View File

@ -128,7 +128,7 @@ static int _ecore_fb_shift = 0;
static int _ecore_fb_lock = 0;
static Ecore_Fd_Handler *_ecore_fb_kbd_fd_handler_handle = NULL;
static int _ecore_fb_kbd_fd_handler(void *data, Ecore_Fd_Handler *fd_handler);
static Eina_Bool _ecore_fb_kbd_fd_handler(void *data, Ecore_Fd_Handler *fd_handler);
static void
_ecore_fb_event_free_key_down(void *data __UNUSED__, void *ev)
@ -153,7 +153,7 @@ _ecore_fb_event_free_key_up(void *data __UNUSED__, void *ev)
free(e);
}
static int
static Eina_Bool
_ecore_fb_kbd_fd_handler(void *data __UNUSED__, Ecore_Fd_Handler *fd_handler __UNUSED__)
{
int v = 0;
@ -163,8 +163,8 @@ _ecore_fb_kbd_fd_handler(void *data __UNUSED__, Ecore_Fd_Handler *fd_handler __U
unsigned char buf;
v = read(_ecore_fb_kbd_fd, &buf, 1);
if (v < 0) return 1;
if (v < 1) return 1;
if (v < 0) return EINA_TRUE;
if (v < 1) return EINA_TRUE;
if (!(buf & 0x80))
{
/* DOWN */
@ -272,7 +272,7 @@ _ecore_fb_kbd_fd_handler(void *data __UNUSED__, Ecore_Fd_Handler *fd_handler __U
;
}
while (v > 0);
return 1;
return EINA_TRUE;
}
int

View File

@ -349,7 +349,7 @@ _ecore_fb_li_device_event_syn(Ecore_Fb_Input_Device *dev, struct input_event *ie
}
}
static int
static Eina_Bool
_ecore_fb_li_device_fd_callback(void *data, Ecore_Fd_Handler *fdh)
{
Ecore_Fb_Input_Device *dev;
@ -381,7 +381,7 @@ _ecore_fb_li_device_fd_callback(void *data, Ecore_Fd_Handler *fdh)
break;
}
}
return 1;
return EINA_TRUE;
}
/*

View File

@ -10,7 +10,7 @@ struct _Ecore_Fb_Ps2_Event
static int _ecore_fb_ps2_event_byte_count = 0;
static Ecore_Fb_Ps2_Event _ecore_fb_ps2_event;
static int _ecore_fb_ps2_fd = 0;
static int _ecore_fb_ps2_fd_handler(void *data, Ecore_Fd_Handler *fd_handler);
static Eina_Bool _ecore_fb_ps2_fd_handler(void *data, Ecore_Fd_Handler *fd_handler);
int
ecore_fb_ps2_init(void)

View File

@ -64,7 +64,7 @@ struct _Ecore_Fb_Ts_Flite
unsigned char brightness;
};
static int _ecore_fb_ts_fd_handler(void *data, Ecore_Fd_Handler *fd_handler);
static Eina_Bool _ecore_fb_ts_fd_handler(void *data, Ecore_Fd_Handler *fd_handler);
static int _ecore_fb_ts_fd = -1;
static int _ecore_fb_ts_event_byte_count = 0;
static int _ecore_fb_ts_apply_cal = 0;

View File

@ -19,7 +19,7 @@ static int _ecore_fb_vt_prev_vt = 0;
static struct termios _ecore_fb_tty_prev_tio_mode;
static struct vt_mode _ecore_fb_vt_prev_mode;
static int _ecore_fb_signal_usr_handler(void *data, int type, void *ev);
static Eina_Bool _ecore_fb_signal_usr_handler(void *data, int type, void *ev);
static Ecore_Event_Handler *_ecore_fb_user_handler = NULL;
static int _ecore_fb_tty_prev_mode = 0;
static int _ecore_fb_tty_prev_kd_mode = 0;
@ -34,7 +34,7 @@ static void *_ecore_fb_func_fb_gain_data = NULL;
static Ecore_Event_Filter *_ecore_fb_filter_handler = NULL;
static void *_ecore_fb_event_filter_start(void *data);
static int _ecore_fb_event_filter_filter(void *data, void *loop_data, int type, void *event);
static Eina_Bool _ecore_fb_event_filter_filter(void *data, void *loop_data, int type, void *event);
static void _ecore_fb_event_filter_end(void *data, void *loop_data);
/* prototypes */
@ -261,23 +261,23 @@ _ecore_fb_event_filter_start(void *data __UNUSED__)
return filter_data;
}
static int
static Eina_Bool
_ecore_fb_event_filter_filter(void *data __UNUSED__, void *loop_data,int type, void *event __UNUSED__)
{
Ecore_Fb_Filter_Data *filter_data;
filter_data = loop_data;
if (!filter_data) return 1;
if (!filter_data) return EINA_TRUE;
if (type == ECORE_FB_EVENT_MOUSE_MOVE)
{
if ((filter_data->last_event_type) == ECORE_FB_EVENT_MOUSE_MOVE)
{
filter_data->last_event_type = type;
return 0;
return EINA_FALSE;
}
}
filter_data->last_event_type = type;
return 1;
return EINA_TRUE;
}
static void

View File

@ -18,7 +18,7 @@ static int _ecore_xcb_key_mask_get(xcb_keysym_t sym);
static int _ecore_xcb_event_modifier(unsigned int state);
static void *_ecore_xcb_event_filter_start(void *data);
static int _ecore_xcb_event_filter_filter(void *data, void *loop_data,int type, void *event);
static Eina_Bool _ecore_xcb_event_filter_filter(void *data, void *loop_data,int type, void *event);
static void _ecore_xcb_event_filter_end(void *data, void *loop_data);
static Ecore_Fd_Handler *_ecore_xcb_fd_handler_handle = NULL;
@ -1026,23 +1026,23 @@ _ecore_xcb_event_filter_start(void *data __UNUSED__)
return filter_data;
}
static int
static Eina_Bool
_ecore_xcb_event_filter_filter(void *data __UNUSED__, void *loop_data,int type, void *event __UNUSED__)
{
Ecore_X_Filter_Data *filter_data;
filter_data = loop_data;
if (!filter_data) return 1;
if (!filter_data) return EINA_TRUE;
if (type == ECORE_EVENT_MOUSE_MOVE)
{
if ((filter_data->last_event_type) == ECORE_EVENT_MOUSE_MOVE)
{
filter_data->last_event_type = type;
return 0;
return EINA_FALSE;
}
}
filter_data->last_event_type = type;
return 1;
return EINA_TRUE;
}
static void

View File

@ -12,16 +12,16 @@
static int _log_dom;
#define INF(...) EINA_LOG_DOM_INFO(_log_dom, __VA_ARGS__)
static int
static Eina_Bool
_quit_cb(void *data)
{
Eina_Bool *val = data;
*val = EINA_TRUE;
ecore_main_loop_quit();
return 0;
return EINA_FALSE;
}
static int
static Eina_Bool
_dummy_cb(void *data)
{
return (int)(long)data;
@ -155,20 +155,20 @@ START_TEST(ecore_test_ecore_main_loop_timer)
}
END_TEST
static int _timer3(void *data)
static Eina_Bool _timer3(void *data)
{
/* timer 3, do nothing */
return 0;
return EINA_FALSE;
}
static int _timer2(void *data)
static Eina_Bool _timer2(void *data)
{
/* timer 2, quit inner mainloop */
ecore_main_loop_quit();
return 0;
return EINA_FALSE;
}
static int _timer1(void *data)
static Eina_Bool _timer1(void *data)
{
/* timer 1, begin inner mainloop */
int *times = data;
@ -180,7 +180,7 @@ static int _timer1(void *data)
ecore_main_loop_quit();
return 0;
return EINA_FALSE;
}
START_TEST(ecore_test_ecore_main_loop_timer_inner)
@ -198,13 +198,13 @@ START_TEST(ecore_test_ecore_main_loop_timer_inner)
}
END_TEST
static int
static Eina_Bool
_fd_handler_cb(void *data, Ecore_Fd_Handler *handler __UNUSED__)
{
Eina_Bool *val = data;
*val = EINA_TRUE;
ecore_main_loop_quit();
return 0;
return EINA_FALSE;
}
START_TEST(ecore_test_ecore_main_loop_fd_handler)
@ -239,13 +239,13 @@ START_TEST(ecore_test_ecore_main_loop_fd_handler)
}
END_TEST
static int
static Eina_Bool
_event_handler_cb(void *data, int type __UNUSED__, void *event __UNUSED__)
{
Eina_Bool *val = data;
*val = EINA_TRUE;
ecore_main_loop_quit();
return 0;
return EINA_FALSE;
}
START_TEST(ecore_test_ecore_main_loop_event)
@ -276,16 +276,16 @@ START_TEST(ecore_test_ecore_main_loop_event)
}
END_TEST
static int
static Eina_Bool
_timer_quit_recursive(void *data)
{
INF(" _timer_quit_recursive: begin");
ecore_main_loop_quit(); /* quits inner main loop */
INF(" _timer_quit_recursive: end");
return 0;
return EINA_FALSE;
}
static int
static Eina_Bool
_event_recursive_cb(void *data, int type, void *event)
{
Ecore_Event *e;
@ -308,7 +308,7 @@ _event_recursive_cb(void *data, int type, void *event)
INF(" guard = %d", guard);
INF(" event_recursive_cb: end");
return 0;
return EINA_FALSE;
}