Enlightenment CVS committal Author : raster Project : e17 Module : libs/ecore
Dir : e17/libs/ecore/src/lib/ecore_fb Modified Files: Tag: SPLIT Ecore_Fb.h ecore_fb.c Log Message: working on making this go on my ipaq.. it does... now. i have to commit data files. will do that once i have a better app design happening. right now it starts and calibrates the touchscreen. that's it. =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_fb/Attic/Ecore_Fb.h,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -u -3 -r1.1.2.2 -r1.1.2.3 --- Ecore_Fb.h 12 Feb 2003 04:40:32 -0000 1.1.2.2 +++ Ecore_Fb.h 16 Feb 2003 15:00:33 -0000 1.1.2.3 @@ -3,7 +3,8 @@ /* FIXME: * add - * - code to qury fb size (width * height) + * - code to control backlight (only for ipaq for now) + * - code to control led's (only for ipaq for now) */ #ifdef __cplusplus @@ -58,6 +59,10 @@ double ecore_fb_double_click_time_get(void); void ecore_fb_size_get(int *w, int *h); + +void ecore_fb_touch_screen_calibrate_set(int xscale, int xtrans, int yscale, int +ytrans, int xyswap); +void ecore_fb_touch_screen_calibrate_get(int *xscale, int *xtrans, int *yscale, int +*ytrans, int *xyswap); + #ifdef __cplusplus } #endif =================================================================== RCS file: /cvsroot/enlightenment/e17/libs/ecore/src/lib/ecore_fb/Attic/ecore_fb.c,v retrieving revision 1.1.2.4 retrieving revision 1.1.2.5 diff -u -3 -r1.1.2.4 -r1.1.2.5 --- ecore_fb.c 15 Feb 2003 14:54:28 -0000 1.1.2.4 +++ ecore_fb.c 16 Feb 2003 15:00:36 -0000 1.1.2.5 @@ -15,7 +15,17 @@ #include <linux/fb.h> #include <sys/ioctl.h> +/* #include <linux/h3600_ts.h> */ +/* hacks to stop people NEEDING #include <linux/h3600_ts.h> */ +#ifndef TS_SET_CAL +#define TS_SET_CAL 0x4014660b +#endif +#ifndef TS_GET_CAL +#define TS_GET_CAL 0x8014660a +#endif + typedef struct _Ecore_Fb_Ts_Event Ecore_Fb_Ts_Event; +typedef struct _Ecore_Fb_Ts_Calibrate Ecore_Fb_Ts_Calibrate; typedef struct _Ecore_Fb_Ps2_Event Ecore_Fb_Ps2_Event; struct _Ecore_Fb_Ts_Event @@ -26,6 +36,15 @@ unsigned short _unused; }; +struct _Ecore_Fb_Ts_Calibrate +{ + int xscale; + int xtrans; + int yscale; + int ytrans; + int xyswap; +}; + struct _Ecore_Fb_Ps2_Event { unsigned char button; @@ -488,6 +507,54 @@ if (h) *h = _ecore_fb_console_h; } +/** + * Calibrate the touschreen + * @param xscale + * @param xtrans + * @param yscale + * @param ytrans + * @param xyswap + * + * Calibrate the touchscreen using the above params + */ +void +ecore_fb_touch_screen_calibrate_set(int xscale, int xtrans, int yscale, int ytrans, +int xyswap) +{ + Ecore_Fb_Ts_Calibrate cal; + + if (_ecore_fb_ts_fd < 0) return; + cal.xscale = xscale; + cal.xtrans = xtrans; + cal.yscale = yscale; + cal.ytrans = ytrans; + cal.xyswap = xyswap; + ioctl(_ecore_fb_ts_fd, TS_SET_CAL, (void *)&cal); +} + +/** + * Get calibratio og the touschreen + * @param xscale + * @param xtrans + * @param yscale + * @param ytrans + * @param xyswap + * + * Get calibration of the touchscreen + */ +void +ecore_fb_touch_screen_calibrate_get(int *xscale, int *xtrans, int *yscale, int +*ytrans, int *xyswap) +{ + Ecore_Fb_Ts_Calibrate cal; + + if (_ecore_fb_ts_fd < 0) return; + ioctl(_ecore_fb_ts_fd, TS_GET_CAL, (void *)&cal); + if (xscale) *xscale = cal.xscale; + if (xtrans) *xtrans = cal.xtrans; + if (yscale) *yscale = cal.yscale; + if (ytrans) *ytrans = cal.ytrans; + if (xyswap) *xyswap = cal.xyswap; +} + static void _ecore_fb_size_get(int *w, int *h) { @@ -579,8 +646,8 @@ e = calloc(1, sizeof(Ecore_Fb_Event_Mouse_Button_Up)); if (!e) goto retry; - e->x = x; - e->y = y; + e->x = prev_x; + e->y = prev_y; e->button = 1; ecore_event_add(ECORE_FB_EVENT_MOUSE_BUTTON_UP, e, _ecore_fb_event_free_generic, NULL); } @@ -622,7 +689,7 @@ e = calloc(1, sizeof(Ecore_Fb_Event_Key_Down)); if (!e) goto retry; - if (_ecore_fb_kbd_fd != _ecore_fb_tty_fd) + if (_ecore_fb_kbd_fd == _ecore_fb_tty_fd) e->keyname = strdup(_ecore_fb_kbd_syms[buf & 0x7f]); else e->keyname = strdup(_ecore_fb_btn_syms[buf & 0x7f]); @@ -640,7 +707,7 @@ e = calloc(1, sizeof(Ecore_Fb_Event_Key_Up)); if (!e) goto retry; - if (_ecore_fb_kbd_fd != _ecore_fb_tty_fd) + if (_ecore_fb_kbd_fd == _ecore_fb_tty_fd) e->keyname = strdup(_ecore_fb_kbd_syms[buf & 0x7f]); else e->keyname = strdup(_ecore_fb_btn_syms[buf & 0x7f]); ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ enlightenment-cvs mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs