summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiecore/device/odevice.cpp33
-rw-r--r--libopie2/opiecore/device/odevice.h15
-rw-r--r--libopie2/opiecore/device/odevice_ipaq.cpp4
-rw-r--r--libopie2/opiecore/device/odevice_simpad.cpp4
-rw-r--r--libopie2/opiecore/device/odevice_zaurus.cpp4
5 files changed, 54 insertions, 6 deletions
diff --git a/libopie2/opiecore/device/odevice.cpp b/libopie2/opiecore/device/odevice.cpp
index ee66d95..62a2e03 100644
--- a/libopie2/opiecore/device/odevice.cpp
+++ b/libopie2/opiecore/device/odevice.cpp
@@ -17,175 +17,208 @@ _;:, .> :=|. This program is free software; you can
17 =_ + =;=|` MERCHANTABILITY or FITNESS FOR A 17 =_ + =;=|` MERCHANTABILITY or FITNESS FOR A
18 _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU 18 _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU
19..}^=.= = ; Library General Public License for more 19..}^=.= = ; Library General Public License for more
20++= -. .` .: details. 20++= -. .` .: details.
21: = ...= . :.=- 21: = ...= . :.=-
22-. .:....=;==+<; You should have received a copy of the GNU 22-. .:....=;==+<; You should have received a copy of the GNU
23 -_. . . )=. = Library General Public License along with 23 -_. . . )=. = Library General Public License along with
24 -- :-=` this library; see the file COPYING.LIB. 24 -- :-=` this library; see the file COPYING.LIB.
25 If not, write to the Free Software Foundation, 25 If not, write to the Free Software Foundation,
26 Inc., 59 Temple Place - Suite 330, 26 Inc., 59 Temple Place - Suite 330,
27 Boston, MA 02111-1307, USA. 27 Boston, MA 02111-1307, USA.
28*/ 28*/
29 29
30#include "odevice_ipaq.h" 30#include "odevice_ipaq.h"
31#include "odevice_jornada.h" 31#include "odevice_jornada.h"
32#include "odevice_ramses.h" 32#include "odevice_ramses.h"
33#include "odevice_simpad.h" 33#include "odevice_simpad.h"
34#include "odevice_yopy.h" 34#include "odevice_yopy.h"
35#include "odevice_zaurus.h" 35#include "odevice_zaurus.h"
36 36
37/* QT */ 37/* QT */
38#include <qapplication.h> 38#include <qapplication.h>
39#include <qfile.h> 39#include <qfile.h>
40#include <qtextstream.h> 40#include <qtextstream.h>
41#include <qwindowsystem_qws.h> 41#include <qwindowsystem_qws.h>
42 42
43/* OPIE */ 43/* OPIE */
44#include <qpe/config.h> 44#include <qpe/config.h>
45#include <qpe/resource.h> 45#include <qpe/resource.h>
46#include <qpe/sound.h> 46#include <qpe/sound.h>
47#include <qpe/qcopenvelope_qws.h> 47#include <qpe/qcopenvelope_qws.h>
48 48
49/* STD */ 49/* STD */
50#include <fcntl.h> 50#include <fcntl.h>
51#include <math.h> 51#include <math.h>
52#include <stdlib.h> 52#include <stdlib.h>
53#include <signal.h> 53#include <signal.h>
54#include <sys/ioctl.h> 54#include <sys/ioctl.h>
55#include <sys/time.h> 55#include <sys/time.h>
56#include <unistd.h> 56#include <unistd.h>
57#ifndef QT_NO_SOUND 57#ifndef QT_NO_SOUND
58#include <linux/soundcard.h> 58#include <linux/soundcard.h>
59#endif 59#endif
60 60
61const char* PATH_PROC_CPUINFO = "/proc/cpuinfo"; 61const char* PATH_PROC_CPUINFO = "/proc/cpuinfo";
62 62
63using namespace Opie::Core; 63using namespace Opie::Core;
64 64
65struct default_button default_buttons [] = {
66 { Qt::Key_F9, QT_TRANSLATE_NOOP("Button", "Calendar Button"),
67 "devicebuttons/z_calendar",
68 "datebook", "nextView()",
69 "today", "raise()" },
70 { Qt::Key_F10, QT_TRANSLATE_NOOP("Button", "Contacts Button"),
71 "devicebuttons/z_contact",
72 "addressbook", "raise()",
73 "addressbook", "beamBusinessCard()" },
74 { Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Home Button"),
75 "devicebuttons/z_home",
76 "QPE/Launcher", "home()",
77 "buttonsettings", "raise()" },
78 { Qt::Key_F11, QT_TRANSLATE_NOOP("Button", "Menu Button"),
79 "devicebuttons/z_menu",
80 "QPE/TaskBar", "toggleMenu()",
81 "QPE/TaskBar", "toggleStartMenu()" },
82 { Qt::Key_F13, QT_TRANSLATE_NOOP("Button", "Mail Button"),
83 "devicebuttons/z_mail",
84 "opiemail", "raise()",
85 "opiemail", "newMail()" },
86};
87
65ODevice *ODevice::inst() 88ODevice *ODevice::inst()
66{ 89{
67 static ODevice *dev = 0; 90 static ODevice *dev = 0;
68 91
69 // rewrite this to only use /proc/cpuinfo or so 92 // rewrite this to only use /proc/cpuinfo or so
70 93
71 if ( !dev ) 94 if ( !dev )
72 { 95 {
73 QFile f( PATH_PROC_CPUINFO ); 96 QFile f( PATH_PROC_CPUINFO );
74 if ( f.open( IO_ReadOnly ) ) 97 if ( f.open( IO_ReadOnly ) )
75 { 98 {
76 QTextStream s( &f ); 99 QTextStream s( &f );
77 while ( !s.atEnd() ) 100 while ( !s.atEnd() )
78 { 101 {
79 QString line; 102 QString line;
80 line = s.readLine(); 103 line = s.readLine();
81 if ( line.startsWith( "Hardware" ) ) 104 if ( line.startsWith( "Hardware" ) )
82 { 105 {
83 qDebug( "ODevice() - found '%s'", (const char*) line ); 106 qDebug( "ODevice() - found '%s'", (const char*) line );
84 if ( line.contains( "sharp", false ) ) dev = new Internal::Zaurus(); 107 if ( line.contains( "sharp", false ) ) dev = new Internal::Zaurus();
85 else if ( line.contains( "ipaq", false ) ) dev = new Internal::iPAQ(); 108 else if ( line.contains( "ipaq", false ) ) dev = new Internal::iPAQ();
86 else if ( line.contains( "simpad", false ) ) dev = new Internal::SIMpad(); 109 else if ( line.contains( "simpad", false ) ) dev = new Internal::SIMpad();
87 else if ( line.contains( "jornada", false ) ) dev = new Internal::Jornada(); 110 else if ( line.contains( "jornada", false ) ) dev = new Internal::Jornada();
88 else if ( line.contains( "ramses", false ) ) dev = new Internal::Ramses(); 111 else if ( line.contains( "ramses", false ) ) dev = new Internal::Ramses();
89 else qWarning( "ODevice() - unknown hardware - using default." ); 112 else qWarning( "ODevice() - unknown hardware - using default." );
90 break; 113 break;
91 } 114 }
92 } 115 }
93 } 116 }
94 else 117 else
95 { 118 {
96 qWarning( "ODevice() - can't open '%s' - unknown hardware - using default.", PATH_PROC_CPUINFO ); 119 qWarning( "ODevice() - can't open '%s' - unknown hardware - using default.", PATH_PROC_CPUINFO );
97 } 120 }
98 if ( !dev ) dev = new ODevice(); 121 if ( !dev ) dev = new ODevice();
99 dev->init(); 122 dev->init();
100 } 123 }
101 return dev; 124 return dev;
102} 125}
103 126
104ODevice::ODevice() 127ODevice::ODevice()
105{ 128{
106 d = new ODeviceData; 129 d = new ODeviceData;
107 130
108 d->m_modelstr = "Unknown"; 131 d->m_modelstr = "Unknown";
109 d->m_model = Model_Unknown; 132 d->m_model = Model_Unknown;
110 d->m_vendorstr = "Unknown"; 133 d->m_vendorstr = "Unknown";
111 d->m_vendor = Vendor_Unknown; 134 d->m_vendor = Vendor_Unknown;
112 d->m_systemstr = "Unknown"; 135 d->m_systemstr = "Unknown";
113 d->m_system = System_Unknown; 136 d->m_system = System_Unknown;
114 d->m_sysverstr = "0.0"; 137 d->m_sysverstr = "0.0";
115 d->m_rotation = Rot0; 138 d->m_rotation = Rot0;
116 d->m_direction = CW; 139 d->m_direction = CW;
117 140
118 d->m_holdtime = 1000; // 1000ms 141 d->m_holdtime = 1000; // 1000ms
119 d->m_buttons = 0; 142 d->m_buttons = 0;
120 d->m_cpu_frequencies = new QStrList; 143 d->m_cpu_frequencies = new QStrList;
121} 144}
122 145
123void ODevice::systemMessage ( const QCString &msg, const QByteArray & ) 146void ODevice::systemMessage ( const QCString &msg, const QByteArray & )
124{ 147{
125 if ( msg == "deviceButtonMappingChanged()" ) { 148 if ( msg == "deviceButtonMappingChanged()" ) {
126 reloadButtonMapping(); 149 reloadButtonMapping();
127 } 150 }
128} 151}
129 152
130void ODevice::init() 153void ODevice::init()
131{ 154{
132} 155}
133 156
134/** 157/**
135* This method initialises the button mapping 158* This method initialises the button mapping
136*/ 159*/
137void ODevice::initButtons() 160void ODevice::initButtons()
138{ 161{
139 if ( d->m_buttons ) 162 if ( d->m_buttons )
140 return; 163 return;
141 164
142 qDebug ( "init Buttons" ); 165 qDebug ( "init Buttons" );
143 d->m_buttons = new QValueList <ODeviceButton>; 166 d->m_buttons = new QValueList <ODeviceButton>;
167 for ( uint i = 0; i < ( sizeof( default_buttons ) / sizeof( default_button )); i++ ) {
168 default_button *db = default_buttons + i;
169 ODeviceButton b;
170 b. setKeycode ( db->code );
171 b. setUserText ( QObject::tr ( "Button", db->utext ));
172 b. setPixmap ( Resource::loadPixmap ( db->pix ));
173 b. setFactoryPresetPressedAction ( OQCopMessage ( makeChannel ( db->fpressedservice ), db->fpressedaction ));
174 b. setFactoryPresetHeldAction ( OQCopMessage ( makeChannel ( db->fheldservice ), db->fheldaction ));
175 d->m_buttons->append ( b );
176 }
144 177
145 reloadButtonMapping(); 178 reloadButtonMapping();
146 179
147 QCopChannel *sysch = new QCopChannel ( "QPE/System", this ); 180 QCopChannel *sysch = new QCopChannel ( "QPE/System", this );
148 connect ( sysch, SIGNAL( received(const QCString&,const QByteArray&)), this, SLOT( systemMessage(const QCString&,const QByteArray&))); 181 connect ( sysch, SIGNAL( received(const QCString&,const QByteArray&)), this, SLOT( systemMessage(const QCString&,const QByteArray&)));
149} 182}
150 183
151ODevice::~ODevice() 184ODevice::~ODevice()
152{ 185{
153// we leak m_devicebuttons and m_cpu_frequency 186// we leak m_devicebuttons and m_cpu_frequency
154// but it's a singleton and it is not so importantant 187// but it's a singleton and it is not so importantant
155// -zecke 188// -zecke
156 delete d; 189 delete d;
157} 190}
158 191
159bool ODevice::setSoftSuspend ( bool /*soft*/ ) 192bool ODevice::setSoftSuspend ( bool /*soft*/ )
160{ 193{
161 return false; 194 return false;
162} 195}
163 196
164//#include <linux/apm_bios.h> 197//#include <linux/apm_bios.h>
165 198
166#define APM_IOC_SUSPEND OD_IO( 'A', 2 ) 199#define APM_IOC_SUSPEND OD_IO( 'A', 2 )
167 200
168/** 201/**
169* This method will try to suspend the device 202* This method will try to suspend the device
170* It only works if the user is the QWS Server and the apm application 203* It only works if the user is the QWS Server and the apm application
171* is installed. 204* is installed.
172* It tries to suspend and then waits some time cause some distributions 205* It tries to suspend and then waits some time cause some distributions
173* do have asynchronus apm implementations. 206* do have asynchronus apm implementations.
174* This method will either fail and return false or it'll suspend the 207* This method will either fail and return false or it'll suspend the
175* device and return once the device got woken up 208* device and return once the device got woken up
176* 209*
177* @return if the device got suspended 210* @return if the device got suspended
178*/ 211*/
179bool ODevice::suspend() 212bool ODevice::suspend()
180{ 213{
181 qDebug("ODevice::suspend"); 214 qDebug("ODevice::suspend");
182 if ( !isQWS( ) ) // only qwsserver is allowed to suspend 215 if ( !isQWS( ) ) // only qwsserver is allowed to suspend
183 return false; 216 return false;
184 217
185 if ( d->m_model == Model_Unknown ) // better don't suspend in qvfb / on unkown devices 218 if ( d->m_model == Model_Unknown ) // better don't suspend in qvfb / on unkown devices
186 return false; 219 return false;
187 220
188 bool res = false; 221 bool res = false;
189 ODevice::sendSuspendmsg(); 222 ODevice::sendSuspendmsg();
190 223
191 struct timeval tvs, tvn; 224 struct timeval tvs, tvn;
diff --git a/libopie2/opiecore/device/odevice.h b/libopie2/opiecore/device/odevice.h
index 5ee9cca..0ba58f0 100644
--- a/libopie2/opiecore/device/odevice.h
+++ b/libopie2/opiecore/device/odevice.h
@@ -115,96 +115,111 @@ enum OSystem {
115 System_Unknown, 115 System_Unknown,
116 116
117 System_Familiar, 117 System_Familiar,
118 System_Zaurus, 118 System_Zaurus,
119 System_OpenZaurus, 119 System_OpenZaurus,
120 System_Linupy, 120 System_Linupy,
121}; 121};
122 122
123enum OLedState { 123enum OLedState {
124 Led_Off, 124 Led_Off,
125 Led_On, 125 Led_On,
126 Led_BlinkSlow, 126 Led_BlinkSlow,
127 Led_BlinkFast 127 Led_BlinkFast
128}; 128};
129 129
130enum OLed { 130enum OLed {
131 Led_Mail, 131 Led_Mail,
132 Led_Power, 132 Led_Power,
133 Led_BlueTooth 133 Led_BlueTooth
134}; 134};
135 135
136enum OHardKey { 136enum OHardKey {
137 HardKey_Datebook = Qt::Key_F9, 137 HardKey_Datebook = Qt::Key_F9,
138 HardKey_Contacts = Qt::Key_F10, 138 HardKey_Contacts = Qt::Key_F10,
139 HardKey_Menu = Qt::Key_F11, 139 HardKey_Menu = Qt::Key_F11,
140 HardKey_Home = Qt::Key_F12, 140 HardKey_Home = Qt::Key_F12,
141 HardKey_Mail = Qt::Key_F13, 141 HardKey_Mail = Qt::Key_F13,
142 HardKey_Record = Qt::Key_F24, 142 HardKey_Record = Qt::Key_F24,
143 HardKey_Suspend = Qt::Key_F34, 143 HardKey_Suspend = Qt::Key_F34,
144 HardKey_Backlight = Qt::Key_F35, 144 HardKey_Backlight = Qt::Key_F35,
145 HardKey_Action = Qt::Key_F10, 145 HardKey_Action = Qt::Key_F10,
146 HardKey_OK = Qt::Key_F11, 146 HardKey_OK = Qt::Key_F11,
147 HardKey_End = Qt::Key_F12, 147 HardKey_End = Qt::Key_F12,
148}; 148};
149 149
150enum ODirection { 150enum ODirection {
151 CW = 0, 151 CW = 0,
152 CCW = 1, 152 CCW = 1,
153 Flip = 2, 153 Flip = 2,
154}; 154};
155 155
156enum OHingeStatus { 156enum OHingeStatus {
157 CASE_CLOSED = 3, 157 CASE_CLOSED = 3,
158 CASE_PORTRAIT = 2, 158 CASE_PORTRAIT = 2,
159 CASE_LANDSCAPE = 0, 159 CASE_LANDSCAPE = 0,
160 CASE_UNKNOWN = 1, 160 CASE_UNKNOWN = 1,
161}; 161};
162 162
163/* default button for qvfb or such
164 * see odevice.cpp for details.
165 * hint: manage a user defined button for qvfb?
166 * alwin
167 */
168struct default_button {
169 Qt::Key code;
170 char *utext;
171 char *pix;
172 char *fpressedservice;
173 char *fpressedaction;
174 char *fheldservice;
175 char *fheldaction;
176};
177
163/** 178/**
164 * A singleton which gives informations about device specefic option 179 * A singleton which gives informations about device specefic option
165 * like the Hardware used, LEDs, the Base Distribution and 180 * like the Hardware used, LEDs, the Base Distribution and
166 * hardware key mappings. 181 * hardware key mappings.
167 * 182 *
168 * @short A small class for device specefic options 183 * @short A small class for device specefic options
169 * @see QObject 184 * @see QObject
170 * @author Robert Griebl 185 * @author Robert Griebl
171 * @version 1.0 186 * @version 1.0
172 */ 187 */
173class ODevice : public QObject 188class ODevice : public QObject
174{ 189{
175 Q_OBJECT 190 Q_OBJECT
176 191
177private: 192private:
178 /* disable copy */ 193 /* disable copy */
179 ODevice ( const ODevice & ); 194 ODevice ( const ODevice & );
180 195
181protected: 196protected:
182 ODevice(); 197 ODevice();
183 virtual void init(); 198 virtual void init();
184 virtual void initButtons(); 199 virtual void initButtons();
185 static void sendSuspendmsg(); 200 static void sendSuspendmsg();
186 201
187 ODeviceData *d; 202 ODeviceData *d;
188 203
189public: 204public:
190 // sandman do we want to allow destructions? -zecke? 205 // sandman do we want to allow destructions? -zecke?
191 virtual ~ODevice(); 206 virtual ~ODevice();
192 207
193 static ODevice *inst(); 208 static ODevice *inst();
194 209
195 // information 210 // information
196 211
197 QString modelString() const; 212 QString modelString() const;
198 OModel model() const; 213 OModel model() const;
199 inline OModel series() const { return (OModel) ( model() & Model_Series_Mask ); } 214 inline OModel series() const { return (OModel) ( model() & Model_Series_Mask ); }
200 215
201 QString vendorString() const; 216 QString vendorString() const;
202 OVendor vendor() const; 217 OVendor vendor() const;
203 218
204 QString systemString() const; 219 QString systemString() const;
205 OSystem system() const; 220 OSystem system() const;
206 221
207 QString systemVersionString() const; 222 QString systemVersionString() const;
208 223
209 virtual Transformation rotation() const; 224 virtual Transformation rotation() const;
210 virtual ODirection direction() const; 225 virtual ODirection direction() const;
diff --git a/libopie2/opiecore/device/odevice_ipaq.cpp b/libopie2/opiecore/device/odevice_ipaq.cpp
index 2efcd3a..98e2ffa 100644
--- a/libopie2/opiecore/device/odevice_ipaq.cpp
+++ b/libopie2/opiecore/device/odevice_ipaq.cpp
@@ -55,98 +55,98 @@
55 55
56 56
57using namespace Opie::Core; 57using namespace Opie::Core;
58using namespace Opie::Core::Internal; 58using namespace Opie::Core::Internal;
59 59
60/* KERNEL */ 60/* KERNEL */
61#define OD_IOC(dir,type,number,size) (( dir << 30 ) | ( type << 8 ) | ( number ) | ( size << 16 )) 61#define OD_IOC(dir,type,number,size) (( dir << 30 ) | ( type << 8 ) | ( number ) | ( size << 16 ))
62 62
63#define OD_IO(type,number) OD_IOC(0,type,number,0) 63#define OD_IO(type,number) OD_IOC(0,type,number,0)
64#define OD_IOW(type,number,size) OD_IOC(1,type,number,sizeof(size)) 64#define OD_IOW(type,number,size) OD_IOC(1,type,number,sizeof(size))
65#define OD_IOR(type,number,size) OD_IOC(2,type,number,sizeof(size)) 65#define OD_IOR(type,number,size) OD_IOC(2,type,number,sizeof(size))
66#define OD_IORW(type,number,size) OD_IOC(3,type,number,sizeof(size)) 66#define OD_IORW(type,number,size) OD_IOC(3,type,number,sizeof(size))
67 67
68typedef struct { 68typedef struct {
69 unsigned char OffOnBlink; /* 0=off 1=on 2=Blink */ 69 unsigned char OffOnBlink; /* 0=off 1=on 2=Blink */
70 unsigned char TotalTime; /* Units of 5 seconds */ 70 unsigned char TotalTime; /* Units of 5 seconds */
71 unsigned char OnTime; /* units of 100m/s */ 71 unsigned char OnTime; /* units of 100m/s */
72 unsigned char OffTime; /* units of 100m/s */ 72 unsigned char OffTime; /* units of 100m/s */
73} LED_IN; 73} LED_IN;
74 74
75typedef struct { 75typedef struct {
76 unsigned char mode; 76 unsigned char mode;
77 unsigned char pwr; 77 unsigned char pwr;
78 unsigned char brightness; 78 unsigned char brightness;
79} FLITE_IN; 79} FLITE_IN;
80 80
81#define LED_ON OD_IOW( 'f', 5, LED_IN ) 81#define LED_ON OD_IOW( 'f', 5, LED_IN )
82#define FLITE_ON OD_IOW( 'f', 7, FLITE_IN ) 82#define FLITE_ON OD_IOW( 'f', 7, FLITE_IN )
83 83
84struct i_button ipaq_buttons [] = { 84struct i_button ipaq_buttons [] = {
85 { Model_iPAQ_H31xx | Model_iPAQ_H36xx | Model_iPAQ_H37xx | Model_iPAQ_H38xx | Model_iPAQ_H39xx | Model_iPAQ_H5xxx, 85 { Model_iPAQ_H31xx | Model_iPAQ_H36xx | Model_iPAQ_H37xx | Model_iPAQ_H38xx | Model_iPAQ_H39xx | Model_iPAQ_H5xxx,
86 Qt::Key_F9, QT_TRANSLATE_NOOP("Button", "Calendar Button"), 86 Qt::Key_F9, QT_TRANSLATE_NOOP("Button", "Calendar Button"),
87 "devicebuttons/ipaq_calendar", 87 "devicebuttons/ipaq_calendar",
88 "datebook", "nextView()", 88 "datebook", "nextView()",
89 "today", "raise()" }, 89 "today", "raise()" },
90 { Model_iPAQ_H31xx | Model_iPAQ_H36xx | Model_iPAQ_H37xx | Model_iPAQ_H38xx | Model_iPAQ_H39xx | Model_iPAQ_H5xxx, 90 { Model_iPAQ_H31xx | Model_iPAQ_H36xx | Model_iPAQ_H37xx | Model_iPAQ_H38xx | Model_iPAQ_H39xx | Model_iPAQ_H5xxx,
91 Qt::Key_F10, QT_TRANSLATE_NOOP("Button", "Contacts Button"), 91 Qt::Key_F10, QT_TRANSLATE_NOOP("Button", "Contacts Button"),
92 "devicebuttons/ipaq_contact", 92 "devicebuttons/ipaq_contact",
93 "addressbook", "raise()", 93 "addressbook", "raise()",
94 "addressbook", "beamBusinessCard()" }, 94 "addressbook", "beamBusinessCard()" },
95 { Model_iPAQ_H31xx | Model_iPAQ_H36xx | Model_iPAQ_H37xx, 95 { Model_iPAQ_H31xx | Model_iPAQ_H36xx | Model_iPAQ_H37xx,
96 Qt::Key_F11, QT_TRANSLATE_NOOP("Button", "Menu Button"), 96 Qt::Key_F11, QT_TRANSLATE_NOOP("Button", "Menu Button"),
97 "devicebuttons/ipaq_menu", 97 "devicebuttons/ipaq_menu",
98 "QPE/TaskBar", "toggleMenu()", 98 "QPE/TaskBar", "toggleMenu()",
99 "QPE/TaskBar", "toggleStartMenu()" }, 99 "QPE/TaskBar", "toggleStartMenu()" },
100 { Model_iPAQ_H38xx | Model_iPAQ_H39xx | Model_iPAQ_H5xxx, 100 { Model_iPAQ_H38xx | Model_iPAQ_H39xx | Model_iPAQ_H5xxx,
101 Qt::Key_F13, QT_TRANSLATE_NOOP("Button", "Mail Button"), 101 Qt::Key_F13, QT_TRANSLATE_NOOP("Button", "Mail Button"),
102 "devicebuttons/ipaq_mail", 102 "devicebuttons/ipaq_mail",
103 "mail", "raise()", 103 "opiemail", "raise()",
104 "mail", "newMail()" }, 104 "opiemail", "newMail()" },
105 { Model_iPAQ_H31xx | Model_iPAQ_H36xx | Model_iPAQ_H37xx | Model_iPAQ_H38xx | Model_iPAQ_H39xx | Model_iPAQ_H5xxx, 105 { Model_iPAQ_H31xx | Model_iPAQ_H36xx | Model_iPAQ_H37xx | Model_iPAQ_H38xx | Model_iPAQ_H39xx | Model_iPAQ_H5xxx,
106 Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Home Button"), 106 Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Home Button"),
107 "devicebuttons/ipaq_home", 107 "devicebuttons/ipaq_home",
108 "QPE/Launcher", "home()", 108 "QPE/Launcher", "home()",
109 "buttonsettings", "raise()" }, 109 "buttonsettings", "raise()" },
110 { Model_iPAQ_H31xx | Model_iPAQ_H36xx | Model_iPAQ_H37xx | Model_iPAQ_H38xx | Model_iPAQ_H39xx | Model_iPAQ_H5xxx, 110 { Model_iPAQ_H31xx | Model_iPAQ_H36xx | Model_iPAQ_H37xx | Model_iPAQ_H38xx | Model_iPAQ_H39xx | Model_iPAQ_H5xxx,
111 Qt::Key_F24, QT_TRANSLATE_NOOP("Button", "Record Button"), 111 Qt::Key_F24, QT_TRANSLATE_NOOP("Button", "Record Button"),
112 "devicebuttons/ipaq_record", 112 "devicebuttons/ipaq_record",
113 "QPE/VMemo", "toggleRecord()", 113 "QPE/VMemo", "toggleRecord()",
114 "sound", "raise()" }, 114 "sound", "raise()" },
115}; 115};
116 116
117void iPAQ::init() 117void iPAQ::init()
118{ 118{
119 d->m_vendorstr = "HP"; 119 d->m_vendorstr = "HP";
120 d->m_vendor = Vendor_HP; 120 d->m_vendor = Vendor_HP;
121 121
122 QFile f ( "/proc/hal/model" ); 122 QFile f ( "/proc/hal/model" );
123 123
124 if ( f. open ( IO_ReadOnly )) { 124 if ( f. open ( IO_ReadOnly )) {
125 QTextStream ts ( &f ); 125 QTextStream ts ( &f );
126 126
127 d->m_modelstr = "H" + ts. readLine(); 127 d->m_modelstr = "H" + ts. readLine();
128 128
129 if ( d->m_modelstr == "H3100" ) 129 if ( d->m_modelstr == "H3100" )
130 d->m_model = Model_iPAQ_H31xx; 130 d->m_model = Model_iPAQ_H31xx;
131 else if ( d->m_modelstr == "H3600" ) 131 else if ( d->m_modelstr == "H3600" )
132 d->m_model = Model_iPAQ_H36xx; 132 d->m_model = Model_iPAQ_H36xx;
133 else if ( d->m_modelstr == "H3700" ) 133 else if ( d->m_modelstr == "H3700" )
134 d->m_model = Model_iPAQ_H37xx; 134 d->m_model = Model_iPAQ_H37xx;
135 else if ( d->m_modelstr == "H3800" ) 135 else if ( d->m_modelstr == "H3800" )
136 d->m_model = Model_iPAQ_H38xx; 136 d->m_model = Model_iPAQ_H38xx;
137 else if ( d->m_modelstr == "H3900" ) 137 else if ( d->m_modelstr == "H3900" )
138 d->m_model = Model_iPAQ_H39xx; 138 d->m_model = Model_iPAQ_H39xx;
139 else if ( d->m_modelstr == "H5400" ) 139 else if ( d->m_modelstr == "H5400" )
140 d->m_model = Model_iPAQ_H5xxx; 140 d->m_model = Model_iPAQ_H5xxx;
141 else 141 else
142 d->m_model = Model_Unknown; 142 d->m_model = Model_Unknown;
143 143
144 f. close(); 144 f. close();
145 } 145 }
146 146
147 switch ( d->m_model ) { 147 switch ( d->m_model ) {
148 case Model_iPAQ_H31xx: 148 case Model_iPAQ_H31xx:
149 case Model_iPAQ_H38xx: 149 case Model_iPAQ_H38xx:
150 d->m_rotation = Rot90; 150 d->m_rotation = Rot90;
151 break; 151 break;
152 case Model_iPAQ_H36xx: 152 case Model_iPAQ_H36xx:
diff --git a/libopie2/opiecore/device/odevice_simpad.cpp b/libopie2/opiecore/device/odevice_simpad.cpp
index 7d79ef5..e9481bb 100644
--- a/libopie2/opiecore/device/odevice_simpad.cpp
+++ b/libopie2/opiecore/device/odevice_simpad.cpp
@@ -30,98 +30,98 @@ _;:, .> :=|. This program is free software; you can
30#include "odevice_simpad.h" 30#include "odevice_simpad.h"
31 31
32/* QT */ 32/* QT */
33#include <qapplication.h> 33#include <qapplication.h>
34#include <qfile.h> 34#include <qfile.h>
35#include <qtextstream.h> 35#include <qtextstream.h>
36#include <qwindowsystem_qws.h> 36#include <qwindowsystem_qws.h>
37 37
38/* OPIE */ 38/* OPIE */
39#include <qpe/config.h> 39#include <qpe/config.h>
40#include <qpe/resource.h> 40#include <qpe/resource.h>
41#include <qpe/sound.h> 41#include <qpe/sound.h>
42#include <qpe/qcopenvelope_qws.h> 42#include <qpe/qcopenvelope_qws.h>
43 43
44/* STD */ 44/* STD */
45#include <fcntl.h> 45#include <fcntl.h>
46#include <math.h> 46#include <math.h>
47#include <stdlib.h> 47#include <stdlib.h>
48#include <signal.h> 48#include <signal.h>
49#include <sys/ioctl.h> 49#include <sys/ioctl.h>
50#include <sys/time.h> 50#include <sys/time.h>
51#include <unistd.h> 51#include <unistd.h>
52#ifndef QT_NO_SOUND 52#ifndef QT_NO_SOUND
53#include <linux/soundcard.h> 53#include <linux/soundcard.h>
54#endif 54#endif
55 55
56using namespace Opie::Core; 56using namespace Opie::Core;
57using namespace Opie::Core::Internal; 57using namespace Opie::Core::Internal;
58 58
59struct s_button simpad_buttons [] = { 59struct s_button simpad_buttons [] = {
60 { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, 60 { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus,
61 Qt::Key_F9, QT_TRANSLATE_NOOP("Button", "Lower+Up"), 61 Qt::Key_F9, QT_TRANSLATE_NOOP("Button", "Lower+Up"),
62 "devicebuttons/simpad_lower_up", 62 "devicebuttons/simpad_lower_up",
63 "datebook", "nextView()", 63 "datebook", "nextView()",
64 "today", "raise()" }, 64 "today", "raise()" },
65 { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, 65 { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus,
66 Qt::Key_F10, QT_TRANSLATE_NOOP("Button", "Lower+Down"), 66 Qt::Key_F10, QT_TRANSLATE_NOOP("Button", "Lower+Down"),
67 "devicebuttons/simpad_lower_down", 67 "devicebuttons/simpad_lower_down",
68 "addressbook", "raise()", 68 "addressbook", "raise()",
69 "addressbook", "beamBusinessCard()" }, 69 "addressbook", "beamBusinessCard()" },
70 { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, 70 { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus,
71 Qt::Key_F11, QT_TRANSLATE_NOOP("Button", "Lower+Right"), 71 Qt::Key_F11, QT_TRANSLATE_NOOP("Button", "Lower+Right"),
72 "devicebuttons/simpad_lower_right", 72 "devicebuttons/simpad_lower_right",
73 "QPE/TaskBar", "toggleMenu()", 73 "QPE/TaskBar", "toggleMenu()",
74 "QPE/TaskBar", "toggleStartMenu()" }, 74 "QPE/TaskBar", "toggleStartMenu()" },
75 { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, 75 { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus,
76 Qt::Key_F13, QT_TRANSLATE_NOOP("Button", "Lower+Left"), 76 Qt::Key_F13, QT_TRANSLATE_NOOP("Button", "Lower+Left"),
77 "devicebuttons/simpad_lower_left", 77 "devicebuttons/simpad_lower_left",
78 "mail", "raise()", 78 "opiemail", "raise()",
79 "mail", "newMail()" }, 79 "opiemail", "newMail()" },
80 80
81 { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, 81 { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus,
82 Qt::Key_F5, QT_TRANSLATE_NOOP("Button", "Upper+Up"), 82 Qt::Key_F5, QT_TRANSLATE_NOOP("Button", "Upper+Up"),
83 "devicebuttons/simpad_upper_up", 83 "devicebuttons/simpad_upper_up",
84 "QPE/Launcher", "home()", 84 "QPE/Launcher", "home()",
85 "buttonsettings", "raise()" }, 85 "buttonsettings", "raise()" },
86 { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, 86 { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus,
87 Qt::Key_F6, QT_TRANSLATE_NOOP("Button", "Upper+Down"), 87 Qt::Key_F6, QT_TRANSLATE_NOOP("Button", "Upper+Down"),
88 "devicebuttons/simpad_upper_down", 88 "devicebuttons/simpad_upper_down",
89 "addressbook", "raise()", 89 "addressbook", "raise()",
90 "addressbook", "beamBusinessCard()" }, 90 "addressbook", "beamBusinessCard()" },
91 { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, 91 { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus,
92 Qt::Key_F7, QT_TRANSLATE_NOOP("Button", "Upper+Right"), 92 Qt::Key_F7, QT_TRANSLATE_NOOP("Button", "Upper+Right"),
93 "devicebuttons/simpad_upper_right", 93 "devicebuttons/simpad_upper_right",
94 "QPE/TaskBar", "toggleMenu()", 94 "QPE/TaskBar", "toggleMenu()",
95 "QPE/TaskBar", "toggleStartMenu()" }, 95 "QPE/TaskBar", "toggleStartMenu()" },
96 { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, 96 { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus,
97 Qt::Key_F13, QT_TRANSLATE_NOOP("Button", "Upper+Left"), 97 Qt::Key_F13, QT_TRANSLATE_NOOP("Button", "Upper+Left"),
98 "devicebuttons/simpad_upper_left", 98 "devicebuttons/simpad_upper_left",
99 "QPE/Rotation", "flip()", 99 "QPE/Rotation", "flip()",
100 "QPE/Rotation", "flip()" }, 100 "QPE/Rotation", "flip()" },
101 /* 101 /*
102 { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, 102 { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus,
103 Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Lower+Upper"), 103 Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Lower+Upper"),
104 "devicebuttons/simpad_lower_upper", 104 "devicebuttons/simpad_lower_upper",
105 "QPE/Launcher", "home()", 105 "QPE/Launcher", "home()",
106 "buttonsettings", "raise()" }, 106 "buttonsettings", "raise()" },
107 { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, 107 { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus,
108 Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Lower+Upper"), 108 Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Lower+Upper"),
109 "devicebuttons/simpad_upper_lower", 109 "devicebuttons/simpad_upper_lower",
110 "QPE/Launcher", "home()", 110 "QPE/Launcher", "home()",
111 "buttonsettings", "raise()" }, 111 "buttonsettings", "raise()" },
112 */ 112 */
113}; 113};
114 114
115void SIMpad::init() 115void SIMpad::init()
116{ 116{
117 d->m_vendorstr = "SIEMENS"; 117 d->m_vendorstr = "SIEMENS";
118 d->m_vendor = Vendor_SIEMENS; 118 d->m_vendor = Vendor_SIEMENS;
119 119
120 QFile f ( "/proc/hal/model" ); 120 QFile f ( "/proc/hal/model" );
121 121
122 //TODO Implement model checking 122 //TODO Implement model checking
123 //FIXME For now we assume an SL4 123 //FIXME For now we assume an SL4
124 124
125 d->m_modelstr = "SL4"; 125 d->m_modelstr = "SL4";
126 d->m_model = Model_SIMpad_SL4; 126 d->m_model = Model_SIMpad_SL4;
127 127
diff --git a/libopie2/opiecore/device/odevice_zaurus.cpp b/libopie2/opiecore/device/odevice_zaurus.cpp
index 000d29c..1434e69 100644
--- a/libopie2/opiecore/device/odevice_zaurus.cpp
+++ b/libopie2/opiecore/device/odevice_zaurus.cpp
@@ -30,98 +30,98 @@ _;:, .> :=|. This program is free software; you can
30#include "odevice_zaurus.h" 30#include "odevice_zaurus.h"
31 31
32/* QT */ 32/* QT */
33#include <qapplication.h> 33#include <qapplication.h>
34#include <qfile.h> 34#include <qfile.h>
35#include <qtextstream.h> 35#include <qtextstream.h>
36#include <qwindowsystem_qws.h> 36#include <qwindowsystem_qws.h>
37 37
38/* OPIE */ 38/* OPIE */
39#include <qpe/config.h> 39#include <qpe/config.h>
40#include <qpe/resource.h> 40#include <qpe/resource.h>
41#include <qpe/sound.h> 41#include <qpe/sound.h>
42#include <qpe/qcopenvelope_qws.h> 42#include <qpe/qcopenvelope_qws.h>
43 43
44/* STD */ 44/* STD */
45#include <fcntl.h> 45#include <fcntl.h>
46#include <math.h> 46#include <math.h>
47#include <stdlib.h> 47#include <stdlib.h>
48#include <signal.h> 48#include <signal.h>
49#include <sys/ioctl.h> 49#include <sys/ioctl.h>
50#include <sys/time.h> 50#include <sys/time.h>
51#include <unistd.h> 51#include <unistd.h>
52#ifndef QT_NO_SOUND 52#ifndef QT_NO_SOUND
53#include <linux/soundcard.h> 53#include <linux/soundcard.h>
54#endif 54#endif
55 55
56using namespace Opie::Core; 56using namespace Opie::Core;
57using namespace Opie::Core::Internal; 57using namespace Opie::Core::Internal;
58 58
59struct z_button z_buttons [] = { 59struct z_button z_buttons [] = {
60 { Qt::Key_F9, QT_TRANSLATE_NOOP("Button", "Calendar Button"), 60 { Qt::Key_F9, QT_TRANSLATE_NOOP("Button", "Calendar Button"),
61 "devicebuttons/z_calendar", 61 "devicebuttons/z_calendar",
62 "datebook", "nextView()", 62 "datebook", "nextView()",
63 "today", "raise()" }, 63 "today", "raise()" },
64 { Qt::Key_F10, QT_TRANSLATE_NOOP("Button", "Contacts Button"), 64 { Qt::Key_F10, QT_TRANSLATE_NOOP("Button", "Contacts Button"),
65 "devicebuttons/z_contact", 65 "devicebuttons/z_contact",
66 "addressbook", "raise()", 66 "addressbook", "raise()",
67 "addressbook", "beamBusinessCard()" }, 67 "addressbook", "beamBusinessCard()" },
68 { Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Home Button"), 68 { Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Home Button"),
69 "devicebuttons/z_home", 69 "devicebuttons/z_home",
70 "QPE/Launcher", "home()", 70 "QPE/Launcher", "home()",
71 "buttonsettings", "raise()" }, 71 "buttonsettings", "raise()" },
72 { Qt::Key_F11, QT_TRANSLATE_NOOP("Button", "Menu Button"), 72 { Qt::Key_F11, QT_TRANSLATE_NOOP("Button", "Menu Button"),
73 "devicebuttons/z_menu", 73 "devicebuttons/z_menu",
74 "QPE/TaskBar", "toggleMenu()", 74 "QPE/TaskBar", "toggleMenu()",
75 "QPE/TaskBar", "toggleStartMenu()" }, 75 "QPE/TaskBar", "toggleStartMenu()" },
76 { Qt::Key_F13, QT_TRANSLATE_NOOP("Button", "Mail Button"), 76 { Qt::Key_F13, QT_TRANSLATE_NOOP("Button", "Mail Button"),
77 "devicebuttons/z_mail", 77 "devicebuttons/z_mail",
78 "mail", "raise()", 78 "opiemail", "raise()",
79 "mail", "newMail()" }, 79 "opiemail", "newMail()" },
80}; 80};
81 81
82struct z_button z_buttons_c700 [] = { 82struct z_button z_buttons_c700 [] = {
83 { Qt::Key_F9, QT_TRANSLATE_NOOP("Button", "Calendar Button"), 83 { Qt::Key_F9, QT_TRANSLATE_NOOP("Button", "Calendar Button"),
84 "devicebuttons/z_calendar", 84 "devicebuttons/z_calendar",
85 "datebook", "nextView()", 85 "datebook", "nextView()",
86 "today", "raise()" }, 86 "today", "raise()" },
87 { Qt::Key_F10, QT_TRANSLATE_NOOP("Button", "Contacts Button"), 87 { Qt::Key_F10, QT_TRANSLATE_NOOP("Button", "Contacts Button"),
88 "devicebuttons/z_contact", 88 "devicebuttons/z_contact",
89 "addressbook", "raise()", 89 "addressbook", "raise()",
90 "addressbook", "beamBusinessCard()" }, 90 "addressbook", "beamBusinessCard()" },
91 { Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Home Button"), 91 { Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Home Button"),
92 "devicebuttons/z_home", 92 "devicebuttons/z_home",
93 "QPE/Launcher", "home()", 93 "QPE/Launcher", "home()",
94 "buttonsettings", "raise()" }, 94 "buttonsettings", "raise()" },
95 { Qt::Key_F11, QT_TRANSLATE_NOOP("Button", "Menu Button"), 95 { Qt::Key_F11, QT_TRANSLATE_NOOP("Button", "Menu Button"),
96 "devicebuttons/z_menu", 96 "devicebuttons/z_menu",
97 "QPE/TaskBar", "toggleMenu()", 97 "QPE/TaskBar", "toggleMenu()",
98 "QPE/TaskBar", "toggleStartMenu()" }, 98 "QPE/TaskBar", "toggleStartMenu()" },
99 { Qt::Key_F14, QT_TRANSLATE_NOOP("Button", "Display Rotate"), 99 { Qt::Key_F14, QT_TRANSLATE_NOOP("Button", "Display Rotate"),
100 "devicebuttons/z_hinge", 100 "devicebuttons/z_hinge",
101 "QPE/Rotation", "rotateDefault()", 101 "QPE/Rotation", "rotateDefault()",
102 "QPE/Dummy", "doNothing()" }, 102 "QPE/Dummy", "doNothing()" },
103}; 103};
104 104
105// FIXME This gets unnecessary complicated. We should think about splitting the Zaurus 105// FIXME This gets unnecessary complicated. We should think about splitting the Zaurus
106// class up into individual classes. We need three classes 106// class up into individual classes. We need three classes
107// 107//
108// Zaurus-Collie (SA-model w/ 320x240 lcd, for SL5500 and SL5000) 108// Zaurus-Collie (SA-model w/ 320x240 lcd, for SL5500 and SL5000)
109// Zaurus-Poodle (PXA-model w/ 320x240 lcd, for SL5600) 109// Zaurus-Poodle (PXA-model w/ 320x240 lcd, for SL5600)
110// Zaurus-Corgi (PXA-model w/ 640x480 lcd, for C700, C750, C760, and C860) 110// Zaurus-Corgi (PXA-model w/ 640x480 lcd, for C700, C750, C760, and C860)
111// 111//
112// Only question right now is: Do we really need to do it? Because as soon 112// Only question right now is: Do we really need to do it? Because as soon
113// as the OpenZaurus kernel is ready, there will be a unified interface for all 113// as the OpenZaurus kernel is ready, there will be a unified interface for all
114// Zaurus models (concerning apm, backlight, buttons, etc.) 114// Zaurus models (concerning apm, backlight, buttons, etc.)
115// 115//
116// Comments? - mickeyl. 116// Comments? - mickeyl.
117 117
118void Zaurus::init() 118void Zaurus::init()
119{ 119{
120 d->m_vendorstr = "Sharp"; 120 d->m_vendorstr = "Sharp";
121 d->m_vendor = Vendor_Sharp; 121 d->m_vendor = Vendor_Sharp;
122 m_embedix = true; // Not openzaurus means: It has an embedix kernel ! 122 m_embedix = true; // Not openzaurus means: It has an embedix kernel !
123 123
124 // QFile f ( "/proc/filesystems" ); 124 // QFile f ( "/proc/filesystems" );
125 QString model; 125 QString model;
126 126
127 // It isn't a good idea to check the system configuration to 127 // It isn't a good idea to check the system configuration to