summaryrefslogtreecommitdiff
path: root/core/applets
authormickeyl <mickeyl>2004-03-01 19:19:37 (UTC)
committer mickeyl <mickeyl>2004-03-01 19:19:37 (UTC)
commitddc3d749af5f7afebf69488b79641771fe246b5b (patch) (side-by-side diff)
tree8ea8614906c568e4677493ef09040724d60dd2d4 /core/applets
parentfb0981f47e529f9d1dd77fa005ffa3c3ecedff67 (diff)
downloadopie-ddc3d749af5f7afebf69488b79641771fe246b5b.zip
opie-ddc3d749af5f7afebf69488b79641771fe246b5b.tar.gz
opie-ddc3d749af5f7afebf69488b79641771fe246b5b.tar.bz2
remove duplicated boiler plate code in favour of the OTaskbarApplet template
Diffstat (limited to 'core/applets') (more/less context) (ignore whitespace changes)
-rw-r--r--core/applets/clipboardapplet/clipboard.cpp11
-rw-r--r--core/applets/clipboardapplet/clipboard.h1
-rw-r--r--core/applets/clipboardapplet/clipboardapplet.pro4
-rw-r--r--core/applets/clipboardapplet/clipboardappletimpl.cpp66
-rw-r--r--core/applets/clipboardapplet/clipboardappletimpl.h43
-rw-r--r--core/applets/clockapplet/clock.cpp12
-rw-r--r--core/applets/clockapplet/clock.h1
-rw-r--r--core/applets/clockapplet/clockapplet.pro4
-rw-r--r--core/applets/clockapplet/clockappletimpl.cpp67
-rw-r--r--core/applets/clockapplet/clockappletimpl.h45
-rw-r--r--core/applets/irdaapplet/irda.cpp17
-rw-r--r--core/applets/irdaapplet/irda.h1
-rw-r--r--core/applets/irdaapplet/irdaapplet.pro14
-rw-r--r--core/applets/irdaapplet/irdaappletimpl.cpp66
-rw-r--r--core/applets/irdaapplet/irdaappletimpl.h45
-rw-r--r--core/applets/screenshotapplet/screenshot.cpp25
-rw-r--r--core/applets/screenshotapplet/screenshot.h1
-rw-r--r--core/applets/screenshotapplet/screenshotapplet.pro6
-rw-r--r--core/applets/screenshotapplet/screenshotappletimpl.cpp66
-rw-r--r--core/applets/screenshotapplet/screenshotappletimpl.h43
-rw-r--r--core/applets/vmemo/vmemo.cpp12
-rw-r--r--core/applets/vmemo/vmemo.h1
-rw-r--r--core/applets/vmemo/vmemo.pro4
-rw-r--r--core/applets/vmemo/vmemoimpl.cpp61
-rw-r--r--core/applets/vmemo/vmemoimpl.h40
-rw-r--r--core/applets/volumeapplet/volume.cpp20
-rw-r--r--core/applets/volumeapplet/volume.h1
-rw-r--r--core/applets/volumeapplet/volumeapplet.pro4
-rw-r--r--core/applets/volumeapplet/volumeappletimpl.cpp65
-rw-r--r--core/applets/volumeapplet/volumeappletimpl.h43
30 files changed, 104 insertions, 685 deletions
diff --git a/core/applets/clipboardapplet/clipboard.cpp b/core/applets/clipboardapplet/clipboard.cpp
index bb0db9b..34d151e 100644
--- a/core/applets/clipboardapplet/clipboard.cpp
+++ b/core/applets/clipboardapplet/clipboard.cpp
@@ -17,12 +17,13 @@
** not clear to you.
**
**********************************************************************/
#include "clipboard.h"
+#include <opie2/otaskbarapplet.h>
#include <qpe/resource.h>
#include <qpe/applnk.h>
#include <qpainter.h>
#include <qpopupmenu.h>
#include <qwindowsystem_qws.h>
@@ -57,12 +58,17 @@ ClipboardApplet::ClipboardApplet( QWidget *parent, const char *name ) : QWidget(
}
ClipboardApplet::~ClipboardApplet ( )
{
}
+int ClipboardApplet::position()
+{
+ return 6;
+}
+
void ClipboardApplet::shutdown ( )
{
// the timer has to be stopped, or Qt/E will hang on quit()
// see launcher/desktop.cpp
m_timer-> stop ( );
@@ -173,6 +179,11 @@ void ClipboardApplet::newData ( )
}
m_timer-> start ( 1500, true );
excllock = false;
}
+
+Q_EXPORT_INTERFACE()
+{
+ Q_CREATE_INSTANCE( OTaskbarAppletWrapper<ClipboardApplet> );
+}
diff --git a/core/applets/clipboardapplet/clipboard.h b/core/applets/clipboardapplet/clipboard.h
index ec87d39..bbda0ff 100644
--- a/core/applets/clipboardapplet/clipboard.h
+++ b/core/applets/clipboardapplet/clipboard.h
@@ -29,12 +29,13 @@ class QTimer;
class ClipboardApplet : public QWidget
{
Q_OBJECT
public:
ClipboardApplet ( QWidget *parent = 0, const char *name=0 );
~ClipboardApplet ( );
+ static int position();
protected:
void mousePressEvent ( QMouseEvent *);
void paintEvent ( QPaintEvent* );
private slots:
diff --git a/core/applets/clipboardapplet/clipboardapplet.pro b/core/applets/clipboardapplet/clipboardapplet.pro
index f6842a2..74cf48c 100644
--- a/core/applets/clipboardapplet/clipboardapplet.pro
+++ b/core/applets/clipboardapplet/clipboardapplet.pro
@@ -1,10 +1,10 @@
TEMPLATE = lib
CONFIG += qt plugin warn_on release
-HEADERS = clipboard.h clipboardappletimpl.h
-SOURCES = clipboard.cpp clipboardappletimpl.cpp
+HEADERS = clipboard.h
+SOURCES = clipboard.cpp
TARGET = clipboardapplet
DESTDIR = $(OPIEDIR)/plugins/applets
INCLUDEPATH += $(OPIEDIR)/include
DEPENDPATH += ../$(OPIEDIR)/include
LIBS += -lqpe
VERSION = 1.0.0
diff --git a/core/applets/clipboardapplet/clipboardappletimpl.cpp b/core/applets/clipboardapplet/clipboardappletimpl.cpp
deleted file mode 100644
index f454529..0000000
--- a/core/applets/clipboardapplet/clipboardappletimpl.cpp
+++ b/dev/null
@@ -1,66 +0,0 @@
-/**********************************************************************
-** Copyright (C) 2000 Trolltech AS. All rights reserved.
-**
-** This file is part of Qtopia Environment.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.trolltech.com/gpl/ for GPL licensing information.
-**
-** Contact info@trolltech.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
-#include "clipboard.h"
-#include "clipboardappletimpl.h"
-
-
-ClipboardAppletImpl::ClipboardAppletImpl()
- : clipboard(0)
-{
-}
-
-ClipboardAppletImpl::~ClipboardAppletImpl()
-{
- delete clipboard;
-}
-
-QWidget *ClipboardAppletImpl::applet( QWidget *parent )
-{
- if ( !clipboard )
- clipboard = new ClipboardApplet( parent );
- return clipboard;
-}
-
-int ClipboardAppletImpl::position() const
-{
- return 6;
-}
-
-QRESULT ClipboardAppletImpl::queryInterface( const QUuid &uuid, QUnknownInterface **iface )
-{
- *iface = 0;
- if ( uuid == IID_QUnknown )
- *iface = this;
- else if ( uuid == IID_TaskbarApplet )
- *iface = this;
- else
- return QS_FALSE;
-
- if ( *iface )
- (*iface)->addRef();
- return QS_OK;
-}
-
-Q_EXPORT_INTERFACE()
-{
- Q_CREATE_INSTANCE( ClipboardAppletImpl )
-}
-
-
diff --git a/core/applets/clipboardapplet/clipboardappletimpl.h b/core/applets/clipboardapplet/clipboardappletimpl.h
deleted file mode 100644
index 497360c..0000000
--- a/core/applets/clipboardapplet/clipboardappletimpl.h
+++ b/dev/null
@@ -1,43 +0,0 @@
-/**********************************************************************
-** Copyright (C) 2000 Trolltech AS. All rights reserved.
-**
-** This file is part of Qtopia Environment.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.trolltech.com/gpl/ for GPL licensing information.
-**
-** Contact info@trolltech.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
-#ifndef CLIPBOARDAPPLETIMPL_H
-#define CLIPBOARDAPPLETIMPL_H
-
-#include <qpe/taskbarappletinterface.h>
-
-class ClipboardApplet;
-
-class ClipboardAppletImpl : public TaskbarAppletInterface
-{
-public:
- ClipboardAppletImpl();
- virtual ~ClipboardAppletImpl();
-
- QRESULT queryInterface( const QUuid&, QUnknownInterface** );
- Q_REFCOUNT
-
- virtual QWidget *applet( QWidget *parent );
- virtual int position() const;
-
-private:
- ClipboardApplet *clipboard;
-};
-
-#endif
diff --git a/core/applets/clockapplet/clock.cpp b/core/applets/clockapplet/clock.cpp
index aadd9b6..9fead03 100644
--- a/core/applets/clockapplet/clock.cpp
+++ b/core/applets/clockapplet/clock.cpp
@@ -17,12 +17,13 @@
** not clear to you.
**
**********************************************************************/
#include "clock.h"
+#include <opie2/otaskbarapplet.h>
#include <qpe/qpeapplication.h>
#include <qpe/qcopenvelope_qws.h>
#include <qpe/config.h>
LauncherClock::LauncherClock( QWidget *parent ) : QLabel( parent )
{
@@ -35,12 +36,17 @@ LauncherClock::LauncherClock( QWidget *parent ) : QLabel( parent )
readConfig();
timerId = 0;
timerEvent( 0 );
show();
}
+int LauncherClock::position()
+{
+ return 10;
+}
+
void LauncherClock::readConfig() {
Config config( "qpe" );
config.setGroup( "Time" );
ampmFormat = config.readBoolEntry( "AMPM", TRUE );
config.setGroup( "Date" );
format = config.readNumEntry("ClockApplet",0);
@@ -104,6 +110,12 @@ void LauncherClock::changeTime( void )
void LauncherClock::slotClockChanged( bool pm )
{
readConfig();
updateTime();
}
+
+Q_EXPORT_INTERFACE()
+{
+ Q_CREATE_INSTANCE( OTaskbarAppletWrapper<LauncherClock> );
+}
+
diff --git a/core/applets/clockapplet/clock.h b/core/applets/clockapplet/clock.h
index caa0c5f..996fb56 100644
--- a/core/applets/clockapplet/clock.h
+++ b/core/applets/clockapplet/clock.h
@@ -26,12 +26,13 @@
class LauncherClock : public QLabel
{
Q_OBJECT
public:
LauncherClock( QWidget *parent );
+ static int position();
protected slots:
void updateTime( void );
void slotClockChanged( bool pm );
protected:
diff --git a/core/applets/clockapplet/clockapplet.pro b/core/applets/clockapplet/clockapplet.pro
index 057e332..8ce3f6f 100644
--- a/core/applets/clockapplet/clockapplet.pro
+++ b/core/applets/clockapplet/clockapplet.pro
@@ -1,10 +1,10 @@
TEMPLATE = lib
CONFIG += qt plugin warn_on release
-HEADERS = clock.h clockappletimpl.h
-SOURCES = clock.cpp clockappletimpl.cpp
+HEADERS = clock.h
+SOURCES = clock.cpp
TARGET = clockapplet
DESTDIR = $(OPIEDIR)/plugins/applets
INCLUDEPATH += $(OPIEDIR)/include
DEPENDPATH += ../$(OPIEDIR)/include ..
LIBS += -lqpe
VERSION = 1.0.0
diff --git a/core/applets/clockapplet/clockappletimpl.cpp b/core/applets/clockapplet/clockappletimpl.cpp
deleted file mode 100644
index 7481f19..0000000
--- a/core/applets/clockapplet/clockappletimpl.cpp
+++ b/dev/null
@@ -1,67 +0,0 @@
-/**********************************************************************
-** Copyright (C) 2000 Trolltech AS. All rights reserved.
-**
-** This file is part of Qtopia Environment.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.trolltech.com/gpl/ for GPL licensing information.
-**
-** Contact info@trolltech.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
-#include "clock.h"
-#include "clockappletimpl.h"
-
-
-ClockAppletImpl::ClockAppletImpl()
- : clock(0)
-{
-}
-
-ClockAppletImpl::~ClockAppletImpl()
-{
- delete clock;
-}
-
-QWidget *ClockAppletImpl::applet( QWidget *parent )
-{
- if ( !clock )
- clock = new LauncherClock( parent );
- return clock;
-}
-
-int ClockAppletImpl::position() const
-{
- return 10;
-}
-
-#ifndef QT_NO_COMPONENT
-QRESULT ClockAppletImpl::queryInterface( const QUuid &uuid, QUnknownInterface **iface )
-{
- *iface = 0;
- if ( uuid == IID_QUnknown )
- *iface = this;
- else if ( uuid == IID_TaskbarApplet )
- *iface = this;
- else
- return QS_FALSE;
-
- if ( *iface )
- (*iface)->addRef();
- return QS_OK;
-}
-
-Q_EXPORT_INTERFACE()
-{
- Q_CREATE_INSTANCE( ClockAppletImpl )
-}
-#endif
-
diff --git a/core/applets/clockapplet/clockappletimpl.h b/core/applets/clockapplet/clockappletimpl.h
deleted file mode 100644
index 1f9c8f0..0000000
--- a/core/applets/clockapplet/clockappletimpl.h
+++ b/dev/null
@@ -1,45 +0,0 @@
-/**********************************************************************
-** Copyright (C) 2000 Trolltech AS. All rights reserved.
-**
-** This file is part of Qtopia Environment.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.trolltech.com/gpl/ for GPL licensing information.
-**
-** Contact info@trolltech.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
-#ifndef CLOCKAPPLETIMPL_H
-#define CLOCKAPPLETIMPL_H
-
-#include <qpe/taskbarappletinterface.h>
-
-class LauncherClock;
-
-class ClockAppletImpl : public TaskbarAppletInterface
-{
-public:
- ClockAppletImpl();
- virtual ~ClockAppletImpl();
-
-#ifndef QT_NO_COMPONENT
- QRESULT queryInterface( const QUuid&, QUnknownInterface** );
- Q_REFCOUNT
-#endif
-
- virtual QWidget *applet( QWidget *parent );
- virtual int position() const;
-
-private:
- LauncherClock *clock;
-};
-
-#endif
diff --git a/core/applets/irdaapplet/irda.cpp b/core/applets/irdaapplet/irda.cpp
index a47f33d..afc0592 100644
--- a/core/applets/irdaapplet/irda.cpp
+++ b/core/applets/irdaapplet/irda.cpp
@@ -11,30 +11,33 @@
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
**********************************************************************/
+#include "irda.h"
+/* OPIE */
+#include <opie2/otaskbarapplet.h>
#include <qpe/resource.h>
#include <qpe/qcopenvelope_qws.h>
+/* QT */
#include <qpainter.h>
#include <qfile.h>
#include <qtimer.h>
#include <qtextstream.h>
+/* STD */
#include <unistd.h>
#include <net/if.h>
#include <netinet/in.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/ioctl.h>
-#include "irda.h"
-
//===========================================================================
IrdaApplet::IrdaApplet ( QWidget *parent, const char *name )
: QWidget ( parent, name )
{
setFixedHeight ( 18 );
@@ -57,12 +60,17 @@ IrdaApplet::IrdaApplet ( QWidget *parent, const char *name )
QCopChannel* chan = new QCopChannel("QPE/IrDaApplet", this );
connect(chan, SIGNAL(received(const QCString&,const QByteArray&) ),
this, SLOT(slotMessage(const QCString&, const QByteArray& ) ) );
}
+int IrdaApplet::position()
+{
+ return 6;
+}
+
void IrdaApplet::show()
{
QWidget::show ( );
startTimer ( 2000 );
}
@@ -347,6 +355,11 @@ void IrdaApplet::slotMessage( const QCString& str, const QByteArray& ar ) {
for (it = m_devices.begin(); it != m_devices.end(); ++it )
list << (*it);
e << list;
}
}
+
+Q_EXPORT_INTERFACE()
+{
+ Q_CREATE_INSTANCE( OTaskbarAppletWrapper<IrdaApplet> );
+}
diff --git a/core/applets/irdaapplet/irda.h b/core/applets/irdaapplet/irda.h
index ec1d32c..f713bbe 100644
--- a/core/applets/irdaapplet/irda.h
+++ b/core/applets/irdaapplet/irda.h
@@ -25,12 +25,13 @@ class IrdaApplet : public QWidget
{
Q_OBJECT
public:
IrdaApplet( QWidget *parent = 0, const char *name = 0 );
~IrdaApplet();
+ static int position();
virtual void show ( );
protected:
virtual void timerEvent ( QTimerEvent * );
virtual void mousePressEvent ( QMouseEvent * );
diff --git a/core/applets/irdaapplet/irdaapplet.pro b/core/applets/irdaapplet/irdaapplet.pro
index 4e94dfb..31e8691 100644
--- a/core/applets/irdaapplet/irdaapplet.pro
+++ b/core/applets/irdaapplet/irdaapplet.pro
@@ -1,13 +1,13 @@
-TEMPLATE = lib
-CONFIG += qt plugin warn_on release
-HEADERS = irda.h irdaappletimpl.h
-SOURCES = irda.cpp irdaappletimpl.cpp
-TARGET = irdaapplet
-DESTDIR = $(OPIEDIR)/plugins/applets
-INCLUDEPATH += $(OPIEDIR)/include
+TEMPLATE = lib
+CONFIG += qt plugin warn_on release
+HEADERS = irda.h
+SOURCES = irda.cpp
+TARGET = irdaapplet
+DESTDIR = $(OPIEDIR)/plugins/applets
+INCLUDEPATH += $(OPIEDIR)/include
DEPENDPATH += ../$(OPIEDIR)/include
LIBS += -lqpe
VERSION = 1.0.0
include ( $(OPIEDIR)/include.pro )
target.path = $$prefix/plugins/applets
diff --git a/core/applets/irdaapplet/irdaappletimpl.cpp b/core/applets/irdaapplet/irdaappletimpl.cpp
deleted file mode 100644
index 33d98af..0000000
--- a/core/applets/irdaapplet/irdaappletimpl.cpp
+++ b/dev/null
@@ -1,66 +0,0 @@
-/**********************************************************************
-** Copyright (C) 2000 Trolltech AS. All rights reserved.
-**
-** This file is part of Qtopia Environment.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.trolltech.com/gpl/ for GPL licensing information.
-**
-** Contact info@trolltech.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
-#include "irda.h"
-#include "irdaappletimpl.h"
-
-
-IrdaAppletImpl::IrdaAppletImpl()
- : irda(0)
-{
-}
-
-IrdaAppletImpl::~IrdaAppletImpl()
-{
- delete irda;
-}
-
-QWidget *IrdaAppletImpl::applet( QWidget *parent )
-{
- if ( !irda )
- irda = new IrdaApplet( parent );
- return irda;
-}
-
-int IrdaAppletImpl::position() const
-{
- return 6;
-}
-
-QRESULT IrdaAppletImpl::queryInterface( const QUuid &uuid, QUnknownInterface **iface )
-{
- *iface = 0;
- if ( uuid == IID_QUnknown )
- *iface = this;
- else if ( uuid == IID_TaskbarApplet )
- *iface = this;
- else
- return QS_FALSE;
-
- if ( *iface )
- (*iface)->addRef();
- return QS_OK;
-}
-
-Q_EXPORT_INTERFACE()
-{
- Q_CREATE_INSTANCE( IrdaAppletImpl )
-}
-
-
diff --git a/core/applets/irdaapplet/irdaappletimpl.h b/core/applets/irdaapplet/irdaappletimpl.h
deleted file mode 100644
index 024cc06..0000000
--- a/core/applets/irdaapplet/irdaappletimpl.h
+++ b/dev/null
@@ -1,45 +0,0 @@
-/**********************************************************************
-** Copyright (C) 2000 Trolltech AS. All rights reserved.
-**
-** This file is part of Qtopia Environment.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.trolltech.com/gpl/ for GPL licensing information.
-**
-** Contact info@trolltech.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
-#ifndef IRDAAPPLETIMPL_H
-#define IRDAAPPLETIMPL_H
-
-#include <qwidget.h>
-
-#include <qpe/taskbarappletinterface.h>
-
-class IrdaApplet;
-
-class IrdaAppletImpl : public TaskbarAppletInterface
-{
-public:
- IrdaAppletImpl();
- virtual ~IrdaAppletImpl();
-
- QRESULT queryInterface( const QUuid&, QUnknownInterface** );
- Q_REFCOUNT
-
- virtual QWidget *applet( QWidget *parent );
- virtual int position() const;
-
-private:
- IrdaApplet *irda;
-};
-
-#endif
diff --git a/core/applets/screenshotapplet/screenshot.cpp b/core/applets/screenshotapplet/screenshot.cpp
index 56a031c..5d6bce4 100644
--- a/core/applets/screenshotapplet/screenshot.cpp
+++ b/core/applets/screenshotapplet/screenshot.cpp
@@ -12,31 +12,34 @@
**
**********************************************************************/
#include "screenshot.h"
#include "inputDialog.h"
-#include <stdlib.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <netdb.h>
-#include <unistd.h>
-
+/* OPIE */
+#include <opie2/otaskbarapplet.h>
#include <qpe/qpeapplication.h>
#include <qpe/applnk.h>
+/* QT */
#include <qlineedit.h>
#include <qdir.h>
#include <qlabel.h>
#include <qpushbutton.h>
#include <qpainter.h>
#include <qspinbox.h>
#include <qlayout.h>
#include <qcheckbox.h>
#include <qmessagebox.h>
+/* STD */
+#include <stdlib.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <netdb.h>
+#include <unistd.h>
/* XPM */
static char * snapshot_xpm[] = {
"32 32 177 2",
" c None",
". c #042045",
@@ -494,12 +497,17 @@ ScreenshotApplet::ScreenshotApplet( QWidget *parent, const char *name )
}
ScreenshotApplet::~ScreenshotApplet()
{
}
+int ScreenshotApplet::position()
+{
+ return 6;
+}
+
void ScreenshotApplet::mousePressEvent( QMouseEvent *)
{
ScreenshotControl *sc = new ScreenshotControl ( );
QPoint curPos = mapToGlobal ( QPoint ( 0, 0 ));
// windowPosX is the windows position centered above the applets icon.
@@ -525,6 +533,11 @@ void ScreenshotApplet::mousePressEvent( QMouseEvent *)
void ScreenshotApplet::paintEvent( QPaintEvent* )
{
QPainter p ( this );
p.drawPixmap( 0,0, m_icon );
}
+Q_EXPORT_INTERFACE()
+{
+ Q_CREATE_INSTANCE( OTaskbarAppletWrapper<ScreenshotApplet> );
+}
+
diff --git a/core/applets/screenshotapplet/screenshot.h b/core/applets/screenshotapplet/screenshot.h
index 74cc5e6..b753583 100644
--- a/core/applets/screenshotapplet/screenshot.h
+++ b/core/applets/screenshotapplet/screenshot.h
@@ -53,12 +53,13 @@ private slots:
};
class ScreenshotApplet : public QWidget {
public:
ScreenshotApplet( QWidget *parent = 0, const char *name=0 );
~ScreenshotApplet();
+ static int position();
protected:
void mousePressEvent( QMouseEvent * );
void paintEvent( QPaintEvent* );
private:
diff --git a/core/applets/screenshotapplet/screenshotapplet.pro b/core/applets/screenshotapplet/screenshotapplet.pro
index 45a5759..c7fcc3e 100644
--- a/core/applets/screenshotapplet/screenshotapplet.pro
+++ b/core/applets/screenshotapplet/screenshotapplet.pro
@@ -1,15 +1,13 @@
TEMPLATE = lib
CONFIG += qt plugin warn_on release
-HEADERS = screenshot.h inputDialog.h screenshotappletimpl.h
-SOURCES = screenshot.cpp inputDialog.cpp screenshotappletimpl.cpp
+HEADERS = screenshot.h inputDialog.h
+SOURCES = screenshot.cpp inputDialog.cpp
TARGET = screenshotapplet
DESTDIR = $(OPIEDIR)/plugins/applets
INCLUDEPATH += $(OPIEDIR)/include
DEPENDPATH += ../$(OPIEDIR)/include
LIBS += -lqpe
VERSION = 1.0.0
-MOC_DIR=opieobj
-OBJECTS_DIR=opieobj
include ( $(OPIEDIR)/include.pro )
target.path = $$prefix/plugins/applets
diff --git a/core/applets/screenshotapplet/screenshotappletimpl.cpp b/core/applets/screenshotapplet/screenshotappletimpl.cpp
deleted file mode 100644
index e99ecb0..0000000
--- a/core/applets/screenshotapplet/screenshotappletimpl.cpp
+++ b/dev/null
@@ -1,66 +0,0 @@
-/**********************************************************************
-** Copyright (C) 2000 Trolltech AS. All rights reserved.
-**
-** This file is part of Qtopia Environment.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.trolltech.com/gpl/ for GPL licensing information.
-**
-** Contact info@trolltech.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
-#include "screenshot.h"
-#include "screenshotappletimpl.h"
-
-
-ScreenshotAppletImpl::ScreenshotAppletImpl()
- : screenshot(0)
-{
-}
-
-ScreenshotAppletImpl::~ScreenshotAppletImpl()
-{
- delete screenshot;
-}
-
-QWidget *ScreenshotAppletImpl::applet( QWidget *parent )
-{
- if ( !screenshot )
- screenshot = new ScreenshotApplet( parent );
- return screenshot;
-}
-
-int ScreenshotAppletImpl::position() const
-{
- return 6;
-}
-
-QRESULT ScreenshotAppletImpl::queryInterface( const QUuid &uuid, QUnknownInterface **iface )
-{
- *iface = 0;
- if ( uuid == IID_QUnknown )
- *iface = this;
- else if ( uuid == IID_TaskbarApplet )
- *iface = this;
- else
- return QS_FALSE;
-
- if ( *iface )
- (*iface)->addRef();
- return QS_OK;
-}
-
-Q_EXPORT_INTERFACE()
-{
- Q_CREATE_INSTANCE( ScreenshotAppletImpl )
-}
-
-
diff --git a/core/applets/screenshotapplet/screenshotappletimpl.h b/core/applets/screenshotapplet/screenshotappletimpl.h
deleted file mode 100644
index 988a34c..0000000
--- a/core/applets/screenshotapplet/screenshotappletimpl.h
+++ b/dev/null
@@ -1,43 +0,0 @@
-/**********************************************************************
-** Copyright (C) 2000 Trolltech AS. All rights reserved.
-**
-** This file is part of Qtopia Environment.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.trolltech.com/gpl/ for GPL licensing information.
-**
-** Contact info@trolltech.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
-#ifndef SCREENSHOTAPPLETIMPL_H
-#define SCREENSHOTAPPLETIMPL_H
-
-#include <qpe/taskbarappletinterface.h>
-
-class ScreenshotApplet;
-
-class ScreenshotAppletImpl : public TaskbarAppletInterface
-{
-public:
- ScreenshotAppletImpl();
- virtual ~ScreenshotAppletImpl();
-
- QRESULT queryInterface( const QUuid&, QUnknownInterface** );
- Q_REFCOUNT
-
- virtual QWidget *applet( QWidget *parent );
- virtual int position() const;
-
-private:
- ScreenshotApplet *screenshot;
-};
-
-#endif
diff --git a/core/applets/vmemo/vmemo.cpp b/core/applets/vmemo/vmemo.cpp
index fe8ebfd..563d110 100644
--- a/core/applets/vmemo/vmemo.cpp
+++ b/core/applets/vmemo/vmemo.cpp
@@ -58,12 +58,13 @@ struct adpcm_state encoder_state;
#define WAVE_FORMAT_DVI_ADPCM (0x0011)
#define WAVE_FORMAT_PCM (0x0001)
#include "vmemo.h"
+#include <opie2/otaskbarapplet.h>
#include <qpe/qpeapplication.h>
#include <qpe/config.h>
#include <qpainter.h>
#include <qmessagebox.h>
@@ -234,12 +235,17 @@ VMemo::VMemo( QWidget *parent, const char *_name )
// }
}
VMemo::~VMemo() {
}
+int VMemo::position()
+{
+ return 6;
+}
+
void VMemo::receive( const QCString &msg, const QByteArray &data ) {
qDebug("receive");
QDataStream stream( data, IO_ReadOnly );
if (msg == "toggleRecord()") {
if (recording) {
@@ -628,6 +634,12 @@ int VMemo::setToggleButton(int tog) {
void VMemo::timerBreak() {
//stop
stopRecording();
QMessageBox::message("Vmemo","Vmemo recording has ended");
}
+
+Q_EXPORT_INTERFACE()
+{
+ Q_CREATE_INSTANCE( OTaskbarAppletWrapper<VMemo> );
+}
+
diff --git a/core/applets/vmemo/vmemo.h b/core/applets/vmemo/vmemo.h
index 31d0a25..1bd735f 100644
--- a/core/applets/vmemo/vmemo.h
+++ b/core/applets/vmemo/vmemo.h
@@ -29,12 +29,13 @@
class VMemo : public QWidget
{
Q_OBJECT
public:
VMemo( QWidget *parent, const char *name = NULL);
~VMemo();
+ static int position();
QFile track;
int length;
QString fileName, errorMsg, date;
QLabel* msgLabel;
QTimer *t_timer;
bool usingIcon, useADPCM;
diff --git a/core/applets/vmemo/vmemo.pro b/core/applets/vmemo/vmemo.pro
index f83a53f..2deedfd 100644
--- a/core/applets/vmemo/vmemo.pro
+++ b/core/applets/vmemo/vmemo.pro
@@ -1,10 +1,10 @@
TEMPLATE = lib
CONFIG += qt plugin warn_on release
-HEADERS = vmemo.h vmemoimpl.h adpcm.h
-SOURCES = vmemo.cpp vmemoimpl.cpp adpcm.c
+HEADERS = vmemo.h adpcm.h
+SOURCES = vmemo.cpp adpcm.c
TARGET = vmemoapplet
DESTDIR =$(OPIEDIR)/plugins/applets
INCLUDEPATH += $(OPIEDIR)/include
DEPENDPATH += $(OPIEDIR)/include
LIBS += -lqpe
VERSION = 1.0.0
diff --git a/core/applets/vmemo/vmemoimpl.cpp b/core/applets/vmemo/vmemoimpl.cpp
deleted file mode 100644
index 7779b83..0000000
--- a/core/applets/vmemo/vmemoimpl.cpp
+++ b/dev/null
@@ -1,61 +0,0 @@
-/**************************************************************************************94x78**
- **
- ** This file may be distributed and/or modified under the terms of the
- ** GNU General Public License version 2 as published by the Free Software
- ** Foundation and appearing in the file LICENSE.GPL included in the
- ** packaging of this file.
- **
- ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
- ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
- **
- *********************************************************************************************/
-
-/*
- * $Id$
- */
-
-#include "vmemo.h"
-#include "vmemoimpl.h"
-
-
-VMemoAppletImpl::VMemoAppletImpl()
- : vmemo(0)
-{
-}
-
-VMemoAppletImpl::~VMemoAppletImpl()
-{
- delete vmemo;
-}
-
-QWidget *VMemoAppletImpl::applet( QWidget *parent )
-{
- if ( !vmemo )
- vmemo = new VMemo( parent );
- return vmemo;
-}
-
-int VMemoAppletImpl::position() const
-{
- return 6;
-}
-
-QRESULT VMemoAppletImpl::queryInterface( const QUuid &uuid, QUnknownInterface **iface )
-{
- *iface = 0;
- if ( uuid == IID_QUnknown )
- *iface = this;
- else if ( uuid == IID_TaskbarApplet )
- *iface = this;
- else
- return QS_FALSE;
-
- if ( *iface )
- (*iface)->addRef();
- return QS_OK;
-}
-
-Q_EXPORT_INTERFACE()
-{
- Q_CREATE_INSTANCE( VMemoAppletImpl )
- }
diff --git a/core/applets/vmemo/vmemoimpl.h b/core/applets/vmemo/vmemoimpl.h
deleted file mode 100644
index 985138b..0000000
--- a/core/applets/vmemo/vmemoimpl.h
+++ b/dev/null
@@ -1,40 +0,0 @@
-/**************************************************************************************94x78**
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-*********************************************************************************************/
-
-/*
- * $Id$
- */
-
-#ifndef __VMEMOIMPLAPPLETIMPL_H__
-#define __VMEMOIMPLAPPLETIMPL_H__
-
-#include <qpe/taskbarappletinterface.h>
-
-class VMemo;
-
-class VMemoAppletImpl : public TaskbarAppletInterface
-{
-public:
- VMemoAppletImpl();
- virtual ~VMemoAppletImpl();
-
- QRESULT queryInterface( const QUuid&, QUnknownInterface** );
- Q_REFCOUNT
-
- virtual QWidget *applet( QWidget *parent );
- virtual int position() const;
-
-private:
- VMemo *vmemo;
-};
-
-#endif
diff --git a/core/applets/volumeapplet/volume.cpp b/core/applets/volumeapplet/volume.cpp
index c736437..8fd88f6 100644
--- a/core/applets/volumeapplet/volume.cpp
+++ b/core/applets/volumeapplet/volume.cpp
@@ -15,36 +15,32 @@
**
** Contact info@trolltech.com if any conditions of this licensing are
** not clear to you.
**
**********************************************************************/
-#include <stdio.h>
-
#include "volume.h"
+#include "oledbox.h"
+#include <opie2/odevice.h>
+#include <opie2/otaskbarapplet.h>
#include <qpe/resource.h>
#include <qpe/applnk.h>
#include <qpe/config.h>
-#if ( defined Q_WS_QWS || defined(_WS_QWS_) ) && !defined(QT_NO_COP)
#include <qpe/qcopenvelope_qws.h>
-#endif
#include <qpainter.h>
#include <qcheckbox.h>
#include <qslider.h>
#include <qlayout.h>
#include <qvbox.h>
#include <qlabel.h>
-
#include <qpushbutton.h>
#include <qtimer.h>
-#include <opie/odevice.h>
-
-#include "oledbox.h"
+#include <stdio.h>
using namespace Opie;
#define RATE_TIMER_INTERVAL 100
// Ten times per second is fine (RATE_TIMER_INTERVAL 100). A shorter time
// results in "hanging" buttons on the iPAQ due to quite high CPU consumption.
@@ -734,12 +730,16 @@ VolumeApplet::VolumeApplet( QWidget *parent, const char *name )
VolumeApplet::~VolumeApplet()
{
delete m_pixmap;
}
+int VolumeApplet::position()
+{
+ return 6;
+}
void VolumeApplet::mousePressEvent ( QMouseEvent * )
{
if ( m_dialog-> isVisible ( ))
m_dialog-> hide ( );
else
@@ -774,6 +774,10 @@ void VolumeApplet::paintEvent ( QPaintEvent * )
p. drawLine ( width() - 2, 2, 1, height() - 5 );
p. drawLine ( width() - 2, 3, 1, height() - 4 );
}
}
+Q_EXPORT_INTERFACE()
+{
+ Q_CREATE_INSTANCE( OTaskbarAppletWrapper<VolumeApplet> );
+}
diff --git a/core/applets/volumeapplet/volume.h b/core/applets/volumeapplet/volume.h
index d2345b5..454a688 100644
--- a/core/applets/volumeapplet/volume.h
+++ b/core/applets/volumeapplet/volume.h
@@ -114,12 +114,13 @@ private:
class VolumeApplet : public QWidget {
Q_OBJECT
public:
VolumeApplet ( QWidget *parent = 0, const char *name=0 );
~VolumeApplet ( );
+ static int position();
void redraw ( bool all = true );
protected:
virtual void mousePressEvent ( QMouseEvent * );
virtual void paintEvent ( QPaintEvent* );
diff --git a/core/applets/volumeapplet/volumeapplet.pro b/core/applets/volumeapplet/volumeapplet.pro
index 92c6b0a..b14956e 100644
--- a/core/applets/volumeapplet/volumeapplet.pro
+++ b/core/applets/volumeapplet/volumeapplet.pro
@@ -1,10 +1,10 @@
TEMPLATE = lib
CONFIG += qt plugin warn_on release
-HEADERS = volume.h volumeappletimpl.h oledbox.h
-SOURCES = volume.cpp volumeappletimpl.cpp oledbox.cpp
+HEADERS = volume.h oledbox.h
+SOURCES = volume.cpp oledbox.cpp
TARGET = volumeapplet
DESTDIR = $(OPIEDIR)/plugins/applets
INCLUDEPATH += $(OPIEDIR)/include
DEPENDPATH += ../$(OPIEDIR)/include
LIBS += -lqpe
VERSION = 1.0.0
diff --git a/core/applets/volumeapplet/volumeappletimpl.cpp b/core/applets/volumeapplet/volumeappletimpl.cpp
deleted file mode 100644
index 9c7dea3..0000000
--- a/core/applets/volumeapplet/volumeappletimpl.cpp
+++ b/dev/null
@@ -1,65 +0,0 @@
-/**********************************************************************
-** Copyright (C) 2000 Trolltech AS. All rights reserved.
-**
-** This file is part of Qtopia Environment.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.trolltech.com/gpl/ for GPL licensing information.
-**
-** Contact info@trolltech.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
-#include "volume.h"
-#include "volumeappletimpl.h"
-
-VolumeAppletImpl::VolumeAppletImpl()
- : volume(0)
-{
-}
-
-VolumeAppletImpl::~VolumeAppletImpl()
-{
- delete volume;
-}
-
-QWidget *VolumeAppletImpl::applet( QWidget *parent )
-{
- if ( !volume )
- volume = new VolumeApplet( parent );
- return volume;
-}
-
-int VolumeAppletImpl::position() const
-{
- return 6;
-}
-
-QRESULT VolumeAppletImpl::queryInterface( const QUuid &uuid, QUnknownInterface **iface )
-{
- *iface = 0;
- if ( uuid == IID_QUnknown )
- *iface = this;
- else if ( uuid == IID_TaskbarApplet )
- *iface = this;
- else
- return QS_FALSE;
-
- if ( *iface )
- (*iface)->addRef();
- return QS_OK;
-}
-
-Q_EXPORT_INTERFACE()
-{
- Q_CREATE_INSTANCE( VolumeAppletImpl )
-}
-
-
diff --git a/core/applets/volumeapplet/volumeappletimpl.h b/core/applets/volumeapplet/volumeappletimpl.h
deleted file mode 100644
index a9221c6..0000000
--- a/core/applets/volumeapplet/volumeappletimpl.h
+++ b/dev/null
@@ -1,43 +0,0 @@
-/**********************************************************************
-** Copyright (C) 2000 Trolltech AS. All rights reserved.
-**
-** This file is part of Qtopia Environment.
-**
-** This file may be distributed and/or modified under the terms of the
-** GNU General Public License version 2 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file.
-**
-** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-**
-** See http://www.trolltech.com/gpl/ for GPL licensing information.
-**
-** Contact info@trolltech.com if any conditions of this licensing are
-** not clear to you.
-**
-**********************************************************************/
-#ifndef VOLUMEAPPLETIMPL_H
-#define VOLUMEAPPLETIMPL_H
-
-#include <qpe/taskbarappletinterface.h>
-
-class VolumeApplet;
-
-class VolumeAppletImpl : public TaskbarAppletInterface
-{
-public:
- VolumeAppletImpl();
- virtual ~VolumeAppletImpl();
-
- QRESULT queryInterface( const QUuid&, QUnknownInterface** );
- Q_REFCOUNT
-
- virtual QWidget *applet( QWidget *parent );
- virtual int position() const;
-
-private:
- VolumeApplet *volume;
-};
-
-#endif