author | zecke <zecke> | 2004-03-13 19:51:45 (UTC) |
---|---|---|
committer | zecke <zecke> | 2004-03-13 19:51:45 (UTC) |
commit | 6d08277737e22b7a1527124623f3571969073ddf (patch) (side-by-side diff) | |
tree | 4129e674e21df767b31299e873dd44e33a308e1b /libopie2/opiecore/device | |
parent | 8e28911f7199f4450ac5eef09482069f9b9caea2 (diff) | |
download | opie-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
-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 @@ -60,7 +60,7 @@ _;:, .> :=|. This program is free software; you can const char* PATH_PROC_CPUINFO = "/proc/cpuinfo"; -using namespace Opie; +using namespace Opie::Core; ODevice *ODevice::inst() { @@ -81,11 +81,11 @@ ODevice *ODevice::inst() if ( line.startsWith( "Hardware" ) ) { qDebug( "ODevice() - found '%s'", (const char*) line ); - if ( line.contains( "sharp", false ) ) dev = new Zaurus(); - else if ( line.contains( "ipaq", false ) ) dev = new iPAQ(); - else if ( line.contains( "simpad", false ) ) dev = new SIMpad(); - else if ( line.contains( "jornada", false ) ) dev = new Jornada(); - else if ( line.contains( "ramses", false ) ) dev = new Ramses(); + if ( line.contains( "sharp", false ) ) dev = new Private::Zaurus(); + else if ( line.contains( "ipaq", false ) ) dev = new Private::iPAQ(); + else if ( line.contains( "simpad", false ) ) dev = new Private::SIMpad(); + else if ( line.contains( "jornada", false ) ) dev = new Private::Jornada(); + else if ( line.contains( "ramses", false ) ) dev = new Private::Ramses(); else qWarning( "ODevice() - unknown hardware - using default." ); break; } @@ -187,7 +187,7 @@ bool ODevice::suspend() bool res = false; ODevice::sendSuspendmsg(); - + struct timeval tvs, tvn; ::gettimeofday ( &tvs, 0 ); @@ -624,5 +624,8 @@ void ODevice::virtual_hook(int, void* ){ void ODevice::sendSuspendmsg() { + if ( isQWS() ) + return; + QCopEnvelope ( "QPE/System", "aboutToSuspend()" ); } 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 #include <qstring.h> #include <qstrlist.h> -namespace Opie -{ +namespace Opie{ +namespace Core{ + class ODeviceData; /** * The available devices @@ -250,7 +251,7 @@ public: * of buttons will vary depending on the device. Button numbers will be assigned * by the device manufacturer and will be from most preferred button to least preffered * button. Note that this list only contains "user mappable" buttons. - * + * * @todo Make method const and take care of calling initButtons or make that const too * */ @@ -314,6 +315,7 @@ class ODeviceData { }; } +} static inline bool isQWS() { @@ -328,5 +330,6 @@ static QCString makeChannel ( const char *str ) return str; } + #endif 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 @@ #include <linux/soundcard.h> #endif + +using namespace Opie::Core; +using namespace Opie::Core::Private; + /* KERNEL */ #define OD_IOC(dir,type,number,size) (( dir << 30 ) | ( type << 8 ) | ( number ) | ( size << 16 )) 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 @@ /* QT */ #include <qwindowsystem_qws.h> -using namespace Opie; +namespace Opie { +namespace Core { +namespace Private { class iPAQ : public ODevice, public QWSServer::KeyboardFilter { @@ -81,4 +83,8 @@ struct i_button { char *fheldaction; }; +} +} +} + #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 { #define LED_ON OD_IOW( 'f', 5, LED_IN ) #define FLITE_ON OD_IOW( 'f', 7, FLITE_IN ) -using namespace Opie; +using namespace Opie::Core::Private; void Jornada::init() { 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 @@ #include <opie2/odevice.h> -using namespace Opie; - +namespace Opie { +namespace Core { +namespace Private { class Jornada : public ODevice { @@ -45,6 +46,8 @@ class Jornada : public ODevice virtual bool setDisplayBrightness ( int b ); virtual int displayBrightnessResolution() const; }; - +} +} +} #endif 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 @@ #include <linux/soundcard.h> #endif +using namespace Opie::Core; +using namespace Opie::Core::Private; + struct r_button ramses_buttons [] = { { Model_Ramses_MNCI, 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 @@ /* QT */ #include <qwindowsystem_qws.h> -using namespace Opie; +namespace Opie { +namespace Core { +namespace Private { class Ramses : public ODevice, public QWSServer::KeyboardFilter { @@ -68,5 +70,8 @@ struct r_button { char *fheldservice; char *fheldaction; }; +} +} +} #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 #include <linux/soundcard.h> #endif -using namespace Opie; +using namespace Opie::Core; +using namespace Opie::Core::Private; struct s_button simpad_buttons [] = { { 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 @@ /* QT */ #include <qwindowsystem_qws.h> -using namespace Opie; +namespace Opie { +namespace Core { +namespace Private { class SIMpad : public ODevice, public QWSServer::KeyboardFilter { @@ -78,4 +80,8 @@ struct s_button { char *fheldaction; }; +} +} +} + #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 #include <linux/soundcard.h> #endif -using namespace Opie; +using namespace Opie::Core; +using namespace Opie::Core::Private; struct yopy_button yopy_buttons [] = { { 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 #include <opie2/odevice.h> -using namespace Opie; - +namespace Opie { +namespace Core { +namespace Private { class Yopy : public ODevice { protected: @@ -59,4 +60,8 @@ struct yopy_button char *fheldaction; }; +} +} +} + #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 #include <linux/soundcard.h> #endif -using namespace Opie; +using namespace Opie::Core; +using namespace Opie::Core::Private; struct z_button z_buttons [] = { { 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 @@ #define OD_IOR(type,number,size) OD_IOC(2,type,number,sizeof(size)) #define OD_IORW(type,number,size) OD_IOC(3,type,number,sizeof(size)) -using namespace Opie; +namespace Opie { +namespace Core { +namespace Private { class Zaurus : public ODevice { @@ -92,5 +94,7 @@ struct z_button { char *fheldservice; char *fheldaction; }; - +} +} +} #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 @@ #include <qpe/qcopenvelope_qws.h> #include <opie2/odevicebutton.h> -using namespace Opie; + +namespace Opie { +namespace Core { +namespace Private { class OQCopMessageData { @@ -42,7 +45,10 @@ class OQCopMessageData QCString m_message; QByteArray m_data; }; +} +using namespace Opie::Core; +using namespace Opie::Core::Private; OQCopMessage::OQCopMessage() : d ( 0 ) @@ -124,8 +130,8 @@ void OQCopMessage::setData ( const QByteArray &data ) d->m_data = data; } -/*! \class Opie::ODeviceButton - \brief The Opie::ODeviceButton class represents a physical user mappable button on a Qtopia device. +/*! \class Opie::Core::ODeviceButton + \brief The Opie::Core::ODeviceButton class represents a physical user mappable button on a Qtopia device. This class represents a physical button on a Qtopia device. A device may have "user programmable" buttons. @@ -244,3 +250,6 @@ void ODeviceButton::setHeldAction(const OQCopMessage& action) { m_HeldAction = action; } + +} +} 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 @@ #include <qpixmap.h> #include <qstring.h> -class OQCopMessageData; -namespace Opie -{ +namespace Opie{ +namespace Core{ +namespace Private { +class OQCopMessageData; +} class OQCopMessage { @@ -52,7 +54,7 @@ public: private: void init ( const QCString &m_channel, const QCString &message, const QByteArray &args ); - OQCopMessageData *d; + Private::OQCopMessageData *d; class Private; Private* m_data; }; @@ -104,5 +106,6 @@ class ODeviceButton }; } +} #endif |