summaryrefslogtreecommitdiff
path: root/libopie2/opiecore/device
authormickeyl <mickeyl>2005-02-06 22:53:53 (UTC)
committer mickeyl <mickeyl>2005-02-06 22:53:53 (UTC)
commitab32151cd8e85deb354bab04e25efb1f3f399dee (patch) (unidiff)
tree66ab72d210bbc50c0e535986c61ca23f68efbfd1 /libopie2/opiecore/device
parentec33239c6edd9927fe2f82953fa48dec47d19567 (diff)
downloadopie-ab32151cd8e85deb354bab04e25efb1f3f399dee.zip
opie-ab32151cd8e85deb354bab04e25efb1f3f399dee.tar.gz
opie-ab32151cd8e85deb354bab04e25efb1f3f399dee.tar.bz2
make autorotate also work on kernel 2.6
Diffstat (limited to 'libopie2/opiecore/device') (more/less context) (show whitespace changes)
-rw-r--r--libopie2/opiecore/device/odevice.cpp62
-rw-r--r--libopie2/opiecore/device/odevice_zaurus.cpp22
2 files changed, 22 insertions, 62 deletions
diff --git a/libopie2/opiecore/device/odevice.cpp b/libopie2/opiecore/device/odevice.cpp
index 3d69614..2c5190c 100644
--- a/libopie2/opiecore/device/odevice.cpp
+++ b/libopie2/opiecore/device/odevice.cpp
@@ -250,154 +250,115 @@ ODevice::~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
257//#include <linux/apm_bios.h> 257//#include <linux/apm_bios.h>
258 258
259#define APM_IOC_SUSPEND OD_IO( 'A', 2 ) 259#define APM_IOC_SUSPEND OD_IO( 'A', 2 )
260 260
261/** 261/**
262* This method will try to suspend the device 262* This method will try to suspend the device
263* 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
264* is installed. 264* is installed.
265* 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
266* do have asynchronus apm implementations. 266* do have asynchronus apm implementations.
267* 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
268* device and return once the device got woken up 268* device and return once the device got woken up
269* 269*
270* @return if the device got suspended 270* @return if the device got suspended
271*/ 271*/
272bool ODevice::suspend() 272bool ODevice::suspend()
273{ 273{
274 if ( !isQWS( ) ) // only qwsserver is allowed to suspend 274 return false; // default implementation == unknown device or qvfb
275 return false;
276
277 if ( d->m_model == Model_Unknown ) // better don't suspend in qvfb / on unkown devices
278 return false;
279
280 bool res = false;
281 ODevice::sendSuspendmsg();
282
283 struct timeval tvs, tvn;
284 ::gettimeofday ( &tvs, 0 );
285
286 ::sync(); // flush fs caches
287 res = ( ::system ( "apm --suspend" ) == 0 );
288
289 // This is needed because the iPAQ apm implementation is asynchronous and we
290 // can not be sure when exactly the device is really suspended
291 // This can be deleted as soon as a stable familiar with a synchronous apm implementation exists.
292
293 if ( res ) {
294 do { // wait at most 1.5 sec: either suspend didn't work or the device resumed
295 ::usleep ( 200 * 1000 );
296 ::gettimeofday ( &tvn, 0 );
297 } while ((( tvn. tv_sec - tvs. tv_sec ) * 1000 + ( tvn. tv_usec - tvs. tv_usec ) / 1000 ) < 1500 );
298 }
299
300 return res;
301} 275}
302 276
303//#include <linux/fb.h> better not rely on kernel headers in userspace ... 277//#include <linux/fb.h> better not rely on kernel headers in userspace ...
304 278
305#define FBIOBLANK OD_IO( 'F', 0x11 ) // 0x4611 279#define FBIOBLANK OD_IO( 'F', 0x11 ) // 0x4611
306 280
307/* VESA Blanking Levels */ 281/* VESA Blanking Levels */
308#define VESA_NO_BLANKING 0 282#define VESA_NO_BLANKING 0
309#define VESA_VSYNC_SUSPEND 1 283#define VESA_VSYNC_SUSPEND 1
310#define VESA_HSYNC_SUSPEND 2 284#define VESA_HSYNC_SUSPEND 2
311#define VESA_POWERDOWN 3 285#define VESA_POWERDOWN 3
312 286
313/** 287/**
314* This sets the display on or off 288* This sets the display on or off
315*/ 289*/
316bool ODevice::setDisplayStatus ( bool on ) 290bool ODevice::setDisplayStatus ( bool on )
317{ 291{
318 qDebug("ODevice::setDisplayStatus(%d)", on); 292 qDebug( "ODevice::setDisplayStatus( %d ) - please override me.", on );
319 293 return false; // don't do anything for unknown models
320 if ( d->m_model == Model_Unknown )
321 return false;
322
323 bool res = false;
324 int fd;
325
326#ifdef QT_QWS_DEVFS
327 if (( fd = ::open ( "/dev/fb/0", O_RDWR )) >= 0 ) {
328#else
329 if (( fd = ::open ( "/dev/fb0", O_RDWR )) >= 0 ) {
330#endif
331 res = ( ::ioctl ( fd, FBIOBLANK, on ? VESA_NO_BLANKING : VESA_POWERDOWN ) == 0 );
332 ::close ( fd );
333 }
334 return res;
335} 294}
336 295
337/** 296/**
338* This sets the display brightness 297* This sets the display brightness
339* 298*
340* @param b The brightness to be set on a scale from 0 to 255 299* @param b The brightness to be set on a scale from 0 to 255
341* @return success or failure 300* @return success or failure
342*/ 301*/
343bool ODevice::setDisplayBrightness ( int b) 302bool ODevice::setDisplayBrightness ( int b)
344{ 303{
345 Q_UNUSED( b ) 304 qDebug( "ODevice::setDisplayBrightness( %d ) - please override me.", b );
346 return false; 305 return false;
347} 306}
348 307
349/** 308/**
350 * 309 *
351 * @return Returns the number of steppings on the brightness slider 310 * @returns the number of steppings on the brightness slider
352 * in the Light-'n-Power settings. Values smaller zero and bigger 311 * in the Light-'n-Power settings. Values smaller than zero and bigger
353 * than 255 do not make sense. 312 * than 255 do not make sense.
354 * 313 *
355 * \sa QSlider::setLineStep 314 * \sa QSlider::setLineStep
356 * \sa QSlider::setPageStep 315 * \sa QSlider::setPageStep
357 */ 316 */
358int ODevice::displayBrightnessResolution() const 317int ODevice::displayBrightnessResolution() const
359{ 318{
319 qDebug( "ODevice::displayBrightnessResolution() - please override me." );
360 return 16; 320 return 16;
361} 321}
362 322
363/** 323/**
364* This sets the display contrast 324* This sets the display contrast
365* @param p The contrast to be set on a scale from 0 to 255 325* @param p The contrast to be set on a scale from 0 to 255
366* @return success or failure 326* @returns success or failure
367*/ 327*/
368bool ODevice::setDisplayContrast ( int p) 328bool ODevice::setDisplayContrast ( int p)
369{ 329{
370 Q_UNUSED( p ) 330 qDebug( "ODevice::setDisplayContrast( %d ) - please override me.", p );
371 return false; 331 return false;
372} 332}
373 333
374/** 334/**
375* @return return the max value for the brightness settings slider 335* @returns the maximum value for the contrast settings slider
376* or 0 if the device doesn't support setting of a contrast 336* or 0 if the device doesn't support setting of a contrast
377*/ 337*/
378int ODevice::displayContrastResolution() const 338int ODevice::displayContrastResolution() const
379{ 339{
340 qDebug( "ODevice::displayBrightnessResolution() - please override me." );
380 return 0; 341 return 0;
381} 342}
382 343
383/** 344/**
384* This returns the vendor as string 345* This returns the vendor as string
385* @return Vendor as QString 346* @return Vendor as QString
386*/ 347*/
387QString ODevice::vendorString() const 348QString ODevice::vendorString() const
388{ 349{
389 return d->m_vendorstr; 350 return d->m_vendorstr;
390} 351}
391 352
392/** 353/**
393* This returns the vendor as one of the values of OVendor 354* This returns the vendor as one of the values of OVendor
394* @return OVendor 355* @return OVendor
395*/ 356*/
396OVendor ODevice::vendor() const 357OVendor ODevice::vendor() const
397{ 358{
398 return d->m_vendor; 359 return d->m_vendor;
399} 360}
400 361
401/** 362/**
402* This returns the model as a string 363* This returns the model as a string
403* @return A string representing the model 364* @return A string representing the model
@@ -658,49 +619,48 @@ void ODevice::reloadButtonMapping()
658 } 619 }
659 620
660 Config cfg ( "ButtonSettings" ); 621 Config cfg ( "ButtonSettings" );
661 622
662 for ( uint i = 0; i < d->m_buttons->count(); i++ ) { 623 for ( uint i = 0; i < d->m_buttons->count(); i++ ) {
663 ODeviceButton &b = ( *d->m_buttons ) [i]; 624 ODeviceButton &b = ( *d->m_buttons ) [i];
664 QString group = "Button" + QString::number ( i ); 625 QString group = "Button" + QString::number ( i );
665 626
666 QCString pch, hch; 627 QCString pch, hch;
667 QCString pm, hm; 628 QCString pm, hm;
668 QByteArray pdata, hdata; 629 QByteArray pdata, hdata;
669 630
670 if ( cfg. hasGroup ( group )) { 631 if ( cfg. hasGroup ( group )) {
671 cfg. setGroup ( group ); 632 cfg. setGroup ( group );
672 pch = cfg. readEntry ( "PressedActionChannel" ). latin1(); 633 pch = cfg. readEntry ( "PressedActionChannel" ). latin1();
673 pm = cfg. readEntry ( "PressedActionMessage" ). latin1(); 634 pm = cfg. readEntry ( "PressedActionMessage" ). latin1();
674 // pdata = decodeBase64 ( buttonFile. readEntry ( "PressedActionArgs" )); 635 // pdata = decodeBase64 ( buttonFile. readEntry ( "PressedActionArgs" ));
675 636
676 hch = cfg. readEntry ( "HeldActionChannel" ). latin1(); 637 hch = cfg. readEntry ( "HeldActionChannel" ). latin1();
677 hm = cfg. readEntry ( "HeldActionMessage" ). latin1(); 638 hm = cfg. readEntry ( "HeldActionMessage" ). latin1();
678 // hdata = decodeBase64 ( buttonFile. readEntry ( "HeldActionArgs" )); 639 // hdata = decodeBase64 ( buttonFile. readEntry ( "HeldActionArgs" ));
679 } 640 }
680 641
681 b. setPressedAction ( OQCopMessage ( pch, pm, pdata )); 642 b. setPressedAction ( OQCopMessage ( pch, pm, pdata ));
682
683 b. setHeldAction ( OQCopMessage ( hch, hm, hdata )); 643 b. setHeldAction ( OQCopMessage ( hch, hm, hdata ));
684 } 644 }
685} 645}
686 646
687void ODevice::remapPressedAction ( int button, const OQCopMessage &action ) 647void ODevice::remapPressedAction ( int button, const OQCopMessage &action )
688{ 648{
689 initButtons(); 649 initButtons();
690 650
691 QString mb_chan; 651 QString mb_chan;
692 652
693 if ( button >= (int) d->m_buttons->count()) 653 if ( button >= (int) d->m_buttons->count())
694 return; 654 return;
695 655
696 ODeviceButton &b = ( *d->m_buttons ) [button]; 656 ODeviceButton &b = ( *d->m_buttons ) [button];
697 b. setPressedAction ( action ); 657 b. setPressedAction ( action );
698 658
699 mb_chan=b. pressedAction(). channel(); 659 mb_chan=b. pressedAction(). channel();
700 660
701 Config buttonFile ( "ButtonSettings" ); 661 Config buttonFile ( "ButtonSettings" );
702 buttonFile. setGroup ( "Button" + QString::number ( button )); 662 buttonFile. setGroup ( "Button" + QString::number ( button ));
703 buttonFile. writeEntry ( "PressedActionChannel", (const char*) mb_chan); 663 buttonFile. writeEntry ( "PressedActionChannel", (const char*) mb_chan);
704 buttonFile. writeEntry ( "PressedActionMessage", (const char*) b. pressedAction(). message()); 664 buttonFile. writeEntry ( "PressedActionMessage", (const char*) b. pressedAction(). message());
705 665
706// buttonFile. writeEntry ( "PressedActionArgs", encodeBase64 ( b. pressedAction(). data())); 666// buttonFile. writeEntry ( "PressedActionArgs", encodeBase64 ( b. pressedAction(). data()));
diff --git a/libopie2/opiecore/device/odevice_zaurus.cpp b/libopie2/opiecore/device/odevice_zaurus.cpp
index 7377965..82e127e 100644
--- a/libopie2/opiecore/device/odevice_zaurus.cpp
+++ b/libopie2/opiecore/device/odevice_zaurus.cpp
@@ -81,60 +81,60 @@ struct z_button z_buttons [] = {
81}; 81};
82 82
83struct z_button z_buttons_c700 [] = { 83struct z_button z_buttons_c700 [] = {
84 { Qt::Key_F9, QT_TRANSLATE_NOOP("Button", "Calendar Button"), 84 { Qt::Key_F9, QT_TRANSLATE_NOOP("Button", "Calendar Button"),
85 "devicebuttons/z_calendar", 85 "devicebuttons/z_calendar",
86 "datebook", "nextView()", 86 "datebook", "nextView()",
87 "today", "raise()" }, 87 "today", "raise()" },
88 { Qt::Key_F10, QT_TRANSLATE_NOOP("Button", "Contacts Button"), 88 { Qt::Key_F10, QT_TRANSLATE_NOOP("Button", "Contacts Button"),
89 "devicebuttons/z_contact", 89 "devicebuttons/z_contact",
90 "addressbook", "raise()", 90 "addressbook", "raise()",
91 "addressbook", "beamBusinessCard()" }, 91 "addressbook", "beamBusinessCard()" },
92 { Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Home Button"), 92 { Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Home Button"),
93 "devicebuttons/z_home", 93 "devicebuttons/z_home",
94 "QPE/Launcher", "home()", 94 "QPE/Launcher", "home()",
95 "buttonsettings", "raise()" }, 95 "buttonsettings", "raise()" },
96 { Qt::Key_F11, QT_TRANSLATE_NOOP("Button", "Menu Button"), 96 { Qt::Key_F11, QT_TRANSLATE_NOOP("Button", "Menu Button"),
97 "devicebuttons/z_menu", 97 "devicebuttons/z_menu",
98 "QPE/TaskBar", "toggleMenu()", 98 "QPE/TaskBar", "toggleMenu()",
99 "QPE/TaskBar", "toggleStartMenu()" }, 99 "QPE/TaskBar", "toggleStartMenu()" },
100 { Qt::Key_F13, QT_TRANSLATE_NOOP("Button", "Mail Button"), 100 { Qt::Key_F13, QT_TRANSLATE_NOOP("Button", "Mail Button"),
101 "devicebuttons/z_mail", 101 "devicebuttons/z_mail",
102 "opiemail", "raise()", 102 "opiemail", "raise()",
103 "opiemail", "newMail()" }, 103 "opiemail", "newMail()" },
104 104
105 { Qt::Key_F15, QT_TRANSLATE_NOOP("Button", "Display Rotate"), 105 { Qt::Key_F15, QT_TRANSLATE_NOOP("Button", "Hinge1"),
106 "devicebuttons/z_hinge", 106 "devicebuttons/z_hinge1",
107 "QPE/Rotation", "rotateDefault()", 107 "QPE/Rotation", "rotateDefault()",
108 "QPE/Dummy", "doNothing()" }, 108 "QPE/Rotation", "rotateDefault()" },
109 { Qt::Key_F16, QT_TRANSLATE_NOOP("Button", "Display Rotate"), 109 { Qt::Key_F16, QT_TRANSLATE_NOOP("Button", "Hinge2"),
110 "devicebuttons/z_hinge", 110 "devicebuttons/z_hinge2",
111 "QPE/Rotation", "rotateDefault()", 111 "QPE/Rotation", "rotateDefault()",
112 "QPE/Dummy", "doNothing()" }, 112 "QPE/Rotation", "rotateDefault()" },
113 { Qt::Key_F17, QT_TRANSLATE_NOOP("Button", "Display Rotate"), 113 { Qt::Key_F17, QT_TRANSLATE_NOOP("Button", "Hinge3"),
114 "devicebuttons/z_hinge", 114 "devicebuttons/z_hinge3",
115 "QPE/Rotation", "rotateDefault()", 115 "QPE/Rotation", "rotateDefault()",
116 "QPE/Dummy", "doNothing()" }, 116 "QPE/Rotation", "rotateDefault()" },
117}; 117};
118 118
119// FIXME This gets unnecessary complicated. We should think about splitting the Zaurus 119// FIXME This gets unnecessary complicated. We should think about splitting the Zaurus
120// class up into individual classes. We need three classes 120// class up into individual classes. We need three classes
121// 121//
122// Zaurus-Collie (SA-model w/ 320x240 lcd, for SL5500 and SL5000) 122// Zaurus-Collie (SA-model w/ 320x240 lcd, for SL5500 and SL5000)
123// Zaurus-Poodle (PXA-model w/ 320x240 lcd, for SL5600) 123// Zaurus-Poodle (PXA-model w/ 320x240 lcd, for SL5600)
124// Zaurus-Corgi (PXA-model w/ 640x480 lcd, for C700, C750, C760, C860, C3000) 124// Zaurus-Corgi (PXA-model w/ 640x480 lcd, for C700, C750, C760, C860, C3000)
125// Zaurus-Tosa (PXA-model w/ 480x640 lcd, for SL6000) 125// Zaurus-Tosa (PXA-model w/ 480x640 lcd, for SL6000)
126// 126//
127// Only question right now is: Do we really need to do it? Because as soon 127// Only question right now is: Do we really need to do it? Because as soon
128// as the OpenZaurus kernel is ready, there will be a unified interface for all 128// as the OpenZaurus kernel is ready, there will be a unified interface for all
129// Zaurus models (concerning apm, backlight, buttons, etc.) 129// Zaurus models (concerning apm, backlight, buttons, etc.)
130// 130//
131// Comments? - mickeyl. 131// Comments? - mickeyl.
132 132
133void Zaurus::init(const QString& cpu_info) 133void Zaurus::init(const QString& cpu_info)
134{ 134{
135 // generic distribution code already scanned /etc/issue at that point - 135 // generic distribution code already scanned /etc/issue at that point -
136 // embedix releases contain "Embedix <version> | Linux for Embedded Devices" 136 // embedix releases contain "Embedix <version> | Linux for Embedded Devices"
137 if ( d->m_sysverstr.contains( "embedix", false ) ) 137 if ( d->m_sysverstr.contains( "embedix", false ) )
138 { 138 {
139 d->m_vendorstr = "Sharp"; 139 d->m_vendorstr = "Sharp";
140 d->m_vendor = Vendor_Sharp; 140 d->m_vendor = Vendor_Sharp;
@@ -467,95 +467,95 @@ bool Zaurus::setDisplayStatus( bool on )
467 ::close ( fd ); 467 ::close ( fd );
468 } 468 }
469 } 469 }
470 else 470 else
471 { 471 {
472 int fd = ::open( "/sys/class/backlight/corgi-bl/power", O_WRONLY|O_NONBLOCK ); 472 int fd = ::open( "/sys/class/backlight/corgi-bl/power", O_WRONLY|O_NONBLOCK );
473 if ( fd ) 473 if ( fd )
474 { 474 {
475 char buf[10]; 475 char buf[10];
476 buf[0] = on ? FB_BLANK_UNBLANK : FB_BLANK_POWERDOWN; 476 buf[0] = on ? FB_BLANK_UNBLANK : FB_BLANK_POWERDOWN;
477 buf[1] = '\0'; 477 buf[1] = '\0';
478 res = ( ::write( fd, &buf[0], 2 ) == 0 ); 478 res = ( ::write( fd, &buf[0], 2 ) == 0 );
479 ::close( fd ); 479 ::close( fd );
480 } 480 }
481 } 481 }
482 return res; 482 return res;
483} 483}
484 484
485bool Zaurus::suspend() 485bool Zaurus::suspend()
486{ 486{
487 qDebug("ODevice::suspend"); 487 qDebug("ODevice::suspend");
488 if ( !isQWS( ) ) // only qwsserver is allowed to suspend 488 if ( !isQWS( ) ) // only qwsserver is allowed to suspend
489 return false; 489 return false;
490 490
491 if ( d->m_model == Model_Unknown ) // better don't suspend in qvfb / on unkown devices 491 if ( d->m_model == Model_Unknown ) // better don't suspend on unknown devices
492 return false; 492 return false;
493 493
494 bool res = false; 494 bool res = false;
495 ODevice::sendSuspendmsg(); 495 ODevice::sendSuspendmsg();
496 496
497 struct timeval tvs, tvn; 497 struct timeval tvs, tvn;
498 ::gettimeofday ( &tvs, 0 ); 498 ::gettimeofday ( &tvs, 0 );
499 499
500 ::sync(); // flush fs caches 500 ::sync(); // flush fs caches
501 res = ( ::system ( "apm --suspend" ) == 0 ); 501 res = ( ::system ( "apm --suspend" ) == 0 );
502 502
503 // This is needed because the apm implementation is asynchronous and we 503 // This is needed because the apm implementation is asynchronous and we
504 // can not be sure when exactly the device is really suspended 504 // can not be sure when exactly the device is really suspended
505 if ( res ) { 505 if ( res ) {
506 do { // Yes, wait 15 seconds. This APM sucks big time. 506 do { // Yes, wait 15 seconds. This APM sucks big time.
507 ::usleep ( 200 * 1000 ); 507 ::usleep ( 200 * 1000 );
508 ::gettimeofday ( &tvn, 0 ); 508 ::gettimeofday ( &tvn, 0 );
509 } while ((( tvn. tv_sec - tvs. tv_sec ) * 1000 + ( tvn. tv_usec - tvs. tv_usec ) / 1000 ) < 15000 ); 509 } while ((( tvn. tv_sec - tvs. tv_sec ) * 1000 + ( tvn. tv_usec - tvs. tv_usec ) / 1000 ) < 15000 );
510 } 510 }
511 511
512 QCopEnvelope ( "QPE/Rotation", "rotateDefault()" ); 512 QCopEnvelope ( "QPE/Rotation", "rotateDefault()" );
513 return res; 513 return res;
514} 514}
515 515
516 516
517Transformation Zaurus::rotation() const 517Transformation Zaurus::rotation() const
518{ 518{
519 qDebug( "Zaurus::rotation()" ); 519 qDebug( "Zaurus::rotation()" );
520 Transformation rot; 520 Transformation rot;
521 521
522 switch ( d->m_model ) { 522 switch ( d->m_model ) {
523 case Model_Zaurus_SLC3000: // fallthrough 523 case Model_Zaurus_SLC3000: // fallthrough
524 case Model_Zaurus_SLC7x0: 524 case Model_Zaurus_SLC7x0:
525 { 525 {
526 OHingeStatus hs = readHingeSensor(); 526 OHingeStatus hs = readHingeSensor();
527 qDebug( "Zaurus::rotation() - hinge sensor = %d", (int) hs ); 527 qDebug( "Zaurus::rotation() - hinge sensor = %d", (int) hs );
528 528
529 if ( m_embedix ) 529 if ( m_embedix )
530 { 530 {
531 if ( hs == CASE_PORTRAIT ) rot = Rot0; 531 if ( hs == CASE_PORTRAIT ) rot = Rot0;
532 else if ( hs == CASE_UNKNOWN ) rot = Rot0; 532 else if ( hs == CASE_UNKNOWN ) rot = Rot0;
533 else rot = Rot270; 533 else rot = Rot270;
534 } 534 }
535 else 535 else
536 { 536 {
537 if ( hs == CASE_PORTRAIT ) rot = Rot270; 537 if ( hs == CASE_PORTRAIT ) rot = Rot90;
538 else if ( hs == CASE_UNKNOWN ) rot = Rot0; 538 else if ( hs == CASE_UNKNOWN ) rot = Rot0;
539 else rot = Rot0; 539 else rot = Rot0;
540 } 540 }
541 } 541 }
542 break; 542 break;
543 case Model_Zaurus_SL6000: 543 case Model_Zaurus_SL6000:
544 case Model_Zaurus_SLB600: 544 case Model_Zaurus_SLB600:
545 case Model_Zaurus_SLA300: 545 case Model_Zaurus_SLA300:
546 case Model_Zaurus_SL5500: 546 case Model_Zaurus_SL5500:
547 case Model_Zaurus_SL5000: 547 case Model_Zaurus_SL5000:
548 default: 548 default:
549 rot = d->m_rotation; 549 rot = d->m_rotation;
550 break; 550 break;
551 } 551 }
552 552
553 return rot; 553 return rot;
554} 554}
555ODirection Zaurus::direction() const 555ODirection Zaurus::direction() const
556{ 556{
557 ODirection dir; 557 ODirection dir;
558 558
559 switch ( d->m_model ) { 559 switch ( d->m_model ) {
560 case Model_Zaurus_SLC3000: // fallthrough 560 case Model_Zaurus_SLC3000: // fallthrough
561 case Model_Zaurus_SLC7x0: { 561 case Model_Zaurus_SLC7x0: {