summaryrefslogtreecommitdiff
path: root/libopie2/opiecore/device/odevice_jornada.cpp
Unidiff
Diffstat (limited to 'libopie2/opiecore/device/odevice_jornada.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiecore/device/odevice_jornada.cpp58
1 files changed, 30 insertions, 28 deletions
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,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) 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"
@@ -34,16 +35,17 @@
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>
@@ -109,28 +111,28 @@ struct j_button jornada56x_buttons [] = {
109}; 111};
110 112
111void Jornada::init(const QString& cpu_info) 113void Jornada::init(const QString& cpu_info)
112{ 114{
113 d->m_vendorstr = "HP"; 115 d->m_vendorstr = "HP";
114 d->m_vendor = Vendor_HP; 116 d->m_vendor = Vendor_HP;
115 117
116 QString model; 118 QString model;
117 int loc = cpu_info.find( ":" ); 119 int loc = cpu_info.find( ":" );
118 if ( loc != -1 ) 120 if ( loc != -1 )
119 model = cpu_info.mid( loc+2 ).simplifyWhiteSpace(); 121 model = cpu_info.mid( loc+2 ).simplifyWhiteSpace();
120 else 122 else
121 model = cpu_info; 123 model = cpu_info;
122 124
123 if ( model == "HP Jornada 56x" ) { 125 if ( model == "HP Jornada 56x" ) {
124 d->m_modelstr = "Jornada 56x"; 126 d->m_modelstr = "Jornada 56x";
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
135void Jornada::initButtons() 137void Jornada::initButtons()
136{ 138{
@@ -143,13 +145,13 @@ void Jornada::initButtons()
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 }
@@ -194,15 +196,15 @@ bool Jornada::setDisplayBrightness( int bright )
194} 196}
195 197
196 198
197bool Jornada::setDisplayStatus ( bool on ) 199bool Jornada::setDisplayStatus ( bool on )
198{ 200{
199 bool res = false; 201 bool res = false;
200 202
201 QString cmdline; 203 QString cmdline;
202 204
203 if ( d->m_model == Model_Jornada_56x ) { 205 if ( d->m_model == Model_Jornada_56x ) {
204 cmdline = QString::fromLatin1( "echo %1 > /sys/class/lcd/sa1100fb/power; echo %2 > /sys/class/backlight/sa1100fb/power").arg( on ? "0" : "4" ).arg( on ? "0" : "4" ); 206 cmdline = QString::fromLatin1( "echo %1 > /sys/class/lcd/sa1100fb/power; echo %2 > /sys/class/backlight/sa1100fb/power").arg( on ? "0" : "4" ).arg( on ? "0" : "4" );
205 } else if ( d->m_model == Model_Jornada_720 ) { 207 } else if ( d->m_model == Model_Jornada_720 ) {
206 cmdline = QString::fromLatin1( "echo %1 > /sys/class/lcd/e1356fb/power").arg( on ? "0" : "4" ); 208 cmdline = QString::fromLatin1( "echo %1 > /sys/class/lcd/e1356fb/power").arg( on ? "0" : "4" );
207 } 209 }
208 210