author | chicken <chicken> | 2003-11-02 20:12:26 (UTC) |
---|---|---|
committer | chicken <chicken> | 2003-11-02 20:12:26 (UTC) |
commit | 559f4034cd483845b107aa7180f56e701c1444e6 (patch) (side-by-side diff) | |
tree | ce5ed970a0cb49429b39d72173953adb24280a4e | |
parent | 1b73bc0cb5c1d6fe7363d7bf30d8ca1a467e3e8d (diff) | |
download | opie-559f4034cd483845b107aa7180f56e701c1444e6.zip opie-559f4034cd483845b107aa7180f56e701c1444e6.tar.gz opie-559f4034cd483845b107aa7180f56e701c1444e6.tar.bz2 |
add iPAQ H5xxx support
-rw-r--r-- | libopie/odevice.cpp | 27 | ||||
-rw-r--r-- | libopie/odevice.h | 1 |
2 files changed, 18 insertions, 10 deletions
diff --git a/libopie/odevice.cpp b/libopie/odevice.cpp index 13b4330..3edf8e7 100644 --- a/libopie/odevice.cpp +++ b/libopie/odevice.cpp @@ -100,25 +100,25 @@ public: protected: virtual bool filter ( int unicode, int keycode, int modifiers, bool isPress, bool autoRepeat ); virtual void timerEvent ( QTimerEvent *te ); int m_power_timer; OLedState m_leds [2]; }; class Jornada : public ODevice { protected: virtual void init ( ); - virtual void initButtons ( ); + //virtual void initButtons ( ); public: virtual bool setSoftSuspend ( bool soft ); virtual bool setDisplayBrightness ( int b ); virtual int displayBrightnessResolution ( ) const; static bool isJornada(); }; class Zaurus : public ODevice { protected: virtual void init ( ); virtual void initButtons ( ); @@ -198,50 +198,50 @@ protected: }; struct i_button { uint model; Qt::Key code; char *utext; char *pix; char *fpressedservice; char *fpressedaction; char *fheldservice; char *fheldaction; } ipaq_buttons [] = { - { Model_iPAQ_H31xx | Model_iPAQ_H36xx | Model_iPAQ_H37xx | Model_iPAQ_H38xx | Model_iPAQ_H39xx, + { Model_iPAQ_H31xx | Model_iPAQ_H36xx | Model_iPAQ_H37xx | Model_iPAQ_H38xx | Model_iPAQ_H39xx | Model_iPAQ_H5xxx, Qt::Key_F9, QT_TRANSLATE_NOOP("Button", "Calendar Button"), "devicebuttons/ipaq_calendar", "datebook", "nextView()", "today", "raise()" }, - { Model_iPAQ_H31xx | Model_iPAQ_H36xx | Model_iPAQ_H37xx | Model_iPAQ_H38xx | Model_iPAQ_H39xx, + { Model_iPAQ_H31xx | Model_iPAQ_H36xx | Model_iPAQ_H37xx | Model_iPAQ_H38xx | Model_iPAQ_H39xx | Model_iPAQ_H5xxx, Qt::Key_F10, QT_TRANSLATE_NOOP("Button", "Contacts Button"), "devicebuttons/ipaq_contact", "addressbook", "raise()", "addressbook", "beamBusinessCard()" }, { Model_iPAQ_H31xx | Model_iPAQ_H36xx | Model_iPAQ_H37xx, Qt::Key_F11, QT_TRANSLATE_NOOP("Button", "Menu Button"), "devicebuttons/ipaq_menu", "QPE/TaskBar", "toggleMenu()", "QPE/TaskBar", "toggleStartMenu()" }, - { Model_iPAQ_H38xx | Model_iPAQ_H39xx, + { Model_iPAQ_H38xx | Model_iPAQ_H39xx | Model_iPAQ_H5xxx, Qt::Key_F13, QT_TRANSLATE_NOOP("Button", "Mail Button"), "devicebuttons/ipaq_mail", "mail", "raise()", "mail", "newMail()" }, - { Model_iPAQ_H31xx | Model_iPAQ_H36xx | Model_iPAQ_H37xx | Model_iPAQ_H38xx | Model_iPAQ_H39xx, + { Model_iPAQ_H31xx | Model_iPAQ_H36xx | Model_iPAQ_H37xx | Model_iPAQ_H38xx | Model_iPAQ_H39xx | Model_iPAQ_H5xxx, Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Home Button"), "devicebuttons/ipaq_home", "QPE/Launcher", "home()", "buttonsettings", "raise()" }, - { Model_iPAQ_H31xx | Model_iPAQ_H36xx | Model_iPAQ_H37xx | Model_iPAQ_H38xx | Model_iPAQ_H39xx, + { Model_iPAQ_H31xx | Model_iPAQ_H36xx | Model_iPAQ_H37xx | Model_iPAQ_H38xx | Model_iPAQ_H39xx | Model_iPAQ_H5xxx, Qt::Key_F24, QT_TRANSLATE_NOOP("Button", "Record Button"), "devicebuttons/ipaq_record", "QPE/VMemo", "toggleRecord()", "sound", "raise()" }, }; struct z_button { Qt::Key code; char *utext; char *pix; char *fpressedservice; char *fpressedaction; @@ -1109,42 +1109,46 @@ void iPAQ::init ( ) d-> m_modelstr = "H" + ts. readLine ( ); if ( d-> m_modelstr == "H3100" ) d-> m_model = Model_iPAQ_H31xx; else if ( d-> m_modelstr == "H3600" ) d-> m_model = Model_iPAQ_H36xx; else if ( d-> m_modelstr == "H3700" ) d-> m_model = Model_iPAQ_H37xx; else if ( d-> m_modelstr == "H3800" ) d-> m_model = Model_iPAQ_H38xx; else if ( d-> m_modelstr == "H3900" ) d-> m_model = Model_iPAQ_H39xx; + else if ( d-> m_modelstr == "H5400" ) + d-> m_model = Model_iPAQ_H5xxx; else d-> m_model = Model_Unknown; f. close ( ); } switch ( d-> m_model ) { case Model_iPAQ_H31xx: case Model_iPAQ_H38xx: d-> m_rotation = Rot90; break; case Model_iPAQ_H36xx: case Model_iPAQ_H37xx: case Model_iPAQ_H39xx: default: d-> m_rotation = Rot270; break; - } + case Model_iPAQ_H5xxx: + d-> m_rotation = Rot0; + } f. setName ( "/etc/familiar-version" ); if ( f. open ( IO_ReadOnly )) { d-> m_systemstr = "Familiar"; d-> m_system = System_Familiar; QTextStream ts ( &f ); d-> m_sysverstr = ts. readLine ( ). mid ( 10 ); f. close ( ); } else { f. setName ( "/etc/oz_version" ); @@ -1283,25 +1287,26 @@ bool iPAQ::setLedState ( OLed l, OLedState st ) return false; } bool iPAQ::filter ( int /*unicode*/, int keycode, int modifiers, bool isPress, bool autoRepeat ) { int newkeycode = keycode; switch ( keycode ) { // H38xx/H39xx have no "Q" key anymore - this is now the Mail key case HardKey_Menu: { if (( d-> m_model == Model_iPAQ_H38xx ) || - ( d-> m_model == Model_iPAQ_H39xx )) { + ( d-> m_model == Model_iPAQ_H39xx ) || + ( d-> m_model == Model_iPAQ_H5xxx)) { newkeycode = HardKey_Mail; } break; } // Rotate cursor keys 180° case Key_Left : case Key_Right: case Key_Up : case Key_Down : { if (( d-> m_model == Model_iPAQ_H31xx ) || ( d-> m_model == Model_iPAQ_H38xx )) { @@ -1427,24 +1432,26 @@ bool iPAQ::setDisplayBrightness ( int bright ) int iPAQ::displayBrightnessResolution ( ) const { switch ( model ( )) { case Model_iPAQ_H31xx: case Model_iPAQ_H36xx: case Model_iPAQ_H37xx: return 128; // really 256, but >128 could damage the LCD case Model_iPAQ_H38xx: case Model_iPAQ_H39xx: return 64; + case Model_iPAQ_H5xxx: + return 255; default: return 2; } } bool iPAQ::hasLightSensor ( ) const { return true; } @@ -2507,25 +2514,25 @@ void Jornada::init ( ) QFile f ( "/etc/familiar-version" ); f. setName ( "/etc/familiar-version" ); if ( f. open ( IO_ReadOnly )) { QTextStream ts ( &f ); d-> m_sysverstr = ts. readLine ( ). mid ( 10 ); f. close ( ); } } - +#if 0 void Jornada::initButtons ( ) { if ( d-> m_buttons ) return; // Simulation uses iPAQ 3660 device buttons qDebug ( "init Buttons" ); d-> m_buttons = new QValueList <ODeviceButton>; for ( uint i = 0; i < ( sizeof( ipaq_buttons ) / sizeof( i_button )); i++ ) { i_button *ib = ipaq_buttons + i; @@ -2536,25 +2543,25 @@ void Jornada::initButtons ( ) b. setUserText ( QObject::tr ( "Button", ib-> utext )); b. setPixmap ( Resource::loadPixmap ( ib-> pix )); b. setFactoryPresetPressedAction ( OQCopMessage ( makeChannel ( ib-> fpressedservice ), ib-> fpressedaction )); b. setFactoryPresetHeldAction ( OQCopMessage ( makeChannel ( ib-> fheldservice ), ib-> fheldaction )); d-> m_buttons-> append ( b ); } } reloadButtonMapping ( ); QCopChannel *sysch = new QCopChannel ( "QPE/System", this ); connect ( sysch, SIGNAL( received( const QCString &, const QByteArray & )), this, SLOT( systemMessage ( const QCString &, const QByteArray & ))); } - +#endif int Jornada::displayBrightnessResolution ( ) const { } bool Jornada::setDisplayBrightness ( int bright ) { bool res = false; int fd; if ( bright > 255 ) bright = 255; if ( bright < 0 ) diff --git a/libopie/odevice.h b/libopie/odevice.h index 35e3eff..46f1614 100644 --- a/libopie/odevice.h +++ b/libopie/odevice.h @@ -41,24 +41,25 @@ enum OModel { Model_Unknown, // = 0 Model_Series_Mask = 0xff000000, Model_iPAQ = ( 1 << 24 ), Model_iPAQ_All = ( Model_iPAQ | 0xffffff ), Model_iPAQ_H31xx = ( Model_iPAQ | 0x000001 ), Model_iPAQ_H36xx = ( Model_iPAQ | 0x000002 ), Model_iPAQ_H37xx = ( Model_iPAQ | 0x000004 ), Model_iPAQ_H38xx = ( Model_iPAQ | 0x000008 ), Model_iPAQ_H39xx = ( Model_iPAQ | 0x000010 ), + Model_iPAQ_H5xxx = ( Model_iPAQ | 0x000011 ), Model_Jornada = ( 6 << 24 ), Model_Jornada_56x = ( Model_Jornada | 0x000001 ), Model_Zaurus = ( 2 << 24 ), Model_Zaurus_SL5000 = ( Model_Zaurus | 0x000001 ), Model_Zaurus_SL5500 = ( Model_Zaurus | 0x000002 ), Model_Zaurus_SLA300 = ( Model_Zaurus | 0x000003 ), Model_Zaurus_SLB600 = ( Model_Zaurus | 0x000004 ), Model_Zaurus_SLC700 = ( Model_Zaurus | 0x000005 ), |