summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--core/launcher/main.cpp7
-rw-r--r--core/opie-login/main.cpp5
-rw-r--r--libopie2/opiecore/device/odevice.cpp5
-rw-r--r--libopie2/opiecore/device/odevice.h2
-rw-r--r--libopie2/opiecore/device/odevice_genuineintel.cpp6
-rw-r--r--libopie2/opiecore/device/odevice_genuineintel.h2
-rw-r--r--libopie2/opiecore/device/odevice_ipaq.cpp21
-rw-r--r--libopie2/opiecore/device/odevice_ipaq.h2
-rw-r--r--libopie2/opiecore/device/odevice_zaurus.cpp42
-rw-r--r--libopie2/opiecore/device/odevice_zaurus.h2
10 files changed, 1 insertions, 93 deletions
diff --git a/core/launcher/main.cpp b/core/launcher/main.cpp
index 734d072..5bbed59 100644
--- a/core/launcher/main.cpp
+++ b/core/launcher/main.cpp
@@ -149,27 +149,24 @@ int initApplication( int argc, char ** argv )
149#ifdef QWS 149#ifdef QWS
150 QWSServer::setDesktopBackground( QImage() ); 150 QWSServer::setDesktopBackground( QImage() );
151#endif 151#endif
152 ServerApplication a( argc, argv, QApplication::GuiServer ); 152 ServerApplication a( argc, argv, QApplication::GuiServer );
153 initKeyboard(); 153 initKeyboard();
154 154
155 if ( firstUse() ) 155 if ( firstUse() )
156 { 156 {
157 a.restart(); 157 a.restart();
158 return 0; 158 return 0;
159 } 159 }
160 160
161#ifndef Q_OS_MACX
162 ODevice::inst()->setSoftSuspend( true );
163#endif
164 { 161 {
165 QCopEnvelope e("QPE/System", "setBacklight(int)" ); 162 QCopEnvelope e("QPE/System", "setBacklight(int)" );
166 e << -3; // Forced on 163 e << -3; // Forced on
167 } 164 }
168 165
169 AlarmServer::initialize(); 166 AlarmServer::initialize();
170 Server *s = new Server(); 167 Server *s = new Server();
171 new SysFileMonitor(s); 168 new SysFileMonitor(s);
172#ifdef QWS 169#ifdef QWS
173 Network::createServer(s); 170 Network::createServer(s);
174#endif 171#endif
175 s->show(); 172 s->show();
@@ -186,28 +183,24 @@ int initApplication( int argc, char ** argv )
186 } 183 }
187 } 184 }
188#endif 185#endif
189 186
190 create_pidfile(); 187 create_pidfile();
191 odebug << "--> mainloop in" << oendl; 188 odebug << "--> mainloop in" << oendl;
192 int rv = a.exec(); 189 int rv = a.exec();
193 odebug << "<-- mainloop out" << oendl; 190 odebug << "<-- mainloop out" << oendl;
194 remove_pidfile(); 191 remove_pidfile();
195 odebug << "removing server object..." << oendl; 192 odebug << "removing server object..." << oendl;
196 delete s; 193 delete s;
197 194
198#ifndef Q_OS_MACX
199 ODevice::inst()->setSoftSuspend( false );
200#endif
201
202 odebug << "returning from qpe/initapplication..." << oendl; 195 odebug << "returning from qpe/initapplication..." << oendl;
203 return rv; 196 return rv;
204} 197}
205 198
206static const char *pidfile_path = "/var/run/opie.pid"; 199static const char *pidfile_path = "/var/run/opie.pid";
207 200
208void create_pidfile() 201void create_pidfile()
209{ 202{
210 FILE *f; 203 FILE *f;
211 204
212 if (( f = ::fopen( pidfile_path, "w" ))) { 205 if (( f = ::fopen( pidfile_path, "w" ))) {
213 ::fprintf( f, "%d", getpid ( )); 206 ::fprintf( f, "%d", getpid ( ));
diff --git a/core/opie-login/main.cpp b/core/opie-login/main.cpp
index 0699d0a..2de0180 100644
--- a/core/opie-login/main.cpp
+++ b/core/opie-login/main.cpp
@@ -184,25 +184,24 @@ int main ( int argc, char **argv )
184 Config cfg ( confFile, Config::File ); 184 Config cfg ( confFile, Config::File );
185 cfg. setGroup ( "General" ); 185 cfg. setGroup ( "General" );
186 QString user = cfg. readEntry ( "AutoLogin" ); 186 QString user = cfg. readEntry ( "AutoLogin" );
187 187
188 if ( !user. isEmpty ( )) 188 if ( !user. isEmpty ( ))
189 autolog = ::strdup ( user. latin1 ( )); 189 autolog = ::strdup ( user. latin1 ( ));
190 } 190 }
191 191
192 if ( autolog && !userExited ) { 192 if ( autolog && !userExited ) {
193 193
194 QWSServer::setDesktopBackground( QImage() ); 194 QWSServer::setDesktopBackground( QImage() );
195 ODevice::inst ( )-> setDisplayStatus ( true ); 195 ODevice::inst ( )-> setDisplayStatus ( true );
196 ODevice::inst ( )-> setSoftSuspend ( false );
197 LoginApplication *app = new LoginApplication ( argc, argv, ppid ); 196 LoginApplication *app = new LoginApplication ( argc, argv, ppid );
198 LoginApplication::setLoginAs ( autolog ); 197 LoginApplication::setLoginAs ( autolog );
199 198
200 199
201 if ( LoginApplication::changeIdentity ( )) 200 if ( LoginApplication::changeIdentity ( ))
202 ::exit ( LoginApplication::login ( )); 201 ::exit ( LoginApplication::login ( ));
203 else 202 else
204 ::exit ( 0 ); 203 ::exit ( 0 );
205 } 204 }
206 else { 205 else {
207 ::exit ( login_main ( argc, argv, ppid )); 206 ::exit ( login_main ( argc, argv, ppid ));
208 } 207 }
@@ -326,52 +325,48 @@ namespace Opie { extern int force_appearance; } // HACK to get around the force
326 325
327 326
328int login_main ( int argc, char **argv, pid_t ppid ) 327int login_main ( int argc, char **argv, pid_t ppid )
329{ 328{
330 QWSServer::setDesktopBackground( QImage() ); 329 QWSServer::setDesktopBackground( QImage() );
331 LoginApplication *app = new LoginApplication ( argc, argv, ppid ); 330 LoginApplication *app = new LoginApplication ( argc, argv, ppid );
332 331
333 Opie::force_appearance = 0; 332 Opie::force_appearance = 0;
334 333
335 app-> setFont ( QFont ( "Helvetica", 10 )); 334 app-> setFont ( QFont ( "Helvetica", 10 ));
336 app-> setStyle ( new QPEStyle ( )); 335 app-> setStyle ( new QPEStyle ( ));
337 336
338 ODevice::inst ( )-> setSoftSuspend ( true );
339
340 if ( QWSServer::mouseHandler() && 337 if ( QWSServer::mouseHandler() &&
341 QWSServer::mouseHandler() ->inherits("QCalibratedMouseHandler") ) { 338 QWSServer::mouseHandler() ->inherits("QCalibratedMouseHandler") ) {
342 if ( !QFile::exists ( "/etc/pointercal" )) { 339 if ( !QFile::exists ( "/etc/pointercal" )) {
343 // Make sure calibration widget starts on top. 340 // Make sure calibration widget starts on top.
344 Calibrate *cal = new Calibrate; 341 Calibrate *cal = new Calibrate;
345 cal-> exec ( ); 342 cal-> exec ( );
346 delete cal; 343 delete cal;
347 } 344 }
348 } 345 }
349 346
350 LoginScreenSaver *saver = new LoginScreenSaver; 347 LoginScreenSaver *saver = new LoginScreenSaver;
351 348
352 saver-> setIntervals ( ); 349 saver-> setIntervals ( );
353 QWSServer::setScreenSaver ( saver ); 350 QWSServer::setScreenSaver ( saver );
354 saver-> restore ( ); 351 saver-> restore ( );
355 352
356 353
357 LoginWindowImpl *lw = new LoginWindowImpl ( ); 354 LoginWindowImpl *lw = new LoginWindowImpl ( );
358 app-> setMainWidget ( lw ); 355 app-> setMainWidget ( lw );
359 lw-> setGeometry ( 0, 0, app-> desktop ( )-> width ( ), app-> desktop ( )-> height ( )); 356 lw-> setGeometry ( 0, 0, app-> desktop ( )-> width ( ), app-> desktop ( )-> height ( ));
360 lw-> show ( ); 357 lw-> show ( );
361 358
362 int rc = app-> exec ( ); 359 int rc = app-> exec ( );
363 360
364 ODevice::inst ( )-> setSoftSuspend ( false );
365
366 if ( app-> loginAs ( )) { 361 if ( app-> loginAs ( )) {
367 if ( app-> changeIdentity ( )) { 362 if ( app-> changeIdentity ( )) {
368 app-> login ( ); 363 app-> login ( );
369 364
370 // if login succeeds, it never comes back 365 // if login succeeds, it never comes back
371 366
372 QMessageBox::critical ( 0, LoginWindowImpl::tr( "Failure" ), LoginWindowImpl::tr( "Could not start Opie." )); 367 QMessageBox::critical ( 0, LoginWindowImpl::tr( "Failure" ), LoginWindowImpl::tr( "Could not start Opie." ));
373 rc = 1; 368 rc = 1;
374 } 369 }
375 else { 370 else {
376 QMessageBox::critical ( 0, LoginWindowImpl::tr( "Failure" ), LoginWindowImpl::tr( "Could not switch to new user identity" )); 371 QMessageBox::critical ( 0, LoginWindowImpl::tr( "Failure" ), LoginWindowImpl::tr( "Could not switch to new user identity" ));
377 rc = 2; 372 rc = 2;
diff --git a/libopie2/opiecore/device/odevice.cpp b/libopie2/opiecore/device/odevice.cpp
index a824392..3d69614 100644
--- a/libopie2/opiecore/device/odevice.cpp
+++ b/libopie2/opiecore/device/odevice.cpp
@@ -245,29 +245,24 @@ void ODevice::initButtons()
245 245
246 reloadButtonMapping(); 246 reloadButtonMapping();
247} 247}
248 248
249ODevice::~ODevice() 249ODevice::~ODevice()
250{ 250{
251// we leak m_devicebuttons and m_cpu_frequency 251// we leak m_devicebuttons and m_cpu_frequency
252// but it's a singleton and it is not so importantant 252// but it's a singleton and it is not so importantant
253// -zecke 253// -zecke
254 delete d; 254 delete d;
255} 255}
256 256
257bool ODevice::setSoftSuspend ( bool /*soft*/ )
258{
259 return false;
260}
261
262//#include <linux/apm_bios.h> 257//#include <linux/apm_bios.h>
263 258
264#define APM_IOC_SUSPEND OD_IO( 'A', 2 ) 259#define APM_IOC_SUSPEND OD_IO( 'A', 2 )
265 260
266/** 261/**
267* This method will try to suspend the device 262* This method will try to suspend the device
268* It only works if the user is the QWS Server and the apm application 263* It only works if the user is the QWS Server and the apm application
269* is installed. 264* is installed.
270* It tries to suspend and then waits some time cause some distributions 265* It tries to suspend and then waits some time cause some distributions
271* do have asynchronus apm implementations. 266* do have asynchronus apm implementations.
272* This method will either fail and return false or it'll suspend the 267* This method will either fail and return false or it'll suspend the
273* device and return once the device got woken up 268* device and return once the device got woken up
diff --git a/libopie2/opiecore/device/odevice.h b/libopie2/opiecore/device/odevice.h
index bbc32fa..96a41fc 100644
--- a/libopie2/opiecore/device/odevice.h
+++ b/libopie2/opiecore/device/odevice.h
@@ -246,26 +246,24 @@ public:
246 QString vendorString() const; 246 QString vendorString() const;
247 OVendor vendor() const; 247 OVendor vendor() const;
248 248
249 QString systemString() const; 249 QString systemString() const;
250 OSystem system() const; 250 OSystem system() const;
251 251
252 QString systemVersionString() const; 252 QString systemVersionString() const;
253 253
254 virtual Transformation rotation() const; 254 virtual Transformation rotation() const;
255 virtual ODirection direction() const; 255 virtual ODirection direction() const;
256 256
257 // system 257 // system
258
259 virtual bool setSoftSuspend ( bool on );
260 virtual bool suspend(); 258 virtual bool suspend();
261 259
262 virtual bool setDisplayStatus ( bool on ); 260 virtual bool setDisplayStatus ( bool on );
263 virtual bool setDisplayBrightness ( int brightness ); 261 virtual bool setDisplayBrightness ( int brightness );
264 virtual int displayBrightnessResolution() const; 262 virtual int displayBrightnessResolution() const;
265 virtual bool setDisplayContrast ( int contrast ); 263 virtual bool setDisplayContrast ( int contrast );
266 virtual int displayContrastResolution() const; 264 virtual int displayContrastResolution() const;
267 265
268 // don't add new virtual methods, use this: 266 // don't add new virtual methods, use this:
269 // /*virtual */ void boo(int i ) { return virtual_hook(1,&i); }; 267 // /*virtual */ void boo(int i ) { return virtual_hook(1,&i); };
270 // and in your subclass do overwrite 268 // and in your subclass do overwrite
271 // protected virtual int virtual_hook(int, void *) 269 // protected virtual int virtual_hook(int, void *)
diff --git a/libopie2/opiecore/device/odevice_genuineintel.cpp b/libopie2/opiecore/device/odevice_genuineintel.cpp
index 61ba052..1584249 100644
--- a/libopie2/opiecore/device/odevice_genuineintel.cpp
+++ b/libopie2/opiecore/device/odevice_genuineintel.cpp
@@ -151,30 +151,24 @@ void GenuineIntel::playAlarmSound()
151{ 151{
152#ifndef QT_NO_SOUND 152#ifndef QT_NO_SOUND
153 static Sound snd ( "alarm" ); 153 static Sound snd ( "alarm" );
154 if(!snd.isFinished()) 154 if(!snd.isFinished())
155 return; 155 return;
156 156
157 changeMixerForAlarm(0, "/dev/sound/mixer", &snd ); 157 changeMixerForAlarm(0, "/dev/sound/mixer", &snd );
158 snd. play(); 158 snd. play();
159#endif 159#endif
160} 160}
161 161
162 162
163bool GenuineIntel::setSoftSuspend ( bool )
164{
165 return false;
166}
167
168
169bool GenuineIntel::setDisplayBrightness ( int ) 163bool GenuineIntel::setDisplayBrightness ( int )
170{ 164{
171 return false; 165 return false;
172} 166}
173 167
174int GenuineIntel::displayBrightnessResolution() const 168int GenuineIntel::displayBrightnessResolution() const
175{ 169{
176 return 1; // perhaps to avoid division by zero 170 return 1; // perhaps to avoid division by zero
177} 171}
178 172
179 173
180bool GenuineIntel::hasLightSensor() const 174bool GenuineIntel::hasLightSensor() const
diff --git a/libopie2/opiecore/device/odevice_genuineintel.h b/libopie2/opiecore/device/odevice_genuineintel.h
index 52c5fc6..69316af 100644
--- a/libopie2/opiecore/device/odevice_genuineintel.h
+++ b/libopie2/opiecore/device/odevice_genuineintel.h
@@ -38,26 +38,24 @@
38namespace Opie { 38namespace Opie {
39namespace Core { 39namespace Core {
40namespace Internal { 40namespace Internal {
41 41
42class GenuineIntel : public ODevice, public QWSServer::KeyboardFilter 42class GenuineIntel : public ODevice, public QWSServer::KeyboardFilter
43{ 43{
44 44
45 protected: 45 protected:
46 virtual void init(const QString&); 46 virtual void init(const QString&);
47 virtual void initButtons(); 47 virtual void initButtons();
48 48
49 public: 49 public:
50 virtual bool setSoftSuspend( bool soft );
51
52 virtual bool setDisplayBrightness( int b ); 50 virtual bool setDisplayBrightness( int b );
53 virtual int displayBrightnessResolution() const; 51 virtual int displayBrightnessResolution() const;
54 52
55 virtual void playAlarmSound(); 53 virtual void playAlarmSound();
56 54
57 virtual QValueList <OLed> ledList() const; 55 virtual QValueList <OLed> ledList() const;
58 virtual QValueList <OLedState> ledStateList( OLed led ) const; 56 virtual QValueList <OLedState> ledStateList( OLed led ) const;
59 virtual OLedState ledState( OLed led ) const; 57 virtual OLedState ledState( OLed led ) const;
60 virtual bool setLedState( OLed led, OLedState st ); 58 virtual bool setLedState( OLed led, OLedState st );
61 59
62 virtual bool hasLightSensor() const; 60 virtual bool hasLightSensor() const;
63 virtual int readLightSensor(); 61 virtual int readLightSensor();
diff --git a/libopie2/opiecore/device/odevice_ipaq.cpp b/libopie2/opiecore/device/odevice_ipaq.cpp
index 9e01a0c..2ce38a9 100644
--- a/libopie2/opiecore/device/odevice_ipaq.cpp
+++ b/libopie2/opiecore/device/odevice_ipaq.cpp
@@ -327,45 +327,24 @@ void iPAQ::timerEvent ( QTimerEvent * )
327void iPAQ::playAlarmSound() 327void iPAQ::playAlarmSound()
328{ 328{
329#ifndef QT_NO_SOUND 329#ifndef QT_NO_SOUND
330 static Sound snd ( "alarm" ); 330 static Sound snd ( "alarm" );
331 if(!snd.isFinished()) 331 if(!snd.isFinished())
332 return; 332 return;
333 333
334 changeMixerForAlarm(0, "/dev/sound/mixer", &snd ); 334 changeMixerForAlarm(0, "/dev/sound/mixer", &snd );
335 snd. play(); 335 snd. play();
336#endif 336#endif
337} 337}
338 338
339
340bool iPAQ::setSoftSuspend ( bool soft )
341{
342 bool res = false;
343 int fd;
344
345 if (( fd = ::open ( "/proc/sys/ts/suspend_button_mode", O_WRONLY )) >= 0 ) {
346 if ( ::write ( fd, soft ? "1" : "0", 1 ) == 1 )
347 res = true;
348 else
349 ::perror ( "write to /proc/sys/ts/suspend_button_mode" );
350
351 ::close ( fd );
352 }
353 else
354 ::perror ( "/proc/sys/ts/suspend_button_mode" );
355
356 return res;
357}
358
359
360bool iPAQ::setDisplayBrightness ( int bright ) 339bool iPAQ::setDisplayBrightness ( int bright )
361{ 340{
362 bool res = false; 341 bool res = false;
363 int fd; 342 int fd;
364 343
365 if ( bright > 255 ) 344 if ( bright > 255 )
366 bright = 255; 345 bright = 255;
367 if ( bright < 0 ) 346 if ( bright < 0 )
368 bright = 0; 347 bright = 0;
369 348
370 if (( fd = ::open ( "/dev/touchscreen/0", O_WRONLY )) >= 0 ) { 349 if (( fd = ::open ( "/dev/touchscreen/0", O_WRONLY )) >= 0 ) {
371 FLITE_IN bl; 350 FLITE_IN bl;
diff --git a/libopie2/opiecore/device/odevice_ipaq.h b/libopie2/opiecore/device/odevice_ipaq.h
index cc0b8ac..b1dac74 100644
--- a/libopie2/opiecore/device/odevice_ipaq.h
+++ b/libopie2/opiecore/device/odevice_ipaq.h
@@ -38,26 +38,24 @@
38namespace Opie { 38namespace Opie {
39namespace Core { 39namespace Core {
40namespace Internal { 40namespace Internal {
41 41
42class iPAQ : public ODevice, public QWSServer::KeyboardFilter 42class iPAQ : public ODevice, public QWSServer::KeyboardFilter
43{ 43{
44 44
45 protected: 45 protected:
46 virtual void init(const QString&); 46 virtual void init(const QString&);
47 virtual void initButtons(); 47 virtual void initButtons();
48 48
49 public: 49 public:
50 virtual bool setSoftSuspend( bool soft );
51
52 virtual bool setDisplayBrightness( int b ); 50 virtual bool setDisplayBrightness( int b );
53 virtual int displayBrightnessResolution() const; 51 virtual int displayBrightnessResolution() const;
54 52
55 virtual void playAlarmSound(); 53 virtual void playAlarmSound();
56 54
57 virtual QValueList <OLed> ledList() const; 55 virtual QValueList <OLed> ledList() const;
58 virtual QValueList <OLedState> ledStateList( OLed led ) const; 56 virtual QValueList <OLedState> ledStateList( OLed led ) const;
59 virtual OLedState ledState( OLed led ) const; 57 virtual OLedState ledState( OLed led ) const;
60 virtual bool setLedState( OLed led, OLedState st ); 58 virtual bool setLedState( OLed led, OLedState st );
61 59
62 virtual bool hasLightSensor() const; 60 virtual bool hasLightSensor() const;
63 virtual int readLightSensor(); 61 virtual int readLightSensor();
diff --git a/libopie2/opiecore/device/odevice_zaurus.cpp b/libopie2/opiecore/device/odevice_zaurus.cpp
index b22ee70..cbc7a24 100644
--- a/libopie2/opiecore/device/odevice_zaurus.cpp
+++ b/libopie2/opiecore/device/odevice_zaurus.cpp
@@ -371,61 +371,24 @@ bool Zaurus::setLedState( OLed which, OLedState st )
371 default : ok = false; 371 default : ok = false;
372 } 372 }
373 373
374 if ( ok && ( ::ioctl ( fd, SHARP_LED_SETSTATUS, &leds ) >= 0 )) { 374 if ( ok && ( ::ioctl ( fd, SHARP_LED_SETSTATUS, &leds ) >= 0 )) {
375 m_leds [0] = st; 375 m_leds [0] = st;
376 return true; 376 return true;
377 } 377 }
378 } 378 }
379 } 379 }
380 return false; 380 return false;
381} 381}
382 382
383bool Zaurus::setSoftSuspend ( bool soft )
384{
385 if (!m_embedix) {
386 /* non-Embedix kernels dont have kernel autosuspend */
387 return ODevice::setSoftSuspend( soft );
388 }
389
390 bool res = false;
391 int fd;
392
393 if ((( fd = ::open ( "/dev/apm_bios", O_RDWR )) >= 0 ) ||
394 (( fd = ::open ( "/dev/misc/apm_bios",O_RDWR )) >= 0 )) {
395
396 int sources = ::ioctl( fd, APM_IOCGEVTSRC, 0 ); // get current event sources
397
398 if ( sources >= 0 ) {
399 if ( soft )
400 sources &= ~APM_EVT_POWER_BUTTON;
401 else
402 sources |= APM_EVT_POWER_BUTTON;
403
404 if ( ::ioctl( fd, APM_IOCSEVTSRC, sources ) >= 0 ) // set new event sources
405 res = true;
406 else
407 perror ( "APM_IOCGEVTSRC" );
408 }
409 else
410 perror ( "APM_IOCGEVTSRC" );
411
412 ::close( fd );
413 }
414 else
415 perror( "/dev/apm_bios or /dev/misc/apm_bios" );
416
417 return res;
418}
419
420int Zaurus::displayBrightnessResolution() const 383int Zaurus::displayBrightnessResolution() const
421{ 384{
422 int res = 1; 385 int res = 1;
423 if (m_embedix) 386 if (m_embedix)
424 { 387 {
425 int fd = ::open( SHARP_FL_IOCTL_DEVICE, O_RDWR|O_NONBLOCK ); 388 int fd = ::open( SHARP_FL_IOCTL_DEVICE, O_RDWR|O_NONBLOCK );
426 if ( fd ) 389 if ( fd )
427 { 390 {
428 int value = ::ioctl( fd, SHARP_FL_IOCTL_GET_STEP, 0 ); 391 int value = ::ioctl( fd, SHARP_FL_IOCTL_GET_STEP, 0 );
429 ::close( fd ); 392 ::close( fd );
430 return value ? value : res; 393 return value ? value : res;
431 } 394 }
@@ -531,52 +494,49 @@ bool Zaurus::suspend()
531 ::gettimeofday ( &tvn, 0 ); 494 ::gettimeofday ( &tvn, 0 );
532 } while ((( tvn. tv_sec - tvs. tv_sec ) * 1000 + ( tvn. tv_usec - tvs. tv_usec ) / 1000 ) < 15000 ); 495 } while ((( tvn. tv_sec - tvs. tv_sec ) * 1000 + ( tvn. tv_usec - tvs. tv_usec ) / 1000 ) < 15000 );
533 } 496 }
534 497
535 QCopEnvelope ( "QPE/Rotation", "rotateDefault()" ); 498 QCopEnvelope ( "QPE/Rotation", "rotateDefault()" );
536 return res; 499 return res;
537} 500}
538 501
539 502
540Transformation Zaurus::rotation() const 503Transformation Zaurus::rotation() const
541{ 504{
542 Transformation rot; 505 Transformation rot;
543 int handle = 0;
544 int retval = 0;
545 506
546 switch ( d->m_model ) { 507 switch ( d->m_model ) {
547 case Model_Zaurus_SLC3000: // fallthrough 508 case Model_Zaurus_SLC3000: // fallthrough
548 case Model_Zaurus_SLC7x0: 509 case Model_Zaurus_SLC7x0:
549 OHingeStatus hs = readHingeSensor(); 510 OHingeStatus hs = readHingeSensor();
550 if ( hs == CASE_PORTRAIT ) rot = Rot0; 511 if ( hs == CASE_PORTRAIT ) rot = Rot0;
551 else if ( hs == CASE_UNKNOWN ) rot = Rot0; 512 else if ( hs == CASE_UNKNOWN ) rot = Rot0;
552 else rot = Rot270; 513 else rot = Rot270;
553 break; 514 break;
554 case Model_Zaurus_SL6000: 515 case Model_Zaurus_SL6000:
555 case Model_Zaurus_SLB600: 516 case Model_Zaurus_SLB600:
556 case Model_Zaurus_SLA300: 517 case Model_Zaurus_SLA300:
557 case Model_Zaurus_SL5500: 518 case Model_Zaurus_SL5500:
558 case Model_Zaurus_SL5000: 519 case Model_Zaurus_SL5000:
559 default: 520 default:
560 rot = d->m_rotation; 521 rot = d->m_rotation;
561 break; 522 break;
562 } 523 }
563 524
564 return rot; 525 return rot;
565} 526}
566ODirection Zaurus::direction() const 527ODirection Zaurus::direction() const
567{ 528{
568 ODirection dir; 529 ODirection dir;
569 int handle = 0; 530
570 int retval = 0;
571 switch ( d->m_model ) { 531 switch ( d->m_model ) {
572 case Model_Zaurus_SLC3000: // fallthrough 532 case Model_Zaurus_SLC3000: // fallthrough
573 case Model_Zaurus_SLC7x0: 533 case Model_Zaurus_SLC7x0:
574 OHingeStatus hs = readHingeSensor(); 534 OHingeStatus hs = readHingeSensor();
575 if ( hs == CASE_PORTRAIT ) dir = CCW; 535 if ( hs == CASE_PORTRAIT ) dir = CCW;
576 else if ( hs == CASE_UNKNOWN ) dir = CCW; 536 else if ( hs == CASE_UNKNOWN ) dir = CCW;
577 else dir = CW; 537 else dir = CW;
578 break; 538 break;
579 case Model_Zaurus_SL6000: 539 case Model_Zaurus_SL6000:
580 case Model_Zaurus_SLA300: 540 case Model_Zaurus_SLA300:
581 case Model_Zaurus_SLB600: 541 case Model_Zaurus_SLB600:
582 case Model_Zaurus_SL5500: 542 case Model_Zaurus_SL5500:
diff --git a/libopie2/opiecore/device/odevice_zaurus.h b/libopie2/opiecore/device/odevice_zaurus.h
index c763798..04e73c4 100644
--- a/libopie2/opiecore/device/odevice_zaurus.h
+++ b/libopie2/opiecore/device/odevice_zaurus.h
@@ -85,26 +85,24 @@
85 85
86namespace Opie { 86namespace Opie {
87namespace Core { 87namespace Core {
88namespace Internal { 88namespace Internal {
89 89
90class Zaurus : public ODevice 90class Zaurus : public ODevice
91{ 91{
92 protected: 92 protected:
93 virtual void init(const QString&); 93 virtual void init(const QString&);
94 virtual void initButtons(); 94 virtual void initButtons();
95 95
96 public: 96 public:
97 virtual bool setSoftSuspend( bool soft );
98
99 virtual bool setDisplayBrightness( int b ); 97 virtual bool setDisplayBrightness( int b );
100 virtual bool setDisplayStatus( bool on ); 98 virtual bool setDisplayStatus( bool on );
101 virtual int displayBrightnessResolution() const; 99 virtual int displayBrightnessResolution() const;
102 100
103 virtual void playAlarmSound(); 101 virtual void playAlarmSound();
104 virtual void playKeySound(); 102 virtual void playKeySound();
105 virtual void playTouchSound(); 103 virtual void playTouchSound();
106 104
107 virtual QValueList <OLed> ledList() const; 105 virtual QValueList <OLed> ledList() const;
108 virtual QValueList <OLedState> ledStateList ( OLed led ) const; 106 virtual QValueList <OLedState> ledStateList ( OLed led ) const;
109 virtual OLedState ledState( OLed led ) const; 107 virtual OLedState ledState( OLed led ) const;
110 virtual bool setLedState( OLed led, OLedState st ); 108 virtual bool setLedState( OLed led, OLedState st );