-rw-r--r-- | libopie/odevice.cpp | 124 |
1 files changed, 107 insertions, 17 deletions
diff --git a/libopie/odevice.cpp b/libopie/odevice.cpp index 9373ef9..5038cc9 100644 --- a/libopie/odevice.cpp +++ b/libopie/odevice.cpp | |||
@@ -16,408 +16,413 @@ | |||
16 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 16 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
17 | Boston, MA 02111-1307, USA. | 17 | Boston, MA 02111-1307, USA. |
18 | */ | 18 | */ |
19 | 19 | ||
20 | #include <stdlib.h> | 20 | #include <stdlib.h> |
21 | #include <unistd.h> | 21 | #include <unistd.h> |
22 | #include <fcntl.h> | 22 | #include <fcntl.h> |
23 | #include <sys/ioctl.h> | 23 | #include <sys/ioctl.h> |
24 | #include <signal.h> | 24 | #include <signal.h> |
25 | #include <sys/time.h> | 25 | #include <sys/time.h> |
26 | #ifndef QT_NO_SOUND | 26 | #ifndef QT_NO_SOUND |
27 | #include <linux/soundcard.h> | 27 | #include <linux/soundcard.h> |
28 | #endif | 28 | #endif |
29 | #include <math.h> | 29 | #include <math.h> |
30 | 30 | ||
31 | #include <qapplication.h> | 31 | #include <qapplication.h> |
32 | 32 | ||
33 | #include <qfile.h> | 33 | #include <qfile.h> |
34 | #include <qtextstream.h> | 34 | #include <qtextstream.h> |
35 | #include <qpe/sound.h> | 35 | #include <qpe/sound.h> |
36 | #include <qpe/resource.h> | 36 | #include <qpe/resource.h> |
37 | #include <qpe/config.h> | 37 | #include <qpe/config.h> |
38 | #include <qpe/qcopenvelope_qws.h> | 38 | #include <qpe/qcopenvelope_qws.h> |
39 | 39 | ||
40 | #include "odevice.h" | 40 | #include "odevice.h" |
41 | 41 | ||
42 | #include <qwindowsystem_qws.h> | 42 | #include <qwindowsystem_qws.h> |
43 | 43 | ||
44 | #ifndef ARRAY_SIZE | 44 | #ifndef ARRAY_SIZE |
45 | #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) | 45 | #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) |
46 | #endif | 46 | #endif |
47 | 47 | ||
48 | // _IO and friends are only defined in kernel headers ... | 48 | // _IO and friends are only defined in kernel headers ... |
49 | 49 | ||
50 | #define OD_IOC(dir,type,number,size) (( dir << 30 ) | ( type << 8 ) | ( number ) | ( size << 16 )) | 50 | #define OD_IOC(dir,type,number,size) (( dir << 30 ) | ( type << 8 ) | ( number ) | ( size << 16 )) |
51 | 51 | ||
52 | #define OD_IO(type,number) OD_IOC(0,type,number,0) | 52 | #define OD_IO(type,number) OD_IOC(0,type,number,0) |
53 | #define OD_IOW(type,number,size) OD_IOC(1,type,number,sizeof(size)) | 53 | #define OD_IOW(type,number,size) OD_IOC(1,type,number,sizeof(size)) |
54 | #define OD_IOR(type,number,size) OD_IOC(2,type,number,sizeof(size)) | 54 | #define OD_IOR(type,number,size) OD_IOC(2,type,number,sizeof(size)) |
55 | #define OD_IORW(type,number,size) OD_IOC(3,type,number,sizeof(size)) | 55 | #define OD_IORW(type,number,size) OD_IOC(3,type,number,sizeof(size)) |
56 | 56 | ||
57 | using namespace Opie; | 57 | using namespace Opie; |
58 | 58 | ||
59 | class ODeviceData { | 59 | class ODeviceData { |
60 | public: | 60 | public: |
61 | QString m_vendorstr; | 61 | QString m_vendorstr; |
62 | OVendor m_vendor; | 62 | OVendor m_vendor; |
63 | 63 | ||
64 | QString m_modelstr; | 64 | QString m_modelstr; |
65 | OModel m_model; | 65 | OModel m_model; |
66 | 66 | ||
67 | QString m_systemstr; | 67 | QString m_systemstr; |
68 | OSystem m_system; | 68 | OSystem m_system; |
69 | 69 | ||
70 | QString m_sysverstr; | 70 | QString m_sysverstr; |
71 | 71 | ||
72 | Transformation m_rotation; | 72 | Transformation m_rotation; |
73 | ODirection m_direction; | 73 | ODirection m_direction; |
74 | 74 | ||
75 | QValueList <ODeviceButton> *m_buttons; | 75 | QValueList <ODeviceButton> *m_buttons; |
76 | uint m_holdtime; | 76 | uint m_holdtime; |
77 | QStrList *m_cpu_frequencies; | 77 | QStrList *m_cpu_frequencies; |
78 | }; | 78 | }; |
79 | 79 | ||
80 | class iPAQ : public ODevice, public QWSServer::KeyboardFilter { | 80 | class iPAQ : public ODevice, public QWSServer::KeyboardFilter { |
81 | protected: | 81 | protected: |
82 | virtual void init ( ); | 82 | virtual void init ( ); |
83 | virtual void initButtons ( ); | 83 | virtual void initButtons ( ); |
84 | 84 | ||
85 | public: | 85 | public: |
86 | virtual bool setSoftSuspend ( bool soft ); | 86 | virtual bool setSoftSuspend ( bool soft ); |
87 | 87 | ||
88 | virtual bool setDisplayBrightness ( int b ); | 88 | virtual bool setDisplayBrightness ( int b ); |
89 | virtual int displayBrightnessResolution ( ) const; | 89 | virtual int displayBrightnessResolution ( ) const; |
90 | 90 | ||
91 | virtual void alarmSound ( ); | 91 | virtual void alarmSound ( ); |
92 | 92 | ||
93 | virtual QValueList <OLed> ledList ( ) const; | 93 | virtual QValueList <OLed> ledList ( ) const; |
94 | virtual QValueList <OLedState> ledStateList ( OLed led ) const; | 94 | virtual QValueList <OLedState> ledStateList ( OLed led ) const; |
95 | virtual OLedState ledState ( OLed led ) const; | 95 | virtual OLedState ledState ( OLed led ) const; |
96 | virtual bool setLedState ( OLed led, OLedState st ); | 96 | virtual bool setLedState ( OLed led, OLedState st ); |
97 | 97 | ||
98 | virtual bool hasLightSensor ( ) const; | 98 | virtual bool hasLightSensor ( ) const; |
99 | virtual int readLightSensor ( ); | 99 | virtual int readLightSensor ( ); |
100 | virtual int lightSensorResolution ( ) const; | 100 | virtual int lightSensorResolution ( ) const; |
101 | 101 | ||
102 | protected: | 102 | protected: |
103 | virtual bool filter ( int unicode, int keycode, int modifiers, bool isPress, bool autoRepeat ); | 103 | virtual bool filter ( int unicode, int keycode, int modifiers, bool isPress, bool autoRepeat ); |
104 | virtual void timerEvent ( QTimerEvent *te ); | 104 | virtual void timerEvent ( QTimerEvent *te ); |
105 | 105 | ||
106 | int m_power_timer; | 106 | int m_power_timer; |
107 | 107 | ||
108 | OLedState m_leds [2]; | 108 | OLedState m_leds [2]; |
109 | }; | 109 | }; |
110 | 110 | ||
111 | class Jornada : public ODevice { | 111 | class Jornada : public ODevice { |
112 | protected: | 112 | protected: |
113 | virtual void init ( ); | 113 | virtual void init ( ); |
114 | //virtual void initButtons ( ); | 114 | //virtual void initButtons ( ); |
115 | public: | 115 | public: |
116 | virtual bool setSoftSuspend ( bool soft ); | 116 | virtual bool setSoftSuspend ( bool soft ); |
117 | virtual bool setDisplayBrightness ( int b ); | 117 | virtual bool setDisplayBrightness ( int b ); |
118 | virtual int displayBrightnessResolution ( ) const; | 118 | virtual int displayBrightnessResolution ( ) const; |
119 | static bool isJornada(); | 119 | static bool isJornada(); |
120 | 120 | ||
121 | }; | 121 | }; |
122 | 122 | ||
123 | class Zaurus : public ODevice { | 123 | class Zaurus : public ODevice { |
124 | protected: | 124 | protected: |
125 | virtual void init ( ); | 125 | virtual void init ( ); |
126 | virtual void initButtons ( ); | 126 | virtual void initButtons ( ); |
127 | 127 | ||
128 | public: | 128 | public: |
129 | virtual bool setSoftSuspend ( bool soft ); | 129 | virtual bool setSoftSuspend ( bool soft ); |
130 | 130 | ||
131 | virtual bool setDisplayBrightness ( int b ); | 131 | virtual bool setDisplayBrightness ( int b ); |
132 | virtual int displayBrightnessResolution ( ) const; | 132 | virtual int displayBrightnessResolution ( ) const; |
133 | 133 | ||
134 | virtual void alarmSound ( ); | 134 | virtual void alarmSound ( ); |
135 | virtual void keySound ( ); | 135 | virtual void keySound ( ); |
136 | virtual void touchSound ( ); | 136 | virtual void touchSound ( ); |
137 | 137 | ||
138 | virtual QValueList <OLed> ledList ( ) const; | 138 | virtual QValueList <OLed> ledList ( ) const; |
139 | virtual QValueList <OLedState> ledStateList ( OLed led ) const; | 139 | virtual QValueList <OLedState> ledStateList ( OLed led ) const; |
140 | virtual OLedState ledState ( OLed led ) const; | 140 | virtual OLedState ledState ( OLed led ) const; |
141 | virtual bool setLedState ( OLed led, OLedState st ); | 141 | virtual bool setLedState ( OLed led, OLedState st ); |
142 | 142 | ||
143 | static bool isZaurus(); | 143 | static bool isZaurus(); |
144 | |||
145 | // Does this break BC? | ||
146 | virtual bool suspend ( ); | ||
147 | virtual Transformation rotation ( ) const; | ||
148 | virtual ODirection direction ( ) const; | ||
144 | 149 | ||
145 | protected: | 150 | protected: |
146 | virtual void buzzer ( int snd ); | 151 | virtual void buzzer ( int snd ); |
147 | 152 | ||
148 | OLedState m_leds [1]; | 153 | OLedState m_leds [1]; |
149 | bool m_embedix; | 154 | bool m_embedix; |
150 | }; | 155 | }; |
151 | 156 | ||
152 | class SIMpad : public ODevice, public QWSServer::KeyboardFilter { | 157 | class SIMpad : public ODevice, public QWSServer::KeyboardFilter { |
153 | protected: | 158 | protected: |
154 | virtual void init ( ); | 159 | virtual void init ( ); |
155 | virtual void initButtons ( ); | 160 | virtual void initButtons ( ); |
156 | 161 | ||
157 | public: | 162 | public: |
158 | virtual bool setSoftSuspend ( bool soft ); | 163 | virtual bool setSoftSuspend ( bool soft ); |
159 | virtual bool suspend(); | 164 | virtual bool suspend(); |
160 | 165 | ||
161 | virtual bool setDisplayStatus( bool on ); | 166 | virtual bool setDisplayStatus( bool on ); |
162 | virtual bool setDisplayBrightness ( int b ); | 167 | virtual bool setDisplayBrightness ( int b ); |
163 | virtual int displayBrightnessResolution ( ) const; | 168 | virtual int displayBrightnessResolution ( ) const; |
164 | 169 | ||
165 | virtual void alarmSound ( ); | 170 | virtual void alarmSound ( ); |
166 | 171 | ||
167 | virtual QValueList <OLed> ledList ( ) const; | 172 | virtual QValueList <OLed> ledList ( ) const; |
168 | virtual QValueList <OLedState> ledStateList ( OLed led ) const; | 173 | virtual QValueList <OLedState> ledStateList ( OLed led ) const; |
169 | virtual OLedState ledState ( OLed led ) const; | 174 | virtual OLedState ledState ( OLed led ) const; |
170 | virtual bool setLedState ( OLed led, OLedState st ); | 175 | virtual bool setLedState ( OLed led, OLedState st ); |
171 | 176 | ||
172 | protected: | 177 | protected: |
173 | virtual bool filter ( int unicode, int keycode, int modifiers, bool isPress, bool autoRepeat ); | 178 | virtual bool filter ( int unicode, int keycode, int modifiers, bool isPress, bool autoRepeat ); |
174 | virtual void timerEvent ( QTimerEvent *te ); | 179 | virtual void timerEvent ( QTimerEvent *te ); |
175 | 180 | ||
176 | int m_power_timer; | 181 | int m_power_timer; |
177 | 182 | ||
178 | OLedState m_leds [1]; //FIXME check if really only one | 183 | OLedState m_leds [1]; //FIXME check if really only one |
179 | }; | 184 | }; |
180 | 185 | ||
181 | class Ramses : public ODevice, public QWSServer::KeyboardFilter { | 186 | class Ramses : public ODevice, public QWSServer::KeyboardFilter { |
182 | protected: | 187 | protected: |
183 | virtual void init ( ); | 188 | virtual void init ( ); |
184 | 189 | ||
185 | public: | 190 | public: |
186 | virtual bool setSoftSuspend ( bool soft ); | 191 | virtual bool setSoftSuspend ( bool soft ); |
187 | virtual bool suspend ( ); | 192 | virtual bool suspend ( ); |
188 | 193 | ||
189 | virtual bool setDisplayStatus( bool on ); | 194 | virtual bool setDisplayStatus( bool on ); |
190 | virtual bool setDisplayBrightness ( int b ); | 195 | virtual bool setDisplayBrightness ( int b ); |
191 | virtual int displayBrightnessResolution ( ) const; | 196 | virtual int displayBrightnessResolution ( ) const; |
192 | virtual bool setDisplayContrast ( int b ); | 197 | virtual bool setDisplayContrast ( int b ); |
193 | virtual int displayContrastResolution ( ) const; | 198 | virtual int displayContrastResolution ( ) const; |
194 | 199 | ||
195 | protected: | 200 | protected: |
196 | virtual bool filter ( int unicode, int keycode, int modifiers, bool isPress, bool autoRepeat ); | 201 | virtual bool filter ( int unicode, int keycode, int modifiers, bool isPress, bool autoRepeat ); |
197 | virtual void timerEvent ( QTimerEvent *te ); | 202 | virtual void timerEvent ( QTimerEvent *te ); |
198 | 203 | ||
199 | int m_power_timer; | 204 | int m_power_timer; |
200 | }; | 205 | }; |
201 | 206 | ||
202 | struct i_button { | 207 | struct i_button { |
203 | uint model; | 208 | uint model; |
204 | Qt::Key code; | 209 | Qt::Key code; |
205 | char *utext; | 210 | char *utext; |
206 | char *pix; | 211 | char *pix; |
207 | char *fpressedservice; | 212 | char *fpressedservice; |
208 | char *fpressedaction; | 213 | char *fpressedaction; |
209 | char *fheldservice; | 214 | char *fheldservice; |
210 | char *fheldaction; | 215 | char *fheldaction; |
211 | } ipaq_buttons [] = { | 216 | } ipaq_buttons [] = { |
212 | { Model_iPAQ_H31xx | Model_iPAQ_H36xx | Model_iPAQ_H37xx | Model_iPAQ_H38xx | Model_iPAQ_H39xx | Model_iPAQ_H5xxx, | 217 | { Model_iPAQ_H31xx | Model_iPAQ_H36xx | Model_iPAQ_H37xx | Model_iPAQ_H38xx | Model_iPAQ_H39xx | Model_iPAQ_H5xxx, |
213 | Qt::Key_F9, QT_TRANSLATE_NOOP("Button", "Calendar Button"), | 218 | Qt::Key_F9, QT_TRANSLATE_NOOP("Button", "Calendar Button"), |
214 | "devicebuttons/ipaq_calendar", | 219 | "devicebuttons/ipaq_calendar", |
215 | "datebook", "nextView()", | 220 | "datebook", "nextView()", |
216 | "today", "raise()" }, | 221 | "today", "raise()" }, |
217 | { Model_iPAQ_H31xx | Model_iPAQ_H36xx | Model_iPAQ_H37xx | Model_iPAQ_H38xx | Model_iPAQ_H39xx | Model_iPAQ_H5xxx, | 222 | { Model_iPAQ_H31xx | Model_iPAQ_H36xx | Model_iPAQ_H37xx | Model_iPAQ_H38xx | Model_iPAQ_H39xx | Model_iPAQ_H5xxx, |
218 | Qt::Key_F10, QT_TRANSLATE_NOOP("Button", "Contacts Button"), | 223 | Qt::Key_F10, QT_TRANSLATE_NOOP("Button", "Contacts Button"), |
219 | "devicebuttons/ipaq_contact", | 224 | "devicebuttons/ipaq_contact", |
220 | "addressbook", "raise()", | 225 | "addressbook", "raise()", |
221 | "addressbook", "beamBusinessCard()" }, | 226 | "addressbook", "beamBusinessCard()" }, |
222 | { Model_iPAQ_H31xx | Model_iPAQ_H36xx | Model_iPAQ_H37xx, | 227 | { Model_iPAQ_H31xx | Model_iPAQ_H36xx | Model_iPAQ_H37xx, |
223 | Qt::Key_F11, QT_TRANSLATE_NOOP("Button", "Menu Button"), | 228 | Qt::Key_F11, QT_TRANSLATE_NOOP("Button", "Menu Button"), |
224 | "devicebuttons/ipaq_menu", | 229 | "devicebuttons/ipaq_menu", |
225 | "QPE/TaskBar", "toggleMenu()", | 230 | "QPE/TaskBar", "toggleMenu()", |
226 | "QPE/TaskBar", "toggleStartMenu()" }, | 231 | "QPE/TaskBar", "toggleStartMenu()" }, |
227 | { Model_iPAQ_H38xx | Model_iPAQ_H39xx | Model_iPAQ_H5xxx, | 232 | { Model_iPAQ_H38xx | Model_iPAQ_H39xx | Model_iPAQ_H5xxx, |
228 | Qt::Key_F13, QT_TRANSLATE_NOOP("Button", "Mail Button"), | 233 | Qt::Key_F13, QT_TRANSLATE_NOOP("Button", "Mail Button"), |
229 | "devicebuttons/ipaq_mail", | 234 | "devicebuttons/ipaq_mail", |
230 | "mail", "raise()", | 235 | "mail", "raise()", |
231 | "mail", "newMail()" }, | 236 | "mail", "newMail()" }, |
232 | { Model_iPAQ_H31xx | Model_iPAQ_H36xx | Model_iPAQ_H37xx | Model_iPAQ_H38xx | Model_iPAQ_H39xx | Model_iPAQ_H5xxx, | 237 | { Model_iPAQ_H31xx | Model_iPAQ_H36xx | Model_iPAQ_H37xx | Model_iPAQ_H38xx | Model_iPAQ_H39xx | Model_iPAQ_H5xxx, |
233 | Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Home Button"), | 238 | Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Home Button"), |
234 | "devicebuttons/ipaq_home", | 239 | "devicebuttons/ipaq_home", |
235 | "QPE/Launcher", "home()", | 240 | "QPE/Launcher", "home()", |
236 | "buttonsettings", "raise()" }, | 241 | "buttonsettings", "raise()" }, |
237 | { Model_iPAQ_H31xx | Model_iPAQ_H36xx | Model_iPAQ_H37xx | Model_iPAQ_H38xx | Model_iPAQ_H39xx | Model_iPAQ_H5xxx, | 242 | { Model_iPAQ_H31xx | Model_iPAQ_H36xx | Model_iPAQ_H37xx | Model_iPAQ_H38xx | Model_iPAQ_H39xx | Model_iPAQ_H5xxx, |
238 | Qt::Key_F24, QT_TRANSLATE_NOOP("Button", "Record Button"), | 243 | Qt::Key_F24, QT_TRANSLATE_NOOP("Button", "Record Button"), |
239 | "devicebuttons/ipaq_record", | 244 | "devicebuttons/ipaq_record", |
240 | "QPE/VMemo", "toggleRecord()", | 245 | "QPE/VMemo", "toggleRecord()", |
241 | "sound", "raise()" }, | 246 | "sound", "raise()" }, |
242 | }; | 247 | }; |
243 | 248 | ||
244 | struct z_button { | 249 | struct z_button { |
245 | Qt::Key code; | 250 | Qt::Key code; |
246 | char *utext; | 251 | char *utext; |
247 | char *pix; | 252 | char *pix; |
248 | char *fpressedservice; | 253 | char *fpressedservice; |
249 | char *fpressedaction; | 254 | char *fpressedaction; |
250 | char *fheldservice; | 255 | char *fheldservice; |
251 | char *fheldaction; | 256 | char *fheldaction; |
252 | } z_buttons [] = { | 257 | } z_buttons [] = { |
253 | { Qt::Key_F9, QT_TRANSLATE_NOOP("Button", "Calendar Button"), | 258 | { Qt::Key_F9, QT_TRANSLATE_NOOP("Button", "Calendar Button"), |
254 | "devicebuttons/z_calendar", | 259 | "devicebuttons/z_calendar", |
255 | "datebook", "nextView()", | 260 | "datebook", "nextView()", |
256 | "today", "raise()" }, | 261 | "today", "raise()" }, |
257 | { Qt::Key_F10, QT_TRANSLATE_NOOP("Button", "Contacts Button"), | 262 | { Qt::Key_F10, QT_TRANSLATE_NOOP("Button", "Contacts Button"), |
258 | "devicebuttons/z_contact", | 263 | "devicebuttons/z_contact", |
259 | "addressbook", "raise()", | 264 | "addressbook", "raise()", |
260 | "addressbook", "beamBusinessCard()" }, | 265 | "addressbook", "beamBusinessCard()" }, |
261 | { Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Home Button"), | 266 | { Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Home Button"), |
262 | "devicebuttons/z_home", | 267 | "devicebuttons/z_home", |
263 | "QPE/Launcher", "home()", | 268 | "QPE/Launcher", "home()", |
264 | "buttonsettings", "raise()" }, | 269 | "buttonsettings", "raise()" }, |
265 | { Qt::Key_F11, QT_TRANSLATE_NOOP("Button", "Menu Button"), | 270 | { Qt::Key_F11, QT_TRANSLATE_NOOP("Button", "Menu Button"), |
266 | "devicebuttons/z_menu", | 271 | "devicebuttons/z_menu", |
267 | "QPE/TaskBar", "toggleMenu()", | 272 | "QPE/TaskBar", "toggleMenu()", |
268 | "QPE/TaskBar", "toggleStartMenu()" }, | 273 | "QPE/TaskBar", "toggleStartMenu()" }, |
269 | { Qt::Key_F13, QT_TRANSLATE_NOOP("Button", "Mail Button"), | 274 | { Qt::Key_F13, QT_TRANSLATE_NOOP("Button", "Mail Button"), |
270 | "devicebuttons/z_mail", | 275 | "devicebuttons/z_mail", |
271 | "mail", "raise()", | 276 | "mail", "raise()", |
272 | "mail", "newMail()" }, | 277 | "mail", "newMail()" }, |
273 | }; | 278 | }; |
274 | 279 | ||
275 | struct z_button z_buttons_c700 [] = { | 280 | struct z_button z_buttons_c700 [] = { |
276 | { Qt::Key_F9, QT_TRANSLATE_NOOP("Button", "Calendar Button"), | 281 | { Qt::Key_F9, QT_TRANSLATE_NOOP("Button", "Calendar Button"), |
277 | "devicebuttons/z_calendar", | 282 | "devicebuttons/z_calendar", |
278 | "datebook", "nextView()", | 283 | "datebook", "nextView()", |
279 | "today", "raise()" }, | 284 | "today", "raise()" }, |
280 | { Qt::Key_F10, QT_TRANSLATE_NOOP("Button", "Contacts Button"), | 285 | { Qt::Key_F10, QT_TRANSLATE_NOOP("Button", "Contacts Button"), |
281 | "devicebuttons/z_contact", | 286 | "devicebuttons/z_contact", |
282 | "addressbook", "raise()", | 287 | "addressbook", "raise()", |
283 | "addressbook", "beamBusinessCard()" }, | 288 | "addressbook", "beamBusinessCard()" }, |
284 | { Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Home Button"), | 289 | { Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Home Button"), |
285 | "devicebuttons/z_home", | 290 | "devicebuttons/z_home", |
286 | "QPE/Launcher", "home()", | 291 | "QPE/Launcher", "home()", |
287 | "buttonsettings", "raise()" }, | 292 | "buttonsettings", "raise()" }, |
288 | { Qt::Key_F11, QT_TRANSLATE_NOOP("Button", "Menu Button"), | 293 | { Qt::Key_F11, QT_TRANSLATE_NOOP("Button", "Menu Button"), |
289 | "devicebuttons/z_menu", | 294 | "devicebuttons/z_menu", |
290 | "QPE/TaskBar", "toggleMenu()", | 295 | "QPE/TaskBar", "toggleMenu()", |
291 | "QPE/TaskBar", "toggleStartMenu()" }, | 296 | "QPE/TaskBar", "toggleStartMenu()" }, |
292 | { Qt::Key_F13, QT_TRANSLATE_NOOP("Button", "Display Rotate"), | 297 | { Qt::Key_F14, QT_TRANSLATE_NOOP("Button", "Display Rotate"), |
293 | "", | 298 | "", |
294 | "QPE/Rotation", "flip()", | 299 | "QPE/Rotation", "rotateDefault()", |
295 | "QPE/Rotation", "flip()" }, | 300 | "QPE/Rotation", "rotateDefault()" }, |
296 | }; | 301 | }; |
297 | 302 | ||
298 | struct s_button { | 303 | struct s_button { |
299 | uint model; | 304 | uint model; |
300 | Qt::Key code; | 305 | Qt::Key code; |
301 | char *utext; | 306 | char *utext; |
302 | char *pix; | 307 | char *pix; |
303 | char *fpressedservice; | 308 | char *fpressedservice; |
304 | char *fpressedaction; | 309 | char *fpressedaction; |
305 | char *fheldservice; | 310 | char *fheldservice; |
306 | char *fheldaction; | 311 | char *fheldaction; |
307 | } simpad_buttons [] = { | 312 | } simpad_buttons [] = { |
308 | { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, | 313 | { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, |
309 | Qt::Key_F9, QT_TRANSLATE_NOOP("Button", "Lower+Up"), | 314 | Qt::Key_F9, QT_TRANSLATE_NOOP("Button", "Lower+Up"), |
310 | "devicebuttons/simpad_lower_up", | 315 | "devicebuttons/simpad_lower_up", |
311 | "datebook", "nextView()", | 316 | "datebook", "nextView()", |
312 | "today", "raise()" }, | 317 | "today", "raise()" }, |
313 | { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, | 318 | { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, |
314 | Qt::Key_F10, QT_TRANSLATE_NOOP("Button", "Lower+Down"), | 319 | Qt::Key_F10, QT_TRANSLATE_NOOP("Button", "Lower+Down"), |
315 | "devicebuttons/simpad_lower_down", | 320 | "devicebuttons/simpad_lower_down", |
316 | "addressbook", "raise()", | 321 | "addressbook", "raise()", |
317 | "addressbook", "beamBusinessCard()" }, | 322 | "addressbook", "beamBusinessCard()" }, |
318 | { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, | 323 | { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, |
319 | Qt::Key_F11, QT_TRANSLATE_NOOP("Button", "Lower+Right"), | 324 | Qt::Key_F11, QT_TRANSLATE_NOOP("Button", "Lower+Right"), |
320 | "devicebuttons/simpad_lower_right", | 325 | "devicebuttons/simpad_lower_right", |
321 | "QPE/TaskBar", "toggleMenu()", | 326 | "QPE/TaskBar", "toggleMenu()", |
322 | "QPE/TaskBar", "toggleStartMenu()" }, | 327 | "QPE/TaskBar", "toggleStartMenu()" }, |
323 | { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, | 328 | { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, |
324 | Qt::Key_F13, QT_TRANSLATE_NOOP("Button", "Lower+Left"), | 329 | Qt::Key_F13, QT_TRANSLATE_NOOP("Button", "Lower+Left"), |
325 | "devicebuttons/simpad_lower_left", | 330 | "devicebuttons/simpad_lower_left", |
326 | "mail", "raise()", | 331 | "mail", "raise()", |
327 | "mail", "newMail()" }, | 332 | "mail", "newMail()" }, |
328 | 333 | ||
329 | { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, | 334 | { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, |
330 | Qt::Key_F5, QT_TRANSLATE_NOOP("Button", "Upper+Up"), | 335 | Qt::Key_F5, QT_TRANSLATE_NOOP("Button", "Upper+Up"), |
331 | "devicebuttons/simpad_upper_up", | 336 | "devicebuttons/simpad_upper_up", |
332 | "QPE/Launcher", "home()", | 337 | "QPE/Launcher", "home()", |
333 | "buttonsettings", "raise()" }, | 338 | "buttonsettings", "raise()" }, |
334 | { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, | 339 | { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, |
335 | Qt::Key_F6, QT_TRANSLATE_NOOP("Button", "Upper+Down"), | 340 | Qt::Key_F6, QT_TRANSLATE_NOOP("Button", "Upper+Down"), |
336 | "devicebuttons/simpad_upper_down", | 341 | "devicebuttons/simpad_upper_down", |
337 | "addressbook", "raise()", | 342 | "addressbook", "raise()", |
338 | "addressbook", "beamBusinessCard()" }, | 343 | "addressbook", "beamBusinessCard()" }, |
339 | { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, | 344 | { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, |
340 | Qt::Key_F7, QT_TRANSLATE_NOOP("Button", "Upper+Right"), | 345 | Qt::Key_F7, QT_TRANSLATE_NOOP("Button", "Upper+Right"), |
341 | "devicebuttons/simpad_upper_right", | 346 | "devicebuttons/simpad_upper_right", |
342 | "QPE/TaskBar", "toggleMenu()", | 347 | "QPE/TaskBar", "toggleMenu()", |
343 | "QPE/TaskBar", "toggleStartMenu()" }, | 348 | "QPE/TaskBar", "toggleStartMenu()" }, |
344 | { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, | 349 | { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, |
345 | Qt::Key_F13, QT_TRANSLATE_NOOP("Button", "Upper+Left"), | 350 | Qt::Key_F13, QT_TRANSLATE_NOOP("Button", "Upper+Left"), |
346 | "devicebuttons/simpad_upper_left", | 351 | "devicebuttons/simpad_upper_left", |
347 | "QPE/Rotation", "flip()", | 352 | "QPE/Rotation", "flip()", |
348 | "QPE/Rotation", "flip()" }, | 353 | "QPE/Rotation", "flip()" }, |
349 | /* | 354 | /* |
350 | { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, | 355 | { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, |
351 | Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Lower+Upper"), | 356 | Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Lower+Upper"), |
352 | "devicebuttons/simpad_lower_upper", | 357 | "devicebuttons/simpad_lower_upper", |
353 | "QPE/Launcher", "home()", | 358 | "QPE/Launcher", "home()", |
354 | "buttonsettings", "raise()" }, | 359 | "buttonsettings", "raise()" }, |
355 | { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, | 360 | { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, |
356 | Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Lower+Upper"), | 361 | Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Lower+Upper"), |
357 | "devicebuttons/simpad_upper_lower", | 362 | "devicebuttons/simpad_upper_lower", |
358 | "QPE/Launcher", "home()", | 363 | "QPE/Launcher", "home()", |
359 | "buttonsettings", "raise()" }, | 364 | "buttonsettings", "raise()" }, |
360 | */ | 365 | */ |
361 | }; | 366 | }; |
362 | 367 | ||
363 | struct r_button { | 368 | struct r_button { |
364 | uint model; | 369 | uint model; |
365 | Qt::Key code; | 370 | Qt::Key code; |
366 | char *utext; | 371 | char *utext; |
367 | char *pix; | 372 | char *pix; |
368 | char *fpressedservice; | 373 | char *fpressedservice; |
369 | char *fpressedaction; | 374 | char *fpressedaction; |
370 | char *fheldservice; | 375 | char *fheldservice; |
371 | char *fheldaction; | 376 | char *fheldaction; |
372 | } ramses_buttons [] = { | 377 | } ramses_buttons [] = { |
373 | { Model_Ramses_MNCI, | 378 | { Model_Ramses_MNCI, |
374 | Qt::Key_F11, QT_TRANSLATE_NOOP("Button", "Menu Button"), | 379 | Qt::Key_F11, QT_TRANSLATE_NOOP("Button", "Menu Button"), |
375 | "devicebuttons/z_menu", | 380 | "devicebuttons/z_menu", |
376 | "QPE/TaskBar", "toggleMenu()", | 381 | "QPE/TaskBar", "toggleMenu()", |
377 | "QPE/TaskBar", "toggleStartMenu()" }, | 382 | "QPE/TaskBar", "toggleStartMenu()" }, |
378 | { Model_Ramses_MNCI, | 383 | { Model_Ramses_MNCI, |
379 | Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Home Button"), | 384 | Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Home Button"), |
380 | "devicebuttons/ipaq_home", | 385 | "devicebuttons/ipaq_home", |
381 | "QPE/Launcher", "home()", | 386 | "QPE/Launcher", "home()", |
382 | "buttonsettings", "raise()" }, | 387 | "buttonsettings", "raise()" }, |
383 | }; | 388 | }; |
384 | 389 | ||
385 | class Yopy : public ODevice { | 390 | class Yopy : public ODevice { |
386 | protected: | 391 | protected: |
387 | virtual void init ( ); | 392 | virtual void init ( ); |
388 | virtual void initButtons ( ); | 393 | virtual void initButtons ( ); |
389 | 394 | ||
390 | public: | 395 | public: |
391 | virtual bool suspend ( ); | 396 | virtual bool suspend ( ); |
392 | 397 | ||
393 | virtual bool setDisplayBrightness ( int b ); | 398 | virtual bool setDisplayBrightness ( int b ); |
394 | virtual int displayBrightnessResolution ( ) const; | 399 | virtual int displayBrightnessResolution ( ) const; |
395 | 400 | ||
396 | static bool isYopy ( ); | 401 | static bool isYopy ( ); |
397 | }; | 402 | }; |
398 | 403 | ||
399 | struct yopy_button { | 404 | struct yopy_button { |
400 | Qt::Key code; | 405 | Qt::Key code; |
401 | char *utext; | 406 | char *utext; |
402 | char *pix; | 407 | char *pix; |
403 | char *fpressedservice; | 408 | char *fpressedservice; |
404 | char *fpressedaction; | 409 | char *fpressedaction; |
405 | char *fheldservice; | 410 | char *fheldservice; |
406 | char *fheldaction; | 411 | char *fheldaction; |
407 | } yopy_buttons [] = { | 412 | } yopy_buttons [] = { |
408 | { Qt::Key_F10, QT_TRANSLATE_NOOP("Button", "Action Button"), | 413 | { Qt::Key_F10, QT_TRANSLATE_NOOP("Button", "Action Button"), |
409 | "devicebuttons/yopy_action", | 414 | "devicebuttons/yopy_action", |
410 | "datebook", "nextView()", | 415 | "datebook", "nextView()", |
411 | "today", "raise()" }, | 416 | "today", "raise()" }, |
412 | { Qt::Key_F11, QT_TRANSLATE_NOOP("Button", "OK Button"), | 417 | { Qt::Key_F11, QT_TRANSLATE_NOOP("Button", "OK Button"), |
413 | "devicebuttons/yopy_ok", | 418 | "devicebuttons/yopy_ok", |
414 | "addressbook", "raise()", | 419 | "addressbook", "raise()", |
415 | "addressbook", "beamBusinessCard()" }, | 420 | "addressbook", "beamBusinessCard()" }, |
416 | { Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "End Button"), | 421 | { Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "End Button"), |
417 | "devicebuttons/yopy_end", | 422 | "devicebuttons/yopy_end", |
418 | "QPE/Launcher", "home()", | 423 | "QPE/Launcher", "home()", |
419 | "buttonsettings", "raise()" }, | 424 | "buttonsettings", "raise()" }, |
420 | }; | 425 | }; |
421 | 426 | ||
422 | static QCString makeChannel ( const char *str ) | 427 | static QCString makeChannel ( const char *str ) |
423 | { | 428 | { |
@@ -1507,603 +1512,688 @@ int iPAQ::lightSensorResolution ( ) const | |||
1507 | // Comments? - mickeyl. | 1512 | // Comments? - mickeyl. |
1508 | 1513 | ||
1509 | bool Zaurus::isZaurus() | 1514 | bool Zaurus::isZaurus() |
1510 | { | 1515 | { |
1511 | 1516 | ||
1512 | // If the special devices by embedix exist, it is quite simple: it is a Zaurus ! | 1517 | // If the special devices by embedix exist, it is quite simple: it is a Zaurus ! |
1513 | if ( QFile::exists ( "/dev/sharp_buz" ) || QFile::exists ( "/dev/sharp_led" ) ){ | 1518 | if ( QFile::exists ( "/dev/sharp_buz" ) || QFile::exists ( "/dev/sharp_led" ) ){ |
1514 | return true; | 1519 | return true; |
1515 | } | 1520 | } |
1516 | 1521 | ||
1517 | // On non-embedix kernels, we have to look closer. | 1522 | // On non-embedix kernels, we have to look closer. |
1518 | bool is_zaurus = false; | 1523 | bool is_zaurus = false; |
1519 | QFile f ( "/proc/cpuinfo" ); | 1524 | QFile f ( "/proc/cpuinfo" ); |
1520 | if ( f. open ( IO_ReadOnly ) ) { | 1525 | if ( f. open ( IO_ReadOnly ) ) { |
1521 | QString model; | 1526 | QString model; |
1522 | QFile f ( "/proc/cpuinfo" ); | 1527 | QFile f ( "/proc/cpuinfo" ); |
1523 | 1528 | ||
1524 | QTextStream ts ( &f ); | 1529 | QTextStream ts ( &f ); |
1525 | QString line; | 1530 | QString line; |
1526 | while( line = ts. readLine ( ) ) { | 1531 | while( line = ts. readLine ( ) ) { |
1527 | if ( line. left ( 8 ) == "Hardware" ) | 1532 | if ( line. left ( 8 ) == "Hardware" ) |
1528 | break; | 1533 | break; |
1529 | } | 1534 | } |
1530 | int loc = line. find ( ":" ); | 1535 | int loc = line. find ( ":" ); |
1531 | if ( loc != -1 ) | 1536 | if ( loc != -1 ) |
1532 | model = line. mid ( loc + 2 ). simplifyWhiteSpace( ); | 1537 | model = line. mid ( loc + 2 ). simplifyWhiteSpace( ); |
1533 | 1538 | ||
1534 | if ( model == "Sharp-Collie" | 1539 | if ( model == "Sharp-Collie" |
1535 | || model == "Collie" | 1540 | || model == "Collie" |
1536 | || model == "SHARP Corgi" | 1541 | || model == "SHARP Corgi" |
1537 | || model == "SHARP Shepherd" | 1542 | || model == "SHARP Shepherd" |
1538 | || model == "SHARP Poodle" | 1543 | || model == "SHARP Poodle" |
1539 | || model == "SHARP Husky" | 1544 | || model == "SHARP Husky" |
1540 | ) | 1545 | ) |
1541 | is_zaurus = true; | 1546 | is_zaurus = true; |
1542 | 1547 | ||
1543 | } | 1548 | } |
1544 | return is_zaurus; | 1549 | return is_zaurus; |
1545 | } | 1550 | } |
1546 | 1551 | ||
1547 | 1552 | ||
1548 | void Zaurus::init ( ) | 1553 | void Zaurus::init ( ) |
1549 | { | 1554 | { |
1550 | d-> m_vendorstr = "Sharp"; | 1555 | d-> m_vendorstr = "Sharp"; |
1551 | d-> m_vendor = Vendor_Sharp; | 1556 | d-> m_vendor = Vendor_Sharp; |
1552 | m_embedix = true; // Not openzaurus means: It has an embedix kernel ! | 1557 | m_embedix = true; // Not openzaurus means: It has an embedix kernel ! |
1553 | 1558 | ||
1554 | // QFile f ( "/proc/filesystems" ); | 1559 | // QFile f ( "/proc/filesystems" ); |
1555 | QString model; | 1560 | QString model; |
1556 | 1561 | ||
1557 | // It isn't a good idea to check the system configuration to | 1562 | // It isn't a good idea to check the system configuration to |
1558 | // detect the distribution ! | 1563 | // detect the distribution ! |
1559 | // Otherwise it may happen that any other distribution is detected as openzaurus, just | 1564 | // Otherwise it may happen that any other distribution is detected as openzaurus, just |
1560 | // because it uses a jffs2 filesystem.. | 1565 | // because it uses a jffs2 filesystem.. |
1561 | // (eilers) | 1566 | // (eilers) |
1562 | // if ( f. open ( IO_ReadOnly ) && ( QTextStream ( &f ). read ( ). find ( "\tjffs2\n" ) >= 0 )) { | 1567 | // if ( f. open ( IO_ReadOnly ) && ( QTextStream ( &f ). read ( ). find ( "\tjffs2\n" ) >= 0 )) { |
1563 | QFile f ("/etc/oz_version"); | 1568 | QFile f ("/etc/oz_version"); |
1564 | if ( f.exists() ){ | 1569 | if ( f.exists() ){ |
1565 | d-> m_vendorstr = "OpenZaurus Team"; | 1570 | d-> m_vendorstr = "OpenZaurus Team"; |
1566 | d-> m_systemstr = "OpenZaurus"; | 1571 | d-> m_systemstr = "OpenZaurus"; |
1567 | d-> m_system = System_OpenZaurus; | 1572 | d-> m_system = System_OpenZaurus; |
1568 | 1573 | ||
1569 | if ( f. open ( IO_ReadOnly )) { | 1574 | if ( f. open ( IO_ReadOnly )) { |
1570 | QTextStream ts ( &f ); | 1575 | QTextStream ts ( &f ); |
1571 | d-> m_sysverstr = ts. readLine ( );//. mid ( 10 ); | 1576 | d-> m_sysverstr = ts. readLine ( );//. mid ( 10 ); |
1572 | f. close ( ); | 1577 | f. close ( ); |
1573 | } | 1578 | } |
1574 | 1579 | ||
1575 | // Openzaurus sometimes uses the embedix kernel! | 1580 | // Openzaurus sometimes uses the embedix kernel! |
1576 | // => Check whether this is an embedix kernel | 1581 | // => Check whether this is an embedix kernel |
1577 | FILE *uname = popen("uname -r", "r"); | 1582 | FILE *uname = popen("uname -r", "r"); |
1578 | QString line; | 1583 | QString line; |
1579 | if ( f.open(IO_ReadOnly, uname) ) { | 1584 | if ( f.open(IO_ReadOnly, uname) ) { |
1580 | QTextStream ts ( &f ); | 1585 | QTextStream ts ( &f ); |
1581 | line = ts. readLine ( ); | 1586 | line = ts. readLine ( ); |
1582 | int loc = line. find ( "embedix" ); | 1587 | int loc = line. find ( "embedix" ); |
1583 | if ( loc != -1 ) | 1588 | if ( loc != -1 ) |
1584 | m_embedix = true; | 1589 | m_embedix = true; |
1585 | else | 1590 | else |
1586 | m_embedix = false; | 1591 | m_embedix = false; |
1587 | f. close ( ); | 1592 | f. close ( ); |
1588 | } | 1593 | } |
1589 | pclose(uname); | 1594 | pclose(uname); |
1590 | } | 1595 | } |
1591 | else { | 1596 | else { |
1592 | d-> m_systemstr = "Zaurus"; | 1597 | d-> m_systemstr = "Zaurus"; |
1593 | d-> m_system = System_Zaurus; | 1598 | d-> m_system = System_Zaurus; |
1594 | } | 1599 | } |
1595 | 1600 | ||
1596 | f. setName ( "/proc/cpuinfo" ); | 1601 | f. setName ( "/proc/cpuinfo" ); |
1597 | if ( f. open ( IO_ReadOnly ) ) { | 1602 | if ( f. open ( IO_ReadOnly ) ) { |
1598 | QTextStream ts ( &f ); | 1603 | QTextStream ts ( &f ); |
1599 | QString line; | 1604 | QString line; |
1600 | while( line = ts. readLine ( ) ) { | 1605 | while( line = ts. readLine ( ) ) { |
1601 | if ( line. left ( 8 ) == "Hardware" ) | 1606 | if ( line. left ( 8 ) == "Hardware" ) |
1602 | break; | 1607 | break; |
1603 | } | 1608 | } |
1604 | int loc = line. find ( ":" ); | 1609 | int loc = line. find ( ":" ); |
1605 | if ( loc != -1 ) | 1610 | if ( loc != -1 ) |
1606 | model = line. mid ( loc + 2 ). simplifyWhiteSpace( ); | 1611 | model = line. mid ( loc + 2 ). simplifyWhiteSpace( ); |
1607 | } | 1612 | } |
1608 | 1613 | ||
1609 | if ( model == "SHARP Corgi" ) { | 1614 | if ( model == "SHARP Corgi" ) { |
1610 | d-> m_model = Model_Zaurus_SLC7x0; | 1615 | d-> m_model = Model_Zaurus_SLC7x0; |
1611 | d-> m_modelstr = "Zaurus SL-C700"; | 1616 | d-> m_modelstr = "Zaurus SL-C700"; |
1612 | } else if ( model == "SHARP Shepherd" ) { | 1617 | } else if ( model == "SHARP Shepherd" ) { |
1613 | d-> m_model = Model_Zaurus_SLC7x0; | 1618 | d-> m_model = Model_Zaurus_SLC7x0; |
1614 | d-> m_modelstr = "Zaurus SL-C750"; | 1619 | d-> m_modelstr = "Zaurus SL-C750"; |
1615 | } else if ( model == "SHARP Husky" ) { | 1620 | } else if ( model == "SHARP Husky" ) { |
1616 | d-> m_model = Model_Zaurus_SLC7x0; | 1621 | d-> m_model = Model_Zaurus_SLC7x0; |
1617 | d-> m_modelstr = "Zaurus SL-C760"; | 1622 | d-> m_modelstr = "Zaurus SL-C760"; |
1618 | } else if ( model == "SHARP Poodle" ) { | 1623 | } else if ( model == "SHARP Poodle" ) { |
1619 | d-> m_model = Model_Zaurus_SLB600; | 1624 | d-> m_model = Model_Zaurus_SLB600; |
1620 | d-> m_modelstr = "Zaurus SL-B500 or SL-5600"; | 1625 | d-> m_modelstr = "Zaurus SL-B500 or SL-5600"; |
1621 | } else if ( model == "Sharp-Collie" || model == "Collie" ) { | 1626 | } else if ( model == "Sharp-Collie" || model == "Collie" ) { |
1622 | d-> m_model = Model_Zaurus_SL5500; | 1627 | d-> m_model = Model_Zaurus_SL5500; |
1623 | d-> m_modelstr = "Zaurus SL-5500 or SL-5000d"; | 1628 | d-> m_modelstr = "Zaurus SL-5500 or SL-5000d"; |
1624 | } else { | 1629 | } else { |
1625 | d-> m_model = Model_Zaurus_SL5500; | 1630 | d-> m_model = Model_Zaurus_SL5500; |
1626 | d-> m_modelstr = "Zaurus (Model unknown)"; | 1631 | d-> m_modelstr = "Zaurus (Model unknown)"; |
1627 | } | 1632 | } |
1628 | 1633 | ||
1629 | bool flipstate = false; | 1634 | bool flipstate = false; |
1630 | switch ( d-> m_model ) { | 1635 | switch ( d-> m_model ) { |
1631 | case Model_Zaurus_SLA300: | 1636 | case Model_Zaurus_SLA300: |
1632 | d-> m_rotation = Rot0; | 1637 | d-> m_rotation = Rot0; |
1633 | break; | 1638 | break; |
1634 | case Model_Zaurus_SLC7x0: | 1639 | case Model_Zaurus_SLC7x0: |
1635 | // Note: need to 1) set flipstate based on physical screen orientation | 1640 | d-> m_rotation = rotation(); |
1636 | // and 2) check to see if the user overrode the rotation direction | 1641 | d-> m_direction = direction(); |
1637 | // using appearance, and if so, remove that item from the Config to | ||
1638 | // ensure the rotate applet flips us back to the previous state. | ||
1639 | // treke said he has patches for detecting the phys. so where are they, treke? -mickeyl. | ||
1640 | if ( flipstate ) { | ||
1641 | // 480x640 | ||
1642 | d-> m_rotation = Rot0; | ||
1643 | d-> m_direction = CW; | ||
1644 | } else { | ||
1645 | // 640x480 | ||
1646 | d-> m_rotation = Rot270; | ||
1647 | d-> m_direction = CCW; | ||
1648 | } | ||
1649 | break; | 1642 | break; |
1650 | case Model_Zaurus_SLB600: | 1643 | case Model_Zaurus_SLB600: |
1651 | case Model_Zaurus_SL5500: | 1644 | case Model_Zaurus_SL5500: |
1652 | case Model_Zaurus_SL5000: | 1645 | case Model_Zaurus_SL5000: |
1653 | default: | 1646 | default: |
1654 | d-> m_rotation = Rot270; | 1647 | d-> m_rotation = Rot270; |
1655 | break; | 1648 | break; |
1656 | } | 1649 | } |
1657 | m_leds [0] = Led_Off; | 1650 | m_leds [0] = Led_Off; |
1658 | } | 1651 | } |
1659 | 1652 | ||
1660 | void Zaurus::initButtons ( ) | 1653 | void Zaurus::initButtons ( ) |
1661 | { | 1654 | { |
1662 | if ( d-> m_buttons ) | 1655 | if ( d-> m_buttons ) |
1663 | return; | 1656 | return; |
1664 | 1657 | ||
1665 | d-> m_buttons = new QValueList <ODeviceButton>; | 1658 | d-> m_buttons = new QValueList <ODeviceButton>; |
1666 | 1659 | ||
1667 | struct z_button * pz_buttons; | 1660 | struct z_button * pz_buttons; |
1668 | int buttoncount; | 1661 | int buttoncount; |
1669 | switch ( d-> m_model ) { | 1662 | switch ( d-> m_model ) { |
1670 | case Model_Zaurus_SLC7x0: | 1663 | case Model_Zaurus_SLC7x0: |
1671 | pz_buttons = z_buttons_c700; | 1664 | pz_buttons = z_buttons_c700; |
1672 | buttoncount = ARRAY_SIZE(z_buttons_c700); | 1665 | buttoncount = ARRAY_SIZE(z_buttons_c700); |
1673 | break; | 1666 | break; |
1674 | default: | 1667 | default: |
1675 | pz_buttons = z_buttons; | 1668 | pz_buttons = z_buttons; |
1676 | buttoncount = ARRAY_SIZE(z_buttons); | 1669 | buttoncount = ARRAY_SIZE(z_buttons); |
1677 | break; | 1670 | break; |
1678 | } | 1671 | } |
1679 | 1672 | ||
1680 | for ( int i = 0; i < buttoncount; i++ ) { | 1673 | for ( int i = 0; i < buttoncount; i++ ) { |
1681 | struct z_button *zb = pz_buttons + i; | 1674 | struct z_button *zb = pz_buttons + i; |
1682 | ODeviceButton b; | 1675 | ODeviceButton b; |
1683 | 1676 | ||
1684 | b. setKeycode ( zb-> code ); | 1677 | b. setKeycode ( zb-> code ); |
1685 | b. setUserText ( QObject::tr ( "Button", zb-> utext )); | 1678 | b. setUserText ( QObject::tr ( "Button", zb-> utext )); |
1686 | b. setPixmap ( Resource::loadPixmap ( zb-> pix )); | 1679 | b. setPixmap ( Resource::loadPixmap ( zb-> pix )); |
1687 | b. setFactoryPresetPressedAction ( OQCopMessage ( makeChannel ( zb-> fpressedservice ), | 1680 | b. setFactoryPresetPressedAction ( OQCopMessage ( makeChannel ( zb-> fpressedservice ), |
1688 | zb-> fpressedaction )); | 1681 | zb-> fpressedaction )); |
1689 | b. setFactoryPresetHeldAction ( OQCopMessage ( makeChannel ( zb-> fheldservice ), | 1682 | b. setFactoryPresetHeldAction ( OQCopMessage ( makeChannel ( zb-> fheldservice ), |
1690 | zb-> fheldaction )); | 1683 | zb-> fheldaction )); |
1691 | 1684 | ||
1692 | d-> m_buttons-> append ( b ); | 1685 | d-> m_buttons-> append ( b ); |
1693 | } | 1686 | } |
1694 | 1687 | ||
1695 | reloadButtonMapping ( ); | 1688 | reloadButtonMapping ( ); |
1696 | 1689 | ||
1697 | QCopChannel *sysch = new QCopChannel ( "QPE/System", this ); | 1690 | QCopChannel *sysch = new QCopChannel ( "QPE/System", this ); |
1698 | connect ( sysch, SIGNAL( received( const QCString &, const QByteArray & )), | 1691 | connect ( sysch, SIGNAL( received( const QCString &, const QByteArray & )), |
1699 | this, SLOT( systemMessage ( const QCString &, const QByteArray & ))); | 1692 | this, SLOT( systemMessage ( const QCString &, const QByteArray & ))); |
1700 | } | 1693 | } |
1701 | 1694 | ||
1702 | #include <unistd.h> | 1695 | #include <unistd.h> |
1703 | #include <fcntl.h> | 1696 | #include <fcntl.h> |
1704 | #include <sys/ioctl.h> | 1697 | #include <sys/ioctl.h> |
1705 | 1698 | ||
1706 | //#include <asm/sharp_char.h> // including kernel headers is evil ... | 1699 | //#include <asm/sharp_char.h> // including kernel headers is evil ... |
1707 | 1700 | ||
1708 | #define SHARP_DEV_IOCTL_COMMAND_START 0x5680 | 1701 | #define SHARP_DEV_IOCTL_COMMAND_START 0x5680 |
1709 | 1702 | ||
1710 | #defineSHARP_BUZZER_IOCTL_START (SHARP_DEV_IOCTL_COMMAND_START) | 1703 | #defineSHARP_BUZZER_IOCTL_START (SHARP_DEV_IOCTL_COMMAND_START) |
1711 | #define SHARP_BUZZER_MAKESOUND (SHARP_BUZZER_IOCTL_START) | 1704 | #define SHARP_BUZZER_MAKESOUND (SHARP_BUZZER_IOCTL_START) |
1712 | 1705 | ||
1713 | #define SHARP_BUZ_TOUCHSOUND 1 /* touch panel sound */ | 1706 | #define SHARP_BUZ_TOUCHSOUND 1 /* touch panel sound */ |
1714 | #define SHARP_BUZ_KEYSOUND 2 /* key sound */ | 1707 | #define SHARP_BUZ_KEYSOUND 2 /* key sound */ |
1715 | #define SHARP_BUZ_SCHEDULE_ALARM 11 /* schedule alarm */ | 1708 | #define SHARP_BUZ_SCHEDULE_ALARM 11 /* schedule alarm */ |
1716 | 1709 | ||
1717 | /* --- for SHARP_BUZZER device --- */ | 1710 | /* --- for SHARP_BUZZER device --- */ |
1718 | 1711 | ||
1719 | //#defineSHARP_BUZZER_IOCTL_START (SHARP_DEV_IOCTL_COMMAND_START) | 1712 | //#defineSHARP_BUZZER_IOCTL_START (SHARP_DEV_IOCTL_COMMAND_START) |
1720 | //#define SHARP_BUZZER_MAKESOUND (SHARP_BUZZER_IOCTL_START) | 1713 | //#define SHARP_BUZZER_MAKESOUND (SHARP_BUZZER_IOCTL_START) |
1721 | 1714 | ||
1722 | #define SHARP_BUZZER_SETVOLUME (SHARP_BUZZER_IOCTL_START+1) | 1715 | #define SHARP_BUZZER_SETVOLUME (SHARP_BUZZER_IOCTL_START+1) |
1723 | #define SHARP_BUZZER_GETVOLUME (SHARP_BUZZER_IOCTL_START+2) | 1716 | #define SHARP_BUZZER_GETVOLUME (SHARP_BUZZER_IOCTL_START+2) |
1724 | #define SHARP_BUZZER_ISSUPPORTED (SHARP_BUZZER_IOCTL_START+3) | 1717 | #define SHARP_BUZZER_ISSUPPORTED (SHARP_BUZZER_IOCTL_START+3) |
1725 | #define SHARP_BUZZER_SETMUTE (SHARP_BUZZER_IOCTL_START+4) | 1718 | #define SHARP_BUZZER_SETMUTE (SHARP_BUZZER_IOCTL_START+4) |
1726 | #define SHARP_BUZZER_STOPSOUND (SHARP_BUZZER_IOCTL_START+5) | 1719 | #define SHARP_BUZZER_STOPSOUND (SHARP_BUZZER_IOCTL_START+5) |
1727 | 1720 | ||
1728 | //#define SHARP_BUZ_TOUCHSOUND 1 /* touch panel sound */ | 1721 | //#define SHARP_BUZ_TOUCHSOUND 1 /* touch panel sound */ |
1729 | //#define SHARP_BUZ_KEYSOUND 2 /* key sound */ | 1722 | //#define SHARP_BUZ_KEYSOUND 2 /* key sound */ |
1730 | 1723 | ||
1731 | //#define SHARP_PDA_ILLCLICKSOUND 3 /* illegal click */ | 1724 | //#define SHARP_PDA_ILLCLICKSOUND 3 /* illegal click */ |
1732 | //#define SHARP_PDA_WARNSOUND 4 /* warning occurred */ | 1725 | //#define SHARP_PDA_WARNSOUND 4 /* warning occurred */ |
1733 | //#define SHARP_PDA_ERRORSOUND 5 /* error occurred */ | 1726 | //#define SHARP_PDA_ERRORSOUND 5 /* error occurred */ |
1734 | //#define SHARP_PDA_CRITICALSOUND 6 /* critical error occurred */ | 1727 | //#define SHARP_PDA_CRITICALSOUND 6 /* critical error occurred */ |
1735 | //#define SHARP_PDA_SYSSTARTSOUND 7 /* system start */ | 1728 | //#define SHARP_PDA_SYSSTARTSOUND 7 /* system start */ |
1736 | //#define SHARP_PDA_SYSTEMENDSOUND 8 /* system shutdown */ | 1729 | //#define SHARP_PDA_SYSTEMENDSOUND 8 /* system shutdown */ |
1737 | //#define SHARP_PDA_APPSTART 9 /* application start */ | 1730 | //#define SHARP_PDA_APPSTART 9 /* application start */ |
1738 | //#define SHARP_PDA_APPQUIT 10 /* application ends */ | 1731 | //#define SHARP_PDA_APPQUIT 10 /* application ends */ |
1739 | 1732 | ||
1740 | //#define SHARP_BUZ_SCHEDULE_ALARM 11 /* schedule alarm */ | 1733 | //#define SHARP_BUZ_SCHEDULE_ALARM 11 /* schedule alarm */ |
1741 | //#define SHARP_BUZ_DAILY_ALARM 12 /* daily alarm */ | 1734 | //#define SHARP_BUZ_DAILY_ALARM 12 /* daily alarm */ |
1742 | //#define SHARP_BUZ_GOT_PHONE_CALL 13 /* phone call sound */ | 1735 | //#define SHARP_BUZ_GOT_PHONE_CALL 13 /* phone call sound */ |
1743 | //#define SHARP_BUZ_GOT_MAIL 14 /* mail sound */ | 1736 | //#define SHARP_BUZ_GOT_MAIL 14 /* mail sound */ |
1744 | // | 1737 | // |
1745 | 1738 | ||
1746 | #defineSHARP_LED_IOCTL_START (SHARP_DEV_IOCTL_COMMAND_START) | 1739 | #defineSHARP_LED_IOCTL_START (SHARP_DEV_IOCTL_COMMAND_START) |
1747 | #define SHARP_LED_SETSTATUS (SHARP_LED_IOCTL_START+1) | 1740 | #define SHARP_LED_SETSTATUS (SHARP_LED_IOCTL_START+1) |
1748 | 1741 | ||
1742 | #define SHARP_IOCTL_GET_ROTATION 0x413c | ||
1743 | |||
1749 | typedef struct sharp_led_status { | 1744 | typedef struct sharp_led_status { |
1750 | int which; /* select which LED status is wanted. */ | 1745 | int which; /* select which LED status is wanted. */ |
1751 | int status; /* set new led status if you call SHARP_LED_SETSTATUS */ | 1746 | int status; /* set new led status if you call SHARP_LED_SETSTATUS */ |
1752 | } sharp_led_status; | 1747 | } sharp_led_status; |
1753 | 1748 | ||
1754 | #define SHARP_LED_MAIL_EXISTS 9 /* mail status (exists or not) */ | 1749 | #define SHARP_LED_MAIL_EXISTS 9 /* mail status (exists or not) */ |
1755 | 1750 | ||
1756 | #define LED_MAIL_NO_UNREAD_MAIL 0 /* for SHARP_LED_MAIL_EXISTS */ | 1751 | #define LED_MAIL_NO_UNREAD_MAIL 0 /* for SHARP_LED_MAIL_EXISTS */ |
1757 | #define LED_MAIL_NEWMAIL_EXISTS 1 /* for SHARP_LED_MAIL_EXISTS */ | 1752 | #define LED_MAIL_NEWMAIL_EXISTS 1 /* for SHARP_LED_MAIL_EXISTS */ |
1758 | #define LED_MAIL_UNREAD_MAIL_EX 2 /* for SHARP_LED_MAIL_EXISTS */ | 1753 | #define LED_MAIL_UNREAD_MAIL_EX 2 /* for SHARP_LED_MAIL_EXISTS */ |
1759 | 1754 | ||
1760 | // #include <asm/sharp_apm.h> // including kernel headers is evil ... | 1755 | // #include <asm/sharp_apm.h> // including kernel headers is evil ... |
1761 | 1756 | ||
1762 | #define APM_IOCGEVTSRC OD_IOR( 'A', 203, int ) | 1757 | #define APM_IOCGEVTSRC OD_IOR( 'A', 203, int ) |
1763 | #define APM_IOCSEVTSRC OD_IORW( 'A', 204, int ) | 1758 | #define APM_IOCSEVTSRC OD_IORW( 'A', 204, int ) |
1764 | #define APM_EVT_POWER_BUTTON (1 << 0) | 1759 | #define APM_EVT_POWER_BUTTON (1 << 0) |
1765 | 1760 | ||
1766 | #define FL_IOCTL_STEP_CONTRAST 100 | 1761 | #define FL_IOCTL_STEP_CONTRAST 100 |
1767 | 1762 | ||
1768 | 1763 | ||
1769 | void Zaurus::buzzer ( int sound ) | 1764 | void Zaurus::buzzer ( int sound ) |
1770 | { | 1765 | { |
1771 | #ifndef QT_NO_SOUND | 1766 | #ifndef QT_NO_SOUND |
1772 | QString soundname; | 1767 | QString soundname; |
1773 | 1768 | ||
1774 | // Not all devices have real sound | 1769 | // Not all devices have real sound |
1775 | if ( d->m_model == Model_Zaurus_SLC7x0 | 1770 | if ( d->m_model == Model_Zaurus_SLC7x0 |
1776 | || d->m_model == Model_Zaurus_SLB600 ){ | 1771 | || d->m_model == Model_Zaurus_SLB600 ){ |
1777 | 1772 | ||
1778 | switch ( sound ){ | 1773 | switch ( sound ){ |
1779 | case SHARP_BUZ_SCHEDULE_ALARM: | 1774 | case SHARP_BUZ_SCHEDULE_ALARM: |
1780 | soundname = "alarm"; | 1775 | soundname = "alarm"; |
1781 | break; | 1776 | break; |
1782 | case SHARP_BUZ_TOUCHSOUND: | 1777 | case SHARP_BUZ_TOUCHSOUND: |
1783 | soundname = "touchsound"; | 1778 | soundname = "touchsound"; |
1784 | break; | 1779 | break; |
1785 | case SHARP_BUZ_KEYSOUND: | 1780 | case SHARP_BUZ_KEYSOUND: |
1786 | soundname = "keysound"; | 1781 | soundname = "keysound"; |
1787 | break; | 1782 | break; |
1788 | default: | 1783 | default: |
1789 | soundname = "alarm"; | 1784 | soundname = "alarm"; |
1790 | 1785 | ||
1791 | } | 1786 | } |
1792 | } | 1787 | } |
1793 | 1788 | ||
1794 | // If a soundname is defined, we expect that this device has | 1789 | // If a soundname is defined, we expect that this device has |
1795 | // sound capabilities.. Otherwise we expect to have the buzzer | 1790 | // sound capabilities.. Otherwise we expect to have the buzzer |
1796 | // device.. | 1791 | // device.. |
1797 | if ( !soundname.isEmpty() ){ | 1792 | if ( !soundname.isEmpty() ){ |
1798 | int fd; | 1793 | int fd; |
1799 | int vol; | 1794 | int vol; |
1800 | bool vol_reset = false; | 1795 | bool vol_reset = false; |
1801 | 1796 | ||
1802 | Sound snd ( soundname ); | 1797 | Sound snd ( soundname ); |
1803 | 1798 | ||
1804 | if (( fd = ::open ( "/dev/sound/mixer", O_RDWR )) >= 0 ) { | 1799 | if (( fd = ::open ( "/dev/sound/mixer", O_RDWR )) >= 0 ) { |
1805 | if ( ::ioctl ( fd, MIXER_READ( 0 ), &vol ) >= 0 ) { | 1800 | if ( ::ioctl ( fd, MIXER_READ( 0 ), &vol ) >= 0 ) { |
1806 | Config cfg ( "qpe" ); | 1801 | Config cfg ( "qpe" ); |
1807 | cfg. setGroup ( "Volume" ); | 1802 | cfg. setGroup ( "Volume" ); |
1808 | 1803 | ||
1809 | int volalarm = cfg. readNumEntry ( "AlarmPercent", 50 ); | 1804 | int volalarm = cfg. readNumEntry ( "AlarmPercent", 50 ); |
1810 | if ( volalarm < 0 ) | 1805 | if ( volalarm < 0 ) |
1811 | volalarm = 0; | 1806 | volalarm = 0; |
1812 | else if ( volalarm > 100 ) | 1807 | else if ( volalarm > 100 ) |
1813 | volalarm = 100; | 1808 | volalarm = 100; |
1814 | volalarm |= ( volalarm << 8 ); | 1809 | volalarm |= ( volalarm << 8 ); |
1815 | 1810 | ||
1816 | if ( ::ioctl ( fd, MIXER_WRITE( 0 ), &volalarm ) >= 0 ) | 1811 | if ( ::ioctl ( fd, MIXER_WRITE( 0 ), &volalarm ) >= 0 ) |
1817 | vol_reset = true; | 1812 | vol_reset = true; |
1818 | } | 1813 | } |
1819 | } | 1814 | } |
1820 | 1815 | ||
1821 | snd. play ( ); | 1816 | snd. play ( ); |
1822 | while ( !snd. isFinished ( )) | 1817 | while ( !snd. isFinished ( )) |
1823 | qApp-> processEvents ( ); | 1818 | qApp-> processEvents ( ); |
1824 | 1819 | ||
1825 | if ( fd >= 0 ) { | 1820 | if ( fd >= 0 ) { |
1826 | if ( vol_reset ) | 1821 | if ( vol_reset ) |
1827 | ::ioctl ( fd, MIXER_WRITE( 0 ), &vol ); | 1822 | ::ioctl ( fd, MIXER_WRITE( 0 ), &vol ); |
1828 | ::close ( fd ); | 1823 | ::close ( fd ); |
1829 | } | 1824 | } |
1830 | } else { | 1825 | } else { |
1831 | int fd = ::open ( "/dev/sharp_buz", O_WRONLY|O_NONBLOCK ); | 1826 | int fd = ::open ( "/dev/sharp_buz", O_WRONLY|O_NONBLOCK ); |
1832 | 1827 | ||
1833 | if ( fd >= 0 ) { | 1828 | if ( fd >= 0 ) { |
1834 | ::ioctl ( fd, SHARP_BUZZER_MAKESOUND, sound ); | 1829 | ::ioctl ( fd, SHARP_BUZZER_MAKESOUND, sound ); |
1835 | ::close ( fd ); | 1830 | ::close ( fd ); |
1836 | } | 1831 | } |
1837 | 1832 | ||
1838 | } | 1833 | } |
1839 | #endif | 1834 | #endif |
1840 | } | 1835 | } |
1841 | 1836 | ||
1842 | 1837 | ||
1843 | void Zaurus::alarmSound ( ) | 1838 | void Zaurus::alarmSound ( ) |
1844 | { | 1839 | { |
1845 | buzzer ( SHARP_BUZ_SCHEDULE_ALARM ); | 1840 | buzzer ( SHARP_BUZ_SCHEDULE_ALARM ); |
1846 | } | 1841 | } |
1847 | 1842 | ||
1848 | void Zaurus::touchSound ( ) | 1843 | void Zaurus::touchSound ( ) |
1849 | { | 1844 | { |
1850 | buzzer ( SHARP_BUZ_TOUCHSOUND ); | 1845 | buzzer ( SHARP_BUZ_TOUCHSOUND ); |
1851 | } | 1846 | } |
1852 | 1847 | ||
1853 | void Zaurus::keySound ( ) | 1848 | void Zaurus::keySound ( ) |
1854 | { | 1849 | { |
1855 | buzzer ( SHARP_BUZ_KEYSOUND ); | 1850 | buzzer ( SHARP_BUZ_KEYSOUND ); |
1856 | } | 1851 | } |
1857 | 1852 | ||
1858 | 1853 | ||
1859 | QValueList <OLed> Zaurus::ledList ( ) const | 1854 | QValueList <OLed> Zaurus::ledList ( ) const |
1860 | { | 1855 | { |
1861 | QValueList <OLed> vl; | 1856 | QValueList <OLed> vl; |
1862 | vl << Led_Mail; | 1857 | vl << Led_Mail; |
1863 | return vl; | 1858 | return vl; |
1864 | } | 1859 | } |
1865 | 1860 | ||
1866 | QValueList <OLedState> Zaurus::ledStateList ( OLed l ) const | 1861 | QValueList <OLedState> Zaurus::ledStateList ( OLed l ) const |
1867 | { | 1862 | { |
1868 | QValueList <OLedState> vl; | 1863 | QValueList <OLedState> vl; |
1869 | 1864 | ||
1870 | if ( l == Led_Mail ) | 1865 | if ( l == Led_Mail ) |
1871 | vl << Led_Off << Led_On << Led_BlinkSlow; | 1866 | vl << Led_Off << Led_On << Led_BlinkSlow; |
1872 | return vl; | 1867 | return vl; |
1873 | } | 1868 | } |
1874 | 1869 | ||
1875 | OLedState Zaurus::ledState ( OLed which ) const | 1870 | OLedState Zaurus::ledState ( OLed which ) const |
1876 | { | 1871 | { |
1877 | if ( which == Led_Mail ) | 1872 | if ( which == Led_Mail ) |
1878 | return m_leds [0]; | 1873 | return m_leds [0]; |
1879 | else | 1874 | else |
1880 | return Led_Off; | 1875 | return Led_Off; |
1881 | } | 1876 | } |
1882 | 1877 | ||
1883 | bool Zaurus::setLedState ( OLed which, OLedState st ) | 1878 | bool Zaurus::setLedState ( OLed which, OLedState st ) |
1884 | { | 1879 | { |
1885 | if (!m_embedix) // Currently not supported on non_embedix kernels | 1880 | if (!m_embedix) // Currently not supported on non_embedix kernels |
1886 | return false; | 1881 | return false; |
1887 | 1882 | ||
1888 | static int fd = ::open ( "/dev/sharp_led", O_RDWR|O_NONBLOCK ); | 1883 | static int fd = ::open ( "/dev/sharp_led", O_RDWR|O_NONBLOCK ); |
1889 | 1884 | ||
1890 | if ( which == Led_Mail ) { | 1885 | if ( which == Led_Mail ) { |
1891 | if ( fd >= 0 ) { | 1886 | if ( fd >= 0 ) { |
1892 | struct sharp_led_status leds; | 1887 | struct sharp_led_status leds; |
1893 | ::memset ( &leds, 0, sizeof( leds )); | 1888 | ::memset ( &leds, 0, sizeof( leds )); |
1894 | leds. which = SHARP_LED_MAIL_EXISTS; | 1889 | leds. which = SHARP_LED_MAIL_EXISTS; |
1895 | bool ok = true; | 1890 | bool ok = true; |
1896 | 1891 | ||
1897 | switch ( st ) { | 1892 | switch ( st ) { |
1898 | case Led_Off : leds. status = LED_MAIL_NO_UNREAD_MAIL; break; | 1893 | case Led_Off : leds. status = LED_MAIL_NO_UNREAD_MAIL; break; |
1899 | case Led_On : leds. status = LED_MAIL_NEWMAIL_EXISTS; break; | 1894 | case Led_On : leds. status = LED_MAIL_NEWMAIL_EXISTS; break; |
1900 | case Led_BlinkSlow: leds. status = LED_MAIL_UNREAD_MAIL_EX; break; | 1895 | case Led_BlinkSlow: leds. status = LED_MAIL_UNREAD_MAIL_EX; break; |
1901 | default : ok = false; | 1896 | default : ok = false; |
1902 | } | 1897 | } |
1903 | 1898 | ||
1904 | if ( ok && ( ::ioctl ( fd, SHARP_LED_SETSTATUS, &leds ) >= 0 )) { | 1899 | if ( ok && ( ::ioctl ( fd, SHARP_LED_SETSTATUS, &leds ) >= 0 )) { |
1905 | m_leds [0] = st; | 1900 | m_leds [0] = st; |
1906 | return true; | 1901 | return true; |
1907 | } | 1902 | } |
1908 | } | 1903 | } |
1909 | } | 1904 | } |
1910 | return false; | 1905 | return false; |
1911 | } | 1906 | } |
1912 | 1907 | ||
1913 | bool Zaurus::setSoftSuspend ( bool soft ) | 1908 | bool Zaurus::setSoftSuspend ( bool soft ) |
1914 | { | 1909 | { |
1915 | if (!m_embedix) { | 1910 | if (!m_embedix) { |
1916 | /* non-Embedix kernels dont have kernel autosuspend */ | 1911 | /* non-Embedix kernels dont have kernel autosuspend */ |
1917 | return ODevice::setSoftSuspend( soft ); | 1912 | return ODevice::setSoftSuspend( soft ); |
1918 | } | 1913 | } |
1919 | 1914 | ||
1920 | bool res = false; | 1915 | bool res = false; |
1921 | int fd; | 1916 | int fd; |
1922 | 1917 | ||
1923 | if ((( fd = ::open ( "/dev/apm_bios", O_RDWR )) >= 0 ) || | 1918 | if ((( fd = ::open ( "/dev/apm_bios", O_RDWR )) >= 0 ) || |
1924 | (( fd = ::open ( "/dev/misc/apm_bios",O_RDWR )) >= 0 )) { | 1919 | (( fd = ::open ( "/dev/misc/apm_bios",O_RDWR )) >= 0 )) { |
1925 | 1920 | ||
1926 | int sources = ::ioctl ( fd, APM_IOCGEVTSRC, 0 ); // get current event sources | 1921 | int sources = ::ioctl ( fd, APM_IOCGEVTSRC, 0 ); // get current event sources |
1927 | 1922 | ||
1928 | if ( sources >= 0 ) { | 1923 | if ( sources >= 0 ) { |
1929 | if ( soft ) | 1924 | if ( soft ) |
1930 | sources &= ~APM_EVT_POWER_BUTTON; | 1925 | sources &= ~APM_EVT_POWER_BUTTON; |
1931 | else | 1926 | else |
1932 | sources |= APM_EVT_POWER_BUTTON; | 1927 | sources |= APM_EVT_POWER_BUTTON; |
1933 | 1928 | ||
1934 | if ( ::ioctl ( fd, APM_IOCSEVTSRC, sources ) >= 0 ) // set new event sources | 1929 | if ( ::ioctl ( fd, APM_IOCSEVTSRC, sources ) >= 0 ) // set new event sources |
1935 | res = true; | 1930 | res = true; |
1936 | else | 1931 | else |
1937 | perror ( "APM_IOCGEVTSRC" ); | 1932 | perror ( "APM_IOCGEVTSRC" ); |
1938 | } | 1933 | } |
1939 | else | 1934 | else |
1940 | perror ( "APM_IOCGEVTSRC" ); | 1935 | perror ( "APM_IOCGEVTSRC" ); |
1941 | 1936 | ||
1942 | ::close ( fd ); | 1937 | ::close ( fd ); |
1943 | } | 1938 | } |
1944 | else | 1939 | else |
1945 | perror ( "/dev/apm_bios or /dev/misc/apm_bios" ); | 1940 | perror ( "/dev/apm_bios or /dev/misc/apm_bios" ); |
1946 | 1941 | ||
1947 | return res; | 1942 | return res; |
1948 | } | 1943 | } |
1949 | 1944 | ||
1950 | 1945 | ||
1951 | bool Zaurus::setDisplayBrightness ( int bright ) | 1946 | bool Zaurus::setDisplayBrightness ( int bright ) |
1952 | { | 1947 | { |
1953 | // FIXME The C7x0 have a proc-interface (/proc/drivers/corgi-bl) which | 1948 | // FIXME The C7x0 have a proc-interface (/proc/drivers/corgi-bl) which |
1954 | // is nice to use. Currently it exposes 16+1 levels. Implement this! | 1949 | // is nice to use. Currently it exposes 16+1 levels. Implement this! |
1955 | // (or wait for kergoth unifying the interfaces in the OpenZaurus kernel.) | 1950 | // (or wait for kergoth unifying the interfaces in the OpenZaurus kernel.) |
1956 | bool res = false; | 1951 | bool res = false; |
1957 | int fd; | 1952 | int fd; |
1958 | 1953 | ||
1959 | if ( bright > 255 ) | 1954 | if ( bright > 255 ) |
1960 | bright = 255; | 1955 | bright = 255; |
1961 | if ( bright < 0 ) | 1956 | if ( bright < 0 ) |
1962 | bright = 0; | 1957 | bright = 0; |
1963 | 1958 | ||
1964 | if (m_embedix) { | 1959 | if (m_embedix) { |
1965 | if (( fd = ::open ( "/dev/fl", O_WRONLY )) >= 0 ) { | 1960 | if (( fd = ::open ( "/dev/fl", O_WRONLY )) >= 0 ) { |
1966 | int bl = ( bright * 4 + 127 ) / 255; // only 4 steps on zaurus | 1961 | int bl = ( bright * 4 + 127 ) / 255; // only 4 steps on zaurus |
1967 | if ( bright && !bl ) | 1962 | if ( bright && !bl ) |
1968 | bl = 1; | 1963 | bl = 1; |
1969 | res = ( ::ioctl ( fd, FL_IOCTL_STEP_CONTRAST, bl ) == 0 ); | 1964 | res = ( ::ioctl ( fd, FL_IOCTL_STEP_CONTRAST, bl ) == 0 ); |
1970 | ::close ( fd ); | 1965 | ::close ( fd ); |
1971 | } | 1966 | } |
1972 | } else { | 1967 | } else { |
1973 | #define FB_BACKLIGHT_SET_BRIGHTNESS _IOW('F', 1, u_int) /* set brightness */ | 1968 | #define FB_BACKLIGHT_SET_BRIGHTNESS _IOW('F', 1, u_int) /* set brightness */ |
1974 | if (( fd = ::open ( "/dev/fb0", O_WRONLY )) >= 0 ) { | 1969 | if (( fd = ::open ( "/dev/fb0", O_WRONLY )) >= 0 ) { |
1975 | res = ( ::ioctl ( fd , FB_BACKLIGHT_SET_BRIGHTNESS, bright ) == 0 ); | 1970 | res = ( ::ioctl ( fd , FB_BACKLIGHT_SET_BRIGHTNESS, bright ) == 0 ); |
1976 | ::close ( fd ); | 1971 | ::close ( fd ); |
1977 | } | 1972 | } |
1978 | } | 1973 | } |
1979 | return res; | 1974 | return res; |
1980 | } | 1975 | } |
1981 | 1976 | ||
1977 | bool Zaurus::suspend ( ) | ||
1978 | { | ||
1979 | qDebug("ODevice::suspend"); | ||
1980 | if ( !isQWS( ) ) // only qwsserver is allowed to suspend | ||
1981 | return false; | ||
1982 | |||
1983 | if ( d-> m_model == Model_Unknown ) // better don't suspend in qvfb / on unkown devices | ||
1984 | return false; | ||
1985 | |||
1986 | bool res = false; | ||
1987 | |||
1988 | struct timeval tvs, tvn; | ||
1989 | ::gettimeofday ( &tvs, 0 ); | ||
1990 | |||
1991 | ::sync ( ); // flush fs caches | ||
1992 | res = ( ::system ( "apm --suspend" ) == 0 ); | ||
1993 | |||
1994 | // This is needed because the iPAQ apm implementation is asynchronous and we | ||
1995 | // can not be sure when exactly the device is really suspended | ||
1996 | // This can be deleted as soon as a stable familiar with a synchronous apm implementation exists. | ||
1997 | |||
1998 | if ( res ) { | ||
1999 | do { // Yes, wait 15 seconds. This APM bug sucks big time. | ||
2000 | ::usleep ( 200 * 1000 ); | ||
2001 | ::gettimeofday ( &tvn, 0 ); | ||
2002 | } while ((( tvn. tv_sec - tvs. tv_sec ) * 1000 + ( tvn. tv_usec - tvs. tv_usec ) / 1000 ) < 15000 ); | ||
2003 | } | ||
2004 | |||
2005 | QCopEnvelope ( "QPE/Rotation", "rotateDefault()" ); | ||
2006 | return res; | ||
2007 | } | ||
2008 | |||
2009 | |||
2010 | Transformation Zaurus::rotation ( ) const | ||
2011 | { | ||
2012 | Transformation rot; | ||
2013 | int handle = 0; | ||
2014 | int retval = 0; | ||
2015 | |||
2016 | switch ( d-> m_model ) { | ||
2017 | case Model_Zaurus_SLC7x0: | ||
2018 | handle = ::open("/dev/apm_bios", O_RDWR|O_NONBLOCK); | ||
2019 | if (handle == -1) { | ||
2020 | return Rot270; | ||
2021 | } else { | ||
2022 | retval = ::ioctl(handle, SHARP_IOCTL_GET_ROTATION); | ||
2023 | ::close (handle); | ||
2024 | |||
2025 | if (retval == 2 ) | ||
2026 | rot = Rot0; | ||
2027 | else | ||
2028 | rot = Rot270; | ||
2029 | } | ||
2030 | break; | ||
2031 | case Model_Zaurus_SLA300: | ||
2032 | case Model_Zaurus_SLB600: | ||
2033 | case Model_Zaurus_SL5500: | ||
2034 | case Model_Zaurus_SL5000: | ||
2035 | default: | ||
2036 | rot = d-> m_rotation; | ||
2037 | break; | ||
2038 | } | ||
2039 | |||
2040 | return rot; | ||
2041 | } | ||
2042 | ODirection Zaurus::direction ( ) const | ||
2043 | { | ||
2044 | ODirection dir; | ||
2045 | int handle = 0; | ||
2046 | int retval = 0; | ||
2047 | switch ( d-> m_model ) { | ||
2048 | case Model_Zaurus_SLC7x0: | ||
2049 | handle = ::open("/dev/apm_bios", O_RDWR|O_NONBLOCK); | ||
2050 | if (handle == -1) { | ||
2051 | dir = Rot270; | ||
2052 | } else { | ||
2053 | retval = ::ioctl(handle, SHARP_IOCTL_GET_ROTATION); | ||
2054 | ::close (handle); | ||
2055 | if (retval == 2 ) | ||
2056 | dir = CCW; | ||
2057 | else | ||
2058 | dir = CW; | ||
2059 | } | ||
2060 | break; | ||
2061 | case Model_Zaurus_SLA300: | ||
2062 | case Model_Zaurus_SLB600: | ||
2063 | case Model_Zaurus_SL5500: | ||
2064 | case Model_Zaurus_SL5000: | ||
2065 | default: | ||
2066 | dir = d-> m_direction; | ||
2067 | break; | ||
2068 | } | ||
2069 | return dir; | ||
2070 | |||
2071 | } | ||
1982 | 2072 | ||
1983 | int Zaurus::displayBrightnessResolution ( ) const | 2073 | int Zaurus::displayBrightnessResolution ( ) const |
1984 | { | 2074 | { |
1985 | if (m_embedix) | 2075 | if (m_embedix) |
1986 | return 5; | 2076 | return 5; |
1987 | else | 2077 | else |
1988 | return 256; | 2078 | return 256; |
1989 | } | 2079 | } |
1990 | 2080 | ||
1991 | /************************************************** | 2081 | /************************************************** |
1992 | * | 2082 | * |
1993 | * SIMpad | 2083 | * SIMpad |
1994 | * | 2084 | * |
1995 | **************************************************/ | 2085 | **************************************************/ |
1996 | 2086 | ||
1997 | void SIMpad::init ( ) | 2087 | void SIMpad::init ( ) |
1998 | { | 2088 | { |
1999 | d-> m_vendorstr = "SIEMENS"; | 2089 | d-> m_vendorstr = "SIEMENS"; |
2000 | d-> m_vendor = Vendor_SIEMENS; | 2090 | d-> m_vendor = Vendor_SIEMENS; |
2001 | 2091 | ||
2002 | QFile f ( "/proc/hal/model" ); | 2092 | QFile f ( "/proc/hal/model" ); |
2003 | 2093 | ||
2004 | //TODO Implement model checking | 2094 | //TODO Implement model checking |
2005 | //FIXME For now we assume an SL4 | 2095 | //FIXME For now we assume an SL4 |
2006 | 2096 | ||
2007 | d-> m_modelstr = "SL4"; | 2097 | d-> m_modelstr = "SL4"; |
2008 | d-> m_model = Model_SIMpad_SL4; | 2098 | d-> m_model = Model_SIMpad_SL4; |
2009 | 2099 | ||
2010 | switch ( d-> m_model ) { | 2100 | switch ( d-> m_model ) { |
2011 | default: | 2101 | default: |
2012 | d-> m_rotation = Rot0; | 2102 | d-> m_rotation = Rot0; |
2013 | d-> m_direction = CCW; | 2103 | d-> m_direction = CCW; |
2014 | d-> m_holdtime = 1000; // 1000ms | 2104 | d-> m_holdtime = 1000; // 1000ms |
2015 | 2105 | ||
2016 | break; | 2106 | break; |
2017 | } | 2107 | } |
2018 | 2108 | ||
2019 | f. setName ( "/etc/familiar-version" ); | 2109 | f. setName ( "/etc/familiar-version" ); |
2020 | if ( f. open ( IO_ReadOnly )) { | 2110 | if ( f. open ( IO_ReadOnly )) { |
2021 | d-> m_systemstr = "Familiar"; | 2111 | d-> m_systemstr = "Familiar"; |
2022 | d-> m_system = System_Familiar; | 2112 | d-> m_system = System_Familiar; |
2023 | 2113 | ||
2024 | QTextStream ts ( &f ); | 2114 | QTextStream ts ( &f ); |
2025 | d-> m_sysverstr = ts. readLine ( ). mid ( 10 ); | 2115 | d-> m_sysverstr = ts. readLine ( ). mid ( 10 ); |
2026 | 2116 | ||
2027 | f. close ( ); | 2117 | f. close ( ); |
2028 | } else { | 2118 | } else { |
2029 | f. setName ( "/etc/oz_version" ); | 2119 | f. setName ( "/etc/oz_version" ); |
2030 | 2120 | ||
2031 | if ( f. open ( IO_ReadOnly )) { | 2121 | if ( f. open ( IO_ReadOnly )) { |
2032 | d-> m_systemstr = "OpenEmbedded/SIMpad"; | 2122 | d-> m_systemstr = "OpenEmbedded/SIMpad"; |
2033 | d-> m_system = System_OpenZaurus; | 2123 | d-> m_system = System_OpenZaurus; |
2034 | 2124 | ||
2035 | QTextStream ts ( &f ); | 2125 | QTextStream ts ( &f ); |
2036 | ts.setDevice ( &f ); | 2126 | ts.setDevice ( &f ); |
2037 | d-> m_sysverstr = ts. readLine ( ); | 2127 | d-> m_sysverstr = ts. readLine ( ); |
2038 | f. close ( ); | 2128 | f. close ( ); |
2039 | } | 2129 | } |
2040 | } | 2130 | } |
2041 | 2131 | ||
2042 | m_leds [0] = m_leds [1] = Led_Off; | 2132 | m_leds [0] = m_leds [1] = Led_Off; |
2043 | 2133 | ||
2044 | m_power_timer = 0; | 2134 | m_power_timer = 0; |
2045 | 2135 | ||
2046 | } | 2136 | } |
2047 | 2137 | ||
2048 | void SIMpad::initButtons ( ) | 2138 | void SIMpad::initButtons ( ) |
2049 | { | 2139 | { |
2050 | if ( d-> m_buttons ) | 2140 | if ( d-> m_buttons ) |
2051 | return; | 2141 | return; |
2052 | 2142 | ||
2053 | if ( isQWS( ) ) | 2143 | if ( isQWS( ) ) |
2054 | QWSServer::setKeyboardFilter ( this ); | 2144 | QWSServer::setKeyboardFilter ( this ); |
2055 | 2145 | ||
2056 | d-> m_buttons = new QValueList <ODeviceButton>; | 2146 | d-> m_buttons = new QValueList <ODeviceButton>; |
2057 | 2147 | ||
2058 | for ( uint i = 0; i < ( sizeof( simpad_buttons ) / sizeof( s_button )); i++ ) { | 2148 | for ( uint i = 0; i < ( sizeof( simpad_buttons ) / sizeof( s_button )); i++ ) { |
2059 | s_button *sb = simpad_buttons + i; | 2149 | s_button *sb = simpad_buttons + i; |
2060 | ODeviceButton b; | 2150 | ODeviceButton b; |
2061 | 2151 | ||
2062 | if (( sb-> model & d-> m_model ) == d-> m_model ) { | 2152 | if (( sb-> model & d-> m_model ) == d-> m_model ) { |
2063 | b. setKeycode ( sb-> code ); | 2153 | b. setKeycode ( sb-> code ); |
2064 | b. setUserText ( QObject::tr ( "Button", sb-> utext )); | 2154 | b. setUserText ( QObject::tr ( "Button", sb-> utext )); |
2065 | b. setPixmap ( Resource::loadPixmap ( sb-> pix )); | 2155 | b. setPixmap ( Resource::loadPixmap ( sb-> pix )); |
2066 | b. setFactoryPresetPressedAction ( OQCopMessage ( makeChannel ( sb-> fpressedservice ), sb-> fpressedaction )); | 2156 | b. setFactoryPresetPressedAction ( OQCopMessage ( makeChannel ( sb-> fpressedservice ), sb-> fpressedaction )); |
2067 | b. setFactoryPresetHeldAction ( OQCopMessage ( makeChannel ( sb-> fheldservice ), sb-> fheldaction )); | 2157 | b. setFactoryPresetHeldAction ( OQCopMessage ( makeChannel ( sb-> fheldservice ), sb-> fheldaction )); |
2068 | 2158 | ||
2069 | d-> m_buttons-> append ( b ); | 2159 | d-> m_buttons-> append ( b ); |
2070 | } | 2160 | } |
2071 | } | 2161 | } |
2072 | reloadButtonMapping ( ); | 2162 | reloadButtonMapping ( ); |
2073 | 2163 | ||
2074 | QCopChannel *sysch = new QCopChannel ( "QPE/System", this ); | 2164 | QCopChannel *sysch = new QCopChannel ( "QPE/System", this ); |
2075 | connect ( sysch, SIGNAL( received( const QCString &, const QByteArray & )), this, SLOT( systemMessage ( const QCString &, const QByteArray & ))); | 2165 | connect ( sysch, SIGNAL( received( const QCString &, const QByteArray & )), this, SLOT( systemMessage ( const QCString &, const QByteArray & ))); |
2076 | } | 2166 | } |
2077 | 2167 | ||
2078 | // SIMpad boardcontrol register CS3 | 2168 | // SIMpad boardcontrol register CS3 |
2079 | #define SIMPAD_BOARDCONTROL "/proc/cs3" | 2169 | #define SIMPAD_BOARDCONTROL "/proc/cs3" |
2080 | #define SIMPAD_VCC_5V_EN 0x0001 // For 5V PCMCIA | 2170 | #define SIMPAD_VCC_5V_EN 0x0001 // For 5V PCMCIA |
2081 | #define SIMPAD_VCC_3V_EN 0x0002 // FOR 3.3V PCMCIA | 2171 | #define SIMPAD_VCC_3V_EN 0x0002 // FOR 3.3V PCMCIA |
2082 | #define SIMPAD_EN1 0x0004 // This is only for EPROM's | 2172 | #define SIMPAD_EN1 0x0004 // This is only for EPROM's |
2083 | #define SIMPAD_EN0 0x0008 // Both should be enable for 3.3V or 5V | 2173 | #define SIMPAD_EN0 0x0008 // Both should be enable for 3.3V or 5V |
2084 | #define SIMPAD_DISPLAY_ON 0x0010 | 2174 | #define SIMPAD_DISPLAY_ON 0x0010 |
2085 | #define SIMPAD_PCMCIA_BUFF_DIS 0x0020 | 2175 | #define SIMPAD_PCMCIA_BUFF_DIS 0x0020 |
2086 | #define SIMPAD_MQ_RESET 0x0040 | 2176 | #define SIMPAD_MQ_RESET 0x0040 |
2087 | #define SIMPAD_PCMCIA_RESET 0x0080 | 2177 | #define SIMPAD_PCMCIA_RESET 0x0080 |
2088 | #define SIMPAD_DECT_POWER_ON 0x0100 | 2178 | #define SIMPAD_DECT_POWER_ON 0x0100 |
2089 | #define SIMPAD_IRDA_SD 0x0200 // Shutdown for powersave | 2179 | #define SIMPAD_IRDA_SD 0x0200 // Shutdown for powersave |
2090 | #define SIMPAD_RS232_ON 0x0400 | 2180 | #define SIMPAD_RS232_ON 0x0400 |
2091 | #define SIMPAD_SD_MEDIAQ 0x0800 // Shutdown for powersave | 2181 | #define SIMPAD_SD_MEDIAQ 0x0800 // Shutdown for powersave |
2092 | #define SIMPAD_LED2_ON 0x1000 | 2182 | #define SIMPAD_LED2_ON 0x1000 |
2093 | #define SIMPAD_IRDA_MODE 0x2000 // Fast/Slow IrDA mode | 2183 | #define SIMPAD_IRDA_MODE 0x2000 // Fast/Slow IrDA mode |
2094 | #define SIMPAD_ENABLE_5V 0x4000 // Enable 5V circuit | 2184 | #define SIMPAD_ENABLE_5V 0x4000 // Enable 5V circuit |
2095 | #define SIMPAD_RESET_SIMCARD 0x8000 | 2185 | #define SIMPAD_RESET_SIMCARD 0x8000 |
2096 | 2186 | ||
2097 | //SIMpad touchscreen backlight strength control | 2187 | //SIMpad touchscreen backlight strength control |
2098 | #define SIMPAD_BACKLIGHT_CONTROL "/proc/driver/mq200/registers/PWM_CONTROL" | 2188 | #define SIMPAD_BACKLIGHT_CONTROL "/proc/driver/mq200/registers/PWM_CONTROL" |
2099 | #define SIMPAD_BACKLIGHT_MASK 0x00a10044 | 2189 | #define SIMPAD_BACKLIGHT_MASK 0x00a10044 |
2100 | 2190 | ||
2101 | QValueList <OLed> SIMpad::ledList ( ) const | 2191 | QValueList <OLed> SIMpad::ledList ( ) const |
2102 | { | 2192 | { |
2103 | QValueList <OLed> vl; | 2193 | QValueList <OLed> vl; |
2104 | vl << Led_Power; //FIXME which LED is LED2 ? The green one or the amber one? | 2194 | vl << Led_Power; //FIXME which LED is LED2 ? The green one or the amber one? |
2105 | //vl << Led_Mail; //TODO find out if LED1 is accessible anyway | 2195 | //vl << Led_Mail; //TODO find out if LED1 is accessible anyway |
2106 | return vl; | 2196 | return vl; |
2107 | } | 2197 | } |
2108 | 2198 | ||
2109 | QValueList <OLedState> SIMpad::ledStateList ( OLed l ) const | 2199 | QValueList <OLedState> SIMpad::ledStateList ( OLed l ) const |