author | zecke <zecke> | 2004-03-13 21:53:54 (UTC) |
---|---|---|
committer | zecke <zecke> | 2004-03-13 21:53:54 (UTC) |
commit | 2eb5c075b612498c4b65f3d49389b8612612a930 (patch) (side-by-side diff) | |
tree | a0230cd9007f71bbb387b71b8e58684937e0cf70 | |
parent | 184a0cd9935d0a249038cdbe05488c181b273d64 (diff) | |
download | opie-2eb5c075b612498c4b65f3d49389b8612612a930.zip opie-2eb5c075b612498c4b65f3d49389b8612612a930.tar.gz opie-2eb5c075b612498c4b65f3d49389b8612612a930.tar.bz2 |
Introduce the namespace
and the new APPLET_EXPORT define
-rw-r--r-- | noncore/applets/autorotateapplet/autorotate.cpp | 8 | ||||
-rw-r--r-- | noncore/applets/memoryapplet/memorymeter.cpp | 26 | ||||
-rw-r--r-- | noncore/applets/memoryapplet/memorystatus.cpp | 1 | ||||
-rw-r--r-- | noncore/applets/memoryapplet/memorystatus.h | 4 | ||||
-rw-r--r-- | noncore/applets/networkapplet/networkapplet.cpp | 7 | ||||
-rw-r--r-- | noncore/applets/networkapplet/networkapplet.h | 18 | ||||
-rw-r--r-- | noncore/applets/notesapplet/notes.cpp | 8 | ||||
-rw-r--r-- | noncore/applets/wirelessapplet/wireless.cpp | 9 | ||||
-rw-r--r-- | noncore/applets/wirelessapplet/wireless.h | 9 | ||||
-rw-r--r-- | noncore/applets/zkbapplet/zkbwidget.cpp | 11 |
10 files changed, 51 insertions, 50 deletions
diff --git a/noncore/applets/autorotateapplet/autorotate.cpp b/noncore/applets/autorotateapplet/autorotate.cpp index 94be0ae..ae7fbd0 100644 --- a/noncore/applets/autorotateapplet/autorotate.cpp +++ b/noncore/applets/autorotateapplet/autorotate.cpp @@ -23,6 +23,5 @@ #include <qpainter.h> -using namespace Opie; - +using namespace Opie::Ui; AutoRotate::AutoRotate(QWidget * parent):QWidget(parent) { @@ -95,7 +94,4 @@ bool AutoRotate::isRotateEnabled() } -Q_EXPORT_INTERFACE() -{ - Q_CREATE_INSTANCE( OTaskbarAppletWrapper<AutoRotate> ); -} +EXPORT_OPIE_APPLET_v1( AutoRotate ) diff --git a/noncore/applets/memoryapplet/memorymeter.cpp b/noncore/applets/memoryapplet/memorymeter.cpp index 9299f49..9cdeaf4 100644 --- a/noncore/applets/memoryapplet/memorymeter.cpp +++ b/noncore/applets/memoryapplet/memorymeter.cpp @@ -32,14 +32,15 @@ #include <qtopia/applnk.h> +using namespace Opie::Ui; MemoryMeter::MemoryMeter( QWidget *parent ) : QWidget( parent ), memoryView(0) { bvsz = QSize(); - if ( qApp->desktop()->height() >= 300 ) + if ( qApp->desktop()->height() >= 300 ) { memoryView = new MemoryStatus( 0, WStyle_StaysOnTop | WType_Popup ); memoryView->setFrameStyle( QFrame::Panel | QFrame::Raised ); - } - else + } + else { memoryView = new MemoryStatus( 0 ); @@ -80,9 +81,9 @@ bool MemoryMeter::updateMemoryViewGeometry() { QSize sz = memoryView->sizeHint(); - if ( sz != bvsz ) + if ( sz != bvsz ) { bvsz = sz; QRect r(memoryView->pos(), memoryView->sizeHint()); - if ( qApp->desktop()->height() >= 300 ) + if ( qApp->desktop()->height() >= 300 ) { QPoint curPos = mapToGlobal( rect().topLeft() ); @@ -101,9 +102,9 @@ bool MemoryMeter::updateMemoryViewGeometry() void MemoryMeter::mousePressEvent( QMouseEvent *) { - if ( memoryView->isVisible() ) + if ( memoryView->isVisible() ) { memoryView->hide(); - } - else + } + else { bvsz = QSize(); @@ -207,5 +208,5 @@ void MemoryMeter::paintEvent( QPaintEvent* ) // Drained section. // - if (used_height != 0) + if (used_height != 0) { p.setPen(NoPen); @@ -224,5 +225,5 @@ void MemoryMeter::paintEvent( QPaintEvent* ) // Unused section. // - if ( batt_height - used_height > 0 ) + if ( batt_height - used_height > 0 ) { int unused_offset = used_height + batt_yoffset; @@ -241,7 +242,4 @@ void MemoryMeter::paintEvent( QPaintEvent* ) } -Q_EXPORT_INTERFACE() -{ - Q_CREATE_INSTANCE( OTaskbarAppletWrapper<MemoryMeter> ); -} +EXPORT_OPIE_APPLET_v1( MemoryMeter ) diff --git a/noncore/applets/memoryapplet/memorystatus.cpp b/noncore/applets/memoryapplet/memorystatus.cpp index c01ba28..95ae06b 100644 --- a/noncore/applets/memoryapplet/memorystatus.cpp +++ b/noncore/applets/memoryapplet/memorystatus.cpp @@ -29,4 +29,5 @@ #include <qlayout.h> +using namespace Opie::Ui; MemoryStatus::MemoryStatus(QWidget *parent, WFlags f ) : QFrame(parent, 0, f), mi(0), sf(0) diff --git a/noncore/applets/memoryapplet/memorystatus.h b/noncore/applets/memoryapplet/memorystatus.h index c3926db..d16787b 100644 --- a/noncore/applets/memoryapplet/memorystatus.h +++ b/noncore/applets/memoryapplet/memorystatus.h @@ -27,5 +27,5 @@ class MemoryInfo; class Swapfile; -using Opie::OTabWidget; + class MemoryStatus : public QFrame @@ -43,5 +43,5 @@ public: private: - OTabWidget *tab; + Opie::Ui::OTabWidget *tab; }; diff --git a/noncore/applets/networkapplet/networkapplet.cpp b/noncore/applets/networkapplet/networkapplet.cpp index 955ed2e..5eb5ad2 100644 --- a/noncore/applets/networkapplet/networkapplet.cpp +++ b/noncore/applets/networkapplet/networkapplet.cpp @@ -46,4 +46,6 @@ #include <assert.h> +using namespace Opie::Ui; +using namespace Opie::Net; IfaceUpDownButton::IfaceUpDownButton( QWidget* parent, const char* name ) :QToolButton( parent, name ) @@ -247,8 +249,5 @@ void NetworkApplet::mousePressEvent( QMouseEvent* ) } +EXPORT_OPIE_APPLET_v1( NetworkApplet ) -Q_EXPORT_INTERFACE() -{ - Q_CREATE_INSTANCE( OTaskbarAppletWrapper<NetworkApplet> ); -} diff --git a/noncore/applets/networkapplet/networkapplet.h b/noncore/applets/networkapplet/networkapplet.h index 8022537..1e2cac8 100644 --- a/noncore/applets/networkapplet/networkapplet.h +++ b/noncore/applets/networkapplet/networkapplet.h @@ -39,5 +39,11 @@ #include <qpixmap.h> -class ONetworkInterface; + +namespace Opie { +namespace Net { + class ONetwork; + class ONetworkInterface; +} +} class QShowEvent; class QHideEvent; @@ -56,5 +62,5 @@ class IfaceUpDownButton : public QToolButton private: - ONetworkInterface* _iface; + Opie::Net::ONetworkInterface* _iface; }; @@ -72,5 +78,5 @@ class IfaceIPAddress : public QLineEdit private: - ONetworkInterface* _iface; + Opie::Net::ONetworkInterface* _iface; }; @@ -78,5 +84,5 @@ class NetworkAppletControl : public QFrame { public: - NetworkAppletControl( OTaskbarApplet* parent, const char* name = 0 ); + NetworkAppletControl( Opie::Ui::OTaskbarApplet* parent, const char* name = 0 ); ~NetworkAppletControl(); @@ -86,5 +92,5 @@ class NetworkAppletControl : public QFrame virtual void showEvent( QShowEvent* ); virtual void hideEvent( QHideEvent* ); - QString guessDevice( ONetworkInterface* iface ); + QString guessDevice( Opie::Net::ONetworkInterface* iface ); void build(); @@ -95,5 +101,5 @@ class NetworkAppletControl : public QFrame -class NetworkApplet : public OTaskbarApplet +class NetworkApplet : public Opie::Ui::OTaskbarApplet { public: diff --git a/noncore/applets/notesapplet/notes.cpp b/noncore/applets/notesapplet/notes.cpp index 9b5e475..13f7cf3 100644 --- a/noncore/applets/notesapplet/notes.cpp +++ b/noncore/applets/notesapplet/notes.cpp @@ -47,4 +47,5 @@ /* XPM */ +using namespace Opie::Ui; static char * notes_xpm[] = { "16 16 11 1", @@ -509,6 +510,5 @@ void NotesApplet::paintEvent( QPaintEvent* ) { } -Q_EXPORT_INTERFACE() -{ - Q_CREATE_INSTANCE( OTaskbarAppletWrapper<NotesApplet> ); -} + +EXPORT_OPIE_APPLET_v1( NotesApplet ) + diff --git a/noncore/applets/wirelessapplet/wireless.cpp b/noncore/applets/wirelessapplet/wireless.cpp index 6ef2e44..f244426 100644 --- a/noncore/applets/wirelessapplet/wireless.cpp +++ b/noncore/applets/wirelessapplet/wireless.cpp @@ -27,4 +27,5 @@ #include <opie2/otaskbarapplet.h> #include <qpe/config.h> +#include <qpe/qpeapplication.h> /* QT */ @@ -49,4 +50,6 @@ #undef MDEBUG +using namespace Opie::Ui; +using namespace Opie::Net; WirelessControl::WirelessControl( WirelessApplet *applet, QWidget *parent, const char *name ) : QFrame( parent, name, WStyle_StaysOnTop | WType_Popup ), applet( applet ) @@ -551,8 +554,4 @@ int WirelessApplet::position() } - -Q_EXPORT_INTERFACE() -{ - Q_CREATE_INSTANCE( OTaskbarAppletWrapper<WirelessApplet> ); -} +EXPORT_OPIE_APPLET_v1( WirelessApplet ) diff --git a/noncore/applets/wirelessapplet/wireless.h b/noncore/applets/wirelessapplet/wireless.h index 27f8c90..b475a46 100644 --- a/noncore/applets/wirelessapplet/wireless.h +++ b/noncore/applets/wirelessapplet/wireless.h @@ -20,5 +20,8 @@ #include <qpixmap.h> -class OWirelessNetworkInterface; +namespace Opie {namespace Net { + class OWirelessNetworkInterface; +} +} class Y; class QLabel; @@ -87,9 +90,9 @@ class WirelessApplet : public QWidget int timer; - OWirelessNetworkInterface* interface; + Opie::Net::OWirelessNetworkInterface* interface; private: const char** oldpixmap; - OWirelessNetworkInterface* oldiface; + Opie::Net::OWirelessNetworkInterface* oldiface; int oldqualityH; int oldsignalH; diff --git a/noncore/applets/zkbapplet/zkbwidget.cpp b/noncore/applets/zkbapplet/zkbwidget.cpp index 0083e9b..3acff1e 100644 --- a/noncore/applets/zkbapplet/zkbwidget.cpp +++ b/noncore/applets/zkbapplet/zkbwidget.cpp @@ -9,9 +9,10 @@ #include "zkbcfg.h" +using namespace Opie::Ui; ZkbWidget::ZkbWidget(QWidget* parent):QLabel(parent),keymap(0), disabled(Resource::loadPixmap("zkb-disabled")) { labels = new QPopupMenu(); - connect(labels, SIGNAL(activated(int)), this, + connect(labels, SIGNAL(activated(int)), this, SLOT(labelChanged(int))); @@ -69,5 +70,5 @@ bool ZkbWidget::loadKeymap() { int n = 1; w = 0; - for(QStringList::Iterator it = l.begin(); it != l.end(); + for(QStringList::Iterator it = l.begin(); it != l.end(); ++it, n++) { @@ -156,7 +157,5 @@ void ZkbWidget::reload() { } -Q_EXPORT_INTERFACE() -{ - Q_CREATE_INSTANCE( OTaskbarAppletWrapper<ZkbWidget> ); -} +EXPORT_OPIE_APPLET_v1( ZkbWidget ) + |