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.cpp82
1 files changed, 9 insertions, 73 deletions
diff --git a/libopie2/opiecore/device/odevice_jornada.cpp b/libopie2/opiecore/device/odevice_jornada.cpp
index bcd03ed..37bd6e9 100644
--- a/libopie2/opiecore/device/odevice_jornada.cpp
+++ b/libopie2/opiecore/device/odevice_jornada.cpp
@@ -28,5 +28,5 @@
28*/ 28*/
29 29
30#include "odevice.h" 30#include "odevice_jornada.h"
31 31
32/* QT */ 32/* QT */
@@ -54,10 +54,5 @@
54#endif 54#endif
55 55
56#ifndef ARRAY_SIZE 56/* KERNEL */
57#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
58#endif
59
60// _IO and friends are only defined in kernel headers ...
61
62#define OD_IOC(dir,type,number,size) (( dir << 30 ) | ( type << 8 ) | ( number ) | ( size << 16 )) 57#define OD_IOC(dir,type,number,size) (( dir << 30 ) | ( type << 8 ) | ( number ) | ( size << 16 ))
63 58
@@ -85,37 +80,4 @@ typedef struct {
85using namespace Opie; 80using namespace Opie;
86 81
87class Jornada : public ODevice
88{
89
90 protected:
91 virtual void init();
92
93 public:
94 virtual bool setSoftSuspend ( bool soft );
95 virtual bool setDisplayBrightness ( int b );
96 virtual int displayBrightnessResolution() const;
97 static bool isJornada();
98};
99
100
101bool Jornada::isJornada()
102{
103 QFile f( "/proc/cpuinfo" );
104 if ( f. open ( IO_ReadOnly ) ) {
105 QTextStream ts ( &f );
106 QString line;
107 while( line = ts. readLine() ) {
108 if ( line. left ( 8 ) == "Hardware" ) {
109 int loc = line. find ( ":" );
110 if ( loc != -1 ) {
111 QString model = line.mid( loc + 2 ).simplifyWhiteSpace( );
112 return ( model == "HP Jornada 56x" );
113 }
114 }
115 }
116 }
117 return false;
118}
119
120void Jornada::init() 82void Jornada::init()
121{ 83{
@@ -129,9 +91,9 @@ void Jornada::init()
129 91
130 QFile f ( "/etc/familiar-version" ); 92 QFile f ( "/etc/familiar-version" );
131 f. setName ( "/etc/familiar-version" ); 93 f.setName ( "/etc/familiar-version" );
132 if ( f. open ( IO_ReadOnly )) { 94 if ( f.open ( IO_ReadOnly )) {
133 95
134 QTextStream ts ( &f ); 96 QTextStream ts ( &f );
135 d->m_sysverstr = ts. readLine(). mid ( 10 ); 97 d->m_sysverstr = ts.readLine().mid( 10 );
136 98
137 f. close(); 99 f. close();
@@ -139,39 +101,11 @@ void Jornada::init()
139} 101}
140 102
141#if 0
142void Jornada::initButtons()
143{
144 if ( d->m_buttons )
145 return;
146
147 // Simulation uses iPAQ 3660 device buttons
148
149 qDebug ( "init Buttons" );
150 d->m_buttons = new QValueList <ODeviceButton>;
151
152 for ( uint i = 0; i < ( sizeof( ipaq_buttons ) / sizeof( i_button )); i++ ) {
153 i_button *ib = ipaq_buttons + i;
154 ODeviceButton b;
155
156 if (( ib->model & Model_iPAQ_H36xx ) == Model_iPAQ_H36xx ) {
157 b. setKeycode ( ib->code );
158 b. setUserText ( QObject::tr ( "Button", ib->utext ));
159 b. setPixmap ( Resource::loadPixmap ( ib->pix ));
160 b. setFactoryPresetPressedAction ( OQCopMessage ( makeChannel ( ib->fpressedservice ), ib->fpressedaction ));
161 b. setFactoryPresetHeldAction ( OQCopMessage ( makeChannel ( ib->fheldservice ), ib->fheldaction ));
162 d->m_buttons->append ( b );
163 }
164 }
165 reloadButtonMapping();
166
167 QCopChannel *sysch = new QCopChannel ( "QPE/System", this );
168 connect ( sysch, SIGNAL( received( const QCString &, const QByteArray & )), this, SLOT( systemMessage ( const QCString &, const QByteArray & )));
169}
170#endif
171 103
172int Jornada::displayBrightnessResolution() const 104int Jornada::displayBrightnessResolution() const
173{ 105{
106 return 0;
174} 107}
175 108
109
176bool Jornada::setDisplayBrightness( int bright ) 110bool Jornada::setDisplayBrightness( int bright )
177{ 111{
@@ -195,4 +129,5 @@ bool Jornada::setDisplayBrightness( int bright )
195} 129}
196 130
131
197bool Jornada::setSoftSuspend( bool soft ) 132bool Jornada::setSoftSuspend( bool soft )
198{ 133{
@@ -213,2 +148,3 @@ bool Jornada::setSoftSuspend( bool soft )
213 return res; 148 return res;
214} 149}
150