summaryrefslogtreecommitdiff
path: root/legacy/ecore/src/lib/ecore_fb/ecore_fb.c
diff options
context:
space:
mode:
authorCarsten Haitzler <raster@rasterman.com>2005-05-31 22:30:47 +0000
committerCarsten Haitzler <raster@rasterman.com>2005-05-31 22:30:47 +0000
commitd4c7c547a329968cb85e5118db44a1a37e44e812 (patch)
treeca6b49313725069c76271348bd1997dd0c09d549 /legacy/ecore/src/lib/ecore_fb/ecore_fb.c
parent09fc45f3c88f664b59d73cabed2e6c93016dce39 (diff)
simon's tscal stuff
SVN revision: 15040
Diffstat (limited to '')
-rw-r--r--legacy/ecore/src/lib/ecore_fb/ecore_fb.c26
1 files changed, 22 insertions, 4 deletions
diff --git a/legacy/ecore/src/lib/ecore_fb/ecore_fb.c b/legacy/ecore/src/lib/ecore_fb/ecore_fb.c
index b8fe2bcc51..634a54f9ad 100644
--- a/legacy/ecore/src/lib/ecore_fb/ecore_fb.c
+++ b/legacy/ecore/src/lib/ecore_fb/ecore_fb.c
@@ -128,6 +128,9 @@ static void _ecore_fb_event_filter_end(void *data, void *loop_data);
128 128
129static double _ecore_fb_double_click_time = 0.25; 129static double _ecore_fb_double_click_time = 0.25;
130 130
131static struct _Ecore_Fb_Ts_Calibrate _ecore_fb_ts_cal = {1,1,0,0,0};
132static int _ecore_fb_ts_apply_cal = 0;
133
131static const char *_ecore_fb_kbd_syms[128 * 6] = 134static const char *_ecore_fb_kbd_syms[128 * 6] =
132{ 135{
133#include "ecore_fb_keytab.h" 136#include "ecore_fb_keytab.h"
@@ -513,7 +516,10 @@ ecore_fb_touch_screen_calibrate_set(int xscale, int xtrans, int yscale, int ytra
513 cal.yscale = yscale; 516 cal.yscale = yscale;
514 cal.ytrans = ytrans; 517 cal.ytrans = ytrans;
515 cal.xyswap = xyswap; 518 cal.xyswap = xyswap;
516 ioctl(_ecore_fb_ts_fd, TS_SET_CAL, (void *)&cal); 519 if (ioctl(_ecore_fb_ts_fd, TS_SET_CAL, (void *)&cal)) {
520 _ecore_fb_ts_cal = cal;
521 _ecore_fb_ts_apply_cal = 1;
522 }
517} 523}
518 524
519/** 525/**
@@ -532,7 +538,14 @@ ecore_fb_touch_screen_calibrate_get(int *xscale, int *xtrans, int *yscale, int *
532 Ecore_Fb_Ts_Calibrate cal; 538 Ecore_Fb_Ts_Calibrate cal;
533 539
534 if (_ecore_fb_ts_fd < 0) return; 540 if (_ecore_fb_ts_fd < 0) return;
535 ioctl(_ecore_fb_ts_fd, TS_GET_CAL, (void *)&cal); 541 if (!_ecore_fb_ts_apply_cal) {
542 if (ioctl(_ecore_fb_ts_fd, TS_GET_CAL, (void *)&cal)) {
543 _ecore_fb_ts_cal = cal;
544 }
545 }
546 if (_ecore_fb_ts_apply_cal) {
547 cal = _ecore_fb_ts_cal;
548 }
536 if (xscale) *xscale = cal.xscale; 549 if (xscale) *xscale = cal.xscale;
537 if (xtrans) *xtrans = cal.xtrans; 550 if (xtrans) *xtrans = cal.xtrans;
538 if (yscale) *yscale = cal.yscale; 551 if (yscale) *yscale = cal.yscale;
@@ -787,8 +800,13 @@ _ecore_fb_ts_fd_handler(void *data __UNUSED__, Ecore_Fd_Handler *fd_handler __UN
787 if (v < num) return 1; 800 if (v < num) return 1;
788 t = ecore_time_get(); 801 t = ecore_time_get();
789 _ecore_fb_ts_event_byte_count = 0; 802 _ecore_fb_ts_event_byte_count = 0;
790 x = _ecore_fb_ts_event.x; 803 if (_ecore_fb_ts_apply_cal) {
791 y = _ecore_fb_ts_event.y; 804 x = ((_ecore_fb_ts_cal.xscale * _ecore_fb_ts_event.x) >> 8) + _ecore_fb_ts_cal.xtrans;
805 y = ((_ecore_fb_ts_cal.yscale * _ecore_fb_ts_event.y) >> 8) + _ecore_fb_ts_cal.ytrans;
806 } else {
807 x = _ecore_fb_ts_event.x;
808 y = _ecore_fb_ts_event.y;
809 }
792 pressure = _ecore_fb_ts_event.pressure; 810 pressure = _ecore_fb_ts_event.pressure;
793 /* add event to queue */ 811 /* add event to queue */
794 /* always add a move event */ 812 /* always add a move event */