summaryrefslogtreecommitdiff
path: root/legacy/ecore
diff options
context:
space:
mode:
authorVincent Torri <vincent.torri@gmail.com>2010-09-30 07:24:46 +0000
committerVincent Torri <vincent.torri@gmail.com>2010-09-30 07:24:46 +0000
commit586334710d39f761b3bef30b8e1f8d8832aa536f (patch)
tree12680212b78d5ce54f97c437f25db4f9256a3f08 /legacy/ecore
parent16263f52cc03ca65151ad8804506415ae4381ccf (diff)
tab--
SVN revision: 52919
Diffstat (limited to '')
-rw-r--r--legacy/ecore/src/lib/ecore_fb/ecore_fb.c12
-rw-r--r--legacy/ecore/src/lib/ecore_fb/ecore_fb_kbd.c184
-rw-r--r--legacy/ecore/src/lib/ecore_fb/ecore_fb_keytable.h2
-rw-r--r--legacy/ecore/src/lib/ecore_fb/ecore_fb_li.c4
-rw-r--r--legacy/ecore/src/lib/ecore_fb/ecore_fb_private.h58
-rw-r--r--legacy/ecore/src/lib/ecore_fb/ecore_fb_ps2.c184
-rw-r--r--legacy/ecore/src/lib/ecore_fb/ecore_fb_ts.c202
-rw-r--r--legacy/ecore/src/lib/ecore_fb/ecore_fb_vt.c14
8 files changed, 330 insertions, 330 deletions
diff --git a/legacy/ecore/src/lib/ecore_fb/ecore_fb.c b/legacy/ecore/src/lib/ecore_fb/ecore_fb.c
index ebc9631ea5..7725ca2c5d 100644
--- a/legacy/ecore/src/lib/ecore_fb/ecore_fb.c
+++ b/legacy/ecore/src/lib/ecore_fb/ecore_fb.c
@@ -90,16 +90,16 @@ _ecore_fb_size_get(int *w, int *h)
90 fb = open("/dev/fb0", O_RDWR); 90 fb = open("/dev/fb0", O_RDWR);
91 if (fb < 0) 91 if (fb < 0)
92 { 92 {
93 if (w) *w = 0; 93 if (w) *w = 0;
94 if (h) *h = 0; 94 if (h) *h = 0;
95 return; 95 return;
96 } 96 }
97 if (ioctl(fb, FBIOGET_VSCREENINFO, &fb_var) == -1) 97 if (ioctl(fb, FBIOGET_VSCREENINFO, &fb_var) == -1)
98 { 98 {
99 if (w) *w = 0; 99 if (w) *w = 0;
100 if (h) *h = 0; 100 if (h) *h = 0;
101 close(fb); 101 close(fb);
102 return; 102 return;
103 } 103 }
104 close(fb); 104 close(fb);
105 if (w) *w = fb_var.xres; 105 if (w) *w = fb_var.xres;
diff --git a/legacy/ecore/src/lib/ecore_fb/ecore_fb_kbd.c b/legacy/ecore/src/lib/ecore_fb/ecore_fb_kbd.c
index 6d31a785a0..5d2a6a69d5 100644
--- a/legacy/ecore/src/lib/ecore_fb/ecore_fb_kbd.c
+++ b/legacy/ecore/src/lib/ecore_fb/ecore_fb_kbd.c
@@ -160,116 +160,116 @@ _ecore_fb_kbd_fd_handler(void *data __UNUSED__, Ecore_Fd_Handler *fd_handler __U
160 160
161 do 161 do
162 { 162 {
163 unsigned char buf; 163 unsigned char buf;
164 164
165 v = read(_ecore_fb_kbd_fd, &buf, 1); 165 v = read(_ecore_fb_kbd_fd, &buf, 1);
166 if (v < 0) return EINA_TRUE; 166 if (v < 0) return EINA_TRUE;
167 if (v < 1) return EINA_TRUE; 167 if (v < 1) return EINA_TRUE;
168 if (!(buf & 0x80)) 168 if (!(buf & 0x80))
169 { 169 {
170 /* DOWN */ 170 /* DOWN */
171 int vt_switch = -1; 171 int vt_switch = -1;
172 Ecore_Fb_Event_Key_Down *e; 172 Ecore_Fb_Event_Key_Down *e;
173 173
174 e = calloc(1, sizeof(Ecore_Fb_Event_Key_Down)); 174 e = calloc(1, sizeof(Ecore_Fb_Event_Key_Down));
175 if (!e) goto retry; 175 if (!e) goto retry;
176 if (_ecore_fb_kbd_fd == _ecore_fb_tty_fd) 176 if (_ecore_fb_kbd_fd == _ecore_fb_tty_fd)
177 { 177 {
178 int add = 0; 178 int add = 0;
179 179
180 if (_ecore_fb_shift) add = 1; 180 if (_ecore_fb_shift) add = 1;
181 else if (_ecore_fb_lock) add = 2; 181 else if (_ecore_fb_lock) add = 2;
182 e->keyname = strdup(_ecore_fb_kbd_syms[(buf & 0x7f) * 6]); 182 e->keyname = strdup(_ecore_fb_kbd_syms[(buf & 0x7f) * 6]);
183 e->keysymbol = strdup(_ecore_fb_kbd_syms[((buf & 0x7f) * 6) + add]); 183 e->keysymbol = strdup(_ecore_fb_kbd_syms[((buf & 0x7f) * 6) + add]);
184 e->key_compose = strdup(_ecore_fb_kbd_syms[((buf & 0x7f) * 6) + 3 + add]); 184 e->key_compose = strdup(_ecore_fb_kbd_syms[((buf & 0x7f) * 6) + 3 + add]);
185 } 185 }
186 else 186 else
187 e->keyname = strdup(_ecore_fb_btn_syms[buf & 0x7f]); 187 e->keyname = strdup(_ecore_fb_btn_syms[buf & 0x7f]);
188 if (!e->keyname) 188 if (!e->keyname)
189 { 189 {
190 free(e); 190 free(e);
191 goto retry; 191 goto retry;
192 } 192 }
193 ecore_event_add(ECORE_FB_EVENT_KEY_DOWN, e, _ecore_fb_event_free_key_down, NULL); 193 ecore_event_add(ECORE_FB_EVENT_KEY_DOWN, e, _ecore_fb_event_free_key_down, NULL);
194 if (!strcmp(e->keyname, "Control_L")) 194 if (!strcmp(e->keyname, "Control_L"))
195 _ecore_fb_ctrl++; 195 _ecore_fb_ctrl++;
196 else if (!strcmp(e->keyname, "Control_R")) 196 else if (!strcmp(e->keyname, "Control_R"))
197 _ecore_fb_ctrl++; 197 _ecore_fb_ctrl++;
198 else if (!strcmp(e->keyname, "Alt_L")) 198 else if (!strcmp(e->keyname, "Alt_L"))
199 _ecore_fb_alt++; 199 _ecore_fb_alt++;
200 else if (!strcmp(e->keyname, "Alt_R")) 200 else if (!strcmp(e->keyname, "Alt_R"))
201 _ecore_fb_alt++; 201 _ecore_fb_alt++;
202 else if (!strcmp(e->keyname, "Shift_L")) 202 else if (!strcmp(e->keyname, "Shift_L"))
203 _ecore_fb_shift++; 203 _ecore_fb_shift++;
204 else if (!strcmp(e->keyname, "Shift_R")) 204 else if (!strcmp(e->keyname, "Shift_R"))
205 _ecore_fb_shift++; 205 _ecore_fb_shift++;
206 else if (!strcmp(e->keyname, "Caps_Lock")) 206 else if (!strcmp(e->keyname, "Caps_Lock"))
207 _ecore_fb_lock++; 207 _ecore_fb_lock++;
208 else if (!strcmp(e->keyname, "F1")) vt_switch = 0; 208 else if (!strcmp(e->keyname, "F1")) vt_switch = 0;
209 else if (!strcmp(e->keyname, "F2")) vt_switch = 1; 209 else if (!strcmp(e->keyname, "F2")) vt_switch = 1;
210 else if (!strcmp(e->keyname, "F3")) vt_switch = 2; 210 else if (!strcmp(e->keyname, "F3")) vt_switch = 2;
211 else if (!strcmp(e->keyname, "F4")) vt_switch = 3; 211 else if (!strcmp(e->keyname, "F4")) vt_switch = 3;
212 else if (!strcmp(e->keyname, "F5")) vt_switch = 4; 212 else if (!strcmp(e->keyname, "F5")) vt_switch = 4;
213 else if (!strcmp(e->keyname, "F6")) vt_switch = 5; 213 else if (!strcmp(e->keyname, "F6")) vt_switch = 5;
214 else if (!strcmp(e->keyname, "F7")) vt_switch = 6; 214 else if (!strcmp(e->keyname, "F7")) vt_switch = 6;
215 else if (!strcmp(e->keyname, "F8")) vt_switch = 7; 215 else if (!strcmp(e->keyname, "F8")) vt_switch = 7;
216 else if (!strcmp(e->keyname, "F9")) vt_switch = 8; 216 else if (!strcmp(e->keyname, "F9")) vt_switch = 8;
217 else if (!strcmp(e->keyname, "F10")) vt_switch = 9; 217 else if (!strcmp(e->keyname, "F10")) vt_switch = 9;
218 else if (!strcmp(e->keyname, "F11")) vt_switch = 10; 218 else if (!strcmp(e->keyname, "F11")) vt_switch = 10;
219 else if (!strcmp(e->keyname, "F12")) vt_switch = 11; 219 else if (!strcmp(e->keyname, "F12")) vt_switch = 11;
220 if (_ecore_fb_ctrl > 2) _ecore_fb_ctrl = 2; 220 if (_ecore_fb_ctrl > 2) _ecore_fb_ctrl = 2;
221 if (_ecore_fb_alt > 2) _ecore_fb_alt = 2; 221 if (_ecore_fb_alt > 2) _ecore_fb_alt = 2;
222 if ((vt_switch >= 0) && 222 if ((vt_switch >= 0) &&
223 (_ecore_fb_ctrl) && 223 (_ecore_fb_ctrl) &&
224 (_ecore_fb_alt)) 224 (_ecore_fb_alt))
225 _ecore_fb_vt_switch(vt_switch); 225 _ecore_fb_vt_switch(vt_switch);
226 } 226 }
227 else 227 else
228 { 228 {
229 /* UP */ 229 /* UP */
230 Ecore_Fb_Event_Key_Up *e; 230 Ecore_Fb_Event_Key_Up *e;
231 231
232 e = calloc(1, sizeof(Ecore_Fb_Event_Key_Up)); 232 e = calloc(1, sizeof(Ecore_Fb_Event_Key_Up));
233 if (!e) goto retry; 233 if (!e) goto retry;
234 if (_ecore_fb_kbd_fd == _ecore_fb_tty_fd) 234 if (_ecore_fb_kbd_fd == _ecore_fb_tty_fd)
235 { 235 {
236 int add = 0; 236 int add = 0;
237 237
238 if (_ecore_fb_shift) add = 1; 238 if (_ecore_fb_shift) add = 1;
239 else if (_ecore_fb_lock) add = 2; 239 else if (_ecore_fb_lock) add = 2;
240 e->keyname = strdup(_ecore_fb_kbd_syms[(buf & 0x7f) * 6]); 240 e->keyname = strdup(_ecore_fb_kbd_syms[(buf & 0x7f) * 6]);
241 e->keysymbol = strdup(_ecore_fb_kbd_syms[((buf & 0x7f) * 6) + add]); 241 e->keysymbol = strdup(_ecore_fb_kbd_syms[((buf & 0x7f) * 6) + add]);
242 e->key_compose = strdup(_ecore_fb_kbd_syms[((buf & 0x7f) * 6) + 3 + add]); 242 e->key_compose = strdup(_ecore_fb_kbd_syms[((buf & 0x7f) * 6) + 3 + add]);
243 } 243 }
244 else 244 else
245 e->keyname = strdup(_ecore_fb_btn_syms[buf & 0x7f]); 245 e->keyname = strdup(_ecore_fb_btn_syms[buf & 0x7f]);
246 if (!e->keyname) 246 if (!e->keyname)
247 { 247 {
248 free(e); 248 free(e);
249 goto retry; 249 goto retry;
250 } 250 }
251 ecore_event_add(ECORE_FB_EVENT_KEY_UP, e, _ecore_fb_event_free_key_up, NULL); 251 ecore_event_add(ECORE_FB_EVENT_KEY_UP, e, _ecore_fb_event_free_key_up, NULL);
252 if (!strcmp(e->keyname, "Control_L")) 252 if (!strcmp(e->keyname, "Control_L"))
253 _ecore_fb_ctrl--; 253 _ecore_fb_ctrl--;
254 else if (!strcmp(e->keyname, "Control_R")) 254 else if (!strcmp(e->keyname, "Control_R"))
255 _ecore_fb_ctrl--; 255 _ecore_fb_ctrl--;
256 else if (!strcmp(e->keyname, "Alt_L")) 256 else if (!strcmp(e->keyname, "Alt_L"))
257 _ecore_fb_alt--; 257 _ecore_fb_alt--;
258 else if (!strcmp(e->keyname, "Alt_R")) 258 else if (!strcmp(e->keyname, "Alt_R"))
259 _ecore_fb_alt--; 259 _ecore_fb_alt--;
260 else if (!strcmp(e->keyname, "Shift_L")) 260 else if (!strcmp(e->keyname, "Shift_L"))
261 _ecore_fb_shift--; 261 _ecore_fb_shift--;
262 else if (!strcmp(e->keyname, "Shift_R")) 262 else if (!strcmp(e->keyname, "Shift_R"))
263 _ecore_fb_shift--; 263 _ecore_fb_shift--;
264 else if (!strcmp(e->keyname, "Caps_Lock")) 264 else if (!strcmp(e->keyname, "Caps_Lock"))
265 _ecore_fb_lock--; 265 _ecore_fb_lock--;
266 if (_ecore_fb_ctrl < 0) _ecore_fb_ctrl = 0; 266 if (_ecore_fb_ctrl < 0) _ecore_fb_ctrl = 0;
267 if (_ecore_fb_alt < 0) _ecore_fb_alt = 0; 267 if (_ecore_fb_alt < 0) _ecore_fb_alt = 0;
268 if (_ecore_fb_shift < 0) _ecore_fb_shift = 0; 268 if (_ecore_fb_shift < 0) _ecore_fb_shift = 0;
269 if (_ecore_fb_lock < 0) _ecore_fb_lock = 0; 269 if (_ecore_fb_lock < 0) _ecore_fb_lock = 0;
270 } 270 }
271retry: 271retry:
272 ; 272 ;
273 } 273 }
274 while (v > 0); 274 while (v > 0);
275 return EINA_TRUE; 275 return EINA_TRUE;
diff --git a/legacy/ecore/src/lib/ecore_fb/ecore_fb_keytable.h b/legacy/ecore/src/lib/ecore_fb/ecore_fb_keytable.h
index ff03497ac6..c943cfd8c3 100644
--- a/legacy/ecore/src/lib/ecore_fb/ecore_fb_keytable.h
+++ b/legacy/ecore/src/lib/ecore_fb/ecore_fb_keytable.h
@@ -83,7 +83,7 @@
83 "KP_Next", "KP_3", "KP_Next", /**/"", "3", "",/***/ 83 "KP_Next", "KP_3", "KP_Next", /**/"", "3", "",/***/
84 "KP_Insert", "KP_0", "KP_Insert", /**/"", "0", "",/***/ 84 "KP_Insert", "KP_0", "KP_Insert", /**/"", "0", "",/***/
85 "KP_Delete", "KP_Decimal", "KP_Delete", /**/"", ".", "",/***/ 85 "KP_Delete", "KP_Decimal", "KP_Delete", /**/"", ".", "",/***/
86 "0x54", "0x54", "0x54", /**/"", "", "",/***/ 86 "0x54", "0x54", "0x54", /**/"", "", "",/***/
87 "0x55", "0x55", "0x55", /**/"", "", "",/***/ 87 "0x55", "0x55", "0x55", /**/"", "", "",/***/
88 "0x56", "0x56", "0x56", /**/"", "", "",/***/ 88 "0x56", "0x56", "0x56", /**/"", "", "",/***/
89 "F11", "F11", "F11", /**/"", "", "",/***/ 89 "F11", "F11", "F11", /**/"", "", "",/***/
diff --git a/legacy/ecore/src/lib/ecore_fb/ecore_fb_li.c b/legacy/ecore/src/lib/ecore_fb/ecore_fb_li.c
index ff3f86c397..e93679174b 100644
--- a/legacy/ecore/src/lib/ecore_fb/ecore_fb_li.c
+++ b/legacy/ecore/src/lib/ecore_fb/ecore_fb_li.c
@@ -22,7 +22,7 @@ static const char *_ecore_fb_li_kbd_syms[128 * 6] =
22 * Moved to static inline in order to force compiler to otimized 22 * Moved to static inline in order to force compiler to otimized
23 * the unsued part away or force a link error if long has an unexpected 23 * the unsued part away or force a link error if long has an unexpected
24 * size. 24 * size.
25 * - bigeasy 25 * - bigeasy
26 */ 26 */
27extern int long_has_neither_32_nor_64_bits(void); 27extern int long_has_neither_32_nor_64_bits(void);
28static inline int 28static inline int
@@ -385,7 +385,7 @@ ecore_fb_input_device_listen(Ecore_Fb_Input_Device *dev, Eina_Bool listen)
385} 385}
386 386
387#ifndef EV_CNT 387#ifndef EV_CNT
388# define EV_CNT (EV_MAX+1) 388# define EV_CNT (EV_MAX+1)
389#endif 389#endif
390 390
391/* 391/*
diff --git a/legacy/ecore/src/lib/ecore_fb/ecore_fb_private.h b/legacy/ecore/src/lib/ecore_fb/ecore_fb_private.h
index 121f69e14f..0b51bc78ef 100644
--- a/legacy/ecore/src/lib/ecore_fb/ecore_fb_private.h
+++ b/legacy/ecore/src/lib/ecore_fb/ecore_fb_private.h
@@ -32,35 +32,35 @@
32/* ecore_fb_li.c */ 32/* ecore_fb_li.c */
33struct _Ecore_Fb_Input_Device 33struct _Ecore_Fb_Input_Device
34{ 34{
35 int fd; 35 int fd;
36 Ecore_Fd_Handler *handler; 36 Ecore_Fd_Handler *handler;
37 int listen; 37 int listen;
38 struct { 38 struct {
39 Ecore_Fb_Input_Device_Cap cap; 39 Ecore_Fb_Input_Device_Cap cap;
40 char *name; 40 char *name;
41 char *dev; 41 char *dev;
42 } info; 42 } info;
43 struct 43 struct
44 { 44 {
45 /* common mouse */ 45 /* common mouse */
46 int x,y; 46 int x,y;
47 int w,h; 47 int w,h;
48 48
49 double last; 49 double last;
50 double prev; 50 double prev;
51 double threshold; 51 double threshold;
52 /* absolute axis */ 52 /* absolute axis */
53 int min_w, min_h; 53 int min_w, min_h;
54 double rel_w, rel_h; 54 double rel_w, rel_h;
55 int event; 55 int event;
56 } mouse; 56 } mouse;
57 struct 57 struct
58 { 58 {
59 int shift; 59 int shift;
60 int ctrl; 60 int ctrl;
61 int alt; 61 int alt;
62 int lock; 62 int lock;
63 } keyboard; 63 } keyboard;
64}; 64};
65 65
66/* ecore_fb_ts.c */ 66/* ecore_fb_ts.c */
diff --git a/legacy/ecore/src/lib/ecore_fb/ecore_fb_ps2.c b/legacy/ecore/src/lib/ecore_fb/ecore_fb_ps2.c
index 888a18ee90..edd19728f1 100644
--- a/legacy/ecore/src/lib/ecore_fb/ecore_fb_ps2.c
+++ b/legacy/ecore/src/lib/ecore_fb/ecore_fb_ps2.c
@@ -18,17 +18,17 @@ ecore_fb_ps2_init(void)
18 _ecore_fb_ps2_fd = open("/dev/psaux", O_RDWR); 18 _ecore_fb_ps2_fd = open("/dev/psaux", O_RDWR);
19 if (_ecore_fb_ps2_fd >= 0) 19 if (_ecore_fb_ps2_fd >= 0)
20 { 20 {
21 prev_flags = fcntl(_ecore_fb_ps2_fd, F_GETFL); 21 prev_flags = fcntl(_ecore_fb_ps2_fd, F_GETFL);
22 fcntl(_ecore_fb_ps2_fd, F_SETFL, prev_flags | O_NONBLOCK); 22 fcntl(_ecore_fb_ps2_fd, F_SETFL, prev_flags | O_NONBLOCK);
23 _ecore_fb_ts_fd_handler_handle = ecore_main_fd_handler_add(_ecore_fb_ps2_fd, 23 _ecore_fb_ts_fd_handler_handle = ecore_main_fd_handler_add(_ecore_fb_ps2_fd,
24 ECORE_FD_READ, 24 ECORE_FD_READ,
25 _ecore_fb_ps2_fd_handler, NULL, NULL, NULL); 25 _ecore_fb_ps2_fd_handler, NULL, NULL, NULL);
26 if (!_ecore_fb_ts_fd_handler_handle) 26 if (!_ecore_fb_ts_fd_handler_handle)
27 { 27 {
28 close(_ecore_fb_ps2_fd); 28 close(_ecore_fb_ps2_fd);
29 return 0; 29 return 0;
30 } 30 }
31 return 1; 31 return 1;
32 } 32 }
33 return 0; 33 return 0;
34} 34}
@@ -50,98 +50,98 @@ _ecore_fb_ps2_fd_handler(void *data __UNUSED__, Ecore_Fd_Handler *fd_handler __U
50 50
51 do 51 do
52 { 52 {
53 int x, y, button, i; 53 int x, y, button, i;
54 int num; 54 int num;
55 char *ptr; 55 char *ptr;
56 double t; 56 double t;
57 int did_triple = 0; 57 int did_triple = 0;
58 58
59 ptr = (char *)&(_ecore_fb_ps2_event); 59 ptr = (char *)&(_ecore_fb_ps2_event);
60 ptr += _ecore_fb_ps2_event_byte_count; 60 ptr += _ecore_fb_ps2_event_byte_count;
61 num = sizeof(Ecore_Fb_Ps2_Event) - _ecore_fb_ps2_event_byte_count; 61 num = sizeof(Ecore_Fb_Ps2_Event) - _ecore_fb_ps2_event_byte_count;
62 v = read(_ecore_fb_ps2_fd, ptr, num); 62 v = read(_ecore_fb_ps2_fd, ptr, num);
63 if (v < 0) return EINA_TRUE; 63 if (v < 0) return EINA_TRUE;
64 _ecore_fb_ps2_event_byte_count += v; 64 _ecore_fb_ps2_event_byte_count += v;
65 if (v < num) return EINA_TRUE; 65 if (v < num) return EINA_TRUE;
66 t = ecore_time_get(); 66 t = ecore_time_get();
67 _ecore_fb_ps2_event_byte_count = 0; 67 _ecore_fb_ps2_event_byte_count = 0;
68 if (_ecore_fb_ps2_event.button & 0x10) 68 if (_ecore_fb_ps2_event.button & 0x10)
69 x = prev_x + (0xffffff00 | _ecore_fb_ps2_event.x); 69 x = prev_x + (0xffffff00 | _ecore_fb_ps2_event.x);
70 else 70 else
71 x = prev_x + _ecore_fb_ps2_event.x; 71 x = prev_x + _ecore_fb_ps2_event.x;
72 if (_ecore_fb_ps2_event.button & 0x20) 72 if (_ecore_fb_ps2_event.button & 0x20)
73 y = prev_y - (0xffffff00 | _ecore_fb_ps2_event.y); 73 y = prev_y - (0xffffff00 | _ecore_fb_ps2_event.y);
74 else 74 else
75 y = prev_y - _ecore_fb_ps2_event.y; 75 y = prev_y - _ecore_fb_ps2_event.y;
76 button = _ecore_fb_ps2_event.button & 0x7; 76 button = _ecore_fb_ps2_event.button & 0x7;
77 if (x < 0) x = 0; 77 if (x < 0) x = 0;
78 if (y < 0) y = 0; 78 if (y < 0) y = 0;
79 if (x >= _ecore_fb_console_w) x = _ecore_fb_console_w - 1; 79 if (x >= _ecore_fb_console_w) x = _ecore_fb_console_w - 1;
80 if (y >= _ecore_fb_console_h) y = _ecore_fb_console_h - 1; 80 if (y >= _ecore_fb_console_h) y = _ecore_fb_console_h - 1;
81 /* add event to queue */ 81 /* add event to queue */
82 /* always add a move event */ 82 /* always add a move event */
83 if (1) 83 if (1)
84 { 84 {
85 /* MOVE: mouse is down and was */ 85 /* MOVE: mouse is down and was */
86 Ecore_Fb_Event_Mouse_Move *e; 86 Ecore_Fb_Event_Mouse_Move *e;
87 87
88 e = calloc(1, sizeof(Ecore_Fb_Event_Mouse_Move)); 88 e = calloc(1, sizeof(Ecore_Fb_Event_Mouse_Move));
89 if (!e) goto retry; 89 if (!e) goto retry;
90 e->x = x; 90 e->x = x;
91 e->y = y; 91 e->y = y;
92 ecore_event_add(ECORE_FB_EVENT_MOUSE_MOVE, e, NULL, NULL); 92 ecore_event_add(ECORE_FB_EVENT_MOUSE_MOVE, e, NULL, NULL);
93 } 93 }
94 for (i = 1; i <= 3; i++) 94 for (i = 1; i <= 3; i++)
95 { 95 {
96 int mask; 96 int mask;
97 97
98 mask = 1 << (i - 1); 98 mask = 1 << (i - 1);
99 if (((button & mask)) && (!(prev_button & mask))) 99 if (((button & mask)) && (!(prev_button & mask)))
100 { 100 {
101 /* DOWN: mouse is down, but was not now */ 101 /* DOWN: mouse is down, but was not now */
102 Ecore_Fb_Event_Mouse_Button_Down *e; 102 Ecore_Fb_Event_Mouse_Button_Down *e;
103 103
104 e = calloc(1, sizeof(Ecore_Fb_Event_Mouse_Button_Down)); 104 e = calloc(1, sizeof(Ecore_Fb_Event_Mouse_Button_Down));
105 if (!e) goto retry; 105 if (!e) goto retry;
106 e->x = x; 106 e->x = x;
107 e->y = y; 107 e->y = y;
108 e->button = 1; 108 e->button = 1;
109 if ((t - last_time) <= _ecore_fb_double_click_time) 109 if ((t - last_time) <= _ecore_fb_double_click_time)
110 e->double_click = 1; 110 e->double_click = 1;
111 if ((t - last_last_time) <= (2 * _ecore_fb_double_click_time)) 111 if ((t - last_last_time) <= (2 * _ecore_fb_double_click_time))
112 { 112 {
113 did_triple = 1; 113 did_triple = 1;
114 e->triple_click = 1; 114 e->triple_click = 1;
115 } 115 }
116 ecore_event_add(ECORE_FB_EVENT_MOUSE_BUTTON_DOWN, e, NULL, NULL); 116 ecore_event_add(ECORE_FB_EVENT_MOUSE_BUTTON_DOWN, e, NULL, NULL);
117 } 117 }
118 else if ((!(button & mask)) && ((prev_button & mask))) 118 else if ((!(button & mask)) && ((prev_button & mask)))
119 { 119 {
120 /* UP: mouse was down, but is not now */ 120 /* UP: mouse was down, but is not now */
121 Ecore_Fb_Event_Mouse_Button_Up *e; 121 Ecore_Fb_Event_Mouse_Button_Up *e;
122 122
123 e = calloc(1, sizeof(Ecore_Fb_Event_Mouse_Button_Up)); 123 e = calloc(1, sizeof(Ecore_Fb_Event_Mouse_Button_Up));
124 if (!e) goto retry; 124 if (!e) goto retry;
125 e->x = x; 125 e->x = x;
126 e->y = y; 126 e->y = y;
127 e->button = 1; 127 e->button = 1;
128 ecore_event_add(ECORE_FB_EVENT_MOUSE_BUTTON_UP, e, NULL, NULL); 128 ecore_event_add(ECORE_FB_EVENT_MOUSE_BUTTON_UP, e, NULL, NULL);
129 } 129 }
130 } 130 }
131 if (did_triple) 131 if (did_triple)
132 { 132 {
133 last_time = 0; 133 last_time = 0;
134 last_last_time = 0; 134 last_last_time = 0;
135 } 135 }
136 else 136 else
137 { 137 {
138 last_last_time = last_time; 138 last_last_time = last_time;
139 last_time = t; 139 last_time = t;
140 } 140 }
141 retry: 141 retry:
142 prev_x = x; 142 prev_x = x;
143 prev_y = y; 143 prev_y = y;
144 prev_button = button; 144 prev_button = button;
145 } 145 }
146 while (v > 0); 146 while (v > 0);
147 return EINA_TRUE; 147 return EINA_TRUE;
diff --git a/legacy/ecore/src/lib/ecore_fb/ecore_fb_ts.c b/legacy/ecore/src/lib/ecore_fb/ecore_fb_ts.c
index 86992a9706..dd005df4a3 100644
--- a/legacy/ecore/src/lib/ecore_fb/ecore_fb_ts.c
+++ b/legacy/ecore/src/lib/ecore_fb/ecore_fb_ts.c
@@ -108,17 +108,17 @@ ecore_fb_ts_init(void)
108#endif 108#endif
109 if (_ecore_fb_ts_fd >= 0) 109 if (_ecore_fb_ts_fd >= 0)
110 { 110 {
111 _ecore_fb_ts_fd_handler_handle = ecore_main_fd_handler_add(_ecore_fb_ts_fd, 111 _ecore_fb_ts_fd_handler_handle = ecore_main_fd_handler_add(_ecore_fb_ts_fd,
112 ECORE_FD_READ, 112 ECORE_FD_READ,
113 _ecore_fb_ts_fd_handler, NULL, 113 _ecore_fb_ts_fd_handler, NULL,
114 NULL, NULL); 114 NULL, NULL);
115 if (!_ecore_fb_ts_fd_handler_handle) 115 if (!_ecore_fb_ts_fd_handler_handle)
116 { 116 {
117 close(_ecore_fb_ts_fd); 117 close(_ecore_fb_ts_fd);
118 return 0; 118 return 0;
119 } 119 }
120 // FIXME _ecore_fb_kbd_fd = open("/dev/touchscreen/key", O_RDONLY); 120 // FIXME _ecore_fb_kbd_fd = open("/dev/touchscreen/key", O_RDONLY);
121 return 1; 121 return 1;
122 } 122 }
123 return 0; 123 return 0;
124} 124}
@@ -162,8 +162,8 @@ ecore_fb_touch_screen_calibrate_set(int xscale, int xtrans, int yscale, int ytra
162 cal.xyswap = xyswap; 162 cal.xyswap = xyswap;
163 if (ioctl(_ecore_fb_ts_fd, TS_SET_CAL, (void *)&cal)) 163 if (ioctl(_ecore_fb_ts_fd, TS_SET_CAL, (void *)&cal))
164 { 164 {
165 _ecore_fb_ts_cal = cal; 165 _ecore_fb_ts_cal = cal;
166 _ecore_fb_ts_apply_cal = 1; 166 _ecore_fb_ts_apply_cal = 1;
167 } 167 }
168} 168}
169 169
@@ -185,7 +185,7 @@ ecore_fb_touch_screen_calibrate_get(int *xscale, int *xtrans, int *yscale, int *
185 if (_ecore_fb_ts_fd < 0) return; 185 if (_ecore_fb_ts_fd < 0) return;
186 if (!_ecore_fb_ts_apply_cal) 186 if (!_ecore_fb_ts_apply_cal)
187 { 187 {
188 if (ioctl(_ecore_fb_ts_fd, TS_GET_CAL, (void *)&cal)) 188 if (ioctl(_ecore_fb_ts_fd, TS_GET_CAL, (void *)&cal))
189 _ecore_fb_ts_cal = cal; 189 _ecore_fb_ts_cal = cal;
190 } 190 }
191 else 191 else
@@ -207,102 +207,102 @@ _ecore_fb_ts_fd_handler(void *data __UNUSED__, Ecore_Fd_Handler *fd_handler __UN
207 207
208 do 208 do
209 { 209 {
210 int x, y, pressure; 210 int x, y, pressure;
211 int num; 211 int num;
212 char *ptr; 212 char *ptr;
213 double t = 0.0; 213 double t = 0.0;
214 int did_triple = 0; 214 int did_triple = 0;
215 215
216#ifdef HAVE_TSLIB 216#ifdef HAVE_TSLIB
217 if (_ecore_fb_ts_apply_cal) 217 if (_ecore_fb_ts_apply_cal)
218 num = ts_read_raw(_ecore_fb_tslib_tsdev, &_ecore_fb_tslib_event, 1); 218 num = ts_read_raw(_ecore_fb_tslib_tsdev, &_ecore_fb_tslib_event, 1);
219 else 219 else
220 num = ts_read(_ecore_fb_tslib_tsdev, &_ecore_fb_tslib_event, 1); 220 num = ts_read(_ecore_fb_tslib_tsdev, &_ecore_fb_tslib_event, 1);
221 if (num != 1) return 1; /* no more samples at this time */ 221 if (num != 1) return 1; /* no more samples at this time */
222 x = _ecore_fb_tslib_event.x; 222 x = _ecore_fb_tslib_event.x;
223 y = _ecore_fb_tslib_event.y; 223 y = _ecore_fb_tslib_event.y;
224 pressure = _ecore_fb_tslib_event.pressure; 224 pressure = _ecore_fb_tslib_event.pressure;
225 v = 1; /* loop, there might be more samples */ 225 v = 1; /* loop, there might be more samples */
226 t = ecore_time_get(); 226 t = ecore_time_get();
227#else 227#else
228 ptr = (char *)&(_ecore_fb_ts_event); 228 ptr = (char *)&(_ecore_fb_ts_event);
229 ptr += _ecore_fb_ts_event_byte_count; 229 ptr += _ecore_fb_ts_event_byte_count;
230 num = sizeof(Ecore_Fb_Ts_Event) - _ecore_fb_ts_event_byte_count; 230 num = sizeof(Ecore_Fb_Ts_Event) - _ecore_fb_ts_event_byte_count;
231 v = read(_ecore_fb_ts_fd, ptr, num); 231 v = read(_ecore_fb_ts_fd, ptr, num);
232 if (v < 0) return 1; 232 if (v < 0) return 1;
233 _ecore_fb_ts_event_byte_count += v; 233 _ecore_fb_ts_event_byte_count += v;
234 if (v < num) return 1; 234 if (v < num) return 1;
235 _ecore_fb_ts_event_byte_count = 0; 235 _ecore_fb_ts_event_byte_count = 0;
236 if (_ecore_fb_ts_apply_cal) 236 if (_ecore_fb_ts_apply_cal)
237 { 237 {
238 x = ((_ecore_fb_ts_cal.xscale * _ecore_fb_ts_event.x) >> 8) + _ecore_fb_ts_cal.xtrans; 238 x = ((_ecore_fb_ts_cal.xscale * _ecore_fb_ts_event.x) >> 8) + _ecore_fb_ts_cal.xtrans;
239 y = ((_ecore_fb_ts_cal.yscale * _ecore_fb_ts_event.y) >> 8) + _ecore_fb_ts_cal.ytrans; 239 y = ((_ecore_fb_ts_cal.yscale * _ecore_fb_ts_event.y) >> 8) + _ecore_fb_ts_cal.ytrans;
240 } 240 }
241 else 241 else
242 { 242 {
243 x = _ecore_fb_ts_event.x; 243 x = _ecore_fb_ts_event.x;
244 y = _ecore_fb_ts_event.y; 244 y = _ecore_fb_ts_event.y;
245 } 245 }
246 pressure = _ecore_fb_ts_event.pressure; 246 pressure = _ecore_fb_ts_event.pressure;
247#endif 247#endif
248 /* add event to queue */ 248 /* add event to queue */
249 /* always add a move event */ 249 /* always add a move event */
250 if ((pressure) || (prev_pressure)) 250 if ((pressure) || (prev_pressure))
251 { 251 {
252 /* MOVE: mouse is down and was */ 252 /* MOVE: mouse is down and was */
253 Ecore_Fb_Event_Mouse_Move *e; 253 Ecore_Fb_Event_Mouse_Move *e;
254 254
255 e = calloc(1, sizeof(Ecore_Fb_Event_Mouse_Move)); 255 e = calloc(1, sizeof(Ecore_Fb_Event_Mouse_Move));
256 if (!e) goto retry; 256 if (!e) goto retry;
257 e->x = x; 257 e->x = x;
258 e->y = y; 258 e->y = y;
259 ecore_event_add(ECORE_FB_EVENT_MOUSE_MOVE, e, NULL, NULL); 259 ecore_event_add(ECORE_FB_EVENT_MOUSE_MOVE, e, NULL, NULL);
260 } 260 }
261 if ((pressure) && (!prev_pressure)) 261 if ((pressure) && (!prev_pressure))
262 { 262 {
263 /* DOWN: mouse is down, but was not now */ 263 /* DOWN: mouse is down, but was not now */
264 Ecore_Fb_Event_Mouse_Button_Down *e; 264 Ecore_Fb_Event_Mouse_Button_Down *e;
265 265
266 e = calloc(1, sizeof(Ecore_Fb_Event_Mouse_Button_Down)); 266 e = calloc(1, sizeof(Ecore_Fb_Event_Mouse_Button_Down));
267 if (!e) goto retry; 267 if (!e) goto retry;
268 e->x = x; 268 e->x = x;
269 e->y = y; 269 e->y = y;
270 e->button = 1; 270 e->button = 1;
271 if ((t - last_time) <= _ecore_fb_double_click_time) 271 if ((t - last_time) <= _ecore_fb_double_click_time)
272 e->double_click = 1; 272 e->double_click = 1;
273 if ((t - last_last_time) <= (2 * _ecore_fb_double_click_time)) 273 if ((t - last_last_time) <= (2 * _ecore_fb_double_click_time))
274 { 274 {
275 did_triple = 1; 275 did_triple = 1;
276 e->triple_click = 1; 276 e->triple_click = 1;
277 } 277 }
278 ecore_event_add(ECORE_FB_EVENT_MOUSE_BUTTON_DOWN, e, NULL, NULL); 278 ecore_event_add(ECORE_FB_EVENT_MOUSE_BUTTON_DOWN, e, NULL, NULL);
279 } 279 }
280 else if ((!pressure) && (prev_pressure)) 280 else if ((!pressure) && (prev_pressure))
281 { 281 {
282 /* UP: mouse was down, but is not now */ 282 /* UP: mouse was down, but is not now */
283 Ecore_Fb_Event_Mouse_Button_Up *e; 283 Ecore_Fb_Event_Mouse_Button_Up *e;
284 284
285 e = calloc(1, sizeof(Ecore_Fb_Event_Mouse_Button_Up)); 285 e = calloc(1, sizeof(Ecore_Fb_Event_Mouse_Button_Up));
286 if (!e) goto retry; 286 if (!e) goto retry;
287 e->x = prev_x; 287 e->x = prev_x;
288 e->y = prev_y; 288 e->y = prev_y;
289 e->button = 1; 289 e->button = 1;
290 ecore_event_add(ECORE_FB_EVENT_MOUSE_BUTTON_UP, e, NULL, NULL); 290 ecore_event_add(ECORE_FB_EVENT_MOUSE_BUTTON_UP, e, NULL, NULL);
291 } 291 }
292 if (did_triple) 292 if (did_triple)
293 { 293 {
294 last_time = 0; 294 last_time = 0;
295 last_last_time = 0; 295 last_last_time = 0;
296 } 296 }
297 else 297 else
298 { 298 {
299 last_last_time = last_time; 299 last_last_time = last_time;
300 last_time = t; 300 last_time = t;
301 } 301 }
302retry: 302retry:
303 prev_x = x; 303 prev_x = x;
304 prev_y = y; 304 prev_y = y;
305 prev_pressure = pressure; 305 prev_pressure = pressure;
306 } 306 }
307 while (v > 0); 307 while (v > 0);
308 return 1; 308 return 1;
diff --git a/legacy/ecore/src/lib/ecore_fb/ecore_fb_vt.c b/legacy/ecore/src/lib/ecore_fb/ecore_fb_vt.c
index e7f6fe2e36..6ff9dc3d51 100644
--- a/legacy/ecore/src/lib/ecore_fb/ecore_fb_vt.c
+++ b/legacy/ecore/src/lib/ecore_fb/ecore_fb_vt.c
@@ -126,8 +126,8 @@ _ecore_fb_vt_setup(void)
126 } 126 }
127 /* register signal handlers when alloc/detach of vt */ 127 /* register signal handlers when alloc/detach of vt */
128 _ecore_fb_user_handler = ecore_event_handler_add(ECORE_EVENT_SIGNAL_USER, 128 _ecore_fb_user_handler = ecore_event_handler_add(ECORE_EVENT_SIGNAL_USER,
129 _ecore_fb_signal_usr_handler, 129 _ecore_fb_signal_usr_handler,
130 NULL); 130 NULL);
131 /* What does this do? */ 131 /* What does this do? */
132 _ecore_fb_filter_handler = ecore_event_filter_add(_ecore_fb_event_filter_start, _ecore_fb_event_filter_filter, _ecore_fb_event_filter_end, NULL); 132 _ecore_fb_filter_handler = ecore_event_filter_add(_ecore_fb_event_filter_start, _ecore_fb_event_filter_filter, _ecore_fb_event_filter_end, NULL);
133 133
@@ -269,11 +269,11 @@ _ecore_fb_event_filter_filter(void *data __UNUSED__, void *loop_data,int type, v
269 if (!filter_data) return EINA_TRUE; 269 if (!filter_data) return EINA_TRUE;
270 if (type == ECORE_FB_EVENT_MOUSE_MOVE) 270 if (type == ECORE_FB_EVENT_MOUSE_MOVE)
271 { 271 {
272 if ((filter_data->last_event_type) == ECORE_FB_EVENT_MOUSE_MOVE) 272 if ((filter_data->last_event_type) == ECORE_FB_EVENT_MOUSE_MOVE)
273 { 273 {
274 filter_data->last_event_type = type; 274 filter_data->last_event_type = type;
275 return EINA_FALSE; 275 return EINA_FALSE;
276 } 276 }
277 } 277 }
278 filter_data->last_event_type = type; 278 filter_data->last_event_type = type;
279 return EINA_TRUE; 279 return EINA_TRUE;