summaryrefslogtreecommitdiff
path: root/libopie2/opiecore
authormickeyl <mickeyl>2005-01-23 21:35:29 (UTC)
committer mickeyl <mickeyl>2005-01-23 21:35:29 (UTC)
commitdd410f1eb69e68f04cf26b6d3e6bca88f0987f71 (patch) (side-by-side diff)
tree0f2b59bae4c326011783e9cdea0754e180ae0e27 /libopie2/opiecore
parent78e658cecc7521cf3932f5eb44d3f551d73f3181 (diff)
downloadopie-dd410f1eb69e68f04cf26b6d3e6bca88f0987f71.zip
opie-dd410f1eb69e68f04cf26b6d3e6bca88f0987f71.tar.gz
opie-dd410f1eb69e68f04cf26b6d3e6bca88f0987f71.tar.bz2
remove setSoftSuspend() from ODevice. this is a left-over from the old days
Diffstat (limited to 'libopie2/opiecore') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiecore/device/odevice.cpp5
-rw-r--r--libopie2/opiecore/device/odevice.h2
-rw-r--r--libopie2/opiecore/device/odevice_genuineintel.cpp6
-rw-r--r--libopie2/opiecore/device/odevice_genuineintel.h2
-rw-r--r--libopie2/opiecore/device/odevice_ipaq.cpp21
-rw-r--r--libopie2/opiecore/device/odevice_ipaq.h2
-rw-r--r--libopie2/opiecore/device/odevice_zaurus.cpp44
-rw-r--r--libopie2/opiecore/device/odevice_zaurus.h2
8 files changed, 2 insertions, 82 deletions
diff --git a/libopie2/opiecore/device/odevice.cpp b/libopie2/opiecore/device/odevice.cpp
index a824392..3d69614 100644
--- a/libopie2/opiecore/device/odevice.cpp
+++ b/libopie2/opiecore/device/odevice.cpp
@@ -245,29 +245,24 @@ void ODevice::initButtons()
reloadButtonMapping();
}
ODevice::~ODevice()
{
// we leak m_devicebuttons and m_cpu_frequency
// but it's a singleton and it is not so importantant
// -zecke
delete d;
}
-bool ODevice::setSoftSuspend ( bool /*soft*/ )
-{
- return false;
-}
-
//#include <linux/apm_bios.h>
#define APM_IOC_SUSPEND OD_IO( 'A', 2 )
/**
* This method will try to suspend the device
* It only works if the user is the QWS Server and the apm application
* is installed.
* It tries to suspend and then waits some time cause some distributions
* do have asynchronus apm implementations.
* This method will either fail and return false or it'll suspend the
* device and return once the device got woken up
diff --git a/libopie2/opiecore/device/odevice.h b/libopie2/opiecore/device/odevice.h
index bbc32fa..96a41fc 100644
--- a/libopie2/opiecore/device/odevice.h
+++ b/libopie2/opiecore/device/odevice.h
@@ -246,26 +246,24 @@ public:
QString vendorString() const;
OVendor vendor() const;
QString systemString() const;
OSystem system() const;
QString systemVersionString() const;
virtual Transformation rotation() const;
virtual ODirection direction() const;
// system
-
- virtual bool setSoftSuspend ( bool on );
virtual bool suspend();
virtual bool setDisplayStatus ( bool on );
virtual bool setDisplayBrightness ( int brightness );
virtual int displayBrightnessResolution() const;
virtual bool setDisplayContrast ( int contrast );
virtual int displayContrastResolution() const;
// don't add new virtual methods, use this:
// /*virtual */ void boo(int i ) { return virtual_hook(1,&i); };
// and in your subclass do overwrite
// protected virtual int virtual_hook(int, void *)
diff --git a/libopie2/opiecore/device/odevice_genuineintel.cpp b/libopie2/opiecore/device/odevice_genuineintel.cpp
index 61ba052..1584249 100644
--- a/libopie2/opiecore/device/odevice_genuineintel.cpp
+++ b/libopie2/opiecore/device/odevice_genuineintel.cpp
@@ -151,30 +151,24 @@ void GenuineIntel::playAlarmSound()
{
#ifndef QT_NO_SOUND
static Sound snd ( "alarm" );
if(!snd.isFinished())
return;
changeMixerForAlarm(0, "/dev/sound/mixer", &snd );
snd. play();
#endif
}
-bool GenuineIntel::setSoftSuspend ( bool )
-{
- return false;
-}
-
-
bool GenuineIntel::setDisplayBrightness ( int )
{
return false;
}
int GenuineIntel::displayBrightnessResolution() const
{
return 1; // perhaps to avoid division by zero
}
bool GenuineIntel::hasLightSensor() const
diff --git a/libopie2/opiecore/device/odevice_genuineintel.h b/libopie2/opiecore/device/odevice_genuineintel.h
index 52c5fc6..69316af 100644
--- a/libopie2/opiecore/device/odevice_genuineintel.h
+++ b/libopie2/opiecore/device/odevice_genuineintel.h
@@ -38,26 +38,24 @@
namespace Opie {
namespace Core {
namespace Internal {
class GenuineIntel : public ODevice, public QWSServer::KeyboardFilter
{
protected:
virtual void init(const QString&);
virtual void initButtons();
public:
- virtual bool setSoftSuspend( bool soft );
-
virtual bool setDisplayBrightness( int b );
virtual int displayBrightnessResolution() const;
virtual void playAlarmSound();
virtual QValueList <OLed> ledList() const;
virtual QValueList <OLedState> ledStateList( OLed led ) const;
virtual OLedState ledState( OLed led ) const;
virtual bool setLedState( OLed led, OLedState st );
virtual bool hasLightSensor() const;
virtual int readLightSensor();
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
@@ -327,45 +327,24 @@ void iPAQ::timerEvent ( QTimerEvent * )
void iPAQ::playAlarmSound()
{
#ifndef QT_NO_SOUND
static Sound snd ( "alarm" );
if(!snd.isFinished())
return;
changeMixerForAlarm(0, "/dev/sound/mixer", &snd );
snd. play();
#endif
}
-
-bool iPAQ::setSoftSuspend ( bool soft )
-{
- bool res = false;
- int fd;
-
- if (( fd = ::open ( "/proc/sys/ts/suspend_button_mode", O_WRONLY )) >= 0 ) {
- if ( ::write ( fd, soft ? "1" : "0", 1 ) == 1 )
- res = true;
- else
- ::perror ( "write to /proc/sys/ts/suspend_button_mode" );
-
- ::close ( fd );
- }
- else
- ::perror ( "/proc/sys/ts/suspend_button_mode" );
-
- return res;
-}
-
-
bool iPAQ::setDisplayBrightness ( int bright )
{
bool res = false;
int fd;
if ( bright > 255 )
bright = 255;
if ( bright < 0 )
bright = 0;
if (( fd = ::open ( "/dev/touchscreen/0", O_WRONLY )) >= 0 ) {
FLITE_IN bl;
diff --git a/libopie2/opiecore/device/odevice_ipaq.h b/libopie2/opiecore/device/odevice_ipaq.h
index cc0b8ac..b1dac74 100644
--- a/libopie2/opiecore/device/odevice_ipaq.h
+++ b/libopie2/opiecore/device/odevice_ipaq.h
@@ -38,26 +38,24 @@
namespace Opie {
namespace Core {
namespace Internal {
class iPAQ : public ODevice, public QWSServer::KeyboardFilter
{
protected:
virtual void init(const QString&);
virtual void initButtons();
public:
- virtual bool setSoftSuspend( bool soft );
-
virtual bool setDisplayBrightness( int b );
virtual int displayBrightnessResolution() const;
virtual void playAlarmSound();
virtual QValueList <OLed> ledList() const;
virtual QValueList <OLedState> ledStateList( OLed led ) const;
virtual OLedState ledState( OLed led ) const;
virtual bool setLedState( OLed led, OLedState st );
virtual bool hasLightSensor() const;
virtual int readLightSensor();
diff --git a/libopie2/opiecore/device/odevice_zaurus.cpp b/libopie2/opiecore/device/odevice_zaurus.cpp
index b22ee70..cbc7a24 100644
--- a/libopie2/opiecore/device/odevice_zaurus.cpp
+++ b/libopie2/opiecore/device/odevice_zaurus.cpp
@@ -371,61 +371,24 @@ bool Zaurus::setLedState( OLed which, OLedState st )
default : ok = false;
}
if ( ok && ( ::ioctl ( fd, SHARP_LED_SETSTATUS, &leds ) >= 0 )) {
m_leds [0] = st;
return true;
}
}
}
return false;
}
-bool Zaurus::setSoftSuspend ( bool soft )
-{
- if (!m_embedix) {
- /* non-Embedix kernels dont have kernel autosuspend */
- return ODevice::setSoftSuspend( soft );
- }
-
- bool res = false;
- int fd;
-
- if ((( fd = ::open ( "/dev/apm_bios", O_RDWR )) >= 0 ) ||
- (( fd = ::open ( "/dev/misc/apm_bios",O_RDWR )) >= 0 )) {
-
- int sources = ::ioctl( fd, APM_IOCGEVTSRC, 0 ); // get current event sources
-
- if ( sources >= 0 ) {
- if ( soft )
- sources &= ~APM_EVT_POWER_BUTTON;
- else
- sources |= APM_EVT_POWER_BUTTON;
-
- if ( ::ioctl( fd, APM_IOCSEVTSRC, sources ) >= 0 ) // set new event sources
- res = true;
- else
- perror ( "APM_IOCGEVTSRC" );
- }
- else
- perror ( "APM_IOCGEVTSRC" );
-
- ::close( fd );
- }
- else
- perror( "/dev/apm_bios or /dev/misc/apm_bios" );
-
- return res;
-}
-
int Zaurus::displayBrightnessResolution() const
{
int res = 1;
if (m_embedix)
{
int fd = ::open( SHARP_FL_IOCTL_DEVICE, O_RDWR|O_NONBLOCK );
if ( fd )
{
int value = ::ioctl( fd, SHARP_FL_IOCTL_GET_STEP, 0 );
::close( fd );
return value ? value : res;
}
@@ -531,52 +494,49 @@ bool Zaurus::suspend()
::gettimeofday ( &tvn, 0 );
} while ((( tvn. tv_sec - tvs. tv_sec ) * 1000 + ( tvn. tv_usec - tvs. tv_usec ) / 1000 ) < 15000 );
}
QCopEnvelope ( "QPE/Rotation", "rotateDefault()" );
return res;
}
Transformation Zaurus::rotation() const
{
Transformation rot;
- int handle = 0;
- int retval = 0;
-
+
switch ( d->m_model ) {
case Model_Zaurus_SLC3000: // fallthrough
case Model_Zaurus_SLC7x0:
OHingeStatus hs = readHingeSensor();
if ( hs == CASE_PORTRAIT ) rot = Rot0;
else if ( hs == CASE_UNKNOWN ) rot = Rot0;
else rot = Rot270;
break;
case Model_Zaurus_SL6000:
case Model_Zaurus_SLB600:
case Model_Zaurus_SLA300:
case Model_Zaurus_SL5500:
case Model_Zaurus_SL5000:
default:
rot = d->m_rotation;
break;
}
return rot;
}
ODirection Zaurus::direction() const
{
ODirection dir;
- int handle = 0;
- int retval = 0;
+
switch ( d->m_model ) {
case Model_Zaurus_SLC3000: // fallthrough
case Model_Zaurus_SLC7x0:
OHingeStatus hs = readHingeSensor();
if ( hs == CASE_PORTRAIT ) dir = CCW;
else if ( hs == CASE_UNKNOWN ) dir = CCW;
else dir = CW;
break;
case Model_Zaurus_SL6000:
case Model_Zaurus_SLA300:
case Model_Zaurus_SLB600:
case Model_Zaurus_SL5500:
diff --git a/libopie2/opiecore/device/odevice_zaurus.h b/libopie2/opiecore/device/odevice_zaurus.h
index c763798..04e73c4 100644
--- a/libopie2/opiecore/device/odevice_zaurus.h
+++ b/libopie2/opiecore/device/odevice_zaurus.h
@@ -85,26 +85,24 @@
namespace Opie {
namespace Core {
namespace Internal {
class Zaurus : public ODevice
{
protected:
virtual void init(const QString&);
virtual void initButtons();
public:
- virtual bool setSoftSuspend( bool soft );
-
virtual bool setDisplayBrightness( int b );
virtual bool setDisplayStatus( bool on );
virtual int displayBrightnessResolution() const;
virtual void playAlarmSound();
virtual void playKeySound();
virtual void playTouchSound();
virtual QValueList <OLed> ledList() const;
virtual QValueList <OLedState> ledStateList ( OLed led ) const;
virtual OLedState ledState( OLed led ) const;
virtual bool setLedState( OLed led, OLedState st );