summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libopie/odevice.cpp23
1 files changed, 13 insertions, 10 deletions
diff --git a/libopie/odevice.cpp b/libopie/odevice.cpp
index fef623a..58254a7 100644
--- a/libopie/odevice.cpp
+++ b/libopie/odevice.cpp
@@ -1127,24 +1127,25 @@ void iPAQ::init ( )
1127 1127
1128 f. close ( ); 1128 f. close ( );
1129 } 1129 }
1130 1130
1131 switch ( d-> m_model ) { 1131 switch ( d-> m_model ) {
1132 case Model_iPAQ_H31xx: 1132 case Model_iPAQ_H31xx:
1133 case Model_iPAQ_H38xx: 1133 case Model_iPAQ_H38xx:
1134 d-> m_rotation = Rot90; 1134 d-> m_rotation = Rot90;
1135 break; 1135 break;
1136 case Model_iPAQ_H36xx: 1136 case Model_iPAQ_H36xx:
1137 case Model_iPAQ_H37xx: 1137 case Model_iPAQ_H37xx:
1138 case Model_iPAQ_H39xx: 1138 case Model_iPAQ_H39xx:
1139
1139 default: 1140 default:
1140 d-> m_rotation = Rot270; 1141 d-> m_rotation = Rot270;
1141 break; 1142 break;
1142 case Model_iPAQ_H5xxx: 1143 case Model_iPAQ_H5xxx:
1143 d-> m_rotation = Rot0; 1144 d-> m_rotation = Rot0;
1144 } 1145 }
1145 1146
1146 f. setName ( "/etc/familiar-version" ); 1147 f. setName ( "/etc/familiar-version" );
1147 if ( f. open ( IO_ReadOnly )) { 1148 if ( f. open ( IO_ReadOnly )) {
1148 d-> m_systemstr = "Familiar"; 1149 d-> m_systemstr = "Familiar";
1149 d-> m_system = System_Familiar; 1150 d-> m_system = System_Familiar;
1150 1151
@@ -1491,46 +1492,47 @@ int iPAQ::lightSensorResolution ( ) const
1491 * 1492 *
1492 **************************************************/ 1493 **************************************************/
1493 1494
1494// Check whether this device is the sharp zaurus.. 1495// Check whether this device is the sharp zaurus..
1495bool Zaurus::isZaurus() 1496bool Zaurus::isZaurus()
1496{ 1497{
1497 1498
1498 // If the special devices by embedix exist, it is quite simple: it is a Zaurus ! 1499 // If the special devices by embedix exist, it is quite simple: it is a Zaurus !
1499 if ( QFile::exists ( "/dev/sharp_buz" ) || QFile::exists ( "/dev/sharp_led" ) ){ 1500 if ( QFile::exists ( "/dev/sharp_buz" ) || QFile::exists ( "/dev/sharp_led" ) ){
1500 return true; 1501 return true;
1501 } 1502 }
1502 1503
1503 // On non-embedix kenrnels, we have too look closer. 1504 // On non-embedix kernels, we have to look closer.
1504 bool is_zaurus = false; 1505 bool is_zaurus = false;
1505 QFile f ( "/proc/cpuinfo" ); 1506 QFile f ( "/proc/cpuinfo" );
1506 if ( f. open ( IO_ReadOnly ) ) { 1507 if ( f. open ( IO_ReadOnly ) ) {
1507 QString model; 1508 QString model;
1508 QFile f ( "/proc/cpuinfo" ); 1509 QFile f ( "/proc/cpuinfo" );
1509 1510
1510 QTextStream ts ( &f ); 1511 QTextStream ts ( &f );
1511 QString line; 1512 QString line;
1512 while( line = ts. readLine ( ) ) { 1513 while( line = ts. readLine ( ) ) {
1513 if ( line. left ( 8 ) == "Hardware" ) 1514 if ( line. left ( 8 ) == "Hardware" )
1514 break; 1515 break;
1515 } 1516 }
1516 int loc = line. find ( ":" ); 1517 int loc = line. find ( ":" );
1517 if ( loc != -1 ) 1518 if ( loc != -1 )
1518 model = line. mid ( loc + 2 ). simplifyWhiteSpace( ); 1519 model = line. mid ( loc + 2 ). simplifyWhiteSpace( );
1519 1520
1520 if ( model == "Sharp-Collie" 1521 if ( model == "Sharp-Collie"
1521 || model == "Collie" 1522 || model == "Collie"
1522 || model == "SHARP Corgi" 1523 || model == "SHARP Corgi"
1523 || model == "SHARP Shepherd" 1524 || model == "SHARP Shepherd"
1524 || model == "SHARP Poodle" 1525 || model == "SHARP Poodle"
1526 || model == "SHARP Husky" )
1525 ) 1527 )
1526 is_zaurus = true; 1528 is_zaurus = true;
1527 1529
1528 } 1530 }
1529 return is_zaurus; 1531 return is_zaurus;
1530} 1532}
1531 1533
1532 1534
1533void Zaurus::init ( ) 1535void Zaurus::init ( )
1534{ 1536{
1535 d-> m_vendorstr = "Sharp"; 1537 d-> m_vendorstr = "Sharp";
1536 d-> m_vendor = Vendor_Sharp; 1538 d-> m_vendor = Vendor_Sharp;
@@ -1583,46 +1585,49 @@ void Zaurus::init ( )
1583 QTextStream ts ( &f ); 1585 QTextStream ts ( &f );
1584 QString line; 1586 QString line;
1585 while( line = ts. readLine ( ) ) { 1587 while( line = ts. readLine ( ) ) {
1586 if ( line. left ( 8 ) == "Hardware" ) 1588 if ( line. left ( 8 ) == "Hardware" )
1587 break; 1589 break;
1588 } 1590 }
1589 int loc = line. find ( ":" ); 1591 int loc = line. find ( ":" );
1590 if ( loc != -1 ) 1592 if ( loc != -1 )
1591 model = line. mid ( loc + 2 ). simplifyWhiteSpace( ); 1593 model = line. mid ( loc + 2 ). simplifyWhiteSpace( );
1592 } 1594 }
1593 1595
1594 if ( model == "SHARP Corgi" ) { 1596 if ( model == "SHARP Corgi" ) {
1595 d-> m_model = Model_Zaurus_SLC700; 1597 d-> m_model = Model_Zaurus_SLC7x0;
1596 d-> m_modelstr = "Zaurus SL-C700"; 1598 d-> m_modelstr = "Zaurus SL-C700";
1597 } else if ( model == "SHARP Shepherd" ) { 1599 } else if ( model == "SHARP Shepherd" ) {
1598 d-> m_model = Model_Zaurus_SLC700; // Do we need a special type for the C750 ? (eilers) 1600 d-> m_model = Model_Zaurus_SLC7x0;
1599 d-> m_modelstr = "Zaurus SL-C750"; 1601 d-> m_modelstr = "Zaurus SL-C750";
1602 } else if ( model == "SHARP Husky" ) {
1603 d-> m_model = Model_Zaurus_SLC7x0;
1604 d-> m_modelstr = "Zaurus SL-C760";
1600 } else if ( model == "SHARP Poodle" ) { 1605 } else if ( model == "SHARP Poodle" ) {
1601 d-> m_model = Model_Zaurus_SLB600; 1606 d-> m_model = Model_Zaurus_SLB600;
1602 d-> m_modelstr = "Zaurus SL-B500 or SL-5600"; 1607 d-> m_modelstr = "Zaurus SL-B500 or SL-5600";
1603 } else if ( model == "Sharp-Collie" || model == "Collie" ) { 1608 } else if ( model == "Sharp-Collie" || model == "Collie" ) {
1604 d-> m_model = Model_Zaurus_SL5500; 1609 d-> m_model = Model_Zaurus_SL5500;
1605 d-> m_modelstr = "Zaurus SL-5500 or SL-5000d"; 1610 d-> m_modelstr = "Zaurus SL-5500 or SL-5000d";
1606 } else { 1611 } else {
1607 d-> m_model = Model_Zaurus_SL5500; 1612 d-> m_model = Model_Zaurus_SL5500;
1608 d-> m_modelstr = "Zaurus (Model unknown)"; 1613 d-> m_modelstr = "Zaurus (Model unknown)";
1609 } 1614 }
1610 1615
1611 bool flipstate = false; 1616 bool flipstate = false;
1612 switch ( d-> m_model ) { 1617 switch ( d-> m_model ) {
1613 case Model_Zaurus_SLA300: 1618 case Model_Zaurus_SLA300:
1614 d-> m_rotation = Rot0; 1619 d-> m_rotation = Rot0;
1615 break; 1620 break;
1616 case Model_Zaurus_SLC700: 1621 case Model_Zaurus_SLC7x0:
1617 // Note: need to 1) set flipstate based on physical screen orientation 1622 // Note: need to 1) set flipstate based on physical screen orientation
1618 // and 2) check to see if the user overrode the rotation direction 1623 // and 2) check to see if the user overrode the rotation direction
1619 // using appearance, and if so, remove that item from the Config to 1624 // using appearance, and if so, remove that item from the Config to
1620 // ensure the rotate applet flips us back to the previous state. 1625 // ensure the rotate applet flips us back to the previous state.
1621 if ( flipstate ) { 1626 if ( flipstate ) {
1622 // 480x640 1627 // 480x640
1623 d-> m_rotation = Rot0; 1628 d-> m_rotation = Rot0;
1624 d-> m_direction = CW; 1629 d-> m_direction = CW;
1625 } else { 1630 } else {
1626 // 640x480 1631 // 640x480
1627 d-> m_rotation = Rot270; 1632 d-> m_rotation = Rot270;
1628 d-> m_direction = CCW; 1633 d-> m_direction = CCW;
@@ -1639,25 +1644,25 @@ void Zaurus::init ( )
1639} 1644}
1640 1645
1641void Zaurus::initButtons ( ) 1646void Zaurus::initButtons ( )
1642{ 1647{
1643 if ( d-> m_buttons ) 1648 if ( d-> m_buttons )
1644 return; 1649 return;
1645 1650
1646 d-> m_buttons = new QValueList <ODeviceButton>; 1651 d-> m_buttons = new QValueList <ODeviceButton>;
1647 1652
1648 struct z_button * pz_buttons; 1653 struct z_button * pz_buttons;
1649 int buttoncount; 1654 int buttoncount;
1650 switch ( d-> m_model ) { 1655 switch ( d-> m_model ) {
1651 case Model_Zaurus_SLC700: 1656 case Model_Zaurus_SLC7x0:
1652 pz_buttons = z_buttons_c700; 1657 pz_buttons = z_buttons_c700;
1653 buttoncount = ARRAY_SIZE(z_buttons_c700); 1658 buttoncount = ARRAY_SIZE(z_buttons_c700);
1654 break; 1659 break;
1655 default: 1660 default:
1656 pz_buttons = z_buttons; 1661 pz_buttons = z_buttons;
1657 buttoncount = ARRAY_SIZE(z_buttons); 1662 buttoncount = ARRAY_SIZE(z_buttons);
1658 break; 1663 break;
1659 } 1664 }
1660 1665
1661 for ( int i = 0; i < buttoncount; i++ ) { 1666 for ( int i = 0; i < buttoncount; i++ ) {
1662 struct z_button *zb = pz_buttons + i; 1667 struct z_button *zb = pz_buttons + i;
1663 ODeviceButton b; 1668 ODeviceButton b;
@@ -1743,29 +1748,27 @@ typedef struct sharp_led_status {
1743#define APM_IOCGEVTSRC OD_IOR( 'A', 203, int ) 1748#define APM_IOCGEVTSRC OD_IOR( 'A', 203, int )
1744#define APM_IOCSEVTSRC OD_IORW( 'A', 204, int ) 1749#define APM_IOCSEVTSRC OD_IORW( 'A', 204, int )
1745#define APM_EVT_POWER_BUTTON (1 << 0) 1750#define APM_EVT_POWER_BUTTON (1 << 0)
1746 1751
1747#define FL_IOCTL_STEP_CONTRAST 100 1752#define FL_IOCTL_STEP_CONTRAST 100
1748 1753
1749 1754
1750void Zaurus::buzzer ( int sound ) 1755void Zaurus::buzzer ( int sound )
1751{ 1756{
1752#ifndef QT_NO_SOUND 1757#ifndef QT_NO_SOUND
1753 QString soundname; 1758 QString soundname;
1754 1759
1755 // Not all devices have real sound. But I expect 1760 // Not all devices have real sound
1756 // that Openzaurus now has a sound driver which 1761 if ( d->m_model == Model_Zaurus_SLC7x0
1757 // I will use instead the buzzer... 1762 || d->m_model == Model_Zaurus_SLB600 ){
1758 if ( ( d->m_model == Model_Zaurus_SLC700 )
1759 || d->m_system == System_OpenZaurus ){
1760 1763
1761 switch ( sound ){ 1764 switch ( sound ){
1762 case SHARP_BUZ_SCHEDULE_ALARM: 1765 case SHARP_BUZ_SCHEDULE_ALARM:
1763 soundname = "alarm"; 1766 soundname = "alarm";
1764 break; 1767 break;
1765 case SHARP_BUZ_TOUCHSOUND: 1768 case SHARP_BUZ_TOUCHSOUND:
1766 soundname = "touchsound"; 1769 soundname = "touchsound";
1767 break; 1770 break;
1768 case SHARP_BUZ_KEYSOUND: 1771 case SHARP_BUZ_KEYSOUND:
1769 soundname = "keysound"; 1772 soundname = "keysound";
1770 break; 1773 break;
1771 default: 1774 default: