author | eilers <eilers> | 2003-11-17 17:27:44 (UTC) |
---|---|---|
committer | eilers <eilers> | 2003-11-17 17:27:44 (UTC) |
commit | e8bba52dc9443d3aadcc2c221fa62ba37ea5c712 (patch) (unidiff) | |
tree | ddd09027e169cecb392fb7d956f55631d5bf4ef7 | |
parent | 2e6030553ecc21845ebb9987dffd6c252760a94d (diff) | |
download | opie-e8bba52dc9443d3aadcc2c221fa62ba37ea5c712.zip opie-e8bba52dc9443d3aadcc2c221fa62ba37ea5c712.tar.gz opie-e8bba52dc9443d3aadcc2c221fa62ba37ea5c712.tar.bz2 |
Merging the corgie-patches from Branch manually.. (no cvs -j would caused
a big mess .. ;) )
Changed the keysound handling for zaurus: Just all C7x0 and the 5600 will
use the sounddevice.. All other will use the old /dev/sharp_buz device..
-rw-r--r-- | libopie/odevice.cpp | 23 |
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 | |||
@@ -1107,64 +1107,65 @@ void iPAQ::init ( ) | |||
1107 | 1107 | ||
1108 | if ( f. open ( IO_ReadOnly )) { | 1108 | if ( f. open ( IO_ReadOnly )) { |
1109 | QTextStream ts ( &f ); | 1109 | QTextStream ts ( &f ); |
1110 | 1110 | ||
1111 | d-> m_modelstr = "H" + ts. readLine ( ); | 1111 | d-> m_modelstr = "H" + ts. readLine ( ); |
1112 | 1112 | ||
1113 | if ( d-> m_modelstr == "H3100" ) | 1113 | if ( d-> m_modelstr == "H3100" ) |
1114 | d-> m_model = Model_iPAQ_H31xx; | 1114 | d-> m_model = Model_iPAQ_H31xx; |
1115 | else if ( d-> m_modelstr == "H3600" ) | 1115 | else if ( d-> m_modelstr == "H3600" ) |
1116 | d-> m_model = Model_iPAQ_H36xx; | 1116 | d-> m_model = Model_iPAQ_H36xx; |
1117 | else if ( d-> m_modelstr == "H3700" ) | 1117 | else if ( d-> m_modelstr == "H3700" ) |
1118 | d-> m_model = Model_iPAQ_H37xx; | 1118 | d-> m_model = Model_iPAQ_H37xx; |
1119 | else if ( d-> m_modelstr == "H3800" ) | 1119 | else if ( d-> m_modelstr == "H3800" ) |
1120 | d-> m_model = Model_iPAQ_H38xx; | 1120 | d-> m_model = Model_iPAQ_H38xx; |
1121 | else if ( d-> m_modelstr == "H3900" ) | 1121 | else if ( d-> m_modelstr == "H3900" ) |
1122 | d-> m_model = Model_iPAQ_H39xx; | 1122 | d-> m_model = Model_iPAQ_H39xx; |
1123 | else if ( d-> m_modelstr == "H5400" ) | 1123 | else if ( d-> m_modelstr == "H5400" ) |
1124 | d-> m_model = Model_iPAQ_H5xxx; | 1124 | d-> m_model = Model_iPAQ_H5xxx; |
1125 | else | 1125 | else |
1126 | d-> m_model = Model_Unknown; | 1126 | d-> m_model = Model_Unknown; |
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 | ||
1151 | QTextStream ts ( &f ); | 1152 | QTextStream ts ( &f ); |
1152 | d-> m_sysverstr = ts. readLine ( ). mid ( 10 ); | 1153 | d-> m_sysverstr = ts. readLine ( ). mid ( 10 ); |
1153 | 1154 | ||
1154 | f. close ( ); | 1155 | f. close ( ); |
1155 | } else { | 1156 | } else { |
1156 | f. setName ( "/etc/oz_version" ); | 1157 | f. setName ( "/etc/oz_version" ); |
1157 | 1158 | ||
1158 | if ( f. open ( IO_ReadOnly )) { | 1159 | if ( f. open ( IO_ReadOnly )) { |
1159 | d-> m_systemstr = "OpenEmbedded/iPaq"; | 1160 | d-> m_systemstr = "OpenEmbedded/iPaq"; |
1160 | d-> m_system = System_Familiar; | 1161 | d-> m_system = System_Familiar; |
1161 | 1162 | ||
1162 | QTextStream ts ( &f ); | 1163 | QTextStream ts ( &f ); |
1163 | ts.setDevice ( &f ); | 1164 | ts.setDevice ( &f ); |
1164 | d-> m_sysverstr = ts. readLine ( ); | 1165 | d-> m_sysverstr = ts. readLine ( ); |
1165 | f. close ( ); | 1166 | f. close ( ); |
1166 | } | 1167 | } |
1167 | } | 1168 | } |
1168 | 1169 | ||
1169 | 1170 | ||
1170 | 1171 | ||
@@ -1471,86 +1472,87 @@ int iPAQ::readLightSensor ( ) | |||
1471 | buffer [4] = 0; | 1472 | buffer [4] = 0; |
1472 | val = ::strtol ( buffer + 2, &endptr, 16 ); | 1473 | val = ::strtol ( buffer + 2, &endptr, 16 ); |
1473 | 1474 | ||
1474 | if ( *endptr != 0 ) | 1475 | if ( *endptr != 0 ) |
1475 | val = -1; | 1476 | val = -1; |
1476 | } | 1477 | } |
1477 | ::close ( fd ); | 1478 | ::close ( fd ); |
1478 | } | 1479 | } |
1479 | 1480 | ||
1480 | return val; | 1481 | return val; |
1481 | } | 1482 | } |
1482 | 1483 | ||
1483 | int iPAQ::lightSensorResolution ( ) const | 1484 | int iPAQ::lightSensorResolution ( ) const |
1484 | { | 1485 | { |
1485 | return 256; | 1486 | return 256; |
1486 | } | 1487 | } |
1487 | 1488 | ||
1488 | /************************************************** | 1489 | /************************************************** |
1489 | * | 1490 | * |
1490 | * Zaurus | 1491 | * Zaurus |
1491 | * | 1492 | * |
1492 | **************************************************/ | 1493 | **************************************************/ |
1493 | 1494 | ||
1494 | // Check whether this device is the sharp zaurus.. | 1495 | // Check whether this device is the sharp zaurus.. |
1495 | bool Zaurus::isZaurus() | 1496 | bool 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 | ||
1533 | void Zaurus::init ( ) | 1535 | void 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; |
1537 | m_embedix = true; // Not openzaurus means: It has an embedix kernel ! | 1539 | m_embedix = true; // Not openzaurus means: It has an embedix kernel ! |
1538 | 1540 | ||
1539 | // QFile f ( "/proc/filesystems" ); | 1541 | // QFile f ( "/proc/filesystems" ); |
1540 | QString model; | 1542 | QString model; |
1541 | 1543 | ||
1542 | // It isn't a good idea to check the system configuration to | 1544 | // It isn't a good idea to check the system configuration to |
1543 | // detect the distribution ! | 1545 | // detect the distribution ! |
1544 | // Otherwise it may happen that any other distribution is detected as openzaurus, just | 1546 | // Otherwise it may happen that any other distribution is detected as openzaurus, just |
1545 | // because it uses a jffs2 filesystem.. | 1547 | // because it uses a jffs2 filesystem.. |
1546 | // (eilers) | 1548 | // (eilers) |
1547 | // if ( f. open ( IO_ReadOnly ) && ( QTextStream ( &f ). read ( ). find ( "\tjffs2\n" ) >= 0 )) { | 1549 | // if ( f. open ( IO_ReadOnly ) && ( QTextStream ( &f ). read ( ). find ( "\tjffs2\n" ) >= 0 )) { |
1548 | QFile f ("/etc/oz_version"); | 1550 | QFile f ("/etc/oz_version"); |
1549 | if ( f.exists() ){ | 1551 | if ( f.exists() ){ |
1550 | d-> m_vendorstr = "OpenZaurus Team"; | 1552 | d-> m_vendorstr = "OpenZaurus Team"; |
1551 | d-> m_systemstr = "OpenZaurus"; | 1553 | d-> m_systemstr = "OpenZaurus"; |
1552 | d-> m_system = System_OpenZaurus; | 1554 | d-> m_system = System_OpenZaurus; |
1553 | 1555 | ||
1554 | if ( f. open ( IO_ReadOnly )) { | 1556 | if ( f. open ( IO_ReadOnly )) { |
1555 | QTextStream ts ( &f ); | 1557 | QTextStream ts ( &f ); |
1556 | d-> m_sysverstr = ts. readLine ( );//. mid ( 10 ); | 1558 | d-> m_sysverstr = ts. readLine ( );//. mid ( 10 ); |
@@ -1563,121 +1565,124 @@ void Zaurus::init ( ) | |||
1563 | QString line; | 1565 | QString line; |
1564 | if ( f.open(IO_ReadOnly, uname) ) { | 1566 | if ( f.open(IO_ReadOnly, uname) ) { |
1565 | QTextStream ts ( &f ); | 1567 | QTextStream ts ( &f ); |
1566 | line = ts. readLine ( ); | 1568 | line = ts. readLine ( ); |
1567 | int loc = line. find ( "embedix" ); | 1569 | int loc = line. find ( "embedix" ); |
1568 | if ( loc != -1 ) | 1570 | if ( loc != -1 ) |
1569 | m_embedix = true; | 1571 | m_embedix = true; |
1570 | else | 1572 | else |
1571 | m_embedix = false; | 1573 | m_embedix = false; |
1572 | f. close ( ); | 1574 | f. close ( ); |
1573 | } | 1575 | } |
1574 | pclose(uname); | 1576 | pclose(uname); |
1575 | } | 1577 | } |
1576 | else { | 1578 | else { |
1577 | d-> m_systemstr = "Zaurus"; | 1579 | d-> m_systemstr = "Zaurus"; |
1578 | d-> m_system = System_Zaurus; | 1580 | d-> m_system = System_Zaurus; |
1579 | } | 1581 | } |
1580 | 1582 | ||
1581 | f. setName ( "/proc/cpuinfo" ); | 1583 | f. setName ( "/proc/cpuinfo" ); |
1582 | if ( f. open ( IO_ReadOnly ) ) { | 1584 | if ( f. open ( IO_ReadOnly ) ) { |
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; |
1629 | } | 1634 | } |
1630 | break; | 1635 | break; |
1631 | case Model_Zaurus_SLB600: | 1636 | case Model_Zaurus_SLB600: |
1632 | case Model_Zaurus_SL5500: | 1637 | case Model_Zaurus_SL5500: |
1633 | case Model_Zaurus_SL5000: | 1638 | case Model_Zaurus_SL5000: |
1634 | default: | 1639 | default: |
1635 | d-> m_rotation = Rot270; | 1640 | d-> m_rotation = Rot270; |
1636 | break; | 1641 | break; |
1637 | } | 1642 | } |
1638 | m_leds [0] = Led_Off; | 1643 | m_leds [0] = Led_Off; |
1639 | } | 1644 | } |
1640 | 1645 | ||
1641 | void Zaurus::initButtons ( ) | 1646 | void 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; |
1664 | 1669 | ||
1665 | b. setKeycode ( zb-> code ); | 1670 | b. setKeycode ( zb-> code ); |
1666 | b. setUserText ( QObject::tr ( "Button", zb-> utext )); | 1671 | b. setUserText ( QObject::tr ( "Button", zb-> utext )); |
1667 | b. setPixmap ( Resource::loadPixmap ( zb-> pix )); | 1672 | b. setPixmap ( Resource::loadPixmap ( zb-> pix )); |
1668 | b. setFactoryPresetPressedAction ( OQCopMessage ( makeChannel ( zb-> fpressedservice ), | 1673 | b. setFactoryPresetPressedAction ( OQCopMessage ( makeChannel ( zb-> fpressedservice ), |
1669 | zb-> fpressedaction )); | 1674 | zb-> fpressedaction )); |
1670 | b. setFactoryPresetHeldAction ( OQCopMessage ( makeChannel ( zb-> fheldservice ), | 1675 | b. setFactoryPresetHeldAction ( OQCopMessage ( makeChannel ( zb-> fheldservice ), |
1671 | zb-> fheldaction )); | 1676 | zb-> fheldaction )); |
1672 | 1677 | ||
1673 | d-> m_buttons-> append ( b ); | 1678 | d-> m_buttons-> append ( b ); |
1674 | } | 1679 | } |
1675 | 1680 | ||
1676 | reloadButtonMapping ( ); | 1681 | reloadButtonMapping ( ); |
1677 | 1682 | ||
1678 | QCopChannel *sysch = new QCopChannel ( "QPE/System", this ); | 1683 | QCopChannel *sysch = new QCopChannel ( "QPE/System", this ); |
1679 | connect ( sysch, SIGNAL( received( const QCString &, const QByteArray & )), | 1684 | connect ( sysch, SIGNAL( received( const QCString &, const QByteArray & )), |
1680 | this, SLOT( systemMessage ( const QCString &, const QByteArray & ))); | 1685 | this, SLOT( systemMessage ( const QCString &, const QByteArray & ))); |
1681 | } | 1686 | } |
1682 | 1687 | ||
1683 | #include <unistd.h> | 1688 | #include <unistd.h> |
@@ -1723,69 +1728,67 @@ void Zaurus::initButtons ( ) | |||
1723 | //#define SHARP_BUZ_GOT_PHONE_CALL 13 /* phone call sound */ | 1728 | //#define SHARP_BUZ_GOT_PHONE_CALL 13 /* phone call sound */ |
1724 | //#define SHARP_BUZ_GOT_MAIL 14 /* mail sound */ | 1729 | //#define SHARP_BUZ_GOT_MAIL 14 /* mail sound */ |
1725 | // | 1730 | // |
1726 | 1731 | ||
1727 | #defineSHARP_LED_IOCTL_START (SHARP_DEV_IOCTL_COMMAND_START) | 1732 | #defineSHARP_LED_IOCTL_START (SHARP_DEV_IOCTL_COMMAND_START) |
1728 | #define SHARP_LED_SETSTATUS (SHARP_LED_IOCTL_START+1) | 1733 | #define SHARP_LED_SETSTATUS (SHARP_LED_IOCTL_START+1) |
1729 | 1734 | ||
1730 | typedef struct sharp_led_status { | 1735 | typedef struct sharp_led_status { |
1731 | int which; /* select which LED status is wanted. */ | 1736 | int which; /* select which LED status is wanted. */ |
1732 | int status; /* set new led status if you call SHARP_LED_SETSTATUS */ | 1737 | int status; /* set new led status if you call SHARP_LED_SETSTATUS */ |
1733 | } sharp_led_status; | 1738 | } sharp_led_status; |
1734 | 1739 | ||
1735 | #define SHARP_LED_MAIL_EXISTS 9 /* mail status (exists or not) */ | 1740 | #define SHARP_LED_MAIL_EXISTS 9 /* mail status (exists or not) */ |
1736 | 1741 | ||
1737 | #define LED_MAIL_NO_UNREAD_MAIL 0 /* for SHARP_LED_MAIL_EXISTS */ | 1742 | #define LED_MAIL_NO_UNREAD_MAIL 0 /* for SHARP_LED_MAIL_EXISTS */ |
1738 | #define LED_MAIL_NEWMAIL_EXISTS 1 /* for SHARP_LED_MAIL_EXISTS */ | 1743 | #define LED_MAIL_NEWMAIL_EXISTS 1 /* for SHARP_LED_MAIL_EXISTS */ |
1739 | #define LED_MAIL_UNREAD_MAIL_EX 2 /* for SHARP_LED_MAIL_EXISTS */ | 1744 | #define LED_MAIL_UNREAD_MAIL_EX 2 /* for SHARP_LED_MAIL_EXISTS */ |
1740 | 1745 | ||
1741 | // #include <asm/sharp_apm.h> // including kernel headers is evil ... | 1746 | // #include <asm/sharp_apm.h> // including kernel headers is evil ... |
1742 | 1747 | ||
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 | ||
1750 | void Zaurus::buzzer ( int sound ) | 1755 | void 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: |
1772 | soundname = "alarm"; | 1775 | soundname = "alarm"; |
1773 | 1776 | ||
1774 | } | 1777 | } |
1775 | } | 1778 | } |
1776 | 1779 | ||
1777 | // If a soundname is defined, we expect that this device has | 1780 | // If a soundname is defined, we expect that this device has |
1778 | // sound capabilities.. Otherwise we expect to have the buzzer | 1781 | // sound capabilities.. Otherwise we expect to have the buzzer |
1779 | // device.. | 1782 | // device.. |
1780 | if ( !soundname.isEmpty() ){ | 1783 | if ( !soundname.isEmpty() ){ |
1781 | int fd; | 1784 | int fd; |
1782 | int vol; | 1785 | int vol; |
1783 | bool vol_reset = false; | 1786 | bool vol_reset = false; |
1784 | 1787 | ||
1785 | Sound snd ( soundname ); | 1788 | Sound snd ( soundname ); |
1786 | 1789 | ||
1787 | if (( fd = ::open ( "/dev/sound/mixer", O_RDWR )) >= 0 ) { | 1790 | if (( fd = ::open ( "/dev/sound/mixer", O_RDWR )) >= 0 ) { |
1788 | if ( ::ioctl ( fd, MIXER_READ( 0 ), &vol ) >= 0 ) { | 1791 | if ( ::ioctl ( fd, MIXER_READ( 0 ), &vol ) >= 0 ) { |
1789 | Config cfg ( "qpe" ); | 1792 | Config cfg ( "qpe" ); |
1790 | cfg. setGroup ( "Volume" ); | 1793 | cfg. setGroup ( "Volume" ); |
1791 | 1794 | ||