author | zecke <zecke> | 2004-03-14 17:37:48 (UTC) |
---|---|---|
committer | zecke <zecke> | 2004-03-14 17:37:48 (UTC) |
commit | d69b11f67e3118f86d068c38c422984d754e13cc (patch) (side-by-side diff) | |
tree | 9733e26ab49003bead06d820d70a14babd0c09f0 /core | |
parent | 64820b76cc9d1c06a6967cd34114f3b95896aaeb (diff) | |
download | opie-d69b11f67e3118f86d068c38c422984d754e13cc.zip opie-d69b11f67e3118f86d068c38c422984d754e13cc.tar.gz opie-d69b11f67e3118f86d068c38c422984d754e13cc.tar.bz2 |
Updatet the applets
33 files changed, 66 insertions, 70 deletions
diff --git a/core/applets/batteryapplet/battery.cpp b/core/applets/batteryapplet/battery.cpp index b2cef55..18e368e 100644 --- a/core/applets/batteryapplet/battery.cpp +++ b/core/applets/batteryapplet/battery.cpp @@ -9,41 +9,44 @@ ** 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 "battery.h" #include "batterystatus.h" /* OPIE */ #include <opie2/otaskbarapplet.h> + +#include <qpe/qpeapplication.h> #include <qpe/applnk.h> #include <qpe/config.h> #include <qpe/power.h> /* QT */ #include <qpainter.h> #include <qtimer.h> +using namespace Opie::Ui; BatteryMeter::BatteryMeter( QWidget *parent ) : QWidget( parent ), charging(false) { ps = new PowerStatus; startTimer( 10000 ); setFixedWidth( QMAX(AppLnk::smallIconSize()*3/4, 6) ); setFixedHeight( AppLnk::smallIconSize() ); chargeTimer = new QTimer( this ); connect( chargeTimer, SIGNAL(timeout()), this, SLOT(chargeTimeout()) ); timerEvent(0); QPEApplication::setStylusOperation( this, QPEApplication::RightOnHold ); Config c( "qpe" ); c.setGroup( "Battery" ); style = c.readNumEntry( "Style", 0 ); @@ -162,21 +165,18 @@ void BatteryMeter::paintEvent( QPaintEvent* ) for ( int i = 0; i < middle; i++ ) { p.setPen( gray.dark( 100+i*20 ) ); p.drawLine( x1+middle-i, 2, x1+middle-i, y-1 ); p.drawLine( x1+middle+i, 2, x1+middle+i, y-1 ); p.setPen( color.dark( 100+i*20 ) ); p.drawLine( x1+middle-i, y, x1+middle-i, y2 ); p.drawLine( x1+middle+i, y, x1+middle+i, y2 ); } } int BatteryMeter::position() { return 8; } -Q_EXPORT_INTERFACE() -{ - Q_CREATE_INSTANCE( OTaskbarAppletWrapper<BatteryMeter> ); -} +EXPORT_OPIE_APPLET_v1( BatteryMeter ) diff --git a/core/applets/batteryapplet/batterystatus.cpp b/core/applets/batteryapplet/batterystatus.cpp index ea11495..bd86f77 100644 --- a/core/applets/batteryapplet/batterystatus.cpp +++ b/core/applets/batteryapplet/batterystatus.cpp @@ -1,32 +1,32 @@ #include "batterystatus.h" /* OPIE */ #include <opie2/odevice.h> #include <qpe/power.h> /* QT */ #include <qpushbutton.h> #include <qdrawutil.h> #include <qfile.h> #include <qlayout.h> #include <qtextstream.h> #include <qmessagebox.h> -using namespace Opie; +using namespace Opie::Core; BatteryStatus::BatteryStatus( const PowerStatus *p, QWidget *parent ) : QWidget( parent, 0, WDestructiveClose), ps(p), bat2(false) { setCaption( tr("Battery status") ); setMinimumSize( 150, 200 ); QPushButton *pb = new QPushButton( tr("Close"), this ); QVBoxLayout *layout = new QVBoxLayout ( this ); jackPercent = 0; pb->setMaximumSize( 120, 40 ); pb->show(); layout->addStretch(); diff --git a/core/applets/batteryapplet/config.in b/core/applets/batteryapplet/config.in index 3067317..eca07e3 100644 --- a/core/applets/batteryapplet/config.in +++ b/core/applets/batteryapplet/config.in @@ -1,4 +1,4 @@ config BATTERYAPPLET boolean "opie-batteryapplet (Applet to monitor battery status)" default "y" - depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE + depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIECORE2 diff --git a/core/applets/cardmon/cardmon.cpp b/core/applets/cardmon/cardmon.cpp index 6090b68..ed4bfc7 100644 --- a/core/applets/cardmon/cardmon.cpp +++ b/core/applets/cardmon/cardmon.cpp @@ -34,32 +34,33 @@ /* STD */ #include <stdio.h> #include <unistd.h> #include <stdlib.h> #include <string.h> #include <fcntl.h> #if defined(_OS_LINUX_) || defined(Q_OS_LINUX) #include <sys/vfs.h> #include <mntent.h> #endif using namespace Opie; using namespace Opie::Ui; +using namespace Opie::Ui; using namespace Opie::Core; CardMonitor::CardMonitor( QWidget * parent ) : QWidget( parent ), pm( Resource::loadPixmap( "cardmon/pcmcia" ) ) { QCopChannel * pcmciaChannel = new QCopChannel( "QPE/Card", this ); connect( pcmciaChannel, SIGNAL( received(const QCString&,const QByteArray&) ), this, SLOT( cardMessage(const QCString&,const QByteArray&) ) ); QCopChannel *sdChannel = new QCopChannel( "QPE/Card", this ); connect( sdChannel, SIGNAL( received(const QCString&,const QByteArray&) ), this, SLOT( cardMessage(const QCString&,const QByteArray&) ) ); diff --git a/core/applets/cardmon/config.in b/core/applets/cardmon/config.in index f3d57fd..8626c75 100644 --- a/core/applets/cardmon/config.in +++ b/core/applets/cardmon/config.in @@ -1,4 +1,4 @@ config CARDMON boolean "opie-cardmon (monitor cf/sd/mmc card status, and eject function)" default "y" - depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE + depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIECORE2 diff --git a/core/applets/clipboardapplet/clipboard.cpp b/core/applets/clipboardapplet/clipboard.cpp index 4fc8076..57a4088 100644 --- a/core/applets/clipboardapplet/clipboard.cpp +++ b/core/applets/clipboardapplet/clipboard.cpp @@ -21,32 +21,33 @@ #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> #include <qapplication.h> #include <qclipboard.h> #include <qtimer.h> //=========================================================================== +using namespace Opie::Ui; ClipboardApplet::ClipboardApplet( QWidget *parent, const char *name ) : QWidget( parent, name ) { setFixedWidth ( AppLnk::smallIconSize() ); setFixedHeight ( AppLnk::smallIconSize() ); QImage img = Resource::loadImage( "paste"); img = img.smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ); m_clipboardPixmap.convertFromImage( img ); m_timer = new QTimer ( this ); connect ( QApplication::clipboard ( ), SIGNAL( dataChanged()), this, SLOT( newData())); connect ( m_timer, SIGNAL( timeout()), this, SLOT( newData())); connect ( qApp, SIGNAL( aboutToQuit()), this, SLOT( shutdown())); @@ -170,20 +171,18 @@ void ClipboardApplet::newData ( ) QString txt = QApplication::clipboard ( )-> text ( type ); if ( !txt. isEmpty ( ) && !m_history. contains ( txt )) { m_history. append ( txt ); if ( m_history. count ( ) > 5 ) m_history. remove ( m_history. begin ( )); m_dirty = true; } m_timer-> start ( 1500, true ); excllock = false; } -Q_EXPORT_INTERFACE() -{ - Q_CREATE_INSTANCE( OTaskbarAppletWrapper<ClipboardApplet> ); -} +EXPORT_OPIE_APPLET_v1( ClipboardApplet ) + diff --git a/core/applets/clipboardapplet/config.in b/core/applets/clipboardapplet/config.in index 1205b26..e58d239 100644 --- a/core/applets/clipboardapplet/config.in +++ b/core/applets/clipboardapplet/config.in @@ -1,4 +1,4 @@ config CLIPBOARDAPPLET boolean "opie-clipboardapplet (copy/cut/paste applet)" default "y" - depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE + depends ( LIBQPE || LIBQPE-X11 ) diff --git a/core/applets/clockapplet/clock.cpp b/core/applets/clockapplet/clock.cpp index 120a019..3b13d74 100644 --- a/core/applets/clockapplet/clock.cpp +++ b/core/applets/clockapplet/clock.cpp @@ -12,32 +12,33 @@ ** 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 <opie2/otaskbarapplet.h> #include <qpe/qpeapplication.h> #include <qpe/qcopenvelope_qws.h> #include <qpe/config.h> +using namespace Opie::Ui; LauncherClock::LauncherClock( QWidget *parent ) : QLabel( parent ) { // If you want a sunken border around the clock do this: // setFrameStyle( QFrame::Panel | QFrame::Sunken ); //setFont( QFont( "Helvetica", , QFont::Normal ) ); connect( qApp, SIGNAL( timeChanged() ), this, SLOT( updateTime() ) ); connect( qApp, SIGNAL( clockChanged(bool) ), this, SLOT( slotClockChanged(bool) ) ); readConfig(); timerId = 0; timerEvent( 0 ); show(); } int LauncherClock::position() { @@ -101,21 +102,19 @@ void LauncherClock::changeTime( void ) } else if (format==2) { QDate dm = QDate::currentDate(); QString d; d.sprintf("%d/%d ", dm.month(), dm.day()); setText( d+s ); } else { setText( s ); } } void LauncherClock::slotClockChanged( bool pm ) { readConfig(); updateTime(); } -Q_EXPORT_INTERFACE() -{ - Q_CREATE_INSTANCE( OTaskbarAppletWrapper<LauncherClock> ); -} + +EXPORT_OPIE_APPLET_v1( LauncherClock ) diff --git a/core/applets/clockapplet/config.in b/core/applets/clockapplet/config.in index 20bd39d..6c32f79 100644 --- a/core/applets/clockapplet/config.in +++ b/core/applets/clockapplet/config.in @@ -1,4 +1,4 @@ config CLOCKAPPLET boolean "opie-clockapplet (Digital clock applet)" default "y" - depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE + depends ( LIBQPE || LIBQPE-X11 ) diff --git a/core/applets/homeapplet/config.in b/core/applets/homeapplet/config.in index 1828da0..53d7882 100644 --- a/core/applets/homeapplet/config.in +++ b/core/applets/homeapplet/config.in @@ -1,4 +1,4 @@ config HOMEAPPLET boolean "Home" default "y" - depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE + depends ( LIBQPE || LIBQPE-X11 ) diff --git a/core/applets/irdaapplet/config.in b/core/applets/irdaapplet/config.in index 56ec664..0976e8f 100644 --- a/core/applets/irdaapplet/config.in +++ b/core/applets/irdaapplet/config.in @@ -1,4 +1,4 @@ config IRDAAPPLET boolean "opie-irdaapplet (applet for IR beaming/discovery)" default "y" - depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE + depends ( LIBQPE || LIBQPE-X11 ) diff --git a/core/applets/irdaapplet/irda.cpp b/core/applets/irdaapplet/irda.cpp index dde8050..2196d18 100644 --- a/core/applets/irdaapplet/irda.cpp +++ b/core/applets/irdaapplet/irda.cpp @@ -24,32 +24,33 @@ /* 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> //=========================================================================== +using namespace Opie::Ui; IrdaApplet::IrdaApplet ( QWidget *parent, const char *name ) : QWidget ( parent, name ) { setFixedHeight ( 18 ); setFixedWidth ( 14 ); m_sockfd = ::socket ( PF_INET, SOCK_DGRAM, IPPROTO_IP ); m_irdaOnPixmap = Resource::loadPixmap( "irdaapplet/irdaon" ); m_irdaOffPixmap = Resource::loadPixmap( "irdaapplet/irdaoff" ); m_irdaDiscoveryOnPixmap = Resource::loadPixmap( "irdaapplet/magglass" ); m_receiveActivePixmap = Resource::loadPixmap( "irdaapplet/receive" ); m_irda_active = false; m_irda_discovery_active = false; m_receive_active = false; @@ -346,20 +347,17 @@ void IrdaApplet::slotMessage( const QCString& str, const QByteArray& ar ) { } if ( !m_wasDiscover ) { setIrdaDiscoveryStatus ( false ); } } else if ( str == "listDevices()") { QCopEnvelope e("QPE/IrDaAppletBack", "devices(QStringList)"); QStringList list; QMap<QString, QString>::Iterator it; for (it = m_devices.begin(); it != m_devices.end(); ++it ) list << (*it); e << list; } } -Q_EXPORT_INTERFACE() -{ - Q_CREATE_INSTANCE( OTaskbarAppletWrapper<IrdaApplet> ); -} +EXPORT_OPIE_APPLET_v1( IrdaApplet ) diff --git a/core/applets/logoutapplet/config.in b/core/applets/logoutapplet/config.in index 385b02f..0d48c6a 100644 --- a/core/applets/logoutapplet/config.in +++ b/core/applets/logoutapplet/config.in @@ -1,4 +1,4 @@ config LOGOUTAPPLET boolean "Logout" default "y" - depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE + depends ( LIBQPE || LIBQPE-X11 ) diff --git a/core/applets/multikeyapplet/multikey.cpp b/core/applets/multikeyapplet/multikey.cpp index fc5f093..195ada5 100644 --- a/core/applets/multikeyapplet/multikey.cpp +++ b/core/applets/multikeyapplet/multikey.cpp @@ -4,36 +4,38 @@ ** ** 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. ** **********************************************************************/ #include "multikey.h" /* OPIE */ #include <opie2/otaskbarapplet.h> #include <qpe/qcopenvelope_qws.h> +#include <qpe/qpeapplication.h> /* QT */ #include <qdir.h> +using namespace Opie::Ui; Multikey::Multikey(QWidget *parent) : QLabel(parent), popupMenu(this), current("EN") { QCopChannel* swChannel = new QCopChannel("MultiKey/Switcher", this); connect( swChannel, SIGNAL(received(const QCString&,const QByteArray&)), this, SLOT(message(const QCString&,const QByteArray&))); setFont( QFont( "Helvetica", 10, QFont::Normal ) ); QPEApplication::setStylusOperation(this, QPEApplication::RightOnHold); lang = 0; QCopEnvelope e("MultiKey/Keyboard", "getmultikey()"); setText("EN"); popupMenu.insertItem("EN", 0); show(); } void Multikey::mousePressEvent(QMouseEvent *ev) @@ -124,20 +126,17 @@ void Multikey::message(const QCString &message, const QByteArray &data) } map.readLine(line, 1024); } map.close(); } } setText(current); } } int Multikey::position() { return 10; } -Q_EXPORT_INTERFACE() -{ - Q_CREATE_INSTANCE( OTaskbarAppletWrapper<Multikey> ); -} +EXPORT_OPIE_APPLET_v1( Multikey ) diff --git a/core/applets/restartapplet/config.in b/core/applets/restartapplet/config.in index aa2580f..764ae58 100644 --- a/core/applets/restartapplet/config.in +++ b/core/applets/restartapplet/config.in @@ -1,4 +1,4 @@ config RESTARTAPPLET boolean "opie-restartapplet (Restart Opie via taskbar)" default "y" - depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE + depends ( LIBQPE || LIBQPE-X11 ) diff --git a/core/applets/rotateapplet/config.in b/core/applets/rotateapplet/config.in index 1a0d923..d3de89a 100644 --- a/core/applets/rotateapplet/config.in +++ b/core/applets/rotateapplet/config.in @@ -1,4 +1,4 @@ config ROTATEAPPLET boolean "Rotate" default "y" - depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE + depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIECORE2 diff --git a/core/applets/rotateapplet/rotate.cpp b/core/applets/rotateapplet/rotate.cpp index 0488c36..f621aa9 100644 --- a/core/applets/rotateapplet/rotate.cpp +++ b/core/applets/rotateapplet/rotate.cpp @@ -18,38 +18,38 @@ =_ + =;=| MERCHANTABILITY or FITNESS FOR A _.=:. : :=>: PARTICULAR PURPOSE. See the GNU ..}^=.= = ; Library General Public License for more ++= -. . .: details. : = ...= . :.=- -. .:....=;==+<; You should have received a copy of the GNU -_. . . )=. = Library General Public License along with -- :-= this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "rotate.h" /* OPIE */ -#include <opie/odevice.h> +#include <opie2/odevice.h> #include <qpe/config.h> #include <qpe/power.h> #include <qpe/qcopenvelope_qws.h> #include <qpe/resource.h> -using namespace Opie; +using namespace Opie::Core; /* QT */ #include <time.h> RotateApplet::RotateApplet() :QObject( 0, "RotateApplet" ), m_flipped( false ) { #if !defined(QT_NO_COP) QCopChannel *rotateChannel = new QCopChannel( "QPE/Rotation" , this ); connect ( rotateChannel, SIGNAL( received(const QCString&,const QByteArray&) ), this, SLOT ( channelReceived(const QCString&,const QByteArray&) ) ); #endif } diff --git a/core/applets/rotateapplet/rotateapplet.pro b/core/applets/rotateapplet/rotateapplet.pro index f24682c..7a4420f 100644 --- a/core/applets/rotateapplet/rotateapplet.pro +++ b/core/applets/rotateapplet/rotateapplet.pro @@ -1,13 +1,13 @@ TEMPLATE = lib CONFIG += qt plugn warn_on release HEADERS = rotate.h SOURCES = rotate.cpp TARGET = rotateapplet DESTDIR = $(OPIEDIR)/plugins/applets INCLUDEPATH += $(OPIEDIR)/include DEPENDPATH += $(OPIEDIR)/include -LIBS += -lqpe +LIBS += -lqpe -lopiecore2 VERSION = 1.0.0 include ( $(OPIEDIR)/include.pro ) target.path = $$prefix/plugins/applets diff --git a/core/applets/screenshotapplet/config.in b/core/applets/screenshotapplet/config.in index cafd470..98f2b61 100644 --- a/core/applets/screenshotapplet/config.in +++ b/core/applets/screenshotapplet/config.in @@ -1,4 +1,4 @@ config SCREENSHOTAPPLET boolean "opie-screenshotapplet (create images from your current display)" default "y" - depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE + depends ( LIBQPE || LIBQPE-X11 ) diff --git a/core/applets/screenshotapplet/inputDialog.cpp b/core/applets/screenshotapplet/inputDialog.cpp index 73ec773..ce03ec0 100644 --- a/core/applets/screenshotapplet/inputDialog.cpp +++ b/core/applets/screenshotapplet/inputDialog.cpp @@ -2,32 +2,33 @@ ** Form implementation generated from reading ui file 'inputDialog.ui' ** ** Created: Sat Mar 2 07:55:03 2002 ** by: The User Interface Compiler (uic) ** ** WARNING! All changes made in this file will be lost! ****************************************************************************/ #include "inputDialog.h" #include <qpe/resource.h> #include <opie2/ofiledialog.h> #include <qlineedit.h> #include <qpushbutton.h> +using namespace Opie::Ui; InputDialog::InputDialog( QWidget* parent, const char* name, bool modal, WFlags fl ) : QDialog( parent, name, modal, fl ) { if ( !name ) setName( "InputDialog" ); resize( 234, 115); setMaximumSize( QSize( 240, 40)); setCaption( tr(name ) ); QPushButton *browserButton; browserButton = new QPushButton( Resource::loadIconSet("fileopen"),"",this,"BrowseButton"); browserButton->setGeometry( QRect( 205, 10, 22, 22)); connect( browserButton, SIGNAL(released()),this,SLOT(browse())); LineEdit1 = new QLineEdit( this, "LineEdit1" ); LineEdit1->setGeometry( QRect( 4, 10, 190, 22 ) ); } @@ -45,20 +46,20 @@ void InputDialog::browse() { MimeTypes types; QStringList audio, video, all; audio << "audio/*"; audio << "playlist/plain"; audio << "audio/x-mpegurl"; video << "video/*"; video << "playlist/plain"; all += audio; all += video; types.insert("All Media Files", all ); types.insert("Audio", audio ); types.insert("Video", video ); - QString str = Opie::OFileDialog::getOpenFileName( 1,"/","", types, 0 ); + QString str = Opie::Ui::OFileDialog::getOpenFileName( 1,"/","", types, 0 ); LineEdit1->setText(str); } diff --git a/core/applets/screenshotapplet/screenshot.cpp b/core/applets/screenshotapplet/screenshot.cpp index 20e1c9b..9aa012a 100644 --- a/core/applets/screenshotapplet/screenshot.cpp +++ b/core/applets/screenshotapplet/screenshot.cpp @@ -26,32 +26,33 @@ #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 */ +using namespace Opie::Ui; static char * snapshot_xpm[] = { "32 32 177 2", " c None", ". c #042045", "+ c #0D2B47", "@ c #0E325E", "# c #0D2E50", "$ c #0A1C32", "% c #0F3A69", "& c #164680", "* c #165EAE", "= c #134D89", "- c #0A3A6E", "; c #031024", "> c #031B36", ", c #1A5EA3", @@ -523,21 +524,19 @@ void ScreenshotApplet::mousePressEvent( QMouseEvent *) XwindowPosX = windowPosX + sc-> sizeHint ( ). width ( ) - screenWidth; ZwindowPosX = windowPosX - XwindowPosX - 1; } else { ZwindowPosX = windowPosX; } sc-> move ( ZwindowPosX, curPos. y ( ) - sc-> sizeHint ( ). height ( ) ); sc-> show ( ); } void ScreenshotApplet::paintEvent( QPaintEvent* ) { QPainter p ( this ); p.drawPixmap( 0,0, m_icon ); } -Q_EXPORT_INTERFACE() -{ - Q_CREATE_INSTANCE( OTaskbarAppletWrapper<ScreenshotApplet> ); -} + +EXPORT_OPIE_APPLET_v1( ScreenshotApplet ) diff --git a/core/applets/suspendapplet/config.in b/core/applets/suspendapplet/config.in index fdbe8b3..d75f581 100644 --- a/core/applets/suspendapplet/config.in +++ b/core/applets/suspendapplet/config.in @@ -1,4 +1,4 @@ config SUSPENDAPPLET boolean "Suspend" default "y" - depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE + depends ( LIBQPE || LIBQPE-X11 ) diff --git a/core/applets/vmemo/config.in b/core/applets/vmemo/config.in index d13492d..356ab16 100644 --- a/core/applets/vmemo/config.in +++ b/core/applets/vmemo/config.in @@ -1,4 +1,4 @@ config VMEMO boolean "opie-vmemo (take voice memos)" default "y" - depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE + depends ( LIBQPE || LIBQPE-X11 ) diff --git a/core/applets/vmemo/vmemo.cpp b/core/applets/vmemo/vmemo.cpp index 27f6015..7dd5b4b 100644 --- a/core/applets/vmemo/vmemo.cpp +++ b/core/applets/vmemo/vmemo.cpp @@ -180,32 +180,33 @@ static char * vmemo_xpm[] = { " $ % & * = - ", " ; > , ' ) ! ~ ", " { ] ^ / ( _ : ", " < [ } | 1 2 3 ", " 4 5 6 7 8 9 0 a b c ", " d e f g h i j 3 k l m n ", " o p q r s t u v w n ", " o x y z A B C D E n ", " F G H I J K L M N O ", " P Q R S T U V W X ", " Y Z ` b ...+. ", " @.#.$.%.&. ", " *.B =. ", " n n n n n n n n n "}; +using namespace Opie::Ui; VMemo::VMemo( QWidget *parent, const char *_name ) : QWidget( parent, _name ) { setFixedHeight( 18 ); setFixedWidth( 14 ); t_timer = new QTimer( this ); connect( t_timer, SIGNAL( timeout() ), SLOT( timerBreak() ) ); Config vmCfg("Vmemo"); vmCfg.setGroup("Defaults"); int toggleKey = setToggleButton(vmCfg.readNumEntry("toggleKey", -1)); useADPCM = vmCfg.readBoolEntry("use_ADPCM", 0); qDebug("toggleKey %d", toggleKey); if ( QFile::exists ( "/dev/sharp_buz" ) || QFile::exists ( "/dev/sharp_led" )) systemZaurus=TRUE; @@ -625,21 +626,19 @@ int VMemo::setToggleButton(int tog) { return Key_F11; break; case 8: return Key_F13; break; }; } return -1; } void VMemo::timerBreak() { //stop stopRecording(); QMessageBox::message("Vmemo","Vmemo recording has ended"); } -Q_EXPORT_INTERFACE() -{ - Q_CREATE_INSTANCE( OTaskbarAppletWrapper<VMemo> ); -} + +EXPORT_OPIE_APPLET_v1( VMemo ) diff --git a/core/applets/volumeapplet/config.in b/core/applets/volumeapplet/config.in index 1233d9f..f097591 100644 --- a/core/applets/volumeapplet/config.in +++ b/core/applets/volumeapplet/config.in @@ -1,4 +1,4 @@ config VOLUMEAPPLET boolean "opie-volumeapplet (set volume for microphone and speaker)" default "y" - depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE + depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIECORE2 diff --git a/core/applets/volumeapplet/volume.cpp b/core/applets/volumeapplet/volume.cpp index 942cebb..276f47f 100644 --- a/core/applets/volumeapplet/volume.cpp +++ b/core/applets/volumeapplet/volume.cpp @@ -26,40 +26,41 @@ #include <qpe/resource.h> #include <qpe/applnk.h> #include <qpe/config.h> #include <qpe/qcopenvelope_qws.h> #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 <stdio.h> -using namespace Opie; +using namespace Opie::Core; #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. /* XPM */ +using namespace Opie::Ui; static const char * vol_xpm[] = { "20 20 3 1", " c None", ". c #0000FF", "+ c #000000", " ", " . ", " . . . . ", " . . . . . . ", " . . . . . . . ", " . . ..... . . ", " . ... ..... ... ", " ........... .... ", " ................. ", "++++++++++++++++++++", " .................. ", @@ -764,20 +765,17 @@ void VolumeApplet::paintEvent ( QPaintEvent * ) p. drawRect ( 1, height() - 4, width() - 2, 4 ); int pixelsWide = m_dialog-> volPercent ( ) * ( width() - 4 ) / 100; p. fillRect ( 2, height() - 3, pixelsWide, 2, red ); p. fillRect ( pixelsWide + 2, height() - 3, width() - 4 - pixelsWide, 2, lightGray ); if ( m_dialog-> volMuted ( )) { p. setPen ( red ); p. drawLine ( 1, 2, width() - 2, height() - 5 ); p. drawLine ( 1, 3, width() - 2, height() - 4 ); p. drawLine ( width() - 2, 2, 1, height() - 5 ); p. drawLine ( width() - 2, 3, 1, height() - 4 ); } } -Q_EXPORT_INTERFACE() -{ - Q_CREATE_INSTANCE( OTaskbarAppletWrapper<VolumeApplet> ); -} +EXPORT_OPIE_APPLET_v1( VolumeApplet ) diff --git a/core/applets/volumeapplet/volumeapplet.pro b/core/applets/volumeapplet/volumeapplet.pro index b14956e..b478ed1 100644 --- a/core/applets/volumeapplet/volumeapplet.pro +++ b/core/applets/volumeapplet/volumeapplet.pro @@ -1,13 +1,13 @@ TEMPLATE = lib CONFIG += qt plugin warn_on release HEADERS = volume.h oledbox.h SOURCES = volume.cpp oledbox.cpp TARGET = volumeapplet DESTDIR = $(OPIEDIR)/plugins/applets INCLUDEPATH += $(OPIEDIR)/include DEPENDPATH += ../$(OPIEDIR)/include -LIBS += -lqpe +LIBS += -lqpe -lopiecore2 VERSION = 1.0.0 include ( $(OPIEDIR)/include.pro ) target.path = $$prefix/plugins/applets diff --git a/core/applets/vtapplet/config.in b/core/applets/vtapplet/config.in index 85692a5..8fe4200 100644 --- a/core/applets/vtapplet/config.in +++ b/core/applets/vtapplet/config.in @@ -1,4 +1,4 @@ config VTAPPLET boolean "VT (switch to another virtual terminal)" default "y" - depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE + depends ( LIBQPE || LIBQPE-X11 ) diff --git a/core/obex/config.in b/core/obex/config.in index ef09f7a..c0208d1 100644 --- a/core/obex/config.in +++ b/core/obex/config.in @@ -1,4 +1,4 @@ config OBEX boolean "libopieobex0 (library needed for beaming in Opie)" default "y" - depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE + depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIECORE2 diff --git a/core/obex/obex.cc b/core/obex/obex.cc index 50e5201..3c99af6 100644 --- a/core/obex/obex.cc +++ b/core/obex/obex.cc @@ -1,55 +1,56 @@ #include <qfileinfo.h> -#include <opie/oprocess.h> +#include <opie2/oprocess.h> #include "obex.h" using namespace OpieObex; +using namespace Opie::Core; /* TRANSLATOR OpieObex::Obex */ Obex::Obex( QObject *parent, const char* name ) : QObject(parent, name ) { m_rec = 0; m_send=0; m_count = 0; m_receive = false; connect( this, SIGNAL(error(int) ), // for recovering to receive SLOT(slotError() ) ); connect( this, SIGNAL(sent(bool) ), SLOT(slotError() ) ); }; Obex::~Obex() { delete m_rec; delete m_send; } void Obex::receive() { m_receive = true; m_outp = QString::null; qWarning("Receive" ); m_rec = new OProcess(); *m_rec << "irobex_palm3"; // connect to the necessary slots - connect(m_rec, SIGNAL(processExited(OProcess*) ), - this, SLOT(slotExited(OProcess*) ) ); + connect(m_rec, SIGNAL(processExited(Opie::Core::OProcess*) ), + this, SLOT(slotExited(Opie::Core::OProcess*) ) ); - connect(m_rec, SIGNAL(receivedStdout(OProcess*, char*, int ) ), - this, SLOT(slotStdOut(OProcess*, char*, int) ) ); + connect(m_rec, SIGNAL(receivedStdout(Opie::Core::OProcess*, char*, int ) ), + this, SLOT(slotStdOut(Opie::Core::OProcess*, char*, int) ) ); if(!m_rec->start(OProcess::NotifyOnExit, OProcess::AllOutput) ) { qWarning("could not start :("); emit done( false ); delete m_rec; m_rec = 0; } // emit currentTry(m_count ); } void Obex::send( const QString& fileName) { // if currently receiving stop it send receive m_count = 0; m_file = fileName; qWarning("send %s", fileName.latin1() ); if (m_rec != 0 ) { qWarning("running"); @@ -67,36 +68,36 @@ void Obex::send( const QString& fileName) { // if currently receiving stop it se } sendNow(); } void Obex::sendNow(){ qWarning("sendNow"); if ( m_count >= 25 ) { // could not send emit error(-1 ); emit sent(false); return; } // OProcess inititialisation m_send = new OProcess(); *m_send << "irobex_palm3"; *m_send << QFile::encodeName(m_file); // connect to slots Exited and and StdOut - connect(m_send, SIGNAL(processExited(OProcess*) ), - this, SLOT(slotExited(OProcess*)) ); - connect(m_send, SIGNAL(receivedStdout(OProcess*, char*, int )), - this, SLOT(slotStdOut(OProcess*, char*, int) ) ); + connect(m_send, SIGNAL(processExited(Opie::Core::OProcess*) ), + this, SLOT(slotExited(Opie::Core::OProcess*)) ); + connect(m_send, SIGNAL(receivedStdout(Opie::Core::OProcess*, char*, int )), + this, SLOT(slotStdOut(Opie::Core::OProcess*, char*, int) ) ); // now start it if (!m_send->start(/*OProcess::NotifyOnExit, OProcess::AllOutput*/ ) ) { qWarning("could not send" ); m_count = 25; emit error(-1 ); delete m_send; m_send=0; } // end m_count++; emit currentTry( m_count ); } void Obex::slotExited(OProcess* proc ){ if (proc == m_rec ) { // receive process diff --git a/core/obex/obex.h b/core/obex/obex.h index 60f5d28..284cb12 100644 --- a/core/obex/obex.h +++ b/core/obex/obex.h @@ -1,24 +1,24 @@ #ifndef OpieObex_H #define OpieObex_H #include <qobject.h> -class OProcess; +namespace Opie {namespace Core {class OProcess;}} class QCopChannel; namespace OpieObex { class Obex : public QObject { Q_OBJECT public: /** * Obex c'tor look */ Obex( QObject *parent, const char* name); /** * d'tor */ ~Obex(); /** * Starting listening to irda after enabled by the applet @@ -40,45 +40,45 @@ namespace OpieObex { */ void error( int ); /** * The current try to receive data */ void currentTry(unsigned int); /** * signal sent The file got beamed to the remote location */ void sent(bool); void done(bool); private: uint m_count; QString m_file; QString m_outp; - OProcess *m_send; - OProcess *m_rec; + Opie::Core::OProcess *m_send; + Opie::Core::OProcess *m_rec; bool m_receive : 1; void shutDownReceive(); private slots: /** * send over palm obex */ //void send(const QString&); // the process exited - void slotExited(OProcess* proc) ; - void slotStdOut(OProcess*, char*, int); + void slotExited(Opie::Core::OProcess* proc) ; + void slotStdOut(Opie::Core::OProcess*, char*, int); void slotError(); private: void sendNow(); QString parseOut(); void received(); void sendEnd(); }; }; #endif diff --git a/core/obex/obex.pro b/core/obex/obex.pro index a296b2c..51fa300 100644 --- a/core/obex/obex.pro +++ b/core/obex/obex.pro @@ -1,13 +1,13 @@ TEMPLATE = lib CONFIG += qt warn_on release -HEADERS = obex.h obexhandler.h obexsend.h receiver.h -SOURCES = obex.cc obexsend.cpp obexhandler.cpp receiver.cpp +HEADERS = obex.h obexhandler.h obexsend.h receiver.h obeximpl.h +SOURCES = obex.cc obexsend.cpp obexhandler.cpp receiver.cpp obeximpl.cpp TARGET = opieobex DESTDIR = $(OPIEDIR)/plugins/obex INCLUDEPATH += $(OPIEDIR)/include $(OPIEDIR)/core/launcher DEPENDPATH += ../$(OPIEDIR)/include LIBS += -lqpe -lopiecore2 VERSION = 0.0.2 include ( $(OPIEDIR)/include.pro ) target.path = $$prefix/plugins/applets diff --git a/core/obex/obeximpl.cpp b/core/obex/obeximpl.cpp index 5b53644..ca6ce7b 100644 --- a/core/obex/obeximpl.cpp +++ b/core/obex/obeximpl.cpp @@ -1,19 +1,21 @@ #include "obexhandler.h" #include "obeximpl.h" + + using namespace OpieObex; /* TRANSLATOR OpieObex::ObexImpl */ ObexImpl::ObexImpl() { m_handler = new ObexHandler; } ObexImpl::~ObexImpl() { delete m_handler; } QRESULT ObexImpl::queryInterface( const QUuid& uuid, QUnknownInterface **iface ) { *iface = 0; if ( uuid == IID_QUnknown ) { *iface = this; }else if ( uuid == IID_ObexInterface ) *iface = this; |