-rw-r--r-- | libopie2/opiecore/device/odevice.h | 1 | ||||
-rw-r--r-- | libopie2/opiecore/device/odevice_zaurus.cpp | 4 |
2 files changed, 5 insertions, 0 deletions
diff --git a/libopie2/opiecore/device/odevice.h b/libopie2/opiecore/device/odevice.h index 762d3f1..cb7a83f 100644 --- a/libopie2/opiecore/device/odevice.h +++ b/libopie2/opiecore/device/odevice.h | |||
@@ -29,96 +29,97 @@ _;:, .> :=|. This program is free software; you can | |||
29 | 29 | ||
30 | #ifndef ODEVICE_H_ | 30 | #ifndef ODEVICE_H_ |
31 | #define ODEVICE_H_ | 31 | #define ODEVICE_H_ |
32 | 32 | ||
33 | /* OPIE */ | 33 | /* OPIE */ |
34 | #include <opie2/odevicebutton.h> | 34 | #include <opie2/odevicebutton.h> |
35 | #include <qpe/qpeapplication.h> /* for Transformation enum.. */ | 35 | #include <qpe/qpeapplication.h> /* for Transformation enum.. */ |
36 | 36 | ||
37 | /* QT */ | 37 | /* QT */ |
38 | #include <qnamespace.h> | 38 | #include <qnamespace.h> |
39 | #include <qobject.h> | 39 | #include <qobject.h> |
40 | #include <qstring.h> | 40 | #include <qstring.h> |
41 | #include <qstrlist.h> | 41 | #include <qstrlist.h> |
42 | #include <qwindowsystem_qws.h> | 42 | #include <qwindowsystem_qws.h> |
43 | 43 | ||
44 | namespace Opie{ | 44 | namespace Opie{ |
45 | namespace Core{ | 45 | namespace Core{ |
46 | 46 | ||
47 | class ODeviceData; | 47 | class ODeviceData; |
48 | /** | 48 | /** |
49 | * The available devices | 49 | * The available devices |
50 | */ | 50 | */ |
51 | enum OModel { | 51 | enum OModel { |
52 | Model_Unknown, // = 0 | 52 | Model_Unknown, // = 0 |
53 | 53 | ||
54 | Model_Series_Mask = 0xff000000, | 54 | Model_Series_Mask = 0xff000000, |
55 | 55 | ||
56 | Model_iPAQ = ( 1 << 24 ), | 56 | Model_iPAQ = ( 1 << 24 ), |
57 | 57 | ||
58 | Model_iPAQ_All = ( Model_iPAQ | 0xffffff ), | 58 | Model_iPAQ_All = ( Model_iPAQ | 0xffffff ), |
59 | Model_iPAQ_H31xx = ( Model_iPAQ | 0x000001 ), | 59 | Model_iPAQ_H31xx = ( Model_iPAQ | 0x000001 ), |
60 | Model_iPAQ_H36xx = ( Model_iPAQ | 0x000002 ), | 60 | Model_iPAQ_H36xx = ( Model_iPAQ | 0x000002 ), |
61 | Model_iPAQ_H37xx = ( Model_iPAQ | 0x000004 ), | 61 | Model_iPAQ_H37xx = ( Model_iPAQ | 0x000004 ), |
62 | Model_iPAQ_H38xx = ( Model_iPAQ | 0x000008 ), | 62 | Model_iPAQ_H38xx = ( Model_iPAQ | 0x000008 ), |
63 | Model_iPAQ_H39xx = ( Model_iPAQ | 0x000010 ), | 63 | Model_iPAQ_H39xx = ( Model_iPAQ | 0x000010 ), |
64 | Model_iPAQ_H5xxx = ( Model_iPAQ | 0x000020 ), | 64 | Model_iPAQ_H5xxx = ( Model_iPAQ | 0x000020 ), |
65 | Model_iPAQ_H22xx = ( Model_iPAQ | 0x000040 ), | 65 | Model_iPAQ_H22xx = ( Model_iPAQ | 0x000040 ), |
66 | 66 | ||
67 | Model_Jornada = ( 6 << 24 ), | 67 | Model_Jornada = ( 6 << 24 ), |
68 | Model_Jornada_56x = ( Model_Jornada | 0x000001 ), | 68 | Model_Jornada_56x = ( Model_Jornada | 0x000001 ), |
69 | 69 | ||
70 | Model_Zaurus = ( 2 << 24 ), | 70 | Model_Zaurus = ( 2 << 24 ), |
71 | 71 | ||
72 | Model_Zaurus_SL5000 = ( Model_Zaurus | 0x000001 ), | 72 | Model_Zaurus_SL5000 = ( Model_Zaurus | 0x000001 ), |
73 | Model_Zaurus_SL5500 = ( Model_Zaurus | 0x000002 ), | 73 | Model_Zaurus_SL5500 = ( Model_Zaurus | 0x000002 ), |
74 | Model_Zaurus_SLA300 = ( Model_Zaurus | 0x000003 ), | 74 | Model_Zaurus_SLA300 = ( Model_Zaurus | 0x000003 ), |
75 | Model_Zaurus_SLB600 = ( Model_Zaurus | 0x000004 ), | 75 | Model_Zaurus_SLB600 = ( Model_Zaurus | 0x000004 ), |
76 | Model_Zaurus_SLC7x0 = ( Model_Zaurus | 0x000005 ), | 76 | Model_Zaurus_SLC7x0 = ( Model_Zaurus | 0x000005 ), |
77 | Model_Zaurus_SL6000 = ( Model_Zaurus | 0x000006 ), | ||
77 | 78 | ||
78 | Model_SIMpad = ( 3 << 24 ), | 79 | Model_SIMpad = ( 3 << 24 ), |
79 | 80 | ||
80 | Model_SIMpad_All = ( Model_SIMpad | 0xffffff ), | 81 | Model_SIMpad_All = ( Model_SIMpad | 0xffffff ), |
81 | Model_SIMpad_CL4 = ( Model_SIMpad | 0x000001 ), | 82 | Model_SIMpad_CL4 = ( Model_SIMpad | 0x000001 ), |
82 | Model_SIMpad_SL4 = ( Model_SIMpad | 0x000002 ), | 83 | Model_SIMpad_SL4 = ( Model_SIMpad | 0x000002 ), |
83 | Model_SIMpad_SLC = ( Model_SIMpad | 0x000004 ), | 84 | Model_SIMpad_SLC = ( Model_SIMpad | 0x000004 ), |
84 | Model_SIMpad_TSinus = ( Model_SIMpad | 0x000008 ), | 85 | Model_SIMpad_TSinus = ( Model_SIMpad | 0x000008 ), |
85 | 86 | ||
86 | Model_Ramses = ( 4 << 24 ), | 87 | Model_Ramses = ( 4 << 24 ), |
87 | 88 | ||
88 | Model_Ramses_All = ( Model_Ramses | 0xffffff ), | 89 | Model_Ramses_All = ( Model_Ramses | 0xffffff ), |
89 | Model_Ramses_MNCI = ( Model_Ramses | 0x000001 ), | 90 | Model_Ramses_MNCI = ( Model_Ramses | 0x000001 ), |
90 | 91 | ||
91 | Model_Yopy = ( 5 << 24 ), | 92 | Model_Yopy = ( 5 << 24 ), |
92 | 93 | ||
93 | Model_Yopy_All = ( Model_Yopy | 0xffffff ), | 94 | Model_Yopy_All = ( Model_Yopy | 0xffffff ), |
94 | Model_Yopy_3000 = ( Model_Yopy | 0x000001 ), | 95 | Model_Yopy_3000 = ( Model_Yopy | 0x000001 ), |
95 | Model_Yopy_3500 = ( Model_Yopy | 0x000002 ), | 96 | Model_Yopy_3500 = ( Model_Yopy | 0x000002 ), |
96 | Model_Yopy_3700 = ( Model_Yopy | 0x000003 ), | 97 | Model_Yopy_3700 = ( Model_Yopy | 0x000003 ), |
97 | 98 | ||
98 | Model_Beagle = ( 6 << 24 ), | 99 | Model_Beagle = ( 6 << 24 ), |
99 | 100 | ||
100 | Model_Beagle_All = ( Model_Beagle | 0xffffff ), | 101 | Model_Beagle_All = ( Model_Beagle | 0xffffff ), |
101 | Model_Beagle_PA100 = ( Model_Beagle | 0x000001 ), | 102 | Model_Beagle_PA100 = ( Model_Beagle | 0x000001 ), |
102 | 103 | ||
103 | }; | 104 | }; |
104 | 105 | ||
105 | /** | 106 | /** |
106 | * The vendor of the device | 107 | * The vendor of the device |
107 | */ | 108 | */ |
108 | enum OVendor { | 109 | enum OVendor { |
109 | Vendor_Unknown, | 110 | Vendor_Unknown, |
110 | 111 | ||
111 | Vendor_HP, | 112 | Vendor_HP, |
112 | Vendor_Sharp, | 113 | Vendor_Sharp, |
113 | Vendor_SIEMENS, | 114 | Vendor_SIEMENS, |
114 | Vendor_MundN, | 115 | Vendor_MundN, |
115 | Vendor_GMate, | 116 | Vendor_GMate, |
116 | Vendor_MasterIA, | 117 | Vendor_MasterIA, |
117 | }; | 118 | }; |
118 | 119 | ||
119 | /** | 120 | /** |
120 | * The System used | 121 | * The System used |
121 | */ | 122 | */ |
122 | enum OSystem { | 123 | enum OSystem { |
123 | System_Unknown, | 124 | System_Unknown, |
124 | 125 | ||
diff --git a/libopie2/opiecore/device/odevice_zaurus.cpp b/libopie2/opiecore/device/odevice_zaurus.cpp index 6ac3157..47682bb 100644 --- a/libopie2/opiecore/device/odevice_zaurus.cpp +++ b/libopie2/opiecore/device/odevice_zaurus.cpp | |||
@@ -129,105 +129,109 @@ void Zaurus::init(const QString& cpu_info) | |||
129 | } | 129 | } |
130 | else | 130 | else |
131 | { | 131 | { |
132 | d->m_vendorstr = "OpenZaurus Team"; | 132 | d->m_vendorstr = "OpenZaurus Team"; |
133 | d->m_systemstr = "OpenZaurus"; | 133 | d->m_systemstr = "OpenZaurus"; |
134 | d->m_system = System_OpenZaurus; | 134 | d->m_system = System_OpenZaurus; |
135 | // sysver already gathered | 135 | // sysver already gathered |
136 | 136 | ||
137 | // Openzaurus sometimes uses the embedix kernel, check if this is one | 137 | // Openzaurus sometimes uses the embedix kernel, check if this is one |
138 | FILE *uname = popen("uname -r", "r"); | 138 | FILE *uname = popen("uname -r", "r"); |
139 | QFile f; | 139 | QFile f; |
140 | QString line; | 140 | QString line; |
141 | if ( f.open(IO_ReadOnly, uname) ) { | 141 | if ( f.open(IO_ReadOnly, uname) ) { |
142 | QTextStream ts ( &f ); | 142 | QTextStream ts ( &f ); |
143 | line = ts. readLine(); | 143 | line = ts. readLine(); |
144 | int loc = line. find ( "embedix" ); | 144 | int loc = line. find ( "embedix" ); |
145 | if ( loc != -1 ) | 145 | if ( loc != -1 ) |
146 | m_embedix = true; | 146 | m_embedix = true; |
147 | else | 147 | else |
148 | m_embedix = false; | 148 | m_embedix = false; |
149 | f.close(); | 149 | f.close(); |
150 | } | 150 | } |
151 | pclose(uname); | 151 | pclose(uname); |
152 | } | 152 | } |
153 | 153 | ||
154 | // check the Zaurus model | 154 | // check the Zaurus model |
155 | QString model; | 155 | QString model; |
156 | int loc = cpu_info.find( ":" ); | 156 | int loc = cpu_info.find( ":" ); |
157 | if ( loc != -1 ) | 157 | if ( loc != -1 ) |
158 | model = cpu_info.mid( loc+2 ).simplifyWhiteSpace(); | 158 | model = cpu_info.mid( loc+2 ).simplifyWhiteSpace(); |
159 | else | 159 | else |
160 | model = cpu_info; | 160 | model = cpu_info; |
161 | 161 | ||
162 | if ( model == "SHARP Corgi" ) { | 162 | if ( model == "SHARP Corgi" ) { |
163 | d->m_model = Model_Zaurus_SLC7x0; | 163 | d->m_model = Model_Zaurus_SLC7x0; |
164 | d->m_modelstr = "Zaurus SL-C700"; | 164 | d->m_modelstr = "Zaurus SL-C700"; |
165 | } else if ( model == "SHARP Shepherd" ) { | 165 | } else if ( model == "SHARP Shepherd" ) { |
166 | d->m_model = Model_Zaurus_SLC7x0; | 166 | d->m_model = Model_Zaurus_SLC7x0; |
167 | d->m_modelstr = "Zaurus SL-C750"; | 167 | d->m_modelstr = "Zaurus SL-C750"; |
168 | } else if ( model == "SHARP Husky" ) { | 168 | } else if ( model == "SHARP Husky" ) { |
169 | d->m_model = Model_Zaurus_SLC7x0; | 169 | d->m_model = Model_Zaurus_SLC7x0; |
170 | d->m_modelstr = "Zaurus SL-C760"; | 170 | d->m_modelstr = "Zaurus SL-C760"; |
171 | } else if ( model == "SHARP Poodle" ) { | 171 | } else if ( model == "SHARP Poodle" ) { |
172 | d->m_model = Model_Zaurus_SLB600; | 172 | d->m_model = Model_Zaurus_SLB600; |
173 | d->m_modelstr = "Zaurus SL-B500 or SL-5600"; | 173 | d->m_modelstr = "Zaurus SL-B500 or SL-5600"; |
174 | } else if ( model == "Sharp-Collie" || model == "Collie" ) { | 174 | } else if ( model == "Sharp-Collie" || model == "Collie" ) { |
175 | d->m_model = Model_Zaurus_SL5500; | 175 | d->m_model = Model_Zaurus_SL5500; |
176 | d->m_modelstr = "Zaurus SL-5500 or SL-5000d"; | 176 | d->m_modelstr = "Zaurus SL-5500 or SL-5000d"; |
177 | } else if ( model == "SHARP Tosa" ) { | ||
178 | d->m_model = Model_Zaurus_SL6000; | ||
179 | d->m_modelstr = "Zaurus SL-6000"; | ||
177 | } else { | 180 | } else { |
178 | d->m_model = Model_Zaurus_SL5500; | 181 | d->m_model = Model_Zaurus_SL5500; |
179 | d->m_modelstr = "Unkown Zaurus"; | 182 | d->m_modelstr = "Unkown Zaurus"; |
180 | } | 183 | } |
181 | 184 | ||
182 | // set initial rotation | 185 | // set initial rotation |
183 | 186 | ||
184 | bool flipstate = false; | 187 | bool flipstate = false; |
185 | switch ( d->m_model ) { | 188 | switch ( d->m_model ) { |
189 | case Model_Zaurus_SL6000: | ||
186 | case Model_Zaurus_SLA300: | 190 | case Model_Zaurus_SLA300: |
187 | d->m_rotation = Rot0; | 191 | d->m_rotation = Rot0; |
188 | break; | 192 | break; |
189 | case Model_Zaurus_SLC7x0: | 193 | case Model_Zaurus_SLC7x0: |
190 | d->m_rotation = rotation(); | 194 | d->m_rotation = rotation(); |
191 | d->m_direction = direction(); | 195 | d->m_direction = direction(); |
192 | break; | 196 | break; |
193 | case Model_Zaurus_SLB600: | 197 | case Model_Zaurus_SLB600: |
194 | case Model_Zaurus_SL5500: | 198 | case Model_Zaurus_SL5500: |
195 | case Model_Zaurus_SL5000: | 199 | case Model_Zaurus_SL5000: |
196 | default: | 200 | default: |
197 | d->m_rotation = Rot270; | 201 | d->m_rotation = Rot270; |
198 | break; | 202 | break; |
199 | } | 203 | } |
200 | m_leds [0] = Led_Off; | 204 | m_leds [0] = Led_Off; |
201 | } | 205 | } |
202 | 206 | ||
203 | void Zaurus::initButtons() | 207 | void Zaurus::initButtons() |
204 | { | 208 | { |
205 | if ( d->m_buttons ) | 209 | if ( d->m_buttons ) |
206 | return; | 210 | return; |
207 | 211 | ||
208 | d->m_buttons = new QValueList <ODeviceButton>; | 212 | d->m_buttons = new QValueList <ODeviceButton>; |
209 | 213 | ||
210 | struct z_button * pz_buttons; | 214 | struct z_button * pz_buttons; |
211 | int buttoncount; | 215 | int buttoncount; |
212 | switch ( d->m_model ) { | 216 | switch ( d->m_model ) { |
213 | case Model_Zaurus_SLC7x0: | 217 | case Model_Zaurus_SLC7x0: |
214 | pz_buttons = z_buttons_c700; | 218 | pz_buttons = z_buttons_c700; |
215 | buttoncount = ARRAY_SIZE(z_buttons_c700); | 219 | buttoncount = ARRAY_SIZE(z_buttons_c700); |
216 | break; | 220 | break; |
217 | default: | 221 | default: |
218 | pz_buttons = z_buttons; | 222 | pz_buttons = z_buttons; |
219 | buttoncount = ARRAY_SIZE(z_buttons); | 223 | buttoncount = ARRAY_SIZE(z_buttons); |
220 | break; | 224 | break; |
221 | } | 225 | } |
222 | 226 | ||
223 | for ( int i = 0; i < buttoncount; i++ ) { | 227 | for ( int i = 0; i < buttoncount; i++ ) { |
224 | struct z_button *zb = pz_buttons + i; | 228 | struct z_button *zb = pz_buttons + i; |
225 | ODeviceButton b; | 229 | ODeviceButton b; |
226 | 230 | ||
227 | b. setKeycode ( zb->code ); | 231 | b. setKeycode ( zb->code ); |
228 | b. setUserText ( QObject::tr ( "Button", zb->utext )); | 232 | b. setUserText ( QObject::tr ( "Button", zb->utext )); |
229 | b. setPixmap ( Resource::loadPixmap ( zb->pix )); | 233 | b. setPixmap ( Resource::loadPixmap ( zb->pix )); |
230 | b. setFactoryPresetPressedAction ( OQCopMessage ( makeChannel ( zb->fpressedservice ), | 234 | b. setFactoryPresetPressedAction ( OQCopMessage ( makeChannel ( zb->fpressedservice ), |
231 | zb->fpressedaction )); | 235 | zb->fpressedaction )); |
232 | b. setFactoryPresetHeldAction ( OQCopMessage ( makeChannel ( zb->fheldservice ), | 236 | b. setFactoryPresetHeldAction ( OQCopMessage ( makeChannel ( zb->fheldservice ), |
233 | zb->fheldaction )); | 237 | zb->fheldaction )); |