author | mickeyl <mickeyl> | 2005-08-23 12:25:35 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2005-08-23 12:25:35 (UTC) |
commit | 95210ac41729a4c264e830963cdae3a4cdd218fb (patch) (unidiff) | |
tree | c73284a5aebdeb2f56d11cec6ecda80e9b41cec8 /libopie2 | |
parent | d6e8e6bf49bb176ec54efed5eb0d012098f056d7 (diff) | |
download | opie-95210ac41729a4c264e830963cdae3a4cdd218fb.zip opie-95210ac41729a4c264e830963cdae3a4cdd218fb.tar.gz opie-95210ac41729a4c264e830963cdae3a4cdd218fb.tar.bz2 |
add support for the Sharp SL-C3100 "Borzoi"
-rw-r--r-- | libopie2/opiecore/device/odevice.h | 1 | ||||
-rw-r--r-- | libopie2/opiecore/device/odevice_zaurus.cpp | 16 | ||||
-rw-r--r-- | libopie2/opiecore/device/odevice_zaurus.h | 2 |
3 files changed, 15 insertions, 4 deletions
diff --git a/libopie2/opiecore/device/odevice.h b/libopie2/opiecore/device/odevice.h index 76cf97d..0eed1c9 100644 --- a/libopie2/opiecore/device/odevice.h +++ b/libopie2/opiecore/device/odevice.h | |||
@@ -81,12 +81,13 @@ enum OModel { | |||
81 | Model_Zaurus_SLA300 = ( Model_Zaurus | 0x0003 ), | 81 | Model_Zaurus_SLA300 = ( Model_Zaurus | 0x0003 ), |
82 | Model_Zaurus_SLB600 = ( Model_Zaurus | 0x0004 ), | 82 | Model_Zaurus_SLB600 = ( Model_Zaurus | 0x0004 ), |
83 | Model_Zaurus_SLC7x0 = ( Model_Zaurus | 0x0005 ), | 83 | Model_Zaurus_SLC7x0 = ( Model_Zaurus | 0x0005 ), |
84 | Model_Zaurus_SL6000 = ( Model_Zaurus | 0x0006 ), | 84 | Model_Zaurus_SL6000 = ( Model_Zaurus | 0x0006 ), |
85 | Model_Zaurus_SLC3000 = ( Model_Zaurus | 0x0007 ), | 85 | Model_Zaurus_SLC3000 = ( Model_Zaurus | 0x0007 ), |
86 | Model_Zaurus_SLC1000 = ( Model_Zaurus | 0x0008 ), | 86 | Model_Zaurus_SLC1000 = ( Model_Zaurus | 0x0008 ), |
87 | Model_Zaurus_SLC3100 = ( Model_Zaurus | 0x0009 ), | ||
87 | 88 | ||
88 | Model_SIMpad = ( 3 << 16 ), | 89 | Model_SIMpad = ( 3 << 16 ), |
89 | 90 | ||
90 | Model_SIMpad_All = ( Model_SIMpad | 0xffff ), | 91 | Model_SIMpad_All = ( Model_SIMpad | 0xffff ), |
91 | Model_SIMpad_CL4 = ( Model_SIMpad | 0x0001 ), | 92 | Model_SIMpad_CL4 = ( Model_SIMpad | 0x0001 ), |
92 | Model_SIMpad_SL4 = ( Model_SIMpad | 0x0002 ), | 93 | Model_SIMpad_SL4 = ( Model_SIMpad | 0x0002 ), |
diff --git a/libopie2/opiecore/device/odevice_zaurus.cpp b/libopie2/opiecore/device/odevice_zaurus.cpp index b7f3104..4a80a7e 100644 --- a/libopie2/opiecore/device/odevice_zaurus.cpp +++ b/libopie2/opiecore/device/odevice_zaurus.cpp | |||
@@ -1,10 +1,10 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of the Opie Project | 2 | This file is part of the Opie Project |
3 | Copyright (C) 2002-2005 The Opie Team <opie-devel@handhelds.org> | 3 | Copyright (C) 2002-2005 The Opie Team <opie-devel@handhelds.org> |
4 | =. | 4 | =. Copyright (C) 2002-2005 Michael 'Mickey' Lauer <mickey@Vanille.de> |
5 | .=l. | 5 | .=l. |
6 | .>+-= | 6 | .>+-= |
7 | _;:, .> :=|. This program is free software; you can | 7 | _;:, .> :=|. This program is free software; you can |
8 | .> <`_, > . <= redistribute it and/or modify it under | 8 | .> <`_, > . <= redistribute it and/or modify it under |
9 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | 9 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public |
10 | .="- .-=="i, .._ License as published by the Free Software | 10 | .="- .-=="i, .._ License as published by the Free Software |
@@ -221,12 +221,15 @@ void Zaurus::init(const QString& cpu_info) | |||
221 | } else if ( model == "SHARP Spitz" ) { | 221 | } else if ( model == "SHARP Spitz" ) { |
222 | d->m_model = Model_Zaurus_SLC3000; | 222 | d->m_model = Model_Zaurus_SLC3000; |
223 | d->m_modelstr = "Zaurus SL-C3000"; | 223 | d->m_modelstr = "Zaurus SL-C3000"; |
224 | } else if ( model == "SHARP Akita" ) { | 224 | } else if ( model == "SHARP Akita" ) { |
225 | d->m_model = Model_Zaurus_SLC1000; | 225 | d->m_model = Model_Zaurus_SLC1000; |
226 | d->m_modelstr = "Zaurus SL-C1000"; | 226 | d->m_modelstr = "Zaurus SL-C1000"; |
227 | } else if ( model == "SHARP Borzoi" ) { | ||
228 | d->m_model = Model_Zaurus_SLC3100; | ||
229 | d->m_modelstr = "Zaurus SL-C3100"; | ||
227 | } else { | 230 | } else { |
228 | d->m_model = Model_Zaurus_SL5500; | 231 | d->m_model = Model_Zaurus_SL5500; |
229 | d->m_modelstr = "Unknown Zaurus"; | 232 | d->m_modelstr = "Unknown Zaurus"; |
230 | } | 233 | } |
231 | 234 | ||
232 | // set path to backlight device in kernel 2.6 | 235 | // set path to backlight device in kernel 2.6 |
@@ -247,12 +250,13 @@ void Zaurus::init(const QString& cpu_info) | |||
247 | switch( d->m_model ) | 250 | switch( d->m_model ) |
248 | { | 251 | { |
249 | case Model_Zaurus_SL6000: // fallthrough | 252 | case Model_Zaurus_SL6000: // fallthrough |
250 | case Model_Zaurus_SLA300: | 253 | case Model_Zaurus_SLA300: |
251 | d->m_rotation = Rot0; | 254 | d->m_rotation = Rot0; |
252 | break; | 255 | break; |
256 | case Model_Zaurus_SLC3100: // fallthrough | ||
253 | case Model_Zaurus_SLC3000: // fallthrough | 257 | case Model_Zaurus_SLC3000: // fallthrough |
254 | case Model_Zaurus_SLC1000: // fallthrough | 258 | case Model_Zaurus_SLC1000: // fallthrough |
255 | case Model_Zaurus_SLC7x0: | 259 | case Model_Zaurus_SLC7x0: |
256 | d->m_rotation = rotation(); | 260 | d->m_rotation = rotation(); |
257 | d->m_direction = direction(); | 261 | d->m_direction = direction(); |
258 | break; | 262 | break; |
@@ -293,12 +297,13 @@ void Zaurus::initButtons() | |||
293 | switch ( d->m_model ) | 297 | switch ( d->m_model ) |
294 | { | 298 | { |
295 | case Model_Zaurus_SL6000: | 299 | case Model_Zaurus_SL6000: |
296 | pz_buttons = z_buttons_6000; | 300 | pz_buttons = z_buttons_6000; |
297 | buttoncount = ARRAY_SIZE(z_buttons_6000); | 301 | buttoncount = ARRAY_SIZE(z_buttons_6000); |
298 | break; | 302 | break; |
303 | case Model_Zaurus_SLC3100: // fallthrough | ||
299 | case Model_Zaurus_SLC3000: // fallthrough | 304 | case Model_Zaurus_SLC3000: // fallthrough |
300 | case Model_Zaurus_SLC1000: // fallthrough | 305 | case Model_Zaurus_SLC1000: // fallthrough |
301 | case Model_Zaurus_SLC7x0: | 306 | case Model_Zaurus_SLC7x0: |
302 | if ( isQWS( ) ) { | 307 | if ( isQWS( ) ) { |
303 | addPreHandler(this); // hinge-sensor-handler | 308 | addPreHandler(this); // hinge-sensor-handler |
304 | } | 309 | } |
@@ -546,12 +551,13 @@ bool Zaurus::setDisplayStatus( bool on ) | |||
546 | Transformation Zaurus::rotation() const | 551 | Transformation Zaurus::rotation() const |
547 | { | 552 | { |
548 | qDebug( "Zaurus::rotation()" ); | 553 | qDebug( "Zaurus::rotation()" ); |
549 | Transformation rot; | 554 | Transformation rot; |
550 | 555 | ||
551 | switch ( d->m_model ) { | 556 | switch ( d->m_model ) { |
557 | case Model_Zaurus_SLC3100: // fallthrough | ||
552 | case Model_Zaurus_SLC3000: // fallthrough | 558 | case Model_Zaurus_SLC3000: // fallthrough |
553 | case Model_Zaurus_SLC1000: | 559 | case Model_Zaurus_SLC1000: |
554 | { | 560 | { |
555 | OHingeStatus hs = readHingeSensor(); | 561 | OHingeStatus hs = readHingeSensor(); |
556 | qDebug( "Zaurus::rotation() - hinge sensor = %d", (int) hs ); | 562 | qDebug( "Zaurus::rotation() - hinge sensor = %d", (int) hs ); |
557 | if ( hs == CASE_PORTRAIT ) rot = Rot0; | 563 | if ( hs == CASE_PORTRAIT ) rot = Rot0; |
@@ -595,12 +601,13 @@ Transformation Zaurus::rotation() const | |||
595 | } | 601 | } |
596 | ODirection Zaurus::direction() const | 602 | ODirection Zaurus::direction() const |
597 | { | 603 | { |
598 | ODirection dir; | 604 | ODirection dir; |
599 | 605 | ||
600 | switch ( d->m_model ) { | 606 | switch ( d->m_model ) { |
607 | case Model_Zaurus_SLC3100: // fallthrough | ||
601 | case Model_Zaurus_SLC3000: // fallthrough | 608 | case Model_Zaurus_SLC3000: // fallthrough |
602 | case Model_Zaurus_SLC1000: // fallthrough | 609 | case Model_Zaurus_SLC1000: // fallthrough |
603 | case Model_Zaurus_SLC7x0: { | 610 | case Model_Zaurus_SLC7x0: { |
604 | OHingeStatus hs = readHingeSensor(); | 611 | OHingeStatus hs = readHingeSensor(); |
605 | if ( hs == CASE_PORTRAIT ) dir = CCW; | 612 | if ( hs == CASE_PORTRAIT ) dir = CCW; |
606 | else if ( hs == CASE_UNKNOWN ) dir = CCW; | 613 | else if ( hs == CASE_UNKNOWN ) dir = CCW; |
@@ -618,13 +625,16 @@ ODirection Zaurus::direction() const | |||
618 | return dir; | 625 | return dir; |
619 | 626 | ||
620 | } | 627 | } |
621 | 628 | ||
622 | bool Zaurus::hasHingeSensor() const | 629 | bool Zaurus::hasHingeSensor() const |
623 | { | 630 | { |
624 | return d->m_model == Model_Zaurus_SLC7x0 || d->m_model == Model_Zaurus_SLC3000 || d->m_model == Model_Zaurus_SLC1000; | 631 | return d->m_model == Model_Zaurus_SLC7x0 || |
632 | d->m_model == Model_Zaurus_SLC3100 || | ||
633 | d->m_model == Model_Zaurus_SLC3000 || | ||
634 | d->m_model == Model_Zaurus_SLC1000; | ||
625 | } | 635 | } |
626 | 636 | ||
627 | OHingeStatus Zaurus::readHingeSensor() const | 637 | OHingeStatus Zaurus::readHingeSensor() const |
628 | { | 638 | { |
629 | if (m_embedix) | 639 | if (m_embedix) |
630 | { | 640 | { |
@@ -668,13 +678,13 @@ OHingeStatus Zaurus::readHingeSensor() const | |||
668 | * I hope that is ok - Alwin | 678 | * I hope that is ok - Alwin |
669 | */ | 679 | */ |
670 | bool Zaurus::filter ( int /*unicode*/, int keycode, int modifiers, bool isPress, bool autoRepeat ) | 680 | bool Zaurus::filter ( int /*unicode*/, int keycode, int modifiers, bool isPress, bool autoRepeat ) |
671 | { | 681 | { |
672 | int newkeycode = keycode; | 682 | int newkeycode = keycode; |
673 | 683 | ||
674 | if (d->m_model != Model_Zaurus_SLC7x0 && d->m_model != Model_Zaurus_SLC3000 && d->m_model != Model_Zaurus_SLC1000) return false; | 684 | if ( !hasHingeSensor() ) return false; |
675 | 685 | ||
676 | /* map cursor keys depending on the hinge status */ | 686 | /* map cursor keys depending on the hinge status */ |
677 | switch ( keycode ) { | 687 | switch ( keycode ) { |
678 | // Rotate cursor keys | 688 | // Rotate cursor keys |
679 | case Key_Left : | 689 | case Key_Left : |
680 | case Key_Right: | 690 | case Key_Right: |
diff --git a/libopie2/opiecore/device/odevice_zaurus.h b/libopie2/opiecore/device/odevice_zaurus.h index 4314aff..677e29f 100644 --- a/libopie2/opiecore/device/odevice_zaurus.h +++ b/libopie2/opiecore/device/odevice_zaurus.h | |||
@@ -1,10 +1,10 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of the Opie Project | 2 | This file is part of the Opie Project |
3 | Copyright (C) 2002-2005 The Opie Team <opie-devel@handhelds.org> | 3 | Copyright (C) 2002-2005 The Opie Team <opie-devel@handhelds.org> |
4 | =. | 4 | =. Copyright (C) 2002-2005 Michael 'Mickey' Lauer <mickey@Vanille.de> |
5 | .=l. | 5 | .=l. |
6 | .>+-= | 6 | .>+-= |
7 | _;:, .> :=|. This program is free software; you can | 7 | _;:, .> :=|. This program is free software; you can |
8 | .> <`_, > . <= redistribute it and/or modify it under | 8 | .> <`_, > . <= redistribute it and/or modify it under |
9 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | 9 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public |
10 | .="- .-=="i, .._ License as published by the Free Software | 10 | .="- .-=="i, .._ License as published by the Free Software |