summaryrefslogtreecommitdiff
path: root/libopie2/opiecore/device
authorzecke <zecke>2004-03-13 19:51:45 (UTC)
committer zecke <zecke>2004-03-13 19:51:45 (UTC)
commit6d08277737e22b7a1527124623f3571969073ddf (patch) (unidiff)
tree4129e674e21df767b31299e873dd44e33a308e1b /libopie2/opiecore/device
parent8e28911f7199f4450ac5eef09482069f9b9caea2 (diff)
downloadopie-6d08277737e22b7a1527124623f3571969073ddf.zip
opie-6d08277737e22b7a1527124623f3571969073ddf.tar.gz
opie-6d08277737e22b7a1527124623f3571969073ddf.tar.bz2
Move XML class to internal PIM
Add namespaces!!! Opie::Core and Opie::Core::Private Opie::Net and Opie::Net::Private Opie::Ui and Opie::Ui::Private Opie::MM and Opie::MM::Private Opie::DB and Opie::DB::Private PIM classes are not yet converted because we will do other work on it as well
Diffstat (limited to 'libopie2/opiecore/device') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiecore/device/odevice.cpp17
-rw-r--r--libopie2/opiecore/device/odevice.h9
-rw-r--r--libopie2/opiecore/device/odevice_ipaq.cpp4
-rw-r--r--libopie2/opiecore/device/odevice_ipaq.h8
-rw-r--r--libopie2/opiecore/device/odevice_jornada.cpp2
-rw-r--r--libopie2/opiecore/device/odevice_jornada.h9
-rw-r--r--libopie2/opiecore/device/odevice_ramses.cpp3
-rw-r--r--libopie2/opiecore/device/odevice_ramses.h7
-rw-r--r--libopie2/opiecore/device/odevice_simpad.cpp3
-rw-r--r--libopie2/opiecore/device/odevice_simpad.h8
-rw-r--r--libopie2/opiecore/device/odevice_yopy.cpp3
-rw-r--r--libopie2/opiecore/device/odevice_yopy.h9
-rw-r--r--libopie2/opiecore/device/odevice_zaurus.cpp3
-rw-r--r--libopie2/opiecore/device/odevice_zaurus.h8
-rw-r--r--libopie2/opiecore/device/odevicebutton.cpp15
-rw-r--r--libopie2/opiecore/device/odevicebutton.h11
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
@@ -57,13 +57,13 @@ _;:, .> :=|. This program is free software; you can
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
61const char* PATH_PROC_CPUINFO = "/proc/cpuinfo"; 61const char* PATH_PROC_CPUINFO = "/proc/cpuinfo";
62 62
63using namespace Opie; 63using namespace Opie::Core;
64 64
65ODevice *ODevice::inst() 65ODevice *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
@@ -78,17 +78,17 @@ ODevice *ODevice::inst()
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
@@ -184,13 +184,13 @@ bool ODevice::suspend()
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
@@ -621,8 +621,11 @@ void ODevice::remapHeldAction ( int button, const OQCopMessage &action )
621void ODevice::virtual_hook(int, void* ){ 621void ODevice::virtual_hook(int, void* ){
622 622
623} 623}
624 624
625void ODevice::sendSuspendmsg() 625void 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
@@ -37,14 +37,15 @@ _;:, .> :=|. This program is free software; you can
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
43namespace Opie 43namespace Opie{
44{ 44namespace Core{
45
45 class ODeviceData; 46 class ODeviceData;
46/** 47/**
47 * The available devices 48 * The available devices
48 */ 49 */
49enum OModel { 50enum OModel {
50 Model_Unknown, // = 0 51 Model_Unknown, // = 0
@@ -247,13 +248,13 @@ public:
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 /**
@@ -311,12 +312,13 @@ class ODeviceData {
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
318static inline bool isQWS() 320static 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
@@ -325,8 +327,9 @@ static QCString makeChannel ( const char *str )
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
@@ -50,12 +50,16 @@
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
57using namespace Opie::Core;
58using 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))
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
@@ -32,13 +32,15 @@
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
38using namespace Opie; 38namespace Opie {
39namespace Core {
40namespace Private {
39 41
40class iPAQ : public ODevice, public QWSServer::KeyboardFilter 42class iPAQ : public ODevice, public QWSServer::KeyboardFilter
41{ 43{
42 44
43 protected: 45 protected:
44 virtual void init(); 46 virtual void init();
@@ -78,7 +80,11 @@ struct i_button {
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
@@ -74,13 +74,13 @@ typedef struct {
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
80using namespace Opie; 80using namespace Opie::Core::Private;
81 81
82void Jornada::init() 82void 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";
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
@@ -29,22 +29,25 @@
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
35using namespace Opie; 35namespace Opie {
36 36namespace Core {
37namespace Private {
37class Jornada : public ODevice 38class 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
@@ -50,12 +50,15 @@
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
56using namespace Opie::Core;
57using namespace Opie::Core::Private;
58
56struct r_button ramses_buttons [] = { 59struct 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()" },
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
@@ -31,13 +31,15 @@
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
37using namespace Opie; 37namespace Opie {
38namespace Core {
39namespace Private {
38 40
39class Ramses : public ODevice, public QWSServer::KeyboardFilter 41class Ramses : public ODevice, public QWSServer::KeyboardFilter
40{ 42{
41 protected: 43 protected:
42 virtual void init(); 44 virtual void init();
43 45
@@ -65,8 +67,11 @@ struct r_button {
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
@@ -50,13 +50,14 @@ _;:, .> :=|. This program is free software; you can
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
56using namespace Opie; 56using namespace Opie::Core;
57using namespace Opie::Core::Private;
57 58
58struct s_button simpad_buttons [] = { 59struct 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()",
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
@@ -32,13 +32,15 @@
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
38using namespace Opie; 38namespace Opie {
39namespace Core {
40namespace Private {
39 41
40class SIMpad : public ODevice, public QWSServer::KeyboardFilter 42class 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();
@@ -75,7 +77,11 @@ struct s_button {
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
@@ -50,13 +50,14 @@ _;:,     .>    :=|. This program is free software; you can
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
56using namespace Opie; 56using namespace Opie::Core;
57using namespace Opie::Core::Private;
57 58
58struct yopy_button yopy_buttons [] = { 59struct 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()" },
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
@@ -29,14 +29,15 @@ _;:,     .>    :=|. This program is free software; you can
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
35using namespace Opie; 35namespace Opie {
36 36namespace Core {
37namespace Private {
37class Yopy : public ODevice 38class 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();
@@ -56,7 +57,11 @@ struct yopy_button
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
@@ -50,13 +50,14 @@ _;:, .> :=|. This program is free software; you can
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
56using namespace Opie; 56using namespace Opie::Core;
57using namespace Opie::Core::Private;
57 58
58struct z_button z_buttons [] = { 59struct 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()" },
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
@@ -42,14 +42,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
48using namespace Opie;
49 48
49namespace Opie {
50namespace Core {
51namespace Private {
50class Zaurus : public ODevice 52class 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();
@@ -89,8 +91,10 @@ struct z_button {
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
@@ -30,22 +30,28 @@
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
36using namespace Opie; 36
37namespace Opie {
38namespace Core {
39namespace Private {
37 40
38class OQCopMessageData 41class 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
50using namespace Opie::Core;
51using namespace Opie::Core::Private;
46 52
47OQCopMessage::OQCopMessage() 53OQCopMessage::OQCopMessage()
48 : d ( 0 ) 54 : d ( 0 )
49{ 55{
50 init ( QCString(), QCString(), QByteArray()); 56 init ( QCString(), QCString(), QByteArray());
51} 57}
@@ -121,14 +127,14 @@ void OQCopMessage::setMessage ( const QCString &m )
121 127
122void OQCopMessage::setData ( const QByteArray &data ) 128void 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.
@@ -241,6 +247,9 @@ void ODeviceButton::setFactoryPresetHeldAction(const OQCopMessage& action)
241} 247}
242 248
243void ODeviceButton::setHeldAction(const OQCopMessage& action) 249void 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
@@ -20,16 +20,18 @@
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
26class OQCopMessageData;
27 26
28namespace Opie 27namespace Opie{
29{ 28namespace Core{
29namespace Private {
30class OQCopMessageData;
31}
30 32
31class OQCopMessage 33class OQCopMessage
32{ 34{
33public: 35public:
34 OQCopMessage ( ); 36 OQCopMessage ( );
35 OQCopMessage ( const OQCopMessage &copy ); 37 OQCopMessage ( const OQCopMessage &copy );
@@ -49,13 +51,13 @@ public:
49 51
50 bool send ( ); 52 bool send ( );
51 53
52private: 54private:
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/**
@@ -101,8 +103,9 @@ class ODeviceButton
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