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
@@ -60,7 +60,7 @@ _;:, .> :=|. This program is free software; you can
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{
@@ -81,11 +81,11 @@ ODevice *ODevice::inst()
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 }
@@ -187,7 +187,7 @@ bool ODevice::suspend()
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
@@ -624,5 +624,8 @@ void ODevice::virtual_hook(int, void* ){
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
@@ -40,8 +40,9 @@ _;:, .> :=|. This program is free software; you can
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
@@ -250,7 +251,7 @@ public:
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 */
@@ -314,6 +315,7 @@ class ODeviceData {
314}; 315};
315 316
316} 317}
318}
317 319
318static inline bool isQWS() 320static inline bool isQWS()
319{ 321{
@@ -328,5 +330,6 @@ static QCString makeChannel ( const char *str )
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
@@ -53,6 +53,10 @@
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
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
@@ -35,7 +35,9 @@
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{
@@ -81,4 +83,8 @@ struct i_button {
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
@@ -77,7 +77,7 @@ typedef struct {
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{
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
@@ -32,8 +32,9 @@
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
@@ -45,6 +46,8 @@ class Jornada : public ODevice
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
@@ -53,6 +53,9 @@
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"),
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
@@ -34,7 +34,9 @@
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{
@@ -68,5 +70,8 @@ struct r_button {
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
@@ -53,7 +53,8 @@ _;:, .> :=|. This program is free software; you can
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,
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
@@ -35,7 +35,9 @@
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{
@@ -78,4 +80,8 @@ struct s_button {
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
@@ -53,7 +53,8 @@ _;:,     .>    :=|. This program is free software; you can
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" ),
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
@@ -32,8 +32,9 @@ _;:,     .>    :=|. This program is free software; you can
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:
@@ -59,4 +60,8 @@ struct yopy_button
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
@@ -53,7 +53,8 @@ _;:, .> :=|. This program is free software; you can
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"),
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
@@ -45,8 +45,10 @@
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
@@ -92,5 +94,7 @@ struct z_button {
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
@@ -33,7 +33,10 @@
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{
@@ -42,7 +45,10 @@ class OQCopMessageData
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 )
@@ -124,8 +130,8 @@ void OQCopMessage::setData ( const QByteArray &data )
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.
@@ -244,3 +250,6 @@ 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
@@ -23,10 +23,12 @@
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{
@@ -52,7 +54,7 @@ public:
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};
@@ -104,5 +106,6 @@ class ODeviceButton
104}; 106};
105 107
106} 108}
109}
107 110
108#endif 111#endif