author | chicken <chicken> | 2004-03-01 15:44:36 (UTC) |
---|---|---|
committer | chicken <chicken> | 2004-03-01 15:44:36 (UTC) |
commit | c50e4c32d34a0550f167480b6306aac632fb201c (patch) (unidiff) | |
tree | a0795fa171d7410624717f120d1bd17f6c8f3224 /libopie/odevice.cpp | |
parent | 01abceaeb00bc35fa9bf5792eb51aa70b68f110d (diff) | |
download | opie-c50e4c32d34a0550f167480b6306aac632fb201c.zip opie-c50e4c32d34a0550f167480b6306aac632fb201c.tar.gz opie-c50e4c32d34a0550f167480b6306aac632fb201c.tar.bz2 |
fix includes
-rw-r--r-- | libopie/odevice.cpp | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/libopie/odevice.cpp b/libopie/odevice.cpp index c5342e1..c0b6efa 100644 --- a/libopie/odevice.cpp +++ b/libopie/odevice.cpp | |||
@@ -1,415 +1,414 @@ | |||
1 | /* This file is part of the OPIE libraries | 1 | /* This file is part of the OPIE libraries |
2 | Copyright (C) 2002 Robert Griebl (sandman@handhelds.org) | 2 | Copyright (C) 2002 Robert Griebl (sandman@handhelds.org) |
3 | 3 | ||
4 | This library is free software; you can redistribute it and/or | 4 | This library is free software; you can redistribute it and/or |
5 | modify it under the terms of the GNU Library General Public | 5 | modify it under the terms of the GNU Library General Public |
6 | License as published by the Free Software Foundation; either | 6 | License as published by the Free Software Foundation; either |
7 | version 2 of the License, or (at your option) any later version. | 7 | version 2 of the License, or (at your option) any later version. |
8 | 8 | ||
9 | This library is distributed in the hope that it will be useful, | 9 | This library is distributed in the hope that it will be useful, |
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
12 | Library General Public License for more details. | 12 | Library General Public License for more details. |
13 | 13 | ||
14 | You should have received a copy of the GNU Library General Public License | 14 | You should have received a copy of the GNU Library General Public License |
15 | along with this library; see the file COPYING.LIB. If not, write to | 15 | along with this library; see the file COPYING.LIB. If not, write to |
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> | ||
32 | 31 | ||
33 | #include <qfile.h> | 32 | #include <qfile.h> |
34 | #include <qtextstream.h> | 33 | #include <qtextstream.h> |
35 | #include <qpe/sound.h> | 34 | #include <qpe/sound.h> |
36 | #include <qpe/resource.h> | 35 | #include <qpe/resource.h> |
37 | #include <qpe/config.h> | 36 | #include <qpe/config.h> |
38 | #include <qpe/qcopenvelope_qws.h> | 37 | #include <qpe/qcopenvelope_qws.h> |
39 | 38 | ||
40 | #include "odevice.h" | 39 | #include "odevice.h" |
41 | 40 | ||
42 | #include <qwindowsystem_qws.h> | 41 | #include <qwindowsystem_qws.h> |
43 | 42 | ||
44 | #ifndef ARRAY_SIZE | 43 | #ifndef ARRAY_SIZE |
45 | #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) | 44 | #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) |
46 | #endif | 45 | #endif |
47 | 46 | ||
48 | // _IO and friends are only defined in kernel headers ... | 47 | // _IO and friends are only defined in kernel headers ... |
49 | 48 | ||
50 | #define OD_IOC(dir,type,number,size) (( dir << 30 ) | ( type << 8 ) | ( number ) | ( size << 16 )) | 49 | #define OD_IOC(dir,type,number,size) (( dir << 30 ) | ( type << 8 ) | ( number ) | ( size << 16 )) |
51 | 50 | ||
52 | #define OD_IO(type,number) OD_IOC(0,type,number,0) | 51 | #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)) | 52 | #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)) | 53 | #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)) | 54 | #define OD_IORW(type,number,size) OD_IOC(3,type,number,sizeof(size)) |
56 | 55 | ||
57 | using namespace Opie; | 56 | using namespace Opie; |
58 | 57 | ||
59 | class ODeviceData { | 58 | class ODeviceData { |
60 | public: | 59 | public: |
61 | QString m_vendorstr; | 60 | QString m_vendorstr; |
62 | OVendor m_vendor; | 61 | OVendor m_vendor; |
63 | 62 | ||
64 | QString m_modelstr; | 63 | QString m_modelstr; |
65 | OModel m_model; | 64 | OModel m_model; |
66 | 65 | ||
67 | QString m_systemstr; | 66 | QString m_systemstr; |
68 | OSystem m_system; | 67 | OSystem m_system; |
69 | 68 | ||
70 | QString m_sysverstr; | 69 | QString m_sysverstr; |
71 | 70 | ||
72 | Transformation m_rotation; | 71 | Transformation m_rotation; |
73 | ODirection m_direction; | 72 | ODirection m_direction; |
74 | 73 | ||
75 | QValueList <ODeviceButton> *m_buttons; | 74 | QValueList <ODeviceButton> *m_buttons; |
76 | uint m_holdtime; | 75 | uint m_holdtime; |
77 | QStrList *m_cpu_frequencies; | 76 | QStrList *m_cpu_frequencies; |
78 | 77 | ||
79 | }; | 78 | }; |
80 | 79 | ||
81 | class iPAQ : public ODevice, public QWSServer::KeyboardFilter { | 80 | class iPAQ : public ODevice, public QWSServer::KeyboardFilter { |
82 | protected: | 81 | protected: |
83 | virtual void init ( ); | 82 | virtual void init ( ); |
84 | virtual void initButtons ( ); | 83 | virtual void initButtons ( ); |
85 | 84 | ||
86 | public: | 85 | public: |
87 | virtual bool setSoftSuspend ( bool soft ); | 86 | virtual bool setSoftSuspend ( bool soft ); |
88 | 87 | ||
89 | virtual bool setDisplayBrightness ( int b ); | 88 | virtual bool setDisplayBrightness ( int b ); |
90 | virtual int displayBrightnessResolution ( ) const; | 89 | virtual int displayBrightnessResolution ( ) const; |
91 | 90 | ||
92 | virtual void alarmSound ( ); | 91 | virtual void alarmSound ( ); |
93 | 92 | ||
94 | virtual QValueList <OLed> ledList ( ) const; | 93 | virtual QValueList <OLed> ledList ( ) const; |
95 | virtual QValueList <OLedState> ledStateList ( OLed led ) const; | 94 | virtual QValueList <OLedState> ledStateList ( OLed led ) const; |
96 | virtual OLedState ledState ( OLed led ) const; | 95 | virtual OLedState ledState ( OLed led ) const; |
97 | virtual bool setLedState ( OLed led, OLedState st ); | 96 | virtual bool setLedState ( OLed led, OLedState st ); |
98 | 97 | ||
99 | virtual bool hasLightSensor ( ) const; | 98 | virtual bool hasLightSensor ( ) const; |
100 | virtual int readLightSensor ( ); | 99 | virtual int readLightSensor ( ); |
101 | virtual int lightSensorResolution ( ) const; | 100 | virtual int lightSensorResolution ( ) const; |
102 | 101 | ||
103 | protected: | 102 | protected: |
104 | 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 ); |
105 | virtual void timerEvent ( QTimerEvent *te ); | 104 | virtual void timerEvent ( QTimerEvent *te ); |
106 | 105 | ||
107 | int m_power_timer; | 106 | int m_power_timer; |
108 | 107 | ||
109 | OLedState m_leds [2]; | 108 | OLedState m_leds [2]; |
110 | }; | 109 | }; |
111 | 110 | ||
112 | class Jornada : public ODevice { | 111 | class Jornada : public ODevice { |
113 | protected: | 112 | protected: |
114 | virtual void init ( ); | 113 | virtual void init ( ); |
115 | //virtual void initButtons ( ); | 114 | //virtual void initButtons ( ); |
116 | public: | 115 | public: |
117 | virtual bool setSoftSuspend ( bool soft ); | 116 | virtual bool setSoftSuspend ( bool soft ); |
118 | virtual bool setDisplayBrightness ( int b ); | 117 | virtual bool setDisplayBrightness ( int b ); |
119 | virtual int displayBrightnessResolution ( ) const; | 118 | virtual int displayBrightnessResolution ( ) const; |
120 | static bool isJornada(); | 119 | static bool isJornada(); |
121 | 120 | ||
122 | }; | 121 | }; |
123 | 122 | ||
124 | class Zaurus : public ODevice { | 123 | class Zaurus : public ODevice { |
125 | protected: | 124 | protected: |
126 | virtual void init ( ); | 125 | virtual void init ( ); |
127 | virtual void initButtons ( ); | 126 | virtual void initButtons ( ); |
128 | 127 | ||
129 | public: | 128 | public: |
130 | virtual bool setSoftSuspend ( bool soft ); | 129 | virtual bool setSoftSuspend ( bool soft ); |
131 | 130 | ||
132 | virtual bool setDisplayBrightness ( int b ); | 131 | virtual bool setDisplayBrightness ( int b ); |
133 | virtual int displayBrightnessResolution ( ) const; | 132 | virtual int displayBrightnessResolution ( ) const; |
134 | 133 | ||
135 | virtual void alarmSound ( ); | 134 | virtual void alarmSound ( ); |
136 | virtual void keySound ( ); | 135 | virtual void keySound ( ); |
137 | virtual void touchSound ( ); | 136 | virtual void touchSound ( ); |
138 | 137 | ||
139 | virtual QValueList <OLed> ledList ( ) const; | 138 | virtual QValueList <OLed> ledList ( ) const; |
140 | virtual QValueList <OLedState> ledStateList ( OLed led ) const; | 139 | virtual QValueList <OLedState> ledStateList ( OLed led ) const; |
141 | virtual OLedState ledState ( OLed led ) const; | 140 | virtual OLedState ledState ( OLed led ) const; |
142 | virtual bool setLedState ( OLed led, OLedState st ); | 141 | virtual bool setLedState ( OLed led, OLedState st ); |
143 | 142 | ||
144 | bool hasHingeSensor() const; | 143 | bool hasHingeSensor() const; |
145 | OHingeStatus readHingeSensor(); | 144 | OHingeStatus readHingeSensor(); |
146 | 145 | ||
147 | static bool isZaurus(); | 146 | static bool isZaurus(); |
148 | 147 | ||
149 | // Does this break BC? | 148 | // Does this break BC? |
150 | virtual bool suspend ( ); | 149 | virtual bool suspend ( ); |
151 | Transformation rotation ( ) const; | 150 | Transformation rotation ( ) const; |
152 | ODirection direction ( ) const; | 151 | ODirection direction ( ) const; |
153 | 152 | ||
154 | protected: | 153 | protected: |
155 | virtual void buzzer ( int snd ); | 154 | virtual void buzzer ( int snd ); |
156 | 155 | ||
157 | OLedState m_leds [1]; | 156 | OLedState m_leds [1]; |
158 | bool m_embedix; | 157 | bool m_embedix; |
159 | void virtual_hook( int id, void *data ); | 158 | void virtual_hook( int id, void *data ); |
160 | }; | 159 | }; |
161 | 160 | ||
162 | class SIMpad : public ODevice, public QWSServer::KeyboardFilter { | 161 | class SIMpad : public ODevice, public QWSServer::KeyboardFilter { |
163 | protected: | 162 | protected: |
164 | virtual void init ( ); | 163 | virtual void init ( ); |
165 | virtual void initButtons ( ); | 164 | virtual void initButtons ( ); |
166 | 165 | ||
167 | public: | 166 | public: |
168 | virtual bool setSoftSuspend ( bool soft ); | 167 | virtual bool setSoftSuspend ( bool soft ); |
169 | virtual bool suspend(); | 168 | virtual bool suspend(); |
170 | 169 | ||
171 | virtual bool setDisplayStatus( bool on ); | 170 | virtual bool setDisplayStatus( bool on ); |
172 | virtual bool setDisplayBrightness ( int b ); | 171 | virtual bool setDisplayBrightness ( int b ); |
173 | virtual int displayBrightnessResolution ( ) const; | 172 | virtual int displayBrightnessResolution ( ) const; |
174 | 173 | ||
175 | virtual void alarmSound ( ); | 174 | virtual void alarmSound ( ); |
176 | 175 | ||
177 | virtual QValueList <OLed> ledList ( ) const; | 176 | virtual QValueList <OLed> ledList ( ) const; |
178 | virtual QValueList <OLedState> ledStateList ( OLed led ) const; | 177 | virtual QValueList <OLedState> ledStateList ( OLed led ) const; |
179 | virtual OLedState ledState ( OLed led ) const; | 178 | virtual OLedState ledState ( OLed led ) const; |
180 | virtual bool setLedState ( OLed led, OLedState st ); | 179 | virtual bool setLedState ( OLed led, OLedState st ); |
181 | 180 | ||
182 | protected: | 181 | protected: |
183 | virtual bool filter ( int unicode, int keycode, int modifiers, bool isPress, bool autoRepeat ); | 182 | virtual bool filter ( int unicode, int keycode, int modifiers, bool isPress, bool autoRepeat ); |
184 | virtual void timerEvent ( QTimerEvent *te ); | 183 | virtual void timerEvent ( QTimerEvent *te ); |
185 | 184 | ||
186 | int m_power_timer; | 185 | int m_power_timer; |
187 | 186 | ||
188 | OLedState m_leds [1]; //FIXME check if really only one | 187 | OLedState m_leds [1]; //FIXME check if really only one |
189 | }; | 188 | }; |
190 | 189 | ||
191 | class Ramses : public ODevice, public QWSServer::KeyboardFilter { | 190 | class Ramses : public ODevice, public QWSServer::KeyboardFilter { |
192 | protected: | 191 | protected: |
193 | virtual void init ( ); | 192 | virtual void init ( ); |
194 | 193 | ||
195 | public: | 194 | public: |
196 | virtual bool setSoftSuspend ( bool soft ); | 195 | virtual bool setSoftSuspend ( bool soft ); |
197 | virtual bool suspend ( ); | 196 | virtual bool suspend ( ); |
198 | 197 | ||
199 | virtual bool setDisplayStatus( bool on ); | 198 | virtual bool setDisplayStatus( bool on ); |
200 | virtual bool setDisplayBrightness ( int b ); | 199 | virtual bool setDisplayBrightness ( int b ); |
201 | virtual int displayBrightnessResolution ( ) const; | 200 | virtual int displayBrightnessResolution ( ) const; |
202 | virtual bool setDisplayContrast ( int b ); | 201 | virtual bool setDisplayContrast ( int b ); |
203 | virtual int displayContrastResolution ( ) const; | 202 | virtual int displayContrastResolution ( ) const; |
204 | 203 | ||
205 | protected: | 204 | protected: |
206 | virtual bool filter ( int unicode, int keycode, int modifiers, bool isPress, bool autoRepeat ); | 205 | virtual bool filter ( int unicode, int keycode, int modifiers, bool isPress, bool autoRepeat ); |
207 | virtual void timerEvent ( QTimerEvent *te ); | 206 | virtual void timerEvent ( QTimerEvent *te ); |
208 | 207 | ||
209 | int m_power_timer; | 208 | int m_power_timer; |
210 | }; | 209 | }; |
211 | 210 | ||
212 | struct i_button { | 211 | struct i_button { |
213 | uint model; | 212 | uint model; |
214 | Qt::Key code; | 213 | Qt::Key code; |
215 | char *utext; | 214 | char *utext; |
216 | char *pix; | 215 | char *pix; |
217 | char *fpressedservice; | 216 | char *fpressedservice; |
218 | char *fpressedaction; | 217 | char *fpressedaction; |
219 | char *fheldservice; | 218 | char *fheldservice; |
220 | char *fheldaction; | 219 | char *fheldaction; |
221 | } ipaq_buttons [] = { | 220 | } ipaq_buttons [] = { |
222 | { Model_iPAQ_H31xx | Model_iPAQ_H36xx | Model_iPAQ_H37xx | Model_iPAQ_H38xx | Model_iPAQ_H39xx | Model_iPAQ_H5xxx, | 221 | { Model_iPAQ_H31xx | Model_iPAQ_H36xx | Model_iPAQ_H37xx | Model_iPAQ_H38xx | Model_iPAQ_H39xx | Model_iPAQ_H5xxx, |
223 | Qt::Key_F9, QT_TRANSLATE_NOOP("Button", "Calendar Button"), | 222 | Qt::Key_F9, QT_TRANSLATE_NOOP("Button", "Calendar Button"), |
224 | "devicebuttons/ipaq_calendar", | 223 | "devicebuttons/ipaq_calendar", |
225 | "datebook", "nextView()", | 224 | "datebook", "nextView()", |
226 | "today", "raise()" }, | 225 | "today", "raise()" }, |
227 | { Model_iPAQ_H31xx | Model_iPAQ_H36xx | Model_iPAQ_H37xx | Model_iPAQ_H38xx | Model_iPAQ_H39xx | Model_iPAQ_H5xxx, | 226 | { Model_iPAQ_H31xx | Model_iPAQ_H36xx | Model_iPAQ_H37xx | Model_iPAQ_H38xx | Model_iPAQ_H39xx | Model_iPAQ_H5xxx, |
228 | Qt::Key_F10, QT_TRANSLATE_NOOP("Button", "Contacts Button"), | 227 | Qt::Key_F10, QT_TRANSLATE_NOOP("Button", "Contacts Button"), |
229 | "devicebuttons/ipaq_contact", | 228 | "devicebuttons/ipaq_contact", |
230 | "addressbook", "raise()", | 229 | "addressbook", "raise()", |
231 | "addressbook", "beamBusinessCard()" }, | 230 | "addressbook", "beamBusinessCard()" }, |
232 | { Model_iPAQ_H31xx | Model_iPAQ_H36xx | Model_iPAQ_H37xx, | 231 | { Model_iPAQ_H31xx | Model_iPAQ_H36xx | Model_iPAQ_H37xx, |
233 | Qt::Key_F11, QT_TRANSLATE_NOOP("Button", "Menu Button"), | 232 | Qt::Key_F11, QT_TRANSLATE_NOOP("Button", "Menu Button"), |
234 | "devicebuttons/ipaq_menu", | 233 | "devicebuttons/ipaq_menu", |
235 | "QPE/TaskBar", "toggleMenu()", | 234 | "QPE/TaskBar", "toggleMenu()", |
236 | "QPE/TaskBar", "toggleStartMenu()" }, | 235 | "QPE/TaskBar", "toggleStartMenu()" }, |
237 | { Model_iPAQ_H38xx | Model_iPAQ_H39xx | Model_iPAQ_H5xxx, | 236 | { Model_iPAQ_H38xx | Model_iPAQ_H39xx | Model_iPAQ_H5xxx, |
238 | Qt::Key_F13, QT_TRANSLATE_NOOP("Button", "Mail Button"), | 237 | Qt::Key_F13, QT_TRANSLATE_NOOP("Button", "Mail Button"), |
239 | "devicebuttons/ipaq_mail", | 238 | "devicebuttons/ipaq_mail", |
240 | "mail", "raise()", | 239 | "mail", "raise()", |
241 | "mail", "newMail()" }, | 240 | "mail", "newMail()" }, |
242 | { Model_iPAQ_H31xx | Model_iPAQ_H36xx | Model_iPAQ_H37xx | Model_iPAQ_H38xx | Model_iPAQ_H39xx | Model_iPAQ_H5xxx, | 241 | { Model_iPAQ_H31xx | Model_iPAQ_H36xx | Model_iPAQ_H37xx | Model_iPAQ_H38xx | Model_iPAQ_H39xx | Model_iPAQ_H5xxx, |
243 | Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Home Button"), | 242 | Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Home Button"), |
244 | "devicebuttons/ipaq_home", | 243 | "devicebuttons/ipaq_home", |
245 | "QPE/Launcher", "home()", | 244 | "QPE/Launcher", "home()", |
246 | "buttonsettings", "raise()" }, | 245 | "buttonsettings", "raise()" }, |
247 | { Model_iPAQ_H31xx | Model_iPAQ_H36xx | Model_iPAQ_H37xx | Model_iPAQ_H38xx | Model_iPAQ_H39xx | Model_iPAQ_H5xxx, | 246 | { Model_iPAQ_H31xx | Model_iPAQ_H36xx | Model_iPAQ_H37xx | Model_iPAQ_H38xx | Model_iPAQ_H39xx | Model_iPAQ_H5xxx, |
248 | Qt::Key_F24, QT_TRANSLATE_NOOP("Button", "Record Button"), | 247 | Qt::Key_F24, QT_TRANSLATE_NOOP("Button", "Record Button"), |
249 | "devicebuttons/ipaq_record", | 248 | "devicebuttons/ipaq_record", |
250 | "QPE/VMemo", "toggleRecord()", | 249 | "QPE/VMemo", "toggleRecord()", |
251 | "sound", "raise()" }, | 250 | "sound", "raise()" }, |
252 | }; | 251 | }; |
253 | 252 | ||
254 | struct z_button { | 253 | struct z_button { |
255 | Qt::Key code; | 254 | Qt::Key code; |
256 | char *utext; | 255 | char *utext; |
257 | char *pix; | 256 | char *pix; |
258 | char *fpressedservice; | 257 | char *fpressedservice; |
259 | char *fpressedaction; | 258 | char *fpressedaction; |
260 | char *fheldservice; | 259 | char *fheldservice; |
261 | char *fheldaction; | 260 | char *fheldaction; |
262 | } z_buttons [] = { | 261 | } z_buttons [] = { |
263 | { Qt::Key_F9, QT_TRANSLATE_NOOP("Button", "Calendar Button"), | 262 | { Qt::Key_F9, QT_TRANSLATE_NOOP("Button", "Calendar Button"), |
264 | "devicebuttons/z_calendar", | 263 | "devicebuttons/z_calendar", |
265 | "datebook", "nextView()", | 264 | "datebook", "nextView()", |
266 | "today", "raise()" }, | 265 | "today", "raise()" }, |
267 | { Qt::Key_F10, QT_TRANSLATE_NOOP("Button", "Contacts Button"), | 266 | { Qt::Key_F10, QT_TRANSLATE_NOOP("Button", "Contacts Button"), |
268 | "devicebuttons/z_contact", | 267 | "devicebuttons/z_contact", |
269 | "addressbook", "raise()", | 268 | "addressbook", "raise()", |
270 | "addressbook", "beamBusinessCard()" }, | 269 | "addressbook", "beamBusinessCard()" }, |
271 | { Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Home Button"), | 270 | { Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Home Button"), |
272 | "devicebuttons/z_home", | 271 | "devicebuttons/z_home", |
273 | "QPE/Launcher", "home()", | 272 | "QPE/Launcher", "home()", |
274 | "buttonsettings", "raise()" }, | 273 | "buttonsettings", "raise()" }, |
275 | { Qt::Key_F11, QT_TRANSLATE_NOOP("Button", "Menu Button"), | 274 | { Qt::Key_F11, QT_TRANSLATE_NOOP("Button", "Menu Button"), |
276 | "devicebuttons/z_menu", | 275 | "devicebuttons/z_menu", |
277 | "QPE/TaskBar", "toggleMenu()", | 276 | "QPE/TaskBar", "toggleMenu()", |
278 | "QPE/TaskBar", "toggleStartMenu()" }, | 277 | "QPE/TaskBar", "toggleStartMenu()" }, |
279 | { Qt::Key_F13, QT_TRANSLATE_NOOP("Button", "Mail Button"), | 278 | { Qt::Key_F13, QT_TRANSLATE_NOOP("Button", "Mail Button"), |
280 | "devicebuttons/z_mail", | 279 | "devicebuttons/z_mail", |
281 | "mail", "raise()", | 280 | "mail", "raise()", |
282 | "mail", "newMail()" }, | 281 | "mail", "newMail()" }, |
283 | }; | 282 | }; |
284 | 283 | ||
285 | struct z_button z_buttons_c700 [] = { | 284 | struct z_button z_buttons_c700 [] = { |
286 | { Qt::Key_F9, QT_TRANSLATE_NOOP("Button", "Calendar Button"), | 285 | { Qt::Key_F9, QT_TRANSLATE_NOOP("Button", "Calendar Button"), |
287 | "devicebuttons/z_calendar", | 286 | "devicebuttons/z_calendar", |
288 | "datebook", "nextView()", | 287 | "datebook", "nextView()", |
289 | "today", "raise()" }, | 288 | "today", "raise()" }, |
290 | { Qt::Key_F10, QT_TRANSLATE_NOOP("Button", "Contacts Button"), | 289 | { Qt::Key_F10, QT_TRANSLATE_NOOP("Button", "Contacts Button"), |
291 | "devicebuttons/z_contact", | 290 | "devicebuttons/z_contact", |
292 | "addressbook", "raise()", | 291 | "addressbook", "raise()", |
293 | "addressbook", "beamBusinessCard()" }, | 292 | "addressbook", "beamBusinessCard()" }, |
294 | { Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Home Button"), | 293 | { Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Home Button"), |
295 | "devicebuttons/z_home", | 294 | "devicebuttons/z_home", |
296 | "QPE/Launcher", "home()", | 295 | "QPE/Launcher", "home()", |
297 | "buttonsettings", "raise()" }, | 296 | "buttonsettings", "raise()" }, |
298 | { Qt::Key_F11, QT_TRANSLATE_NOOP("Button", "Menu Button"), | 297 | { Qt::Key_F11, QT_TRANSLATE_NOOP("Button", "Menu Button"), |
299 | "devicebuttons/z_menu", | 298 | "devicebuttons/z_menu", |
300 | "QPE/TaskBar", "toggleMenu()", | 299 | "QPE/TaskBar", "toggleMenu()", |
301 | "QPE/TaskBar", "toggleStartMenu()" }, | 300 | "QPE/TaskBar", "toggleStartMenu()" }, |
302 | { Qt::Key_F14, QT_TRANSLATE_NOOP("Button", "Display Rotate"), | 301 | { Qt::Key_F14, QT_TRANSLATE_NOOP("Button", "Display Rotate"), |
303 | "devicebuttons/z_hinge", | 302 | "devicebuttons/z_hinge", |
304 | "QPE/Rotation", "rotateDefault()", | 303 | "QPE/Rotation", "rotateDefault()", |
305 | "QPE/Dummy", "doNothing()" }, | 304 | "QPE/Dummy", "doNothing()" }, |
306 | }; | 305 | }; |
307 | 306 | ||
308 | struct s_button { | 307 | struct s_button { |
309 | uint model; | 308 | uint model; |
310 | Qt::Key code; | 309 | Qt::Key code; |
311 | char *utext; | 310 | char *utext; |
312 | char *pix; | 311 | char *pix; |
313 | char *fpressedservice; | 312 | char *fpressedservice; |
314 | char *fpressedaction; | 313 | char *fpressedaction; |
315 | char *fheldservice; | 314 | char *fheldservice; |
316 | char *fheldaction; | 315 | char *fheldaction; |
317 | } simpad_buttons [] = { | 316 | } simpad_buttons [] = { |
318 | { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, | 317 | { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, |
319 | Qt::Key_F9, QT_TRANSLATE_NOOP("Button", "Lower+Up"), | 318 | Qt::Key_F9, QT_TRANSLATE_NOOP("Button", "Lower+Up"), |
320 | "devicebuttons/simpad_lower_up", | 319 | "devicebuttons/simpad_lower_up", |
321 | "datebook", "nextView()", | 320 | "datebook", "nextView()", |
322 | "today", "raise()" }, | 321 | "today", "raise()" }, |
323 | { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, | 322 | { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, |
324 | Qt::Key_F10, QT_TRANSLATE_NOOP("Button", "Lower+Down"), | 323 | Qt::Key_F10, QT_TRANSLATE_NOOP("Button", "Lower+Down"), |
325 | "devicebuttons/simpad_lower_down", | 324 | "devicebuttons/simpad_lower_down", |
326 | "addressbook", "raise()", | 325 | "addressbook", "raise()", |
327 | "addressbook", "beamBusinessCard()" }, | 326 | "addressbook", "beamBusinessCard()" }, |
328 | { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, | 327 | { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, |
329 | Qt::Key_F11, QT_TRANSLATE_NOOP("Button", "Lower+Right"), | 328 | Qt::Key_F11, QT_TRANSLATE_NOOP("Button", "Lower+Right"), |
330 | "devicebuttons/simpad_lower_right", | 329 | "devicebuttons/simpad_lower_right", |
331 | "QPE/TaskBar", "toggleMenu()", | 330 | "QPE/TaskBar", "toggleMenu()", |
332 | "QPE/TaskBar", "toggleStartMenu()" }, | 331 | "QPE/TaskBar", "toggleStartMenu()" }, |
333 | { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, | 332 | { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, |
334 | Qt::Key_F13, QT_TRANSLATE_NOOP("Button", "Lower+Left"), | 333 | Qt::Key_F13, QT_TRANSLATE_NOOP("Button", "Lower+Left"), |
335 | "devicebuttons/simpad_lower_left", | 334 | "devicebuttons/simpad_lower_left", |
336 | "mail", "raise()", | 335 | "mail", "raise()", |
337 | "mail", "newMail()" }, | 336 | "mail", "newMail()" }, |
338 | 337 | ||
339 | { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, | 338 | { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, |
340 | Qt::Key_F5, QT_TRANSLATE_NOOP("Button", "Upper+Up"), | 339 | Qt::Key_F5, QT_TRANSLATE_NOOP("Button", "Upper+Up"), |
341 | "devicebuttons/simpad_upper_up", | 340 | "devicebuttons/simpad_upper_up", |
342 | "QPE/Launcher", "home()", | 341 | "QPE/Launcher", "home()", |
343 | "buttonsettings", "raise()" }, | 342 | "buttonsettings", "raise()" }, |
344 | { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, | 343 | { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, |
345 | Qt::Key_F6, QT_TRANSLATE_NOOP("Button", "Upper+Down"), | 344 | Qt::Key_F6, QT_TRANSLATE_NOOP("Button", "Upper+Down"), |
346 | "devicebuttons/simpad_upper_down", | 345 | "devicebuttons/simpad_upper_down", |
347 | "addressbook", "raise()", | 346 | "addressbook", "raise()", |
348 | "addressbook", "beamBusinessCard()" }, | 347 | "addressbook", "beamBusinessCard()" }, |
349 | { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, | 348 | { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, |
350 | Qt::Key_F7, QT_TRANSLATE_NOOP("Button", "Upper+Right"), | 349 | Qt::Key_F7, QT_TRANSLATE_NOOP("Button", "Upper+Right"), |
351 | "devicebuttons/simpad_upper_right", | 350 | "devicebuttons/simpad_upper_right", |
352 | "QPE/TaskBar", "toggleMenu()", | 351 | "QPE/TaskBar", "toggleMenu()", |
353 | "QPE/TaskBar", "toggleStartMenu()" }, | 352 | "QPE/TaskBar", "toggleStartMenu()" }, |
354 | { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, | 353 | { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, |
355 | Qt::Key_F13, QT_TRANSLATE_NOOP("Button", "Upper+Left"), | 354 | Qt::Key_F13, QT_TRANSLATE_NOOP("Button", "Upper+Left"), |
356 | "devicebuttons/simpad_upper_left", | 355 | "devicebuttons/simpad_upper_left", |
357 | "QPE/Rotation", "flip()", | 356 | "QPE/Rotation", "flip()", |
358 | "QPE/Rotation", "flip()" }, | 357 | "QPE/Rotation", "flip()" }, |
359 | /* | 358 | /* |
360 | { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, | 359 | { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, |
361 | Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Lower+Upper"), | 360 | Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Lower+Upper"), |
362 | "devicebuttons/simpad_lower_upper", | 361 | "devicebuttons/simpad_lower_upper", |
363 | "QPE/Launcher", "home()", | 362 | "QPE/Launcher", "home()", |
364 | "buttonsettings", "raise()" }, | 363 | "buttonsettings", "raise()" }, |
365 | { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, | 364 | { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, |
366 | Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Lower+Upper"), | 365 | Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Lower+Upper"), |
367 | "devicebuttons/simpad_upper_lower", | 366 | "devicebuttons/simpad_upper_lower", |
368 | "QPE/Launcher", "home()", | 367 | "QPE/Launcher", "home()", |
369 | "buttonsettings", "raise()" }, | 368 | "buttonsettings", "raise()" }, |
370 | */ | 369 | */ |
371 | }; | 370 | }; |
372 | 371 | ||
373 | struct r_button { | 372 | struct r_button { |
374 | uint model; | 373 | uint model; |
375 | Qt::Key code; | 374 | Qt::Key code; |
376 | char *utext; | 375 | char *utext; |
377 | char *pix; | 376 | char *pix; |
378 | char *fpressedservice; | 377 | char *fpressedservice; |
379 | char *fpressedaction; | 378 | char *fpressedaction; |
380 | char *fheldservice; | 379 | char *fheldservice; |
381 | char *fheldaction; | 380 | char *fheldaction; |
382 | } ramses_buttons [] = { | 381 | } ramses_buttons [] = { |
383 | { Model_Ramses_MNCI, | 382 | { Model_Ramses_MNCI, |
384 | Qt::Key_F11, QT_TRANSLATE_NOOP("Button", "Menu Button"), | 383 | Qt::Key_F11, QT_TRANSLATE_NOOP("Button", "Menu Button"), |
385 | "devicebuttons/z_menu", | 384 | "devicebuttons/z_menu", |
386 | "QPE/TaskBar", "toggleMenu()", | 385 | "QPE/TaskBar", "toggleMenu()", |
387 | "QPE/TaskBar", "toggleStartMenu()" }, | 386 | "QPE/TaskBar", "toggleStartMenu()" }, |
388 | { Model_Ramses_MNCI, | 387 | { Model_Ramses_MNCI, |
389 | Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Home Button"), | 388 | Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Home Button"), |
390 | "devicebuttons/ipaq_home", | 389 | "devicebuttons/ipaq_home", |
391 | "QPE/Launcher", "home()", | 390 | "QPE/Launcher", "home()", |
392 | "buttonsettings", "raise()" }, | 391 | "buttonsettings", "raise()" }, |
393 | }; | 392 | }; |
394 | 393 | ||
395 | class Yopy : public ODevice { | 394 | class Yopy : public ODevice { |
396 | protected: | 395 | protected: |
397 | virtual void init ( ); | 396 | virtual void init ( ); |
398 | virtual void initButtons ( ); | 397 | virtual void initButtons ( ); |
399 | 398 | ||
400 | public: | 399 | public: |
401 | virtual bool suspend ( ); | 400 | virtual bool suspend ( ); |
402 | 401 | ||
403 | virtual bool setDisplayBrightness ( int b ); | 402 | virtual bool setDisplayBrightness ( int b ); |
404 | virtual int displayBrightnessResolution ( ) const; | 403 | virtual int displayBrightnessResolution ( ) const; |
405 | 404 | ||
406 | static bool isYopy ( ); | 405 | static bool isYopy ( ); |
407 | }; | 406 | }; |
408 | 407 | ||
409 | struct yopy_button { | 408 | struct yopy_button { |
410 | Qt::Key code; | 409 | Qt::Key code; |
411 | char *utext; | 410 | char *utext; |
412 | char *pix; | 411 | char *pix; |
413 | char *fpressedservice; | 412 | char *fpressedservice; |
414 | char *fpressedaction; | 413 | char *fpressedaction; |
415 | char *fheldservice; | 414 | char *fheldservice; |