Diffstat (limited to 'libopie2/opiecore/device/odevice_ipaq.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | libopie2/opiecore/device/odevice_ipaq.cpp | 48 |
1 files changed, 41 insertions, 7 deletions
diff --git a/libopie2/opiecore/device/odevice_ipaq.cpp b/libopie2/opiecore/device/odevice_ipaq.cpp index 8bc775f..309e1e4 100644 --- a/libopie2/opiecore/device/odevice_ipaq.cpp +++ b/libopie2/opiecore/device/odevice_ipaq.cpp | |||
@@ -87,3 +87,3 @@ typedef struct { | |||
87 | struct i_button ipaq_buttons [] = { | 87 | struct i_button ipaq_buttons [] = { |
88 | { Model_iPAQ_H31xx | Model_iPAQ_H36xx | Model_iPAQ_H37xx | Model_iPAQ_H38xx | Model_iPAQ_H39xx | Model_iPAQ_H5xxx, | 88 | { Model_iPAQ_H31xx | Model_iPAQ_H36xx | Model_iPAQ_H37xx | Model_iPAQ_H38xx | Model_iPAQ_H39xx | Model_iPAQ_H5xxx | Model_iPAQ_H191x, |
89 | Qt::Key_F9, QT_TRANSLATE_NOOP("Button", "Calendar Button"), | 89 | Qt::Key_F9, QT_TRANSLATE_NOOP("Button", "Calendar Button"), |
@@ -92,3 +92,3 @@ struct i_button ipaq_buttons [] = { | |||
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, | 93 | { Model_iPAQ_H31xx | Model_iPAQ_H36xx | Model_iPAQ_H37xx | Model_iPAQ_H38xx | Model_iPAQ_H39xx | Model_iPAQ_H5xxx | Model_iPAQ_H191x, |
94 | Qt::Key_F10, QT_TRANSLATE_NOOP("Button", "Contacts Button"), | 94 | Qt::Key_F10, QT_TRANSLATE_NOOP("Button", "Contacts Button"), |
@@ -102,3 +102,3 @@ struct i_button ipaq_buttons [] = { | |||
102 | "QPE/TaskBar", "toggleStartMenu()" }, | 102 | "QPE/TaskBar", "toggleStartMenu()" }, |
103 | { Model_iPAQ_H38xx | Model_iPAQ_H39xx | Model_iPAQ_H5xxx, | 103 | { Model_iPAQ_H38xx | Model_iPAQ_H39xx | Model_iPAQ_H5xxx | Model_iPAQ_H191x, |
104 | Qt::Key_F13, QT_TRANSLATE_NOOP("Button", "Mail Button"), | 104 | Qt::Key_F13, QT_TRANSLATE_NOOP("Button", "Mail Button"), |
@@ -107,3 +107,3 @@ struct i_button ipaq_buttons [] = { | |||
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, | 108 | { Model_iPAQ_H31xx | Model_iPAQ_H36xx | Model_iPAQ_H37xx | Model_iPAQ_H38xx | Model_iPAQ_H39xx | Model_iPAQ_H5xxx | Model_iPAQ_H191x, |
109 | Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Home Button"), | 109 | Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Home Button"), |
@@ -112,3 +112,3 @@ struct i_button ipaq_buttons [] = { | |||
112 | "buttonsettings", "raise()" }, | 112 | "buttonsettings", "raise()" }, |
113 | { Model_iPAQ_H31xx | Model_iPAQ_H36xx | Model_iPAQ_H37xx | Model_iPAQ_H38xx | Model_iPAQ_H39xx | Model_iPAQ_H5xxx, | 113 | { Model_iPAQ_H31xx | Model_iPAQ_H36xx | Model_iPAQ_H37xx | Model_iPAQ_H38xx | Model_iPAQ_H39xx | Model_iPAQ_H5xxx | Model_iPAQ_H191x, |
114 | Qt::Key_F24, QT_TRANSLATE_NOOP("Button", "Record Button"), | 114 | Qt::Key_F24, QT_TRANSLATE_NOOP("Button", "Record Button"), |
@@ -140,2 +140,4 @@ void iPAQ::init(const QString& model) | |||
140 | d->m_model = Model_iPAQ_H22xx; | 140 | d->m_model = Model_iPAQ_H22xx; |
141 | else if ( d->m_modelstr == "H1910" ) | ||
142 | d->m_model = Model_iPAQ_H191x; | ||
141 | else | 143 | else |
@@ -150,2 +152,3 @@ void iPAQ::init(const QString& model) | |||
150 | case Model_iPAQ_H22xx: | 152 | case Model_iPAQ_H22xx: |
153 | case Model_iPAQ_H191x: | ||
151 | d->m_rotation = Rot0; | 154 | d->m_rotation = Rot0; |
@@ -287,3 +290,4 @@ bool iPAQ::filter ( int /*unicode*/, int keycode, int modifiers, bool isPress, b | |||
287 | // add the offset to the Key_Left key | 290 | // add the offset to the Key_Left key |
288 | if ( d-> m_model == Model_iPAQ_H5xxx ) | 291 | if (( d->m_model == Model_iPAQ_H5xxx ) || |
292 | ( d->m_model == Model_iPAQ_H191x )) | ||
289 | newkeycode = Key_Left + ( keycode - Key_Left + 3 ) % 4; | 293 | newkeycode = Key_Left + ( keycode - Key_Left + 3 ) % 4; |
@@ -350,2 +354,14 @@ bool iPAQ::setDisplayBrightness ( int bright ) | |||
350 | 354 | ||
355 | QString cmdline; | ||
356 | |||
357 | switch ( model()) { | ||
358 | case Model_iPAQ_H191x: | ||
359 | if ( !bright ) | ||
360 | cmdline = QString::fromLatin1( "echo 4 > /sys/class/backlight/pxafb/power"); | ||
361 | else | ||
362 | cmdline = QString::fromLatin1( "echo 0 > /sys/class/backlight/pxafb/power; echo %1 > /sys/class/backlight/pxafb/brightness" ).arg( bright ); | ||
363 | // No Global::shellQuote as we gurantee it to be sane | ||
364 | res = ( ::system( QFile::encodeName(cmdline) ) == 0 ); | ||
365 | break; | ||
366 | default: | ||
351 | if (( fd = ::open ( "/dev/touchscreen/0", O_WRONLY )) >= 0 ) { | 367 | if (( fd = ::open ( "/dev/touchscreen/0", O_WRONLY )) >= 0 ) { |
@@ -358,2 +374,3 @@ bool iPAQ::setDisplayBrightness ( int bright ) | |||
358 | } | 374 | } |
375 | } | ||
359 | return res; | 376 | return res; |
@@ -374,3 +391,4 @@ int iPAQ::displayBrightnessResolution() const | |||
374 | return 255; | 391 | return 255; |
375 | 392 | case Model_iPAQ_H191x: | |
393 | return 183; | ||
376 | default: | 394 | default: |
@@ -380,2 +398,18 @@ int iPAQ::displayBrightnessResolution() const | |||
380 | 398 | ||
399 | bool iPAQ::setDisplayStatus ( bool on ) | ||
400 | { | ||
401 | bool res = false; | ||
402 | |||
403 | QString cmdline; | ||
404 | |||
405 | if ( model() == Model_iPAQ_H191x ) { | ||
406 | cmdline = QString::fromLatin1( "echo %1 > /sys/class/lcd/pxafb/power; echo %2 > /sys/class/backlight/pxafb/power").arg( on ? "0" : "4" ).arg( on ? "0" : "4" ); | ||
407 | } else { | ||
408 | res = OAbstractMobileDevice::setDisplayStatus(on); | ||
409 | } | ||
410 | |||
411 | res = ( ::system( QFile::encodeName(cmdline) ) == 0 ); | ||
412 | |||
413 | return res; | ||
414 | } | ||
381 | 415 | ||