summaryrefslogtreecommitdiff
path: root/libopie2
authormickeyl <mickeyl>2006-08-02 19:12:38 (UTC)
committer mickeyl <mickeyl>2006-08-02 19:12:38 (UTC)
commitcc2f5d3f3173be64d177ad827864b7da95343a1d (patch) (unidiff)
tree8c278fc6b108667e3fdc2b98d91dd5377756c95a /libopie2
parent3e77cb64e7ca0d89656e6665c1007bff6b34d609 (diff)
downloadopie-cc2f5d3f3173be64d177ad827864b7da95343a1d.zip
opie-cc2f5d3f3173be64d177ad827864b7da95343a1d.tar.gz
opie-cc2f5d3f3173be64d177ad827864b7da95343a1d.tar.bz2
improve ipaq 2200, 4xxx, 4700 support. patches courtesy R.Wagner, E.Hovland, P.Sokolovsky. thanks guys
Diffstat (limited to 'libopie2') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiecore/device/odevice.h1
-rw-r--r--libopie2/opiecore/device/odevice_ipaq.cpp47
2 files changed, 42 insertions, 6 deletions
diff --git a/libopie2/opiecore/device/odevice.h b/libopie2/opiecore/device/odevice.h
index c2fa411..a8362cd 100644
--- a/libopie2/opiecore/device/odevice.h
+++ b/libopie2/opiecore/device/odevice.h
@@ -72,4 +72,5 @@ enum OModel {
72 Model_iPAQ_H1940 = ( Model_iPAQ | 0x0009 ), 72 Model_iPAQ_H1940 = ( Model_iPAQ | 0x0009 ),
73 Model_iPAQ_HX4700 = ( Model_iPAQ | 0x000A ), 73 Model_iPAQ_HX4700 = ( Model_iPAQ | 0x000A ),
74 Model_iPAQ_H4xxx = ( Model_iPAQ | 0x000b ),
74 Model_Jornada = ( 6 << 16 ), 75 Model_Jornada = ( 6 << 16 ),
75 Model_Jornada_56x = ( Model_Jornada | 0x0001 ), 76 Model_Jornada_56x = ( Model_Jornada | 0x0001 ),
diff --git a/libopie2/opiecore/device/odevice_ipaq.cpp b/libopie2/opiecore/device/odevice_ipaq.cpp
index 63b60a7..00939bf 100644
--- a/libopie2/opiecore/device/odevice_ipaq.cpp
+++ b/libopie2/opiecore/device/odevice_ipaq.cpp
@@ -86,10 +86,10 @@ typedef struct {
86 86
87struct i_button ipaq_buttons [] = { 87struct i_button ipaq_buttons [] = {
88 { Model_iPAQ_H31xx | Model_iPAQ_H36xx | Model_iPAQ_H37xx | Model_iPAQ_H38xx | Model_iPAQ_H39xx | Model_iPAQ_H5xxx | Model_iPAQ_H191x, 88 { Model_iPAQ_H31xx | Model_iPAQ_H36xx | Model_iPAQ_H37xx | Model_iPAQ_H38xx | Model_iPAQ_H39xx | Model_iPAQ_H5xxx | Model_iPAQ_H191x | Model_iPAQ_H22xx | Model_iPAQ_HX4700 | Model_iPAQ_H4xxx,
89 Qt::Key_F9, QT_TRANSLATE_NOOP("Button", "Calendar Button"), 89 Qt::Key_F9, QT_TRANSLATE_NOOP("Button", "Calendar Button"),
90 "devicebuttons/ipaq_calendar", 90 "devicebuttons/ipaq_calendar",
91 "datebook", "nextView()", 91 "datebook", "nextView()",
92 "today", "raise()" }, 92 "today", "raise()" },
93 { Model_iPAQ_H31xx | Model_iPAQ_H36xx | Model_iPAQ_H37xx | Model_iPAQ_H38xx | Model_iPAQ_H39xx | Model_iPAQ_H5xxx | Model_iPAQ_H191x, 93 { Model_iPAQ_H31xx | Model_iPAQ_H36xx | Model_iPAQ_H37xx | Model_iPAQ_H38xx | Model_iPAQ_H39xx | Model_iPAQ_H5xxx | Model_iPAQ_H191x | Model_iPAQ_H22xx | Model_iPAQ_HX4700 | Model_iPAQ_H4xxx,
94 Qt::Key_F10, QT_TRANSLATE_NOOP("Button", "Contacts Button"), 94 Qt::Key_F10, QT_TRANSLATE_NOOP("Button", "Contacts Button"),
95 "devicebuttons/ipaq_contact", 95 "devicebuttons/ipaq_contact",
@@ -106,5 +106,5 @@ struct i_button ipaq_buttons [] = {
106 "opiemail", "raise()", 106 "opiemail", "raise()",
107 "opiemail", "newMail()" }, 107 "opiemail", "newMail()" },
108 { Model_iPAQ_H31xx | Model_iPAQ_H36xx | Model_iPAQ_H37xx | Model_iPAQ_H38xx | Model_iPAQ_H39xx | Model_iPAQ_H5xxx | Model_iPAQ_H191x, 108 { Model_iPAQ_H31xx | Model_iPAQ_H36xx | Model_iPAQ_H37xx | Model_iPAQ_H38xx | Model_iPAQ_H39xx | Model_iPAQ_H5xxx | Model_iPAQ_H191x | Model_iPAQ_H4xxx,
109 Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Home Button"), 109 Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Home Button"),
110 "devicebuttons/ipaq_home", 110 "devicebuttons/ipaq_home",
@@ -117,10 +117,10 @@ struct i_button ipaq_buttons [] = {
117 "sound", "raise()" }, 117 "sound", "raise()" },
118 118
119 { Model_iPAQ_H191x, 119 { Model_iPAQ_H191x | Model_iPAQ_H4xxx,
120 Qt::Key_F8, QT_TRANSLATE_NOOP("Button", "Mail Button"), 120 Qt::Key_F8, QT_TRANSLATE_NOOP("Button", "Mail Button"),
121 "devicebuttons/ipaq_mail", 121 "devicebuttons/ipaq_mail",
122 "opiemail", "raise()", 122 "opiemail", "raise()",
123 "opiemail", "newMail()" }, 123 "opiemail", "newMail()" },
124 { Model_iPAQ_H191x, 124 { Model_iPAQ_H191x | Model_iPAQ_H4xxx,
125 Qt::Key_F7, QT_TRANSLATE_NOOP("Button", "Record Button"), 125 Qt::Key_F7, QT_TRANSLATE_NOOP("Button", "Record Button"),
126 "devicebuttons/ipaq_record", 126 "devicebuttons/ipaq_record",
@@ -128,4 +128,32 @@ struct i_button ipaq_buttons [] = {
128 "sound", "raise()" }, 128 "sound", "raise()" },
129 129
130 //h2200 has different button mapping
131 { Model_iPAQ_H22xx,
132 Qt::Key_NumLock, QT_TRANSLATE_NOOP("Button", "Mail Button"),
133 "devicebuttons/ipaq_mail",
134 "opiemail", "raise()",
135 "opiemail", "newMail()" },
136 { Model_iPAQ_H22xx,
137 Qt::Key_ScrollLock, QT_TRANSLATE_NOOP("Button", "Menu Button"),
138 "devicebuttons/ipaq_menu",
139 "QPE/TaskBar", "toggleMenu()",
140 "QPE/TaskBar", "toggleStartMenu()" },
141 // and hx4700 has different button mapping still
142 { Model_iPAQ_HX4700,
143 Qt::Key_F11, QT_TRANSLATE_NOOP("Button", "Mail Button"),
144 "devicebuttons/ipaq_mail",
145 "opiemail", "raise()",
146 "opiemail", "newMail()" },
147 { Model_iPAQ_HX4700,
148 Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Record Button"),
149 "devicebuttons/ipaq_record",
150 "QPE/VMemo", "toggleRecord()",
151 "sound", "raise()" },
152 { Model_iPAQ_HX4700,
153 Qt::Key_Home, QT_TRANSLATE_NOOP("Button", "Home Button"),
154 "devicebuttons/ipaq_home",
155 "QPE/Launcher", "home()",
156 "buttonsettings", "raise()" },
157
130}; 158};
131 159
@@ -157,4 +185,6 @@ void iPAQ::init(const QString& model)
157 else if ( d->m_modelstr == "HX4700" ) 185 else if ( d->m_modelstr == "HX4700" )
158 d->m_model = Model_iPAQ_HX4700; 186 d->m_model = Model_iPAQ_HX4700;
187 else if ( d->m_modelstr == "H4000" )
188 d->m_model = Model_iPAQ_H4xxx;
159 189
160 else 190 else
@@ -171,4 +201,5 @@ void iPAQ::init(const QString& model)
171 case Model_iPAQ_H1940: 201 case Model_iPAQ_H1940:
172 case Model_iPAQ_HX4700: 202 case Model_iPAQ_HX4700:
203 case Model_iPAQ_H4xxx:
173 d->m_rotation = Rot0; 204 d->m_rotation = Rot0;
174 break; 205 break;
@@ -310,4 +341,5 @@ bool iPAQ::filter ( int /*unicode*/, int keycode, int modifiers, bool isPress, b
310 if (( d->m_model == Model_iPAQ_H5xxx ) || 341 if (( d->m_model == Model_iPAQ_H5xxx ) ||
311 ( d->m_model == Model_iPAQ_H191x ) || 342 ( d->m_model == Model_iPAQ_H191x ) ||
343 ( d->m_model == Model_iPAQ_H4xxx ) ||
312 ( d->m_model == Model_iPAQ_H1940 )) 344 ( d->m_model == Model_iPAQ_H1940 ))
313 newkeycode = Key_Left + ( keycode - Key_Left + 3 ) % 4; 345 newkeycode = Key_Left + ( keycode - Key_Left + 3 ) % 4;
@@ -317,5 +349,5 @@ bool iPAQ::filter ( int /*unicode*/, int keycode, int modifiers, bool isPress, b
317 // map Power Button short/long press to F6 for h191x 349 // map Power Button short/long press to F6 for h191x
318 case Key_F6: 350 case Key_F6:
319 if ( d->m_model != Model_iPAQ_H191x ) 351 if ( d->m_model != Model_iPAQ_H191x && d->m_model != Model_iPAQ_H4xxx )
320 break; 352 break;
321 // map Power Button short/long press to F34/F35 353 // map Power Button short/long press to F34/F35
@@ -381,4 +413,5 @@ bool iPAQ::setDisplayBrightness ( int bright )
381 switch ( model()) { 413 switch ( model()) {
382 case Model_iPAQ_H191x: 414 case Model_iPAQ_H191x:
415 case Model_iPAQ_H4xxx:
383 { 416 {
384 QDir sysClass( "/sys/class/backlight/pxafb/" ); 417 QDir sysClass( "/sys/class/backlight/pxafb/" );
@@ -440,4 +473,5 @@ int iPAQ::displayBrightnessResolution() const
440 case Model_iPAQ_H5xxx: 473 case Model_iPAQ_H5xxx:
441 case Model_iPAQ_HX4700: 474 case Model_iPAQ_HX4700:
475 case Model_iPAQ_H4xxx:
442 return 255; 476 return 255;
443 case Model_iPAQ_H191x: 477 case Model_iPAQ_H191x:
@@ -484,4 +518,5 @@ bool iPAQ::hasLightSensor() const
484 switch (model()) { 518 switch (model()) {
485 case Model_iPAQ_H191x: 519 case Model_iPAQ_H191x:
520 case Model_iPAQ_H4xxx:
486 return false; 521 return false;
487 default: 522 default: