author | drw <drw> | 2005-04-05 23:01:28 (UTC) |
---|---|---|
committer | drw <drw> | 2005-04-05 23:01:28 (UTC) |
commit | 2b0e27b45eb9ff5563f786c5e45d53db49afb9f9 (patch) (unidiff) | |
tree | e5dfb23aa8e0e3778b5fa1f5633f6511789f41f2 /libopie2/opiecore | |
parent | 2a9ee3ea1d8d978b735f0ce3f2e54a15e37c87b3 (diff) | |
download | opie-2b0e27b45eb9ff5563f786c5e45d53db49afb9f9.zip opie-2b0e27b45eb9ff5563f786c5e45d53db49afb9f9.tar.gz opie-2b0e27b45eb9ff5563f786c5e45d53db49afb9f9.tar.bz2 |
Use OResource for loading images
-rw-r--r-- | libopie2/opiecore/device/odevice.cpp | 48 | ||||
-rw-r--r-- | libopie2/opiecore/device/odevice_beagle.cpp | 47 | ||||
-rw-r--r-- | libopie2/opiecore/device/odevice_genuineintel.cpp | 48 | ||||
-rw-r--r-- | libopie2/opiecore/device/odevice_ipaq.cpp | 48 | ||||
-rw-r--r-- | libopie2/opiecore/device/odevice_jornada.cpp | 48 | ||||
-rw-r--r-- | libopie2/opiecore/device/odevice_ramses.cpp | 44 | ||||
-rw-r--r-- | libopie2/opiecore/device/odevice_simpad.cpp | 48 | ||||
-rw-r--r-- | libopie2/opiecore/device/odevice_yopy.cpp | 48 | ||||
-rw-r--r-- | libopie2/opiecore/device/odevice_zaurus.cpp | 48 |
9 files changed, 221 insertions, 206 deletions
diff --git a/libopie2/opiecore/device/odevice.cpp b/libopie2/opiecore/device/odevice.cpp index fcdbf45..dd1e2f3 100644 --- a/libopie2/opiecore/device/odevice.cpp +++ b/libopie2/opiecore/device/odevice.cpp | |||
@@ -1,75 +1,77 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of the Opie Project | 2 | Â Â Â Â Â Â Â Â This file is part of the Opie Project |
3 | Copyright (C) The Opie Team <opie-devel@handhelds.org> | 3 | |
4 | Copyright (C)2002-2005 The Opie Team <opie-devel@handhelds.org> | ||
4 | =. | 5 | =. |
5 | .=l. | 6 | .=l. |
6 | .>+-= | 7 | Â Â Â Â Â Â .>+-= |
7 | _;:, .> :=|. This program is free software; you can | 8 | Â _;:, Â Â .> Â Â :=|. This program is free software; you can |
8 | .> <`_, > . <= redistribute it and/or modify it under | 9 | .> <`_, Â > Â . Â <= redistribute it and/or modify it under |
9 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | 10 | :`=1 )Y*s>-.-- Â : the terms of the GNU Library General Public |
10 | .="- .-=="i, .._ License as published by the Free Software | 11 | .="- .-=="i, Â Â .._ License as published by the Free Software |
11 | - . .-<_> .<> Foundation; either version 2 of the License, | 12 | Â - . Â .-<_> Â Â .<> Foundation; either version 2 of the License, |
12 | ._= =} : or (at your option) any later version. | 13 | Â Â Â ._= =} Â Â Â : or (at your option) any later version. |
13 | .%`+i> _;_. | 14 | Â Â .%`+i> Â Â Â _;_. |
14 | .i_,=:_. -<s. This program is distributed in the hope that | 15 | Â Â .i_,=:_. Â Â Â -<s. This program is distributed in the hope that |
15 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 16 | Â Â Â + Â . Â -:. Â Â Â = it will be useful, but WITHOUT ANY WARRANTY; |
16 | : .. .:, . . . without even the implied warranty of | 17 | : .. Â Â .:, Â Â . . . without even the implied warranty of |
17 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 18 | Â Â =_ Â Â Â Â + Â Â =;=|` MERCHANTABILITY or FITNESS FOR A |
18 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | 19 | Â _.=:. Â Â Â : Â Â :=>`: PARTICULAR PURPOSE. See the GNU |
19 | ..}^=.= = ; Library General Public License for more | 20 | ..}^=.= Â Â Â = Â Â Â ; Library General Public License for more |
20 | ++= -. .` .: details. | 21 | ++= Â -. Â Â .` Â Â .: details. |
21 | : = ...= . :.=- | 22 | : Â Â = Â ...= . :.=- |
22 | -. .:....=;==+<; You should have received a copy of the GNU | 23 | Â -. Â .:....=;==+<; You should have received a copy of the GNU |
23 | -_. . . )=. = Library General Public License along with | 24 | Â -_. . . Â )=. Â = Library General Public License along with |
24 | -- :-=` this library; see the file COPYING.LIB. | 25 | Â Â -- Â Â Â Â :-=` this library; see the file COPYING.LIB. |
25 | If not, write to the Free Software Foundation, | 26 | If not, write to the Free Software Foundation, |
26 | Inc., 59 Temple Place - Suite 330, | 27 | Inc., 59 Temple Place - Suite 330, |
27 | Boston, MA 02111-1307, USA. | 28 | Boston, MA 02111-1307, USA. |
28 | */ | 29 | */ |
29 | 30 | ||
30 | #include "odevice_beagle.h" | 31 | #include "odevice_beagle.h" |
31 | #include "odevice_ipaq.h" | 32 | #include "odevice_ipaq.h" |
32 | #include "odevice_jornada.h" | 33 | #include "odevice_jornada.h" |
33 | #include "odevice_ramses.h" | 34 | #include "odevice_ramses.h" |
34 | #include "odevice_simpad.h" | 35 | #include "odevice_simpad.h" |
35 | #include "odevice_yopy.h" | 36 | #include "odevice_yopy.h" |
36 | #include "odevice_zaurus.h" | 37 | #include "odevice_zaurus.h" |
37 | #include "odevice_genuineintel.h" | 38 | #include "odevice_genuineintel.h" |
38 | 39 | ||
39 | /* QT */ | 40 | /* QT */ |
40 | #include <qapplication.h> | 41 | #include <qapplication.h> |
41 | #include <qfile.h> | 42 | #include <qfile.h> |
42 | #include <qtextstream.h> | 43 | #include <qtextstream.h> |
43 | #include <qwindowsystem_qws.h> | 44 | #include <qwindowsystem_qws.h> |
44 | 45 | ||
45 | /* OPIE */ | 46 | /* OPIE */ |
46 | #include <qpe/config.h> | 47 | #include <qpe/config.h> |
47 | #include <qpe/resource.h> | ||
48 | #include <qpe/sound.h> | 48 | #include <qpe/sound.h> |
49 | #include <qpe/qcopenvelope_qws.h> | 49 | #include <qpe/qcopenvelope_qws.h> |
50 | #include <qpe/sound.h> | 50 | #include <qpe/sound.h> |
51 | |||
51 | #include <opie2/okeyfilter.h> | 52 | #include <opie2/okeyfilter.h> |
53 | #include <opie2/oresource.h> | ||
52 | 54 | ||
53 | /* STD */ | 55 | /* STD */ |
54 | #include <fcntl.h> | 56 | #include <fcntl.h> |
55 | #include <math.h> | 57 | #include <math.h> |
56 | #include <stdlib.h> | 58 | #include <stdlib.h> |
57 | #include <signal.h> | 59 | #include <signal.h> |
58 | #include <sys/ioctl.h> | 60 | #include <sys/ioctl.h> |
59 | #include <sys/time.h> | 61 | #include <sys/time.h> |
60 | #include <unistd.h> | 62 | #include <unistd.h> |
61 | #ifndef QT_NO_SOUND | 63 | #ifndef QT_NO_SOUND |
62 | #include <linux/soundcard.h> | 64 | #include <linux/soundcard.h> |
63 | #endif | 65 | #endif |
64 | 66 | ||
65 | namespace Opie { | 67 | namespace Opie { |
66 | namespace Core { | 68 | namespace Core { |
67 | 69 | ||
68 | static const char* PATH_PROC_CPUINFO = "/proc/cpuinfo"; | 70 | static const char* PATH_PROC_CPUINFO = "/proc/cpuinfo"; |
69 | 71 | ||
70 | 72 | ||
71 | /* STATIC and common implementation */ | 73 | /* STATIC and common implementation */ |
72 | /* EXPORT */ ODistribution distributions[] = { | 74 | /* EXPORT */ ODistribution distributions[] = { |
73 | { System_Familiar, "FamiliarLinux", "/etc/familiar-version" }, | 75 | { System_Familiar, "FamiliarLinux", "/etc/familiar-version" }, |
74 | { System_OpenZaurus, "OpenZaurus", "/etc/oz_version" }, | 76 | { System_OpenZaurus, "OpenZaurus", "/etc/oz_version" }, |
75 | { System_OpenEmbedded, "OpenEmbedded", "/etc/oe-version" }, | 77 | { System_OpenEmbedded, "OpenEmbedded", "/etc/oe-version" }, |
@@ -214,49 +216,49 @@ void ODevice::systemMessage( const QCString &msg, const QByteArray & ) | |||
214 | if ( msg == "deviceButtonMappingChanged()" ) { | 216 | if ( msg == "deviceButtonMappingChanged()" ) { |
215 | reloadButtonMapping(); | 217 | reloadButtonMapping(); |
216 | } | 218 | } |
217 | } | 219 | } |
218 | 220 | ||
219 | void ODevice::init(const QString&) | 221 | void ODevice::init(const QString&) |
220 | { | 222 | { |
221 | } | 223 | } |
222 | 224 | ||
223 | /** | 225 | /** |
224 | * This method initialises the button mapping | 226 | * This method initialises the button mapping |
225 | */ | 227 | */ |
226 | void ODevice::initButtons() | 228 | void ODevice::initButtons() |
227 | { | 229 | { |
228 | if ( d->m_buttons ) | 230 | if ( d->m_buttons ) |
229 | return; | 231 | return; |
230 | 232 | ||
231 | qDebug ( "init Buttons" ); | 233 | qDebug ( "init Buttons" ); |
232 | d->m_buttons = new QValueList <ODeviceButton>; | 234 | d->m_buttons = new QValueList <ODeviceButton>; |
233 | for ( uint i = 0; i < ( sizeof( default_buttons ) / sizeof( default_button )); i++ ) { | 235 | for ( uint i = 0; i < ( sizeof( default_buttons ) / sizeof( default_button )); i++ ) { |
234 | default_button *db = default_buttons + i; | 236 | default_button *db = default_buttons + i; |
235 | ODeviceButton b; | 237 | ODeviceButton b; |
236 | b. setKeycode ( db->code ); | 238 | b. setKeycode ( db->code ); |
237 | b. setUserText ( QObject::tr ( "Button", db->utext )); | 239 | b. setUserText ( QObject::tr ( "Button", db->utext )); |
238 | b. setPixmap ( Resource::loadPixmap ( db->pix )); | 240 | b. setPixmap ( OResource::loadPixmap ( db->pix )); |
239 | b. setFactoryPresetPressedAction ( OQCopMessage ( makeChannel ( db->fpressedservice ), db->fpressedaction )); | 241 | b. setFactoryPresetPressedAction ( OQCopMessage ( makeChannel ( db->fpressedservice ), db->fpressedaction )); |
240 | b. setFactoryPresetHeldAction ( OQCopMessage ( makeChannel ( db->fheldservice ), db->fheldaction )); | 242 | b. setFactoryPresetHeldAction ( OQCopMessage ( makeChannel ( db->fheldservice ), db->fheldaction )); |
241 | d->m_buttons->append ( b ); | 243 | d->m_buttons->append ( b ); |
242 | } | 244 | } |
243 | 245 | ||
244 | reloadButtonMapping(); | 246 | reloadButtonMapping(); |
245 | } | 247 | } |
246 | 248 | ||
247 | ODevice::~ODevice() | 249 | ODevice::~ODevice() |
248 | { | 250 | { |
249 | // we leak m_devicebuttons and m_cpu_frequency | 251 | // we leak m_devicebuttons and m_cpu_frequency |
250 | // but it's a singleton and it is not so importantant | 252 | // but it's a singleton and it is not so importantant |
251 | // -zecke | 253 | // -zecke |
252 | delete d; | 254 | delete d; |
253 | } | 255 | } |
254 | 256 | ||
255 | /** | 257 | /** |
256 | * This method will try to suspend the device | 258 | * This method will try to suspend the device |
257 | * It only works if the user is the QWS Server and the apm application | 259 | * It only works if the user is the QWS Server and the apm application |
258 | * is installed. | 260 | * is installed. |
259 | * It tries to suspend and then waits some time cause some distributions | 261 | * It tries to suspend and then waits some time cause some distributions |
260 | * do have asynchronus apm implementations. | 262 | * do have asynchronus apm implementations. |
261 | * This method will either fail and return false or it'll suspend the | 263 | * This method will either fail and return false or it'll suspend the |
262 | * device and return once the device got woken up | 264 | * device and return once the device got woken up |
diff --git a/libopie2/opiecore/device/odevice_beagle.cpp b/libopie2/opiecore/device/odevice_beagle.cpp index ac12ca6..8735c63 100644 --- a/libopie2/opiecore/device/odevice_beagle.cpp +++ b/libopie2/opiecore/device/odevice_beagle.cpp | |||
@@ -1,57 +1,58 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of the Opie Project | 2 | Â Â Â Â Â Â Â Â This file is part of the Opie Project |
3 | Copyright (C) 2004 The Opie Team <opie-devel@handhelds.org> | 3 | |
4 | Copyright (C)2004 The Opie Team <opie-devel@handhelds.org> | ||
4 | =. | 5 | =. |
5 | .=l. | 6 | .=l. |
6 | .>+-= | 7 | Â Â Â Â Â Â .>+-= |
7 | _;:, .> :=|. This program is free software; you can | 8 | Â _;:, Â Â .> Â Â :=|. This program is free software; you can |
8 | .> <`_, > . <= redistribute it and/or modify it under | 9 | .> <`_, Â > Â . Â <= redistribute it and/or modify it under |
9 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | 10 | :`=1 )Y*s>-.-- Â : the terms of the GNU Library General Public |
10 | .="- .-=="i, .._ License as published by the Free Software | 11 | .="- .-=="i, Â Â .._ License as published by the Free Software |
11 | - . .-<_> .<> Foundation; either version 2 of the License, | 12 | Â - . Â .-<_> Â Â .<> Foundation; either version 2 of the License, |
12 | ._= =} : or (at your option) any later version. | 13 | Â Â Â ._= =} Â Â Â : or (at your option) any later version. |
13 | .%`+i> _;_. | 14 | Â Â .%`+i> Â Â Â _;_. |
14 | .i_,=:_. -<s. This program is distributed in the hope that | 15 | Â Â .i_,=:_. Â Â Â -<s. This program is distributed in the hope that |
15 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 16 | Â Â Â + Â . Â -:. Â Â Â = it will be useful, but WITHOUT ANY WARRANTY; |
16 | : .. .:, . . . without even the implied warranty of | 17 | : .. Â Â .:, Â Â . . . without even the implied warranty of |
17 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 18 | Â Â =_ Â Â Â Â + Â Â =;=|` MERCHANTABILITY or FITNESS FOR A |
18 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | 19 | Â _.=:. Â Â Â : Â Â :=>`: PARTICULAR PURPOSE. See the GNU |
19 | ..}^=.= = ; Library General Public License for more | 20 | ..}^=.= Â Â Â = Â Â Â ; Library General Public License for more |
20 | ++= -. .` .: details. | 21 | ++= Â -. Â Â .` Â Â .: details. |
21 | : = ...= . :.=- | 22 | : Â Â = Â ...= . :.=- |
22 | -. .:....=;==+<; You should have received a copy of the GNU | 23 | Â -. Â .:....=;==+<; You should have received a copy of the GNU |
23 | -_. . . )=. = Library General Public License along with | 24 | Â -_. . . Â )=. Â = Library General Public License along with |
24 | -- :-=` this library; see the file COPYING.LIB. | 25 | Â Â -- Â Â Â Â :-=` this library; see the file COPYING.LIB. |
25 | If not, write to the Free Software Foundation, | 26 | If not, write to the Free Software Foundation, |
26 | Inc., 59 Temple Place - Suite 330, | 27 | Inc., 59 Temple Place - Suite 330, |
27 | Boston, MA 02111-1307, USA. | 28 | Boston, MA 02111-1307, USA. |
28 | */ | 29 | */ |
29 | 30 | ||
30 | #include "odevicebutton.h" | 31 | #include "odevicebutton.h" |
31 | #include "odevice_beagle.h" | 32 | #include "odevice_beagle.h" |
32 | 33 | ||
33 | #include <qpe/resource.h> | 34 | #include <opie2/oresource.h> |
34 | 35 | ||
35 | #include <sys/types.h> | 36 | #include <sys/types.h> |
36 | #include <sys/ioctl.h> | 37 | #include <sys/ioctl.h> |
37 | #include <fcntl.h> | 38 | #include <fcntl.h> |
38 | #include <unistd.h> | 39 | #include <unistd.h> |
39 | 40 | ||
40 | 41 | ||
41 | /* | 42 | /* |
42 | * Intel Assabat FrontLight Control | 43 | * Intel Assabat FrontLight Control |
43 | */ | 44 | */ |
44 | #define _SA1100_FL_IOCTL_ON 1 | 45 | #define _SA1100_FL_IOCTL_ON 1 |
45 | #define _SA1100_FL_IOCTL_OFF 2 | 46 | #define _SA1100_FL_IOCTL_OFF 2 |
46 | #define _SA1100_FL_IOCTL_INTENSITY3 | 47 | #define _SA1100_FL_IOCTL_INTENSITY3 |
47 | #define _SA1100_FL_IOCTL_BACKLIGHT 4 | 48 | #define _SA1100_FL_IOCTL_BACKLIGHT 4 |
48 | #define _SA1100_FL_IOCTL_CONTRAST5 | 49 | #define _SA1100_FL_IOCTL_CONTRAST5 |
49 | #define _SA1100_FL_IOCTL_GET_BACKLIGHT 6 | 50 | #define _SA1100_FL_IOCTL_GET_BACKLIGHT 6 |
50 | #define _SA1100_FL_IOCTL_GET_CONTRAST 7 | 51 | #define _SA1100_FL_IOCTL_GET_CONTRAST 7 |
51 | // added by Sean Hsieh | 52 | // added by Sean Hsieh |
52 | #define _SA1100_FL_IOCTL_PWR_TOGGLE 8 | 53 | #define _SA1100_FL_IOCTL_PWR_TOGGLE 8 |
53 | #define _SA1100_FL_IOCTL_AUTOLIGHT 10 | 54 | #define _SA1100_FL_IOCTL_AUTOLIGHT 10 |
54 | 55 | ||
55 | /* | 56 | /* |
56 | * The device | 57 | * The device |
57 | */ | 58 | */ |
@@ -125,49 +126,49 @@ void Beagle::init( const QString&) { | |||
125 | d->m_rotation = Rot0; | 126 | d->m_rotation = Rot0; |
126 | d->m_model = Model_Beagle_PA100; | 127 | d->m_model = Model_Beagle_PA100; |
127 | } | 128 | } |
128 | 129 | ||
129 | 130 | ||
130 | /* | 131 | /* |
131 | * Initialize the Buttons. We only do it | 132 | * Initialize the Buttons. We only do it |
132 | * if not yet initialized. | 133 | * if not yet initialized. |
133 | * We go through our hardware button array | 134 | * We go through our hardware button array |
134 | * and set the 'Factory' Pressed and Held Action | 135 | * and set the 'Factory' Pressed and Held Action |
135 | * reloadButtonMapping will then apply the user | 136 | * reloadButtonMapping will then apply the user |
136 | * configuration to the buttons | 137 | * configuration to the buttons |
137 | */ | 138 | */ |
138 | void Beagle::initButtons() { | 139 | void Beagle::initButtons() { |
139 | if ( d->m_buttons ) | 140 | if ( d->m_buttons ) |
140 | return; | 141 | return; |
141 | 142 | ||
142 | d->m_buttons = new QValueList<ODeviceButton>; | 143 | d->m_buttons = new QValueList<ODeviceButton>; |
143 | uint length = sizeof( beagle_buttons )/ sizeof( b_button ); | 144 | uint length = sizeof( beagle_buttons )/ sizeof( b_button ); |
144 | for ( uint i = 0; i < length; ++i ) { | 145 | for ( uint i = 0; i < length; ++i ) { |
145 | b_button *bb = &beagle_buttons[i]; | 146 | b_button *bb = &beagle_buttons[i]; |
146 | ODeviceButton b; | 147 | ODeviceButton b; |
147 | b.setKeycode( bb->code ); | 148 | b.setKeycode( bb->code ); |
148 | b.setUserText( QObject::tr( "Button", bb->utext ) ); | 149 | b.setUserText( QObject::tr( "Button", bb->utext ) ); |
149 | b.setPixmap( Resource::loadPixmap( bb->pix ) ); | 150 | b.setPixmap( OResource::loadPixmap( bb->pix ) ); |
150 | b.setFactoryPresetPressedAction( OQCopMessage( makeChannel( bb->fpressedservice ), bb->fpressedaction ) ); | 151 | b.setFactoryPresetPressedAction( OQCopMessage( makeChannel( bb->fpressedservice ), bb->fpressedaction ) ); |
151 | b.setFactoryPresetHeldAction( OQCopMessage( makeChannel( bb->fheldservice ), bb->fheldaction ) ); | 152 | b.setFactoryPresetHeldAction( OQCopMessage( makeChannel( bb->fheldservice ), bb->fheldaction ) ); |
152 | d->m_buttons->append( b ); | 153 | d->m_buttons->append( b ); |
153 | } | 154 | } |
154 | 155 | ||
155 | reloadButtonMapping(); | 156 | reloadButtonMapping(); |
156 | } | 157 | } |
157 | 158 | ||
158 | /* | 159 | /* |
159 | * Turn the display on. We do it by ioctl on FL_FILE | 160 | * Turn the display on. We do it by ioctl on FL_FILE |
160 | */ | 161 | */ |
161 | bool Beagle::setDisplayStatus( bool on ) { | 162 | bool Beagle::setDisplayStatus( bool on ) { |
162 | int fd = ::open(FL_FILE, O_WRONLY); | 163 | int fd = ::open(FL_FILE, O_WRONLY); |
163 | 164 | ||
164 | if ( fd < 0 ) | 165 | if ( fd < 0 ) |
165 | return false; | 166 | return false; |
166 | 167 | ||
167 | return ( ::ioctl(fd, on ? _SA1100_FL_IOCTL_ON : _SA1100_FL_IOCTL_OFF, 0 ) == 0 ); | 168 | return ( ::ioctl(fd, on ? _SA1100_FL_IOCTL_ON : _SA1100_FL_IOCTL_OFF, 0 ) == 0 ); |
168 | } | 169 | } |
169 | 170 | ||
170 | /* | 171 | /* |
171 | * 0-100 are legal steps of the frontlight. | 172 | * 0-100 are legal steps of the frontlight. |
172 | */ | 173 | */ |
173 | int Beagle::displayBrightnessResolution()const { | 174 | int Beagle::displayBrightnessResolution()const { |
diff --git a/libopie2/opiecore/device/odevice_genuineintel.cpp b/libopie2/opiecore/device/odevice_genuineintel.cpp index 1584249..b980909 100644 --- a/libopie2/opiecore/device/odevice_genuineintel.cpp +++ b/libopie2/opiecore/device/odevice_genuineintel.cpp | |||
@@ -1,67 +1,69 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of the Opie Project | 2 | Â Â Â Â Â Â Â Â This file is part of the Opie Project |
3 | Copyright (C) 2002,2003,2004 The Opie Team <opie-devel@handhelds.org> | 3 | |
4 | Copyright (C)2002, 2003, 2004 The Opie Team <opie-devel@handhelds.org> | ||
4 | =. | 5 | =. |
5 | .=l. | 6 | .=l. |
6 | .>+-= | 7 | Â Â Â Â Â Â .>+-= |
7 | _;:, .> :=|. This program is free software; you can | 8 | Â _;:, Â Â .> Â Â :=|. This program is free software; you can |
8 | .> <`_, > . <= redistribute it and/or modify it under | 9 | .> <`_, Â > Â . Â <= redistribute it and/or modify it under |
9 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | 10 | :`=1 )Y*s>-.-- Â : the terms of the GNU Library General Public |
10 | .="- .-=="i, .._ License as published by the Free Software | 11 | .="- .-=="i, Â Â .._ License as published by the Free Software |
11 | - . .-<_> .<> Foundation; either version 2 of the License, | 12 | Â - . Â .-<_> Â Â .<> Foundation; either version 2 of the License, |
12 | ._= =} : or (at your option) any later version. | 13 | Â Â Â ._= =} Â Â Â : or (at your option) any later version. |
13 | .%`+i> _;_. | 14 | Â Â .%`+i> Â Â Â _;_. |
14 | .i_,=:_. -<s. This program is distributed in the hope that | 15 | Â Â .i_,=:_. Â Â Â -<s. This program is distributed in the hope that |
15 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 16 | Â Â Â + Â . Â -:. Â Â Â = it will be useful, but WITHOUT ANY WARRANTY; |
16 | : .. .:, . . . without even the implied warranty of | 17 | : .. Â Â .:, Â Â . . . without even the implied warranty of |
17 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 18 | Â Â =_ Â Â Â Â + Â Â =;=|` MERCHANTABILITY or FITNESS FOR A |
18 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | 19 | Â _.=:. Â Â Â : Â Â :=>`: PARTICULAR PURPOSE. See the GNU |
19 | ..}^=.= = ; Library General Public License for more | 20 | ..}^=.= Â Â Â = Â Â Â ; Library General Public License for more |
20 | ++= -. .` .: details. | 21 | ++= Â -. Â Â .` Â Â .: details. |
21 | : = ...= . :.=- | 22 | : Â Â = Â ...= . :.=- |
22 | -. .:....=;==+<; You should have received a copy of the GNU | 23 | Â -. Â .:....=;==+<; You should have received a copy of the GNU |
23 | -_. . . )=. = Library General Public License along with | 24 | Â -_. . . Â )=. Â = Library General Public License along with |
24 | -- :-=` this library; see the file COPYING.LIB. | 25 | Â Â -- Â Â Â Â :-=` this library; see the file COPYING.LIB. |
25 | If not, write to the Free Software Foundation, | 26 | If not, write to the Free Software Foundation, |
26 | Inc., 59 Temple Place - Suite 330, | 27 | Inc., 59 Temple Place - Suite 330, |
27 | Boston, MA 02111-1307, USA. | 28 | Boston, MA 02111-1307, USA. |
28 | */ | 29 | */ |
29 | 30 | ||
30 | #include "odevice_genuineintel.h" | 31 | #include "odevice_genuineintel.h" |
31 | 32 | ||
32 | /* QT */ | 33 | /* QT */ |
33 | #include <qapplication.h> | 34 | #include <qapplication.h> |
34 | #include <qfile.h> | 35 | #include <qfile.h> |
35 | #include <qtextstream.h> | 36 | #include <qtextstream.h> |
36 | #include <qwindowsystem_qws.h> | 37 | #include <qwindowsystem_qws.h> |
37 | 38 | ||
38 | /* OPIE */ | 39 | /* OPIE */ |
39 | #include <qpe/config.h> | 40 | #include <qpe/config.h> |
40 | #include <qpe/resource.h> | ||
41 | #include <qpe/sound.h> | 41 | #include <qpe/sound.h> |
42 | #include <qpe/qcopenvelope_qws.h> | 42 | #include <qpe/qcopenvelope_qws.h> |
43 | |||
43 | #include <opie2/okeyfilter.h> | 44 | #include <opie2/okeyfilter.h> |
45 | #include <opie2/oresource.h> | ||
44 | 46 | ||
45 | #ifndef QT_NO_SOUND | 47 | #ifndef QT_NO_SOUND |
46 | #include <linux/soundcard.h> | 48 | #include <linux/soundcard.h> |
47 | #endif | 49 | #endif |
48 | 50 | ||
49 | using namespace Opie::Core; | 51 | using namespace Opie::Core; |
50 | using namespace Opie::Core::Internal; | 52 | using namespace Opie::Core::Internal; |
51 | 53 | ||
52 | struct gi_button genuineintel_buttons [] = { | 54 | struct gi_button genuineintel_buttons [] = { |
53 | { | 55 | { |
54 | Qt::Key_F1, QT_TRANSLATE_NOOP("Button", "Calendar Button"), | 56 | Qt::Key_F1, QT_TRANSLATE_NOOP("Button", "Calendar Button"), |
55 | "devicebuttons/ipaq_calendar", | 57 | "devicebuttons/ipaq_calendar", |
56 | "datebook", "nextView()", | 58 | "datebook", "nextView()", |
57 | "today", "raise()" }, | 59 | "today", "raise()" }, |
58 | { | 60 | { |
59 | Qt::Key_F2, QT_TRANSLATE_NOOP("Button", "Contacts Button"), | 61 | Qt::Key_F2, QT_TRANSLATE_NOOP("Button", "Contacts Button"), |
60 | "devicebuttons/ipaq_contact", | 62 | "devicebuttons/ipaq_contact", |
61 | "addressbook", "raise()", | 63 | "addressbook", "raise()", |
62 | "addressbook", "beamBusinessCard()" }, | 64 | "addressbook", "beamBusinessCard()" }, |
63 | { | 65 | { |
64 | Qt::Key_F3, QT_TRANSLATE_NOOP("Button", "Menu Button"), | 66 | Qt::Key_F3, QT_TRANSLATE_NOOP("Button", "Menu Button"), |
65 | "devicebuttons/ipaq_menu", | 67 | "devicebuttons/ipaq_menu", |
66 | "QPE/TaskBar", "toggleMenu()", | 68 | "QPE/TaskBar", "toggleMenu()", |
67 | "QPE/TaskBar", "toggleStartMenu()" }, | 69 | "QPE/TaskBar", "toggleStartMenu()" }, |
@@ -89,49 +91,49 @@ void GenuineIntel::init(const QString& model) | |||
89 | 91 | ||
90 | QStringList SL = QStringList::split( " ", model ); | 92 | QStringList SL = QStringList::split( " ", model ); |
91 | 93 | ||
92 | d->m_model = Model_GenuineIntel; | 94 | d->m_model = Model_GenuineIntel; |
93 | d->m_rotation = Rot0; | 95 | d->m_rotation = Rot0; |
94 | } | 96 | } |
95 | 97 | ||
96 | void GenuineIntel::initButtons() | 98 | void GenuineIntel::initButtons() |
97 | { | 99 | { |
98 | if ( d->m_buttons ) | 100 | if ( d->m_buttons ) |
99 | return; | 101 | return; |
100 | 102 | ||
101 | if ( isQWS( ) ) { | 103 | if ( isQWS( ) ) { |
102 | addPreHandler(this); | 104 | addPreHandler(this); |
103 | } | 105 | } |
104 | 106 | ||
105 | d->m_buttons = new QValueList <ODeviceButton>; | 107 | d->m_buttons = new QValueList <ODeviceButton>; |
106 | 108 | ||
107 | for ( uint i = 0; i < ( sizeof( genuineintel_buttons ) / sizeof( gi_button )); i++ ) { | 109 | for ( uint i = 0; i < ( sizeof( genuineintel_buttons ) / sizeof( gi_button )); i++ ) { |
108 | gi_button *ib = genuineintel_buttons + i; | 110 | gi_button *ib = genuineintel_buttons + i; |
109 | ODeviceButton b; | 111 | ODeviceButton b; |
110 | 112 | ||
111 | b. setKeycode ( ib->code ); | 113 | b. setKeycode ( ib->code ); |
112 | b. setUserText ( QObject::tr ( "Button", ib->utext )); | 114 | b. setUserText ( QObject::tr ( "Button", ib->utext )); |
113 | b. setPixmap ( Resource::loadPixmap ( ib->pix )); | 115 | b. setPixmap ( OResource::loadPixmap ( ib->pix )); |
114 | b. setFactoryPresetPressedAction ( OQCopMessage ( makeChannel ( ib->fpressedservice ), ib->fpressedaction )); | 116 | b. setFactoryPresetPressedAction ( OQCopMessage ( makeChannel ( ib->fpressedservice ), ib->fpressedaction )); |
115 | b. setFactoryPresetHeldAction ( OQCopMessage ( makeChannel ( ib->fheldservice ), ib->fheldaction )); | 117 | b. setFactoryPresetHeldAction ( OQCopMessage ( makeChannel ( ib->fheldservice ), ib->fheldaction )); |
116 | 118 | ||
117 | d->m_buttons->append ( b ); | 119 | d->m_buttons->append ( b ); |
118 | } | 120 | } |
119 | reloadButtonMapping(); | 121 | reloadButtonMapping(); |
120 | } | 122 | } |
121 | 123 | ||
122 | QValueList <OLed> GenuineIntel::ledList() const | 124 | QValueList <OLed> GenuineIntel::ledList() const |
123 | { | 125 | { |
124 | QValueList <OLed> vl; | 126 | QValueList <OLed> vl; |
125 | return vl; //none | 127 | return vl; //none |
126 | } | 128 | } |
127 | 129 | ||
128 | QValueList <OLedState> GenuineIntel::ledStateList ( OLed ) const | 130 | QValueList <OLedState> GenuineIntel::ledStateList ( OLed ) const |
129 | { | 131 | { |
130 | QValueList <OLedState> vl; | 132 | QValueList <OLedState> vl; |
131 | return vl; // none | 133 | return vl; // none |
132 | } | 134 | } |
133 | 135 | ||
134 | OLedState GenuineIntel::ledState ( OLed ) const | 136 | OLedState GenuineIntel::ledState ( OLed ) const |
135 | { | 137 | { |
136 | return Led_Off; | 138 | return Led_Off; |
137 | } | 139 | } |
diff --git a/libopie2/opiecore/device/odevice_ipaq.cpp b/libopie2/opiecore/device/odevice_ipaq.cpp index 2ce38a9..8bc775f 100644 --- a/libopie2/opiecore/device/odevice_ipaq.cpp +++ b/libopie2/opiecore/device/odevice_ipaq.cpp | |||
@@ -1,67 +1,69 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of the Opie Project | 2 | Â Â Â Â Â Â Â Â This file is part of the Opie Project |
3 | Copyright (C) 2002,2003,2004 The Opie Team <opie-devel@handhelds.org> | 3 | |
4 | Copyright (C)2002, 2003, 2004 The Opie Team <opie-devel@handhelds.org> | ||
4 | =. | 5 | =. |
5 | .=l. | 6 | .=l. |
6 | .>+-= | 7 | Â Â Â Â Â Â .>+-= |
7 | _;:, .> :=|. This program is free software; you can | 8 | Â _;:, Â Â .> Â Â :=|. This program is free software; you can |
8 | .> <`_, > . <= redistribute it and/or modify it under | 9 | .> <`_, Â > Â . Â <= redistribute it and/or modify it under |
9 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | 10 | :`=1 )Y*s>-.-- Â : the terms of the GNU Library General Public |
10 | .="- .-=="i, .._ License as published by the Free Software | 11 | .="- .-=="i, Â Â .._ License as published by the Free Software |
11 | - . .-<_> .<> Foundation; either version 2 of the License, | 12 | Â - . Â .-<_> Â Â .<> Foundation; either version 2 of the License, |
12 | ._= =} : or (at your option) any later version. | 13 | Â Â Â ._= =} Â Â Â : or (at your option) any later version. |
13 | .%`+i> _;_. | 14 | Â Â .%`+i> Â Â Â _;_. |
14 | .i_,=:_. -<s. This program is distributed in the hope that | 15 | Â Â .i_,=:_. Â Â Â -<s. This program is distributed in the hope that |
15 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 16 | Â Â Â + Â . Â -:. Â Â Â = it will be useful, but WITHOUT ANY WARRANTY; |
16 | : .. .:, . . . without even the implied warranty of | 17 | : .. Â Â .:, Â Â . . . without even the implied warranty of |
17 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 18 | Â Â =_ Â Â Â Â + Â Â =;=|` MERCHANTABILITY or FITNESS FOR A |
18 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | 19 | Â _.=:. Â Â Â : Â Â :=>`: PARTICULAR PURPOSE. See the GNU |
19 | ..}^=.= = ; Library General Public License for more | 20 | ..}^=.= Â Â Â = Â Â Â ; Library General Public License for more |
20 | ++= -. .` .: details. | 21 | ++= Â -. Â Â .` Â Â .: details. |
21 | : = ...= . :.=- | 22 | : Â Â = Â ...= . :.=- |
22 | -. .:....=;==+<; You should have received a copy of the GNU | 23 | Â -. Â .:....=;==+<; You should have received a copy of the GNU |
23 | -_. . . )=. = Library General Public License along with | 24 | Â -_. . . Â )=. Â = Library General Public License along with |
24 | -- :-=` this library; see the file COPYING.LIB. | 25 | Â Â -- Â Â Â Â :-=` this library; see the file COPYING.LIB. |
25 | If not, write to the Free Software Foundation, | 26 | If not, write to the Free Software Foundation, |
26 | Inc., 59 Temple Place - Suite 330, | 27 | Inc., 59 Temple Place - Suite 330, |
27 | Boston, MA 02111-1307, USA. | 28 | Boston, MA 02111-1307, USA. |
28 | */ | 29 | */ |
29 | 30 | ||
30 | #include "odevice_ipaq.h" | 31 | #include "odevice_ipaq.h" |
31 | 32 | ||
32 | /* QT */ | 33 | /* QT */ |
33 | #include <qapplication.h> | 34 | #include <qapplication.h> |
34 | #include <qfile.h> | 35 | #include <qfile.h> |
35 | #include <qtextstream.h> | 36 | #include <qtextstream.h> |
36 | #include <qwindowsystem_qws.h> | 37 | #include <qwindowsystem_qws.h> |
37 | 38 | ||
38 | /* OPIE */ | 39 | /* OPIE */ |
39 | #include <qpe/config.h> | 40 | #include <qpe/config.h> |
40 | #include <qpe/resource.h> | ||
41 | #include <qpe/sound.h> | 41 | #include <qpe/sound.h> |
42 | #include <qpe/qcopenvelope_qws.h> | 42 | #include <qpe/qcopenvelope_qws.h> |
43 | |||
43 | #include <opie2/okeyfilter.h> | 44 | #include <opie2/okeyfilter.h> |
45 | #include <opie2/oresource.h> | ||
44 | 46 | ||
45 | /* STD */ | 47 | /* STD */ |
46 | #include <fcntl.h> | 48 | #include <fcntl.h> |
47 | #include <math.h> | 49 | #include <math.h> |
48 | #include <stdlib.h> | 50 | #include <stdlib.h> |
49 | #include <signal.h> | 51 | #include <signal.h> |
50 | #include <sys/ioctl.h> | 52 | #include <sys/ioctl.h> |
51 | #include <sys/time.h> | 53 | #include <sys/time.h> |
52 | #include <unistd.h> | 54 | #include <unistd.h> |
53 | #ifndef QT_NO_SOUND | 55 | #ifndef QT_NO_SOUND |
54 | #include <linux/soundcard.h> | 56 | #include <linux/soundcard.h> |
55 | #endif | 57 | #endif |
56 | 58 | ||
57 | 59 | ||
58 | using namespace Opie::Core; | 60 | using namespace Opie::Core; |
59 | using namespace Opie::Core::Internal; | 61 | using namespace Opie::Core::Internal; |
60 | 62 | ||
61 | /* KERNEL */ | 63 | /* KERNEL */ |
62 | #define OD_IOC(dir,type,number,size) (( dir << 30 ) | ( type << 8 ) | ( number ) | ( size << 16 )) | 64 | #define OD_IOC(dir,type,number,size) (( dir << 30 ) | ( type << 8 ) | ( number ) | ( size << 16 )) |
63 | 65 | ||
64 | #define OD_IO(type,number) OD_IOC(0,type,number,0) | 66 | #define OD_IO(type,number) OD_IOC(0,type,number,0) |
65 | #define OD_IOW(type,number,size) OD_IOC(1,type,number,sizeof(size)) | 67 | #define OD_IOW(type,number,size) OD_IOC(1,type,number,sizeof(size)) |
66 | #define OD_IOR(type,number,size) OD_IOC(2,type,number,sizeof(size)) | 68 | #define OD_IOR(type,number,size) OD_IOC(2,type,number,sizeof(size)) |
67 | #define OD_IORW(type,number,size) OD_IOC(3,type,number,sizeof(size)) | 69 | #define OD_IORW(type,number,size) OD_IOC(3,type,number,sizeof(size)) |
@@ -160,49 +162,49 @@ void iPAQ::init(const QString& model) | |||
160 | m_leds [0] = m_leds [1] = Led_Off; | 162 | m_leds [0] = m_leds [1] = Led_Off; |
161 | 163 | ||
162 | m_power_timer = 0; | 164 | m_power_timer = 0; |
163 | 165 | ||
164 | } | 166 | } |
165 | 167 | ||
166 | void iPAQ::initButtons() | 168 | void iPAQ::initButtons() |
167 | { | 169 | { |
168 | if ( d->m_buttons ) | 170 | if ( d->m_buttons ) |
169 | return; | 171 | return; |
170 | 172 | ||
171 | if ( isQWS( ) ) { | 173 | if ( isQWS( ) ) { |
172 | addPreHandler(this); | 174 | addPreHandler(this); |
173 | } | 175 | } |
174 | 176 | ||
175 | d->m_buttons = new QValueList <ODeviceButton>; | 177 | d->m_buttons = new QValueList <ODeviceButton>; |
176 | 178 | ||
177 | for ( uint i = 0; i < ( sizeof( ipaq_buttons ) / sizeof( i_button )); i++ ) { | 179 | for ( uint i = 0; i < ( sizeof( ipaq_buttons ) / sizeof( i_button )); i++ ) { |
178 | i_button *ib = ipaq_buttons + i; | 180 | i_button *ib = ipaq_buttons + i; |
179 | ODeviceButton b; | 181 | ODeviceButton b; |
180 | 182 | ||
181 | if (( ib->model & d->m_model ) == d->m_model ) { | 183 | if (( ib->model & d->m_model ) == d->m_model ) { |
182 | b. setKeycode ( ib->code ); | 184 | b. setKeycode ( ib->code ); |
183 | b. setUserText ( QObject::tr ( "Button", ib->utext )); | 185 | b. setUserText ( QObject::tr ( "Button", ib->utext )); |
184 | b. setPixmap ( Resource::loadPixmap ( ib->pix )); | 186 | b. setPixmap ( OResource::loadPixmap ( ib->pix )); |
185 | b. setFactoryPresetPressedAction ( OQCopMessage ( makeChannel ( ib->fpressedservice ), ib->fpressedaction )); | 187 | b. setFactoryPresetPressedAction ( OQCopMessage ( makeChannel ( ib->fpressedservice ), ib->fpressedaction )); |
186 | b. setFactoryPresetHeldAction ( OQCopMessage ( makeChannel ( ib->fheldservice ), ib->fheldaction )); | 188 | b. setFactoryPresetHeldAction ( OQCopMessage ( makeChannel ( ib->fheldservice ), ib->fheldaction )); |
187 | 189 | ||
188 | d->m_buttons->append ( b ); | 190 | d->m_buttons->append ( b ); |
189 | } | 191 | } |
190 | } | 192 | } |
191 | reloadButtonMapping(); | 193 | reloadButtonMapping(); |
192 | } | 194 | } |
193 | 195 | ||
194 | QValueList <OLed> iPAQ::ledList() const | 196 | QValueList <OLed> iPAQ::ledList() const |
195 | { | 197 | { |
196 | QValueList <OLed> vl; | 198 | QValueList <OLed> vl; |
197 | vl << Led_Power; | 199 | vl << Led_Power; |
198 | 200 | ||
199 | if ( d->m_model == Model_iPAQ_H38xx ) | 201 | if ( d->m_model == Model_iPAQ_H38xx ) |
200 | vl << Led_BlueTooth; | 202 | vl << Led_BlueTooth; |
201 | return vl; | 203 | return vl; |
202 | } | 204 | } |
203 | 205 | ||
204 | QValueList <OLedState> iPAQ::ledStateList ( OLed l ) const | 206 | QValueList <OLedState> iPAQ::ledStateList ( OLed l ) const |
205 | { | 207 | { |
206 | QValueList <OLedState> vl; | 208 | QValueList <OLedState> vl; |
207 | 209 | ||
208 | if ( l == Led_Power ) | 210 | if ( l == Led_Power ) |
diff --git a/libopie2/opiecore/device/odevice_jornada.cpp b/libopie2/opiecore/device/odevice_jornada.cpp index 3acba03..7dbde48 100644 --- a/libopie2/opiecore/device/odevice_jornada.cpp +++ b/libopie2/opiecore/device/odevice_jornada.cpp | |||
@@ -1,67 +1,69 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of the Opie Project | 2 | Â Â Â Â Â Â Â Â This file is part of the Opie Project |
3 | Copyright (C) The Opie Team <opie-devel@handhelds.org> | 3 | |
4 | Copyright (C)2002-2005 The Opie Team <opie-devel@handhelds.org> | ||
4 | =. | 5 | =. |
5 | .=l. | 6 | .=l. |
6 | .>+-= | 7 | Â Â Â Â Â Â .>+-= |
7 | _;:, .> :=|. This program is free software; you can | 8 | Â _;:, Â Â .> Â Â :=|. This program is free software; you can |
8 | .> <`_, > . <= redistribute it and/or modify it under | 9 | .> <`_, Â > Â . Â <= redistribute it and/or modify it under |
9 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | 10 | :`=1 )Y*s>-.-- Â : the terms of the GNU Library General Public |
10 | .="- .-=="i, .._ License as published by the Free Software | 11 | .="- .-=="i, Â Â .._ License as published by the Free Software |
11 | - . .-<_> .<> Foundation; either version 2 of the License, | 12 | Â - . Â .-<_> Â Â .<> Foundation; either version 2 of the License, |
12 | ._= =} : or (at your option) any later version. | 13 | Â Â Â ._= =} Â Â Â : or (at your option) any later version. |
13 | .%`+i> _;_. | 14 | Â Â .%`+i> Â Â Â _;_. |
14 | .i_,=:_. -<s. This program is distributed in the hope that | 15 | Â Â .i_,=:_. Â Â Â -<s. This program is distributed in the hope that |
15 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 16 | Â Â Â + Â . Â -:. Â Â Â = it will be useful, but WITHOUT ANY WARRANTY; |
16 | : .. .:, . . . without even the implied warranty of | 17 | : .. Â Â .:, Â Â . . . without even the implied warranty of |
17 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 18 | Â Â =_ Â Â Â Â + Â Â =;=|` MERCHANTABILITY or FITNESS FOR A |
18 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | 19 | Â _.=:. Â Â Â : Â Â :=>`: PARTICULAR PURPOSE. See the GNU |
19 | ..}^=.= = ; Library General Public License for more | 20 | ..}^=.= Â Â Â = Â Â Â ; Library General Public License for more |
20 | ++= -. .` .: details. | 21 | ++= Â -. Â Â .` Â Â .: details. |
21 | : = ...= . :.=- | 22 | : Â Â = Â ...= . :.=- |
22 | -. .:....=;==+<; You should have received a copy of the GNU | 23 | Â -. Â .:....=;==+<; You should have received a copy of the GNU |
23 | -_. . . )=. = Library General Public License along with | 24 | Â -_. . . Â )=. Â = Library General Public License along with |
24 | -- :-=` this library; see the file COPYING.LIB. | 25 | Â Â -- Â Â Â Â :-=` this library; see the file COPYING.LIB. |
25 | If not, write to the Free Software Foundation, | 26 | If not, write to the Free Software Foundation, |
26 | Inc., 59 Temple Place - Suite 330, | 27 | Inc., 59 Temple Place - Suite 330, |
27 | Boston, MA 02111-1307, USA. | 28 | Boston, MA 02111-1307, USA. |
28 | */ | 29 | */ |
29 | 30 | ||
30 | #include "odevice_jornada.h" | 31 | #include "odevice_jornada.h" |
31 | 32 | ||
32 | /* QT */ | 33 | /* QT */ |
33 | #include <qapplication.h> | 34 | #include <qapplication.h> |
34 | #include <qfile.h> | 35 | #include <qfile.h> |
35 | #include <qtextstream.h> | 36 | #include <qtextstream.h> |
36 | #include <qwindowsystem_qws.h> | 37 | #include <qwindowsystem_qws.h> |
37 | 38 | ||
38 | /* OPIE */ | 39 | /* OPIE */ |
39 | #include <qpe/config.h> | 40 | #include <qpe/config.h> |
40 | #include <qpe/resource.h> | ||
41 | #include <qpe/sound.h> | 41 | #include <qpe/sound.h> |
42 | #include <qpe/qcopenvelope_qws.h> | 42 | #include <qpe/qcopenvelope_qws.h> |
43 | 43 | ||
44 | #include <opie2/oresource.h> | ||
45 | |||
44 | /* STD */ | 46 | /* STD */ |
45 | #include <fcntl.h> | 47 | #include <fcntl.h> |
46 | #include <math.h> | 48 | #include <math.h> |
47 | #include <stdlib.h> | 49 | #include <stdlib.h> |
48 | #include <signal.h> | 50 | #include <signal.h> |
49 | #include <sys/ioctl.h> | 51 | #include <sys/ioctl.h> |
50 | #include <sys/time.h> | 52 | #include <sys/time.h> |
51 | #include <unistd.h> | 53 | #include <unistd.h> |
52 | #ifndef QT_NO_SOUND | 54 | #ifndef QT_NO_SOUND |
53 | #include <linux/soundcard.h> | 55 | #include <linux/soundcard.h> |
54 | #endif | 56 | #endif |
55 | 57 | ||
56 | /* KERNEL */ | 58 | /* KERNEL */ |
57 | #define OD_IOC(dir,type,number,size) (( dir << 30 ) | ( type << 8 ) | ( number ) | ( size << 16 )) | 59 | #define OD_IOC(dir,type,number,size) (( dir << 30 ) | ( type << 8 ) | ( number ) | ( size << 16 )) |
58 | 60 | ||
59 | #define OD_IO(type,number) OD_IOC(0,type,number,0) | 61 | #define OD_IO(type,number) OD_IOC(0,type,number,0) |
60 | #define OD_IOW(type,number,size) OD_IOC(1,type,number,sizeof(size)) | 62 | #define OD_IOW(type,number,size) OD_IOC(1,type,number,sizeof(size)) |
61 | #define OD_IOR(type,number,size) OD_IOC(2,type,number,sizeof(size)) | 63 | #define OD_IOR(type,number,size) OD_IOC(2,type,number,sizeof(size)) |
62 | #define OD_IORW(type,number,size) OD_IOC(3,type,number,sizeof(size)) | 64 | #define OD_IORW(type,number,size) OD_IOC(3,type,number,sizeof(size)) |
63 | 65 | ||
64 | typedef struct { | 66 | typedef struct { |
65 | unsigned char OffOnBlink; /* 0=off 1=on 2=Blink */ | 67 | unsigned char OffOnBlink; /* 0=off 1=on 2=Blink */ |
66 | unsigned char TotalTime; /* Units of 5 seconds */ | 68 | unsigned char TotalTime; /* Units of 5 seconds */ |
67 | unsigned char OnTime; /* units of 100m/s */ | 69 | unsigned char OnTime; /* units of 100m/s */ |
@@ -125,49 +127,49 @@ void Jornada::init(const QString& cpu_info) | |||
125 | d->m_model = Model_Jornada_56x; | 127 | d->m_model = Model_Jornada_56x; |
126 | } else if ( model == "HP Jornada 720" ) { | 128 | } else if ( model == "HP Jornada 720" ) { |
127 | d->m_modelstr = "Jornada 720"; | 129 | d->m_modelstr = "Jornada 720"; |
128 | d->m_model = Model_Jornada_720; | 130 | d->m_model = Model_Jornada_720; |
129 | } | 131 | } |
130 | 132 | ||
131 | d->m_rotation = Rot0; //all Jornadas need this rotation | 133 | d->m_rotation = Rot0; //all Jornadas need this rotation |
132 | //Distribution detecting code is now in base class | 134 | //Distribution detecting code is now in base class |
133 | } | 135 | } |
134 | 136 | ||
135 | void Jornada::initButtons() | 137 | void Jornada::initButtons() |
136 | { | 138 | { |
137 | if ( d->m_buttons ) | 139 | if ( d->m_buttons ) |
138 | return; | 140 | return; |
139 | 141 | ||
140 | d->m_buttons = new QValueList <ODeviceButton>; | 142 | d->m_buttons = new QValueList <ODeviceButton>; |
141 | 143 | ||
142 | for ( uint i = 0; i < ( sizeof( jornada56x_buttons ) / sizeof( j_button )); i++ ) { | 144 | for ( uint i = 0; i < ( sizeof( jornada56x_buttons ) / sizeof( j_button )); i++ ) { |
143 | j_button *ib = jornada56x_buttons + i; | 145 | j_button *ib = jornada56x_buttons + i; |
144 | ODeviceButton b; | 146 | ODeviceButton b; |
145 | 147 | ||
146 | if (( ib->model & d->m_model ) == d->m_model ) { | 148 | if (( ib->model & d->m_model ) == d->m_model ) { |
147 | b. setKeycode ( ib->code ); | 149 | b. setKeycode ( ib->code ); |
148 | b. setUserText ( QObject::tr ( "Button", ib->utext )); | 150 | b. setUserText ( QObject::tr ( "Button", ib->utext )); |
149 | b. setPixmap ( Resource::loadPixmap ( ib->pix )); | 151 | b. setPixmap ( OResource::loadPixmap ( ib->pix )); |
150 | b. setFactoryPresetPressedAction ( OQCopMessage ( makeChannel ( ib->fpressedservice ), ib->fpressedaction )); | 152 | b. setFactoryPresetPressedAction ( OQCopMessage ( makeChannel ( ib->fpressedservice ), ib->fpressedaction )); |
151 | b. setFactoryPresetHeldAction ( OQCopMessage ( makeChannel ( ib->fheldservice ), ib->fheldaction )); | 153 | b. setFactoryPresetHeldAction ( OQCopMessage ( makeChannel ( ib->fheldservice ), ib->fheldaction )); |
152 | 154 | ||
153 | d->m_buttons->append ( b ); | 155 | d->m_buttons->append ( b ); |
154 | } | 156 | } |
155 | } | 157 | } |
156 | reloadButtonMapping(); | 158 | reloadButtonMapping(); |
157 | } | 159 | } |
158 | 160 | ||
159 | int Jornada::displayBrightnessResolution() const | 161 | int Jornada::displayBrightnessResolution() const |
160 | { | 162 | { |
161 | if ( d->m_model == Model_Jornada_56x ) | 163 | if ( d->m_model == Model_Jornada_56x ) |
162 | return 190; | 164 | return 190; |
163 | else if (d->m_model == Model_Jornada_720 ) | 165 | else if (d->m_model == Model_Jornada_720 ) |
164 | return 255; | 166 | return 255; |
165 | else | 167 | else |
166 | return 0; | 168 | return 0; |
167 | } | 169 | } |
168 | 170 | ||
169 | 171 | ||
170 | bool Jornada::setDisplayBrightness( int bright ) | 172 | bool Jornada::setDisplayBrightness( int bright ) |
171 | { | 173 | { |
172 | bool res = false; | 174 | bool res = false; |
173 | 175 | ||
diff --git a/libopie2/opiecore/device/odevice_ramses.cpp b/libopie2/opiecore/device/odevice_ramses.cpp index a060695..105a3a7 100644 --- a/libopie2/opiecore/device/odevice_ramses.cpp +++ b/libopie2/opiecore/device/odevice_ramses.cpp | |||
@@ -1,64 +1,64 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of the Opie Project | 2 | Â Â Â Â Â Â Â Â This file is part of the Opie Project |
3 | Copyright (C) The Opie Team <opie-devel@handhelds.org> | 3 | |
4 | Copyright (C)2002-2005 The Opie Team <opie-devel@handhelds.org> | ||
4 | =. | 5 | =. |
5 | .=l. | 6 | .=l. |
6 | .>+-= | 7 | Â Â Â Â Â Â .>+-= |
7 | _;:, .> :=|. This program is free software; you can | 8 | Â _;:, Â Â .> Â Â :=|. This program is free software; you can |
8 | .> <`_, > . <= redistribute it and/or modify it under | 9 | .> <`_, Â > Â . Â <= redistribute it and/or modify it under |
9 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | 10 | :`=1 )Y*s>-.-- Â : the terms of the GNU Library General Public |
10 | .="- .-=="i, .._ License as published by the Free Software | 11 | .="- .-=="i, Â Â .._ License as published by the Free Software |
11 | - . .-<_> .<> Foundation; either version 2 of the License, | 12 | Â - . Â .-<_> Â Â .<> Foundation; either version 2 of the License, |
12 | ._= =} : or (at your option) any later version. | 13 | Â Â Â ._= =} Â Â Â : or (at your option) any later version. |
13 | .%`+i> _;_. | 14 | Â Â .%`+i> Â Â Â _;_. |
14 | .i_,=:_. -<s. This program is distributed in the hope that | 15 | Â Â .i_,=:_. Â Â Â -<s. This program is distributed in the hope that |
15 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 16 | Â Â Â + Â . Â -:. Â Â Â = it will be useful, but WITHOUT ANY WARRANTY; |
16 | : .. .:, . . . without even the implied warranty of | 17 | : .. Â Â .:, Â Â . . . without even the implied warranty of |
17 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 18 | Â Â =_ Â Â Â Â + Â Â =;=|` MERCHANTABILITY or FITNESS FOR A |
18 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | 19 | Â _.=:. Â Â Â : Â Â :=>`: PARTICULAR PURPOSE. See the GNU |
19 | ..}^=.= = ; Library General Public License for more | 20 | ..}^=.= Â Â Â = Â Â Â ; Library General Public License for more |
20 | ++= -. .` .: details. | 21 | ++= Â -. Â Â .` Â Â .: details. |
21 | : = ...= . :.=- | 22 | : Â Â = Â ...= . :.=- |
22 | -. .:....=;==+<; You should have received a copy of the GNU | 23 | Â -. Â .:....=;==+<; You should have received a copy of the GNU |
23 | -_. . . )=. = Library General Public License along with | 24 | Â -_. . . Â )=. Â = Library General Public License along with |
24 | -- :-=` this library; see the file COPYING.LIB. | 25 | Â Â -- Â Â Â Â :-=` this library; see the file COPYING.LIB. |
25 | If not, write to the Free Software Foundation, | 26 | If not, write to the Free Software Foundation, |
26 | Inc., 59 Temple Place - Suite 330, | 27 | Inc., 59 Temple Place - Suite 330, |
27 | Boston, MA 02111-1307, USA. | 28 | Boston, MA 02111-1307, USA. |
28 | */ | 29 | */ |
29 | 30 | ||
30 | #include "odevice_ramses.h" | 31 | #include "odevice_ramses.h" |
31 | 32 | ||
32 | /* QT */ | 33 | /* QT */ |
33 | #include <qapplication.h> | 34 | #include <qapplication.h> |
34 | #include <qfile.h> | 35 | #include <qfile.h> |
35 | #include <qtextstream.h> | 36 | #include <qtextstream.h> |
36 | #include <qwindowsystem_qws.h> | 37 | #include <qwindowsystem_qws.h> |
37 | 38 | ||
38 | /* OPIE */ | 39 | /* OPIE */ |
39 | #include <qpe/config.h> | 40 | #include <qpe/config.h> |
40 | #include <qpe/resource.h> | ||
41 | #include <qpe/sound.h> | 41 | #include <qpe/sound.h> |
42 | #include <qpe/qcopenvelope_qws.h> | 42 | #include <qpe/qcopenvelope_qws.h> |
43 | 43 | ||
44 | /* STD */ | 44 | /* STD */ |
45 | #include <fcntl.h> | 45 | #include <fcntl.h> |
46 | #include <math.h> | 46 | #include <math.h> |
47 | #include <stdlib.h> | 47 | #include <stdlib.h> |
48 | #include <signal.h> | 48 | #include <signal.h> |
49 | #include <sys/ioctl.h> | 49 | #include <sys/ioctl.h> |
50 | #include <sys/time.h> | 50 | #include <sys/time.h> |
51 | #include <unistd.h> | 51 | #include <unistd.h> |
52 | #ifndef QT_NO_SOUND | 52 | #ifndef QT_NO_SOUND |
53 | #include <linux/soundcard.h> | 53 | #include <linux/soundcard.h> |
54 | #endif | 54 | #endif |
55 | 55 | ||
56 | using namespace Opie::Core; | 56 | using namespace Opie::Core; |
57 | using namespace Opie::Core::Internal; | 57 | using namespace Opie::Core::Internal; |
58 | 58 | ||
59 | 59 | ||
60 | void Ramses::init(const QString&) | 60 | void Ramses::init(const QString&) |
61 | { | 61 | { |
62 | d->m_vendorstr = "M und N"; | 62 | d->m_vendorstr = "M und N"; |
63 | d->m_vendor = Vendor_MundN; | 63 | d->m_vendor = Vendor_MundN; |
64 | 64 | ||
diff --git a/libopie2/opiecore/device/odevice_simpad.cpp b/libopie2/opiecore/device/odevice_simpad.cpp index 550da5e..f2805de 100644 --- a/libopie2/opiecore/device/odevice_simpad.cpp +++ b/libopie2/opiecore/device/odevice_simpad.cpp | |||
@@ -1,68 +1,70 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of the Opie Project | 2 | Â Â Â Â Â Â Â Â This file is part of the Opie Project |
3 | Copyright (C) The Opie Team <opie-devel@handhelds.org> | 3 | |
4 | Copyright (C)2002-2005 The Opie Team <opie-devel@handhelds.org> | ||
4 | =. | 5 | =. |
5 | .=l. | 6 | .=l. |
6 | .>+-= | 7 | Â Â Â Â Â Â .>+-= |
7 | _;:, .> :=|. This program is free software; you can | 8 | Â _;:, Â Â .> Â Â :=|. This program is free software; you can |
8 | .> <`_, > . <= redistribute it and/or modify it under | 9 | .> <`_, Â > Â . Â <= redistribute it and/or modify it under |
9 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | 10 | :`=1 )Y*s>-.-- Â : the terms of the GNU Library General Public |
10 | .="- .-=="i, .._ License as published by the Free Software | 11 | .="- .-=="i, Â Â .._ License as published by the Free Software |
11 | - . .-<_> .<> Foundation; either version 2 of the License, | 12 | Â - . Â .-<_> Â Â .<> Foundation; either version 2 of the License, |
12 | ._= =} : or (at your option) any later version. | 13 | Â Â Â ._= =} Â Â Â : or (at your option) any later version. |
13 | .%`+i> _;_. | 14 | Â Â .%`+i> Â Â Â _;_. |
14 | .i_,=:_. -<s. This program is distributed in the hope that | 15 | Â Â .i_,=:_. Â Â Â -<s. This program is distributed in the hope that |
15 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 16 | Â Â Â + Â . Â -:. Â Â Â = it will be useful, but WITHOUT ANY WARRANTY; |
16 | : .. .:, . . . without even the implied warranty of | 17 | : .. Â Â .:, Â Â . . . without even the implied warranty of |
17 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 18 | Â Â =_ Â Â Â Â + Â Â =;=|` MERCHANTABILITY or FITNESS FOR A |
18 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | 19 | Â _.=:. Â Â Â : Â Â :=>`: PARTICULAR PURPOSE. See the GNU |
19 | ..}^=.= = ; Library General Public License for more | 20 | ..}^=.= Â Â Â = Â Â Â ; Library General Public License for more |
20 | ++= -. .` .: details. | 21 | ++= Â -. Â Â .` Â Â .: details. |
21 | : = ...= . :.=- | 22 | : Â Â = Â ...= . :.=- |
22 | -. .:....=;==+<; You should have received a copy of the GNU | 23 | Â -. Â .:....=;==+<; You should have received a copy of the GNU |
23 | -_. . . )=. = Library General Public License along with | 24 | Â -_. . . Â )=. Â = Library General Public License along with |
24 | -- :-=` this library; see the file COPYING.LIB. | 25 | Â Â -- Â Â Â Â :-=` this library; see the file COPYING.LIB. |
25 | If not, write to the Free Software Foundation, | 26 | If not, write to the Free Software Foundation, |
26 | Inc., 59 Temple Place - Suite 330, | 27 | Inc., 59 Temple Place - Suite 330, |
27 | Boston, MA 02111-1307, USA. | 28 | Boston, MA 02111-1307, USA. |
28 | */ | 29 | */ |
29 | 30 | ||
30 | #include "odevice_simpad.h" | 31 | #include "odevice_simpad.h" |
31 | 32 | ||
32 | /* QT */ | 33 | /* QT */ |
33 | #include <qapplication.h> | 34 | #include <qapplication.h> |
34 | #include <qfile.h> | 35 | #include <qfile.h> |
35 | #include <qtextstream.h> | 36 | #include <qtextstream.h> |
36 | #include <qwindowsystem_qws.h> | 37 | #include <qwindowsystem_qws.h> |
37 | #include <qwidgetlist.h> | 38 | #include <qwidgetlist.h> |
38 | 39 | ||
39 | /* OPIE */ | 40 | /* OPIE */ |
40 | #include <qpe/config.h> | 41 | #include <qpe/config.h> |
41 | #include <qpe/resource.h> | ||
42 | #include <qpe/sound.h> | 42 | #include <qpe/sound.h> |
43 | #include <qpe/qcopenvelope_qws.h> | 43 | #include <qpe/qcopenvelope_qws.h> |
44 | |||
44 | #include <opie2/okeyfilter.h> | 45 | #include <opie2/okeyfilter.h> |
46 | #include <opie2/oresource.h> | ||
45 | 47 | ||
46 | /* STD */ | 48 | /* STD */ |
47 | #include <fcntl.h> | 49 | #include <fcntl.h> |
48 | #include <math.h> | 50 | #include <math.h> |
49 | #include <stdlib.h> | 51 | #include <stdlib.h> |
50 | #include <signal.h> | 52 | #include <signal.h> |
51 | #include <sys/ioctl.h> | 53 | #include <sys/ioctl.h> |
52 | #include <sys/time.h> | 54 | #include <sys/time.h> |
53 | #include <unistd.h> | 55 | #include <unistd.h> |
54 | #ifndef QT_NO_SOUND | 56 | #ifndef QT_NO_SOUND |
55 | #include <linux/soundcard.h> | 57 | #include <linux/soundcard.h> |
56 | #endif | 58 | #endif |
57 | 59 | ||
58 | namespace Opie { | 60 | namespace Opie { |
59 | namespace Core { | 61 | namespace Core { |
60 | namespace Internal { | 62 | namespace Internal { |
61 | namespace { | 63 | namespace { |
62 | struct s_button { | 64 | struct s_button { |
63 | uint model; | 65 | uint model; |
64 | Qt::Key code; | 66 | Qt::Key code; |
65 | char *utext; | 67 | char *utext; |
66 | char *pix; | 68 | char *pix; |
67 | char *fpressedservice; | 69 | char *fpressedservice; |
68 | char *fpressedaction; | 70 | char *fpressedaction; |
@@ -150,49 +152,49 @@ void SIMpad::init(const QString&) | |||
150 | } | 152 | } |
151 | 153 | ||
152 | //Distribution detecting code is now in base class | 154 | //Distribution detecting code is now in base class |
153 | m_leds [0] = m_leds [1] = Led_Off; | 155 | m_leds [0] = m_leds [1] = Led_Off; |
154 | 156 | ||
155 | m_power_timer = 0; | 157 | m_power_timer = 0; |
156 | 158 | ||
157 | } | 159 | } |
158 | 160 | ||
159 | void SIMpad::initButtons() | 161 | void SIMpad::initButtons() |
160 | { | 162 | { |
161 | if ( d->m_buttons ) | 163 | if ( d->m_buttons ) |
162 | return; | 164 | return; |
163 | 165 | ||
164 | d->m_buttons = new QValueList <ODeviceButton>; | 166 | d->m_buttons = new QValueList <ODeviceButton>; |
165 | 167 | ||
166 | uint size = sizeof(simpad_buttons)/sizeof(s_button); | 168 | uint size = sizeof(simpad_buttons)/sizeof(s_button); |
167 | for ( uint i = 0; i < size; i++ ) { | 169 | for ( uint i = 0; i < size; i++ ) { |
168 | s_button *sb = simpad_buttons + i; | 170 | s_button *sb = simpad_buttons + i; |
169 | ODeviceButton b; | 171 | ODeviceButton b; |
170 | 172 | ||
171 | if (( sb->model & d->m_model ) == d->m_model ) { | 173 | if (( sb->model & d->m_model ) == d->m_model ) { |
172 | b. setKeycode ( sb->code ); | 174 | b. setKeycode ( sb->code ); |
173 | b. setUserText ( QObject::tr ( "Button", sb->utext )); | 175 | b. setUserText ( QObject::tr ( "Button", sb->utext )); |
174 | b. setPixmap ( Resource::loadPixmap ( sb->pix )); | 176 | b. setPixmap ( OResource::loadPixmap ( sb->pix )); |
175 | b. setFactoryPresetPressedAction ( OQCopMessage ( makeChannel ( sb->fpressedservice ), sb->fpressedaction )); | 177 | b. setFactoryPresetPressedAction ( OQCopMessage ( makeChannel ( sb->fpressedservice ), sb->fpressedaction )); |
176 | b. setFactoryPresetHeldAction ( OQCopMessage ( makeChannel ( sb->fheldservice ), sb->fheldaction )); | 178 | b. setFactoryPresetHeldAction ( OQCopMessage ( makeChannel ( sb->fheldservice ), sb->fheldaction )); |
177 | 179 | ||
178 | d->m_buttons->append ( b ); | 180 | d->m_buttons->append ( b ); |
179 | } | 181 | } |
180 | } | 182 | } |
181 | reloadButtonMapping(); | 183 | reloadButtonMapping(); |
182 | } | 184 | } |
183 | 185 | ||
184 | // SIMpad boardcontrol register CS3 | 186 | // SIMpad boardcontrol register CS3 |
185 | #define SIMPAD_BOARDCONTROL "/proc/cs3" | 187 | #define SIMPAD_BOARDCONTROL "/proc/cs3" |
186 | #define SIMPAD_VCC_5V_EN 0x0001 // For 5V PCMCIA | 188 | #define SIMPAD_VCC_5V_EN 0x0001 // For 5V PCMCIA |
187 | #define SIMPAD_VCC_3V_EN 0x0002 // FOR 3.3V PCMCIA | 189 | #define SIMPAD_VCC_3V_EN 0x0002 // FOR 3.3V PCMCIA |
188 | #define SIMPAD_EN1 0x0004 // This is only for EPROM's | 190 | #define SIMPAD_EN1 0x0004 // This is only for EPROM's |
189 | #define SIMPAD_EN0 0x0008 // Both should be enable for 3.3V or 5V | 191 | #define SIMPAD_EN0 0x0008 // Both should be enable for 3.3V or 5V |
190 | #define SIMPAD_DISPLAY_ON 0x0010 | 192 | #define SIMPAD_DISPLAY_ON 0x0010 |
191 | #define SIMPAD_PCMCIA_BUFF_DIS 0x0020 | 193 | #define SIMPAD_PCMCIA_BUFF_DIS 0x0020 |
192 | #define SIMPAD_MQ_RESET 0x0040 | 194 | #define SIMPAD_MQ_RESET 0x0040 |
193 | #define SIMPAD_PCMCIA_RESET 0x0080 | 195 | #define SIMPAD_PCMCIA_RESET 0x0080 |
194 | #define SIMPAD_DECT_POWER_ON 0x0100 | 196 | #define SIMPAD_DECT_POWER_ON 0x0100 |
195 | #define SIMPAD_IRDA_SD 0x0200 // Shutdown for powersave | 197 | #define SIMPAD_IRDA_SD 0x0200 // Shutdown for powersave |
196 | #define SIMPAD_RS232_ON 0x0400 | 198 | #define SIMPAD_RS232_ON 0x0400 |
197 | #define SIMPAD_SD_MEDIAQ 0x0800 // Shutdown for powersave | 199 | #define SIMPAD_SD_MEDIAQ 0x0800 // Shutdown for powersave |
198 | #define SIMPAD_LED2_ON 0x1000 | 200 | #define SIMPAD_LED2_ON 0x1000 |
diff --git a/libopie2/opiecore/device/odevice_yopy.cpp b/libopie2/opiecore/device/odevice_yopy.cpp index 8f22514..f81e452 100644 --- a/libopie2/opiecore/device/odevice_yopy.cpp +++ b/libopie2/opiecore/device/odevice_yopy.cpp | |||
@@ -1,67 +1,69 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of the Opie Project | 2 | Â Â Â Â Â Â Â Â This file is part of the Opie Project |
3 | Copyright (C) The Opie Team <opie-devel@handhelds.org> | 3 | |
4 | Copyright (C)2002-2005 The Opie Team <opie-devel@handhelds.org> | ||
4 | =. | 5 | =. |
5 | .=l. | 6 | .=l. |
6 | .>+-= | 7 | Â Â Â Â Â Â .>+-= |
7 | _;:, .> :=|. This program is free software; you can | 8 | Â _;:, Â Â .> Â Â :=|. This program is free software; you can |
8 | .> <`_, > . <= redistribute it and/or modify it under | 9 | .> <`_, Â > Â . Â <= redistribute it and/or modify it under |
9 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | 10 | :`=1 )Y*s>-.-- Â : the terms of the GNU Library General Public |
10 | .="- .-=="i, .._ License as published by the Free Software | 11 | .="- .-=="i, Â Â .._ License as published by the Free Software |
11 | - . .-<_> .<> Foundation; either version 2 of the License, | 12 | Â - . Â .-<_> Â Â .<> Foundation; either version 2 of the License, |
12 | ._= =} : or (at your option) any later version. | 13 | Â Â Â ._= =} Â Â Â : or (at your option) any later version. |
13 | .%`+i> _;_. | 14 | Â Â .%`+i> Â Â Â _;_. |
14 | .i_,=:_. -<s. This program is distributed in the hope that | 15 | Â Â .i_,=:_. Â Â Â -<s. This program is distributed in the hope that |
15 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 16 | Â Â Â + Â . Â -:. Â Â Â = it will be useful, but WITHOUT ANY WARRANTY; |
16 | : .. .:, . . . without even the implied warranty of | 17 | : .. Â Â .:, Â Â . . . without even the implied warranty of |
17 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 18 | Â Â =_ Â Â Â Â + Â Â =;=|` MERCHANTABILITY or FITNESS FOR A |
18 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | 19 | Â _.=:. Â Â Â : Â Â :=>`: PARTICULAR PURPOSE. See the GNU |
19 | ..}^=.= = ; Library General Public License for more | 20 | ..}^=.= Â Â Â = Â Â Â ; Library General Public License for more |
20 | ++= -. .` .: details. | 21 | ++= Â -. Â Â .` Â Â .: details. |
21 | : = ...= . :.=- | 22 | : Â Â = Â ...= . :.=- |
22 | -. .:....=;==+<; You should have received a copy of the GNU | 23 | Â -. Â .:....=;==+<; You should have received a copy of the GNU |
23 | -_. . . )=. = Library General Public License along with | 24 | Â -_. . . Â )=. Â = Library General Public License along with |
24 | -- :-=` this library; see the file COPYING.LIB. | 25 | Â Â -- Â Â Â Â :-=` this library; see the file COPYING.LIB. |
25 | If not, write to the Free Software Foundation, | 26 | If not, write to the Free Software Foundation, |
26 | Inc., 59 Temple Place - Suite 330, | 27 | Inc., 59 Temple Place - Suite 330, |
27 | Boston, MA 02111-1307, USA. | 28 | Boston, MA 02111-1307, USA. |
28 | */ | 29 | */ |
29 | 30 | ||
30 | #include "odevice_yopy.h" | 31 | #include "odevice_yopy.h" |
31 | 32 | ||
32 | /* QT */ | 33 | /* QT */ |
33 | #include <qapplication.h> | 34 | #include <qapplication.h> |
34 | #include <qfile.h> | 35 | #include <qfile.h> |
35 | #include <qtextstream.h> | 36 | #include <qtextstream.h> |
36 | #include <qwindowsystem_qws.h> | 37 | #include <qwindowsystem_qws.h> |
37 | 38 | ||
38 | /* OPIE */ | 39 | /* OPIE */ |
39 | #include <qpe/config.h> | 40 | #include <qpe/config.h> |
40 | #include <qpe/resource.h> | ||
41 | #include <qpe/sound.h> | 41 | #include <qpe/sound.h> |
42 | #include <qpe/qcopenvelope_qws.h> | 42 | #include <qpe/qcopenvelope_qws.h> |
43 | 43 | ||
44 | #include <opie2/oresource.h> | ||
45 | |||
44 | /* STD */ | 46 | /* STD */ |
45 | #include <fcntl.h> | 47 | #include <fcntl.h> |
46 | #include <math.h> | 48 | #include <math.h> |
47 | #include <stdlib.h> | 49 | #include <stdlib.h> |
48 | #include <signal.h> | 50 | #include <signal.h> |
49 | #include <sys/ioctl.h> | 51 | #include <sys/ioctl.h> |
50 | #include <sys/time.h> | 52 | #include <sys/time.h> |
51 | #include <unistd.h> | 53 | #include <unistd.h> |
52 | #ifndef QT_NO_SOUND | 54 | #ifndef QT_NO_SOUND |
53 | #include <linux/soundcard.h> | 55 | #include <linux/soundcard.h> |
54 | #endif | 56 | #endif |
55 | 57 | ||
56 | using namespace Opie::Core; | 58 | using namespace Opie::Core; |
57 | using namespace Opie::Core::Internal; | 59 | using namespace Opie::Core::Internal; |
58 | 60 | ||
59 | struct yopy_button yopy_buttons [] = { | 61 | struct yopy_button yopy_buttons [] = { |
60 | { Qt::Key_F10, QT_TRANSLATE_NOOP( "Button", "Action Button" ), | 62 | { Qt::Key_F10, QT_TRANSLATE_NOOP( "Button", "Action Button" ), |
61 | "devicebuttons/yopy_action", | 63 | "devicebuttons/yopy_action", |
62 | "datebook", "nextView()", | 64 | "datebook", "nextView()", |
63 | "today", "raise()" }, | 65 | "today", "raise()" }, |
64 | { Qt::Key_F11, QT_TRANSLATE_NOOP( "Button", "OK Button" ), | 66 | { Qt::Key_F11, QT_TRANSLATE_NOOP( "Button", "OK Button" ), |
65 | "devicebuttons/yopy_ok", | 67 | "devicebuttons/yopy_ok", |
66 | "addressbook", "raise()", | 68 | "addressbook", "raise()", |
67 | "addressbook", "beamBusinessCard()" }, | 69 | "addressbook", "beamBusinessCard()" }, |
@@ -79,49 +81,49 @@ void Yopy::init(const QString&) | |||
79 | d->m_model = Model_Yopy_3700; | 81 | d->m_model = Model_Yopy_3700; |
80 | d->m_rotation = Rot0; | 82 | d->m_rotation = Rot0; |
81 | d->m_systemstr = "Linupy"; | 83 | d->m_systemstr = "Linupy"; |
82 | d->m_system = System_Linupy; | 84 | d->m_system = System_Linupy; |
83 | // Distribution detection code now in the base class | 85 | // Distribution detection code now in the base class |
84 | } | 86 | } |
85 | 87 | ||
86 | 88 | ||
87 | void Yopy::initButtons() | 89 | void Yopy::initButtons() |
88 | { | 90 | { |
89 | if ( d->m_buttons ) | 91 | if ( d->m_buttons ) |
90 | return ; | 92 | return ; |
91 | 93 | ||
92 | d->m_buttons = new QValueList <ODeviceButton>; | 94 | d->m_buttons = new QValueList <ODeviceButton>; |
93 | 95 | ||
94 | for ( uint i = 0; i < ( sizeof( yopy_buttons ) / sizeof( yopy_button ) ); i++ ) | 96 | for ( uint i = 0; i < ( sizeof( yopy_buttons ) / sizeof( yopy_button ) ); i++ ) |
95 | { | 97 | { |
96 | 98 | ||
97 | yopy_button *ib = yopy_buttons + i; | 99 | yopy_button *ib = yopy_buttons + i; |
98 | 100 | ||
99 | ODeviceButton b; | 101 | ODeviceButton b; |
100 | 102 | ||
101 | b. setKeycode ( ib->code ); | 103 | b. setKeycode ( ib->code ); |
102 | b. setUserText ( QObject::tr ( "Button", ib->utext ) ); | 104 | b. setUserText ( QObject::tr ( "Button", ib->utext ) ); |
103 | b. setPixmap ( Resource::loadPixmap ( ib->pix ) ); | 105 | b. setPixmap ( OResource::loadPixmap ( ib->pix ) ); |
104 | b. setFactoryPresetPressedAction | 106 | b. setFactoryPresetPressedAction |
105 | ( OQCopMessage( makeChannel( ib->fpressedservice ), ib->fpressedaction ) ); | 107 | ( OQCopMessage( makeChannel( ib->fpressedservice ), ib->fpressedaction ) ); |
106 | b. setFactoryPresetHeldAction | 108 | b. setFactoryPresetHeldAction |
107 | ( OQCopMessage( makeChannel( ib->fheldservice ), ib->fheldaction ) ); | 109 | ( OQCopMessage( makeChannel( ib->fheldservice ), ib->fheldaction ) ); |
108 | 110 | ||
109 | d->m_buttons->append ( b ); | 111 | d->m_buttons->append ( b ); |
110 | } | 112 | } |
111 | reloadButtonMapping(); | 113 | reloadButtonMapping(); |
112 | } | 114 | } |
113 | 115 | ||
114 | 116 | ||
115 | bool Yopy::suspend() | 117 | bool Yopy::suspend() |
116 | { | 118 | { |
117 | /* Opie for Yopy does not implement its own power management at the | 119 | /* Opie for Yopy does not implement its own power management at the |
118 | moment. The public version runs parallel to X, and relies on the | 120 | moment. The public version runs parallel to X, and relies on the |
119 | existing power management features. */ | 121 | existing power management features. */ |
120 | return false; | 122 | return false; |
121 | } | 123 | } |
122 | 124 | ||
123 | 125 | ||
124 | bool Yopy::setDisplayBrightness( int bright ) | 126 | bool Yopy::setDisplayBrightness( int bright ) |
125 | { | 127 | { |
126 | /* The code here works, but is disabled as the current version runs | 128 | /* The code here works, but is disabled as the current version runs |
127 | parallel to X, and relies on the existing backlight demon. */ | 129 | parallel to X, and relies on the existing backlight demon. */ |
diff --git a/libopie2/opiecore/device/odevice_zaurus.cpp b/libopie2/opiecore/device/odevice_zaurus.cpp index e9b163a..1742100 100644 --- a/libopie2/opiecore/device/odevice_zaurus.cpp +++ b/libopie2/opiecore/device/odevice_zaurus.cpp | |||
@@ -1,65 +1,67 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of the Opie Project | 2 | Â Â Â Â Â Â Â Â This file is part of the Opie Project |
3 | Copyright (C) 2002-2005 The Opie Team <opie-devel@handhelds.org> | 3 | |
4 | Copyright (C)2002-2005 The Opie Team <opie-devel@handhelds.org> | ||
4 | =. | 5 | =. |
5 | .=l. | 6 | .=l. |
6 | .>+-= | 7 | Â Â Â Â Â Â .>+-= |
7 | _;:, .> :=|. This program is free software; you can | 8 | Â _;:, Â Â .> Â Â :=|. This program is free software; you can |
8 | .> <`_, > . <= redistribute it and/or modify it under | 9 | .> <`_, Â > Â . Â <= redistribute it and/or modify it under |
9 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | 10 | :`=1 )Y*s>-.-- Â : the terms of the GNU Library General Public |
10 | .="- .-=="i, .._ License as published by the Free Software | 11 | .="- .-=="i, Â Â .._ License as published by the Free Software |
11 | - . .-<_> .<> Foundation; either version 2 of the License, | 12 | Â - . Â .-<_> Â Â .<> Foundation; either version 2 of the License, |
12 | ._= =} : or (at your option) any later version. | 13 | Â Â Â ._= =} Â Â Â : or (at your option) any later version. |
13 | .%`+i> _;_. | 14 | Â Â .%`+i> Â Â Â _;_. |
14 | .i_,=:_. -<s. This program is distributed in the hope that | 15 | Â Â .i_,=:_. Â Â Â -<s. This program is distributed in the hope that |
15 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 16 | Â Â Â + Â . Â -:. Â Â Â = it will be useful, but WITHOUT ANY WARRANTY; |
16 | : .. .:, . . . without even the implied warranty of | 17 | : .. Â Â .:, Â Â . . . without even the implied warranty of |
17 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 18 | Â Â =_ Â Â Â Â + Â Â =;=|` MERCHANTABILITY or FITNESS FOR A |
18 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | 19 | Â _.=:. Â Â Â : Â Â :=>`: PARTICULAR PURPOSE. See the GNU |
19 | ..}^=.= = ; Library General Public License for more | 20 | ..}^=.= Â Â Â = Â Â Â ; Library General Public License for more |
20 | ++= -. .` .: details. | 21 | ++= Â -. Â Â .` Â Â .: details. |
21 | : = ...= . :.=- | 22 | : Â Â = Â ...= . :.=- |
22 | -. .:....=;==+<; You should have received a copy of the GNU | 23 | Â -. Â .:....=;==+<; You should have received a copy of the GNU |
23 | -_. . . )=. = Library General Public License along with | 24 | Â -_. . . Â )=. Â = Library General Public License along with |
24 | -- :-=` this library; see the file COPYING.LIB. | 25 | Â Â -- Â Â Â Â :-=` this library; see the file COPYING.LIB. |
25 | If not, write to the Free Software Foundation, | 26 | If not, write to the Free Software Foundation, |
26 | Inc., 59 Temple Place - Suite 330, | 27 | Inc., 59 Temple Place - Suite 330, |
27 | Boston, MA 02111-1307, USA. | 28 | Boston, MA 02111-1307, USA. |
28 | */ | 29 | */ |
29 | 30 | ||
30 | #include "odevice_zaurus.h" | 31 | #include "odevice_zaurus.h" |
31 | 32 | ||
32 | /* QT */ | 33 | /* QT */ |
33 | #include <qapplication.h> | 34 | #include <qapplication.h> |
34 | #include <qfile.h> | 35 | #include <qfile.h> |
35 | #include <qtextstream.h> | 36 | #include <qtextstream.h> |
36 | #include <qwindowsystem_qws.h> | 37 | #include <qwindowsystem_qws.h> |
37 | 38 | ||
38 | /* OPIE */ | 39 | /* OPIE */ |
39 | #include <opie2/oinputsystem.h> | 40 | #include <opie2/oinputsystem.h> |
41 | #include <opie2/oresource.h> | ||
42 | |||
40 | #include <qpe/config.h> | 43 | #include <qpe/config.h> |
41 | #include <qpe/resource.h> | ||
42 | #include <qpe/sound.h> | 44 | #include <qpe/sound.h> |
43 | #include <qpe/qcopenvelope_qws.h> | 45 | #include <qpe/qcopenvelope_qws.h> |
44 | 46 | ||
45 | /* STD */ | 47 | /* STD */ |
46 | #include <fcntl.h> | 48 | #include <fcntl.h> |
47 | #include <math.h> | 49 | #include <math.h> |
48 | #include <stdlib.h> | 50 | #include <stdlib.h> |
49 | #include <signal.h> | 51 | #include <signal.h> |
50 | #include <sys/ioctl.h> | 52 | #include <sys/ioctl.h> |
51 | #include <sys/time.h> | 53 | #include <sys/time.h> |
52 | #include <unistd.h> | 54 | #include <unistd.h> |
53 | #ifndef QT_NO_SOUND | 55 | #ifndef QT_NO_SOUND |
54 | #include <linux/soundcard.h> | 56 | #include <linux/soundcard.h> |
55 | #endif | 57 | #endif |
56 | 58 | ||
57 | using namespace Opie::Core; | 59 | using namespace Opie::Core; |
58 | using namespace Opie::Core::Internal; | 60 | using namespace Opie::Core::Internal; |
59 | 61 | ||
60 | struct z_button z_buttons [] = { | 62 | struct z_button z_buttons [] = { |
61 | { Qt::Key_F9, QT_TRANSLATE_NOOP("Button", "Calendar Button"), | 63 | { Qt::Key_F9, QT_TRANSLATE_NOOP("Button", "Calendar Button"), |
62 | "devicebuttons/z_calendar", | 64 | "devicebuttons/z_calendar", |
63 | "datebook", "nextView()", | 65 | "datebook", "nextView()", |
64 | "today", "raise()" }, | 66 | "today", "raise()" }, |
65 | { Qt::Key_F10, QT_TRANSLATE_NOOP("Button", "Contacts Button"), | 67 | { Qt::Key_F10, QT_TRANSLATE_NOOP("Button", "Contacts Button"), |
@@ -235,49 +237,49 @@ void Zaurus::initButtons() | |||
235 | struct z_button * pz_buttons; | 237 | struct z_button * pz_buttons; |
236 | int buttoncount; | 238 | int buttoncount; |
237 | switch ( d->m_model ) { | 239 | switch ( d->m_model ) { |
238 | case Model_Zaurus_SLC3000: // fallthrough | 240 | case Model_Zaurus_SLC3000: // fallthrough |
239 | case Model_Zaurus_SLC1000: // fallthrough | 241 | case Model_Zaurus_SLC1000: // fallthrough |
240 | case Model_Zaurus_SLC7x0: | 242 | case Model_Zaurus_SLC7x0: |
241 | if ( isQWS( ) ) { | 243 | if ( isQWS( ) ) { |
242 | addPreHandler(this); // hinge-sensor-handler | 244 | addPreHandler(this); // hinge-sensor-handler |
243 | } | 245 | } |
244 | pz_buttons = z_buttons_c700; | 246 | pz_buttons = z_buttons_c700; |
245 | buttoncount = ARRAY_SIZE(z_buttons_c700); | 247 | buttoncount = ARRAY_SIZE(z_buttons_c700); |
246 | break; | 248 | break; |
247 | default: | 249 | default: |
248 | pz_buttons = z_buttons; | 250 | pz_buttons = z_buttons; |
249 | buttoncount = ARRAY_SIZE(z_buttons); | 251 | buttoncount = ARRAY_SIZE(z_buttons); |
250 | break; | 252 | break; |
251 | } | 253 | } |
252 | 254 | ||
253 | for ( int i = 0; i < buttoncount; i++ ) { | 255 | for ( int i = 0; i < buttoncount; i++ ) { |
254 | struct z_button *zb = pz_buttons + i; | 256 | struct z_button *zb = pz_buttons + i; |
255 | ODeviceButton b; | 257 | ODeviceButton b; |
256 | 258 | ||
257 | b.setKeycode( zb->code ); | 259 | b.setKeycode( zb->code ); |
258 | b.setUserText( QObject::tr( "Button", zb->utext )); | 260 | b.setUserText( QObject::tr( "Button", zb->utext )); |
259 | b.setPixmap( Resource::loadPixmap( zb->pix )); | 261 | b.setPixmap( OResource::loadPixmap( zb->pix )); |
260 | b.setFactoryPresetPressedAction( OQCopMessage( makeChannel ( zb->fpressedservice ), zb->fpressedaction )); | 262 | b.setFactoryPresetPressedAction( OQCopMessage( makeChannel ( zb->fpressedservice ), zb->fpressedaction )); |
261 | b.setFactoryPresetHeldAction( OQCopMessage( makeChannel ( zb->fheldservice ), zb->fheldaction )); | 263 | b.setFactoryPresetHeldAction( OQCopMessage( makeChannel ( zb->fheldservice ), zb->fheldaction )); |
262 | d->m_buttons->append( b ); | 264 | d->m_buttons->append( b ); |
263 | } | 265 | } |
264 | 266 | ||
265 | reloadButtonMapping(); | 267 | reloadButtonMapping(); |
266 | } | 268 | } |
267 | 269 | ||
268 | 270 | ||
269 | 271 | ||
270 | typedef struct sharp_led_status { | 272 | typedef struct sharp_led_status { |
271 | int which; /* select which LED status is wanted. */ | 273 | int which; /* select which LED status is wanted. */ |
272 | int status; /* set new led status if you call SHARP_LED_SETSTATUS */ | 274 | int status; /* set new led status if you call SHARP_LED_SETSTATUS */ |
273 | } sharp_led_status; | 275 | } sharp_led_status; |
274 | 276 | ||
275 | void Zaurus::buzzer( int sound ) | 277 | void Zaurus::buzzer( int sound ) |
276 | { | 278 | { |
277 | #ifndef QT_NO_SOUND | 279 | #ifndef QT_NO_SOUND |
278 | Sound *snd = 0; | 280 | Sound *snd = 0; |
279 | 281 | ||
280 | // All devices except SL5500 have a DSP device | 282 | // All devices except SL5500 have a DSP device |
281 | if ( d->m_model != Model_Zaurus_SL5000 | 283 | if ( d->m_model != Model_Zaurus_SL5000 |
282 | && d->m_model != Model_Zaurus_SL5500 ) { | 284 | && d->m_model != Model_Zaurus_SL5500 ) { |
283 | 285 | ||