summaryrefslogtreecommitdiff
path: root/libopie2/opiecore/device/odevice_ipaq.cpp
Unidiff
Diffstat (limited to 'libopie2/opiecore/device/odevice_ipaq.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiecore/device/odevice_ipaq.cpp21
1 files changed, 0 insertions, 21 deletions
diff --git a/libopie2/opiecore/device/odevice_ipaq.cpp b/libopie2/opiecore/device/odevice_ipaq.cpp
index 9e01a0c..2ce38a9 100644
--- a/libopie2/opiecore/device/odevice_ipaq.cpp
+++ b/libopie2/opiecore/device/odevice_ipaq.cpp
@@ -315,69 +315,48 @@ bool iPAQ::filter ( int /*unicode*/, int keycode, int modifiers, bool isPress, b
315 return false; 315 return false;
316} 316}
317 317
318void iPAQ::timerEvent ( QTimerEvent * ) 318void iPAQ::timerEvent ( QTimerEvent * )
319{ 319{
320 killTimer ( m_power_timer ); 320 killTimer ( m_power_timer );
321 m_power_timer = 0; 321 m_power_timer = 0;
322 QWSServer::sendKeyEvent ( -1, HardKey_Backlight, 0, true, false ); 322 QWSServer::sendKeyEvent ( -1, HardKey_Backlight, 0, true, false );
323 QWSServer::sendKeyEvent ( -1, HardKey_Backlight, 0, false, false ); 323 QWSServer::sendKeyEvent ( -1, HardKey_Backlight, 0, false, false );
324} 324}
325 325
326 326
327void iPAQ::playAlarmSound() 327void iPAQ::playAlarmSound()
328{ 328{
329#ifndef QT_NO_SOUND 329#ifndef QT_NO_SOUND
330 static Sound snd ( "alarm" ); 330 static Sound snd ( "alarm" );
331 if(!snd.isFinished()) 331 if(!snd.isFinished())
332 return; 332 return;
333 333
334 changeMixerForAlarm(0, "/dev/sound/mixer", &snd ); 334 changeMixerForAlarm(0, "/dev/sound/mixer", &snd );
335 snd. play(); 335 snd. play();
336#endif 336#endif
337} 337}
338 338
339
340bool iPAQ::setSoftSuspend ( bool soft )
341{
342 bool res = false;
343 int fd;
344
345 if (( fd = ::open ( "/proc/sys/ts/suspend_button_mode", O_WRONLY )) >= 0 ) {
346 if ( ::write ( fd, soft ? "1" : "0", 1 ) == 1 )
347 res = true;
348 else
349 ::perror ( "write to /proc/sys/ts/suspend_button_mode" );
350
351 ::close ( fd );
352 }
353 else
354 ::perror ( "/proc/sys/ts/suspend_button_mode" );
355
356 return res;
357}
358
359
360bool iPAQ::setDisplayBrightness ( int bright ) 339bool iPAQ::setDisplayBrightness ( int bright )
361{ 340{
362 bool res = false; 341 bool res = false;
363 int fd; 342 int fd;
364 343
365 if ( bright > 255 ) 344 if ( bright > 255 )
366 bright = 255; 345 bright = 255;
367 if ( bright < 0 ) 346 if ( bright < 0 )
368 bright = 0; 347 bright = 0;
369 348
370 if (( fd = ::open ( "/dev/touchscreen/0", O_WRONLY )) >= 0 ) { 349 if (( fd = ::open ( "/dev/touchscreen/0", O_WRONLY )) >= 0 ) {
371 FLITE_IN bl; 350 FLITE_IN bl;
372 bl. mode = 1; 351 bl. mode = 1;
373 bl. pwr = bright ? 1 : 0; 352 bl. pwr = bright ? 1 : 0;
374 bl. brightness = ( bright * ( displayBrightnessResolution() - 1 ) + 127 ) / 255; 353 bl. brightness = ( bright * ( displayBrightnessResolution() - 1 ) + 127 ) / 255;
375 res = ( ::ioctl ( fd, FLITE_ON, &bl ) == 0 ); 354 res = ( ::ioctl ( fd, FLITE_ON, &bl ) == 0 );
376 ::close ( fd ); 355 ::close ( fd );
377 } 356 }
378 return res; 357 return res;
379} 358}
380 359
381int iPAQ::displayBrightnessResolution() const 360int iPAQ::displayBrightnessResolution() const
382{ 361{
383 switch ( model()) { 362 switch ( model()) {