Mousecalibration works with TSLIB on Mini2440v2

This example shows how to make the mousecalibration example which come from Qt4's
works with tslib on the Mini2440v2.

Base information:
OS: Linux
tools: bitbake openembedded

Prepare:
If you don't still install "bitbake" and "openembedded" on your PC,
please read this technical article first, the article name is "Creating Qt4 project with bitbake for Mini2440V2".
I think you should read step 1 and 2 only if you don't like reading long article,and it will be enough.

Steps:
1.Modify file "qt4-embedded_4.4.3.bb"
a) Just open this file "/home/paul/project/openembedded/recipes/qt4/qt4-embedded_4.4.3.bb"
find this flag "QT_CONFIG_FLAGS", then change it looks like bellow:
QT_CONFIG_FLAGS += " \
-qtlibinfix E \
-qt-decoration-styled \
-plugin-decoration-default\
-plugin-decoration-windows \
-plugin-mouse-tslib \
-plugin-sql-sqlite \
-qt-kbd-tty \
-qt-kbd-usb \
-qt-mouse-tslib \
-no-armfpa\
-make examples\
-make demo\
-no-largefile -qt-sql-sqlite \
-phonon-backend\
-qt-zlib -qt-gif -qt-libtiff -qt-libpng -qt-libmng -qt-libjpeg \
-depths 8,16,18,24 -qt-gfx-linuxfb -no-gfx-transformed \
-glib \
-DQT_KEYPAD_NAVIGATION
"
After modifying ,file named "qt4-embedded_4.4.3.bb" looks like:
SUMMARY = "Qt is a versatile cross-platform application framework -- this is the embedded version."
SECTION = "libs"
LICENSE = "GPL QPL"
PRIORITY = "optional"
HOMEPAGE = "http://www.trolltech.com"
DEPENDS += "tslib"
PR = "r10"

SRC_URI = "ftp://ftp.trolltech.com/qt/source/qt-embedded-linux-opensource-src-${PV}.tar.bz2 \
file://0001-cross-compile.patch;patch=1 \
file://0002-fix-resinit-declaration.patch;patch=1 \
file://0003-no-tools.patch;patch=1 \
file://0004-no-qmake.patch;patch=1 \
file://0006-freetype-host-includes.patch;patch=1 \
file://0007-openssl-host-includes.patch;patch=1 \
file://0008-qt-lib-infix.patch;patch=1 \
file://0009-support-2bpp.patch;patch=1 \
file://g++.conf \
file://linux.conf \
"
S = "${WORKDIR}/qt-embedded-linux-opensource-src-${PV}"
QT_CONFIG_FLAGS += " \
-qtlibinfix E \
-qt-decoration-styled \
-plugin-decoration-default\
-plugin-decoration-windows \
-plugin-mouse-tslib \
-plugin-sql-sqlite \
-qt-kbd-tty \
-qt-kbd-usb \
-qt-mouse-tslib \
-no-armfpa\
-make examples\
-make demo\
-no-largefile -qt-sql-sqlite \
-phonon-backend\
-qt-zlib -qt-gif -qt-libtiff -qt-libpng -qt-libmng -qt-libjpeg \
-depths 8,16,18,24 -qt-gfx-linuxfb -no-gfx-transformed \
-glib \
-DQT_KEYPAD_NAVIGATION \
"
QT_BASE_NAME = "qt-embedded"
QT_BASE_LIB = "libqt-embedded"
QT_DIR_NAME = "qtopia"
QT_LIBINFIX="E"
require qt4.inc
inherit qt4e
#PR = "${INC_PR}.2"
2) Build qt4-embedded
a) cd /home/paul/project (Go to the project folder)
b) source source-me.txt (initializing envira)
c) bitbake qt4-embedded (This will takes a long time)
3)Copy mousecalibration into Mini2440v2
just copy this file into Mini2440v2 ,
which name "/home/paulproject/build/angstrom.1/work/armv4t-angstrom-linux-gnueabi/qt4-embedded-4.4.3-r10/qt-embedded-linux-opensource-src-4.4.3/examples/qws/mousecalibration"
4)Setting enviroment on Mini244v2
a)open file "/etc/profile" on Mini2440v2 and then adding 5 lines bellow:
export TSLIB_PLUGINDIR=/plugins
export TSLIB_CALIBFILE=/etc/pointercal
export TSLIB_TSDEVICE=/dev/input/touchscreen0
export QWS_MOUSE_PROTO=tslib:/dev/input/touchscreen0
export QWS_DISPLAY="LinuxFb:mmWidth=100:mmHeight=80"

If you don't want to read something about these items , please jump to step 5.
Item "TSLIB_PLUGINDIR" tells where is the plugin library of TSLIB, this folder at lease contains these library bellow:
"dejitter.so"
"input.so"
"linear.so"
"pthres.so"
"variance.so"
Item "TSLIB_CALIBFILE" tells where to put the result of calibration

Item "TSLIB_TSDEVICE" specifies the input device

Item "QWS_MOUSE_PROTO" specifies the driver and device for pointer handling.This very important, otherwise the mousecalibration will not works correctly.

Item "QWS_DISPLAY" just to set the display type and the frambuffer. Here "mmWidth=100:mmHeight=80" only for Hiteg's 3"5 touch screen,
if you using another touchscreen ,please caculate its width and height in mm.

b) Logout and login again to reload profile.
5) Excute mousecalibration
Just call this binary file's name "mousecalibration" directly.