4 * Copyright (c) 2000 - 2011 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>
12 * This library is free software; you can redistribute it and/or modify it under
13 * the terms of the GNU Lesser General Public License as published by the
14 * Free Software Foundation; either version 2.1 of the License, or (at your option)
17 * This library is distributed in the hope that it will be useful, but WITHOUT ANY
18 * WARRANTY; without even the implied warranty of MERCHANTABILITY or
19 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
20 * License for more details.
22 * You should have received a copy of the GNU Lesser General Public License
23 * along with this library; if not, write to the Free Software Foundation, Inc., 51
24 * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
41 #include <Ecore_Input.h>
43 //#include <linux/input.h>
47 #include "probeinfo.h"
51 bool touch_pressed = false;
53 #define HW_EVENT_LOG(_EVENTTYPE, _DETAILTYPE, _X, _Y, _KEYCODE, _EXTRA) \
54 setProbePoint(&probeInfo); \
56 APPEND_LOG_BASIC(LC_UIEVENT); \
57 APPEND_LOG_COMMON_NONE(0); \
58 log.length += sprintf(log.data + log.length, "`,%d`,%d`,%d`,%d`,%s`,%d", \
59 _EVENTTYPE, _DETAILTYPE, _X, _Y, _KEYCODE, _EXTRA); \
60 printLog(&log, MSG_LOG)
62 Eina_Bool ecore_event_evas_key_down(void *data, int type, void *event)
64 static Eina_Bool (*ecore_event_evas_key_downp)(void *data, int type, void *event);
65 DECLARE_COMMON_VARIABLE;
67 GET_REAL_FUNC(ecore_event_evas_key_down, LIBECORE_INPUT_EVAS);
69 if(isOptionEnabled(OPT_EVENT))
74 Ecore_Event_Key* pEv = (Ecore_Event_Key*)event;
75 if(strcasestr(pEv->keyname, "volume") == NULL)
77 HW_EVENT_LOG(_EVENT_KEY, _KEY_PRESSED, 0, 0, pEv->keyname, 0);
83 return ecore_event_evas_key_downp(data, type, event);
86 Eina_Bool ecore_event_evas_key_up(void *data, int type, void *event)
88 static Eina_Bool (*ecore_event_evas_key_upp)(void *data, int type, void *event);
89 DECLARE_COMMON_VARIABLE;
91 GET_REAL_FUNC(ecore_event_evas_key_up, LIBECORE_INPUT_EVAS);
93 if(isOptionEnabled(OPT_EVENT))
98 Ecore_Event_Key* pEv = (Ecore_Event_Key*)event;
99 if(strcasestr(pEv->keyname, "volume") == NULL)
101 HW_EVENT_LOG(_EVENT_KEY, _KEY_RELEASED, 0, 0, pEv->keyname, 0);
107 return ecore_event_evas_key_upp(data, type, event);
110 Eina_Bool ecore_event_evas_mouse_button_down(void *data, int type, void *event)
112 static Eina_Bool (*ecore_event_evas_mouse_button_downp)(void *data, int type, void *event);
113 DECLARE_COMMON_VARIABLE;
115 GET_REAL_FUNC(ecore_event_evas_mouse_button_down, LIBECORE_INPUT_EVAS);
117 if(isOptionEnabled(OPT_EVENT))
122 Ecore_Event_Mouse_Button* pEv = (Ecore_Event_Mouse_Button*)event;
123 touch_pressed = true;
124 HW_EVENT_LOG(_EVENT_TOUCH, _TOUCH_PRESSED, pEv->root.x, pEv->root.y, "", pEv->multi.device);
129 return ecore_event_evas_mouse_button_downp(data, type, event);
132 Eina_Bool ecore_event_evas_mouse_button_up(void *data, int type, void *event)
134 static Eina_Bool (*ecore_event_evas_mouse_button_upp)(void *data, int type, void *event);
135 DECLARE_COMMON_VARIABLE;
137 GET_REAL_FUNC(ecore_event_evas_mouse_button_up, LIBECORE_INPUT_EVAS);
139 if(isOptionEnabled(OPT_EVENT))
144 Ecore_Event_Mouse_Button* pEv = (Ecore_Event_Mouse_Button*)event;
145 touch_pressed = false;
146 HW_EVENT_LOG(_EVENT_TOUCH, _TOUCH_RELEASED, pEv->root.x, pEv->root.y, "", pEv->multi.device);
151 return ecore_event_evas_mouse_button_upp(data, type, event);
154 Eina_Bool ecore_event_evas_mouse_move(void *data, int type, void *event)
156 static Eina_Bool (*ecore_event_evas_mouse_movep)(void *data, int type, void *event);
157 DECLARE_COMMON_VARIABLE;
159 GET_REAL_FUNC(ecore_event_evas_mouse_move, LIBECORE_INPUT_EVAS);
161 if(isOptionEnabled(OPT_EVENT))
168 Ecore_Event_Mouse_Move* pEv = (Ecore_Event_Mouse_Move*)event;
169 HW_EVENT_LOG(_EVENT_TOUCH, _TOUCH_MOVED, pEv->root.x, pEv->root.y, "", pEv->multi.device);
175 return ecore_event_evas_mouse_movep(data, type, event);
180 void evas_event_feed_mouse_down(Evas *e, int b, Evas_Button_Flags flags,
181 unsigned int timestamp, const void *data)
183 static void (*evas_event_feed_mouse_downp)(Evas *e, int b, Evas_Button_Flags flags, unsigned int timestamp, const void *data);
185 DECLARE_COMMON_VARIABLE;
187 GET_REAL_FUNC(evas_event_feed_mouse_down, LIBEVAS);
189 PRE_UNCONDITIONAL_BLOCK_BEGIN();
190 HW_EVENT_LOG(_EVENT_TOUCH, _TOUCH_PRESSED, )
191 PRE_UNCONDITIONAL_BLOCK_END();
194 DECLARE_VARIABLE_EVENT;
197 PRE_PROBEBLOCK_BEGIN_EVENT(evas_event_feed_mouse_down, LIBEVAS, EVENT_TYPE_DOWN);
198 evas_pointer_output_xy_get(e, &x, &y);
199 PRE_PROBEBLOCK_END_EVENT();
201 evas_event_feed_mouse_downp(e, b, flags, timestamp, data);
203 AFTER_ORIGINAL_EVENT(EVENT_TYPE_DOWN, "%d", b);
206 void evas_event_feed_mouse_up(Evas *e, int b, Evas_Button_Flags flags,
207 unsigned int timestamp, const void *data)
209 static void (*evas_event_feed_mouse_upp)(Evas *e, int b, Evas_Button_Flags flags, unsigned int timestamp, const void *data);
211 DECLARE_VARIABLE_EVENT;
214 PRE_PROBEBLOCK_BEGIN_EVENT(evas_event_feed_mouse_up, LIBEVAS, EVENT_TYPE_UP);
215 evas_pointer_output_xy_get(e, &x, &y);
216 PRE_PROBEBLOCK_END_EVENT();
218 evas_event_feed_mouse_upp(e, b, flags, timestamp, data);
220 AFTER_ORIGINAL_EVENT(EVENT_TYPE_UP, "%d", b);
223 void evas_event_feed_mouse_move(Evas *e, int x, int y,
224 unsigned int timestamp, const void *data)
226 static void (*evas_event_feed_mouse_movep)(Evas *e, int x, int y, unsigned int timestamp, const void *data);
228 BEFORE_ORIGINAL_EVENT(evas_event_feed_mouse_move, LIBEVAS, EVENT_TYPE_MOVE);
230 evas_event_feed_mouse_movep(e, x, y, timestamp, data);
232 AFTER_ORIGINAL_EVENT(EVENT_TYPE_MOVE, "%u", timestamp);
235 void evas_event_feed_multi_down(Evas *e, int d, int x, int y,
236 double rad, double radx, double rady,
237 double pres, double ang, double fx, double fy,
238 Evas_Button_Flags flags, unsigned int timestamp, const void *data)
240 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);
242 BEFORE_ORIGINAL_EVENT(evas_event_feed_multi_down, LIBEVAS, EVENT_TYPE_DOWN);
244 evas_event_feed_multi_downp(e, d, x, y, rad, radx,
245 rady, pres, ang, fx, fy, flags, timestamp, data);
247 AFTER_ORIGINAL_EVENT(EVENT_TYPE_DOWN, "%d", d);
250 void evas_event_feed_multi_up(Evas *e, int d, int x, int y, double rad, double radx,
251 double rady, double pres, double ang, double fx, double fy,
252 Evas_Button_Flags flags, unsigned int timestamp, const void *data)
254 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);
256 BEFORE_ORIGINAL_EVENT(evas_event_feed_multi_up, LIBEVAS, EVENT_TYPE_UP);
258 evas_event_feed_multi_upp(e, d, x, y, rad, radx, rady,
259 pres, ang, fx, fy, flags, timestamp, data);
261 AFTER_ORIGINAL_EVENT(EVENT_TYPE_UP, "%d", d);
264 void evas_event_feed_multi_move (Evas *e, int d, int x, int y, double rad, double radx,
265 double rady, double pres, double ang, double fx, double fy,
266 unsigned int timestamp, const void *data)
268 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);
270 BEFORE_ORIGINAL_EVENT(evas_event_feed_multi_move, LIBEVAS, EVENT_TYPE_MOVE);
272 evas_event_feed_multi_movep(e, d, x, y, rad, radx, rady,
273 pres, ang, fx, fy, timestamp, data);
275 AFTER_ORIGINAL_EVENT(EVENT_TYPE_MOVE, "%d", d);