author | kergoth <kergoth> | 2003-01-26 01:01:32 (UTC) |
---|---|---|
committer | kergoth <kergoth> | 2003-01-26 01:01:32 (UTC) |
commit | 7b5f4142a1ace5fba9fdf9b8e5538669a56ba60b (patch) (unidiff) | |
tree | 29ab0dfa5c6d35621857af78a6fa3eaae517be33 | |
parent | 7d07568352e368fe473e4c1c5493df2ebb0090d2 (diff) | |
download | opie-7b5f4142a1ace5fba9fdf9b8e5538669a56ba60b.zip opie-7b5f4142a1ace5fba9fdf9b8e5538669a56ba60b.tar.gz opie-7b5f4142a1ace5fba9fdf9b8e5538669a56ba60b.tar.bz2 |
1) Add Sharp Zaurus A300/B600|5600/C700 models, will add the model specific bits
later.
2) Add rotation data and method, to set a default rotation based on model .. so
we can ditch the use of the startup script to set that.
-rw-r--r-- | libopie/odevice.cpp | 55 | ||||
-rw-r--r-- | libopie/odevice.h | 10 |
2 files changed, 54 insertions, 11 deletions
diff --git a/libopie/odevice.cpp b/libopie/odevice.cpp index d39d72f..78eb416 100644 --- a/libopie/odevice.cpp +++ b/libopie/odevice.cpp | |||
@@ -64,8 +64,10 @@ public: | |||
64 | QString m_systemstr; | 64 | QString m_systemstr; |
65 | OSystem m_system; | 65 | OSystem m_system; |
66 | 66 | ||
67 | QString m_sysverstr; | 67 | QString m_sysverstr; |
68 | |||
69 | Transformation m_rotation; | ||
68 | 70 | ||
69 | QValueList <ODeviceButton> m_buttons; | 71 | QValueList <ODeviceButton> m_buttons; |
70 | uint m_holdtime; | 72 | uint m_holdtime; |
71 | }; | 73 | }; |
@@ -248,8 +250,9 @@ ODevice::ODevice ( ) | |||
248 | d-> m_vendor = Vendor_Unknown; | 250 | d-> m_vendor = Vendor_Unknown; |
249 | d-> m_systemstr = "Unknown"; | 251 | d-> m_systemstr = "Unknown"; |
250 | d-> m_system = System_Unknown; | 252 | d-> m_system = System_Unknown; |
251 | d-> m_sysverstr = "0.0"; | 253 | d-> m_sysverstr = "0.0"; |
254 | d-> m_rotation = None; | ||
252 | 255 | ||
253 | d-> m_holdtime = 1000; // 1000ms | 256 | d-> m_holdtime = 1000; // 1000ms |
254 | 257 | ||
255 | QCopChannel *sysch = new QCopChannel ( "QPE/System", this ); | 258 | QCopChannel *sysch = new QCopChannel ( "QPE/System", this ); |
@@ -399,8 +402,13 @@ QString ODevice::systemVersionString ( ) const | |||
399 | { | 402 | { |
400 | return d-> m_sysverstr; | 403 | return d-> m_sysverstr; |
401 | } | 404 | } |
402 | 405 | ||
406 | Transformation ODevice::rotation ( ) const | ||
407 | { | ||
408 | return d-> m_rotation; | ||
409 | } | ||
410 | |||
403 | void ODevice::alarmSound ( ) | 411 | void ODevice::alarmSound ( ) |
404 | { | 412 | { |
405 | #ifndef QT_NO_SOUND | 413 | #ifndef QT_NO_SOUND |
406 | static Sound snd ( "alarm" ); | 414 | static Sound snd ( "alarm" ); |
@@ -586,8 +594,21 @@ void iPAQ::init ( ) | |||
586 | 594 | ||
587 | f. close ( ); | 595 | f. close ( ); |
588 | } | 596 | } |
589 | 597 | ||
598 | switch ( d-> m_model ) { | ||
599 | case Model_iPAQ_H31xx: | ||
600 | case Model_iPAQ_H38xx: | ||
601 | d-> m_rotation = Rot90; | ||
602 | break; | ||
603 | case Model_iPAQ_H36xx: | ||
604 | case Model_iPAQ_H37xx: | ||
605 | case Model_iPAQ_H39xx: | ||
606 | default: | ||
607 | d-> m_rotation = Rot270; | ||
608 | break; | ||
609 | } | ||
610 | |||
590 | f. setName ( "/etc/familiar-version" ); | 611 | f. setName ( "/etc/familiar-version" ); |
591 | if ( f. open ( IO_ReadOnly )) { | 612 | if ( f. open ( IO_ReadOnly )) { |
592 | d-> m_systemstr = "Familiar"; | 613 | d-> m_systemstr = "Familiar"; |
593 | d-> m_system = System_Familiar; | 614 | d-> m_system = System_Familiar; |
@@ -640,9 +661,8 @@ typedef struct { | |||
640 | #define LED_ON OD_IOW( 'f', 5, LED_IN ) | 661 | #define LED_ON OD_IOW( 'f', 5, LED_IN ) |
641 | #define FLITE_ON OD_IOW( 'f', 7, FLITE_IN ) | 662 | #define FLITE_ON OD_IOW( 'f', 7, FLITE_IN ) |
642 | 663 | ||
643 | 664 | ||
644 | |||
645 | QValueList <OLed> iPAQ::ledList ( ) const | 665 | QValueList <OLed> iPAQ::ledList ( ) const |
646 | { | 666 | { |
647 | QValueList <OLed> vl; | 667 | QValueList <OLed> vl; |
648 | vl << Led_Power; | 668 | vl << Led_Power; |
@@ -936,19 +956,38 @@ void Zaurus::init ( ) | |||
936 | if ( f. open ( IO_ReadOnly ) ) { | 956 | if ( f. open ( IO_ReadOnly ) ) { |
937 | QTextStream ts ( &f ); | 957 | QTextStream ts ( &f ); |
938 | QString model = ts. readLine ( ); | 958 | QString model = ts. readLine ( ); |
939 | f. close ( ); | 959 | f. close ( ); |
940 | if ( model == "SL-5000D" ) { | 960 | |
941 | d-> m_model = Model_Zaurus_SL5000; | 961 | d-> m_modelstr = QString("Zaurus ") + model; |
942 | d-> m_modelstr = "Zaurus SL-5000D"; | 962 | if ( model == "SL-5500" ) |
943 | } else if ( model == "SL-5500" ) { | ||
944 | d-> m_model = Model_Zaurus_SL5500; | 963 | d-> m_model = Model_Zaurus_SL5500; |
945 | d-> m_modelstr = "Zaurus SL-5500"; | 964 | else if ( model == "SL-C700" ) |
946 | } | 965 | d-> m_model = Model_Zaurus_SLC700; |
966 | else if ( model == "SL-A300" ) | ||
967 | d-> m_model = Model_Zaurus_SLA300; | ||
968 | else if ( model == "SL-B600" || model == "SL-5600" ) | ||
969 | d-> m_model = Model_Zaurus_SLB600; | ||
970 | else | ||
971 | d-> m_model = Model_Zaurus_SL5000; | ||
947 | } | 972 | } |
948 | else { | 973 | else { |
949 | d-> m_model = Model_Zaurus_SL5000; | 974 | d-> m_model = Model_Zaurus_SL5000; |
950 | d-> m_modelstr = "Zaurus SL-5000D (unverified)"; | 975 | d-> m_modelstr = "Zaurus (model unknown)"; |
976 | } | ||
977 | |||
978 | switch ( d-> m_model ) { | ||
979 | case Model_Zaurus_SLC700: | ||
980 | /* note for C700, we must check the display rotation | ||
981 | * sensor to set an appropriate value | ||
982 | */ | ||
983 | case Model_Zaurus_SLA300: | ||
984 | case Model_Zaurus_SLB600: | ||
985 | case Model_Zaurus_SL5500: | ||
986 | case Model_Zaurus_SL5000: | ||
987 | default: | ||
988 | d-> m_rotation = Rot270; | ||
989 | break; | ||
951 | } | 990 | } |
952 | 991 | ||
953 | for ( uint i = 0; i < ( sizeof( z_buttons ) / sizeof( z_button )); i++ ) { | 992 | for ( uint i = 0; i < ( sizeof( z_buttons ) / sizeof( z_button )); i++ ) { |
954 | z_button *zb = z_buttons + i; | 993 | z_button *zb = z_buttons + i; |
diff --git a/libopie/odevice.h b/libopie/odevice.h index 54b85a2..8164c4d 100644 --- a/libopie/odevice.h +++ b/libopie/odevice.h | |||
@@ -25,8 +25,10 @@ | |||
25 | #include <qnamespace.h> | 25 | #include <qnamespace.h> |
26 | 26 | ||
27 | #include <opie/odevicebutton.h> | 27 | #include <opie/odevicebutton.h> |
28 | 28 | ||
29 | enum Transformation { None, Rot90, Rot180, Rot270 }; /* from qgfxtransformed_qws.cpp */ | ||
30 | |||
29 | class ODeviceData; | 31 | class ODeviceData; |
30 | 32 | ||
31 | namespace Opie { | 33 | namespace Opie { |
32 | 34 | ||
@@ -47,8 +49,11 @@ enum OModel { | |||
47 | Model_Zaurus = ( 2 << 24 ), | 49 | Model_Zaurus = ( 2 << 24 ), |
48 | 50 | ||
49 | Model_Zaurus_SL5000 = ( Model_Zaurus | 0x000001 ), | 51 | Model_Zaurus_SL5000 = ( Model_Zaurus | 0x000001 ), |
50 | Model_Zaurus_SL5500 = ( Model_Zaurus | 0x000002 ), | 52 | Model_Zaurus_SL5500 = ( Model_Zaurus | 0x000002 ), |
53 | Model_Zaurus_SLA300 = ( Model_Zaurus | 0x000003 ), | ||
54 | Model_Zaurus_SLB600 = ( Model_Zaurus | 0x000004 ), | ||
55 | Model_Zaurus_SLC700 = ( Model_Zaurus | 0x000005 ), | ||
51 | }; | 56 | }; |
52 | 57 | ||
53 | enum OVendor { | 58 | enum OVendor { |
54 | Vendor_Unknown, | 59 | Vendor_Unknown, |
@@ -88,9 +93,8 @@ enum OHardKey { | |||
88 | HardKey_Suspend = Qt::Key_F34, | 93 | HardKey_Suspend = Qt::Key_F34, |
89 | HardKey_Backlight = Qt::Key_F35, | 94 | HardKey_Backlight = Qt::Key_F35, |
90 | }; | 95 | }; |
91 | 96 | ||
92 | |||
93 | class ODevice : public QObject { | 97 | class ODevice : public QObject { |
94 | Q_OBJECT | 98 | Q_OBJECT |
95 | 99 | ||
96 | private: | 100 | private: |
@@ -106,10 +110,8 @@ public: | |||
106 | virtual ~ODevice ( ); | 110 | virtual ~ODevice ( ); |
107 | 111 | ||
108 | static ODevice *inst ( ); | 112 | static ODevice *inst ( ); |
109 | 113 | ||
110 | |||
111 | |||
112 | // information | 114 | // information |
113 | 115 | ||
114 | QString modelString ( ) const; | 116 | QString modelString ( ) const; |
115 | OModel model ( ) const; | 117 | OModel model ( ) const; |
@@ -122,8 +124,10 @@ public: | |||
122 | OSystem system ( ) const; | 124 | OSystem system ( ) const; |
123 | 125 | ||
124 | QString systemVersionString ( ) const; | 126 | QString systemVersionString ( ) const; |
125 | 127 | ||
128 | Transformation rotation ( ) const; | ||
129 | |||
126 | // system | 130 | // system |
127 | 131 | ||
128 | virtual bool setSoftSuspend ( bool on ); | 132 | virtual bool setSoftSuspend ( bool on ); |
129 | virtual bool suspend ( ); | 133 | virtual bool suspend ( ); |