Diffstat (limited to 'libopie2/opiecore/device/odevice_zaurus.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | libopie2/opiecore/device/odevice_zaurus.cpp | 48 |
1 files changed, 25 insertions, 23 deletions
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 | ||