summaryrefslogtreecommitdiff
path: root/libopie2/opiecore/device/odevice_zaurus.cpp
Unidiff
Diffstat (limited to 'libopie2/opiecore/device/odevice_zaurus.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiecore/device/odevice_zaurus.cpp54
1 files changed, 28 insertions, 26 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,30 +1,31 @@
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"
@@ -34,14 +35,15 @@
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>
@@ -233,13 +235,13 @@ void Zaurus::initButtons()
233 d->m_buttons = new QValueList <ODeviceButton>; 235 d->m_buttons = new QValueList <ODeviceButton>;
234 236
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);
@@ -253,13 +255,13 @@ void Zaurus::initButtons()
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();
@@ -486,13 +488,13 @@ Transformation Zaurus::rotation() const
486{ 488{
487 qDebug( "Zaurus::rotation()" ); 489 qDebug( "Zaurus::rotation()" );
488 Transformation rot; 490 Transformation rot;
489 491
490 switch ( d->m_model ) { 492 switch ( d->m_model ) {
491 case Model_Zaurus_SLC3000: // fallthrough 493 case Model_Zaurus_SLC3000: // fallthrough
492 case Model_Zaurus_SLC1000: // fallthrough 494 case Model_Zaurus_SLC1000: // fallthrough
493 case Model_Zaurus_SLC7x0: 495 case Model_Zaurus_SLC7x0:
494 { 496 {
495 OHingeStatus hs = readHingeSensor(); 497 OHingeStatus hs = readHingeSensor();
496 qDebug( "Zaurus::rotation() - hinge sensor = %d", (int) hs ); 498 qDebug( "Zaurus::rotation() - hinge sensor = %d", (int) hs );
497 499
498 if ( m_embedix ) 500 if ( m_embedix )
@@ -524,13 +526,13 @@ Transformation Zaurus::rotation() const
524ODirection Zaurus::direction() const 526ODirection Zaurus::direction() const
525{ 527{
526 ODirection dir; 528 ODirection dir;
527 529
528 switch ( d->m_model ) { 530 switch ( d->m_model ) {
529 case Model_Zaurus_SLC3000: // fallthrough 531 case Model_Zaurus_SLC3000: // fallthrough
530 case Model_Zaurus_SLC1000: // fallthrough 532 case Model_Zaurus_SLC1000: // fallthrough
531 case Model_Zaurus_SLC7x0: { 533 case Model_Zaurus_SLC7x0: {
532 OHingeStatus hs = readHingeSensor(); 534 OHingeStatus hs = readHingeSensor();
533 if ( hs == CASE_PORTRAIT ) dir = CCW; 535 if ( hs == CASE_PORTRAIT ) dir = CCW;
534 else if ( hs == CASE_UNKNOWN ) dir = CCW; 536 else if ( hs == CASE_UNKNOWN ) dir = CCW;
535 else dir = CW; 537 else dir = CW;
536 } 538 }