summaryrefslogtreecommitdiff
path: root/libopie2
authormickeyl <mickeyl>2005-06-26 12:27:37 (UTC)
committer mickeyl <mickeyl>2005-06-26 12:27:37 (UTC)
commitb4d2fa56d4b4608656f6b5cf3ff9375708395e91 (patch) (side-by-side diff)
tree7b087a487929d9b0f9de67860b9fe123773239f0 /libopie2
parent53f924947144ddbb3e15d3bd1ddc877073c7ec7f (diff)
downloadopie-b4d2fa56d4b4608656f6b5cf3ff9375708395e91.zip
opie-b4d2fa56d4b4608656f6b5cf3ff9375708395e91.tar.gz
opie-b4d2fa56d4b4608656f6b5cf3ff9375708395e91.tar.bz2
ODevice now features a method to gather the preferred qte driver.
The default driver is "Transformed". C7x0 Zaurus devices use "W100" from now on.
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()
{
d = new ODeviceData;
d->m_modelstr = "Unknown";
d->m_model = Model_Unknown;
d->m_vendorstr = "Unknown";
d->m_vendor = Vendor_Unknown;
d->m_systemstr = "Unknown";
d->m_system = System_Unknown;
d->m_sysverstr = "0.0";
d->m_rotation = Rot0;
d->m_direction = CW;
+ d->m_qteDriver = "Transformed";
d->m_holdtime = 1000; // 1000ms
d->m_buttons = 0;
d->m_cpu_frequencies = new QStrList;
/* mixer */
d->m_sound = d->m_vol = d->m_mixer = -1;
/* System QCopChannel created */
d->m_initializedButtonQcop = false;
@@ -393,24 +394,29 @@ Transformation ODevice::rotation() const
{
return d->m_rotation;
}
/**
* @return the current rotation direction
*/
ODirection ODevice::direction() const
{
return d->m_direction;
}
+QString ODevice::qteDriver() const
+{
+ return d->m_qteDriver;
+}
+
/**
* This plays an alarm sound
*/
void ODevice::playAlarmSound()
{
#ifndef QT_NO_SOUND
static Sound snd ( "alarm" );
if ( snd. isFinished())
snd. play();
#endif
}
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:
protected:
ODevice();
virtual void init(const QString&);
virtual void initButtons();
static void sendSuspendmsg();
ODeviceData *d;
public:
// sandman do we want to allow destructions? -zecke?
virtual ~ODevice();
-
static ODevice *inst();
// information
-
QString modelString() const;
OModel model() const;
inline OModel series() const { return (OModel) ( model() & Model_Series_Mask ); }
QString vendorString() const;
OVendor vendor() const;
QString systemString() const;
OSystem system() const;
QString systemVersionString() const;
virtual Transformation rotation() const;
virtual ODirection direction() const;
+ QString qteDriver() const;
+
// system
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
@@ -350,24 +350,26 @@ class ODeviceData {
QString m_modelstr;
OModel m_model;
QString m_systemstr;
OSystem m_system;
QString m_sysverstr;
Transformation m_rotation;
ODirection m_direction;
+ QString m_qteDriver;
+
QValueList <ODeviceButton> *m_buttons;
uint m_holdtime;
QStrList *m_cpu_frequencies;
bool m_initializedButtonQcop : 1;
/* values for changeMixerForAlarm */
int m_sound, m_vol, m_mixer;
};
extern bool isQWS();
extern QCString makeChannel ( const char *str );
}
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)
} else if ( model == "SHARP Spitz" ) {
d->m_model = Model_Zaurus_SLC3000;
d->m_modelstr = "Zaurus SL-C3000";
} else if ( model == "SHARP Akita" ) {
d->m_model = Model_Zaurus_SLC1000;
d->m_modelstr = "Zaurus SL-C1000";
} else {
d->m_model = Model_Zaurus_SL5500;
d->m_modelstr = "Unknown Zaurus";
}
// set path to backlight device in kernel 2.6
- switch ( d->m_model ) {
+ switch ( d->m_model )
+ {
case Model_Zaurus_SLB600: // fallthrough
case Model_Zaurus_SL5500:
m_backlightdev = "/sys/class/backlight/locomo-backlight/";
break;
case Model_Zaurus_SL6000:
m_backlightdev = "/sys/class/backlight/tosa-bl/";
break;
default:
m_backlightdev = "/sys/class/backlight/corgi-bl/";
- break;
}
// set initial rotation
- switch( d->m_model ) {
+ switch( d->m_model )
+ {
case Model_Zaurus_SL6000: // fallthrough
case Model_Zaurus_SLA300:
d->m_rotation = Rot0;
break;
case Model_Zaurus_SLC3000: // fallthrough
case Model_Zaurus_SLC1000: // fallthrough
case Model_Zaurus_SLC7x0:
d->m_rotation = rotation();
d->m_direction = direction();
break;
case Model_Zaurus_SLB600: // fallthrough
case Model_Zaurus_SL5000: // fallthrough
case Model_Zaurus_SL5500: // fallthrough
default:
d->m_rotation = Rot270;
+ }
+
+ // set default qte driver
+ switch( d->m_model )
+ {
+ case Model_Zaurus_SLC7x0:
+ d->m_qteDriver = "W100";
break;
+ default:
+ d->m_qteDriver = "Transformed";
}
+
m_leds[0] = Led_Off;
if ( m_embedix )
qDebug( "Zaurus::init() - Using the 2.4 Embedix HAL on a %s", (const char*) d->m_modelstr );
else
qDebug( "Zaurus::init() - Using the 2.6 OpenZaurus HAL on a %s", (const char*) d->m_modelstr );
}
void Zaurus::initButtons()
{
if ( d->m_buttons )
return;