summaryrefslogtreecommitdiff
path: root/libopie2
Unidiff
Diffstat (limited to 'libopie2') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiecore/device/odevice.cpp6
-rw-r--r--libopie2/opiecore/device/odevice.h6
-rw-r--r--libopie2/opiecore/device/odevice_zaurus.cpp17
3 files changed, 24 insertions, 5 deletions
diff --git a/libopie2/opiecore/device/odevice.cpp b/libopie2/opiecore/device/odevice.cpp
index 5e91d8b..56f305f 100644
--- a/libopie2/opiecore/device/odevice.cpp
+++ b/libopie2/opiecore/device/odevice.cpp
@@ -168,24 +168,25 @@ ODevice::ODevice()
168{ 168{
169 d = new ODeviceData; 169 d = new ODeviceData;
170 170
171 d->m_modelstr = "Unknown"; 171 d->m_modelstr = "Unknown";
172 d->m_model = Model_Unknown; 172 d->m_model = Model_Unknown;
173 d->m_vendorstr = "Unknown"; 173 d->m_vendorstr = "Unknown";
174 d->m_vendor = Vendor_Unknown; 174 d->m_vendor = Vendor_Unknown;
175 d->m_systemstr = "Unknown"; 175 d->m_systemstr = "Unknown";
176 d->m_system = System_Unknown; 176 d->m_system = System_Unknown;
177 d->m_sysverstr = "0.0"; 177 d->m_sysverstr = "0.0";
178 d->m_rotation = Rot0; 178 d->m_rotation = Rot0;
179 d->m_direction = CW; 179 d->m_direction = CW;
180 d->m_qteDriver = "Transformed";
180 181
181 d->m_holdtime = 1000; // 1000ms 182 d->m_holdtime = 1000; // 1000ms
182 d->m_buttons = 0; 183 d->m_buttons = 0;
183 d->m_cpu_frequencies = new QStrList; 184 d->m_cpu_frequencies = new QStrList;
184 185
185 186
186 /* mixer */ 187 /* mixer */
187 d->m_sound = d->m_vol = d->m_mixer = -1; 188 d->m_sound = d->m_vol = d->m_mixer = -1;
188 189
189 /* System QCopChannel created */ 190 /* System QCopChannel created */
190 d->m_initializedButtonQcop = false; 191 d->m_initializedButtonQcop = false;
191 192
@@ -393,24 +394,29 @@ Transformation ODevice::rotation() const
393{ 394{
394 return d->m_rotation; 395 return d->m_rotation;
395} 396}
396 397
397/** 398/**
398* @return the current rotation direction 399* @return the current rotation direction
399*/ 400*/
400ODirection ODevice::direction() const 401ODirection ODevice::direction() const
401{ 402{
402 return d->m_direction; 403 return d->m_direction;
403} 404}
404 405
406QString ODevice::qteDriver() const
407{
408 return d->m_qteDriver;
409}
410
405/** 411/**
406* This plays an alarm sound 412* This plays an alarm sound
407*/ 413*/
408void ODevice::playAlarmSound() 414void ODevice::playAlarmSound()
409{ 415{
410#ifndef QT_NO_SOUND 416#ifndef QT_NO_SOUND
411 static Sound snd ( "alarm" ); 417 static Sound snd ( "alarm" );
412 418
413 if ( snd. isFinished()) 419 if ( snd. isFinished())
414 snd. play(); 420 snd. play();
415#endif 421#endif
416} 422}
diff --git a/libopie2/opiecore/device/odevice.h b/libopie2/opiecore/device/odevice.h
index 5db43ff..b8478b9 100644
--- a/libopie2/opiecore/device/odevice.h
+++ b/libopie2/opiecore/device/odevice.h
@@ -227,44 +227,44 @@ private:
227 227
228protected: 228protected:
229 ODevice(); 229 ODevice();
230 virtual void init(const QString&); 230 virtual void init(const QString&);
231 virtual void initButtons(); 231 virtual void initButtons();
232 static void sendSuspendmsg(); 232 static void sendSuspendmsg();
233 233
234 ODeviceData *d; 234 ODeviceData *d;
235 235
236public: 236public:
237 // sandman do we want to allow destructions? -zecke? 237 // sandman do we want to allow destructions? -zecke?
238 virtual ~ODevice(); 238 virtual ~ODevice();
239
240 static ODevice *inst(); 239 static ODevice *inst();
241 240
242 // information 241 // information
243
244 QString modelString() const; 242 QString modelString() const;
245 OModel model() const; 243 OModel model() const;
246 inline OModel series() const { return (OModel) ( model() & Model_Series_Mask ); } 244 inline OModel series() const { return (OModel) ( model() & Model_Series_Mask ); }
247 245
248 QString vendorString() const; 246 QString vendorString() const;
249 OVendor vendor() const; 247 OVendor vendor() const;
250 248
251 QString systemString() const; 249 QString systemString() const;
252 OSystem system() const; 250 OSystem system() const;
253 251
254 QString systemVersionString() const; 252 QString systemVersionString() const;
255 253
256 virtual Transformation rotation() const; 254 virtual Transformation rotation() const;
257 virtual ODirection direction() const; 255 virtual ODirection direction() const;
258 256
257 QString qteDriver() const;
258
259 // system 259 // system
260 virtual bool suspend(); 260 virtual bool suspend();
261 261
262 virtual bool setDisplayStatus ( bool on ); 262 virtual bool setDisplayStatus ( bool on );
263 virtual bool setDisplayBrightness ( int brightness ); 263 virtual bool setDisplayBrightness ( int brightness );
264 virtual int displayBrightnessResolution() const; 264 virtual int displayBrightnessResolution() const;
265 virtual bool setDisplayContrast ( int contrast ); 265 virtual bool setDisplayContrast ( int contrast );
266 virtual int displayContrastResolution() const; 266 virtual int displayContrastResolution() const;
267 267
268 // don't add new virtual methods, use this: 268 // don't add new virtual methods, use this:
269 // /*virtual */ void boo(int i ) { return virtual_hook(1,&i); }; 269 // /*virtual */ void boo(int i ) { return virtual_hook(1,&i); };
270 // and in your subclass do overwrite 270 // and in your subclass do overwrite
@@ -350,24 +350,26 @@ class ODeviceData {
350 350
351 QString m_modelstr; 351 QString m_modelstr;
352 OModel m_model; 352 OModel m_model;
353 353
354 QString m_systemstr; 354 QString m_systemstr;
355 OSystem m_system; 355 OSystem m_system;
356 356
357 QString m_sysverstr; 357 QString m_sysverstr;
358 358
359 Transformation m_rotation; 359 Transformation m_rotation;
360 ODirection m_direction; 360 ODirection m_direction;
361 361
362 QString m_qteDriver;
363
362 QValueList <ODeviceButton> *m_buttons; 364 QValueList <ODeviceButton> *m_buttons;
363 uint m_holdtime; 365 uint m_holdtime;
364 QStrList *m_cpu_frequencies; 366 QStrList *m_cpu_frequencies;
365 bool m_initializedButtonQcop : 1; 367 bool m_initializedButtonQcop : 1;
366 368
367 /* values for changeMixerForAlarm */ 369 /* values for changeMixerForAlarm */
368 int m_sound, m_vol, m_mixer; 370 int m_sound, m_vol, m_mixer;
369}; 371};
370 372
371extern bool isQWS(); 373extern bool isQWS();
372extern QCString makeChannel ( const char *str ); 374extern QCString makeChannel ( const char *str );
373} 375}
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
@@ -190,56 +190,67 @@ void Zaurus::init(const QString& cpu_info)
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
242void Zaurus::initButtons() 253void Zaurus::initButtons()
243{ 254{
244 if ( d->m_buttons ) 255 if ( d->m_buttons )
245 return; 256 return;