summaryrefslogtreecommitdiff
authorzecke <zecke>2004-05-01 18:13:29 (UTC)
committer zecke <zecke>2004-05-01 18:13:29 (UTC)
commit7a2cac7a65be07c1e82508e00c2d3d61e0823dc1 (patch) (unidiff)
tree70381a30c784957b22d9e644272ac96a0fced5a4
parentec6a887d8abddbab085a0a3aecae5760ff85dbe8 (diff)
downloadopie-7a2cac7a65be07c1e82508e00c2d3d61e0823dc1.zip
opie-7a2cac7a65be07c1e82508e00c2d3d61e0823dc1.tar.gz
opie-7a2cac7a65be07c1e82508e00c2d3d61e0823dc1.tar.bz2
Pass on the Hardware line of proc/cpuinfo so we don't need to parse the file again..
only adjusted iPAQ backend to use it Beginning of hh22xx Linux2.6 support
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiecore/device/odevice.cpp6
-rw-r--r--libopie2/opiecore/device/odevice.h7
-rw-r--r--libopie2/opiecore/device/odevice_ipaq.cpp52
-rw-r--r--libopie2/opiecore/device/odevice_ipaq.h2
-rw-r--r--libopie2/opiecore/device/odevice_jornada.cpp2
-rw-r--r--libopie2/opiecore/device/odevice_jornada.h2
-rw-r--r--libopie2/opiecore/device/odevice_ramses.cpp2
-rw-r--r--libopie2/opiecore/device/odevice_ramses.h2
-rw-r--r--libopie2/opiecore/device/odevice_simpad.cpp2
-rw-r--r--libopie2/opiecore/device/odevice_simpad.h2
-rw-r--r--libopie2/opiecore/device/odevice_yopy.cpp2
-rw-r--r--libopie2/opiecore/device/odevice_yopy.h2
-rw-r--r--libopie2/opiecore/device/odevice_zaurus.cpp2
-rw-r--r--libopie2/opiecore/device/odevice_zaurus.h2
14 files changed, 44 insertions, 43 deletions
diff --git a/libopie2/opiecore/device/odevice.cpp b/libopie2/opiecore/device/odevice.cpp
index 62a2e03..cef7f63 100644
--- a/libopie2/opiecore/device/odevice.cpp
+++ b/libopie2/opiecore/device/odevice.cpp
@@ -69,109 +69,111 @@ struct default_button default_buttons [] = {
69 "today", "raise()" }, 69 "today", "raise()" },
70 { Qt::Key_F10, QT_TRANSLATE_NOOP("Button", "Contacts Button"), 70 { Qt::Key_F10, QT_TRANSLATE_NOOP("Button", "Contacts Button"),
71 "devicebuttons/z_contact", 71 "devicebuttons/z_contact",
72 "addressbook", "raise()", 72 "addressbook", "raise()",
73 "addressbook", "beamBusinessCard()" }, 73 "addressbook", "beamBusinessCard()" },
74 { Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Home Button"), 74 { Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Home Button"),
75 "devicebuttons/z_home", 75 "devicebuttons/z_home",
76 "QPE/Launcher", "home()", 76 "QPE/Launcher", "home()",
77 "buttonsettings", "raise()" }, 77 "buttonsettings", "raise()" },
78 { Qt::Key_F11, QT_TRANSLATE_NOOP("Button", "Menu Button"), 78 { Qt::Key_F11, QT_TRANSLATE_NOOP("Button", "Menu Button"),
79 "devicebuttons/z_menu", 79 "devicebuttons/z_menu",
80 "QPE/TaskBar", "toggleMenu()", 80 "QPE/TaskBar", "toggleMenu()",
81 "QPE/TaskBar", "toggleStartMenu()" }, 81 "QPE/TaskBar", "toggleStartMenu()" },
82 { Qt::Key_F13, QT_TRANSLATE_NOOP("Button", "Mail Button"), 82 { Qt::Key_F13, QT_TRANSLATE_NOOP("Button", "Mail Button"),
83 "devicebuttons/z_mail", 83 "devicebuttons/z_mail",
84 "opiemail", "raise()", 84 "opiemail", "raise()",
85 "opiemail", "newMail()" }, 85 "opiemail", "newMail()" },
86}; 86};
87 87
88ODevice *ODevice::inst() 88ODevice *ODevice::inst()
89{ 89{
90 static ODevice *dev = 0; 90 static ODevice *dev = 0;
91 91
92 // rewrite this to only use /proc/cpuinfo or so 92 // rewrite this to only use /proc/cpuinfo or so
93 QString cpu_info;
93 94
94 if ( !dev ) 95 if ( !dev )
95 { 96 {
96 QFile f( PATH_PROC_CPUINFO ); 97 QFile f( PATH_PROC_CPUINFO );
97 if ( f.open( IO_ReadOnly ) ) 98 if ( f.open( IO_ReadOnly ) )
98 { 99 {
99 QTextStream s( &f ); 100 QTextStream s( &f );
100 while ( !s.atEnd() ) 101 while ( !s.atEnd() )
101 { 102 {
102 QString line; 103 QString line;
103 line = s.readLine(); 104 line = s.readLine();
104 if ( line.startsWith( "Hardware" ) ) 105 if ( line.startsWith( "Hardware" ) )
105 { 106 {
106 qDebug( "ODevice() - found '%s'", (const char*) line ); 107 qDebug( "ODevice() - found '%s'", (const char*) line );
108 cpu_info = line;
107 if ( line.contains( "sharp", false ) ) dev = new Internal::Zaurus(); 109 if ( line.contains( "sharp", false ) ) dev = new Internal::Zaurus();
108 else if ( line.contains( "ipaq", false ) ) dev = new Internal::iPAQ(); 110 else if ( line.contains( "ipaq", false ) ) dev = new Internal::iPAQ();
109 else if ( line.contains( "simpad", false ) ) dev = new Internal::SIMpad(); 111 else if ( line.contains( "simpad", false ) ) dev = new Internal::SIMpad();
110 else if ( line.contains( "jornada", false ) ) dev = new Internal::Jornada(); 112 else if ( line.contains( "jornada", false ) ) dev = new Internal::Jornada();
111 else if ( line.contains( "ramses", false ) ) dev = new Internal::Ramses(); 113 else if ( line.contains( "ramses", false ) ) dev = new Internal::Ramses();
112 else qWarning( "ODevice() - unknown hardware - using default." ); 114 else qWarning( "ODevice() - unknown hardware - using default." );
113 break; 115 break;
114 } 116 }
115 } 117 }
116 } 118 }
117 else 119 else
118 { 120 {
119 qWarning( "ODevice() - can't open '%s' - unknown hardware - using default.", PATH_PROC_CPUINFO ); 121 qWarning( "ODevice() - can't open '%s' - unknown hardware - using default.", PATH_PROC_CPUINFO );
120 } 122 }
121 if ( !dev ) dev = new ODevice(); 123 if ( !dev ) dev = new ODevice();
122 dev->init(); 124 dev->init(cpu_info);
123 } 125 }
124 return dev; 126 return dev;
125} 127}
126 128
127ODevice::ODevice() 129ODevice::ODevice()
128{ 130{
129 d = new ODeviceData; 131 d = new ODeviceData;
130 132
131 d->m_modelstr = "Unknown"; 133 d->m_modelstr = "Unknown";
132 d->m_model = Model_Unknown; 134 d->m_model = Model_Unknown;
133 d->m_vendorstr = "Unknown"; 135 d->m_vendorstr = "Unknown";
134 d->m_vendor = Vendor_Unknown; 136 d->m_vendor = Vendor_Unknown;
135 d->m_systemstr = "Unknown"; 137 d->m_systemstr = "Unknown";
136 d->m_system = System_Unknown; 138 d->m_system = System_Unknown;
137 d->m_sysverstr = "0.0"; 139 d->m_sysverstr = "0.0";
138 d->m_rotation = Rot0; 140 d->m_rotation = Rot0;
139 d->m_direction = CW; 141 d->m_direction = CW;
140 142
141 d->m_holdtime = 1000; // 1000ms 143 d->m_holdtime = 1000; // 1000ms
142 d->m_buttons = 0; 144 d->m_buttons = 0;
143 d->m_cpu_frequencies = new QStrList; 145 d->m_cpu_frequencies = new QStrList;
144} 146}
145 147
146void ODevice::systemMessage ( const QCString &msg, const QByteArray & ) 148void ODevice::systemMessage ( const QCString &msg, const QByteArray & )
147{ 149{
148 if ( msg == "deviceButtonMappingChanged()" ) { 150 if ( msg == "deviceButtonMappingChanged()" ) {
149 reloadButtonMapping(); 151 reloadButtonMapping();
150 } 152 }
151} 153}
152 154
153void ODevice::init() 155void ODevice::init(const QString&)
154{ 156{
155} 157}
156 158
157/** 159/**
158* This method initialises the button mapping 160* This method initialises the button mapping
159*/ 161*/
160void ODevice::initButtons() 162void ODevice::initButtons()
161{ 163{
162 if ( d->m_buttons ) 164 if ( d->m_buttons )
163 return; 165 return;
164 166
165 qDebug ( "init Buttons" ); 167 qDebug ( "init Buttons" );
166 d->m_buttons = new QValueList <ODeviceButton>; 168 d->m_buttons = new QValueList <ODeviceButton>;
167 for ( uint i = 0; i < ( sizeof( default_buttons ) / sizeof( default_button )); i++ ) { 169 for ( uint i = 0; i < ( sizeof( default_buttons ) / sizeof( default_button )); i++ ) {
168 default_button *db = default_buttons + i; 170 default_button *db = default_buttons + i;
169 ODeviceButton b; 171 ODeviceButton b;
170 b. setKeycode ( db->code ); 172 b. setKeycode ( db->code );
171 b. setUserText ( QObject::tr ( "Button", db->utext )); 173 b. setUserText ( QObject::tr ( "Button", db->utext ));
172 b. setPixmap ( Resource::loadPixmap ( db->pix )); 174 b. setPixmap ( Resource::loadPixmap ( db->pix ));
173 b. setFactoryPresetPressedAction ( OQCopMessage ( makeChannel ( db->fpressedservice ), db->fpressedaction )); 175 b. setFactoryPresetPressedAction ( OQCopMessage ( makeChannel ( db->fpressedservice ), db->fpressedaction ));
174 b. setFactoryPresetHeldAction ( OQCopMessage ( makeChannel ( db->fheldservice ), db->fheldaction )); 176 b. setFactoryPresetHeldAction ( OQCopMessage ( makeChannel ( db->fheldservice ), db->fheldaction ));
175 d->m_buttons->append ( b ); 177 d->m_buttons->append ( b );
176 } 178 }
177 179
diff --git a/libopie2/opiecore/device/odevice.h b/libopie2/opiecore/device/odevice.h
index 0ba58f0..aaebde3 100644
--- a/libopie2/opiecore/device/odevice.h
+++ b/libopie2/opiecore/device/odevice.h
@@ -39,49 +39,50 @@ _;:, .> :=|. This program is free software; you can
39#include <qobject.h> 39#include <qobject.h>
40#include <qstring.h> 40#include <qstring.h>
41#include <qstrlist.h> 41#include <qstrlist.h>
42 42
43namespace Opie{ 43namespace Opie{
44namespace Core{ 44namespace Core{
45 45
46 class ODeviceData; 46 class ODeviceData;
47/** 47/**
48 * The available devices 48 * The available devices
49 */ 49 */
50enum OModel { 50enum OModel {
51 Model_Unknown, // = 0 51 Model_Unknown, // = 0
52 52
53 Model_Series_Mask = 0xff000000, 53 Model_Series_Mask = 0xff000000,
54 54
55 Model_iPAQ = ( 1 << 24 ), 55 Model_iPAQ = ( 1 << 24 ),
56 56
57 Model_iPAQ_All = ( Model_iPAQ | 0xffffff ), 57 Model_iPAQ_All = ( Model_iPAQ | 0xffffff ),
58 Model_iPAQ_H31xx = ( Model_iPAQ | 0x000001 ), 58 Model_iPAQ_H31xx = ( Model_iPAQ | 0x000001 ),
59 Model_iPAQ_H36xx = ( Model_iPAQ | 0x000002 ), 59 Model_iPAQ_H36xx = ( Model_iPAQ | 0x000002 ),
60 Model_iPAQ_H37xx = ( Model_iPAQ | 0x000004 ), 60 Model_iPAQ_H37xx = ( Model_iPAQ | 0x000004 ),
61 Model_iPAQ_H38xx = ( Model_iPAQ | 0x000008 ), 61 Model_iPAQ_H38xx = ( Model_iPAQ | 0x000008 ),
62 Model_iPAQ_H39xx = ( Model_iPAQ | 0x000010 ), 62 Model_iPAQ_H39xx = ( Model_iPAQ | 0x000010 ),
63 Model_iPAQ_H5xxx = ( Model_iPAQ | 0x000011 ), 63 Model_iPAQ_H5xxx = ( Model_iPAQ | 0x000020 ),
64 Model_iPAQ_H22xx = ( Model_iPAQ | 0x000040 ),
64 65
65 Model_Jornada = ( 6 << 24 ), 66 Model_Jornada = ( 6 << 24 ),
66 Model_Jornada_56x = ( Model_Jornada | 0x000001 ), 67 Model_Jornada_56x = ( Model_Jornada | 0x000001 ),
67 68
68 Model_Zaurus = ( 2 << 24 ), 69 Model_Zaurus = ( 2 << 24 ),
69 70
70 Model_Zaurus_SL5000 = ( Model_Zaurus | 0x000001 ), 71 Model_Zaurus_SL5000 = ( Model_Zaurus | 0x000001 ),
71 Model_Zaurus_SL5500 = ( Model_Zaurus | 0x000002 ), 72 Model_Zaurus_SL5500 = ( Model_Zaurus | 0x000002 ),
72 Model_Zaurus_SLA300 = ( Model_Zaurus | 0x000003 ), 73 Model_Zaurus_SLA300 = ( Model_Zaurus | 0x000003 ),
73 Model_Zaurus_SLB600 = ( Model_Zaurus | 0x000004 ), 74 Model_Zaurus_SLB600 = ( Model_Zaurus | 0x000004 ),
74 Model_Zaurus_SLC7x0 = ( Model_Zaurus | 0x000005 ), 75 Model_Zaurus_SLC7x0 = ( Model_Zaurus | 0x000005 ),
75 76
76 Model_SIMpad = ( 3 << 24 ), 77 Model_SIMpad = ( 3 << 24 ),
77 78
78 Model_SIMpad_All = ( Model_SIMpad | 0xffffff ), 79 Model_SIMpad_All = ( Model_SIMpad | 0xffffff ),
79 Model_SIMpad_CL4 = ( Model_SIMpad | 0x000001 ), 80 Model_SIMpad_CL4 = ( Model_SIMpad | 0x000001 ),
80 Model_SIMpad_SL4 = ( Model_SIMpad | 0x000002 ), 81 Model_SIMpad_SL4 = ( Model_SIMpad | 0x000002 ),
81 Model_SIMpad_SLC = ( Model_SIMpad | 0x000004 ), 82 Model_SIMpad_SLC = ( Model_SIMpad | 0x000004 ),
82 Model_SIMpad_TSinus = ( Model_SIMpad | 0x000008 ), 83 Model_SIMpad_TSinus = ( Model_SIMpad | 0x000008 ),
83 84
84 Model_Ramses = ( 4 << 24 ), 85 Model_Ramses = ( 4 << 24 ),
85 86
86 Model_Ramses_All = ( Model_Ramses | 0xffffff ), 87 Model_Ramses_All = ( Model_Ramses | 0xffffff ),
87 Model_Ramses_MNCI = ( Model_Ramses | 0x000001 ), 88 Model_Ramses_MNCI = ( Model_Ramses | 0x000001 ),
@@ -139,84 +140,84 @@ enum OHardKey {
139 HardKey_Menu = Qt::Key_F11, 140 HardKey_Menu = Qt::Key_F11,
140 HardKey_Home = Qt::Key_F12, 141 HardKey_Home = Qt::Key_F12,
141 HardKey_Mail = Qt::Key_F13, 142 HardKey_Mail = Qt::Key_F13,
142 HardKey_Record = Qt::Key_F24, 143 HardKey_Record = Qt::Key_F24,
143 HardKey_Suspend = Qt::Key_F34, 144 HardKey_Suspend = Qt::Key_F34,
144 HardKey_Backlight = Qt::Key_F35, 145 HardKey_Backlight = Qt::Key_F35,
145 HardKey_Action = Qt::Key_F10, 146 HardKey_Action = Qt::Key_F10,
146 HardKey_OK = Qt::Key_F11, 147 HardKey_OK = Qt::Key_F11,
147 HardKey_End = Qt::Key_F12, 148 HardKey_End = Qt::Key_F12,
148}; 149};
149 150
150enum ODirection { 151enum ODirection {
151 CW = 0, 152 CW = 0,
152 CCW = 1, 153 CCW = 1,
153 Flip = 2, 154 Flip = 2,
154}; 155};
155 156
156enum OHingeStatus { 157enum OHingeStatus {
157 CASE_CLOSED = 3, 158 CASE_CLOSED = 3,
158 CASE_PORTRAIT = 2, 159 CASE_PORTRAIT = 2,
159 CASE_LANDSCAPE = 0, 160 CASE_LANDSCAPE = 0,
160 CASE_UNKNOWN = 1, 161 CASE_UNKNOWN = 1,
161}; 162};
162 163
163/* default button for qvfb or such 164/* default button for qvfb or such
164 * see odevice.cpp for details. 165 * see odevice.cpp for details.
165 * hint: manage a user defined button for qvfb? 166 * hint: manage a user defined button for qvfb?
166 * alwin 167 * alwin
167 */ 168 */
168struct default_button { 169struct default_button {
169 Qt::Key code; 170 Qt::Key code;
170 char *utext; 171 char *utext;
171 char *pix; 172 char *pix;
172 char *fpressedservice; 173 char *fpressedservice;
173 char *fpressedaction; 174 char *fpressedaction;
174 char *fheldservice; 175 char *fheldservice;
175 char *fheldaction; 176 char *fheldaction;
176}; 177};
177 178
178/** 179/**
179 * A singleton which gives informations about device specefic option 180 * A singleton which gives informations about device specefic option
180 * like the Hardware used, LEDs, the Base Distribution and 181 * like the Hardware used, LEDs, the Base Distribution and
181 * hardware key mappings. 182 * hardware key mappings.
182 * 183 *
183 * @short A small class for device specefic options 184 * @short A small class for device specefic options
184 * @see QObject 185 * @see QObject
185 * @author Robert Griebl 186 * @author Robert Griebl
186 * @version 1.0 187 * @version 1.0
187 */ 188 */
188class ODevice : public QObject 189class ODevice : public QObject
189{ 190{
190 Q_OBJECT 191 Q_OBJECT
191 192
192private: 193private:
193 /* disable copy */ 194 /* disable copy */
194 ODevice ( const ODevice & ); 195 ODevice ( const ODevice & );
195 196
196protected: 197protected:
197 ODevice(); 198 ODevice();
198 virtual void init(); 199 virtual void init(const QString&);
199 virtual void initButtons(); 200 virtual void initButtons();
200 static void sendSuspendmsg(); 201 static void sendSuspendmsg();
201 202
202 ODeviceData *d; 203 ODeviceData *d;
203 204
204public: 205public:
205 // sandman do we want to allow destructions? -zecke? 206 // sandman do we want to allow destructions? -zecke?
206 virtual ~ODevice(); 207 virtual ~ODevice();
207 208
208 static ODevice *inst(); 209 static ODevice *inst();
209 210
210 // information 211 // information
211 212
212 QString modelString() const; 213 QString modelString() const;
213 OModel model() const; 214 OModel model() const;
214 inline OModel series() const { return (OModel) ( model() & Model_Series_Mask ); } 215 inline OModel series() const { return (OModel) ( model() & Model_Series_Mask ); }
215 216
216 QString vendorString() const; 217 QString vendorString() const;
217 OVendor vendor() const; 218 OVendor vendor() const;
218 219
219 QString systemString() const; 220 QString systemString() const;
220 OSystem system() const; 221 OSystem system() const;
221 222
222 QString systemVersionString() const; 223 QString systemVersionString() const;
diff --git a/libopie2/opiecore/device/odevice_ipaq.cpp b/libopie2/opiecore/device/odevice_ipaq.cpp
index 98e2ffa..efe35e7 100644
--- a/libopie2/opiecore/device/odevice_ipaq.cpp
+++ b/libopie2/opiecore/device/odevice_ipaq.cpp
@@ -93,95 +93,93 @@ struct i_button ipaq_buttons [] = {
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 "opiemail", "raise()", 103 "opiemail", "raise()",
104 "opiemail", "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(const QString& model)
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 d->m_modelstr = model.mid(model.findRev('H'));
123
124 if ( d->m_modelstr == "H3100" )
125 d->m_model = Model_iPAQ_H31xx;
126 else if ( d->m_modelstr == "H3600" )
127 d->m_model = Model_iPAQ_H36xx;
128 else if ( d->m_modelstr == "H3700" )
129 d->m_model = Model_iPAQ_H37xx;
130 else if ( d->m_modelstr == "H3800" )
131 d->m_model = Model_iPAQ_H38xx;
132 else if ( d->m_modelstr == "H3900" )
133 d->m_model = Model_iPAQ_H39xx;
134 else if ( d->m_modelstr == "H5400" )
135 d->m_model = Model_iPAQ_H5xxx;
136 else if ( d->m_modelstr == "H2200" )
137 d->m_model = Model_iPAQ_H22xx;
138 else
139 d->m_model = Model_Unknown;
123 140
124 if ( f. open ( IO_ReadOnly )) {
125 QTextStream ts ( &f );
126 141
127 d->m_modelstr = "H" + ts. readLine();
128
129 if ( d->m_modelstr == "H3100" )
130 d->m_model = Model_iPAQ_H31xx;
131 else if ( d->m_modelstr == "H3600" )
132 d->m_model = Model_iPAQ_H36xx;
133 else if ( d->m_modelstr == "H3700" )
134 d->m_model = Model_iPAQ_H37xx;
135 else if ( d->m_modelstr == "H3800" )
136 d->m_model = Model_iPAQ_H38xx;
137 else if ( d->m_modelstr == "H3900" )
138 d->m_model = Model_iPAQ_H39xx;
139 else if ( d->m_modelstr == "H5400" )
140 d->m_model = Model_iPAQ_H5xxx;
141 else
142 d->m_model = Model_Unknown;
143
144 f. close();
145 }
146 142
147 switch ( d->m_model ) { 143 switch ( d->m_model ) {
148 case Model_iPAQ_H31xx: 144 case Model_iPAQ_H31xx:
149 case Model_iPAQ_H38xx: 145 case Model_iPAQ_H38xx:
150 d->m_rotation = Rot90; 146 d->m_rotation = Rot90;
151 break; 147 break;
148 case Model_iPAQ_H5xxx:
149 case Model_iPAQ_H22xx:
150 d->m_rotation = Rot0;
151 break;
152 case Model_iPAQ_H36xx: 152 case Model_iPAQ_H36xx:
153 case Model_iPAQ_H37xx: 153 case Model_iPAQ_H37xx:
154 case Model_iPAQ_H39xx: 154 case Model_iPAQ_H39xx:
155
156 default: 155 default:
157 d->m_rotation = Rot270; 156 d->m_rotation = Rot270;
158 break; 157 break;
159 case Model_iPAQ_H5xxx: 158
160 d->m_rotation = Rot0;
161 } 159 }
162 160
163 f. setName ( "/etc/familiar-version" ); 161 QFile f( "/etc/familiar-version" );
164 if ( f. open ( IO_ReadOnly )) { 162 if ( f. open ( IO_ReadOnly )) {
165 d->m_systemstr = "Familiar"; 163 d->m_systemstr = "Familiar";
166 d->m_system = System_Familiar; 164 d->m_system = System_Familiar;
167 165
168 QTextStream ts ( &f ); 166 QTextStream ts ( &f );
169 d->m_sysverstr = ts. readLine(). mid ( 10 ); 167 d->m_sysverstr = ts. readLine(). mid ( 10 );
170 168
171 f. close(); 169 f. close();
172 } else { 170 } else {
173 f. setName ( "/etc/oz_version" ); 171 f. setName ( "/etc/oz_version" );
174 172
175 if ( f. open ( IO_ReadOnly )) { 173 if ( f. open ( IO_ReadOnly )) {
176 d->m_systemstr = "OpenEmbedded/iPaq"; 174 d->m_systemstr = "OpenEmbedded/iPaq";
177 d->m_system = System_Familiar; 175 d->m_system = System_Familiar;
178 176
179 QTextStream ts ( &f ); 177 QTextStream ts ( &f );
180 ts.setDevice ( &f ); 178 ts.setDevice ( &f );
181 d->m_sysverstr = ts. readLine(); 179 d->m_sysverstr = ts. readLine();
182 f. close(); 180 f. close();
183 } 181 }
184 } 182 }
185 183
186 m_leds [0] = m_leds [1] = Led_Off; 184 m_leds [0] = m_leds [1] = Led_Off;
187 185
diff --git a/libopie2/opiecore/device/odevice_ipaq.h b/libopie2/opiecore/device/odevice_ipaq.h
index 968f715..cc0b8ac 100644
--- a/libopie2/opiecore/device/odevice_ipaq.h
+++ b/libopie2/opiecore/device/odevice_ipaq.h
@@ -22,49 +22,49 @@
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#ifndef ODEVICE_IPAQ 30#ifndef ODEVICE_IPAQ
31#define ODEVICE_IPAQ 31#define ODEVICE_IPAQ
32 32
33#include "odevice.h" 33#include "odevice.h"
34 34
35/* QT */ 35/* QT */
36#include <qwindowsystem_qws.h> 36#include <qwindowsystem_qws.h>
37 37
38namespace Opie { 38namespace Opie {
39namespace Core { 39namespace Core {
40namespace Internal { 40namespace Internal {
41 41
42class iPAQ : public ODevice, public QWSServer::KeyboardFilter 42class iPAQ : public ODevice, public QWSServer::KeyboardFilter
43{ 43{
44 44
45 protected: 45 protected:
46 virtual void init(); 46 virtual void init(const QString&);
47 virtual void initButtons(); 47 virtual void initButtons();
48 48
49 public: 49 public:
50 virtual bool setSoftSuspend( bool soft ); 50 virtual bool setSoftSuspend( bool soft );
51 51
52 virtual bool setDisplayBrightness( int b ); 52 virtual bool setDisplayBrightness( int b );
53 virtual int displayBrightnessResolution() const; 53 virtual int displayBrightnessResolution() const;
54 54
55 virtual void playAlarmSound(); 55 virtual void playAlarmSound();
56 56
57 virtual QValueList <OLed> ledList() const; 57 virtual QValueList <OLed> ledList() const;
58 virtual QValueList <OLedState> ledStateList( OLed led ) const; 58 virtual QValueList <OLedState> ledStateList( OLed led ) const;
59 virtual OLedState ledState( OLed led ) const; 59 virtual OLedState ledState( OLed led ) const;
60 virtual bool setLedState( OLed led, OLedState st ); 60 virtual bool setLedState( OLed led, OLedState st );
61 61
62 virtual bool hasLightSensor() const; 62 virtual bool hasLightSensor() const;
63 virtual int readLightSensor(); 63 virtual int readLightSensor();
64 virtual int lightSensorResolution() const; 64 virtual int lightSensorResolution() const;
65 65
66 protected: 66 protected:
67 virtual bool filter( int unicode, int keycode, int modifiers, bool isPress, bool autoRepeat ); 67 virtual bool filter( int unicode, int keycode, int modifiers, bool isPress, bool autoRepeat );
68 virtual void timerEvent( QTimerEvent *te ); 68 virtual void timerEvent( QTimerEvent *te );
69 69
70 int m_power_timer; 70 int m_power_timer;
diff --git a/libopie2/opiecore/device/odevice_jornada.cpp b/libopie2/opiecore/device/odevice_jornada.cpp
index eaa93ca..ad2f830 100644
--- a/libopie2/opiecore/device/odevice_jornada.cpp
+++ b/libopie2/opiecore/device/odevice_jornada.cpp
@@ -58,49 +58,49 @@
58 58
59#define OD_IO(type,number) OD_IOC(0,type,number,0) 59#define OD_IO(type,number) OD_IOC(0,type,number,0)
60#define OD_IOW(type,number,size) OD_IOC(1,type,number,sizeof(size)) 60#define OD_IOW(type,number,size) OD_IOC(1,type,number,sizeof(size))
61#define OD_IOR(type,number,size) OD_IOC(2,type,number,sizeof(size)) 61#define OD_IOR(type,number,size) OD_IOC(2,type,number,sizeof(size))
62#define OD_IORW(type,number,size) OD_IOC(3,type,number,sizeof(size)) 62#define OD_IORW(type,number,size) OD_IOC(3,type,number,sizeof(size))
63 63
64typedef struct { 64typedef struct {
65 unsigned char OffOnBlink; /* 0=off 1=on 2=Blink */ 65 unsigned char OffOnBlink; /* 0=off 1=on 2=Blink */
66 unsigned char TotalTime; /* Units of 5 seconds */ 66 unsigned char TotalTime; /* Units of 5 seconds */
67 unsigned char OnTime; /* units of 100m/s */ 67 unsigned char OnTime; /* units of 100m/s */
68 unsigned char OffTime; /* units of 100m/s */ 68 unsigned char OffTime; /* units of 100m/s */
69} LED_IN; 69} LED_IN;
70 70
71typedef struct { 71typedef struct {
72 unsigned char mode; 72 unsigned char mode;
73 unsigned char pwr; 73 unsigned char pwr;
74 unsigned char brightness; 74 unsigned char brightness;
75} FLITE_IN; 75} FLITE_IN;
76 76
77#define LED_ON OD_IOW( 'f', 5, LED_IN ) 77#define LED_ON OD_IOW( 'f', 5, LED_IN )
78#define FLITE_ON OD_IOW( 'f', 7, FLITE_IN ) 78#define FLITE_ON OD_IOW( 'f', 7, FLITE_IN )
79 79
80using namespace Opie::Core::Internal; 80using namespace Opie::Core::Internal;
81 81
82void Jornada::init() 82void Jornada::init(const QString&)
83{ 83{
84 d->m_vendorstr = "HP"; 84 d->m_vendorstr = "HP";
85 d->m_vendor = Vendor_HP; 85 d->m_vendor = Vendor_HP;
86 d->m_modelstr = "Jornada 56x"; 86 d->m_modelstr = "Jornada 56x";
87 d->m_model = Model_Jornada_56x; 87 d->m_model = Model_Jornada_56x;
88 d->m_systemstr = "Familiar"; 88 d->m_systemstr = "Familiar";
89 d->m_system = System_Familiar; 89 d->m_system = System_Familiar;
90 d->m_rotation = Rot0; 90 d->m_rotation = Rot0;
91 91
92 QFile f ( "/etc/familiar-version" ); 92 QFile f ( "/etc/familiar-version" );
93 f.setName ( "/etc/familiar-version" ); 93 f.setName ( "/etc/familiar-version" );
94 if ( f.open ( IO_ReadOnly )) { 94 if ( f.open ( IO_ReadOnly )) {
95 95
96 QTextStream ts ( &f ); 96 QTextStream ts ( &f );
97 d->m_sysverstr = ts.readLine().mid( 10 ); 97 d->m_sysverstr = ts.readLine().mid( 10 );
98 98
99 f. close(); 99 f. close();
100 } 100 }
101} 101}
102 102
103 103
104int Jornada::displayBrightnessResolution() const 104int Jornada::displayBrightnessResolution() const
105{ 105{
106 return 0; 106 return 0;
diff --git a/libopie2/opiecore/device/odevice_jornada.h b/libopie2/opiecore/device/odevice_jornada.h
index e2e67af..fddfe34 100644
--- a/libopie2/opiecore/device/odevice_jornada.h
+++ b/libopie2/opiecore/device/odevice_jornada.h
@@ -18,36 +18,36 @@
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#ifndef ODEVICE_JORNADA 30#ifndef ODEVICE_JORNADA
31#define ODEVICE_JORNADA 31#define ODEVICE_JORNADA
32 32
33#include <opie2/odevice.h> 33#include <opie2/odevice.h>
34 34
35namespace Opie { 35namespace Opie {
36namespace Core { 36namespace Core {
37namespace Internal { 37namespace Internal {
38class Jornada : public ODevice 38class Jornada : public ODevice
39{ 39{
40 40
41 protected: 41 protected:
42 virtual void init(); 42 virtual void init(const QString&);
43 43
44 public: 44 public:
45 virtual bool setSoftSuspend ( bool soft ); 45 virtual bool setSoftSuspend ( bool soft );
46 virtual bool setDisplayBrightness ( int b ); 46 virtual bool setDisplayBrightness ( int b );
47 virtual int displayBrightnessResolution() const; 47 virtual int displayBrightnessResolution() const;
48}; 48};
49} 49}
50} 50}
51} 51}
52#endif 52#endif
53 53
diff --git a/libopie2/opiecore/device/odevice_ramses.cpp b/libopie2/opiecore/device/odevice_ramses.cpp
index 10b7b61..32467f1 100644
--- a/libopie2/opiecore/device/odevice_ramses.cpp
+++ b/libopie2/opiecore/device/odevice_ramses.cpp
@@ -48,49 +48,49 @@
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 r_button ramses_buttons [] = { 59struct r_button ramses_buttons [] = {
60 { Model_Ramses_MNCI, 60 { Model_Ramses_MNCI,
61 Qt::Key_F11, QT_TRANSLATE_NOOP("Button", "Menu Button"), 61 Qt::Key_F11, QT_TRANSLATE_NOOP("Button", "Menu Button"),
62 "devicebuttons/z_menu", 62 "devicebuttons/z_menu",
63 "QPE/TaskBar", "toggleMenu()", 63 "QPE/TaskBar", "toggleMenu()",
64 "QPE/TaskBar", "toggleStartMenu()" }, 64 "QPE/TaskBar", "toggleStartMenu()" },
65 { Model_Ramses_MNCI, 65 { Model_Ramses_MNCI,
66 Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Home Button"), 66 Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Home Button"),
67 "devicebuttons/ipaq_home", 67 "devicebuttons/ipaq_home",
68 "QPE/Launcher", "home()", 68 "QPE/Launcher", "home()",
69 "buttonsettings", "raise()" }, 69 "buttonsettings", "raise()" },
70}; 70};
71 71
72void Ramses::init() 72void Ramses::init(const QString&)
73{ 73{
74 d->m_vendorstr = "M und N"; 74 d->m_vendorstr = "M und N";
75 d->m_vendor = Vendor_MundN; 75 d->m_vendor = Vendor_MundN;
76 76
77 QFile f("/proc/sys/board/ramses"); 77 QFile f("/proc/sys/board/ramses");
78 78
79 d->m_modelstr = "Ramses"; 79 d->m_modelstr = "Ramses";
80 d->m_model = Model_Ramses_MNCI; 80 d->m_model = Model_Ramses_MNCI;
81 81
82 d->m_rotation = Rot0; 82 d->m_rotation = Rot0;
83 d->m_holdtime = 1000; 83 d->m_holdtime = 1000;
84 84
85 f.setName("/etc/oz_version"); 85 f.setName("/etc/oz_version");
86 86
87 if (f.open(IO_ReadOnly)) { 87 if (f.open(IO_ReadOnly)) {
88 d->m_systemstr = "OpenEmbedded/Ramses"; 88 d->m_systemstr = "OpenEmbedded/Ramses";
89 d->m_system = System_OpenZaurus; 89 d->m_system = System_OpenZaurus;
90 90
91 QTextStream ts(&f); 91 QTextStream ts(&f);
92 ts.setDevice(&f); 92 ts.setDevice(&f);
93 d->m_sysverstr = ts.readLine(); 93 d->m_sysverstr = ts.readLine();
94 f.close(); 94 f.close();
95 } 95 }
96 96
diff --git a/libopie2/opiecore/device/odevice_ramses.h b/libopie2/opiecore/device/odevice_ramses.h
index aea9e2a..3cf5e92 100644
--- a/libopie2/opiecore/device/odevice_ramses.h
+++ b/libopie2/opiecore/device/odevice_ramses.h
@@ -20,49 +20,49 @@
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#ifndef ODEVICE_RAMSES 30#ifndef ODEVICE_RAMSES
31#define ODEVICE_RAMSES 31#define ODEVICE_RAMSES
32 32
33#include <opie2/odevice.h> 33#include <opie2/odevice.h>
34/* QT */ 34/* QT */
35#include <qwindowsystem_qws.h> 35#include <qwindowsystem_qws.h>
36 36
37namespace Opie { 37namespace Opie {
38namespace Core { 38namespace Core {
39namespace Internal { 39namespace Internal {
40 40
41class Ramses : public ODevice, public QWSServer::KeyboardFilter 41class Ramses : public ODevice, public QWSServer::KeyboardFilter
42{ 42{
43 protected: 43 protected:
44 virtual void init(); 44 virtual void init(const QString&);
45 45
46 public: 46 public:
47 virtual bool setSoftSuspend( bool soft ); 47 virtual bool setSoftSuspend( bool soft );
48 virtual bool suspend(); 48 virtual bool suspend();
49 49
50 virtual bool setDisplayStatus( bool on ); 50 virtual bool setDisplayStatus( bool on );
51 virtual bool setDisplayBrightness( int b ); 51 virtual bool setDisplayBrightness( int b );
52 virtual int displayBrightnessResolution() const; 52 virtual int displayBrightnessResolution() const;
53 virtual bool setDisplayContrast( int b ); 53 virtual bool setDisplayContrast( int b );
54 virtual int displayContrastResolution() const; 54 virtual int displayContrastResolution() const;
55 55
56 protected: 56 protected:
57 virtual bool filter ( int unicode, int keycode, int modifiers, bool isPress, bool autoRepeat ); 57 virtual bool filter ( int unicode, int keycode, int modifiers, bool isPress, bool autoRepeat );
58 virtual void timerEvent ( QTimerEvent *te ); 58 virtual void timerEvent ( QTimerEvent *te );
59 59
60 int m_power_timer; 60 int m_power_timer;
61}; 61};
62 62
63struct r_button { 63struct r_button {
64 uint model; 64 uint model;
65 Qt::Key code; 65 Qt::Key code;
66 char *utext; 66 char *utext;
67 char *pix; 67 char *pix;
68 char *fpressedservice; 68 char *fpressedservice;
diff --git a/libopie2/opiecore/device/odevice_simpad.cpp b/libopie2/opiecore/device/odevice_simpad.cpp
index e9481bb..6630763 100644
--- a/libopie2/opiecore/device/odevice_simpad.cpp
+++ b/libopie2/opiecore/device/odevice_simpad.cpp
@@ -91,49 +91,49 @@ struct s_button simpad_buttons [] = {
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(const QString&)
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
128 switch ( d->m_model ) { 128 switch ( d->m_model ) {
129 default: 129 default:
130 d->m_rotation = Rot0; 130 d->m_rotation = Rot0;
131 d->m_direction = CCW; 131 d->m_direction = CCW;
132 d->m_holdtime = 1000; // 1000ms 132 d->m_holdtime = 1000; // 1000ms
133 133
134 break; 134 break;
135 } 135 }
136 136
137 f. setName ( "/etc/familiar-version" ); 137 f. setName ( "/etc/familiar-version" );
138 if ( f. open ( IO_ReadOnly )) { 138 if ( f. open ( IO_ReadOnly )) {
139 d->m_systemstr = "Familiar"; 139 d->m_systemstr = "Familiar";
diff --git a/libopie2/opiecore/device/odevice_simpad.h b/libopie2/opiecore/device/odevice_simpad.h
index 3d5acb5..0f4e66f 100644
--- a/libopie2/opiecore/device/odevice_simpad.h
+++ b/libopie2/opiecore/device/odevice_simpad.h
@@ -21,49 +21,49 @@
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#ifndef ODEVICE_SIMPAD 30#ifndef ODEVICE_SIMPAD
31#define ODEVICE_SIMPAD 31#define ODEVICE_SIMPAD
32 32
33#include <opie2/odevice.h> 33#include <opie2/odevice.h>
34 34
35/* QT */ 35/* QT */
36#include <qwindowsystem_qws.h> 36#include <qwindowsystem_qws.h>
37 37
38namespace Opie { 38namespace Opie {
39namespace Core { 39namespace Core {
40namespace Internal { 40namespace Internal {
41 41
42class SIMpad : public ODevice, public QWSServer::KeyboardFilter 42class SIMpad : public ODevice, public QWSServer::KeyboardFilter
43{ 43{
44 protected: 44 protected:
45 virtual void init(); 45 virtual void init(const QString&);
46 virtual void initButtons(); 46 virtual void initButtons();
47 47
48 public: 48 public:
49 virtual bool setSoftSuspend( bool soft ); 49 virtual bool setSoftSuspend( bool soft );
50 virtual bool suspend(); 50 virtual bool suspend();
51 51
52 virtual bool setDisplayStatus( bool on ); 52 virtual bool setDisplayStatus( bool on );
53 virtual bool setDisplayBrightness( int b ); 53 virtual bool setDisplayBrightness( int b );
54 virtual int displayBrightnessResolution() const; 54 virtual int displayBrightnessResolution() const;
55 55
56 virtual void playAlarmSound(); 56 virtual void playAlarmSound();
57 57
58 virtual QValueList <OLed> ledList() const; 58 virtual QValueList <OLed> ledList() const;
59 virtual QValueList <OLedState> ledStateList( OLed led ) const; 59 virtual QValueList <OLedState> ledStateList( OLed led ) const;
60 virtual OLedState ledState( OLed led ) const; 60 virtual OLedState ledState( OLed led ) const;
61 virtual bool setLedState( OLed led, OLedState st ); 61 virtual bool setLedState( OLed led, OLedState st );
62 62
63 protected: 63 protected:
64 virtual bool filter( int unicode, int keycode, int modifiers, bool isPress, bool autoRepeat ); 64 virtual bool filter( int unicode, int keycode, int modifiers, bool isPress, bool autoRepeat );
65 virtual void timerEvent( QTimerEvent *te ); 65 virtual void timerEvent( QTimerEvent *te );
66 66
67 int m_power_timer; 67 int m_power_timer;
68 68
69 OLedState m_leds [1]; 69 OLedState m_leds [1];
diff --git a/libopie2/opiecore/device/odevice_yopy.cpp b/libopie2/opiecore/device/odevice_yopy.cpp
index 4e9f227..493ed25 100644
--- a/libopie2/opiecore/device/odevice_yopy.cpp
+++ b/libopie2/opiecore/device/odevice_yopy.cpp
@@ -50,49 +50,49 @@ _;:,     .>    :=|. This program is free software; you can
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 yopy_button yopy_buttons [] = { 59struct yopy_button yopy_buttons [] = {
60 { Qt::Key_F10, QT_TRANSLATE_NOOP( "Button", "Action Button" ), 60 { Qt::Key_F10, QT_TRANSLATE_NOOP( "Button", "Action Button" ),
61 "devicebuttons/yopy_action", 61 "devicebuttons/yopy_action",
62 "datebook", "nextView()", 62 "datebook", "nextView()",
63 "today", "raise()" }, 63 "today", "raise()" },
64 { Qt::Key_F11, QT_TRANSLATE_NOOP( "Button", "OK Button" ), 64 { Qt::Key_F11, QT_TRANSLATE_NOOP( "Button", "OK Button" ),
65 "devicebuttons/yopy_ok", 65 "devicebuttons/yopy_ok",
66 "addressbook", "raise()", 66 "addressbook", "raise()",
67 "addressbook", "beamBusinessCard()" }, 67 "addressbook", "beamBusinessCard()" },
68 { Qt::Key_F12, QT_TRANSLATE_NOOP( "Button", "End Button" ), 68 { Qt::Key_F12, QT_TRANSLATE_NOOP( "Button", "End Button" ),
69 "devicebuttons/yopy_end", 69 "devicebuttons/yopy_end",
70 "QPE/Launcher", "home()", 70 "QPE/Launcher", "home()",
71 "buttonsettings", "raise()" }, 71 "buttonsettings", "raise()" },
72}; 72};
73 73
74void Yopy::init() 74void Yopy::init(const QString&)
75{ 75{
76 d->m_vendorstr = "G.Mate"; 76 d->m_vendorstr = "G.Mate";
77 d->m_vendor = Vendor_GMate; 77 d->m_vendor = Vendor_GMate;
78 d->m_modelstr = "Yopy3700"; 78 d->m_modelstr = "Yopy3700";
79 d->m_model = Model_Yopy_3700; 79 d->m_model = Model_Yopy_3700;
80 d->m_rotation = Rot0; 80 d->m_rotation = Rot0;
81 81
82 d->m_systemstr = "Linupy"; 82 d->m_systemstr = "Linupy";
83 d->m_system = System_Linupy; 83 d->m_system = System_Linupy;
84 84
85 QFile f ( "/etc/issue" ); 85 QFile f ( "/etc/issue" );
86 if ( f. open ( IO_ReadOnly ) ) 86 if ( f. open ( IO_ReadOnly ) )
87 { 87 {
88 QTextStream ts ( &f ); 88 QTextStream ts ( &f );
89 ts.readLine(); 89 ts.readLine();
90 d->m_sysverstr = ts. readLine(); 90 d->m_sysverstr = ts. readLine();
91 f. close(); 91 f. close();
92 } 92 }
93} 93}
94 94
95 95
96void Yopy::initButtons() 96void Yopy::initButtons()
97{ 97{
98 if ( d->m_buttons ) 98 if ( d->m_buttons )
diff --git a/libopie2/opiecore/device/odevice_yopy.h b/libopie2/opiecore/device/odevice_yopy.h
index 6e1db88..f6bf061 100644
--- a/libopie2/opiecore/device/odevice_yopy.h
+++ b/libopie2/opiecore/device/odevice_yopy.h
@@ -18,49 +18,49 @@ _;:,     .>    :=|. This program is free software; you can
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#ifndef ODEVICE_YOPY 30#ifndef ODEVICE_YOPY
31#define ODEVICE_YOPY 31#define ODEVICE_YOPY
32 32
33#include <opie2/odevice.h> 33#include <opie2/odevice.h>
34 34
35namespace Opie { 35namespace Opie {
36namespace Core { 36namespace Core {
37namespace Internal { 37namespace Internal {
38class Yopy : public ODevice 38class Yopy : public ODevice
39{ 39{
40 protected: 40 protected:
41 41
42 virtual void init(); 42 virtual void init(const QString&);
43 virtual void initButtons(); 43 virtual void initButtons();
44 44
45 public: 45 public:
46 virtual bool suspend(); 46 virtual bool suspend();
47 47
48 virtual bool setDisplayBrightness ( int b ); 48 virtual bool setDisplayBrightness ( int b );
49 virtual int displayBrightnessResolution() const; 49 virtual int displayBrightnessResolution() const;
50}; 50};
51 51
52struct yopy_button 52struct yopy_button
53{ 53{
54 Qt::Key code; 54 Qt::Key code;
55 char *utext; 55 char *utext;
56 char *pix; 56 char *pix;
57 char *fpressedservice; 57 char *fpressedservice;
58 char *fpressedaction; 58 char *fpressedaction;
59 char *fheldservice; 59 char *fheldservice;
60 char *fheldaction; 60 char *fheldaction;
61}; 61};
62 62
63} 63}
64} 64}
65} 65}
66 66
diff --git a/libopie2/opiecore/device/odevice_zaurus.cpp b/libopie2/opiecore/device/odevice_zaurus.cpp
index 1434e69..e8b813e 100644
--- a/libopie2/opiecore/device/odevice_zaurus.cpp
+++ b/libopie2/opiecore/device/odevice_zaurus.cpp
@@ -94,49 +94,49 @@ struct z_button z_buttons_c700 [] = {
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(const QString&)
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
128 // detect the distribution ! 128 // detect the distribution !
129 // Otherwise it may happen that any other distribution is detected as openzaurus, just 129 // Otherwise it may happen that any other distribution is detected as openzaurus, just
130 // because it uses a jffs2 filesystem.. 130 // because it uses a jffs2 filesystem..
131 // (eilers) 131 // (eilers)
132 // if ( f. open ( IO_ReadOnly ) && ( QTextStream ( &f ). read(). find ( "\tjffs2\n" ) >= 0 )) { 132 // if ( f. open ( IO_ReadOnly ) && ( QTextStream ( &f ). read(). find ( "\tjffs2\n" ) >= 0 )) {
133 QFile f ("/etc/oz_version"); 133 QFile f ("/etc/oz_version");
134 if ( f.exists() ){ 134 if ( f.exists() ){
135 d->m_vendorstr = "OpenZaurus Team"; 135 d->m_vendorstr = "OpenZaurus Team";
136 d->m_systemstr = "OpenZaurus"; 136 d->m_systemstr = "OpenZaurus";
137 d->m_system = System_OpenZaurus; 137 d->m_system = System_OpenZaurus;
138 138
139 if ( f. open ( IO_ReadOnly )) { 139 if ( f. open ( IO_ReadOnly )) {
140 QTextStream ts ( &f ); 140 QTextStream ts ( &f );
141 d->m_sysverstr = ts. readLine();//. mid ( 10 ); 141 d->m_sysverstr = ts. readLine();//. mid ( 10 );
142 f. close(); 142 f. close();
diff --git a/libopie2/opiecore/device/odevice_zaurus.h b/libopie2/opiecore/device/odevice_zaurus.h
index a0b1787..76a40d6 100644
--- a/libopie2/opiecore/device/odevice_zaurus.h
+++ b/libopie2/opiecore/device/odevice_zaurus.h
@@ -32,49 +32,49 @@
32 32
33#include <opie2/odevice.h> 33#include <opie2/odevice.h>
34 34
35#ifndef ARRAY_SIZE 35#ifndef ARRAY_SIZE
36#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) 36#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
37#endif 37#endif
38 38
39// _IO and friends are only defined in kernel headers ... 39// _IO and friends are only defined in kernel headers ...
40 40
41#define OD_IOC(dir,type,number,size) (( dir << 30 ) | ( type << 8 ) | ( number ) | ( size << 16 )) 41#define OD_IOC(dir,type,number,size) (( dir << 30 ) | ( type << 8 ) | ( number ) | ( size << 16 ))
42 42
43#define OD_IO(type,number) OD_IOC(0,type,number,0) 43#define OD_IO(type,number) OD_IOC(0,type,number,0)
44#define OD_IOW(type,number,size) OD_IOC(1,type,number,sizeof(size)) 44#define OD_IOW(type,number,size) OD_IOC(1,type,number,sizeof(size))
45#define OD_IOR(type,number,size) OD_IOC(2,type,number,sizeof(size)) 45#define OD_IOR(type,number,size) OD_IOC(2,type,number,sizeof(size))
46#define OD_IORW(type,number,size) OD_IOC(3,type,number,sizeof(size)) 46#define OD_IORW(type,number,size) OD_IOC(3,type,number,sizeof(size))
47 47
48 48
49namespace Opie { 49namespace Opie {
50namespace Core { 50namespace Core {
51namespace Internal { 51namespace Internal {
52class Zaurus : public ODevice 52class Zaurus : public ODevice
53{ 53{
54 54
55 protected: 55 protected:
56 virtual void init(); 56 virtual void init(const QString&);
57 virtual void initButtons(); 57 virtual void initButtons();
58 58
59 public: 59 public:
60 virtual bool setSoftSuspend ( bool soft ); 60 virtual bool setSoftSuspend ( bool soft );
61 61
62 virtual bool setDisplayBrightness ( int b ); 62 virtual bool setDisplayBrightness ( int b );
63 virtual int displayBrightnessResolution() const; 63 virtual int displayBrightnessResolution() const;
64 64
65 virtual void playAlarmSound(); 65 virtual void playAlarmSound();
66 virtual void playKeySound(); 66 virtual void playKeySound();
67 virtual void playTouchSound(); 67 virtual void playTouchSound();
68 68
69 virtual QValueList <OLed> ledList() const; 69 virtual QValueList <OLed> ledList() const;
70 virtual QValueList <OLedState> ledStateList ( OLed led ) const; 70 virtual QValueList <OLedState> ledStateList ( OLed led ) const;
71 virtual OLedState ledState( OLed led ) const; 71 virtual OLedState ledState( OLed led ) const;
72 virtual bool setLedState( OLed led, OLedState st ); 72 virtual bool setLedState( OLed led, OLedState st );
73 73
74 virtual bool hasHingeSensor() const; 74 virtual bool hasHingeSensor() const;
75 virtual OHingeStatus readHingeSensor(); 75 virtual OHingeStatus readHingeSensor();
76 76
77 virtual bool suspend(); 77 virtual bool suspend();
78 virtual Transformation rotation() const; 78 virtual Transformation rotation() const;
79 virtual ODirection direction() const; 79 virtual ODirection direction() const;
80 80