author | mickeyl <mickeyl> | 2004-01-04 23:36:04 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2004-01-04 23:36:04 (UTC) |
commit | 68f09442c635da109c0f31888d4f42bd14e8de1f (patch) (unidiff) | |
tree | 27f7dbdaae1547fc6e8094a97009859e3c480ee2 | |
parent | 5af215d9cac1c65a9cd56b56cc18e39cfcc06c64 (diff) | |
download | opie-68f09442c635da109c0f31888d4f42bd14e8de1f.zip opie-68f09442c635da109c0f31888d4f42bd14e8de1f.tar.gz opie-68f09442c635da109c0f31888d4f42bd14e8de1f.tar.bz2 |
better not define rotation as pressaction _and_ heldaction
-rw-r--r-- | libopie/odevice.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libopie/odevice.cpp b/libopie/odevice.cpp index 82a0099..35d6cb4 100644 --- a/libopie/odevice.cpp +++ b/libopie/odevice.cpp | |||
@@ -109,387 +109,387 @@ protected: | |||
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 | virtual bool hasHingeSensor() const; | 143 | virtual bool hasHingeSensor() const; |
144 | virtual OHingeStatus readHingeSensor(); | 144 | virtual OHingeStatus readHingeSensor(); |
145 | 145 | ||
146 | static bool isZaurus(); | 146 | static bool isZaurus(); |
147 | 147 | ||
148 | // Does this break BC? | 148 | // Does this break BC? |
149 | virtual bool suspend ( ); | 149 | virtual bool suspend ( ); |
150 | virtual Transformation rotation ( ) const; | 150 | virtual Transformation rotation ( ) const; |
151 | virtual ODirection direction ( ) const; | 151 | virtual ODirection direction ( ) const; |
152 | 152 | ||
153 | protected: | 153 | protected: |
154 | virtual void buzzer ( int snd ); | 154 | virtual void buzzer ( int snd ); |
155 | 155 | ||
156 | OLedState m_leds [1]; | 156 | OLedState m_leds [1]; |
157 | bool m_embedix; | 157 | bool m_embedix; |
158 | }; | 158 | }; |
159 | 159 | ||
160 | class SIMpad : public ODevice, public QWSServer::KeyboardFilter { | 160 | class SIMpad : public ODevice, public QWSServer::KeyboardFilter { |
161 | protected: | 161 | protected: |
162 | virtual void init ( ); | 162 | virtual void init ( ); |
163 | virtual void initButtons ( ); | 163 | virtual void initButtons ( ); |
164 | 164 | ||
165 | public: | 165 | public: |
166 | virtual bool setSoftSuspend ( bool soft ); | 166 | virtual bool setSoftSuspend ( bool soft ); |
167 | virtual bool suspend(); | 167 | virtual bool suspend(); |
168 | 168 | ||
169 | virtual bool setDisplayStatus( bool on ); | 169 | virtual bool setDisplayStatus( bool on ); |
170 | virtual bool setDisplayBrightness ( int b ); | 170 | virtual bool setDisplayBrightness ( int b ); |
171 | virtual int displayBrightnessResolution ( ) const; | 171 | virtual int displayBrightnessResolution ( ) const; |
172 | 172 | ||
173 | virtual void alarmSound ( ); | 173 | virtual void alarmSound ( ); |
174 | 174 | ||
175 | virtual QValueList <OLed> ledList ( ) const; | 175 | virtual QValueList <OLed> ledList ( ) const; |
176 | virtual QValueList <OLedState> ledStateList ( OLed led ) const; | 176 | virtual QValueList <OLedState> ledStateList ( OLed led ) const; |
177 | virtual OLedState ledState ( OLed led ) const; | 177 | virtual OLedState ledState ( OLed led ) const; |
178 | virtual bool setLedState ( OLed led, OLedState st ); | 178 | virtual bool setLedState ( OLed led, OLedState st ); |
179 | 179 | ||
180 | protected: | 180 | protected: |
181 | virtual bool filter ( int unicode, int keycode, int modifiers, bool isPress, bool autoRepeat ); | 181 | virtual bool filter ( int unicode, int keycode, int modifiers, bool isPress, bool autoRepeat ); |
182 | virtual void timerEvent ( QTimerEvent *te ); | 182 | virtual void timerEvent ( QTimerEvent *te ); |
183 | 183 | ||
184 | int m_power_timer; | 184 | int m_power_timer; |
185 | 185 | ||
186 | OLedState m_leds [1]; //FIXME check if really only one | 186 | OLedState m_leds [1]; //FIXME check if really only one |
187 | }; | 187 | }; |
188 | 188 | ||
189 | class Ramses : public ODevice, public QWSServer::KeyboardFilter { | 189 | class Ramses : public ODevice, public QWSServer::KeyboardFilter { |
190 | protected: | 190 | protected: |
191 | virtual void init ( ); | 191 | virtual void init ( ); |
192 | 192 | ||
193 | public: | 193 | public: |
194 | virtual bool setSoftSuspend ( bool soft ); | 194 | virtual bool setSoftSuspend ( bool soft ); |
195 | virtual bool suspend ( ); | 195 | virtual bool suspend ( ); |
196 | 196 | ||
197 | virtual bool setDisplayStatus( bool on ); | 197 | virtual bool setDisplayStatus( bool on ); |
198 | virtual bool setDisplayBrightness ( int b ); | 198 | virtual bool setDisplayBrightness ( int b ); |
199 | virtual int displayBrightnessResolution ( ) const; | 199 | virtual int displayBrightnessResolution ( ) const; |
200 | virtual bool setDisplayContrast ( int b ); | 200 | virtual bool setDisplayContrast ( int b ); |
201 | virtual int displayContrastResolution ( ) const; | 201 | virtual int displayContrastResolution ( ) const; |
202 | 202 | ||
203 | protected: | 203 | protected: |
204 | virtual bool filter ( int unicode, int keycode, int modifiers, bool isPress, bool autoRepeat ); | 204 | virtual bool filter ( int unicode, int keycode, int modifiers, bool isPress, bool autoRepeat ); |
205 | virtual void timerEvent ( QTimerEvent *te ); | 205 | virtual void timerEvent ( QTimerEvent *te ); |
206 | 206 | ||
207 | int m_power_timer; | 207 | int m_power_timer; |
208 | }; | 208 | }; |
209 | 209 | ||
210 | struct i_button { | 210 | struct i_button { |
211 | uint model; | 211 | uint model; |
212 | Qt::Key code; | 212 | Qt::Key code; |
213 | char *utext; | 213 | char *utext; |
214 | char *pix; | 214 | char *pix; |
215 | char *fpressedservice; | 215 | char *fpressedservice; |
216 | char *fpressedaction; | 216 | char *fpressedaction; |
217 | char *fheldservice; | 217 | char *fheldservice; |
218 | char *fheldaction; | 218 | char *fheldaction; |
219 | } ipaq_buttons [] = { | 219 | } ipaq_buttons [] = { |
220 | { Model_iPAQ_H31xx | Model_iPAQ_H36xx | Model_iPAQ_H37xx | Model_iPAQ_H38xx | Model_iPAQ_H39xx | Model_iPAQ_H5xxx, | 220 | { Model_iPAQ_H31xx | Model_iPAQ_H36xx | Model_iPAQ_H37xx | Model_iPAQ_H38xx | Model_iPAQ_H39xx | Model_iPAQ_H5xxx, |
221 | Qt::Key_F9, QT_TRANSLATE_NOOP("Button", "Calendar Button"), | 221 | Qt::Key_F9, QT_TRANSLATE_NOOP("Button", "Calendar Button"), |
222 | "devicebuttons/ipaq_calendar", | 222 | "devicebuttons/ipaq_calendar", |
223 | "datebook", "nextView()", | 223 | "datebook", "nextView()", |
224 | "today", "raise()" }, | 224 | "today", "raise()" }, |
225 | { Model_iPAQ_H31xx | Model_iPAQ_H36xx | Model_iPAQ_H37xx | Model_iPAQ_H38xx | Model_iPAQ_H39xx | Model_iPAQ_H5xxx, | 225 | { Model_iPAQ_H31xx | Model_iPAQ_H36xx | Model_iPAQ_H37xx | Model_iPAQ_H38xx | Model_iPAQ_H39xx | Model_iPAQ_H5xxx, |
226 | Qt::Key_F10, QT_TRANSLATE_NOOP("Button", "Contacts Button"), | 226 | Qt::Key_F10, QT_TRANSLATE_NOOP("Button", "Contacts Button"), |
227 | "devicebuttons/ipaq_contact", | 227 | "devicebuttons/ipaq_contact", |
228 | "addressbook", "raise()", | 228 | "addressbook", "raise()", |
229 | "addressbook", "beamBusinessCard()" }, | 229 | "addressbook", "beamBusinessCard()" }, |
230 | { Model_iPAQ_H31xx | Model_iPAQ_H36xx | Model_iPAQ_H37xx, | 230 | { Model_iPAQ_H31xx | Model_iPAQ_H36xx | Model_iPAQ_H37xx, |
231 | Qt::Key_F11, QT_TRANSLATE_NOOP("Button", "Menu Button"), | 231 | Qt::Key_F11, QT_TRANSLATE_NOOP("Button", "Menu Button"), |
232 | "devicebuttons/ipaq_menu", | 232 | "devicebuttons/ipaq_menu", |
233 | "QPE/TaskBar", "toggleMenu()", | 233 | "QPE/TaskBar", "toggleMenu()", |
234 | "QPE/TaskBar", "toggleStartMenu()" }, | 234 | "QPE/TaskBar", "toggleStartMenu()" }, |
235 | { Model_iPAQ_H38xx | Model_iPAQ_H39xx | Model_iPAQ_H5xxx, | 235 | { Model_iPAQ_H38xx | Model_iPAQ_H39xx | Model_iPAQ_H5xxx, |
236 | Qt::Key_F13, QT_TRANSLATE_NOOP("Button", "Mail Button"), | 236 | Qt::Key_F13, QT_TRANSLATE_NOOP("Button", "Mail Button"), |
237 | "devicebuttons/ipaq_mail", | 237 | "devicebuttons/ipaq_mail", |
238 | "mail", "raise()", | 238 | "mail", "raise()", |
239 | "mail", "newMail()" }, | 239 | "mail", "newMail()" }, |
240 | { Model_iPAQ_H31xx | Model_iPAQ_H36xx | Model_iPAQ_H37xx | Model_iPAQ_H38xx | Model_iPAQ_H39xx | Model_iPAQ_H5xxx, | 240 | { Model_iPAQ_H31xx | Model_iPAQ_H36xx | Model_iPAQ_H37xx | Model_iPAQ_H38xx | Model_iPAQ_H39xx | Model_iPAQ_H5xxx, |
241 | Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Home Button"), | 241 | Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Home Button"), |
242 | "devicebuttons/ipaq_home", | 242 | "devicebuttons/ipaq_home", |
243 | "QPE/Launcher", "home()", | 243 | "QPE/Launcher", "home()", |
244 | "buttonsettings", "raise()" }, | 244 | "buttonsettings", "raise()" }, |
245 | { Model_iPAQ_H31xx | Model_iPAQ_H36xx | Model_iPAQ_H37xx | Model_iPAQ_H38xx | Model_iPAQ_H39xx | Model_iPAQ_H5xxx, | 245 | { Model_iPAQ_H31xx | Model_iPAQ_H36xx | Model_iPAQ_H37xx | Model_iPAQ_H38xx | Model_iPAQ_H39xx | Model_iPAQ_H5xxx, |
246 | Qt::Key_F24, QT_TRANSLATE_NOOP("Button", "Record Button"), | 246 | Qt::Key_F24, QT_TRANSLATE_NOOP("Button", "Record Button"), |
247 | "devicebuttons/ipaq_record", | 247 | "devicebuttons/ipaq_record", |
248 | "QPE/VMemo", "toggleRecord()", | 248 | "QPE/VMemo", "toggleRecord()", |
249 | "sound", "raise()" }, | 249 | "sound", "raise()" }, |
250 | }; | 250 | }; |
251 | 251 | ||
252 | struct z_button { | 252 | struct z_button { |
253 | Qt::Key code; | 253 | Qt::Key code; |
254 | char *utext; | 254 | char *utext; |
255 | char *pix; | 255 | char *pix; |
256 | char *fpressedservice; | 256 | char *fpressedservice; |
257 | char *fpressedaction; | 257 | char *fpressedaction; |
258 | char *fheldservice; | 258 | char *fheldservice; |
259 | char *fheldaction; | 259 | char *fheldaction; |
260 | } z_buttons [] = { | 260 | } z_buttons [] = { |
261 | { Qt::Key_F9, QT_TRANSLATE_NOOP("Button", "Calendar Button"), | 261 | { Qt::Key_F9, QT_TRANSLATE_NOOP("Button", "Calendar Button"), |
262 | "devicebuttons/z_calendar", | 262 | "devicebuttons/z_calendar", |
263 | "datebook", "nextView()", | 263 | "datebook", "nextView()", |
264 | "today", "raise()" }, | 264 | "today", "raise()" }, |
265 | { Qt::Key_F10, QT_TRANSLATE_NOOP("Button", "Contacts Button"), | 265 | { Qt::Key_F10, QT_TRANSLATE_NOOP("Button", "Contacts Button"), |
266 | "devicebuttons/z_contact", | 266 | "devicebuttons/z_contact", |
267 | "addressbook", "raise()", | 267 | "addressbook", "raise()", |
268 | "addressbook", "beamBusinessCard()" }, | 268 | "addressbook", "beamBusinessCard()" }, |
269 | { Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Home Button"), | 269 | { Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Home Button"), |
270 | "devicebuttons/z_home", | 270 | "devicebuttons/z_home", |
271 | "QPE/Launcher", "home()", | 271 | "QPE/Launcher", "home()", |
272 | "buttonsettings", "raise()" }, | 272 | "buttonsettings", "raise()" }, |
273 | { Qt::Key_F11, QT_TRANSLATE_NOOP("Button", "Menu Button"), | 273 | { Qt::Key_F11, QT_TRANSLATE_NOOP("Button", "Menu Button"), |
274 | "devicebuttons/z_menu", | 274 | "devicebuttons/z_menu", |
275 | "QPE/TaskBar", "toggleMenu()", | 275 | "QPE/TaskBar", "toggleMenu()", |
276 | "QPE/TaskBar", "toggleStartMenu()" }, | 276 | "QPE/TaskBar", "toggleStartMenu()" }, |
277 | { Qt::Key_F13, QT_TRANSLATE_NOOP("Button", "Mail Button"), | 277 | { Qt::Key_F13, QT_TRANSLATE_NOOP("Button", "Mail Button"), |
278 | "devicebuttons/z_mail", | 278 | "devicebuttons/z_mail", |
279 | "mail", "raise()", | 279 | "mail", "raise()", |
280 | "mail", "newMail()" }, | 280 | "mail", "newMail()" }, |
281 | }; | 281 | }; |
282 | 282 | ||
283 | struct z_button z_buttons_c700 [] = { | 283 | struct z_button z_buttons_c700 [] = { |
284 | { Qt::Key_F9, QT_TRANSLATE_NOOP("Button", "Calendar Button"), | 284 | { Qt::Key_F9, QT_TRANSLATE_NOOP("Button", "Calendar Button"), |
285 | "devicebuttons/z_calendar", | 285 | "devicebuttons/z_calendar", |
286 | "datebook", "nextView()", | 286 | "datebook", "nextView()", |
287 | "today", "raise()" }, | 287 | "today", "raise()" }, |
288 | { Qt::Key_F10, QT_TRANSLATE_NOOP("Button", "Contacts Button"), | 288 | { Qt::Key_F10, QT_TRANSLATE_NOOP("Button", "Contacts Button"), |
289 | "devicebuttons/z_contact", | 289 | "devicebuttons/z_contact", |
290 | "addressbook", "raise()", | 290 | "addressbook", "raise()", |
291 | "addressbook", "beamBusinessCard()" }, | 291 | "addressbook", "beamBusinessCard()" }, |
292 | { Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Home Button"), | 292 | { Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Home Button"), |
293 | "devicebuttons/z_home", | 293 | "devicebuttons/z_home", |
294 | "QPE/Launcher", "home()", | 294 | "QPE/Launcher", "home()", |
295 | "buttonsettings", "raise()" }, | 295 | "buttonsettings", "raise()" }, |
296 | { Qt::Key_F11, QT_TRANSLATE_NOOP("Button", "Menu Button"), | 296 | { Qt::Key_F11, QT_TRANSLATE_NOOP("Button", "Menu Button"), |
297 | "devicebuttons/z_menu", | 297 | "devicebuttons/z_menu", |
298 | "QPE/TaskBar", "toggleMenu()", | 298 | "QPE/TaskBar", "toggleMenu()", |
299 | "QPE/TaskBar", "toggleStartMenu()" }, | 299 | "QPE/TaskBar", "toggleStartMenu()" }, |
300 | { Qt::Key_F14, QT_TRANSLATE_NOOP("Button", "Display Rotate"), | 300 | { Qt::Key_F14, QT_TRANSLATE_NOOP("Button", "Display Rotate"), |
301 | "", | 301 | "devicebuttons/z_hinge", |
302 | "QPE/Rotation", "rotateDefault()", | 302 | "QPE/Rotation", "rotateDefault()", |
303 | "QPE/Rotation", "rotateDefault()" }, | 303 | "QPE/Dummy", "doNothing()" }, |
304 | }; | 304 | }; |
305 | 305 | ||
306 | struct s_button { | 306 | struct s_button { |
307 | uint model; | 307 | uint model; |
308 | Qt::Key code; | 308 | Qt::Key code; |
309 | char *utext; | 309 | char *utext; |
310 | char *pix; | 310 | char *pix; |
311 | char *fpressedservice; | 311 | char *fpressedservice; |
312 | char *fpressedaction; | 312 | char *fpressedaction; |
313 | char *fheldservice; | 313 | char *fheldservice; |
314 | char *fheldaction; | 314 | char *fheldaction; |
315 | } simpad_buttons [] = { | 315 | } simpad_buttons [] = { |
316 | { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, | 316 | { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, |
317 | Qt::Key_F9, QT_TRANSLATE_NOOP("Button", "Lower+Up"), | 317 | Qt::Key_F9, QT_TRANSLATE_NOOP("Button", "Lower+Up"), |
318 | "devicebuttons/simpad_lower_up", | 318 | "devicebuttons/simpad_lower_up", |
319 | "datebook", "nextView()", | 319 | "datebook", "nextView()", |
320 | "today", "raise()" }, | 320 | "today", "raise()" }, |
321 | { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, | 321 | { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, |
322 | Qt::Key_F10, QT_TRANSLATE_NOOP("Button", "Lower+Down"), | 322 | Qt::Key_F10, QT_TRANSLATE_NOOP("Button", "Lower+Down"), |
323 | "devicebuttons/simpad_lower_down", | 323 | "devicebuttons/simpad_lower_down", |
324 | "addressbook", "raise()", | 324 | "addressbook", "raise()", |
325 | "addressbook", "beamBusinessCard()" }, | 325 | "addressbook", "beamBusinessCard()" }, |
326 | { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, | 326 | { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, |
327 | Qt::Key_F11, QT_TRANSLATE_NOOP("Button", "Lower+Right"), | 327 | Qt::Key_F11, QT_TRANSLATE_NOOP("Button", "Lower+Right"), |
328 | "devicebuttons/simpad_lower_right", | 328 | "devicebuttons/simpad_lower_right", |
329 | "QPE/TaskBar", "toggleMenu()", | 329 | "QPE/TaskBar", "toggleMenu()", |
330 | "QPE/TaskBar", "toggleStartMenu()" }, | 330 | "QPE/TaskBar", "toggleStartMenu()" }, |
331 | { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, | 331 | { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, |
332 | Qt::Key_F13, QT_TRANSLATE_NOOP("Button", "Lower+Left"), | 332 | Qt::Key_F13, QT_TRANSLATE_NOOP("Button", "Lower+Left"), |
333 | "devicebuttons/simpad_lower_left", | 333 | "devicebuttons/simpad_lower_left", |
334 | "mail", "raise()", | 334 | "mail", "raise()", |
335 | "mail", "newMail()" }, | 335 | "mail", "newMail()" }, |
336 | 336 | ||
337 | { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, | 337 | { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, |
338 | Qt::Key_F5, QT_TRANSLATE_NOOP("Button", "Upper+Up"), | 338 | Qt::Key_F5, QT_TRANSLATE_NOOP("Button", "Upper+Up"), |
339 | "devicebuttons/simpad_upper_up", | 339 | "devicebuttons/simpad_upper_up", |
340 | "QPE/Launcher", "home()", | 340 | "QPE/Launcher", "home()", |
341 | "buttonsettings", "raise()" }, | 341 | "buttonsettings", "raise()" }, |
342 | { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, | 342 | { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, |
343 | Qt::Key_F6, QT_TRANSLATE_NOOP("Button", "Upper+Down"), | 343 | Qt::Key_F6, QT_TRANSLATE_NOOP("Button", "Upper+Down"), |
344 | "devicebuttons/simpad_upper_down", | 344 | "devicebuttons/simpad_upper_down", |
345 | "addressbook", "raise()", | 345 | "addressbook", "raise()", |
346 | "addressbook", "beamBusinessCard()" }, | 346 | "addressbook", "beamBusinessCard()" }, |
347 | { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, | 347 | { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, |
348 | Qt::Key_F7, QT_TRANSLATE_NOOP("Button", "Upper+Right"), | 348 | Qt::Key_F7, QT_TRANSLATE_NOOP("Button", "Upper+Right"), |
349 | "devicebuttons/simpad_upper_right", | 349 | "devicebuttons/simpad_upper_right", |
350 | "QPE/TaskBar", "toggleMenu()", | 350 | "QPE/TaskBar", "toggleMenu()", |
351 | "QPE/TaskBar", "toggleStartMenu()" }, | 351 | "QPE/TaskBar", "toggleStartMenu()" }, |
352 | { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, | 352 | { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, |
353 | Qt::Key_F13, QT_TRANSLATE_NOOP("Button", "Upper+Left"), | 353 | Qt::Key_F13, QT_TRANSLATE_NOOP("Button", "Upper+Left"), |
354 | "devicebuttons/simpad_upper_left", | 354 | "devicebuttons/simpad_upper_left", |
355 | "QPE/Rotation", "flip()", | 355 | "QPE/Rotation", "flip()", |
356 | "QPE/Rotation", "flip()" }, | 356 | "QPE/Rotation", "flip()" }, |
357 | /* | 357 | /* |
358 | { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, | 358 | { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, |
359 | Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Lower+Upper"), | 359 | Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Lower+Upper"), |
360 | "devicebuttons/simpad_lower_upper", | 360 | "devicebuttons/simpad_lower_upper", |
361 | "QPE/Launcher", "home()", | 361 | "QPE/Launcher", "home()", |
362 | "buttonsettings", "raise()" }, | 362 | "buttonsettings", "raise()" }, |
363 | { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, | 363 | { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, |
364 | Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Lower+Upper"), | 364 | Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Lower+Upper"), |
365 | "devicebuttons/simpad_upper_lower", | 365 | "devicebuttons/simpad_upper_lower", |
366 | "QPE/Launcher", "home()", | 366 | "QPE/Launcher", "home()", |
367 | "buttonsettings", "raise()" }, | 367 | "buttonsettings", "raise()" }, |
368 | */ | 368 | */ |
369 | }; | 369 | }; |
370 | 370 | ||
371 | struct r_button { | 371 | struct r_button { |
372 | uint model; | 372 | uint model; |
373 | Qt::Key code; | 373 | Qt::Key code; |
374 | char *utext; | 374 | char *utext; |
375 | char *pix; | 375 | char *pix; |
376 | char *fpressedservice; | 376 | char *fpressedservice; |
377 | char *fpressedaction; | 377 | char *fpressedaction; |
378 | char *fheldservice; | 378 | char *fheldservice; |
379 | char *fheldaction; | 379 | char *fheldaction; |
380 | } ramses_buttons [] = { | 380 | } ramses_buttons [] = { |
381 | { Model_Ramses_MNCI, | 381 | { Model_Ramses_MNCI, |
382 | Qt::Key_F11, QT_TRANSLATE_NOOP("Button", "Menu Button"), | 382 | Qt::Key_F11, QT_TRANSLATE_NOOP("Button", "Menu Button"), |
383 | "devicebuttons/z_menu", | 383 | "devicebuttons/z_menu", |
384 | "QPE/TaskBar", "toggleMenu()", | 384 | "QPE/TaskBar", "toggleMenu()", |
385 | "QPE/TaskBar", "toggleStartMenu()" }, | 385 | "QPE/TaskBar", "toggleStartMenu()" }, |
386 | { Model_Ramses_MNCI, | 386 | { Model_Ramses_MNCI, |
387 | Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Home Button"), | 387 | Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Home Button"), |
388 | "devicebuttons/ipaq_home", | 388 | "devicebuttons/ipaq_home", |
389 | "QPE/Launcher", "home()", | 389 | "QPE/Launcher", "home()", |
390 | "buttonsettings", "raise()" }, | 390 | "buttonsettings", "raise()" }, |
391 | }; | 391 | }; |
392 | 392 | ||
393 | class Yopy : public ODevice { | 393 | class Yopy : public ODevice { |
394 | protected: | 394 | protected: |
395 | virtual void init ( ); | 395 | virtual void init ( ); |
396 | virtual void initButtons ( ); | 396 | virtual void initButtons ( ); |
397 | 397 | ||
398 | public: | 398 | public: |
399 | virtual bool suspend ( ); | 399 | virtual bool suspend ( ); |
400 | 400 | ||
401 | virtual bool setDisplayBrightness ( int b ); | 401 | virtual bool setDisplayBrightness ( int b ); |
402 | virtual int displayBrightnessResolution ( ) const; | 402 | virtual int displayBrightnessResolution ( ) const; |
403 | 403 | ||
404 | static bool isYopy ( ); | 404 | static bool isYopy ( ); |
405 | }; | 405 | }; |
406 | 406 | ||
407 | struct yopy_button { | 407 | struct yopy_button { |
408 | Qt::Key code; | 408 | Qt::Key code; |
409 | char *utext; | 409 | char *utext; |
410 | char *pix; | 410 | char *pix; |
411 | char *fpressedservice; | 411 | char *fpressedservice; |
412 | char *fpressedaction; | 412 | char *fpressedaction; |
413 | char *fheldservice; | 413 | char *fheldservice; |
414 | char *fheldaction; | 414 | char *fheldaction; |
415 | } yopy_buttons [] = { | 415 | } yopy_buttons [] = { |
416 | { Qt::Key_F10, QT_TRANSLATE_NOOP("Button", "Action Button"), | 416 | { Qt::Key_F10, QT_TRANSLATE_NOOP("Button", "Action Button"), |
417 | "devicebuttons/yopy_action", | 417 | "devicebuttons/yopy_action", |
418 | "datebook", "nextView()", | 418 | "datebook", "nextView()", |
419 | "today", "raise()" }, | 419 | "today", "raise()" }, |
420 | { Qt::Key_F11, QT_TRANSLATE_NOOP("Button", "OK Button"), | 420 | { Qt::Key_F11, QT_TRANSLATE_NOOP("Button", "OK Button"), |
421 | "devicebuttons/yopy_ok", | 421 | "devicebuttons/yopy_ok", |
422 | "addressbook", "raise()", | 422 | "addressbook", "raise()", |
423 | "addressbook", "beamBusinessCard()" }, | 423 | "addressbook", "beamBusinessCard()" }, |
424 | { Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "End Button"), | 424 | { Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "End Button"), |
425 | "devicebuttons/yopy_end", | 425 | "devicebuttons/yopy_end", |
426 | "QPE/Launcher", "home()", | 426 | "QPE/Launcher", "home()", |
427 | "buttonsettings", "raise()" }, | 427 | "buttonsettings", "raise()" }, |
428 | }; | 428 | }; |
429 | 429 | ||
430 | static QCString makeChannel ( const char *str ) | 430 | static QCString makeChannel ( const char *str ) |
431 | { | 431 | { |
432 | if ( str && !::strchr ( str, '/' )) | 432 | if ( str && !::strchr ( str, '/' )) |
433 | return QCString ( "QPE/Application/" ) + str; | 433 | return QCString ( "QPE/Application/" ) + str; |
434 | else | 434 | else |
435 | return str; | 435 | return str; |
436 | } | 436 | } |
437 | 437 | ||
438 | static inline bool isQWS() | 438 | static inline bool isQWS() |
439 | { | 439 | { |
440 | return qApp ? ( qApp-> type ( ) == QApplication::GuiServer ) : false; | 440 | return qApp ? ( qApp-> type ( ) == QApplication::GuiServer ) : false; |
441 | } | 441 | } |
442 | 442 | ||
443 | ODevice *ODevice::inst ( ) | 443 | ODevice *ODevice::inst ( ) |
444 | { | 444 | { |
445 | static ODevice *dev = 0; | 445 | static ODevice *dev = 0; |
446 | 446 | ||
447 | if ( !dev ) { | 447 | if ( !dev ) { |
448 | if ( QFile::exists ( "/proc/hal/model" )) | 448 | if ( QFile::exists ( "/proc/hal/model" )) |
449 | dev = new iPAQ ( ); | 449 | dev = new iPAQ ( ); |
450 | else if ( Zaurus::isZaurus() ) | 450 | else if ( Zaurus::isZaurus() ) |
451 | dev = new Zaurus ( ); | 451 | dev = new Zaurus ( ); |
452 | else if ( QFile::exists ( "/proc/ucb1x00" ) && QFile::exists ( "/proc/cs3" )) | 452 | else if ( QFile::exists ( "/proc/ucb1x00" ) && QFile::exists ( "/proc/cs3" )) |
453 | dev = new SIMpad ( ); | 453 | dev = new SIMpad ( ); |
454 | else if ( QFile::exists ( "/proc/sys/board/name" )) | 454 | else if ( QFile::exists ( "/proc/sys/board/name" )) |
455 | dev = new Ramses ( ); | 455 | dev = new Ramses ( ); |
456 | else if ( Yopy::isYopy() ) | 456 | else if ( Yopy::isYopy() ) |
457 | dev = new Yopy ( ); | 457 | dev = new Yopy ( ); |
458 | else if ( Jornada::isJornada() ) | 458 | else if ( Jornada::isJornada() ) |
459 | dev = new Jornada ( ); | 459 | dev = new Jornada ( ); |
460 | else | 460 | else |
461 | dev = new ODevice ( ); | 461 | dev = new ODevice ( ); |
462 | dev-> init ( ); | 462 | dev-> init ( ); |
463 | } | 463 | } |
464 | return dev; | 464 | return dev; |
465 | } | 465 | } |
466 | 466 | ||
467 | 467 | ||
468 | /************************************************** | 468 | /************************************************** |
469 | * | 469 | * |
470 | * common | 470 | * common |
471 | * | 471 | * |
472 | **************************************************/ | 472 | **************************************************/ |
473 | 473 | ||
474 | 474 | ||
475 | ODevice::ODevice ( ) | 475 | ODevice::ODevice ( ) |
476 | { | 476 | { |
477 | d = new ODeviceData; | 477 | d = new ODeviceData; |
478 | 478 | ||
479 | d-> m_modelstr = "Unknown"; | 479 | d-> m_modelstr = "Unknown"; |
480 | d-> m_model = Model_Unknown; | 480 | d-> m_model = Model_Unknown; |
481 | d-> m_vendorstr = "Unknown"; | 481 | d-> m_vendorstr = "Unknown"; |
482 | d-> m_vendor = Vendor_Unknown; | 482 | d-> m_vendor = Vendor_Unknown; |
483 | d-> m_systemstr = "Unknown"; | 483 | d-> m_systemstr = "Unknown"; |
484 | d-> m_system = System_Unknown; | 484 | d-> m_system = System_Unknown; |
485 | d-> m_sysverstr = "0.0"; | 485 | d-> m_sysverstr = "0.0"; |
486 | d-> m_rotation = Rot0; | 486 | d-> m_rotation = Rot0; |
487 | d-> m_direction = CW; | 487 | d-> m_direction = CW; |
488 | 488 | ||
489 | d-> m_holdtime = 1000; // 1000ms | 489 | d-> m_holdtime = 1000; // 1000ms |
490 | d-> m_buttons = 0; | 490 | d-> m_buttons = 0; |
491 | d-> m_cpu_frequencies = new QStrList; | 491 | d-> m_cpu_frequencies = new QStrList; |
492 | } | 492 | } |
493 | 493 | ||
494 | void ODevice::systemMessage ( const QCString &msg, const QByteArray & ) | 494 | void ODevice::systemMessage ( const QCString &msg, const QByteArray & ) |
495 | { | 495 | { |