4 * Copyright (c) 2000 - 2013 Samsung Electronics Co., Ltd. All rights reserved.
8 * Jaewon Lim <jaewon81.lim@samsung.com>
9 * Woojin Jung <woojin2.jung@samsung.com>
10 * Juyoung Kim <j0.kim@samsung.com>
11 * Anastasia Lyupa <a.lyupa@samsung.com>
13 * This library is free software; you can redistribute it and/or modify it under
14 * the terms of the GNU Lesser General Public License as published by the
15 * Free Software Foundation; either version 2.1 of the License, or (at your option)
18 * This library is distributed in the hope that it will be useful, but WITHOUT ANY
19 * WARRANTY; without even the implied warranty of MERCHANTABILITY or
20 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
21 * License for more details.
23 * You should have received a copy of the GNU Lesser General Public License
24 * along with this library; if not, write to the Free Software Foundation, Inc., 51
25 * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
29 * - Samsung RnD Institute Russia
43 #include <Ecore_Input.h>
45 //#include <linux/input.h>
49 #include "probeinfo.h"
55 bool touch_pressed = false;
57 #define PACK_HW_EVENT(API_ID, _EVENTTYPE, _DETAILTYPE, _X, _Y, _KEYCODE, _EXTRA, \
58 _ARGDATA, _ARGTYPE, _ARGEVENT) \
60 setProbePoint(&probeInfo); \
61 PREPARE_LOCAL_BUF(); \
62 PACK_COMMON_BEGIN(MSG_PROBE_UIEVENT, API_ID, "pdp", \
63 voidp_to_uint64(_ARGDATA), _ARGTYPE, \
64 voidp_to_uint64(_ARGEVENT)); \
65 PACK_COMMON_END('c', 0, 0, 0); \
66 PACK_UIEVENT(_EVENTTYPE, _DETAILTYPE, _X, _Y, _KEYCODE, _EXTRA); \
70 Eina_Bool ecore_event_evas_key_down(void *data, int type, void *event)
72 static Eina_Bool (*ecore_event_evas_key_downp)(void *data, int type, void *event);
73 probeInfo_t probeInfo;
75 GET_REAL_FUNC(ecore_event_evas_key_down, LIBECORE_INPUT_EVAS);
77 if(isOptionEnabled(OPT_EVENT))
82 Ecore_Event_Key* pEv = (Ecore_Event_Key*)event;
83 if(strcasestr(pEv->keyname, "volume") == NULL)
85 PACK_HW_EVENT(API_ID_ecore_event_evas_key_down,
86 _EVENT_KEY, _KEY_PRESSED, 0, 0, pEv->keyname, 0, \
93 return ecore_event_evas_key_downp(data, type, event);
96 Eina_Bool ecore_event_evas_key_up(void *data, int type, void *event)
98 static Eina_Bool (*ecore_event_evas_key_upp)(void *data, int type, void *event);
99 probeInfo_t probeInfo;
101 GET_REAL_FUNC(ecore_event_evas_key_up, LIBECORE_INPUT_EVAS);
103 if(isOptionEnabled(OPT_EVENT))
108 Ecore_Event_Key* pEv = (Ecore_Event_Key*)event;
109 if(strcasestr(pEv->keyname, "volume") == NULL)
111 PACK_HW_EVENT(API_ID_ecore_event_evas_key_up,
112 _EVENT_KEY, _KEY_RELEASED, 0, 0, pEv->keyname, 0, \
119 return ecore_event_evas_key_upp(data, type, event);
122 Eina_Bool ecore_event_evas_mouse_button_down(void *data, int type, void *event)
124 static Eina_Bool (*ecore_event_evas_mouse_button_downp)(void *data, int type, void *event);
125 probeInfo_t probeInfo;
127 GET_REAL_FUNC(ecore_event_evas_mouse_button_down, LIBECORE_INPUT_EVAS);
129 if(isOptionEnabled(OPT_EVENT))
134 Ecore_Event_Mouse_Button* pEv = (Ecore_Event_Mouse_Button*)event;
135 touch_pressed = true;
136 PACK_HW_EVENT(API_ID_ecore_event_evas_mouse_button_down,
137 _EVENT_TOUCH, _TOUCH_PRESSED, pEv->root.x, pEv->root.y, "", pEv->multi.device, \
143 return ecore_event_evas_mouse_button_downp(data, type, event);
146 Eina_Bool ecore_event_evas_mouse_button_up(void *data, int type, void *event)
148 static Eina_Bool (*ecore_event_evas_mouse_button_upp)(void *data, int type, void *event);
149 probeInfo_t probeInfo;
151 GET_REAL_FUNC(ecore_event_evas_mouse_button_up, LIBECORE_INPUT_EVAS);
153 if(isOptionEnabled(OPT_EVENT))
158 Ecore_Event_Mouse_Button* pEv = (Ecore_Event_Mouse_Button*)event;
159 touch_pressed = false;
160 PACK_HW_EVENT(API_ID_ecore_event_evas_mouse_button_up,
161 _EVENT_TOUCH, _TOUCH_RELEASED, pEv->root.x, pEv->root.y, "", pEv->multi.device, \
167 return ecore_event_evas_mouse_button_upp(data, type, event);
170 Eina_Bool ecore_event_evas_mouse_move(void *data, int type, void *event)
172 static Eina_Bool (*ecore_event_evas_mouse_movep)(void *data, int type, void *event);
173 probeInfo_t probeInfo;
175 GET_REAL_FUNC(ecore_event_evas_mouse_move, LIBECORE_INPUT_EVAS);
177 if(isOptionEnabled(OPT_EVENT))
184 Ecore_Event_Mouse_Move* pEv = (Ecore_Event_Mouse_Move*)event;
185 PACK_HW_EVENT(API_ID_ecore_event_evas_mouse_move,
186 _EVENT_TOUCH, _TOUCH_MOVED, pEv->root.x, pEv->root.y, "", pEv->multi.device, \
193 return ecore_event_evas_mouse_movep(data, type, event);
198 void evas_event_feed_mouse_down(Evas *e, int b, Evas_Button_Flags flags,
199 unsigned int timestamp, const void *data)
201 static void (*evas_event_feed_mouse_downp)(Evas *e, int b, Evas_Button_Flags flags, unsigned int timestamp, const void *data);
203 probeInfo_t probeInfo;
205 GET_REAL_FUNC(evas_event_feed_mouse_down, LIBEVAS);
207 PRE_UNCONDITIONAL_BLOCK_BEGIN();
208 HW_EVENT_LOG(_EVENT_TOUCH, _TOUCH_PRESSED, )
209 PRE_UNCONDITIONAL_BLOCK_END();
212 DECLARE_VARIABLE_EVENT;
215 PRE_PROBEBLOCK_BEGIN_EVENT(evas_event_feed_mouse_down, LIBEVAS, EVENT_TYPE_DOWN);
216 evas_pointer_output_xy_get(e, &x, &y);
217 PRE_PROBEBLOCK_END_EVENT();
219 evas_event_feed_mouse_downp(e, b, flags, timestamp, data);
221 AFTER_ORIGINAL_EVENT(EVENT_TYPE_DOWN, "%d", b);
224 void evas_event_feed_mouse_up(Evas *e, int b, Evas_Button_Flags flags,
225 unsigned int timestamp, const void *data)
227 static void (*evas_event_feed_mouse_upp)(Evas *e, int b, Evas_Button_Flags flags, unsigned int timestamp, const void *data);
229 DECLARE_VARIABLE_EVENT;
232 PRE_PROBEBLOCK_BEGIN_EVENT(evas_event_feed_mouse_up, LIBEVAS, EVENT_TYPE_UP);
233 evas_pointer_output_xy_get(e, &x, &y);
234 PRE_PROBEBLOCK_END_EVENT();
236 evas_event_feed_mouse_upp(e, b, flags, timestamp, data);
238 AFTER_ORIGINAL_EVENT(EVENT_TYPE_UP, "%d", b);
241 void evas_event_feed_mouse_move(Evas *e, int x, int y,
242 unsigned int timestamp, const void *data)
244 static void (*evas_event_feed_mouse_movep)(Evas *e, int x, int y, unsigned int timestamp, const void *data);
246 BEFORE_ORIGINAL_EVENT(evas_event_feed_mouse_move, LIBEVAS, EVENT_TYPE_MOVE);
248 evas_event_feed_mouse_movep(e, x, y, timestamp, data);
250 AFTER_ORIGINAL_EVENT(EVENT_TYPE_MOVE, "%u", timestamp);
253 void evas_event_feed_multi_down(Evas *e, int d, int x, int y,
254 double rad, double radx, double rady,
255 double pres, double ang, double fx, double fy,
256 Evas_Button_Flags flags, unsigned int timestamp, const void *data)
258 static void (*evas_event_feed_multi_downp)(Evas *e, int d, int x, int y, double rad, double radx, double rady, double pres, double ang, double fx, double fy, Evas_Button_Flags flags, unsigned int timestamp, const void *data);
260 BEFORE_ORIGINAL_EVENT(evas_event_feed_multi_down, LIBEVAS, EVENT_TYPE_DOWN);
262 evas_event_feed_multi_downp(e, d, x, y, rad, radx,
263 rady, pres, ang, fx, fy, flags, timestamp, data);
265 AFTER_ORIGINAL_EVENT(EVENT_TYPE_DOWN, "%d", d);
268 void evas_event_feed_multi_up(Evas *e, int d, int x, int y, double rad, double radx,
269 double rady, double pres, double ang, double fx, double fy,
270 Evas_Button_Flags flags, unsigned int timestamp, const void *data)
272 static void (*evas_event_feed_multi_upp)(Evas *e, int d, int x, int y, double rad, double radx, double rady, double pres, double ang, double fx, double fy, Evas_Button_Flags flags, unsigned int timestamp, const void *data);
274 BEFORE_ORIGINAL_EVENT(evas_event_feed_multi_up, LIBEVAS, EVENT_TYPE_UP);
276 evas_event_feed_multi_upp(e, d, x, y, rad, radx, rady,
277 pres, ang, fx, fy, flags, timestamp, data);
279 AFTER_ORIGINAL_EVENT(EVENT_TYPE_UP, "%d", d);
282 void evas_event_feed_multi_move (Evas *e, int d, int x, int y, double rad, double radx,
283 double rady, double pres, double ang, double fx, double fy,
284 unsigned int timestamp, const void *data)
286 static void (*evas_event_feed_multi_movep)(Evas *e, int d, int x, int y, double rad, double radx, double rady, double pres, double ang, double fx, double fy, unsigned int timestamp, const void *data);
288 BEFORE_ORIGINAL_EVENT(evas_event_feed_multi_move, LIBEVAS, EVENT_TYPE_MOVE);
290 evas_event_feed_multi_movep(e, d, x, y, rad, radx, rady,
291 pres, ang, fx, fy, timestamp, data);
293 AFTER_ORIGINAL_EVENT(EVENT_TYPE_MOVE, "%d", d);