author | mickeyl <mickeyl> | 2005-02-06 22:53:53 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2005-02-06 22:53:53 (UTC) |
commit | ab32151cd8e85deb354bab04e25efb1f3f399dee (patch) (side-by-side diff) | |
tree | 66ab72d210bbc50c0e535986c61ca23f68efbfd1 /libopie2/opiecore/device/odevice.cpp | |
parent | ec33239c6edd9927fe2f82953fa48dec47d19567 (diff) | |
download | opie-ab32151cd8e85deb354bab04e25efb1f3f399dee.zip opie-ab32151cd8e85deb354bab04e25efb1f3f399dee.tar.gz opie-ab32151cd8e85deb354bab04e25efb1f3f399dee.tar.bz2 |
make autorotate also work on kernel 2.6
Diffstat (limited to 'libopie2/opiecore/device/odevice.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | libopie2/opiecore/device/odevice.cpp | 62 |
1 files changed, 11 insertions, 51 deletions
diff --git a/libopie2/opiecore/device/odevice.cpp b/libopie2/opiecore/device/odevice.cpp index 3d69614..2c5190c 100644 --- a/libopie2/opiecore/device/odevice.cpp +++ b/libopie2/opiecore/device/odevice.cpp @@ -273,29 +273,3 @@ bool ODevice::suspend() { - if ( !isQWS( ) ) // only qwsserver is allowed to suspend - return false; - - if ( d->m_model == Model_Unknown ) // better don't suspend in qvfb / on unkown devices - return false; - - bool res = false; - ODevice::sendSuspendmsg(); - - struct timeval tvs, tvn; - ::gettimeofday ( &tvs, 0 ); - - ::sync(); // flush fs caches - res = ( ::system ( "apm --suspend" ) == 0 ); - - // This is needed because the iPAQ apm implementation is asynchronous and we - // can not be sure when exactly the device is really suspended - // This can be deleted as soon as a stable familiar with a synchronous apm implementation exists. - - if ( res ) { - do { // wait at most 1.5 sec: either suspend didn't work or the device resumed - ::usleep ( 200 * 1000 ); - ::gettimeofday ( &tvn, 0 ); - } while ((( tvn. tv_sec - tvs. tv_sec ) * 1000 + ( tvn. tv_usec - tvs. tv_usec ) / 1000 ) < 1500 ); - } - - return res; + return false; // default implementation == unknown device or qvfb } @@ -317,19 +291,4 @@ bool ODevice::setDisplayStatus ( bool on ) { - qDebug("ODevice::setDisplayStatus(%d)", on); - - if ( d->m_model == Model_Unknown ) - return false; - - bool res = false; - int fd; - -#ifdef QT_QWS_DEVFS - if (( fd = ::open ( "/dev/fb/0", O_RDWR )) >= 0 ) { -#else - if (( fd = ::open ( "/dev/fb0", O_RDWR )) >= 0 ) { -#endif - res = ( ::ioctl ( fd, FBIOBLANK, on ? VESA_NO_BLANKING : VESA_POWERDOWN ) == 0 ); - ::close ( fd ); - } - return res; + qDebug( "ODevice::setDisplayStatus( %d ) - please override me.", on ); + return false; // don't do anything for unknown models } @@ -344,3 +303,3 @@ bool ODevice::setDisplayBrightness ( int b) { - Q_UNUSED( b ) + qDebug( "ODevice::setDisplayBrightness( %d ) - please override me.", b ); return false; @@ -350,4 +309,4 @@ bool ODevice::setDisplayBrightness ( int b) * - * @return Returns the number of steppings on the brightness slider - * in the Light-'n-Power settings. Values smaller zero and bigger + * @returns the number of steppings on the brightness slider + * in the Light-'n-Power settings. Values smaller than zero and bigger * than 255 do not make sense. @@ -359,2 +318,3 @@ int ODevice::displayBrightnessResolution() const { + qDebug( "ODevice::displayBrightnessResolution() - please override me." ); return 16; @@ -365,3 +325,3 @@ int ODevice::displayBrightnessResolution() const * @param p The contrast to be set on a scale from 0 to 255 -* @return success or failure +* @returns success or failure */ @@ -369,3 +329,3 @@ bool ODevice::setDisplayContrast ( int p) { - Q_UNUSED( p ) + qDebug( "ODevice::setDisplayContrast( %d ) - please override me.", p ); return false; @@ -374,3 +334,3 @@ bool ODevice::setDisplayContrast ( int p) /** -* @return return the max value for the brightness settings slider +* @returns the maximum value for the contrast settings slider * or 0 if the device doesn't support setting of a contrast @@ -379,2 +339,3 @@ int ODevice::displayContrastResolution() const { + qDebug( "ODevice::displayBrightnessResolution() - please override me." ); return 0; @@ -681,3 +642,2 @@ void ODevice::reloadButtonMapping() b. setPressedAction ( OQCopMessage ( pch, pm, pdata )); - b. setHeldAction ( OQCopMessage ( hch, hm, hdata )); |