summaryrefslogtreecommitdiff
path: root/libopie
authormickeyl <mickeyl>2003-05-23 20:39:17 (UTC)
committer mickeyl <mickeyl>2003-05-23 20:39:17 (UTC)
commit0c4b5288ccd4bcd1668816a0c4e12ce0a76b4e6e (patch) (unidiff)
treed3ca4e58beec5121ea2f7c02df1ac689bdb06be3 /libopie
parent165a62b3ca9cc8e2c3c66845f465a38413fa60d9 (diff)
downloadopie-0c4b5288ccd4bcd1668816a0c4e12ce0a76b4e6e.zip
opie-0c4b5288ccd4bcd1668816a0c4e12ce0a76b4e6e.tar.gz
opie-0c4b5288ccd4bcd1668816a0c4e12ce0a76b4e6e.tar.bz2
fix default rotation and direction for SIMpad
Diffstat (limited to 'libopie') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie/odevice.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/libopie/odevice.cpp b/libopie/odevice.cpp
index 02f13b5..2873407 100644
--- a/libopie/odevice.cpp
+++ b/libopie/odevice.cpp
@@ -1468,97 +1468,100 @@ bool Zaurus::setSoftSuspend ( bool soft )
1468bool Zaurus::setDisplayBrightness ( int bright ) 1468bool Zaurus::setDisplayBrightness ( int bright )
1469{ 1469{
1470 bool res = false; 1470 bool res = false;
1471 int fd; 1471 int fd;
1472 1472
1473 if ( bright > 255 ) 1473 if ( bright > 255 )
1474 bright = 255; 1474 bright = 255;
1475 if ( bright < 0 ) 1475 if ( bright < 0 )
1476 bright = 0; 1476 bright = 0;
1477 1477
1478 if (( fd = ::open ( "/dev/fl", O_WRONLY )) >= 0 ) { 1478 if (( fd = ::open ( "/dev/fl", O_WRONLY )) >= 0 ) {
1479 int bl = ( bright * 4 + 127 ) / 255; // only 4 steps on zaurus 1479 int bl = ( bright * 4 + 127 ) / 255; // only 4 steps on zaurus
1480 if ( bright && !bl ) 1480 if ( bright && !bl )
1481 bl = 1; 1481 bl = 1;
1482 res = ( ::ioctl ( fd, FL_IOCTL_STEP_CONTRAST, bl ) == 0 ); 1482 res = ( ::ioctl ( fd, FL_IOCTL_STEP_CONTRAST, bl ) == 0 );
1483 ::close ( fd ); 1483 ::close ( fd );
1484 } 1484 }
1485 return res; 1485 return res;
1486} 1486}
1487 1487
1488 1488
1489int Zaurus::displayBrightnessResolution ( ) const 1489int Zaurus::displayBrightnessResolution ( ) const
1490{ 1490{
1491 return 5; 1491 return 5;
1492} 1492}
1493 1493
1494 1494
1495/************************************************** 1495/**************************************************
1496 * 1496 *
1497 * SIMpad 1497 * SIMpad
1498 * 1498 *
1499 **************************************************/ 1499 **************************************************/
1500 1500
1501void SIMpad::init ( ) 1501void SIMpad::init ( )
1502{ 1502{
1503 d-> m_vendorstr = "SIEMENS"; 1503 d-> m_vendorstr = "SIEMENS";
1504 d-> m_vendor = Vendor_SIEMENS; 1504 d-> m_vendor = Vendor_SIEMENS;
1505 1505
1506 QFile f ( "/proc/hal/model" ); 1506 QFile f ( "/proc/hal/model" );
1507 1507
1508 //TODO Implement model checking 1508 //TODO Implement model checking
1509 //FIXME For now we assume an SL4 1509 //FIXME For now we assume an SL4
1510 1510
1511 d-> m_modelstr = "SL4"; 1511 d-> m_modelstr = "SL4";
1512 d-> m_model = Model_SIMpad_SL4; 1512 d-> m_model = Model_SIMpad_SL4;
1513 1513
1514 switch ( d-> m_model ) { 1514 switch ( d-> m_model ) {
1515 default: 1515 default:
1516 d-> m_rotation = Rot270; 1516 d-> m_rotation = Rot0;
1517 d-> m_direction = CCW;
1518 d-> m_holdtime = 1000; // 1000ms
1519
1517 break; 1520 break;
1518 } 1521 }
1519 1522
1520 f. setName ( "/etc/familiar-version" ); 1523 f. setName ( "/etc/familiar-version" );
1521 if ( f. open ( IO_ReadOnly )) { 1524 if ( f. open ( IO_ReadOnly )) {
1522 d-> m_systemstr = "Familiar"; 1525 d-> m_systemstr = "Familiar";
1523 d-> m_system = System_Familiar; 1526 d-> m_system = System_Familiar;
1524 1527
1525 QTextStream ts ( &f ); 1528 QTextStream ts ( &f );
1526 d-> m_sysverstr = ts. readLine ( ). mid ( 10 ); 1529 d-> m_sysverstr = ts. readLine ( ). mid ( 10 );
1527 1530
1528 f. close ( ); 1531 f. close ( );
1529 } else { 1532 } else {
1530 f. setName ( "/etc/oz_version" ); 1533 f. setName ( "/etc/oz_version" );
1531 1534
1532 if ( f. open ( IO_ReadOnly )) { 1535 if ( f. open ( IO_ReadOnly )) {
1533 d-> m_systemstr = "OpenEmbedded/SIMpad"; 1536 d-> m_systemstr = "OpenEmbedded/SIMpad";
1534 d-> m_system = System_OpenZaurus; 1537 d-> m_system = System_OpenZaurus;
1535 1538
1536 QTextStream ts ( &f ); 1539 QTextStream ts ( &f );
1537 ts.setDevice ( &f ); 1540 ts.setDevice ( &f );
1538 d-> m_sysverstr = ts. readLine ( ); 1541 d-> m_sysverstr = ts. readLine ( );
1539 f. close ( ); 1542 f. close ( );
1540 } 1543 }
1541 } 1544 }
1542 1545
1543 m_leds [0] = m_leds [1] = Led_Off; 1546 m_leds [0] = m_leds [1] = Led_Off;
1544 1547
1545 m_power_timer = 0; 1548 m_power_timer = 0;
1546 1549
1547} 1550}
1548 1551
1549void SIMpad::initButtons ( ) 1552void SIMpad::initButtons ( )
1550{ 1553{
1551 if ( d-> m_buttons ) 1554 if ( d-> m_buttons )
1552 return; 1555 return;
1553 1556
1554 if ( isQWS( ) ) 1557 if ( isQWS( ) )
1555 QWSServer::setKeyboardFilter ( this ); 1558 QWSServer::setKeyboardFilter ( this );
1556 1559
1557 d-> m_buttons = new QValueList <ODeviceButton>; 1560 d-> m_buttons = new QValueList <ODeviceButton>;
1558 1561
1559 for ( uint i = 0; i < ( sizeof( simpad_buttons ) / sizeof( s_button )); i++ ) { 1562 for ( uint i = 0; i < ( sizeof( simpad_buttons ) / sizeof( s_button )); i++ ) {
1560 s_button *sb = simpad_buttons + i; 1563 s_button *sb = simpad_buttons + i;
1561 ODeviceButton b; 1564 ODeviceButton b;
1562 1565
1563 if (( sb-> model & d-> m_model ) == d-> m_model ) { 1566 if (( sb-> model & d-> m_model ) == d-> m_model ) {
1564 b. setKeycode ( sb-> code ); 1567 b. setKeycode ( sb-> code );