-rw-r--r-- | libopie2/opiecore/device/odevice.cpp | 17 | ||||
-rw-r--r-- | libopie2/opiecore/device/odevice.h | 9 | ||||
-rw-r--r-- | libopie2/opiecore/device/odevice_ipaq.cpp | 4 | ||||
-rw-r--r-- | libopie2/opiecore/device/odevice_ipaq.h | 8 | ||||
-rw-r--r-- | libopie2/opiecore/device/odevice_jornada.cpp | 2 | ||||
-rw-r--r-- | libopie2/opiecore/device/odevice_jornada.h | 9 | ||||
-rw-r--r-- | libopie2/opiecore/device/odevice_ramses.cpp | 3 | ||||
-rw-r--r-- | libopie2/opiecore/device/odevice_ramses.h | 7 | ||||
-rw-r--r-- | libopie2/opiecore/device/odevice_simpad.cpp | 3 | ||||
-rw-r--r-- | libopie2/opiecore/device/odevice_simpad.h | 8 | ||||
-rw-r--r-- | libopie2/opiecore/device/odevice_yopy.cpp | 3 | ||||
-rw-r--r-- | libopie2/opiecore/device/odevice_yopy.h | 9 | ||||
-rw-r--r-- | libopie2/opiecore/device/odevice_zaurus.cpp | 3 | ||||
-rw-r--r-- | libopie2/opiecore/device/odevice_zaurus.h | 8 | ||||
-rw-r--r-- | libopie2/opiecore/device/odevicebutton.cpp | 15 | ||||
-rw-r--r-- | libopie2/opiecore/device/odevicebutton.h | 11 |
16 files changed, 88 insertions, 31 deletions
diff --git a/libopie2/opiecore/device/odevice.cpp b/libopie2/opiecore/device/odevice.cpp index 27b0e53..f3e2cfb 100644 --- a/libopie2/opiecore/device/odevice.cpp +++ b/libopie2/opiecore/device/odevice.cpp | |||
@@ -39,74 +39,74 @@ _;:, .> :=|. This program is free software; you can | |||
39 | #include <qfile.h> | 39 | #include <qfile.h> |
40 | #include <qtextstream.h> | 40 | #include <qtextstream.h> |
41 | #include <qwindowsystem_qws.h> | 41 | #include <qwindowsystem_qws.h> |
42 | 42 | ||
43 | /* OPIE */ | 43 | /* OPIE */ |
44 | #include <qpe/config.h> | 44 | #include <qpe/config.h> |
45 | #include <qpe/resource.h> | 45 | #include <qpe/resource.h> |
46 | #include <qpe/sound.h> | 46 | #include <qpe/sound.h> |
47 | #include <qpe/qcopenvelope_qws.h> | 47 | #include <qpe/qcopenvelope_qws.h> |
48 | 48 | ||
49 | /* STD */ | 49 | /* STD */ |
50 | #include <fcntl.h> | 50 | #include <fcntl.h> |
51 | #include <math.h> | 51 | #include <math.h> |
52 | #include <stdlib.h> | 52 | #include <stdlib.h> |
53 | #include <signal.h> | 53 | #include <signal.h> |
54 | #include <sys/ioctl.h> | 54 | #include <sys/ioctl.h> |
55 | #include <sys/time.h> | 55 | #include <sys/time.h> |
56 | #include <unistd.h> | 56 | #include <unistd.h> |
57 | #ifndef QT_NO_SOUND | 57 | #ifndef QT_NO_SOUND |
58 | #include <linux/soundcard.h> | 58 | #include <linux/soundcard.h> |
59 | #endif | 59 | #endif |
60 | 60 | ||
61 | const char* PATH_PROC_CPUINFO = "/proc/cpuinfo"; | 61 | const char* PATH_PROC_CPUINFO = "/proc/cpuinfo"; |
62 | 62 | ||
63 | using namespace Opie; | 63 | using namespace Opie::Core; |
64 | 64 | ||
65 | ODevice *ODevice::inst() | 65 | ODevice *ODevice::inst() |
66 | { | 66 | { |
67 | static ODevice *dev = 0; | 67 | static ODevice *dev = 0; |
68 | 68 | ||
69 | // rewrite this to only use /proc/cpuinfo or so | 69 | // rewrite this to only use /proc/cpuinfo or so |
70 | 70 | ||
71 | if ( !dev ) | 71 | if ( !dev ) |
72 | { | 72 | { |
73 | QFile f( PATH_PROC_CPUINFO ); | 73 | QFile f( PATH_PROC_CPUINFO ); |
74 | if ( f.open( IO_ReadOnly ) ) | 74 | if ( f.open( IO_ReadOnly ) ) |
75 | { | 75 | { |
76 | QTextStream s( &f ); | 76 | QTextStream s( &f ); |
77 | while ( !s.atEnd() ) | 77 | while ( !s.atEnd() ) |
78 | { | 78 | { |
79 | QString line; | 79 | QString line; |
80 | line = s.readLine(); | 80 | line = s.readLine(); |
81 | if ( line.startsWith( "Hardware" ) ) | 81 | if ( line.startsWith( "Hardware" ) ) |
82 | { | 82 | { |
83 | qDebug( "ODevice() - found '%s'", (const char*) line ); | 83 | qDebug( "ODevice() - found '%s'", (const char*) line ); |
84 | if ( line.contains( "sharp", false ) ) dev = new Zaurus(); | 84 | if ( line.contains( "sharp", false ) ) dev = new Private::Zaurus(); |
85 | else if ( line.contains( "ipaq", false ) ) dev = new iPAQ(); | 85 | else if ( line.contains( "ipaq", false ) ) dev = new Private::iPAQ(); |
86 | else if ( line.contains( "simpad", false ) ) dev = new SIMpad(); | 86 | else if ( line.contains( "simpad", false ) ) dev = new Private::SIMpad(); |
87 | else if ( line.contains( "jornada", false ) ) dev = new Jornada(); | 87 | else if ( line.contains( "jornada", false ) ) dev = new Private::Jornada(); |
88 | else if ( line.contains( "ramses", false ) ) dev = new Ramses(); | 88 | else if ( line.contains( "ramses", false ) ) dev = new Private::Ramses(); |
89 | else qWarning( "ODevice() - unknown hardware - using default." ); | 89 | else qWarning( "ODevice() - unknown hardware - using default." ); |
90 | break; | 90 | break; |
91 | } | 91 | } |
92 | } | 92 | } |
93 | } | 93 | } |
94 | else | 94 | else |
95 | { | 95 | { |
96 | qWarning( "ODevice() - can't open '%s' - unknown hardware - using default." ); | 96 | qWarning( "ODevice() - can't open '%s' - unknown hardware - using default." ); |
97 | } | 97 | } |
98 | if ( !dev ) dev = new ODevice(); | 98 | if ( !dev ) dev = new ODevice(); |
99 | dev->init(); | 99 | dev->init(); |
100 | } | 100 | } |
101 | return dev; | 101 | return dev; |
102 | } | 102 | } |
103 | 103 | ||
104 | ODevice::ODevice() | 104 | ODevice::ODevice() |
105 | { | 105 | { |
106 | d = new ODeviceData; | 106 | d = new ODeviceData; |
107 | 107 | ||
108 | d->m_modelstr = "Unknown"; | 108 | d->m_modelstr = "Unknown"; |
109 | d->m_model = Model_Unknown; | 109 | d->m_model = Model_Unknown; |
110 | d->m_vendorstr = "Unknown"; | 110 | d->m_vendorstr = "Unknown"; |
111 | d->m_vendor = Vendor_Unknown; | 111 | d->m_vendor = Vendor_Unknown; |
112 | d->m_systemstr = "Unknown"; | 112 | d->m_systemstr = "Unknown"; |
@@ -166,49 +166,49 @@ bool ODevice::setSoftSuspend ( bool /*soft*/ ) | |||
166 | #define APM_IOC_SUSPEND OD_IO( 'A', 2 ) | 166 | #define APM_IOC_SUSPEND OD_IO( 'A', 2 ) |
167 | 167 | ||
168 | /** | 168 | /** |
169 | * This method will try to suspend the device | 169 | * This method will try to suspend the device |
170 | * It only works if the user is the QWS Server and the apm application | 170 | * It only works if the user is the QWS Server and the apm application |
171 | * is installed. | 171 | * is installed. |
172 | * It tries to suspend and then waits some time cause some distributions | 172 | * It tries to suspend and then waits some time cause some distributions |
173 | * do have asynchronus apm implementations. | 173 | * do have asynchronus apm implementations. |
174 | * This method will either fail and return false or it'll suspend the | 174 | * This method will either fail and return false or it'll suspend the |
175 | * device and return once the device got woken up | 175 | * device and return once the device got woken up |
176 | * | 176 | * |
177 | * @return if the device got suspended | 177 | * @return if the device got suspended |
178 | */ | 178 | */ |
179 | bool ODevice::suspend() | 179 | bool ODevice::suspend() |
180 | { | 180 | { |
181 | qDebug("ODevice::suspend"); | 181 | qDebug("ODevice::suspend"); |
182 | if ( !isQWS( ) ) // only qwsserver is allowed to suspend | 182 | if ( !isQWS( ) ) // only qwsserver is allowed to suspend |
183 | return false; | 183 | return false; |
184 | 184 | ||
185 | if ( d->m_model == Model_Unknown ) // better don't suspend in qvfb / on unkown devices | 185 | if ( d->m_model == Model_Unknown ) // better don't suspend in qvfb / on unkown devices |
186 | return false; | 186 | return false; |
187 | 187 | ||
188 | bool res = false; | 188 | bool res = false; |
189 | ODevice::sendSuspendmsg(); | 189 | ODevice::sendSuspendmsg(); |
190 | 190 | ||
191 | struct timeval tvs, tvn; | 191 | struct timeval tvs, tvn; |
192 | ::gettimeofday ( &tvs, 0 ); | 192 | ::gettimeofday ( &tvs, 0 ); |
193 | 193 | ||
194 | ::sync(); // flush fs caches | 194 | ::sync(); // flush fs caches |
195 | res = ( ::system ( "apm --suspend" ) == 0 ); | 195 | res = ( ::system ( "apm --suspend" ) == 0 ); |
196 | 196 | ||
197 | // This is needed because the iPAQ apm implementation is asynchronous and we | 197 | // This is needed because the iPAQ apm implementation is asynchronous and we |
198 | // can not be sure when exactly the device is really suspended | 198 | // can not be sure when exactly the device is really suspended |
199 | // This can be deleted as soon as a stable familiar with a synchronous apm implementation exists. | 199 | // This can be deleted as soon as a stable familiar with a synchronous apm implementation exists. |
200 | 200 | ||
201 | if ( res ) { | 201 | if ( res ) { |
202 | do { // wait at most 1.5 sec: either suspend didn't work or the device resumed | 202 | do { // wait at most 1.5 sec: either suspend didn't work or the device resumed |
203 | ::usleep ( 200 * 1000 ); | 203 | ::usleep ( 200 * 1000 ); |
204 | ::gettimeofday ( &tvn, 0 ); | 204 | ::gettimeofday ( &tvn, 0 ); |
205 | } while ((( tvn. tv_sec - tvs. tv_sec ) * 1000 + ( tvn. tv_usec - tvs. tv_usec ) / 1000 ) < 1500 ); | 205 | } while ((( tvn. tv_sec - tvs. tv_sec ) * 1000 + ( tvn. tv_usec - tvs. tv_usec ) / 1000 ) < 1500 ); |
206 | } | 206 | } |
207 | 207 | ||
208 | return res; | 208 | return res; |
209 | } | 209 | } |
210 | 210 | ||
211 | //#include <linux/fb.h> better not rely on kernel headers in userspace ... | 211 | //#include <linux/fb.h> better not rely on kernel headers in userspace ... |
212 | 212 | ||
213 | #define FBIOBLANK OD_IO( 'F', 0x11 ) // 0x4611 | 213 | #define FBIOBLANK OD_IO( 'F', 0x11 ) // 0x4611 |
214 | 214 | ||
@@ -603,26 +603,29 @@ void ODevice::remapHeldAction ( int button, const OQCopMessage &action ) | |||
603 | { | 603 | { |
604 | initButtons(); | 604 | initButtons(); |
605 | 605 | ||
606 | if ( button >= (int) d->m_buttons->count()) | 606 | if ( button >= (int) d->m_buttons->count()) |
607 | return; | 607 | return; |
608 | 608 | ||
609 | ODeviceButton &b = ( *d->m_buttons ) [button]; | 609 | ODeviceButton &b = ( *d->m_buttons ) [button]; |
610 | b. setHeldAction ( action ); | 610 | b. setHeldAction ( action ); |
611 | 611 | ||
612 | Config buttonFile ( "ButtonSettings" ); | 612 | Config buttonFile ( "ButtonSettings" ); |
613 | buttonFile. setGroup ( "Button" + QString::number ( button )); | 613 | buttonFile. setGroup ( "Button" + QString::number ( button )); |
614 | buttonFile. writeEntry ( "HeldActionChannel", (const char *) b. heldAction(). channel()); | 614 | buttonFile. writeEntry ( "HeldActionChannel", (const char *) b. heldAction(). channel()); |
615 | buttonFile. writeEntry ( "HeldActionMessage", (const char *) b. heldAction(). message()); | 615 | buttonFile. writeEntry ( "HeldActionMessage", (const char *) b. heldAction(). message()); |
616 | 616 | ||
617 | //buttonFile. writeEntry ( "HeldActionArgs", decodeBase64 ( b. heldAction(). data())); | 617 | //buttonFile. writeEntry ( "HeldActionArgs", decodeBase64 ( b. heldAction(). data())); |
618 | 618 | ||
619 | QCopEnvelope ( "QPE/System", "deviceButtonMappingChanged()" ); | 619 | QCopEnvelope ( "QPE/System", "deviceButtonMappingChanged()" ); |
620 | } | 620 | } |
621 | void ODevice::virtual_hook(int, void* ){ | 621 | void ODevice::virtual_hook(int, void* ){ |
622 | 622 | ||
623 | } | 623 | } |
624 | 624 | ||
625 | void ODevice::sendSuspendmsg() | 625 | void ODevice::sendSuspendmsg() |
626 | { | 626 | { |
627 | if ( isQWS() ) | ||
628 | return; | ||
629 | |||
627 | QCopEnvelope ( "QPE/System", "aboutToSuspend()" ); | 630 | QCopEnvelope ( "QPE/System", "aboutToSuspend()" ); |
628 | } | 631 | } |
diff --git a/libopie2/opiecore/device/odevice.h b/libopie2/opiecore/device/odevice.h index bccb449..5ee9cca 100644 --- a/libopie2/opiecore/device/odevice.h +++ b/libopie2/opiecore/device/odevice.h | |||
@@ -19,50 +19,51 @@ _;:, .> :=|. This program is free software; you can | |||
19 | ..}^=.= = ; Library General Public License for more | 19 | ..}^=.= = ; Library General Public License for more |
20 | ++= -. .` .: details. | 20 | ++= -. .` .: details. |
21 | : = ...= . :.=- | 21 | : = ...= . :.=- |
22 | -. .:....=;==+<; You should have received a copy of the GNU | 22 | -. .:....=;==+<; You should have received a copy of the GNU |
23 | -_. . . )=. = Library General Public License along with | 23 | -_. . . )=. = Library General Public License along with |
24 | -- :-=` this library; see the file COPYING.LIB. | 24 | -- :-=` this library; see the file COPYING.LIB. |
25 | If not, write to the Free Software Foundation, | 25 | If not, write to the Free Software Foundation, |
26 | Inc., 59 Temple Place - Suite 330, | 26 | Inc., 59 Temple Place - Suite 330, |
27 | Boston, MA 02111-1307, USA. | 27 | Boston, MA 02111-1307, USA. |
28 | */ | 28 | */ |
29 | 29 | ||
30 | #ifndef ODEVICE_H_ | 30 | #ifndef ODEVICE_H_ |
31 | #define ODEVICE_H_ | 31 | #define ODEVICE_H_ |
32 | 32 | ||
33 | /* OPIE */ | 33 | /* OPIE */ |
34 | #include <opie2/odevicebutton.h> | 34 | #include <opie2/odevicebutton.h> |
35 | #include <qpe/qpeapplication.h> /* for Transformation enum.. */ | 35 | #include <qpe/qpeapplication.h> /* for Transformation enum.. */ |
36 | 36 | ||
37 | /* QT */ | 37 | /* QT */ |
38 | #include <qnamespace.h> | 38 | #include <qnamespace.h> |
39 | #include <qobject.h> | 39 | #include <qobject.h> |
40 | #include <qstring.h> | 40 | #include <qstring.h> |
41 | #include <qstrlist.h> | 41 | #include <qstrlist.h> |
42 | 42 | ||
43 | namespace Opie | 43 | namespace Opie{ |
44 | { | 44 | namespace Core{ |
45 | |||
45 | class ODeviceData; | 46 | class ODeviceData; |
46 | /** | 47 | /** |
47 | * The available devices | 48 | * The available devices |
48 | */ | 49 | */ |
49 | enum OModel { | 50 | enum OModel { |
50 | Model_Unknown, // = 0 | 51 | Model_Unknown, // = 0 |
51 | 52 | ||
52 | Model_Series_Mask = 0xff000000, | 53 | Model_Series_Mask = 0xff000000, |
53 | 54 | ||
54 | Model_iPAQ = ( 1 << 24 ), | 55 | Model_iPAQ = ( 1 << 24 ), |
55 | 56 | ||
56 | Model_iPAQ_All = ( Model_iPAQ | 0xffffff ), | 57 | Model_iPAQ_All = ( Model_iPAQ | 0xffffff ), |
57 | Model_iPAQ_H31xx = ( Model_iPAQ | 0x000001 ), | 58 | Model_iPAQ_H31xx = ( Model_iPAQ | 0x000001 ), |
58 | Model_iPAQ_H36xx = ( Model_iPAQ | 0x000002 ), | 59 | Model_iPAQ_H36xx = ( Model_iPAQ | 0x000002 ), |
59 | Model_iPAQ_H37xx = ( Model_iPAQ | 0x000004 ), | 60 | Model_iPAQ_H37xx = ( Model_iPAQ | 0x000004 ), |
60 | Model_iPAQ_H38xx = ( Model_iPAQ | 0x000008 ), | 61 | Model_iPAQ_H38xx = ( Model_iPAQ | 0x000008 ), |
61 | Model_iPAQ_H39xx = ( Model_iPAQ | 0x000010 ), | 62 | Model_iPAQ_H39xx = ( Model_iPAQ | 0x000010 ), |
62 | Model_iPAQ_H5xxx = ( Model_iPAQ | 0x000011 ), | 63 | Model_iPAQ_H5xxx = ( Model_iPAQ | 0x000011 ), |
63 | 64 | ||
64 | Model_Jornada = ( 6 << 24 ), | 65 | Model_Jornada = ( 6 << 24 ), |
65 | Model_Jornada_56x = ( Model_Jornada | 0x000001 ), | 66 | Model_Jornada_56x = ( Model_Jornada | 0x000001 ), |
66 | 67 | ||
67 | Model_Zaurus = ( 2 << 24 ), | 68 | Model_Zaurus = ( 2 << 24 ), |
68 | 69 | ||
@@ -229,49 +230,49 @@ public: | |||
229 | virtual void playAlarmSound(); | 230 | virtual void playAlarmSound(); |
230 | virtual void playKeySound(); | 231 | virtual void playKeySound(); |
231 | virtual void playTouchSound(); | 232 | virtual void playTouchSound(); |
232 | 233 | ||
233 | virtual QValueList <OLed> ledList() const; | 234 | virtual QValueList <OLed> ledList() const; |
234 | virtual QValueList <OLedState> ledStateList ( OLed led ) const; | 235 | virtual QValueList <OLedState> ledStateList ( OLed led ) const; |
235 | virtual OLedState ledState ( OLed led ) const; | 236 | virtual OLedState ledState ( OLed led ) const; |
236 | virtual bool setLedState ( OLed led, OLedState st ); | 237 | virtual bool setLedState ( OLed led, OLedState st ); |
237 | 238 | ||
238 | virtual bool hasLightSensor() const; | 239 | virtual bool hasLightSensor() const; |
239 | virtual int readLightSensor(); | 240 | virtual int readLightSensor(); |
240 | virtual int lightSensorResolution() const; | 241 | virtual int lightSensorResolution() const; |
241 | 242 | ||
242 | virtual bool hasHingeSensor() const; | 243 | virtual bool hasHingeSensor() const; |
243 | virtual OHingeStatus readHingeSensor(); | 244 | virtual OHingeStatus readHingeSensor(); |
244 | 245 | ||
245 | const QStrList &allowedCpuFrequencies() const; | 246 | const QStrList &allowedCpuFrequencies() const; |
246 | bool setCurrentCpuFrequency(uint index); | 247 | bool setCurrentCpuFrequency(uint index); |
247 | 248 | ||
248 | /** | 249 | /** |
249 | * Returns the available buttons on this device. The number and location | 250 | * Returns the available buttons on this device. The number and location |
250 | * of buttons will vary depending on the device. Button numbers will be assigned | 251 | * of buttons will vary depending on the device. Button numbers will be assigned |
251 | * by the device manufacturer and will be from most preferred button to least preffered | 252 | * by the device manufacturer and will be from most preferred button to least preffered |
252 | * button. Note that this list only contains "user mappable" buttons. | 253 | * button. Note that this list only contains "user mappable" buttons. |
253 | * | 254 | * |
254 | * @todo Make method const and take care of calling initButtons or make that const too | 255 | * @todo Make method const and take care of calling initButtons or make that const too |
255 | * | 256 | * |
256 | */ | 257 | */ |
257 | const QValueList<ODeviceButton> &buttons(); | 258 | const QValueList<ODeviceButton> &buttons(); |
258 | 259 | ||
259 | /** | 260 | /** |
260 | * Returns the DeviceButton for the \a keyCode. If \a keyCode is not found, it | 261 | * Returns the DeviceButton for the \a keyCode. If \a keyCode is not found, it |
261 | * returns 0L | 262 | * returns 0L |
262 | */ | 263 | */ |
263 | const ODeviceButton *buttonForKeycode ( ushort keyCode ); | 264 | const ODeviceButton *buttonForKeycode ( ushort keyCode ); |
264 | 265 | ||
265 | /** | 266 | /** |
266 | * Reassigns the pressed action for \a button. To return to the factory | 267 | * Reassigns the pressed action for \a button. To return to the factory |
267 | * default pass an empty string as \a qcopMessage. | 268 | * default pass an empty string as \a qcopMessage. |
268 | */ | 269 | */ |
269 | void remapPressedAction ( int button, const OQCopMessage &qcopMessage ); | 270 | void remapPressedAction ( int button, const OQCopMessage &qcopMessage ); |
270 | 271 | ||
271 | /** | 272 | /** |
272 | * Reassigns the held action for \a button. To return to the factory | 273 | * Reassigns the held action for \a button. To return to the factory |
273 | * default pass an empty string as \a qcopMessage. | 274 | * default pass an empty string as \a qcopMessage. |
274 | */ | 275 | */ |
275 | void remapHeldAction ( int button, const OQCopMessage &qcopMessage ); | 276 | void remapHeldAction ( int button, const OQCopMessage &qcopMessage ); |
276 | 277 | ||
277 | /** | 278 | /** |
@@ -293,40 +294,42 @@ protected: | |||
293 | 294 | ||
294 | class ODeviceData { | 295 | class ODeviceData { |
295 | 296 | ||
296 | public: | 297 | public: |
297 | QString m_vendorstr; | 298 | QString m_vendorstr; |
298 | OVendor m_vendor; | 299 | OVendor m_vendor; |
299 | 300 | ||
300 | QString m_modelstr; | 301 | QString m_modelstr; |
301 | OModel m_model; | 302 | OModel m_model; |
302 | 303 | ||
303 | QString m_systemstr; | 304 | QString m_systemstr; |
304 | OSystem m_system; | 305 | OSystem m_system; |
305 | 306 | ||
306 | QString m_sysverstr; | 307 | QString m_sysverstr; |
307 | 308 | ||
308 | Transformation m_rotation; | 309 | Transformation m_rotation; |
309 | ODirection m_direction; | 310 | ODirection m_direction; |
310 | 311 | ||
311 | QValueList <ODeviceButton> *m_buttons; | 312 | QValueList <ODeviceButton> *m_buttons; |
312 | uint m_holdtime; | 313 | uint m_holdtime; |
313 | QStrList *m_cpu_frequencies; | 314 | QStrList *m_cpu_frequencies; |
314 | }; | 315 | }; |
315 | 316 | ||
316 | } | 317 | } |
318 | } | ||
317 | 319 | ||
318 | static inline bool isQWS() | 320 | static inline bool isQWS() |
319 | { | 321 | { |
320 | return qApp ? ( qApp->type() == QApplication::GuiServer ) : false; | 322 | return qApp ? ( qApp->type() == QApplication::GuiServer ) : false; |
321 | } | 323 | } |
322 | 324 | ||
323 | static QCString makeChannel ( const char *str ) | 325 | static QCString makeChannel ( const char *str ) |
324 | { | 326 | { |
325 | if ( str && !::strchr ( str, '/' )) | 327 | if ( str && !::strchr ( str, '/' )) |
326 | return QCString ( "QPE/Application/" ) + str; | 328 | return QCString ( "QPE/Application/" ) + str; |
327 | else | 329 | else |
328 | return str; | 330 | return str; |
329 | } | 331 | } |
330 | 332 | ||
333 | |||
331 | #endif | 334 | #endif |
332 | 335 | ||
diff --git a/libopie2/opiecore/device/odevice_ipaq.cpp b/libopie2/opiecore/device/odevice_ipaq.cpp index 8ecea1b..177fd4c 100644 --- a/libopie2/opiecore/device/odevice_ipaq.cpp +++ b/libopie2/opiecore/device/odevice_ipaq.cpp | |||
@@ -32,48 +32,52 @@ | |||
32 | /* QT */ | 32 | /* QT */ |
33 | #include <qapplication.h> | 33 | #include <qapplication.h> |
34 | #include <qfile.h> | 34 | #include <qfile.h> |
35 | #include <qtextstream.h> | 35 | #include <qtextstream.h> |
36 | #include <qwindowsystem_qws.h> | 36 | #include <qwindowsystem_qws.h> |
37 | 37 | ||
38 | /* OPIE */ | 38 | /* OPIE */ |
39 | #include <qpe/config.h> | 39 | #include <qpe/config.h> |
40 | #include <qpe/resource.h> | 40 | #include <qpe/resource.h> |
41 | #include <qpe/sound.h> | 41 | #include <qpe/sound.h> |
42 | #include <qpe/qcopenvelope_qws.h> | 42 | #include <qpe/qcopenvelope_qws.h> |
43 | 43 | ||
44 | /* STD */ | 44 | /* STD */ |
45 | #include <fcntl.h> | 45 | #include <fcntl.h> |
46 | #include <math.h> | 46 | #include <math.h> |
47 | #include <stdlib.h> | 47 | #include <stdlib.h> |
48 | #include <signal.h> | 48 | #include <signal.h> |
49 | #include <sys/ioctl.h> | 49 | #include <sys/ioctl.h> |
50 | #include <sys/time.h> | 50 | #include <sys/time.h> |
51 | #include <unistd.h> | 51 | #include <unistd.h> |
52 | #ifndef QT_NO_SOUND | 52 | #ifndef QT_NO_SOUND |
53 | #include <linux/soundcard.h> | 53 | #include <linux/soundcard.h> |
54 | #endif | 54 | #endif |
55 | 55 | ||
56 | |||
57 | using namespace Opie::Core; | ||
58 | using namespace Opie::Core::Private; | ||
59 | |||
56 | /* KERNEL */ | 60 | /* KERNEL */ |
57 | #define OD_IOC(dir,type,number,size) (( dir << 30 ) | ( type << 8 ) | ( number ) | ( size << 16 )) | 61 | #define OD_IOC(dir,type,number,size) (( dir << 30 ) | ( type << 8 ) | ( number ) | ( size << 16 )) |
58 | 62 | ||
59 | #define OD_IO(type,number) OD_IOC(0,type,number,0) | 63 | #define OD_IO(type,number) OD_IOC(0,type,number,0) |
60 | #define OD_IOW(type,number,size) OD_IOC(1,type,number,sizeof(size)) | 64 | #define OD_IOW(type,number,size) OD_IOC(1,type,number,sizeof(size)) |
61 | #define OD_IOR(type,number,size) OD_IOC(2,type,number,sizeof(size)) | 65 | #define OD_IOR(type,number,size) OD_IOC(2,type,number,sizeof(size)) |
62 | #define OD_IORW(type,number,size) OD_IOC(3,type,number,sizeof(size)) | 66 | #define OD_IORW(type,number,size) OD_IOC(3,type,number,sizeof(size)) |
63 | 67 | ||
64 | typedef struct { | 68 | typedef struct { |
65 | unsigned char OffOnBlink; /* 0=off 1=on 2=Blink */ | 69 | unsigned char OffOnBlink; /* 0=off 1=on 2=Blink */ |
66 | unsigned char TotalTime; /* Units of 5 seconds */ | 70 | unsigned char TotalTime; /* Units of 5 seconds */ |
67 | unsigned char OnTime; /* units of 100m/s */ | 71 | unsigned char OnTime; /* units of 100m/s */ |
68 | unsigned char OffTime; /* units of 100m/s */ | 72 | unsigned char OffTime; /* units of 100m/s */ |
69 | } LED_IN; | 73 | } LED_IN; |
70 | 74 | ||
71 | typedef struct { | 75 | typedef struct { |
72 | unsigned char mode; | 76 | unsigned char mode; |
73 | unsigned char pwr; | 77 | unsigned char pwr; |
74 | unsigned char brightness; | 78 | unsigned char brightness; |
75 | } FLITE_IN; | 79 | } FLITE_IN; |
76 | 80 | ||
77 | #define LED_ON OD_IOW( 'f', 5, LED_IN ) | 81 | #define LED_ON OD_IOW( 'f', 5, LED_IN ) |
78 | #define FLITE_ON OD_IOW( 'f', 7, FLITE_IN ) | 82 | #define FLITE_ON OD_IOW( 'f', 7, FLITE_IN ) |
79 | 83 | ||
diff --git a/libopie2/opiecore/device/odevice_ipaq.h b/libopie2/opiecore/device/odevice_ipaq.h index f512344..4f4af46 100644 --- a/libopie2/opiecore/device/odevice_ipaq.h +++ b/libopie2/opiecore/device/odevice_ipaq.h | |||
@@ -14,71 +14,77 @@ | |||
14 | .i_,=:_. -<s. This program is distributed in the hope that | 14 | .i_,=:_. -<s. This program is distributed in the hope that |
15 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 15 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
16 | : .. .:, . . . without even the implied warranty of | 16 | : .. .:, . . . without even the implied warranty of |
17 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 17 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
18 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | 18 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
19 | ..}^=.= = ; Library General Public License for more | 19 | ..}^=.= = ; Library General Public License for more |
20 | ++= -. .` .: details. | 20 | ++= -. .` .: details. |
21 | : = ...= . :.=- | 21 | : = ...= . :.=- |
22 | -. .:....=;==+<; You should have received a copy of the GNU | 22 | -. .:....=;==+<; You should have received a copy of the GNU |
23 | -_. . . )=. = Library General Public License along with | 23 | -_. . . )=. = Library General Public License along with |
24 | -- :-=` this library; see the file COPYING.LIB. | 24 | -- :-=` this library; see the file COPYING.LIB. |
25 | If not, write to the Free Software Foundation, | 25 | If not, write to the Free Software Foundation, |
26 | Inc., 59 Temple Place - Suite 330, | 26 | Inc., 59 Temple Place - Suite 330, |
27 | Boston, MA 02111-1307, USA. | 27 | Boston, MA 02111-1307, USA. |
28 | */ | 28 | */ |
29 | 29 | ||
30 | #ifndef ODEVICE_IPAQ | 30 | #ifndef ODEVICE_IPAQ |
31 | #define ODEVICE_IPAQ | 31 | #define ODEVICE_IPAQ |
32 | 32 | ||
33 | #include "odevice.h" | 33 | #include "odevice.h" |
34 | 34 | ||
35 | /* QT */ | 35 | /* QT */ |
36 | #include <qwindowsystem_qws.h> | 36 | #include <qwindowsystem_qws.h> |
37 | 37 | ||
38 | using namespace Opie; | 38 | namespace Opie { |
39 | namespace Core { | ||
40 | namespace Private { | ||
39 | 41 | ||
40 | class iPAQ : public ODevice, public QWSServer::KeyboardFilter | 42 | class iPAQ : public ODevice, public QWSServer::KeyboardFilter |
41 | { | 43 | { |
42 | 44 | ||
43 | protected: | 45 | protected: |
44 | virtual void init(); | 46 | virtual void init(); |
45 | virtual void initButtons(); | 47 | virtual void initButtons(); |
46 | 48 | ||
47 | public: | 49 | public: |
48 | virtual bool setSoftSuspend( bool soft ); | 50 | virtual bool setSoftSuspend( bool soft ); |
49 | 51 | ||
50 | virtual bool setDisplayBrightness( int b ); | 52 | virtual bool setDisplayBrightness( int b ); |
51 | virtual int displayBrightnessResolution() const; | 53 | virtual int displayBrightnessResolution() const; |
52 | 54 | ||
53 | virtual void playAlarmSound(); | 55 | virtual void playAlarmSound(); |
54 | 56 | ||
55 | virtual QValueList <OLed> ledList() const; | 57 | virtual QValueList <OLed> ledList() const; |
56 | virtual QValueList <OLedState> ledStateList( OLed led ) const; | 58 | virtual QValueList <OLedState> ledStateList( OLed led ) const; |
57 | virtual OLedState ledState( OLed led ) const; | 59 | virtual OLedState ledState( OLed led ) const; |
58 | virtual bool setLedState( OLed led, OLedState st ); | 60 | virtual bool setLedState( OLed led, OLedState st ); |
59 | 61 | ||
60 | virtual bool hasLightSensor() const; | 62 | virtual bool hasLightSensor() const; |
61 | virtual int readLightSensor(); | 63 | virtual int readLightSensor(); |
62 | virtual int lightSensorResolution() const; | 64 | virtual int lightSensorResolution() const; |
63 | 65 | ||
64 | protected: | 66 | protected: |
65 | virtual bool filter( int unicode, int keycode, int modifiers, bool isPress, bool autoRepeat ); | 67 | virtual bool filter( int unicode, int keycode, int modifiers, bool isPress, bool autoRepeat ); |
66 | virtual void timerEvent( QTimerEvent *te ); | 68 | virtual void timerEvent( QTimerEvent *te ); |
67 | 69 | ||
68 | int m_power_timer; | 70 | int m_power_timer; |
69 | 71 | ||
70 | OLedState m_leds [2]; | 72 | OLedState m_leds [2]; |
71 | }; | 73 | }; |
72 | 74 | ||
73 | struct i_button { | 75 | struct i_button { |
74 | uint model; | 76 | uint model; |
75 | Qt::Key code; | 77 | Qt::Key code; |
76 | char *utext; | 78 | char *utext; |
77 | char *pix; | 79 | char *pix; |
78 | char *fpressedservice; | 80 | char *fpressedservice; |
79 | char *fpressedaction; | 81 | char *fpressedaction; |
80 | char *fheldservice; | 82 | char *fheldservice; |
81 | char *fheldaction; | 83 | char *fheldaction; |
82 | }; | 84 | }; |
83 | 85 | ||
86 | } | ||
87 | } | ||
88 | } | ||
89 | |||
84 | #endif | 90 | #endif |
diff --git a/libopie2/opiecore/device/odevice_jornada.cpp b/libopie2/opiecore/device/odevice_jornada.cpp index 37bd6e9..b79b0b5 100644 --- a/libopie2/opiecore/device/odevice_jornada.cpp +++ b/libopie2/opiecore/device/odevice_jornada.cpp | |||
@@ -56,49 +56,49 @@ | |||
56 | /* KERNEL */ | 56 | /* KERNEL */ |
57 | #define OD_IOC(dir,type,number,size) (( dir << 30 ) | ( type << 8 ) | ( number ) | ( size << 16 )) | 57 | #define OD_IOC(dir,type,number,size) (( dir << 30 ) | ( type << 8 ) | ( number ) | ( size << 16 )) |
58 | 58 | ||
59 | #define OD_IO(type,number) OD_IOC(0,type,number,0) | 59 | #define OD_IO(type,number) OD_IOC(0,type,number,0) |
60 | #define OD_IOW(type,number,size) OD_IOC(1,type,number,sizeof(size)) | 60 | #define OD_IOW(type,number,size) OD_IOC(1,type,number,sizeof(size)) |
61 | #define OD_IOR(type,number,size) OD_IOC(2,type,number,sizeof(size)) | 61 | #define OD_IOR(type,number,size) OD_IOC(2,type,number,sizeof(size)) |
62 | #define OD_IORW(type,number,size) OD_IOC(3,type,number,sizeof(size)) | 62 | #define OD_IORW(type,number,size) OD_IOC(3,type,number,sizeof(size)) |
63 | 63 | ||
64 | typedef struct { | 64 | typedef struct { |
65 | unsigned char OffOnBlink; /* 0=off 1=on 2=Blink */ | 65 | unsigned char OffOnBlink; /* 0=off 1=on 2=Blink */ |
66 | unsigned char TotalTime; /* Units of 5 seconds */ | 66 | unsigned char TotalTime; /* Units of 5 seconds */ |
67 | unsigned char OnTime; /* units of 100m/s */ | 67 | unsigned char OnTime; /* units of 100m/s */ |
68 | unsigned char OffTime; /* units of 100m/s */ | 68 | unsigned char OffTime; /* units of 100m/s */ |
69 | } LED_IN; | 69 | } LED_IN; |
70 | 70 | ||
71 | typedef struct { | 71 | typedef struct { |
72 | unsigned char mode; | 72 | unsigned char mode; |
73 | unsigned char pwr; | 73 | unsigned char pwr; |
74 | unsigned char brightness; | 74 | unsigned char brightness; |
75 | } FLITE_IN; | 75 | } FLITE_IN; |
76 | 76 | ||
77 | #define LED_ON OD_IOW( 'f', 5, LED_IN ) | 77 | #define LED_ON OD_IOW( 'f', 5, LED_IN ) |
78 | #define FLITE_ON OD_IOW( 'f', 7, FLITE_IN ) | 78 | #define FLITE_ON OD_IOW( 'f', 7, FLITE_IN ) |
79 | 79 | ||
80 | using namespace Opie; | 80 | using namespace Opie::Core::Private; |
81 | 81 | ||
82 | void Jornada::init() | 82 | void Jornada::init() |
83 | { | 83 | { |
84 | d->m_vendorstr = "HP"; | 84 | d->m_vendorstr = "HP"; |
85 | d->m_vendor = Vendor_HP; | 85 | d->m_vendor = Vendor_HP; |
86 | d->m_modelstr = "Jornada 56x"; | 86 | d->m_modelstr = "Jornada 56x"; |
87 | d->m_model = Model_Jornada_56x; | 87 | d->m_model = Model_Jornada_56x; |
88 | d->m_systemstr = "Familiar"; | 88 | d->m_systemstr = "Familiar"; |
89 | d->m_system = System_Familiar; | 89 | d->m_system = System_Familiar; |
90 | d->m_rotation = Rot0; | 90 | d->m_rotation = Rot0; |
91 | 91 | ||
92 | QFile f ( "/etc/familiar-version" ); | 92 | QFile f ( "/etc/familiar-version" ); |
93 | f.setName ( "/etc/familiar-version" ); | 93 | f.setName ( "/etc/familiar-version" ); |
94 | if ( f.open ( IO_ReadOnly )) { | 94 | if ( f.open ( IO_ReadOnly )) { |
95 | 95 | ||
96 | QTextStream ts ( &f ); | 96 | QTextStream ts ( &f ); |
97 | d->m_sysverstr = ts.readLine().mid( 10 ); | 97 | d->m_sysverstr = ts.readLine().mid( 10 ); |
98 | 98 | ||
99 | f. close(); | 99 | f. close(); |
100 | } | 100 | } |
101 | } | 101 | } |
102 | 102 | ||
103 | 103 | ||
104 | int Jornada::displayBrightnessResolution() const | 104 | int Jornada::displayBrightnessResolution() const |
diff --git a/libopie2/opiecore/device/odevice_jornada.h b/libopie2/opiecore/device/odevice_jornada.h index 59be8da..c37d75e 100644 --- a/libopie2/opiecore/device/odevice_jornada.h +++ b/libopie2/opiecore/device/odevice_jornada.h | |||
@@ -11,40 +11,43 @@ | |||
11 | - . .-<_> .<> Foundation; either version 2 of the License, | 11 | - . .-<_> .<> Foundation; either version 2 of the License, |
12 | ._= =} : or (at your option) any later version. | 12 | ._= =} : or (at your option) any later version. |
13 | .%`+i> _;_. | 13 | .%`+i> _;_. |
14 | .i_,=:_. -<s. This program is distributed in the hope that | 14 | .i_,=:_. -<s. This program is distributed in the hope that |
15 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 15 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
16 | : .. .:, . . . without even the implied warranty of | 16 | : .. .:, . . . without even the implied warranty of |
17 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 17 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
18 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | 18 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
19 | ..}^=.= = ; Library General Public License for more | 19 | ..}^=.= = ; Library General Public License for more |
20 | ++= -. .` .: details. | 20 | ++= -. .` .: details. |
21 | : = ...= . :.=- | 21 | : = ...= . :.=- |
22 | -. .:....=;==+<; You should have received a copy of the GNU | 22 | -. .:....=;==+<; You should have received a copy of the GNU |
23 | -_. . . )=. = Library General Public License along with | 23 | -_. . . )=. = Library General Public License along with |
24 | -- :-=` this library; see the file COPYING.LIB. | 24 | -- :-=` this library; see the file COPYING.LIB. |
25 | If not, write to the Free Software Foundation, | 25 | If not, write to the Free Software Foundation, |
26 | Inc., 59 Temple Place - Suite 330, | 26 | Inc., 59 Temple Place - Suite 330, |
27 | Boston, MA 02111-1307, USA. | 27 | Boston, MA 02111-1307, USA. |
28 | */ | 28 | */ |
29 | 29 | ||
30 | #ifndef ODEVICE_JORNADA | 30 | #ifndef ODEVICE_JORNADA |
31 | #define ODEVICE_JORNADA | 31 | #define ODEVICE_JORNADA |
32 | 32 | ||
33 | #include <opie2/odevice.h> | 33 | #include <opie2/odevice.h> |
34 | 34 | ||
35 | using namespace Opie; | 35 | namespace Opie { |
36 | 36 | namespace Core { | |
37 | namespace Private { | ||
37 | class Jornada : public ODevice | 38 | class Jornada : public ODevice |
38 | { | 39 | { |
39 | 40 | ||
40 | protected: | 41 | protected: |
41 | virtual void init(); | 42 | virtual void init(); |
42 | 43 | ||
43 | public: | 44 | public: |
44 | virtual bool setSoftSuspend ( bool soft ); | 45 | virtual bool setSoftSuspend ( bool soft ); |
45 | virtual bool setDisplayBrightness ( int b ); | 46 | virtual bool setDisplayBrightness ( int b ); |
46 | virtual int displayBrightnessResolution() const; | 47 | virtual int displayBrightnessResolution() const; |
47 | }; | 48 | }; |
48 | 49 | } | |
50 | } | ||
51 | } | ||
49 | #endif | 52 | #endif |
50 | 53 | ||
diff --git a/libopie2/opiecore/device/odevice_ramses.cpp b/libopie2/opiecore/device/odevice_ramses.cpp index 5bcf6a9..77de8c5 100644 --- a/libopie2/opiecore/device/odevice_ramses.cpp +++ b/libopie2/opiecore/device/odevice_ramses.cpp | |||
@@ -32,48 +32,51 @@ | |||
32 | /* QT */ | 32 | /* QT */ |
33 | #include <qapplication.h> | 33 | #include <qapplication.h> |
34 | #include <qfile.h> | 34 | #include <qfile.h> |
35 | #include <qtextstream.h> | 35 | #include <qtextstream.h> |
36 | #include <qwindowsystem_qws.h> | 36 | #include <qwindowsystem_qws.h> |
37 | 37 | ||
38 | /* OPIE */ | 38 | /* OPIE */ |
39 | #include <qpe/config.h> | 39 | #include <qpe/config.h> |
40 | #include <qpe/resource.h> | 40 | #include <qpe/resource.h> |
41 | #include <qpe/sound.h> | 41 | #include <qpe/sound.h> |
42 | #include <qpe/qcopenvelope_qws.h> | 42 | #include <qpe/qcopenvelope_qws.h> |
43 | 43 | ||
44 | /* STD */ | 44 | /* STD */ |
45 | #include <fcntl.h> | 45 | #include <fcntl.h> |
46 | #include <math.h> | 46 | #include <math.h> |
47 | #include <stdlib.h> | 47 | #include <stdlib.h> |
48 | #include <signal.h> | 48 | #include <signal.h> |
49 | #include <sys/ioctl.h> | 49 | #include <sys/ioctl.h> |
50 | #include <sys/time.h> | 50 | #include <sys/time.h> |
51 | #include <unistd.h> | 51 | #include <unistd.h> |
52 | #ifndef QT_NO_SOUND | 52 | #ifndef QT_NO_SOUND |
53 | #include <linux/soundcard.h> | 53 | #include <linux/soundcard.h> |
54 | #endif | 54 | #endif |
55 | 55 | ||
56 | using namespace Opie::Core; | ||
57 | using namespace Opie::Core::Private; | ||
58 | |||
56 | struct r_button ramses_buttons [] = { | 59 | struct r_button ramses_buttons [] = { |
57 | { Model_Ramses_MNCI, | 60 | { Model_Ramses_MNCI, |
58 | Qt::Key_F11, QT_TRANSLATE_NOOP("Button", "Menu Button"), | 61 | Qt::Key_F11, QT_TRANSLATE_NOOP("Button", "Menu Button"), |
59 | "devicebuttons/z_menu", | 62 | "devicebuttons/z_menu", |
60 | "QPE/TaskBar", "toggleMenu()", | 63 | "QPE/TaskBar", "toggleMenu()", |
61 | "QPE/TaskBar", "toggleStartMenu()" }, | 64 | "QPE/TaskBar", "toggleStartMenu()" }, |
62 | { Model_Ramses_MNCI, | 65 | { Model_Ramses_MNCI, |
63 | Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Home Button"), | 66 | Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Home Button"), |
64 | "devicebuttons/ipaq_home", | 67 | "devicebuttons/ipaq_home", |
65 | "QPE/Launcher", "home()", | 68 | "QPE/Launcher", "home()", |
66 | "buttonsettings", "raise()" }, | 69 | "buttonsettings", "raise()" }, |
67 | }; | 70 | }; |
68 | 71 | ||
69 | void Ramses::init() | 72 | void Ramses::init() |
70 | { | 73 | { |
71 | d->m_vendorstr = "M und N"; | 74 | d->m_vendorstr = "M und N"; |
72 | d->m_vendor = Vendor_MundN; | 75 | d->m_vendor = Vendor_MundN; |
73 | 76 | ||
74 | QFile f("/proc/sys/board/ramses"); | 77 | QFile f("/proc/sys/board/ramses"); |
75 | 78 | ||
76 | d->m_modelstr = "Ramses"; | 79 | d->m_modelstr = "Ramses"; |
77 | d->m_model = Model_Ramses_MNCI; | 80 | d->m_model = Model_Ramses_MNCI; |
78 | 81 | ||
79 | d->m_rotation = Rot0; | 82 | d->m_rotation = Rot0; |
diff --git a/libopie2/opiecore/device/odevice_ramses.h b/libopie2/opiecore/device/odevice_ramses.h index 1b660ab..e673b1a 100644 --- a/libopie2/opiecore/device/odevice_ramses.h +++ b/libopie2/opiecore/device/odevice_ramses.h | |||
@@ -13,60 +13,65 @@ | |||
13 | .%`+i> _;_. | 13 | .%`+i> _;_. |
14 | .i_,=:_. -<s. This program is distributed in the hope that | 14 | .i_,=:_. -<s. This program is distributed in the hope that |
15 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 15 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
16 | : .. .:, . . . without even the implied warranty of | 16 | : .. .:, . . . without even the implied warranty of |
17 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 17 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
18 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | 18 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
19 | ..}^=.= = ; Library General Public License for more | 19 | ..}^=.= = ; Library General Public License for more |
20 | ++= -. .` .: details. | 20 | ++= -. .` .: details. |
21 | : = ...= . :.=- | 21 | : = ...= . :.=- |
22 | -. .:....=;==+<; You should have received a copy of the GNU | 22 | -. .:....=;==+<; You should have received a copy of the GNU |
23 | -_. . . )=. = Library General Public License along with | 23 | -_. . . )=. = Library General Public License along with |
24 | -- :-=` this library; see the file COPYING.LIB. | 24 | -- :-=` this library; see the file COPYING.LIB. |
25 | If not, write to the Free Software Foundation, | 25 | If not, write to the Free Software Foundation, |
26 | Inc., 59 Temple Place - Suite 330, | 26 | Inc., 59 Temple Place - Suite 330, |
27 | Boston, MA 02111-1307, USA. | 27 | Boston, MA 02111-1307, USA. |
28 | */ | 28 | */ |
29 | 29 | ||
30 | #ifndef ODEVICE_RAMSES | 30 | #ifndef ODEVICE_RAMSES |
31 | #define ODEVICE_RAMSES | 31 | #define ODEVICE_RAMSES |
32 | 32 | ||
33 | #include <opie2/odevice.h> | 33 | #include <opie2/odevice.h> |
34 | /* QT */ | 34 | /* QT */ |
35 | #include <qwindowsystem_qws.h> | 35 | #include <qwindowsystem_qws.h> |
36 | 36 | ||
37 | using namespace Opie; | 37 | namespace Opie { |
38 | namespace Core { | ||
39 | namespace Private { | ||
38 | 40 | ||
39 | class Ramses : public ODevice, public QWSServer::KeyboardFilter | 41 | class Ramses : public ODevice, public QWSServer::KeyboardFilter |
40 | { | 42 | { |
41 | protected: | 43 | protected: |
42 | virtual void init(); | 44 | virtual void init(); |
43 | 45 | ||
44 | public: | 46 | public: |
45 | virtual bool setSoftSuspend( bool soft ); | 47 | virtual bool setSoftSuspend( bool soft ); |
46 | virtual bool suspend(); | 48 | virtual bool suspend(); |
47 | 49 | ||
48 | virtual bool setDisplayStatus( bool on ); | 50 | virtual bool setDisplayStatus( bool on ); |
49 | virtual bool setDisplayBrightness( int b ); | 51 | virtual bool setDisplayBrightness( int b ); |
50 | virtual int displayBrightnessResolution() const; | 52 | virtual int displayBrightnessResolution() const; |
51 | virtual bool setDisplayContrast( int b ); | 53 | virtual bool setDisplayContrast( int b ); |
52 | virtual int displayContrastResolution() const; | 54 | virtual int displayContrastResolution() const; |
53 | 55 | ||
54 | protected: | 56 | protected: |
55 | virtual bool filter ( int unicode, int keycode, int modifiers, bool isPress, bool autoRepeat ); | 57 | virtual bool filter ( int unicode, int keycode, int modifiers, bool isPress, bool autoRepeat ); |
56 | virtual void timerEvent ( QTimerEvent *te ); | 58 | virtual void timerEvent ( QTimerEvent *te ); |
57 | 59 | ||
58 | int m_power_timer; | 60 | int m_power_timer; |
59 | }; | 61 | }; |
60 | 62 | ||
61 | struct r_button { | 63 | struct r_button { |
62 | uint model; | 64 | uint model; |
63 | Qt::Key code; | 65 | Qt::Key code; |
64 | char *utext; | 66 | char *utext; |
65 | char *pix; | 67 | char *pix; |
66 | char *fpressedservice; | 68 | char *fpressedservice; |
67 | char *fpressedaction; | 69 | char *fpressedaction; |
68 | char *fheldservice; | 70 | char *fheldservice; |
69 | char *fheldaction; | 71 | char *fheldaction; |
70 | }; | 72 | }; |
73 | } | ||
74 | } | ||
75 | } | ||
71 | 76 | ||
72 | #endif | 77 | #endif |
diff --git a/libopie2/opiecore/device/odevice_simpad.cpp b/libopie2/opiecore/device/odevice_simpad.cpp index 90aca2f..80d40a3 100644 --- a/libopie2/opiecore/device/odevice_simpad.cpp +++ b/libopie2/opiecore/device/odevice_simpad.cpp | |||
@@ -32,49 +32,50 @@ _;:, .> :=|. This program is free software; you can | |||
32 | /* QT */ | 32 | /* QT */ |
33 | #include <qapplication.h> | 33 | #include <qapplication.h> |
34 | #include <qfile.h> | 34 | #include <qfile.h> |
35 | #include <qtextstream.h> | 35 | #include <qtextstream.h> |
36 | #include <qwindowsystem_qws.h> | 36 | #include <qwindowsystem_qws.h> |
37 | 37 | ||
38 | /* OPIE */ | 38 | /* OPIE */ |
39 | #include <qpe/config.h> | 39 | #include <qpe/config.h> |
40 | #include <qpe/resource.h> | 40 | #include <qpe/resource.h> |
41 | #include <qpe/sound.h> | 41 | #include <qpe/sound.h> |
42 | #include <qpe/qcopenvelope_qws.h> | 42 | #include <qpe/qcopenvelope_qws.h> |
43 | 43 | ||
44 | /* STD */ | 44 | /* STD */ |
45 | #include <fcntl.h> | 45 | #include <fcntl.h> |
46 | #include <math.h> | 46 | #include <math.h> |
47 | #include <stdlib.h> | 47 | #include <stdlib.h> |
48 | #include <signal.h> | 48 | #include <signal.h> |
49 | #include <sys/ioctl.h> | 49 | #include <sys/ioctl.h> |
50 | #include <sys/time.h> | 50 | #include <sys/time.h> |
51 | #include <unistd.h> | 51 | #include <unistd.h> |
52 | #ifndef QT_NO_SOUND | 52 | #ifndef QT_NO_SOUND |
53 | #include <linux/soundcard.h> | 53 | #include <linux/soundcard.h> |
54 | #endif | 54 | #endif |
55 | 55 | ||
56 | using namespace Opie; | 56 | using namespace Opie::Core; |
57 | using namespace Opie::Core::Private; | ||
57 | 58 | ||
58 | struct s_button simpad_buttons [] = { | 59 | struct s_button simpad_buttons [] = { |
59 | { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, | 60 | { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, |
60 | Qt::Key_F9, QT_TRANSLATE_NOOP("Button", "Lower+Up"), | 61 | Qt::Key_F9, QT_TRANSLATE_NOOP("Button", "Lower+Up"), |
61 | "devicebuttons/simpad_lower_up", | 62 | "devicebuttons/simpad_lower_up", |
62 | "datebook", "nextView()", | 63 | "datebook", "nextView()", |
63 | "today", "raise()" }, | 64 | "today", "raise()" }, |
64 | { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, | 65 | { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, |
65 | Qt::Key_F10, QT_TRANSLATE_NOOP("Button", "Lower+Down"), | 66 | Qt::Key_F10, QT_TRANSLATE_NOOP("Button", "Lower+Down"), |
66 | "devicebuttons/simpad_lower_down", | 67 | "devicebuttons/simpad_lower_down", |
67 | "addressbook", "raise()", | 68 | "addressbook", "raise()", |
68 | "addressbook", "beamBusinessCard()" }, | 69 | "addressbook", "beamBusinessCard()" }, |
69 | { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, | 70 | { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, |
70 | Qt::Key_F11, QT_TRANSLATE_NOOP("Button", "Lower+Right"), | 71 | Qt::Key_F11, QT_TRANSLATE_NOOP("Button", "Lower+Right"), |
71 | "devicebuttons/simpad_lower_right", | 72 | "devicebuttons/simpad_lower_right", |
72 | "QPE/TaskBar", "toggleMenu()", | 73 | "QPE/TaskBar", "toggleMenu()", |
73 | "QPE/TaskBar", "toggleStartMenu()" }, | 74 | "QPE/TaskBar", "toggleStartMenu()" }, |
74 | { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, | 75 | { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, |
75 | Qt::Key_F13, QT_TRANSLATE_NOOP("Button", "Lower+Left"), | 76 | Qt::Key_F13, QT_TRANSLATE_NOOP("Button", "Lower+Left"), |
76 | "devicebuttons/simpad_lower_left", | 77 | "devicebuttons/simpad_lower_left", |
77 | "mail", "raise()", | 78 | "mail", "raise()", |
78 | "mail", "newMail()" }, | 79 | "mail", "newMail()" }, |
79 | 80 | ||
80 | { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, | 81 | { Model_SIMpad_CL4 | Model_SIMpad_SL4 | Model_SIMpad_SLC | Model_SIMpad_TSinus, |
diff --git a/libopie2/opiecore/device/odevice_simpad.h b/libopie2/opiecore/device/odevice_simpad.h index 3287ee8..1848151 100644 --- a/libopie2/opiecore/device/odevice_simpad.h +++ b/libopie2/opiecore/device/odevice_simpad.h | |||
@@ -14,68 +14,74 @@ | |||
14 | .i_,=:_. -<s. This program is distributed in the hope that | 14 | .i_,=:_. -<s. This program is distributed in the hope that |
15 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 15 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
16 | : .. .:, . . . without even the implied warranty of | 16 | : .. .:, . . . without even the implied warranty of |
17 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 17 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
18 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | 18 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
19 | ..}^=.= = ; Library General Public License for more | 19 | ..}^=.= = ; Library General Public License for more |
20 | ++= -. .` .: details. | 20 | ++= -. .` .: details. |
21 | : = ...= . :.=- | 21 | : = ...= . :.=- |
22 | -. .:....=;==+<; You should have received a copy of the GNU | 22 | -. .:....=;==+<; You should have received a copy of the GNU |
23 | -_. . . )=. = Library General Public License along with | 23 | -_. . . )=. = Library General Public License along with |
24 | -- :-=` this library; see the file COPYING.LIB. | 24 | -- :-=` this library; see the file COPYING.LIB. |
25 | If not, write to the Free Software Foundation, | 25 | If not, write to the Free Software Foundation, |
26 | Inc., 59 Temple Place - Suite 330, | 26 | Inc., 59 Temple Place - Suite 330, |
27 | Boston, MA 02111-1307, USA. | 27 | Boston, MA 02111-1307, USA. |
28 | */ | 28 | */ |
29 | 29 | ||
30 | #ifndef ODEVICE_SIMPAD | 30 | #ifndef ODEVICE_SIMPAD |
31 | #define ODEVICE_SIMPAD | 31 | #define ODEVICE_SIMPAD |
32 | 32 | ||
33 | #include <opie2/odevice.h> | 33 | #include <opie2/odevice.h> |
34 | 34 | ||
35 | /* QT */ | 35 | /* QT */ |
36 | #include <qwindowsystem_qws.h> | 36 | #include <qwindowsystem_qws.h> |
37 | 37 | ||
38 | using namespace Opie; | 38 | namespace Opie { |
39 | namespace Core { | ||
40 | namespace Private { | ||
39 | 41 | ||
40 | class SIMpad : public ODevice, public QWSServer::KeyboardFilter | 42 | class SIMpad : public ODevice, public QWSServer::KeyboardFilter |
41 | { | 43 | { |
42 | protected: | 44 | protected: |
43 | virtual void init(); | 45 | virtual void init(); |
44 | virtual void initButtons(); | 46 | virtual void initButtons(); |
45 | 47 | ||
46 | public: | 48 | public: |
47 | virtual bool setSoftSuspend( bool soft ); | 49 | virtual bool setSoftSuspend( bool soft ); |
48 | virtual bool suspend(); | 50 | virtual bool suspend(); |
49 | 51 | ||
50 | virtual bool setDisplayStatus( bool on ); | 52 | virtual bool setDisplayStatus( bool on ); |
51 | virtual bool setDisplayBrightness( int b ); | 53 | virtual bool setDisplayBrightness( int b ); |
52 | virtual int displayBrightnessResolution() const; | 54 | virtual int displayBrightnessResolution() const; |
53 | 55 | ||
54 | virtual void playAlarmSound(); | 56 | virtual void playAlarmSound(); |
55 | 57 | ||
56 | virtual QValueList <OLed> ledList() const; | 58 | virtual QValueList <OLed> ledList() const; |
57 | virtual QValueList <OLedState> ledStateList( OLed led ) const; | 59 | virtual QValueList <OLedState> ledStateList( OLed led ) const; |
58 | virtual OLedState ledState( OLed led ) const; | 60 | virtual OLedState ledState( OLed led ) const; |
59 | virtual bool setLedState( OLed led, OLedState st ); | 61 | virtual bool setLedState( OLed led, OLedState st ); |
60 | 62 | ||
61 | protected: | 63 | protected: |
62 | virtual bool filter( int unicode, int keycode, int modifiers, bool isPress, bool autoRepeat ); | 64 | virtual bool filter( int unicode, int keycode, int modifiers, bool isPress, bool autoRepeat ); |
63 | virtual void timerEvent( QTimerEvent *te ); | 65 | virtual void timerEvent( QTimerEvent *te ); |
64 | 66 | ||
65 | int m_power_timer; | 67 | int m_power_timer; |
66 | 68 | ||
67 | OLedState m_leds [1]; | 69 | OLedState m_leds [1]; |
68 | }; | 70 | }; |
69 | 71 | ||
70 | struct s_button { | 72 | struct s_button { |
71 | uint model; | 73 | uint model; |
72 | Qt::Key code; | 74 | Qt::Key code; |
73 | char *utext; | 75 | char *utext; |
74 | char *pix; | 76 | char *pix; |
75 | char *fpressedservice; | 77 | char *fpressedservice; |
76 | char *fpressedaction; | 78 | char *fpressedaction; |
77 | char *fheldservice; | 79 | char *fheldservice; |
78 | char *fheldaction; | 80 | char *fheldaction; |
79 | }; | 81 | }; |
80 | 82 | ||
83 | } | ||
84 | } | ||
85 | } | ||
86 | |||
81 | #endif | 87 | #endif |
diff --git a/libopie2/opiecore/device/odevice_yopy.cpp b/libopie2/opiecore/device/odevice_yopy.cpp index d241db8..f7a4025 100644 --- a/libopie2/opiecore/device/odevice_yopy.cpp +++ b/libopie2/opiecore/device/odevice_yopy.cpp | |||
@@ -32,49 +32,50 @@ _;:, .> :=|. This program is free software; you can | |||
32 | /* QT */ | 32 | /* QT */ |
33 | #include <qapplication.h> | 33 | #include <qapplication.h> |
34 | #include <qfile.h> | 34 | #include <qfile.h> |
35 | #include <qtextstream.h> | 35 | #include <qtextstream.h> |
36 | #include <qwindowsystem_qws.h> | 36 | #include <qwindowsystem_qws.h> |
37 | 37 | ||
38 | /* OPIE */ | 38 | /* OPIE */ |
39 | #include <qpe/config.h> | 39 | #include <qpe/config.h> |
40 | #include <qpe/resource.h> | 40 | #include <qpe/resource.h> |
41 | #include <qpe/sound.h> | 41 | #include <qpe/sound.h> |
42 | #include <qpe/qcopenvelope_qws.h> | 42 | #include <qpe/qcopenvelope_qws.h> |
43 | 43 | ||
44 | /* STD */ | 44 | /* STD */ |
45 | #include <fcntl.h> | 45 | #include <fcntl.h> |
46 | #include <math.h> | 46 | #include <math.h> |
47 | #include <stdlib.h> | 47 | #include <stdlib.h> |
48 | #include <signal.h> | 48 | #include <signal.h> |
49 | #include <sys/ioctl.h> | 49 | #include <sys/ioctl.h> |
50 | #include <sys/time.h> | 50 | #include <sys/time.h> |
51 | #include <unistd.h> | 51 | #include <unistd.h> |
52 | #ifndef QT_NO_SOUND | 52 | #ifndef QT_NO_SOUND |
53 | #include <linux/soundcard.h> | 53 | #include <linux/soundcard.h> |
54 | #endif | 54 | #endif |
55 | 55 | ||
56 | using namespace Opie; | 56 | using namespace Opie::Core; |
57 | using namespace Opie::Core::Private; | ||
57 | 58 | ||
58 | struct yopy_button yopy_buttons [] = { | 59 | struct yopy_button yopy_buttons [] = { |
59 | { Qt::Key_F10, QT_TRANSLATE_NOOP( "Button", "Action Button" ), | 60 | { Qt::Key_F10, QT_TRANSLATE_NOOP( "Button", "Action Button" ), |
60 | "devicebuttons/yopy_action", | 61 | "devicebuttons/yopy_action", |
61 | "datebook", "nextView()", | 62 | "datebook", "nextView()", |
62 | "today", "raise()" }, | 63 | "today", "raise()" }, |
63 | { Qt::Key_F11, QT_TRANSLATE_NOOP( "Button", "OK Button" ), | 64 | { Qt::Key_F11, QT_TRANSLATE_NOOP( "Button", "OK Button" ), |
64 | "devicebuttons/yopy_ok", | 65 | "devicebuttons/yopy_ok", |
65 | "addressbook", "raise()", | 66 | "addressbook", "raise()", |
66 | "addressbook", "beamBusinessCard()" }, | 67 | "addressbook", "beamBusinessCard()" }, |
67 | { Qt::Key_F12, QT_TRANSLATE_NOOP( "Button", "End Button" ), | 68 | { Qt::Key_F12, QT_TRANSLATE_NOOP( "Button", "End Button" ), |
68 | "devicebuttons/yopy_end", | 69 | "devicebuttons/yopy_end", |
69 | "QPE/Launcher", "home()", | 70 | "QPE/Launcher", "home()", |
70 | "buttonsettings", "raise()" }, | 71 | "buttonsettings", "raise()" }, |
71 | }; | 72 | }; |
72 | 73 | ||
73 | void Yopy::init() | 74 | void Yopy::init() |
74 | { | 75 | { |
75 | d->m_vendorstr = "G.Mate"; | 76 | d->m_vendorstr = "G.Mate"; |
76 | d->m_vendor = Vendor_GMate; | 77 | d->m_vendor = Vendor_GMate; |
77 | d->m_modelstr = "Yopy3700"; | 78 | d->m_modelstr = "Yopy3700"; |
78 | d->m_model = Model_Yopy_3700; | 79 | d->m_model = Model_Yopy_3700; |
79 | d->m_rotation = Rot0; | 80 | d->m_rotation = Rot0; |
80 | 81 | ||
diff --git a/libopie2/opiecore/device/odevice_yopy.h b/libopie2/opiecore/device/odevice_yopy.h index be8f62c..7d85479 100644 --- a/libopie2/opiecore/device/odevice_yopy.h +++ b/libopie2/opiecore/device/odevice_yopy.h | |||
@@ -11,52 +11,57 @@ _;:, .> :=|. This program is free software; you can | |||
11 | - . .-<_> .<> Foundation; either version 2 of the License, | 11 | - . .-<_> .<> Foundation; either version 2 of the License, |
12 | ._= =} : or (at your option) any later version. | 12 | ._= =} : or (at your option) any later version. |
13 | .%`+i> _;_. | 13 | .%`+i> _;_. |
14 | .i_,=:_. -<s. This program is distributed in the hope that | 14 | .i_,=:_. -<s. This program is distributed in the hope that |
15 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 15 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
16 | : .. .:, . . . without even the implied warranty of | 16 | : .. .:, . . . without even the implied warranty of |
17 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 17 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
18 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | 18 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
19 | ..}^=.= = ; Library General Public License for more | 19 | ..}^=.= = ; Library General Public License for more |
20 | ++= -. .` .: details. | 20 | ++= -. .` .: details. |
21 | : = ...= . :.=- | 21 | : = ...= . :.=- |
22 | -. .:....=;==+<; You should have received a copy of the GNU | 22 | -. .:....=;==+<; You should have received a copy of the GNU |
23 | -_. . . )=. = Library General Public License along with | 23 | -_. . . )=. = Library General Public License along with |
24 | -- :-=` this library; see the file COPYING.LIB. | 24 | -- :-=` this library; see the file COPYING.LIB. |
25 | If not, write to the Free Software Foundation, | 25 | If not, write to the Free Software Foundation, |
26 | Inc., 59 Temple Place - Suite 330, | 26 | Inc., 59 Temple Place - Suite 330, |
27 | Boston, MA 02111-1307, USA. | 27 | Boston, MA 02111-1307, USA. |
28 | */ | 28 | */ |
29 | 29 | ||
30 | #ifndef ODEVICE_YOPY | 30 | #ifndef ODEVICE_YOPY |
31 | #define ODEVICE_YOPY | 31 | #define ODEVICE_YOPY |
32 | 32 | ||
33 | #include <opie2/odevice.h> | 33 | #include <opie2/odevice.h> |
34 | 34 | ||
35 | using namespace Opie; | 35 | namespace Opie { |
36 | 36 | namespace Core { | |
37 | namespace Private { | ||
37 | class Yopy : public ODevice | 38 | class Yopy : public ODevice |
38 | { | 39 | { |
39 | protected: | 40 | protected: |
40 | 41 | ||
41 | virtual void init(); | 42 | virtual void init(); |
42 | virtual void initButtons(); | 43 | virtual void initButtons(); |
43 | 44 | ||
44 | public: | 45 | public: |
45 | virtual bool suspend(); | 46 | virtual bool suspend(); |
46 | 47 | ||
47 | virtual bool setDisplayBrightness ( int b ); | 48 | virtual bool setDisplayBrightness ( int b ); |
48 | virtual int displayBrightnessResolution() const; | 49 | virtual int displayBrightnessResolution() const; |
49 | }; | 50 | }; |
50 | 51 | ||
51 | struct yopy_button | 52 | struct yopy_button |
52 | { | 53 | { |
53 | Qt::Key code; | 54 | Qt::Key code; |
54 | char *utext; | 55 | char *utext; |
55 | char *pix; | 56 | char *pix; |
56 | char *fpressedservice; | 57 | char *fpressedservice; |
57 | char *fpressedaction; | 58 | char *fpressedaction; |
58 | char *fheldservice; | 59 | char *fheldservice; |
59 | char *fheldaction; | 60 | char *fheldaction; |
60 | }; | 61 | }; |
61 | 62 | ||
63 | } | ||
64 | } | ||
65 | } | ||
66 | |||
62 | #endif | 67 | #endif |
diff --git a/libopie2/opiecore/device/odevice_zaurus.cpp b/libopie2/opiecore/device/odevice_zaurus.cpp index 8ab3cbe..0d21f26 100644 --- a/libopie2/opiecore/device/odevice_zaurus.cpp +++ b/libopie2/opiecore/device/odevice_zaurus.cpp | |||
@@ -32,49 +32,50 @@ _;:, .> :=|. This program is free software; you can | |||
32 | /* QT */ | 32 | /* QT */ |
33 | #include <qapplication.h> | 33 | #include <qapplication.h> |
34 | #include <qfile.h> | 34 | #include <qfile.h> |
35 | #include <qtextstream.h> | 35 | #include <qtextstream.h> |
36 | #include <qwindowsystem_qws.h> | 36 | #include <qwindowsystem_qws.h> |
37 | 37 | ||
38 | /* OPIE */ | 38 | /* OPIE */ |
39 | #include <qpe/config.h> | 39 | #include <qpe/config.h> |
40 | #include <qpe/resource.h> | 40 | #include <qpe/resource.h> |
41 | #include <qpe/sound.h> | 41 | #include <qpe/sound.h> |
42 | #include <qpe/qcopenvelope_qws.h> | 42 | #include <qpe/qcopenvelope_qws.h> |
43 | 43 | ||
44 | /* STD */ | 44 | /* STD */ |
45 | #include <fcntl.h> | 45 | #include <fcntl.h> |
46 | #include <math.h> | 46 | #include <math.h> |
47 | #include <stdlib.h> | 47 | #include <stdlib.h> |
48 | #include <signal.h> | 48 | #include <signal.h> |
49 | #include <sys/ioctl.h> | 49 | #include <sys/ioctl.h> |
50 | #include <sys/time.h> | 50 | #include <sys/time.h> |
51 | #include <unistd.h> | 51 | #include <unistd.h> |
52 | #ifndef QT_NO_SOUND | 52 | #ifndef QT_NO_SOUND |
53 | #include <linux/soundcard.h> | 53 | #include <linux/soundcard.h> |
54 | #endif | 54 | #endif |
55 | 55 | ||
56 | using namespace Opie; | 56 | using namespace Opie::Core; |
57 | using namespace Opie::Core::Private; | ||
57 | 58 | ||
58 | struct z_button z_buttons [] = { | 59 | struct z_button z_buttons [] = { |
59 | { Qt::Key_F9, QT_TRANSLATE_NOOP("Button", "Calendar Button"), | 60 | { Qt::Key_F9, QT_TRANSLATE_NOOP("Button", "Calendar Button"), |
60 | "devicebuttons/z_calendar", | 61 | "devicebuttons/z_calendar", |
61 | "datebook", "nextView()", | 62 | "datebook", "nextView()", |
62 | "today", "raise()" }, | 63 | "today", "raise()" }, |
63 | { Qt::Key_F10, QT_TRANSLATE_NOOP("Button", "Contacts Button"), | 64 | { Qt::Key_F10, QT_TRANSLATE_NOOP("Button", "Contacts Button"), |
64 | "devicebuttons/z_contact", | 65 | "devicebuttons/z_contact", |
65 | "addressbook", "raise()", | 66 | "addressbook", "raise()", |
66 | "addressbook", "beamBusinessCard()" }, | 67 | "addressbook", "beamBusinessCard()" }, |
67 | { Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Home Button"), | 68 | { Qt::Key_F12, QT_TRANSLATE_NOOP("Button", "Home Button"), |
68 | "devicebuttons/z_home", | 69 | "devicebuttons/z_home", |
69 | "QPE/Launcher", "home()", | 70 | "QPE/Launcher", "home()", |
70 | "buttonsettings", "raise()" }, | 71 | "buttonsettings", "raise()" }, |
71 | { Qt::Key_F11, QT_TRANSLATE_NOOP("Button", "Menu Button"), | 72 | { Qt::Key_F11, QT_TRANSLATE_NOOP("Button", "Menu Button"), |
72 | "devicebuttons/z_menu", | 73 | "devicebuttons/z_menu", |
73 | "QPE/TaskBar", "toggleMenu()", | 74 | "QPE/TaskBar", "toggleMenu()", |
74 | "QPE/TaskBar", "toggleStartMenu()" }, | 75 | "QPE/TaskBar", "toggleStartMenu()" }, |
75 | { Qt::Key_F13, QT_TRANSLATE_NOOP("Button", "Mail Button"), | 76 | { Qt::Key_F13, QT_TRANSLATE_NOOP("Button", "Mail Button"), |
76 | "devicebuttons/z_mail", | 77 | "devicebuttons/z_mail", |
77 | "mail", "raise()", | 78 | "mail", "raise()", |
78 | "mail", "newMail()" }, | 79 | "mail", "newMail()" }, |
79 | }; | 80 | }; |
80 | 81 | ||
diff --git a/libopie2/opiecore/device/odevice_zaurus.h b/libopie2/opiecore/device/odevice_zaurus.h index f5c5172..ffb648f 100644 --- a/libopie2/opiecore/device/odevice_zaurus.h +++ b/libopie2/opiecore/device/odevice_zaurus.h | |||
@@ -24,73 +24,77 @@ | |||
24 | -- :-=` this library; see the file COPYING.LIB. | 24 | -- :-=` this library; see the file COPYING.LIB. |
25 | If not, write to the Free Software Foundation, | 25 | If not, write to the Free Software Foundation, |
26 | Inc., 59 Temple Place - Suite 330, | 26 | Inc., 59 Temple Place - Suite 330, |
27 | Boston, MA 02111-1307, USA. | 27 | Boston, MA 02111-1307, USA. |
28 | */ | 28 | */ |
29 | 29 | ||
30 | #ifndef ODEVICE_ZAURUS | 30 | #ifndef ODEVICE_ZAURUS |
31 | #define ODEVICE_ZAURUS | 31 | #define ODEVICE_ZAURUS |
32 | 32 | ||
33 | #include <opie2/odevice.h> | 33 | #include <opie2/odevice.h> |
34 | 34 | ||
35 | #ifndef ARRAY_SIZE | 35 | #ifndef ARRAY_SIZE |
36 | #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) | 36 | #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) |
37 | #endif | 37 | #endif |
38 | 38 | ||
39 | // _IO and friends are only defined in kernel headers ... | 39 | // _IO and friends are only defined in kernel headers ... |
40 | 40 | ||
41 | #define OD_IOC(dir,type,number,size) (( dir << 30 ) | ( type << 8 ) | ( number ) | ( size << 16 )) | 41 | #define OD_IOC(dir,type,number,size) (( dir << 30 ) | ( type << 8 ) | ( number ) | ( size << 16 )) |
42 | 42 | ||
43 | #define OD_IO(type,number) OD_IOC(0,type,number,0) | 43 | #define OD_IO(type,number) OD_IOC(0,type,number,0) |
44 | #define OD_IOW(type,number,size) OD_IOC(1,type,number,sizeof(size)) | 44 | #define OD_IOW(type,number,size) OD_IOC(1,type,number,sizeof(size)) |
45 | #define OD_IOR(type,number,size) OD_IOC(2,type,number,sizeof(size)) | 45 | #define OD_IOR(type,number,size) OD_IOC(2,type,number,sizeof(size)) |
46 | #define OD_IORW(type,number,size) OD_IOC(3,type,number,sizeof(size)) | 46 | #define OD_IORW(type,number,size) OD_IOC(3,type,number,sizeof(size)) |
47 | 47 | ||
48 | using namespace Opie; | ||
49 | 48 | ||
49 | namespace Opie { | ||
50 | namespace Core { | ||
51 | namespace Private { | ||
50 | class Zaurus : public ODevice | 52 | class Zaurus : public ODevice |
51 | { | 53 | { |
52 | 54 | ||
53 | protected: | 55 | protected: |
54 | virtual void init(); | 56 | virtual void init(); |
55 | virtual void initButtons(); | 57 | virtual void initButtons(); |
56 | 58 | ||
57 | public: | 59 | public: |
58 | virtual bool setSoftSuspend ( bool soft ); | 60 | virtual bool setSoftSuspend ( bool soft ); |
59 | 61 | ||
60 | virtual bool setDisplayBrightness ( int b ); | 62 | virtual bool setDisplayBrightness ( int b ); |
61 | virtual int displayBrightnessResolution() const; | 63 | virtual int displayBrightnessResolution() const; |
62 | 64 | ||
63 | virtual void playAlarmSound(); | 65 | virtual void playAlarmSound(); |
64 | virtual void playKeySound(); | 66 | virtual void playKeySound(); |
65 | virtual void playTouchSound(); | 67 | virtual void playTouchSound(); |
66 | 68 | ||
67 | virtual QValueList <OLed> ledList() const; | 69 | virtual QValueList <OLed> ledList() const; |
68 | virtual QValueList <OLedState> ledStateList ( OLed led ) const; | 70 | virtual QValueList <OLedState> ledStateList ( OLed led ) const; |
69 | virtual OLedState ledState( OLed led ) const; | 71 | virtual OLedState ledState( OLed led ) const; |
70 | virtual bool setLedState( OLed led, OLedState st ); | 72 | virtual bool setLedState( OLed led, OLedState st ); |
71 | 73 | ||
72 | virtual bool hasHingeSensor() const; | 74 | virtual bool hasHingeSensor() const; |
73 | virtual OHingeStatus readHingeSensor(); | 75 | virtual OHingeStatus readHingeSensor(); |
74 | 76 | ||
75 | virtual bool suspend(); | 77 | virtual bool suspend(); |
76 | virtual Transformation rotation() const; | 78 | virtual Transformation rotation() const; |
77 | virtual ODirection direction() const; | 79 | virtual ODirection direction() const; |
78 | 80 | ||
79 | protected: | 81 | protected: |
80 | virtual void buzzer ( int snd ); | 82 | virtual void buzzer ( int snd ); |
81 | 83 | ||
82 | OLedState m_leds [1]; | 84 | OLedState m_leds [1]; |
83 | bool m_embedix; | 85 | bool m_embedix; |
84 | }; | 86 | }; |
85 | 87 | ||
86 | struct z_button { | 88 | struct z_button { |
87 | Qt::Key code; | 89 | Qt::Key code; |
88 | char *utext; | 90 | char *utext; |
89 | char *pix; | 91 | char *pix; |
90 | char *fpressedservice; | 92 | char *fpressedservice; |
91 | char *fpressedaction; | 93 | char *fpressedaction; |
92 | char *fheldservice; | 94 | char *fheldservice; |
93 | char *fheldaction; | 95 | char *fheldaction; |
94 | }; | 96 | }; |
95 | 97 | } | |
98 | } | ||
99 | } | ||
96 | #endif | 100 | #endif |
diff --git a/libopie2/opiecore/device/odevicebutton.cpp b/libopie2/opiecore/device/odevicebutton.cpp index 0b593d5..a081b7f 100644 --- a/libopie2/opiecore/device/odevicebutton.cpp +++ b/libopie2/opiecore/device/odevicebutton.cpp | |||
@@ -12,58 +12,64 @@ | |||
12 | ._= =} : or (at your option) any later version. | 12 | ._= =} : or (at your option) any later version. |
13 | .%`+i> _;_. | 13 | .%`+i> _;_. |
14 | .i_,=:_. -<s. This program is distributed in the hope that | 14 | .i_,=:_. -<s. This program is distributed in the hope that |
15 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 15 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
16 | : .. .:, . . . without even the implied warranty of | 16 | : .. .:, . . . without even the implied warranty of |
17 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 17 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
18 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | 18 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
19 | ..}^=.= = ; Library General Public License for more | 19 | ..}^=.= = ; Library General Public License for more |
20 | ++= -. .` .: details. | 20 | ++= -. .` .: details. |
21 | : = ...= . :.=- | 21 | : = ...= . :.=- |
22 | -. .:....=;==+<; You should have received a copy of the GNU | 22 | -. .:....=;==+<; You should have received a copy of the GNU |
23 | -_. . . )=. = Library General Public License along with | 23 | -_. . . )=. = Library General Public License along with |
24 | -- :-=` this library; see the file COPYING.LIB. | 24 | -- :-=` this library; see the file COPYING.LIB. |
25 | If not, write to the Free Software Foundation, | 25 | If not, write to the Free Software Foundation, |
26 | Inc., 59 Temple Place - Suite 330, | 26 | Inc., 59 Temple Place - Suite 330, |
27 | Boston, MA 02111-1307, USA. | 27 | Boston, MA 02111-1307, USA. |
28 | */ | 28 | */ |
29 | 29 | ||
30 | #include <qpixmap.h> | 30 | #include <qpixmap.h> |
31 | #include <qstring.h> | 31 | #include <qstring.h> |
32 | 32 | ||
33 | #include <qpe/qcopenvelope_qws.h> | 33 | #include <qpe/qcopenvelope_qws.h> |
34 | #include <opie2/odevicebutton.h> | 34 | #include <opie2/odevicebutton.h> |
35 | 35 | ||
36 | using namespace Opie; | 36 | |
37 | namespace Opie { | ||
38 | namespace Core { | ||
39 | namespace Private { | ||
37 | 40 | ||
38 | class OQCopMessageData | 41 | class OQCopMessageData |
39 | { | 42 | { |
40 | public: | 43 | public: |
41 | QCString m_channel; | 44 | QCString m_channel; |
42 | QCString m_message; | 45 | QCString m_message; |
43 | QByteArray m_data; | 46 | QByteArray m_data; |
44 | }; | 47 | }; |
48 | } | ||
45 | 49 | ||
50 | using namespace Opie::Core; | ||
51 | using namespace Opie::Core::Private; | ||
46 | 52 | ||
47 | OQCopMessage::OQCopMessage() | 53 | OQCopMessage::OQCopMessage() |
48 | : d ( 0 ) | 54 | : d ( 0 ) |
49 | { | 55 | { |
50 | init ( QCString(), QCString(), QByteArray()); | 56 | init ( QCString(), QCString(), QByteArray()); |
51 | } | 57 | } |
52 | 58 | ||
53 | OQCopMessage::OQCopMessage ( const OQCopMessage © ) | 59 | OQCopMessage::OQCopMessage ( const OQCopMessage © ) |
54 | : d ( 0 ) | 60 | : d ( 0 ) |
55 | { | 61 | { |
56 | init ( copy. channel(), copy. message(), copy. data()); | 62 | init ( copy. channel(), copy. message(), copy. data()); |
57 | } | 63 | } |
58 | 64 | ||
59 | OQCopMessage &OQCopMessage::operator = ( const OQCopMessage &assign ) | 65 | OQCopMessage &OQCopMessage::operator = ( const OQCopMessage &assign ) |
60 | { | 66 | { |
61 | init ( assign. channel(), assign. message(), assign. data()); | 67 | init ( assign. channel(), assign. message(), assign. data()); |
62 | return *this; | 68 | return *this; |
63 | } | 69 | } |
64 | 70 | ||
65 | OQCopMessage::OQCopMessage ( const QCString &ch, const QCString &m, const QByteArray &arg ) | 71 | OQCopMessage::OQCopMessage ( const QCString &ch, const QCString &m, const QByteArray &arg ) |
66 | : d ( 0 ) | 72 | : d ( 0 ) |
67 | { | 73 | { |
68 | init ( ch, m, arg ); | 74 | init ( ch, m, arg ); |
69 | } | 75 | } |
@@ -103,50 +109,50 @@ QCString OQCopMessage::message() const | |||
103 | QByteArray OQCopMessage::data() const | 109 | QByteArray OQCopMessage::data() const |
104 | { | 110 | { |
105 | return d->m_data; | 111 | return d->m_data; |
106 | } | 112 | } |
107 | 113 | ||
108 | bool OQCopMessage::isNull() const | 114 | bool OQCopMessage::isNull() const |
109 | { | 115 | { |
110 | return d->m_message.isNull() || d->m_channel.isNull(); | 116 | return d->m_message.isNull() || d->m_channel.isNull(); |
111 | } | 117 | } |
112 | void OQCopMessage::setChannel ( const QCString &ch ) | 118 | void OQCopMessage::setChannel ( const QCString &ch ) |
113 | { | 119 | { |
114 | d->m_channel = ch; | 120 | d->m_channel = ch; |
115 | } | 121 | } |
116 | 122 | ||
117 | void OQCopMessage::setMessage ( const QCString &m ) | 123 | void OQCopMessage::setMessage ( const QCString &m ) |
118 | { | 124 | { |
119 | d->m_message = m; | 125 | d->m_message = m; |
120 | } | 126 | } |
121 | 127 | ||
122 | void OQCopMessage::setData ( const QByteArray &data ) | 128 | void OQCopMessage::setData ( const QByteArray &data ) |
123 | { | 129 | { |
124 | d->m_data = data; | 130 | d->m_data = data; |
125 | } | 131 | } |
126 | 132 | ||
127 | /*! \class Opie::ODeviceButton | 133 | /*! \class Opie::Core::ODeviceButton |
128 | \brief The Opie::ODeviceButton class represents a physical user mappable button on a Qtopia device. | 134 | \brief The Opie::Core::ODeviceButton class represents a physical user mappable button on a Qtopia device. |
129 | 135 | ||
130 | This class represents a physical button on a Qtopia device. A | 136 | This class represents a physical button on a Qtopia device. A |
131 | device may have "user programmable" buttons. | 137 | device may have "user programmable" buttons. |
132 | The location and number of buttons will vary from device to | 138 | The location and number of buttons will vary from device to |
133 | device. userText() and pixmap() may be used to describe this button | 139 | device. userText() and pixmap() may be used to describe this button |
134 | to the user in help documentation. | 140 | to the user in help documentation. |
135 | 141 | ||
136 | \ingroup qtopiaemb | 142 | \ingroup qtopiaemb |
137 | \internal | 143 | \internal |
138 | */ | 144 | */ |
139 | 145 | ||
140 | ODeviceButton::ODeviceButton() | 146 | ODeviceButton::ODeviceButton() |
141 | {} | 147 | {} |
142 | 148 | ||
143 | ODeviceButton::~ODeviceButton() | 149 | ODeviceButton::~ODeviceButton() |
144 | {} | 150 | {} |
145 | 151 | ||
146 | /*! | 152 | /*! |
147 | Returns the button's keycode. | 153 | Returns the button's keycode. |
148 | */ | 154 | */ |
149 | ushort ODeviceButton::keycode() const | 155 | ushort ODeviceButton::keycode() const |
150 | { | 156 | { |
151 | return m_Keycode; | 157 | return m_Keycode; |
152 | } | 158 | } |
@@ -223,24 +229,27 @@ void ODeviceButton::setPixmap(const QPixmap& picture) | |||
223 | { | 229 | { |
224 | m_Pixmap = picture; | 230 | m_Pixmap = picture; |
225 | } | 231 | } |
226 | 232 | ||
227 | void ODeviceButton::setFactoryPresetPressedAction(const OQCopMessage& action) | 233 | void ODeviceButton::setFactoryPresetPressedAction(const OQCopMessage& action) |
228 | { | 234 | { |
229 | m_FactoryPresetPressedAction = action; | 235 | m_FactoryPresetPressedAction = action; |
230 | } | 236 | } |
231 | 237 | ||
232 | 238 | ||
233 | void ODeviceButton::setPressedAction(const OQCopMessage& action) | 239 | void ODeviceButton::setPressedAction(const OQCopMessage& action) |
234 | { | 240 | { |
235 | m_PressedAction = action; | 241 | m_PressedAction = action; |
236 | } | 242 | } |
237 | 243 | ||
238 | void ODeviceButton::setFactoryPresetHeldAction(const OQCopMessage& action) | 244 | void ODeviceButton::setFactoryPresetHeldAction(const OQCopMessage& action) |
239 | { | 245 | { |
240 | m_FactoryPresetHeldAction = action; | 246 | m_FactoryPresetHeldAction = action; |
241 | } | 247 | } |
242 | 248 | ||
243 | void ODeviceButton::setHeldAction(const OQCopMessage& action) | 249 | void ODeviceButton::setHeldAction(const OQCopMessage& action) |
244 | { | 250 | { |
245 | m_HeldAction = action; | 251 | m_HeldAction = action; |
246 | } | 252 | } |
253 | |||
254 | } | ||
255 | } | ||
diff --git a/libopie2/opiecore/device/odevicebutton.h b/libopie2/opiecore/device/odevicebutton.h index a66b88f..4000144 100644 --- a/libopie2/opiecore/device/odevicebutton.h +++ b/libopie2/opiecore/device/odevicebutton.h | |||
@@ -2,78 +2,80 @@ | |||
2 | ** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. | 2 | ** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of the Qtopia Environment. | 4 | ** This file is part of the Qtopia Environment. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | ** This file may be distributed and/or modified under the terms of the |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | ** GNU General Public License version 2 as published by the Free Software |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
15 | ** | 15 | ** |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | ** Contact info@trolltech.com if any conditions of this licensing are |
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | #ifndef DEVICE_BUTTON_H | 20 | #ifndef DEVICE_BUTTON_H |
21 | #define DEVICE_BUTTON_H | 21 | #define DEVICE_BUTTON_H |
22 | 22 | ||
23 | #include <qpixmap.h> | 23 | #include <qpixmap.h> |
24 | #include <qstring.h> | 24 | #include <qstring.h> |
25 | 25 | ||
26 | class OQCopMessageData; | ||
27 | 26 | ||
28 | namespace Opie | 27 | namespace Opie{ |
29 | { | 28 | namespace Core{ |
29 | namespace Private { | ||
30 | class OQCopMessageData; | ||
31 | } | ||
30 | 32 | ||
31 | class OQCopMessage | 33 | class OQCopMessage |
32 | { | 34 | { |
33 | public: | 35 | public: |
34 | OQCopMessage ( ); | 36 | OQCopMessage ( ); |
35 | OQCopMessage ( const OQCopMessage © ); | 37 | OQCopMessage ( const OQCopMessage © ); |
36 | OQCopMessage ( const QCString &m_channel, const QCString &message, const QByteArray &args = QByteArray ( )); | 38 | OQCopMessage ( const QCString &m_channel, const QCString &message, const QByteArray &args = QByteArray ( )); |
37 | 39 | ||
38 | OQCopMessage &operator = ( const OQCopMessage &assign ); | 40 | OQCopMessage &operator = ( const OQCopMessage &assign ); |
39 | 41 | ||
40 | void setChannel ( const QCString &channel ); | 42 | void setChannel ( const QCString &channel ); |
41 | void setMessage ( const QCString &message ); | 43 | void setMessage ( const QCString &message ); |
42 | void setData ( const QByteArray &ba ); | 44 | void setData ( const QByteArray &ba ); |
43 | 45 | ||
44 | QCString channel ( ) const; | 46 | QCString channel ( ) const; |
45 | QCString message ( ) const; | 47 | QCString message ( ) const; |
46 | QByteArray data ( ) const; | 48 | QByteArray data ( ) const; |
47 | 49 | ||
48 | bool isNull()const; | 50 | bool isNull()const; |
49 | 51 | ||
50 | bool send ( ); | 52 | bool send ( ); |
51 | 53 | ||
52 | private: | 54 | private: |
53 | void init ( const QCString &m_channel, const QCString &message, const QByteArray &args ); | 55 | void init ( const QCString &m_channel, const QCString &message, const QByteArray &args ); |
54 | 56 | ||
55 | OQCopMessageData *d; | 57 | Private::OQCopMessageData *d; |
56 | class Private; | 58 | class Private; |
57 | Private* m_data; | 59 | Private* m_data; |
58 | }; | 60 | }; |
59 | 61 | ||
60 | 62 | ||
61 | /** | 63 | /** |
62 | * This class represents a physical button on a Qtopia device. A device may | 64 | * This class represents a physical button on a Qtopia device. A device may |
63 | * have n "user programmable" buttons, which are number 1..n. The location | 65 | * have n "user programmable" buttons, which are number 1..n. The location |
64 | * and number of buttons will vary from device to device. userText() and pixmap() | 66 | * and number of buttons will vary from device to device. userText() and pixmap() |
65 | * may be used to describe this button to the user in help documentation. | 67 | * may be used to describe this button to the user in help documentation. |
66 | * | 68 | * |
67 | * @version 1.0 | 69 | * @version 1.0 |
68 | * @author Trolltech | 70 | * @author Trolltech |
69 | * @short A representation of buttons | 71 | * @short A representation of buttons |
70 | */ | 72 | */ |
71 | 73 | ||
72 | class ODeviceButton | 74 | class ODeviceButton |
73 | { | 75 | { |
74 | public: | 76 | public: |
75 | ODeviceButton(); | 77 | ODeviceButton(); |
76 | virtual ~ODeviceButton(); | 78 | virtual ~ODeviceButton(); |
77 | 79 | ||
78 | ushort keycode ( ) const; | 80 | ushort keycode ( ) const; |
79 | QString userText ( ) const; | 81 | QString userText ( ) const; |
@@ -83,26 +85,27 @@ class ODeviceButton | |||
83 | OQCopMessage factoryPresetHeldAction ( ) const; | 85 | OQCopMessage factoryPresetHeldAction ( ) const; |
84 | OQCopMessage heldAction ( ) const; | 86 | OQCopMessage heldAction ( ) const; |
85 | 87 | ||
86 | void setKeycode ( ushort keycode ); | 88 | void setKeycode ( ushort keycode ); |
87 | void setUserText ( const QString& text ); | 89 | void setUserText ( const QString& text ); |
88 | void setPixmap ( const QPixmap& picture ); | 90 | void setPixmap ( const QPixmap& picture ); |
89 | void setFactoryPresetPressedAction ( const OQCopMessage& qcopMessage ); | 91 | void setFactoryPresetPressedAction ( const OQCopMessage& qcopMessage ); |
90 | void setPressedAction ( const OQCopMessage& qcopMessage ); | 92 | void setPressedAction ( const OQCopMessage& qcopMessage ); |
91 | void setFactoryPresetHeldAction ( const OQCopMessage& qcopMessage ); | 93 | void setFactoryPresetHeldAction ( const OQCopMessage& qcopMessage ); |
92 | void setHeldAction ( const OQCopMessage& qcopMessage ); | 94 | void setHeldAction ( const OQCopMessage& qcopMessage ); |
93 | 95 | ||
94 | private: | 96 | private: |
95 | ushort m_Keycode; | 97 | ushort m_Keycode; |
96 | QString m_UserText; | 98 | QString m_UserText; |
97 | QPixmap m_Pixmap; | 99 | QPixmap m_Pixmap; |
98 | OQCopMessage m_FactoryPresetPressedAction; | 100 | OQCopMessage m_FactoryPresetPressedAction; |
99 | OQCopMessage m_PressedAction; | 101 | OQCopMessage m_PressedAction; |
100 | OQCopMessage m_FactoryPresetHeldAction; | 102 | OQCopMessage m_FactoryPresetHeldAction; |
101 | OQCopMessage m_HeldAction; | 103 | OQCopMessage m_HeldAction; |
102 | class Private; | 104 | class Private; |
103 | Private *d; | 105 | Private *d; |
104 | }; | 106 | }; |
105 | 107 | ||
106 | } | 108 | } |
109 | } | ||
107 | 110 | ||
108 | #endif | 111 | #endif |