diff options
author | Michael Lauer <mickey@vanille-media.de> | 2005-09-11 20:59:08 +0000 |
---|---|---|
committer | OpenEmbedded Project <openembedded-devel@lists.openembedded.org> | 2005-09-11 20:59:08 +0000 |
commit | 79f476dc493d2566cd235760f874490478f9be1c (patch) | |
tree | 03319a0f7f1adc5a0da42897a9c52ab51dbdb5ad | |
parent | b4d7c99b58c6ffa2586d0fd92fef99339e154b1d (diff) | |
parent | b76fb6d7da96071ae4536a4d20ff594c50f10673 (diff) |
merge of 53eb13501a2259cc700bd74c6a4d5b7022eb3d69
and 7123616b4991ab3d5b73ef32b51e555cacf38b72
-rw-r--r-- | packages/efl/ecore-fb_20050907.bb | 13 | ||||
-rw-r--r-- | packages/efl/ecore/add-tslib-support.patch | 104 |
2 files changed, 113 insertions, 4 deletions
diff --git a/packages/efl/ecore-fb_20050907.bb b/packages/efl/ecore-fb_20050907.bb index 96823d0761..b60cd7e1fd 100644 --- a/packages/efl/ecore-fb_20050907.bb +++ b/packages/efl/ecore-fb_20050907.bb @@ -1,11 +1,17 @@ include ecore.inc -PR = "r0" +PR = "r1" DEFAULT_PREFERENCE = "-1" SRC_URI = "cvs://anonymous@cvs.sourceforge.net/cvsroot/enlightenment;module=e17/libs/ecore;date=${PV}" S = "${WORKDIR}/ecore" +### add tslib support +SRC_URI += "file://add-tslib-support.patch;patch=1" +DEPENDS += "tslib" +CFLAGS += "-DHAVE_TSLIB" +LDFLAGS += "-lts" + EXTRA_OECONF = "--enable-ecore-fb \ --enable-ecore-job \ --enable-ecore-file \ @@ -25,6 +31,5 @@ EXTRA_OECONF = "--enable-ecore-fb \ --enable-ecore-config \ --disable-openssl" -parts = "Ecore Ecore_Job Ecore_File Ecore_DBus \ - Ecore_Txt Ecore_Fb Ecore_Con \ - Ecore_Ipc Ecore_Evas Ecore_Config" +parts = "Ecore Ecore_Job Ecore_File Ecore_DBus Ecore_Txt Ecore_Fb Ecore_Con Ecore_Ipc Ecore_Evas Ecore_Config" + diff --git a/packages/efl/ecore/add-tslib-support.patch b/packages/efl/ecore/add-tslib-support.patch new file mode 100644 index 0000000000..c125122a91 --- /dev/null +++ b/packages/efl/ecore/add-tslib-support.patch @@ -0,0 +1,104 @@ + +# +# tslib support for ecore, (C) Michael 'Mickey' Lauer <mickey@Vanille.de> +# + +--- ecore/src/lib/ecore_fb/ecore_fb.c~add-tslib-support.patch ++++ ecore/src/lib/ecore_fb/ecore_fb.c +@@ -4,6 +4,13 @@ + #include "Ecore_Fb.h" + #include "ecore_private.h" + ++ ++#ifdef HAVE_TSLIB ++#include <tslib.h> ++#include <errno.h> ++#endif ++ ++ + #include <fcntl.h> + #include <unistd.h> + #include <stdio.h> +@@ -77,6 +84,11 @@ + unsigned char z; + }; + ++#ifdef HAVE_TSLIB ++struct tsdev *_ecore_fb_tslib_tsdev = NULL; ++struct ts_sample _ecore_fb_tslib_event; ++#endif ++ + static void _ecore_fb_size_get(int *w, int *h); + static int _ecore_fb_ts_fd_handler(void *data, Ecore_Fd_Handler *fd_handler); + static int _ecore_fb_kbd_fd_handler(void *data, Ecore_Fd_Handler *fd_handler); +@@ -269,10 +281,39 @@ + ecore_fb_init(const char *name __UNUSED__) + { + int prev_flags; ++#ifdef HAVE_TSLIB ++ char *tslib_tsdevice = NULL; ++#endif + + _ecore_fb_init_count++; + if (_ecore_fb_init_count > 1) return _ecore_fb_init_count; ++#ifdef HAVE_TSLIB ++ if ( ( tslib_tsdevice = getenv("TSLIB_TSDEVICE") ) != NULL ) ++ { ++ printf( "ECORE_FB: TSLIB_TSDEVICE = '%s'\n", tslib_tsdevice ); ++ _ecore_fb_tslib_tsdev = ts_open( tslib_tsdevice, 1 ); /* 1 = nonblocking, 0 = blocking */ ++ ++ if ( !_ecore_fb_tslib_tsdev ) ++ { ++ printf( "ECORE_FB: Can't ts_open (%s)\n", strerror( errno ) ); ++ return 0; ++ } ++ ++ if ( ts_config( _ecore_fb_tslib_tsdev ) ) ++ { ++ printf( "ECORE_FB: Can't ts_config (%s)\n", strerror( errno ) ); ++ return 0; ++ } ++ _ecore_fb_ts_fd = ts_fd( _ecore_fb_tslib_tsdev ); ++ if ( _ecore_fb_ts_fd < 0 ) ++ { ++ printf( "ECORE_FB: Can't open touchscreen (%s)\n", strerror( errno ) ); ++ return 0; ++ } ++ } ++#else + _ecore_fb_ts_fd = open("/dev/touchscreen/0", O_RDONLY); ++#endif + if (_ecore_fb_ts_fd >= 0) + { + prev_flags = fcntl(_ecore_fb_ts_fd, F_GETFL); +@@ -790,7 +831,21 @@ + char *ptr; + double t; + int did_triple = 0; +- ++ ++#ifdef HAVE_TSLIB ++ if ( _ecore_fb_ts_apply_cal ) ++ num = ts_read_raw( _ecore_fb_tslib_tsdev, &_ecore_fb_tslib_event, 1 ); ++ else ++ num = ts_read( _ecore_fb_tslib_tsdev, &_ecore_fb_tslib_event, 1 ); ++ if ( num != 1 ) ++ { ++ return 1; /* no more samples at this time */ ++ } ++ x = _ecore_fb_tslib_event.x; ++ y = _ecore_fb_tslib_event.y; ++ pressure = _ecore_fb_tslib_event.pressure; ++ v = 1; /* loop, there might be more samples */ ++#else + ptr = (char *)&(_ecore_fb_ts_event); + ptr += _ecore_fb_ts_event_byte_count; + num = sizeof(Ecore_Fb_Ts_Event) - _ecore_fb_ts_event_byte_count; +@@ -811,6 +866,7 @@ + y = _ecore_fb_ts_event.y; + } + pressure = _ecore_fb_ts_event.pressure; ++#endif + /* add event to queue */ + /* always add a move event */ + if ((pressure) || (prev_pressure)) |