summaryrefslogtreecommitdiff
path: root/libopie2
authormickeyl <mickeyl>2005-08-17 17:28:11 (UTC)
committer mickeyl <mickeyl>2005-08-17 17:28:11 (UTC)
commit7f931999d32be3fc90b451347dfec52643d8eeb8 (patch) (unidiff)
treea0047526c4b4e8da2e35f28dfdc3890c24c207a0 /libopie2
parente68f54c2f00d8e7a8e753722a50b47484c1124ee (diff)
downloadopie-7f931999d32be3fc90b451347dfec52643d8eeb8.zip
opie-7f931999d32be3fc90b451347dfec52643d8eeb8.tar.gz
opie-7f931999d32be3fc90b451347dfec52643d8eeb8.tar.bz2
split rotation handling of c7x0 and CXK because of the W100 Rot0 special case
Diffstat (limited to 'libopie2') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiecore/device/odevice_zaurus.cpp17
1 files changed, 14 insertions, 3 deletions
diff --git a/libopie2/opiecore/device/odevice_zaurus.cpp b/libopie2/opiecore/device/odevice_zaurus.cpp
index 7302d2c..b7f3104 100644
--- a/libopie2/opiecore/device/odevice_zaurus.cpp
+++ b/libopie2/opiecore/device/odevice_zaurus.cpp
@@ -529,68 +529,79 @@ bool Zaurus::setDisplayStatus( bool on )
529 } 529 }
530 } 530 }
531 else 531 else
532 { 532 {
533 int fd = ::open( m_backlightdev + "power", O_WRONLY|O_NONBLOCK ); 533 int fd = ::open( m_backlightdev + "power", O_WRONLY|O_NONBLOCK );
534 if ( fd ) 534 if ( fd )
535 { 535 {
536 char buf[10]; 536 char buf[10];
537 buf[0] = on ? FB_BLANK_UNBLANK : FB_BLANK_POWERDOWN; 537 buf[0] = on ? FB_BLANK_UNBLANK : FB_BLANK_POWERDOWN;
538 buf[1] = '\0'; 538 buf[1] = '\0';
539 res = ( ::write( fd, &buf[0], 2 ) == 0 ); 539 res = ( ::write( fd, &buf[0], 2 ) == 0 );
540 ::close( fd ); 540 ::close( fd );
541 } 541 }
542 } 542 }
543 return res; 543 return res;
544} 544}
545 545
546Transformation Zaurus::rotation() const 546Transformation Zaurus::rotation() const
547{ 547{
548 qDebug( "Zaurus::rotation()" ); 548 qDebug( "Zaurus::rotation()" );
549 Transformation rot; 549 Transformation rot;
550 550
551 switch ( d->m_model ) { 551 switch ( d->m_model ) {
552 case Model_Zaurus_SLC3000: // fallthrough 552 case Model_Zaurus_SLC3000: // fallthrough
553 case Model_Zaurus_SLC1000: // fallthrough 553 case Model_Zaurus_SLC1000:
554 {
555 OHingeStatus hs = readHingeSensor();
556 qDebug( "Zaurus::rotation() - hinge sensor = %d", (int) hs );
557 if ( hs == CASE_PORTRAIT ) rot = Rot0;
558 else if ( hs == CASE_UNKNOWN ) rot = Rot270;
559 else rot = Rot270;
560 }
561 break;
562
563 // SLC7x0 needs a special case here, because we were able to set the W100
564 // hardware default rotation on kernel 2.6 to Rot0
554 case Model_Zaurus_SLC7x0: 565 case Model_Zaurus_SLC7x0:
555 { 566 {
556 OHingeStatus hs = readHingeSensor(); 567 OHingeStatus hs = readHingeSensor();
557 qDebug( "Zaurus::rotation() - hinge sensor = %d", (int) hs ); 568 qDebug( "Zaurus::rotation() - hinge sensor = %d", (int) hs );
558 569
559 if ( m_embedix ) 570 if ( m_embedix )
560 { 571 {
561 if ( hs == CASE_PORTRAIT ) rot = Rot0; 572 if ( hs == CASE_PORTRAIT ) rot = Rot0;
562 else if ( hs == CASE_UNKNOWN ) rot = Rot0; 573 else if ( hs == CASE_UNKNOWN ) rot = Rot270;
563 else rot = Rot270; 574 else rot = Rot270;
564 } 575 }
565 else 576 else
566 { 577 {
567 if ( hs == CASE_PORTRAIT ) rot = Rot90; 578 if ( hs == CASE_PORTRAIT ) rot = Rot90;
568 else if ( hs == CASE_UNKNOWN ) rot = Rot0; 579 else if ( hs == CASE_UNKNOWN ) rot = Rot0;
569 else rot = Rot0; 580 else rot = Rot0;
570 } 581 }
571 } 582 }
572 break; 583 break;
573 case Model_Zaurus_SL6000: 584 case Model_Zaurus_SL6000:
574 case Model_Zaurus_SLB600: 585 case Model_Zaurus_SLB600:
575 case Model_Zaurus_SLA300: 586 case Model_Zaurus_SLA300:
576 case Model_Zaurus_SL5500: 587 case Model_Zaurus_SL5500:
577 case Model_Zaurus_SL5000: 588 case Model_Zaurus_SL5000:
578 default: 589 default:
579 rot = d->m_rotation; 590 rot = d->m_rotation;
580 break; 591 break;
581 } 592 }
582 593
583 return rot; 594 return rot;
584} 595}
585ODirection Zaurus::direction() const 596ODirection Zaurus::direction() const
586{ 597{
587 ODirection dir; 598 ODirection dir;
588 599
589 switch ( d->m_model ) { 600 switch ( d->m_model ) {
590 case Model_Zaurus_SLC3000: // fallthrough 601 case Model_Zaurus_SLC3000: // fallthrough
591 case Model_Zaurus_SLC1000: // fallthrough 602 case Model_Zaurus_SLC1000: // fallthrough
592 case Model_Zaurus_SLC7x0: { 603 case Model_Zaurus_SLC7x0: {
593 OHingeStatus hs = readHingeSensor(); 604 OHingeStatus hs = readHingeSensor();
594 if ( hs == CASE_PORTRAIT ) dir = CCW; 605 if ( hs == CASE_PORTRAIT ) dir = CCW;
595 else if ( hs == CASE_UNKNOWN ) dir = CCW; 606 else if ( hs == CASE_UNKNOWN ) dir = CCW;
596 else dir = CW; 607 else dir = CW;