summaryrefslogtreecommitdiff
path: root/libopie2/opiecore/device
authormickeyl <mickeyl>2005-02-04 17:59:22 (UTC)
committer mickeyl <mickeyl>2005-02-04 17:59:22 (UTC)
commitee4b479d3e0b67a4418914231c0ec38ef31b8290 (patch) (unidiff)
treeb4bde4c8544444d260f98619bf82a0c5ec8a584e /libopie2/opiecore/device
parentc0248a2c02381b5a5dce5c4543db6ff46486f2f1 (diff)
downloadopie-ee4b479d3e0b67a4418914231c0ec38ef31b8290.zip
opie-ee4b479d3e0b67a4418914231c0ec38ef31b8290.tar.gz
opie-ee4b479d3e0b67a4418914231c0ec38ef31b8290.tar.bz2
implement computing the hinge status for Zaurus w/ Kernel 2.6
Diffstat (limited to 'libopie2/opiecore/device') (more/less context) (show whitespace changes)
-rw-r--r--libopie2/opiecore/device/odevice_zaurus.cpp19
1 files changed, 17 insertions, 2 deletions
diff --git a/libopie2/opiecore/device/odevice_zaurus.cpp b/libopie2/opiecore/device/odevice_zaurus.cpp
index 780d130..a59e799 100644
--- a/libopie2/opiecore/device/odevice_zaurus.cpp
+++ b/libopie2/opiecore/device/odevice_zaurus.cpp
@@ -27,24 +27,25 @@
27 Boston, MA 02111-1307, USA. 27 Boston, MA 02111-1307, USA.
28*/ 28*/
29 29
30#include "odevice_zaurus.h" 30#include "odevice_zaurus.h"
31 31
32/* QT */ 32/* QT */
33#include <qapplication.h> 33#include <qapplication.h>
34#include <qfile.h> 34#include <qfile.h>
35#include <qtextstream.h> 35#include <qtextstream.h>
36#include <qwindowsystem_qws.h> 36#include <qwindowsystem_qws.h>
37 37
38/* OPIE */ 38/* OPIE */
39#include <opie2/oinputsystem.h>
39#include <qpe/config.h> 40#include <qpe/config.h>
40#include <qpe/resource.h> 41#include <qpe/resource.h>
41#include <qpe/sound.h> 42#include <qpe/sound.h>
42#include <qpe/qcopenvelope_qws.h> 43#include <qpe/qcopenvelope_qws.h>
43 44
44/* STD */ 45/* STD */
45#include <fcntl.h> 46#include <fcntl.h>
46#include <math.h> 47#include <math.h>
47#include <stdlib.h> 48#include <stdlib.h>
48#include <signal.h> 49#include <signal.h>
49#include <sys/ioctl.h> 50#include <sys/ioctl.h>
50#include <sys/time.h> 51#include <sys/time.h>
@@ -91,25 +92,34 @@ struct z_button z_buttons_c700 [] = {
91 { Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Home Button"), 92 { Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Home Button"),
92 "devicebuttons/z_home", 93 "devicebuttons/z_home",
93 "QPE/Launcher", "home()", 94 "QPE/Launcher", "home()",
94 "buttonsettings", "raise()" }, 95 "buttonsettings", "raise()" },
95 { Qt::Key_F11, QT_TRANSLATE_NOOP("Button", "Menu Button"), 96 { Qt::Key_F11, QT_TRANSLATE_NOOP("Button", "Menu Button"),
96 "devicebuttons/z_menu", 97 "devicebuttons/z_menu",
97 "QPE/TaskBar", "toggleMenu()", 98 "QPE/TaskBar", "toggleMenu()",
98 "QPE/TaskBar", "toggleStartMenu()" }, 99 "QPE/TaskBar", "toggleStartMenu()" },
99 { Qt::Key_F13, QT_TRANSLATE_NOOP("Button", "Mail Button"), 100 { Qt::Key_F13, QT_TRANSLATE_NOOP("Button", "Mail Button"),
100 "devicebuttons/z_mail", 101 "devicebuttons/z_mail",
101 "opiemail", "raise()", 102 "opiemail", "raise()",
102 "opiemail", "newMail()" }, 103 "opiemail", "newMail()" },
103 { Qt::Key_F14, QT_TRANSLATE_NOOP("Button", "Display Rotate"), 104
105 { Qt::Key_F15, QT_TRANSLATE_NOOP("Button", "Display Rotate"),
106 "devicebuttons/z_hinge",
107 "QPE/Rotation", "rotateDefault()",
108 "QPE/Dummy", "doNothing()" },
109 { Qt::Key_F16, QT_TRANSLATE_NOOP("Button", "Display Rotate"),
110 "devicebuttons/z_hinge",
111 "QPE/Rotation", "rotateDefault()",
112 "QPE/Dummy", "doNothing()" },
113 { Qt::Key_F17, QT_TRANSLATE_NOOP("Button", "Display Rotate"),
104 "devicebuttons/z_hinge", 114 "devicebuttons/z_hinge",
105 "QPE/Rotation", "rotateDefault()", 115 "QPE/Rotation", "rotateDefault()",
106 "QPE/Dummy", "doNothing()" }, 116 "QPE/Dummy", "doNothing()" },
107}; 117};
108 118
109// 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
110// class up into individual classes. We need three classes 120// class up into individual classes. We need three classes
111// 121//
112// Zaurus-Collie (SA-model w/ 320x240 lcd, for SL5500 and SL5000) 122// Zaurus-Collie (SA-model w/ 320x240 lcd, for SL5500 and SL5000)
113// Zaurus-Poodle (PXA-model w/ 320x240 lcd, for SL5600) 123// Zaurus-Poodle (PXA-model w/ 320x240 lcd, for SL5600)
114// 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)
115// Zaurus-Tosa (PXA-model w/ 480x640 lcd, for SL6000) 125// Zaurus-Tosa (PXA-model w/ 480x640 lcd, for SL6000)
@@ -578,16 +588,21 @@ OHingeStatus Zaurus::readHingeSensor() const
578 qDebug( "Zaurus::readHingeSensor() - result = %d", retval ); 588 qDebug( "Zaurus::readHingeSensor() - result = %d", retval );
579 return static_cast<OHingeStatus>( retval ); 589 return static_cast<OHingeStatus>( retval );
580 } 590 }
581 else 591 else
582 { 592 {
583 qWarning("Zaurus::readHingeSensor() - couldn't compute hinge status!" ); 593 qWarning("Zaurus::readHingeSensor() - couldn't compute hinge status!" );
584 return CASE_UNKNOWN; 594 return CASE_UNKNOWN;
585 } 595 }
586 } 596 }
587 } 597 }
588 else 598 else
589 { 599 {
590 qDebug( "Zaurus::readHingeSensor: ODevice handling for non-embedix kernels not yet implemented" ); 600 // corgi keyboard is event source 0 in OZ kernel 2.6
601 OInputDevice* keyboard = OInputSystem::instance()->device( "event0" );
602 if ( keyboard && keyboard->isHeld( OInputDevice::Key_KP0 ) ) return CASE_LANDSCAPE;
603 else if ( keyboard && keyboard->isHeld( OInputDevice::Key_KP1 ) ) return CASE_PORTRAIT;
604 else if ( keyboard && keyboard->isHeld( OInputDevice::Key_KP2 ) ) return CASE_CLOSED;
605 qWarning("Zaurus::readHingeSensor() - couldn't compute hinge status!" );
591 return CASE_UNKNOWN; 606 return CASE_UNKNOWN;
592 } 607 }
593} 608}