author | zecke <zecke> | 2005-10-06 18:58:40 (UTC) |
---|---|---|
committer | zecke <zecke> | 2005-10-06 18:58:40 (UTC) |
commit | 0bad2116a1ceed19956b94889cb034781f35146d (patch) (unidiff) | |
tree | a1131b9e026cdf5533c4da6a7f49fcbb139b4e09 | |
parent | 31777172abf127e00594790e4365dfad8772b100 (diff) | |
download | opie-0bad2116a1ceed19956b94889cb034781f35146d.zip opie-0bad2116a1ceed19956b94889cb034781f35146d.tar.gz opie-0bad2116a1ceed19956b94889cb034781f35146d.tar.bz2 |
ODevice patch from #1701 gor hp1940
-Allocate device number
-Some implementation
-rw-r--r-- | libopie2/opiecore/device/odevice.h | 1 | ||||
-rw-r--r-- | libopie2/opiecore/device/odevice_ipaq.cpp | 8 |
2 files changed, 8 insertions, 1 deletions
diff --git a/libopie2/opiecore/device/odevice.h b/libopie2/opiecore/device/odevice.h index 492c97b..c70d2af 100644 --- a/libopie2/opiecore/device/odevice.h +++ b/libopie2/opiecore/device/odevice.h | |||
@@ -60,24 +60,25 @@ enum OModel { | |||
60 | 60 | ||
61 | Model_iPAQ = ( 1 << 16 ), | 61 | Model_iPAQ = ( 1 << 16 ), |
62 | 62 | ||
63 | Model_iPAQ_All = ( Model_iPAQ | 0xffff ), | 63 | Model_iPAQ_All = ( Model_iPAQ | 0xffff ), |
64 | Model_iPAQ_H31xx = ( Model_iPAQ | 0x0001 ), | 64 | Model_iPAQ_H31xx = ( Model_iPAQ | 0x0001 ), |
65 | Model_iPAQ_H36xx = ( Model_iPAQ | 0x0002 ), | 65 | Model_iPAQ_H36xx = ( Model_iPAQ | 0x0002 ), |
66 | Model_iPAQ_H37xx = ( Model_iPAQ | 0x0003 ), | 66 | Model_iPAQ_H37xx = ( Model_iPAQ | 0x0003 ), |
67 | Model_iPAQ_H38xx = ( Model_iPAQ | 0x0004 ), | 67 | Model_iPAQ_H38xx = ( Model_iPAQ | 0x0004 ), |
68 | Model_iPAQ_H39xx = ( Model_iPAQ | 0x0005 ), | 68 | Model_iPAQ_H39xx = ( Model_iPAQ | 0x0005 ), |
69 | Model_iPAQ_H5xxx = ( Model_iPAQ | 0x0006 ), | 69 | Model_iPAQ_H5xxx = ( Model_iPAQ | 0x0006 ), |
70 | Model_iPAQ_H22xx = ( Model_iPAQ | 0x0007 ), | 70 | Model_iPAQ_H22xx = ( Model_iPAQ | 0x0007 ), |
71 | Model_iPAQ_H191x = ( Model_iPAQ | 0x0008 ), | 71 | Model_iPAQ_H191x = ( Model_iPAQ | 0x0008 ), |
72 | Model_iPAQ_H1940 = ( Model_iPAQ | 0x0009 ), | ||
72 | 73 | ||
73 | Model_Jornada = ( 6 << 16 ), | 74 | Model_Jornada = ( 6 << 16 ), |
74 | Model_Jornada_56x = ( Model_Jornada | 0x0001 ), | 75 | Model_Jornada_56x = ( Model_Jornada | 0x0001 ), |
75 | Model_Jornada_720 = ( Model_Jornada | 0x0002 ), | 76 | Model_Jornada_720 = ( Model_Jornada | 0x0002 ), |
76 | 77 | ||
77 | Model_Zaurus = ( 2 << 16 ), | 78 | Model_Zaurus = ( 2 << 16 ), |
78 | 79 | ||
79 | Model_Zaurus_SL5000 = ( Model_Zaurus | 0x0001 ), | 80 | Model_Zaurus_SL5000 = ( Model_Zaurus | 0x0001 ), |
80 | Model_Zaurus_SL5500 = ( Model_Zaurus | 0x0002 ), | 81 | Model_Zaurus_SL5500 = ( Model_Zaurus | 0x0002 ), |
81 | Model_Zaurus_SLA300 = ( Model_Zaurus | 0x0003 ), | 82 | Model_Zaurus_SLA300 = ( Model_Zaurus | 0x0003 ), |
82 | Model_Zaurus_SLB600 = ( Model_Zaurus | 0x0004 ), | 83 | Model_Zaurus_SLB600 = ( Model_Zaurus | 0x0004 ), |
83 | Model_Zaurus_SLC7x0 = ( Model_Zaurus | 0x0005 ), | 84 | Model_Zaurus_SLC7x0 = ( Model_Zaurus | 0x0005 ), |
diff --git a/libopie2/opiecore/device/odevice_ipaq.cpp b/libopie2/opiecore/device/odevice_ipaq.cpp index 3cc6cec..52da2d9 100644 --- a/libopie2/opiecore/device/odevice_ipaq.cpp +++ b/libopie2/opiecore/device/odevice_ipaq.cpp | |||
@@ -142,35 +142,38 @@ void iPAQ::init(const QString& model) | |||
142 | else if ( d->m_modelstr == "H3700" ) | 142 | else if ( d->m_modelstr == "H3700" ) |
143 | d->m_model = Model_iPAQ_H37xx; | 143 | d->m_model = Model_iPAQ_H37xx; |
144 | else if ( d->m_modelstr == "H3800" ) | 144 | else if ( d->m_modelstr == "H3800" ) |
145 | d->m_model = Model_iPAQ_H38xx; | 145 | d->m_model = Model_iPAQ_H38xx; |
146 | else if ( d->m_modelstr == "H3900" ) | 146 | else if ( d->m_modelstr == "H3900" ) |
147 | d->m_model = Model_iPAQ_H39xx; | 147 | d->m_model = Model_iPAQ_H39xx; |
148 | else if ( d->m_modelstr == "H5400" ) | 148 | else if ( d->m_modelstr == "H5400" ) |
149 | d->m_model = Model_iPAQ_H5xxx; | 149 | d->m_model = Model_iPAQ_H5xxx; |
150 | else if ( d->m_modelstr == "H2200" ) | 150 | else if ( d->m_modelstr == "H2200" ) |
151 | d->m_model = Model_iPAQ_H22xx; | 151 | d->m_model = Model_iPAQ_H22xx; |
152 | else if ( d->m_modelstr == "H1910" ) | 152 | else if ( d->m_modelstr == "H1910" ) |
153 | d->m_model = Model_iPAQ_H191x; | 153 | d->m_model = Model_iPAQ_H191x; |
154 | else if ( d->m_modelstr == "H1940" ) | ||
155 | d->m_model = Model_iPAQ_H1940; | ||
154 | else | 156 | else |
155 | d->m_model = Model_Unknown; | 157 | d->m_model = Model_Unknown; |
156 | 158 | ||
157 | switch ( d->m_model ) { | 159 | switch ( d->m_model ) { |
158 | case Model_iPAQ_H31xx: | 160 | case Model_iPAQ_H31xx: |
159 | case Model_iPAQ_H38xx: | 161 | case Model_iPAQ_H38xx: |
160 | d->m_rotation = Rot90; | 162 | d->m_rotation = Rot90; |
161 | break; | 163 | break; |
162 | case Model_iPAQ_H5xxx: | 164 | case Model_iPAQ_H5xxx: |
163 | case Model_iPAQ_H22xx: | 165 | case Model_iPAQ_H22xx: |
164 | case Model_iPAQ_H191x: | 166 | case Model_iPAQ_H191x: |
167 | case Model_iPAQ_H1940: | ||
165 | d->m_rotation = Rot0; | 168 | d->m_rotation = Rot0; |
166 | break; | 169 | break; |
167 | case Model_iPAQ_H36xx: | 170 | case Model_iPAQ_H36xx: |
168 | case Model_iPAQ_H37xx: | 171 | case Model_iPAQ_H37xx: |
169 | case Model_iPAQ_H39xx: | 172 | case Model_iPAQ_H39xx: |
170 | default: | 173 | default: |
171 | d->m_rotation = Rot270; | 174 | d->m_rotation = Rot270; |
172 | break; | 175 | break; |
173 | 176 | ||
174 | } | 177 | } |
175 | 178 | ||
176 | m_leds [0] = m_leds [1] = Led_Off; | 179 | m_leds [0] = m_leds [1] = Led_Off; |
@@ -291,25 +294,26 @@ bool iPAQ::filter ( int /*unicode*/, int keycode, int modifiers, bool isPress, b | |||
291 | case Key_Right: | 294 | case Key_Right: |
292 | case Key_Up : | 295 | case Key_Up : |
293 | case Key_Down : { | 296 | case Key_Down : { |
294 | if (( d->m_model == Model_iPAQ_H31xx ) || | 297 | if (( d->m_model == Model_iPAQ_H31xx ) || |
295 | ( d->m_model == Model_iPAQ_H38xx )) { | 298 | ( d->m_model == Model_iPAQ_H38xx )) { |
296 | newkeycode = Key_Left + ( keycode - Key_Left + 2 ) % 4; | 299 | newkeycode = Key_Left + ( keycode - Key_Left + 2 ) % 4; |
297 | } | 300 | } |
298 | // Rotate the cursor keys by 270 | 301 | // Rotate the cursor keys by 270 |
299 | // keycode - Key_Left = position of the button starting from left clockwise | 302 | // keycode - Key_Left = position of the button starting from left clockwise |
300 | // add the rotation to it and modolo. No we've the original offset | 303 | // add the rotation to it and modolo. No we've the original offset |
301 | // add the offset to the Key_Left key | 304 | // add the offset to the Key_Left key |
302 | if (( d->m_model == Model_iPAQ_H5xxx ) || | 305 | if (( d->m_model == Model_iPAQ_H5xxx ) || |
303 | ( d->m_model == Model_iPAQ_H191x )) | 306 | ( d->m_model == Model_iPAQ_H191x ) || |
307 | ( d->m_model == Model_iPAQ_H1940 )) | ||
304 | newkeycode = Key_Left + ( keycode - Key_Left + 3 ) % 4; | 308 | newkeycode = Key_Left + ( keycode - Key_Left + 3 ) % 4; |
305 | break; | 309 | break; |
306 | } | 310 | } |
307 | 311 | ||
308 | // map Power Button short/long press to F34/F35 | 312 | // map Power Button short/long press to F34/F35 |
309 | case Key_SysReq: { | 313 | case Key_SysReq: { |
310 | if ( isPress ) { | 314 | if ( isPress ) { |
311 | if ( m_power_timer ) | 315 | if ( m_power_timer ) |
312 | killTimer ( m_power_timer ); | 316 | killTimer ( m_power_timer ); |
313 | m_power_timer = startTimer ( 500 ); | 317 | m_power_timer = startTimer ( 500 ); |
314 | } | 318 | } |
315 | else if ( m_power_timer ) { | 319 | else if ( m_power_timer ) { |
@@ -393,24 +397,26 @@ int iPAQ::displayBrightnessResolution() const | |||
393 | case Model_iPAQ_H31xx: | 397 | case Model_iPAQ_H31xx: |
394 | case Model_iPAQ_H36xx: | 398 | case Model_iPAQ_H36xx: |
395 | case Model_iPAQ_H37xx: | 399 | case Model_iPAQ_H37xx: |
396 | return 128; // really 256, but >128 could damage the LCD | 400 | return 128; // really 256, but >128 could damage the LCD |
397 | 401 | ||
398 | case Model_iPAQ_H38xx: | 402 | case Model_iPAQ_H38xx: |
399 | case Model_iPAQ_H39xx: | 403 | case Model_iPAQ_H39xx: |
400 | return 64; | 404 | return 64; |
401 | case Model_iPAQ_H5xxx: | 405 | case Model_iPAQ_H5xxx: |
402 | return 255; | 406 | return 255; |
403 | case Model_iPAQ_H191x: | 407 | case Model_iPAQ_H191x: |
404 | return 183; | 408 | return 183; |
409 | case Model_iPAQ_H191x: | ||
410 | return 44; | ||
405 | default: | 411 | default: |
406 | return 2; | 412 | return 2; |
407 | } | 413 | } |
408 | } | 414 | } |
409 | 415 | ||
410 | bool iPAQ::setDisplayStatus ( bool on ) | 416 | bool iPAQ::setDisplayStatus ( bool on ) |
411 | { | 417 | { |
412 | bool res = false; | 418 | bool res = false; |
413 | 419 | ||
414 | QString cmdline; | 420 | QString cmdline; |
415 | 421 | ||
416 | if ( model() == Model_iPAQ_H191x ) { | 422 | if ( model() == Model_iPAQ_H191x ) { |