Diffstat (limited to 'libopie2/opiecore/device/odevice_zaurus.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie2/opiecore/device/odevice_zaurus.cpp | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/libopie2/opiecore/device/odevice_zaurus.cpp b/libopie2/opiecore/device/odevice_zaurus.cpp index 21d2342..0c421e3 100644 --- a/libopie2/opiecore/device/odevice_zaurus.cpp +++ b/libopie2/opiecore/device/odevice_zaurus.cpp | |||
@@ -154,128 +154,139 @@ void Zaurus::init(const QString& cpu_info) | |||
154 | line = ts.readLine(); | 154 | line = ts.readLine(); |
155 | m_embedix = line.startsWith( "2.4." ); | 155 | m_embedix = line.startsWith( "2.4." ); |
156 | f.close(); | 156 | f.close(); |
157 | } | 157 | } |
158 | pclose(uname); | 158 | pclose(uname); |
159 | } | 159 | } |
160 | 160 | ||
161 | // check the Zaurus model | 161 | // check the Zaurus model |
162 | QString model; | 162 | QString model; |
163 | int loc = cpu_info.find( ":" ); | 163 | int loc = cpu_info.find( ":" ); |
164 | if ( loc != -1 ) | 164 | if ( loc != -1 ) |
165 | model = cpu_info.mid( loc+2 ).simplifyWhiteSpace(); | 165 | model = cpu_info.mid( loc+2 ).simplifyWhiteSpace(); |
166 | else | 166 | else |
167 | model = cpu_info; | 167 | model = cpu_info; |
168 | 168 | ||
169 | if ( model == "SHARP Corgi" ) { | 169 | if ( model == "SHARP Corgi" ) { |
170 | d->m_model = Model_Zaurus_SLC7x0; | 170 | d->m_model = Model_Zaurus_SLC7x0; |
171 | d->m_modelstr = "Zaurus SL-C700"; | 171 | d->m_modelstr = "Zaurus SL-C700"; |
172 | } else if ( model == "SHARP Shepherd" ) { | 172 | } else if ( model == "SHARP Shepherd" ) { |
173 | d->m_model = Model_Zaurus_SLC7x0; | 173 | d->m_model = Model_Zaurus_SLC7x0; |
174 | d->m_modelstr = "Zaurus SL-C750"; | 174 | d->m_modelstr = "Zaurus SL-C750"; |
175 | } else if ( model == "SHARP Husky" ) { | 175 | } else if ( model == "SHARP Husky" ) { |
176 | d->m_model = Model_Zaurus_SLC7x0; | 176 | d->m_model = Model_Zaurus_SLC7x0; |
177 | d->m_modelstr = "Zaurus SL-C760 or SL-C860"; | 177 | d->m_modelstr = "Zaurus SL-C760 or SL-C860"; |
178 | } else if ( model == "SHARP Boxer" ) { | 178 | } else if ( model == "SHARP Boxer" ) { |
179 | d->m_model = Model_Zaurus_SLC7x0; | 179 | d->m_model = Model_Zaurus_SLC7x0; |
180 | d->m_modelstr = "Zaurus SL-C760 or SL-C860"; | 180 | d->m_modelstr = "Zaurus SL-C760 or SL-C860"; |
181 | } else if ( model == "SHARP Poodle" ) { | 181 | } else if ( model == "SHARP Poodle" ) { |
182 | d->m_model = Model_Zaurus_SLB600; | 182 | d->m_model = Model_Zaurus_SLB600; |
183 | d->m_modelstr = "Zaurus SL-B500 or SL-5600"; | 183 | d->m_modelstr = "Zaurus SL-B500 or SL-5600"; |
184 | } else if ( model == "Sharp-Collie" || model == "Collie" ) { | 184 | } else if ( model == "Sharp-Collie" || model == "Collie" ) { |
185 | d->m_model = Model_Zaurus_SL5500; | 185 | d->m_model = Model_Zaurus_SL5500; |
186 | d->m_modelstr = "Zaurus SL-5500 or SL-5000d"; | 186 | d->m_modelstr = "Zaurus SL-5500 or SL-5000d"; |
187 | } else if ( model == "SHARP Tosa" ) { | 187 | } else if ( model == "SHARP Tosa" ) { |
188 | d->m_model = Model_Zaurus_SL6000; | 188 | d->m_model = Model_Zaurus_SL6000; |
189 | d->m_modelstr = "Zaurus SL-6000"; | 189 | d->m_modelstr = "Zaurus SL-6000"; |
190 | } else if ( model == "SHARP Spitz" ) { | 190 | } else if ( model == "SHARP Spitz" ) { |
191 | d->m_model = Model_Zaurus_SLC3000; | 191 | d->m_model = Model_Zaurus_SLC3000; |
192 | d->m_modelstr = "Zaurus SL-C3000"; | 192 | d->m_modelstr = "Zaurus SL-C3000"; |
193 | } else if ( model == "SHARP Akita" ) { | 193 | } else if ( model == "SHARP Akita" ) { |
194 | d->m_model = Model_Zaurus_SLC1000; | 194 | d->m_model = Model_Zaurus_SLC1000; |
195 | d->m_modelstr = "Zaurus SL-C1000"; | 195 | d->m_modelstr = "Zaurus SL-C1000"; |
196 | } else { | 196 | } else { |
197 | d->m_model = Model_Zaurus_SL5500; | 197 | d->m_model = Model_Zaurus_SL5500; |
198 | d->m_modelstr = "Unknown Zaurus"; | 198 | d->m_modelstr = "Unknown Zaurus"; |
199 | } | 199 | } |
200 | 200 | ||
201 | // set path to backlight device in kernel 2.6 | 201 | // set path to backlight device in kernel 2.6 |
202 | switch ( d->m_model ) { | 202 | switch ( d->m_model ) |
203 | { | ||
203 | case Model_Zaurus_SLB600: // fallthrough | 204 | case Model_Zaurus_SLB600: // fallthrough |
204 | case Model_Zaurus_SL5500: | 205 | case Model_Zaurus_SL5500: |
205 | m_backlightdev = "/sys/class/backlight/locomo-backlight/"; | 206 | m_backlightdev = "/sys/class/backlight/locomo-backlight/"; |
206 | break; | 207 | break; |
207 | case Model_Zaurus_SL6000: | 208 | case Model_Zaurus_SL6000: |
208 | m_backlightdev = "/sys/class/backlight/tosa-bl/"; | 209 | m_backlightdev = "/sys/class/backlight/tosa-bl/"; |
209 | break; | 210 | break; |
210 | default: | 211 | default: |
211 | m_backlightdev = "/sys/class/backlight/corgi-bl/"; | 212 | m_backlightdev = "/sys/class/backlight/corgi-bl/"; |
212 | break; | ||
213 | } | 213 | } |
214 | 214 | ||
215 | // set initial rotation | 215 | // set initial rotation |
216 | switch( d->m_model ) { | 216 | switch( d->m_model ) |
217 | { | ||
217 | case Model_Zaurus_SL6000: // fallthrough | 218 | case Model_Zaurus_SL6000: // fallthrough |
218 | case Model_Zaurus_SLA300: | 219 | case Model_Zaurus_SLA300: |
219 | d->m_rotation = Rot0; | 220 | d->m_rotation = Rot0; |
220 | break; | 221 | break; |
221 | case Model_Zaurus_SLC3000: // fallthrough | 222 | case Model_Zaurus_SLC3000: // fallthrough |
222 | case Model_Zaurus_SLC1000: // fallthrough | 223 | case Model_Zaurus_SLC1000: // fallthrough |
223 | case Model_Zaurus_SLC7x0: | 224 | case Model_Zaurus_SLC7x0: |
224 | d->m_rotation = rotation(); | 225 | d->m_rotation = rotation(); |
225 | d->m_direction = direction(); | 226 | d->m_direction = direction(); |
226 | break; | 227 | break; |
227 | case Model_Zaurus_SLB600: // fallthrough | 228 | case Model_Zaurus_SLB600: // fallthrough |
228 | case Model_Zaurus_SL5000: // fallthrough | 229 | case Model_Zaurus_SL5000: // fallthrough |
229 | case Model_Zaurus_SL5500: // fallthrough | 230 | case Model_Zaurus_SL5500: // fallthrough |
230 | default: | 231 | default: |
231 | d->m_rotation = Rot270; | 232 | d->m_rotation = Rot270; |
233 | } | ||
234 | |||
235 | // set default qte driver | ||
236 | switch( d->m_model ) | ||
237 | { | ||
238 | case Model_Zaurus_SLC7x0: | ||
239 | d->m_qteDriver = "W100"; | ||
232 | break; | 240 | break; |
241 | default: | ||
242 | d->m_qteDriver = "Transformed"; | ||
233 | } | 243 | } |
244 | |||
234 | m_leds[0] = Led_Off; | 245 | m_leds[0] = Led_Off; |
235 | 246 | ||
236 | if ( m_embedix ) | 247 | if ( m_embedix ) |
237 | qDebug( "Zaurus::init() - Using the 2.4 Embedix HAL on a %s", (const char*) d->m_modelstr ); | 248 | qDebug( "Zaurus::init() - Using the 2.4 Embedix HAL on a %s", (const char*) d->m_modelstr ); |
238 | else | 249 | else |
239 | qDebug( "Zaurus::init() - Using the 2.6 OpenZaurus HAL on a %s", (const char*) d->m_modelstr ); | 250 | qDebug( "Zaurus::init() - Using the 2.6 OpenZaurus HAL on a %s", (const char*) d->m_modelstr ); |
240 | } | 251 | } |
241 | 252 | ||
242 | void Zaurus::initButtons() | 253 | void Zaurus::initButtons() |
243 | { | 254 | { |
244 | if ( d->m_buttons ) | 255 | if ( d->m_buttons ) |
245 | return; | 256 | return; |
246 | 257 | ||
247 | 258 | ||
248 | d->m_buttons = new QValueList <ODeviceButton>; | 259 | d->m_buttons = new QValueList <ODeviceButton>; |
249 | 260 | ||
250 | struct z_button * pz_buttons; | 261 | struct z_button * pz_buttons; |
251 | int buttoncount; | 262 | int buttoncount; |
252 | switch ( d->m_model ) { | 263 | switch ( d->m_model ) { |
253 | case Model_Zaurus_SLC3000: // fallthrough | 264 | case Model_Zaurus_SLC3000: // fallthrough |
254 | case Model_Zaurus_SLC1000: // fallthrough | 265 | case Model_Zaurus_SLC1000: // fallthrough |
255 | case Model_Zaurus_SLC7x0: | 266 | case Model_Zaurus_SLC7x0: |
256 | if ( isQWS( ) ) { | 267 | if ( isQWS( ) ) { |
257 | addPreHandler(this); // hinge-sensor-handler | 268 | addPreHandler(this); // hinge-sensor-handler |
258 | } | 269 | } |
259 | pz_buttons = z_buttons_c700; | 270 | pz_buttons = z_buttons_c700; |
260 | buttoncount = ARRAY_SIZE(z_buttons_c700); | 271 | buttoncount = ARRAY_SIZE(z_buttons_c700); |
261 | break; | 272 | break; |
262 | default: | 273 | default: |
263 | pz_buttons = z_buttons; | 274 | pz_buttons = z_buttons; |
264 | buttoncount = ARRAY_SIZE(z_buttons); | 275 | buttoncount = ARRAY_SIZE(z_buttons); |
265 | break; | 276 | break; |
266 | } | 277 | } |
267 | 278 | ||
268 | for ( int i = 0; i < buttoncount; i++ ) { | 279 | for ( int i = 0; i < buttoncount; i++ ) { |
269 | struct z_button *zb = pz_buttons + i; | 280 | struct z_button *zb = pz_buttons + i; |
270 | ODeviceButton b; | 281 | ODeviceButton b; |
271 | 282 | ||
272 | b.setKeycode( zb->code ); | 283 | b.setKeycode( zb->code ); |
273 | b.setUserText( QObject::tr( "Button", zb->utext )); | 284 | b.setUserText( QObject::tr( "Button", zb->utext )); |
274 | b.setPixmap( OResource::loadPixmap( zb->pix )); | 285 | b.setPixmap( OResource::loadPixmap( zb->pix )); |
275 | b.setFactoryPresetPressedAction( OQCopMessage( makeChannel ( zb->fpressedservice ), zb->fpressedaction )); | 286 | b.setFactoryPresetPressedAction( OQCopMessage( makeChannel ( zb->fpressedservice ), zb->fpressedaction )); |
276 | b.setFactoryPresetHeldAction( OQCopMessage( makeChannel ( zb->fheldservice ), zb->fheldaction )); | 287 | b.setFactoryPresetHeldAction( OQCopMessage( makeChannel ( zb->fheldservice ), zb->fheldaction )); |
277 | d->m_buttons->append( b ); | 288 | d->m_buttons->append( b ); |
278 | } | 289 | } |
279 | 290 | ||
280 | reloadButtonMapping(); | 291 | reloadButtonMapping(); |
281 | } | 292 | } |