summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiecore/device/odevice_zaurus.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/libopie2/opiecore/device/odevice_zaurus.cpp b/libopie2/opiecore/device/odevice_zaurus.cpp
index 28a1ccf..4963f54 100644
--- a/libopie2/opiecore/device/odevice_zaurus.cpp
+++ b/libopie2/opiecore/device/odevice_zaurus.cpp
@@ -51,385 +51,385 @@
51#include <stdlib.h> 51#include <stdlib.h>
52#include <signal.h> 52#include <signal.h>
53#include <sys/ioctl.h> 53#include <sys/ioctl.h>
54#include <sys/time.h> 54#include <sys/time.h>
55#include <unistd.h> 55#include <unistd.h>
56#ifndef QT_NO_SOUND 56#ifndef QT_NO_SOUND
57#include <linux/soundcard.h> 57#include <linux/soundcard.h>
58#endif 58#endif
59 59
60using namespace Opie::Core; 60using namespace Opie::Core;
61using namespace Opie::Core::Internal; 61using namespace Opie::Core::Internal;
62 62
63struct z_button z_buttons [] = { 63struct z_button z_buttons [] = {
64 { Qt::Key_F9, QT_TRANSLATE_NOOP("Button", "Calendar Button"), 64 { Qt::Key_F9, QT_TRANSLATE_NOOP("Button", "Calendar Button"),
65 "devicebuttons/z_calendar", 65 "devicebuttons/z_calendar",
66 "datebook", "nextView()", 66 "datebook", "nextView()",
67 "today", "raise()" }, 67 "today", "raise()" },
68 { Qt::Key_F10, QT_TRANSLATE_NOOP("Button", "Contacts Button"), 68 { Qt::Key_F10, QT_TRANSLATE_NOOP("Button", "Contacts Button"),
69 "devicebuttons/z_contact", 69 "devicebuttons/z_contact",
70 "addressbook", "raise()", 70 "addressbook", "raise()",
71 "addressbook", "beamBusinessCard()" }, 71 "addressbook", "beamBusinessCard()" },
72 { Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Home Button"), 72 { Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Home Button"),
73 "devicebuttons/z_home", 73 "devicebuttons/z_home",
74 "QPE/Launcher", "home()", 74 "QPE/Launcher", "home()",
75 "buttonsettings", "raise()" }, 75 "buttonsettings", "raise()" },
76 { Qt::Key_F11, QT_TRANSLATE_NOOP("Button", "Menu Button"), 76 { Qt::Key_F11, QT_TRANSLATE_NOOP("Button", "Menu Button"),
77 "devicebuttons/z_menu", 77 "devicebuttons/z_menu",
78 "QPE/TaskBar", "toggleMenu()", 78 "QPE/TaskBar", "toggleMenu()",
79 "QPE/TaskBar", "toggleStartMenu()" }, 79 "QPE/TaskBar", "toggleStartMenu()" },
80 { Qt::Key_F13, QT_TRANSLATE_NOOP("Button", "Mail Button"), 80 { Qt::Key_F13, QT_TRANSLATE_NOOP("Button", "Mail Button"),
81 "devicebuttons/z_mail", 81 "devicebuttons/z_mail",
82 "opiemail", "raise()", 82 "opiemail", "raise()",
83 "opiemail", "newMail()" }, 83 "opiemail", "newMail()" },
84}; 84};
85 85
86struct z_button z_buttons_c700 [] = { 86struct z_button z_buttons_c700 [] = {
87 { Qt::Key_F9, QT_TRANSLATE_NOOP("Button", "Calendar Button"), 87 { Qt::Key_F9, QT_TRANSLATE_NOOP("Button", "Calendar Button"),
88 "devicebuttons/z_calendar", 88 "devicebuttons/z_calendar",
89 "datebook", "nextView()", 89 "datebook", "nextView()",
90 "today", "raise()" }, 90 "today", "raise()" },
91 { Qt::Key_F10, QT_TRANSLATE_NOOP("Button", "Contacts Button"), 91 { Qt::Key_F10, QT_TRANSLATE_NOOP("Button", "Contacts Button"),
92 "devicebuttons/z_contact", 92 "devicebuttons/z_contact",
93 "addressbook", "raise()", 93 "addressbook", "raise()",
94 "addressbook", "beamBusinessCard()" }, 94 "addressbook", "beamBusinessCard()" },
95 { Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Home Button"), 95 { Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Home Button"),
96 "devicebuttons/z_home", 96 "devicebuttons/z_home",
97 "QPE/Launcher", "home()", 97 "QPE/Launcher", "home()",
98 "buttonsettings", "raise()" }, 98 "buttonsettings", "raise()" },
99 { Qt::Key_F11, QT_TRANSLATE_NOOP("Button", "Menu Button"), 99 { Qt::Key_F11, QT_TRANSLATE_NOOP("Button", "Menu Button"),
100 "devicebuttons/z_menu", 100 "devicebuttons/z_menu",
101 "QPE/TaskBar", "toggleMenu()", 101 "QPE/TaskBar", "toggleMenu()",
102 "QPE/TaskBar", "toggleStartMenu()" }, 102 "QPE/TaskBar", "toggleStartMenu()" },
103 { Qt::Key_F13, QT_TRANSLATE_NOOP("Button", "Mail Button"), 103 { Qt::Key_F13, QT_TRANSLATE_NOOP("Button", "Mail Button"),
104 "devicebuttons/z_mail", 104 "devicebuttons/z_mail",
105 "opiemail", "raise()", 105 "opiemail", "raise()",
106 "opiemail", "newMail()" }, 106 "opiemail", "newMail()" },
107 107
108 { Qt::Key_F15, QT_TRANSLATE_NOOP("Button", "Hinge1"), 108 { Qt::Key_F15, QT_TRANSLATE_NOOP("Button", "Hinge1"),
109 "devicebuttons/z_hinge1", 109 "devicebuttons/z_hinge1",
110 "QPE/Rotation", "rotateDefault()",0}, 110 "QPE/Rotation", "rotateDefault()",0},
111 { Qt::Key_F16, QT_TRANSLATE_NOOP("Button", "Hinge2"), 111 { Qt::Key_F16, QT_TRANSLATE_NOOP("Button", "Hinge2"),
112 "devicebuttons/z_hinge2", 112 "devicebuttons/z_hinge2",
113 "QPE/Rotation", "rotateDefault()",0}, 113 "QPE/Rotation", "rotateDefault()",0},
114 { Qt::Key_F17, QT_TRANSLATE_NOOP("Button", "Hinge3"), 114 { Qt::Key_F17, QT_TRANSLATE_NOOP("Button", "Hinge3"),
115 "devicebuttons/z_hinge3", 115 "devicebuttons/z_hinge3",
116 "QPE/Rotation", "rotateDefault()",0}, 116 "QPE/Rotation", "rotateDefault()",0},
117}; 117};
118 118
119struct z_button z_buttons_6000 [] = { 119struct z_button z_buttons_6000 [] = {
120 { Qt::Key_F9, QT_TRANSLATE_NOOP("Button", "Calendar Button"), 120 { Qt::Key_F9, QT_TRANSLATE_NOOP("Button", "Calendar Button"),
121 "devicebuttons/z_calendar", 121 "devicebuttons/z_calendar",
122 "datebook", "nextView()", 122 "datebook", "nextView()",
123 "today", "raise()" }, 123 "today", "raise()" },
124 { Qt::Key_F10, QT_TRANSLATE_NOOP("Button", "Contacts Button"), 124 { Qt::Key_F10, QT_TRANSLATE_NOOP("Button", "Contacts Button"),
125 "devicebuttons/z_contact", 125 "devicebuttons/z_contact",
126 "addressbook", "raise()", 126 "addressbook", "raise()",
127 "addressbook", "beamBusinessCard()" }, 127 "addressbook", "beamBusinessCard()" },
128 { Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Home Button"), 128 { Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Home Button"),
129 "devicebuttons/z_home", 129 "devicebuttons/z_home",
130 "QPE/Launcher", "home()", 130 "QPE/Launcher", "home()",
131 "buttonsettings", "raise()" }, 131 "buttonsettings", "raise()" },
132 { Qt::Key_F11, QT_TRANSLATE_NOOP("Button", "Menu Button"), 132 { Qt::Key_F11, QT_TRANSLATE_NOOP("Button", "Menu Button"),
133 "devicebuttons/z_menu", 133 "devicebuttons/z_menu",
134 "QPE/TaskBar", "toggleMenu()", 134 "QPE/TaskBar", "toggleMenu()",
135 "QPE/TaskBar", "toggleStartMenu()" }, 135 "QPE/TaskBar", "toggleStartMenu()" },
136 { Qt::Key_F13, QT_TRANSLATE_NOOP("Button", "Mail Button"), 136 { Qt::Key_F13, QT_TRANSLATE_NOOP("Button", "Mail Button"),
137 "devicebuttons/z_mail", 137 "devicebuttons/z_mail",
138 "opiemail", "raise()", 138 "opiemail", "raise()",
139 "opiemail", "newMail()" }, 139 "opiemail", "newMail()" },
140 { Qt::Key_F15, QT_TRANSLATE_NOOP("Button", "Rotate Button"), 140 { Qt::Key_F15, QT_TRANSLATE_NOOP("Button", "Rotate Button"),
141 "devicebuttons/z_rotate", 141 "devicebuttons/z_rotate",
142 0, 142 0,
143 "QPE/Rotation", "rotateDefault()" }, 143 "QPE/Rotation", "rotateDefault()" },
144 { Qt::Key_F24, QT_TRANSLATE_NOOP("Button", "Record Button"), 144 { Qt::Key_F24, QT_TRANSLATE_NOOP("Button", "Record Button"),
145 "devicebuttons/z_hinge3", 145 "devicebuttons/z_hinge3",
146 "QPE/VMemo", "toggleRecord()", 146 "QPE/VMemo", "toggleRecord()",
147 "sound", "raise()" }, 147 "sound", "raise()" },
148}; 148};
149 149
150// FIXME This gets unnecessary complicated. We should think about splitting the Zaurus 150// FIXME This gets unnecessary complicated. We should think about splitting the Zaurus
151// class up into individual classes. We would need three classes 151// class up into individual classes. We would need three classes
152// 152//
153// Zaurus-Collie (SA-model w/ 320x240 lcd, for SL5500 and SL5000) 153// Zaurus-Collie (SA-model w/ 320x240 lcd, for SL5500 and SL5000)
154// Zaurus-Poodle (PXA-model w/ 320x240 lcd, for SL5600) 154// Zaurus-Poodle (PXA-model w/ 320x240 lcd, for SL5600)
155// Zaurus-Corgi (PXA-model w/ 640x480 lcd, for C700, C750, C760, C860, C3000, C1000, C3100) 155// Zaurus-Corgi (PXA-model w/ 640x480 lcd, for C700, C750, C760, C860, C3000, C1000, C3100)
156// Zaurus-Tosa (PXA-model w/ 480x640 lcd, for SL6000) 156// Zaurus-Tosa (PXA-model w/ 480x640 lcd, for SL6000)
157 157
158void Zaurus::init(const QString& cpu_info) 158void Zaurus::init(const QString& cpu_info)
159{ 159{
160 qDebug( "Zaurus::init()" ); 160 qDebug( "Zaurus::init()" );
161 // Set the time to wait until the system is really suspended 161 // Set the time to wait until the system is really suspended
162 // the delta between apm --suspend and sleeping 162 // the delta between apm --suspend and sleeping
163 setAPMTimeOut( 15000 ); 163 setAPMTimeOut( 15000 );
164 164
165 // generic distribution code already scanned /etc/issue at that point - 165 // generic distribution code already scanned /etc/issue at that point -
166 // embedix releases contain "Embedix <version> | Linux for Embedded Devices" 166 // embedix releases contain "Embedix <version> | Linux for Embedded Devices"
167 if ( d->m_sysverstr.contains( "embedix", false ) ) 167 if ( d->m_sysverstr.contains( "embedix", false ) )
168 { 168 {
169 d->m_vendorstr = "Sharp"; 169 d->m_vendorstr = "Sharp";
170 d->m_vendor = Vendor_Sharp; 170 d->m_vendor = Vendor_Sharp;
171 d->m_systemstr = "Zaurus"; 171 d->m_systemstr = "Zaurus";
172 d->m_system = System_Zaurus; 172 d->m_system = System_Zaurus;
173 m_embedix = true; 173 m_embedix = true;
174 } 174 }
175 else 175 else
176 { 176 {
177 d->m_vendorstr = "OpenZaurus Team"; 177 d->m_vendorstr = "OpenZaurus Team";
178 d->m_systemstr = "OpenZaurus"; 178 d->m_systemstr = "OpenZaurus";
179 d->m_system = System_OpenZaurus; 179 d->m_system = System_OpenZaurus;
180 // sysver already gathered 180 // sysver already gathered
181 181
182 // OpenZaurus sometimes uses the 2.4 (embedix) kernel, check if this is one 182 // OpenZaurus sometimes uses the 2.4 (embedix) kernel, check if this is one
183 FILE *uname = popen("uname -r", "r"); 183 FILE *uname = popen("uname -r", "r");
184 QFile f; 184 QFile f;
185 QString line; 185 QString line;
186 if ( f.open(IO_ReadOnly, uname) ) { 186 if ( f.open(IO_ReadOnly, uname) ) {
187 QTextStream ts ( &f ); 187 QTextStream ts ( &f );
188 line = ts.readLine(); 188 line = ts.readLine();
189 m_embedix = line.startsWith( "2.4." ); 189 m_embedix = line.startsWith( "2.4." );
190 f.close(); 190 f.close();
191 } 191 }
192 pclose(uname); 192 pclose(uname);
193 } 193 }
194 194
195 // check the Zaurus model 195 // check the Zaurus model
196 QString model; 196 QString model;
197 int loc = cpu_info.find( ":" ); 197 int loc = cpu_info.find( ":" );
198 if ( loc != -1 ) 198 if ( loc != -1 )
199 model = cpu_info.mid( loc+2 ).simplifyWhiteSpace(); 199 model = cpu_info.mid( loc+2 ).simplifyWhiteSpace();
200 else 200 else
201 model = cpu_info; 201 model = cpu_info;
202 202
203 if ( model == "SHARP Corgi" ) { 203 if ( model == "SHARP Corgi" ) {
204 d->m_model = Model_Zaurus_SLC7x0; 204 d->m_model = Model_Zaurus_SLC7x0;
205 d->m_modelstr = "Zaurus SL-C700"; 205 d->m_modelstr = "Zaurus SL-C700";
206 } else if ( model == "SHARP Shepherd" ) { 206 } else if ( model == "SHARP Shepherd" ) {
207 d->m_model = Model_Zaurus_SLC7x0; 207 d->m_model = Model_Zaurus_SLC7x0;
208 d->m_modelstr = "Zaurus SL-C750"; 208 d->m_modelstr = "Zaurus SL-C750";
209 } else if ( model == "SHARP Husky" ) { 209 } else if ( model == "SHARP Husky" ) {
210 d->m_model = Model_Zaurus_SLC7x0; 210 d->m_model = Model_Zaurus_SLC7x0;
211 d->m_modelstr = "Zaurus SL-C760 or SL-C860"; 211 d->m_modelstr = "Zaurus SL-C760 or SL-C860";
212 } else if ( model == "SHARP Boxer" ) { 212 } else if ( model == "SHARP Boxer" ) {
213 d->m_model = Model_Zaurus_SLC7x0; 213 d->m_model = Model_Zaurus_SLC7x0;
214 d->m_modelstr = "Zaurus SL-C760 or SL-C860"; 214 d->m_modelstr = "Zaurus SL-C760 or SL-C860";
215 } else if ( model == "SHARP Poodle" ) { 215 } else if ( model == "SHARP Poodle" ) {
216 d->m_model = Model_Zaurus_SLB600; 216 d->m_model = Model_Zaurus_SLB600;
217 d->m_modelstr = "Zaurus SL-B500 or SL-5600"; 217 d->m_modelstr = "Zaurus SL-B500 or SL-5600";
218 } else if ( model == "Sharp-Collie" || model == "Collie" ) { 218 } else if ( model == "Sharp-Collie" || model == "Collie" ) {
219 d->m_model = Model_Zaurus_SL5500; 219 d->m_model = Model_Zaurus_SL5500;
220 d->m_modelstr = "Zaurus SL-5500 or SL-5000d"; 220 d->m_modelstr = "Zaurus SL-5500 or SL-5000d";
221 } else if ( model == "SHARP Tosa" ) { 221 } else if ( model == "SHARP Tosa" ) {
222 d->m_model = Model_Zaurus_SL6000; 222 d->m_model = Model_Zaurus_SL6000;
223 d->m_modelstr = "Zaurus SL-6000"; 223 d->m_modelstr = "Zaurus SL-6000";
224 } else if ( model == "SHARP Spitz" ) { 224 } else if ( model == "SHARP Spitz" ) {
225 d->m_model = Model_Zaurus_SLC3000; 225 d->m_model = Model_Zaurus_SLC3000;
226 d->m_modelstr = "Zaurus SL-C3000"; 226 d->m_modelstr = "Zaurus SL-C3000";
227 } else if ( model == "SHARP Akita" ) { 227 } else if ( model == "SHARP Akita" ) {
228 d->m_model = Model_Zaurus_SLC1000; 228 d->m_model = Model_Zaurus_SLC1000;
229 d->m_modelstr = "Zaurus SL-C1000"; 229 d->m_modelstr = "Zaurus SL-C1000";
230 } else if ( model == "SHARP Borzoi" ) { 230 } else if ( model == "SHARP Borzoi" ) {
231 d->m_model = Model_Zaurus_SLC3100; 231 d->m_model = Model_Zaurus_SLC3100;
232 d->m_modelstr = "Zaurus SL-C3100"; 232 d->m_modelstr = "Zaurus SL-C3100";
233 } else { 233 } else {
234 d->m_model = Model_Zaurus_SL5500; 234 d->m_model = Model_Zaurus_SL5500;
235 d->m_modelstr = "Unknown Zaurus"; 235 d->m_modelstr = "Unknown Zaurus";
236 } 236 }
237 237
238 // set path to backlight device in kernel 2.6 238 // set path to backlight device in kernel 2.6
239 switch ( d->m_model ) 239 switch ( d->m_model )
240 { 240 {
241 case Model_Zaurus_SLB600: // fallthrough 241 case Model_Zaurus_SLB600: // fallthrough
242 case Model_Zaurus_SL5500: 242 case Model_Zaurus_SL5500:
243 m_backlightdev = "/sys/class/backlight/locomo-backlight/"; 243 m_backlightdev = "/sys/class/backlight/locomo-bl/";
244 break; 244 break;
245 default: 245 default:
246 m_backlightdev = "/sys/class/backlight/corgi-bl/"; 246 m_backlightdev = "/sys/class/backlight/corgi-bl/";
247 } 247 }
248 248
249 // set initial rotation 249 // set initial rotation
250 switch( d->m_model ) 250 switch( d->m_model )
251 { 251 {
252 case Model_Zaurus_SL6000: // fallthrough 252 case Model_Zaurus_SL6000: // fallthrough
253 case Model_Zaurus_SLA300: 253 case Model_Zaurus_SLA300:
254 d->m_rotation = Rot0; 254 d->m_rotation = Rot0;
255 break; 255 break;
256 case Model_Zaurus_SLC3100: // fallthrough 256 case Model_Zaurus_SLC3100: // fallthrough
257 case Model_Zaurus_SLC3000: // fallthrough 257 case Model_Zaurus_SLC3000: // fallthrough
258 case Model_Zaurus_SLC1000: // fallthrough 258 case Model_Zaurus_SLC1000: // fallthrough
259 case Model_Zaurus_SLC7x0: 259 case Model_Zaurus_SLC7x0:
260 initHingeSensor(); 260 initHingeSensor();
261 d->m_rotation = rotation(); 261 d->m_rotation = rotation();
262 d->m_direction = direction(); 262 d->m_direction = direction();
263 break; 263 break;
264 case Model_Zaurus_SLB600: // fallthrough 264 case Model_Zaurus_SLB600: // fallthrough
265 case Model_Zaurus_SL5000: // fallthrough 265 case Model_Zaurus_SL5000: // fallthrough
266 case Model_Zaurus_SL5500: // fallthrough 266 case Model_Zaurus_SL5500: // fallthrough
267 default: 267 default:
268 d->m_rotation = Rot270; 268 d->m_rotation = Rot270;
269 } 269 }
270 270
271 // set default qte driver 271 // set default qte driver
272 switch( d->m_model ) 272 switch( d->m_model )
273 { 273 {
274 case Model_Zaurus_SLC7x0: 274 case Model_Zaurus_SLC7x0:
275 d->m_qteDriver = "W100"; 275 d->m_qteDriver = "W100";
276 break; 276 break;
277 default: 277 default:
278 d->m_qteDriver = "Transformed"; 278 d->m_qteDriver = "Transformed";
279 } 279 }
280 280
281 m_leds[0] = Led_Off; 281 m_leds[0] = Led_Off;
282 282
283 if ( m_embedix ) 283 if ( m_embedix )
284 qDebug( "Zaurus::init() - Using the 2.4 Embedix HAL on a %s", (const char*) d->m_modelstr ); 284 qDebug( "Zaurus::init() - Using the 2.4 Embedix HAL on a %s", (const char*) d->m_modelstr );
285 else 285 else
286 qDebug( "Zaurus::init() - Using the 2.6 OpenZaurus HAL on a %s", (const char*) d->m_modelstr ); 286 qDebug( "Zaurus::init() - Using the 2.6 OpenZaurus HAL on a %s", (const char*) d->m_modelstr );
287} 287}
288 288
289void Zaurus::initButtons() 289void Zaurus::initButtons()
290{ 290{
291 qDebug( "Zaurus::initButtons()" ); 291 qDebug( "Zaurus::initButtons()" );
292 if ( d->m_buttons ) 292 if ( d->m_buttons )
293 return; 293 return;
294 294
295 d->m_buttons = new QValueList <ODeviceButton>; 295 d->m_buttons = new QValueList <ODeviceButton>;
296 296
297 struct z_button * pz_buttons; 297 struct z_button * pz_buttons;
298 int buttoncount; 298 int buttoncount;
299 switch ( d->m_model ) 299 switch ( d->m_model )
300 { 300 {
301 case Model_Zaurus_SL6000: 301 case Model_Zaurus_SL6000:
302 pz_buttons = z_buttons_6000; 302 pz_buttons = z_buttons_6000;
303 buttoncount = ARRAY_SIZE(z_buttons_6000); 303 buttoncount = ARRAY_SIZE(z_buttons_6000);
304 break; 304 break;
305 case Model_Zaurus_SLC3100: // fallthrough 305 case Model_Zaurus_SLC3100: // fallthrough
306 case Model_Zaurus_SLC3000: // fallthrough 306 case Model_Zaurus_SLC3000: // fallthrough
307 case Model_Zaurus_SLC1000: // fallthrough 307 case Model_Zaurus_SLC1000: // fallthrough
308 case Model_Zaurus_SLC7x0: 308 case Model_Zaurus_SLC7x0:
309 if ( isQWS( ) ) 309 if ( isQWS( ) )
310 { 310 {
311 addPreHandler(this); 311 addPreHandler(this);
312 } 312 }
313 pz_buttons = z_buttons_c700; 313 pz_buttons = z_buttons_c700;
314 buttoncount = ARRAY_SIZE(z_buttons_c700); 314 buttoncount = ARRAY_SIZE(z_buttons_c700);
315 break; 315 break;
316 default: 316 default:
317 pz_buttons = z_buttons; 317 pz_buttons = z_buttons;
318 buttoncount = ARRAY_SIZE(z_buttons); 318 buttoncount = ARRAY_SIZE(z_buttons);
319 break; 319 break;
320 } 320 }
321 321
322 for ( int i = 0; i < buttoncount; i++ ) { 322 for ( int i = 0; i < buttoncount; i++ ) {
323 struct z_button *zb = pz_buttons + i; 323 struct z_button *zb = pz_buttons + i;
324 ODeviceButton b; 324 ODeviceButton b;
325 325
326 b.setKeycode( zb->code ); 326 b.setKeycode( zb->code );
327 b.setUserText( QObject::tr( "Button", zb->utext )); 327 b.setUserText( QObject::tr( "Button", zb->utext ));
328 b.setPixmap( OResource::loadPixmap( zb->pix )); 328 b.setPixmap( OResource::loadPixmap( zb->pix ));
329 b.setFactoryPresetPressedAction( OQCopMessage( makeChannel ( zb->fpressedservice ), zb->fpressedaction )); 329 b.setFactoryPresetPressedAction( OQCopMessage( makeChannel ( zb->fpressedservice ), zb->fpressedaction ));
330 b.setFactoryPresetHeldAction( OQCopMessage( makeChannel ( zb->fheldservice ), zb->fheldaction )); 330 b.setFactoryPresetHeldAction( OQCopMessage( makeChannel ( zb->fheldservice ), zb->fheldaction ));
331 d->m_buttons->append( b ); 331 d->m_buttons->append( b );
332 } 332 }
333 333
334 reloadButtonMapping(); 334 reloadButtonMapping();
335} 335}
336 336
337 337
338 338
339typedef struct sharp_led_status { 339typedef struct sharp_led_status {
340 int which; /* select which LED status is wanted. */ 340 int which; /* select which LED status is wanted. */
341 int status; /* set new led status if you call SHARP_LED_SETSTATUS */ 341 int status; /* set new led status if you call SHARP_LED_SETSTATUS */
342} sharp_led_status; 342} sharp_led_status;
343 343
344void Zaurus::buzzer( int sound ) 344void Zaurus::buzzer( int sound )
345{ 345{
346#ifndef QT_NO_SOUND 346#ifndef QT_NO_SOUND
347 Sound *snd = 0; 347 Sound *snd = 0;
348 348
349 // All devices except SL5500 have a DSP device 349 // All devices except SL5500 have a DSP device
350 if ( d->m_model != Model_Zaurus_SL5000 350 if ( d->m_model != Model_Zaurus_SL5000
351 && d->m_model != Model_Zaurus_SL5500 ) { 351 && d->m_model != Model_Zaurus_SL5500 ) {
352 352
353 switch ( sound ){ 353 switch ( sound ){
354 case SHARP_BUZ_TOUCHSOUND: { 354 case SHARP_BUZ_TOUCHSOUND: {
355 static Sound touch_sound("touchsound"); 355 static Sound touch_sound("touchsound");
356 snd = &touch_sound; 356 snd = &touch_sound;
357 } 357 }
358 break; 358 break;
359 case SHARP_BUZ_KEYSOUND: { 359 case SHARP_BUZ_KEYSOUND: {
360 static Sound key_sound( "keysound" ); 360 static Sound key_sound( "keysound" );
361 snd = &key_sound; 361 snd = &key_sound;
362 } 362 }
363 break; 363 break;
364 case SHARP_BUZ_SCHEDULE_ALARM: 364 case SHARP_BUZ_SCHEDULE_ALARM:
365 default: { 365 default: {
366 static Sound alarm_sound("alarm"); 366 static Sound alarm_sound("alarm");
367 snd = &alarm_sound; 367 snd = &alarm_sound;
368 } 368 }
369 break; 369 break;
370 } 370 }
371 } 371 }
372 372
373 // If a soundname is defined, we expect that this device has 373 // If a soundname is defined, we expect that this device has
374 // sound capabilities.. Otherwise we expect to have the buzzer 374 // sound capabilities.. Otherwise we expect to have the buzzer
375 // device.. 375 // device..
376 if ( snd && snd->isFinished() ){ 376 if ( snd && snd->isFinished() ){
377 changeMixerForAlarm( 0, "/dev/sound/mixer", snd ); 377 changeMixerForAlarm( 0, "/dev/sound/mixer", snd );
378 snd->play(); 378 snd->play();
379 } else if( !snd ) { 379 } else if( !snd ) {
380 int fd = ::open ( "/dev/sharp_buz", O_WRONLY|O_NONBLOCK ); 380 int fd = ::open ( "/dev/sharp_buz", O_WRONLY|O_NONBLOCK );
381 381
382 if ( fd >= 0 ) { 382 if ( fd >= 0 ) {
383 ::ioctl ( fd, SHARP_BUZZER_MAKESOUND, sound ); 383 ::ioctl ( fd, SHARP_BUZZER_MAKESOUND, sound );
384 ::close ( fd ); 384 ::close ( fd );
385 } 385 }
386 386
387 } 387 }
388#endif 388#endif
389} 389}
390 390
391 391
392void Zaurus::playAlarmSound() 392void Zaurus::playAlarmSound()
393{ 393{
394 buzzer( SHARP_BUZ_SCHEDULE_ALARM ); 394 buzzer( SHARP_BUZ_SCHEDULE_ALARM );
395} 395}
396 396
397void Zaurus::playTouchSound() 397void Zaurus::playTouchSound()
398{ 398{
399 buzzer( SHARP_BUZ_TOUCHSOUND ); 399 buzzer( SHARP_BUZ_TOUCHSOUND );
400} 400}
401 401
402void Zaurus::playKeySound() 402void Zaurus::playKeySound()
403{ 403{
404 buzzer( SHARP_BUZ_KEYSOUND ); 404 buzzer( SHARP_BUZ_KEYSOUND );
405} 405}
406 406
407 407
408QValueList <OLed> Zaurus::ledList() const 408QValueList <OLed> Zaurus::ledList() const
409{ 409{
410 QValueList <OLed> vl; 410 QValueList <OLed> vl;
411 vl << Led_Mail; 411 vl << Led_Mail;
412 return vl; 412 return vl;
413} 413}
414 414
415QValueList <OLedState> Zaurus::ledStateList( OLed l ) const 415QValueList <OLedState> Zaurus::ledStateList( OLed l ) const
416{ 416{
417 QValueList <OLedState> vl; 417 QValueList <OLedState> vl;
418 418
419 if ( l == Led_Mail ) 419 if ( l == Led_Mail )
420 vl << Led_Off << Led_On << Led_BlinkSlow; 420 vl << Led_Off << Led_On << Led_BlinkSlow;
421 return vl; 421 return vl;
422} 422}
423 423
424OLedState Zaurus::ledState( OLed which ) const 424OLedState Zaurus::ledState( OLed which ) const
425{ 425{
426 if ( which == Led_Mail ) 426 if ( which == Led_Mail )
427 return m_leds [0]; 427 return m_leds [0];
428 else 428 else
429 return Led_Off; 429 return Led_Off;
430} 430}
431 431
432bool Zaurus::setLedState( OLed which, OLedState st ) 432bool Zaurus::setLedState( OLed which, OLedState st )
433{ 433{
434 // Currently not supported on non_embedix kernels 434 // Currently not supported on non_embedix kernels
435 if (!m_embedix) 435 if (!m_embedix)