summaryrefslogtreecommitdiff
authorsandman <sandman>2002-11-19 00:58:14 (UTC)
committer sandman <sandman>2002-11-19 00:58:14 (UTC)
commit9581e5b0b3b4b4e36d8356f15dd33eba9cf99b31 (patch) (unidiff)
treee0656e311b020954e08f2cb9abd45aba6cf7f360
parented81ae3a2a504c324481b85ceb24808381b5b89c (diff)
downloadopie-9581e5b0b3b4b4e36d8356f15dd33eba9cf99b31.zip
opie-9581e5b0b3b4b4e36d8356f15dd33eba9cf99b31.tar.gz
opie-9581e5b0b3b4b4e36d8356f15dd33eba9cf99b31.tar.bz2
Removed the last QT_QWS_* in libopie .. the libopie binary should now be
interchangeable between iPAQ, OZ and retail Z (in theory ;) )
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libopie/odevice.cpp8
1 files changed, 0 insertions, 8 deletions
diff --git a/libopie/odevice.cpp b/libopie/odevice.cpp
index 25c9826..2d2f7db 100644
--- a/libopie/odevice.cpp
+++ b/libopie/odevice.cpp
@@ -275,97 +275,91 @@ QString ODevice::vendorString ( ) const
275OVendor ODevice::vendor ( ) const 275OVendor ODevice::vendor ( ) const
276{ 276{
277 return d-> m_vendor; 277 return d-> m_vendor;
278} 278}
279 279
280QString ODevice::modelString ( ) const 280QString ODevice::modelString ( ) const
281{ 281{
282 return d-> m_modelstr; 282 return d-> m_modelstr;
283} 283}
284 284
285OModel ODevice::model ( ) const 285OModel ODevice::model ( ) const
286{ 286{
287 return d-> m_model; 287 return d-> m_model;
288} 288}
289 289
290QString ODevice::systemString ( ) const 290QString ODevice::systemString ( ) const
291{ 291{
292 return d-> m_systemstr; 292 return d-> m_systemstr;
293} 293}
294 294
295OSystem ODevice::system ( ) const 295OSystem ODevice::system ( ) const
296{ 296{
297 return d-> m_system; 297 return d-> m_system;
298} 298}
299 299
300QString ODevice::systemVersionString ( ) const 300QString ODevice::systemVersionString ( ) const
301{ 301{
302 return d-> m_sysverstr; 302 return d-> m_sysverstr;
303} 303}
304 304
305void ODevice::alarmSound ( ) 305void ODevice::alarmSound ( )
306{ 306{
307#ifndef QT_QWS_EBX
308#ifndef QT_NO_SOUND 307#ifndef QT_NO_SOUND
309 static Sound snd ( "alarm" ); 308 static Sound snd ( "alarm" );
310 309
311 if ( snd. isFinished ( )) 310 if ( snd. isFinished ( ))
312 snd. play ( ); 311 snd. play ( );
313#endif 312#endif
314#endif
315} 313}
316 314
317void ODevice::keySound ( ) 315void ODevice::keySound ( )
318{ 316{
319#ifndef QT_QWS_EBX
320#ifndef QT_NO_SOUND 317#ifndef QT_NO_SOUND
321 static Sound snd ( "keysound" ); 318 static Sound snd ( "keysound" );
322 319
323 if ( snd. isFinished ( )) 320 if ( snd. isFinished ( ))
324 snd. play ( ); 321 snd. play ( );
325#endif 322#endif
326#endif
327} 323}
328 324
329void ODevice::touchSound ( ) 325void ODevice::touchSound ( )
330{ 326{
331 327
332#ifndef QT_QWS_EBX
333#ifndef QT_NO_SOUND 328#ifndef QT_NO_SOUND
334 static Sound snd ( "touchsound" ); 329 static Sound snd ( "touchsound" );
335 330
336 if ( snd. isFinished ( )) 331 if ( snd. isFinished ( ))
337 snd. play ( ); 332 snd. play ( );
338#endif 333#endif
339#endif
340} 334}
341 335
342 336
343QValueList <OLed> ODevice::ledList ( ) const 337QValueList <OLed> ODevice::ledList ( ) const
344{ 338{
345 return QValueList <OLed> ( ); 339 return QValueList <OLed> ( );
346} 340}
347 341
348QValueList <OLedState> ODevice::ledStateList ( OLed /*which*/ ) const 342QValueList <OLedState> ODevice::ledStateList ( OLed /*which*/ ) const
349{ 343{
350 return QValueList <OLedState> ( ); 344 return QValueList <OLedState> ( );
351} 345}
352 346
353OLedState ODevice::ledState ( OLed /*which*/ ) const 347OLedState ODevice::ledState ( OLed /*which*/ ) const
354{ 348{
355 return Led_Off; 349 return Led_Off;
356} 350}
357 351
358bool ODevice::setLedState ( OLed /*which*/, OLedState /*st*/ ) 352bool ODevice::setLedState ( OLed /*which*/, OLedState /*st*/ )
359{ 353{
360 return false; 354 return false;
361} 355}
362 356
363bool ODevice::hasLightSensor ( ) const 357bool ODevice::hasLightSensor ( ) const
364{ 358{
365 return false; 359 return false;
366} 360}
367 361
368int ODevice::readLightSensor ( ) 362int ODevice::readLightSensor ( )
369{ 363{
370 return -1; 364 return -1;
371} 365}
@@ -563,101 +557,99 @@ bool iPAQ::filter ( int /*unicode*/, int keycode, int modifiers, bool isPress, b
563 m_power_timer = 0; 557 m_power_timer = 0;
564 QWSServer::sendKeyEvent ( -1, HardKey_Suspend, 0, true, false ); 558 QWSServer::sendKeyEvent ( -1, HardKey_Suspend, 0, true, false );
565 QWSServer::sendKeyEvent ( -1, HardKey_Suspend, 0, false, false ); 559 QWSServer::sendKeyEvent ( -1, HardKey_Suspend, 0, false, false );
566 } 560 }
567 newkeycode = Key_unknown; 561 newkeycode = Key_unknown;
568 } 562 }
569 //nobreak; 563 //nobreak;
570 564
571 default: 565 default:
572 break; 566 break;
573 } 567 }
574 568
575 if ( newkeycode != keycode ) { 569 if ( newkeycode != keycode ) {
576 if ( newkeycode != Key_unknown ) 570 if ( newkeycode != Key_unknown )
577 QWSServer::sendKeyEvent ( -1, newkeycode, modifiers, isPress, autoRepeat ); 571 QWSServer::sendKeyEvent ( -1, newkeycode, modifiers, isPress, autoRepeat );
578 return true; 572 return true;
579 } 573 }
580 else 574 else
581 return false; 575 return false;
582} 576}
583 577
584void iPAQ::timerEvent ( QTimerEvent * ) 578void iPAQ::timerEvent ( QTimerEvent * )
585{ 579{
586 killTimer ( m_power_timer ); 580 killTimer ( m_power_timer );
587 m_power_timer = 0; 581 m_power_timer = 0;
588 QWSServer::sendKeyEvent ( -1, HardKey_Backlight, 0, true, false ); 582 QWSServer::sendKeyEvent ( -1, HardKey_Backlight, 0, true, false );
589 QWSServer::sendKeyEvent ( -1, HardKey_Backlight, 0, false, false ); 583 QWSServer::sendKeyEvent ( -1, HardKey_Backlight, 0, false, false );
590} 584}
591 585
592 586
593void iPAQ::alarmSound ( ) 587void iPAQ::alarmSound ( )
594{ 588{
595#if defined( QT_QWS_IPAQ ) // IPAQ
596#ifndef QT_NO_SOUND 589#ifndef QT_NO_SOUND
597 static Sound snd ( "alarm" ); 590 static Sound snd ( "alarm" );
598 int fd; 591 int fd;
599 int vol; 592 int vol;
600 bool vol_reset = false; 593 bool vol_reset = false;
601 594
602 if (( fd = ::open ( "/dev/sound/mixer", O_RDWR )) >= 0 ) { 595 if (( fd = ::open ( "/dev/sound/mixer", O_RDWR )) >= 0 ) {
603 if ( ::ioctl ( fd, MIXER_READ( 0 ), &vol ) >= 0 ) { 596 if ( ::ioctl ( fd, MIXER_READ( 0 ), &vol ) >= 0 ) {
604 Config cfg ( "qpe" ); 597 Config cfg ( "qpe" );
605 cfg. setGroup ( "Volume" ); 598 cfg. setGroup ( "Volume" );
606 599
607 int volalarm = cfg. readNumEntry ( "AlarmPercent", 50 ); 600 int volalarm = cfg. readNumEntry ( "AlarmPercent", 50 );
608 if ( volalarm < 0 ) 601 if ( volalarm < 0 )
609 volalarm = 0; 602 volalarm = 0;
610 else if ( volalarm > 100 ) 603 else if ( volalarm > 100 )
611 volalarm = 100; 604 volalarm = 100;
612 volalarm |= ( volalarm << 8 ); 605 volalarm |= ( volalarm << 8 );
613 606
614 if (( volalarm & 0xff ) > ( vol & 0xff )) { 607 if (( volalarm & 0xff ) > ( vol & 0xff )) {
615 if ( ::ioctl ( fd, MIXER_WRITE( 0 ), &volalarm ) >= 0 ) 608 if ( ::ioctl ( fd, MIXER_WRITE( 0 ), &volalarm ) >= 0 )
616 vol_reset = true; 609 vol_reset = true;
617 } 610 }
618 } 611 }
619 } 612 }
620 613
621 snd. play ( ); 614 snd. play ( );
622 while ( !snd. isFinished ( )) 615 while ( !snd. isFinished ( ))
623 qApp-> processEvents ( ); 616 qApp-> processEvents ( );
624 617
625 if ( fd >= 0 ) { 618 if ( fd >= 0 ) {
626 if ( vol_reset ) 619 if ( vol_reset )
627 ::ioctl ( fd, MIXER_WRITE( 0 ), &vol ); 620 ::ioctl ( fd, MIXER_WRITE( 0 ), &vol );
628 ::close ( fd ); 621 ::close ( fd );
629 } 622 }
630#endif 623#endif
631#endif
632} 624}
633 625
634 626
635bool iPAQ::setSoftSuspend ( bool soft ) 627bool iPAQ::setSoftSuspend ( bool soft )
636{ 628{
637 bool res = false; 629 bool res = false;
638 int fd; 630 int fd;
639 631
640 if (( fd = ::open ( "/proc/sys/ts/suspend_button_mode", O_WRONLY )) >= 0 ) { 632 if (( fd = ::open ( "/proc/sys/ts/suspend_button_mode", O_WRONLY )) >= 0 ) {
641 if ( ::write ( fd, soft ? "1" : "0", 1 ) == 1 ) 633 if ( ::write ( fd, soft ? "1" : "0", 1 ) == 1 )
642 res = true; 634 res = true;
643 else 635 else
644 ::perror ( "write to /proc/sys/ts/suspend_button_mode" ); 636 ::perror ( "write to /proc/sys/ts/suspend_button_mode" );
645 637
646 ::close ( fd ); 638 ::close ( fd );
647 } 639 }
648 else 640 else
649 ::perror ( "/proc/sys/ts/suspend_button_mode" ); 641 ::perror ( "/proc/sys/ts/suspend_button_mode" );
650 642
651 return res; 643 return res;
652} 644}
653 645
654 646
655bool iPAQ::setDisplayBrightness ( int bright ) 647bool iPAQ::setDisplayBrightness ( int bright )
656{ 648{
657 bool res = false; 649 bool res = false;
658 int fd; 650 int fd;
659 651
660 if ( bright > 255 ) 652 if ( bright > 255 )
661 bright = 255; 653 bright = 255;
662 if ( bright < 0 ) 654 if ( bright < 0 )
663 bright = 0; 655 bright = 0;