| Home · All Classes · Grouped Classes · Annotated · Functions |
This document describes the process required to implement a plug-in for a new device. All directory references are relative to the example provided in the <qtopia-root-dir>/devices/example directory.
Qtopia also provides Device Profiles to simplify the task of configuring Qtopia for a device and providing the plug-ins required.
The following directories are of particular interest:
| Directory | Description |
|---|---|
| mkspecs | contains the qmake configuration file used to build for the device |
| src | contains the source code for the plug-in drivers for keypad and touchscreen |
This tutorial assumes that debugging using qLog() is enabled. To activate debugging:
This functionality is available in both debug and release builds.
The steps taken to implement a new plug-in depend on whether you are implementing a keypad plug-in or a touchscreen/mouse plug-in. The following tutorial provides the steps for both.
The initial steps for either type of plug-in are:
Note:The value chosen for <device-name> must only contain alpha-numeric characters.
The functionality required to implement a keypad device plug-in is found in the source file: /src/<device-name>kbdhandler.cpp, which implements a class to handle keypad input inheriting QWSKeyboardhandler. Then the constructor/destructor readKbdData() functions are overloaded to match your device.
The functionality required to implement a touchscreen/mouse device plug-in is found in the source file: /src/<device-name>mousehandler.cpp which implements a class to handle mouse input inheriting QWSCalibratedMousehandler. The constructor/destructor readMouseData() and calibrate() functions are then overloaded to match your device.
Note: When creating a plug-in it is not necessary to rebuild all of Qtopia to enable it. Simply rebuild the plug-in and copy the files to the image/Qtopia directory and restart Qtopia.
For some hardware there is a need to make minor changes to how the screen is written to the device. One such example is where there needs to be an ioctl sent to the framebuffer device after each frame update. To see how one might create a QScreenDriverPlugin plugin to do that, see src/plugins/qtopiacore/gfxdrivers/example/ and modify the ExampleScreen::exposeRegion function to send the ioctl required.
To make use of this created screen driver plugin set QWS_DISPLAY, for example:
export QWS_DISPLAY=examplescreen
After customizing src/devtools/startup/qpe.{env,sh} to suit the device and Qtopia is installed into the device it is then possible to:
. /opt/Qtopia/qpe.env
cd /opt/Qtopia
bin/textedit -qws
/opt/Qtopia/qpe.sh
A common practice is to append the above /etc/init.d/rc.local so that Qtopia is started upon bootup.
See also Running Qtopia.
| Copyright © 2007 Trolltech | Trademarks | Qtopia 4.2.5 |