author | llornkcor <llornkcor> | 2002-05-22 13:00:46 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-05-22 13:00:46 (UTC) |
commit | 492c5c3c07a192b3a00e76f227e40d98459db1aa (patch) (side-by-side diff) | |
tree | 0c07a9c56b528d693ff14b4fc3e4cba4407a682b | |
parent | d3466b66bd9189219b6dff7fd248169b5725a1b8 (diff) | |
download | opie-492c5c3c07a192b3a00e76f227e40d98459db1aa.zip opie-492c5c3c07a192b3a00e76f227e40d98459db1aa.tar.gz opie-492c5c3c07a192b3a00e76f227e40d98459db1aa.tar.bz2 |
added #include custom-ipaq.h for ipaq builds for ipaq sounds
-rw-r--r-- | core/launcher/desktop.cpp | 3 | ||||
-rw-r--r-- | core/launcher/taskbar.cpp | 92 |
2 files changed, 51 insertions, 44 deletions
diff --git a/core/launcher/desktop.cpp b/core/launcher/desktop.cpp index 85ba160..649862b 100644 --- a/core/launcher/desktop.cpp +++ b/core/launcher/desktop.cpp @@ -20,48 +20,51 @@ #include "desktop.h" #include "info.h" #include "launcher.h" #include "mrulist.h" #include "qcopbridge.h" #include "shutdownimpl.h" #include "startmenu.h" #include "taskbar.h" #include "transferserver.h" #include "irserver.h" #include "packageslave.h" #include <qpe/applnk.h> #include <qpe/mimetype.h> #include <qpe/password.h> #include <qpe/config.h> #include <qpe/power.h> #include <qpe/timeconversion.h> #include <qpe/qcopenvelope_qws.h> #include <qpe/global.h> #ifdef QT_QWS_CUSTOM #include "qpe/custom.h" #endif +#if defined(QT_QWS_IPAQ) +#include "qpe/custom-ipaq.h" +#endif #include <qgfx_qws.h> #include <qmainwindow.h> #include <qmessagebox.h> #include <qtimer.h> #include <qwindowsystem_qws.h> #include <qvaluelist.h> #include <stdlib.h> #include <unistd.h> class QCopKeyRegister { public: QCopKeyRegister() : keyCode(0) { } QCopKeyRegister(int k, const QString &c, const QString &m) : keyCode(k), channel(c), message(m) { } int getKeyCode() const { return keyCode; } QString getChannel() const { return channel; } QString getMessage() const { return message; } private: diff --git a/core/launcher/taskbar.cpp b/core/launcher/taskbar.cpp index 18d28cb..54777c6 100644 --- a/core/launcher/taskbar.cpp +++ b/core/launcher/taskbar.cpp @@ -14,301 +14,305 @@ ** 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 "startmenu.h" #include "inputmethods.h" #include "mrulist.h" #include "systray.h" #include "calibrate.h" #include "wait.h" #include "appicons.h" #include "taskbar.h" #include "desktop.h" #include <qpe/qpeapplication.h> #include <qpe/qcopenvelope_qws.h> #include <qpe/global.h> #ifdef QT_QWS_CUSTOM #include <qpe/custom.h> #endif +#if defined(QT_QWS_IPAQ) +#include "qpe/custom-ipaq.h" +#endif + #include <qlabel.h> #include <qlayout.h> #include <qtimer.h> #include <qwindowsystem_qws.h> #include <qwidgetstack.h> #if defined( Q_WS_QWS ) #include <qwsdisplay_qws.h> #include <qgfx_qws.h> #endif #define FACTORY(T) \ static QWidget *new##T( bool maximized ) { \ - QWidget *w = new T( 0, "test", QWidget::WDestructiveClose | QWidget::WGroupLeader ); \ - if ( maximized ) { \ - if ( qApp->desktop()->width() <= 350 ) { \ - w->showMaximized(); \ - } else { \ - w->resize( QSize( 300, 300 ) ); \ - } \ - } \ - w->show(); \ - return w; \ + QWidget *w = new T( 0, "test", QWidget::WDestructiveClose | QWidget::WGroupLeader ); \ + if ( maximized ) { \ + if ( qApp->desktop()->width() <= 350 ) { \ + w->showMaximized(); \ + } else { \ + w->resize( QSize( 300, 300 ) ); \ + } \ + } \ + w->show(); \ + return w; \ } #ifdef SINGLE_APP #define APP(a,b,c,d) FACTORY(b) #include "../launcher/apps.h" #undef APP #endif // SINGLE_APP static Global::Command builtins[] = { #ifdef SINGLE_APP #define APP(a,b,c,d) { a, new##b, c }, #include "../launcher/apps.h" #undef APP #endif #if defined(QT_QWS_IPAQ) || defined(QT_QWS_CASSIOPEIA) || defined(QT_QWS_EBX) - { "calibrate", TaskBar::calibrate, 1, 0 }, + { "calibrate", TaskBar::calibrate, 1, 0 }, #endif #if !defined(QT_QWS_CASSIOPEIA) - { "shutdown", Global::shutdown, 1, 0 }, -// { "run", run, 1, 0 }, + { "shutdown", Global::shutdown, 1, 0 }, +// { "run", run, 1, 0 }, #endif - { 0, TaskBar::calibrate, 0, 0 }, + { 0, TaskBar::calibrate, 0, 0 }, }; static bool initNumLock() { #ifdef QPE_INITIAL_NUMLOCK_STATE QPE_INITIAL_NUMLOCK_STATE #endif return FALSE; } class LockKeyState : public QWidget { public: LockKeyState( QWidget *parent ) : - QWidget(parent), - nl(initNumLock()), cl(FALSE) + QWidget(parent), + nl(initNumLock()), cl(FALSE) { - nl_pm = Resource::loadPixmap("numlock"); - cl_pm = Resource::loadPixmap("capslock"); + nl_pm = Resource::loadPixmap("numlock"); + cl_pm = Resource::loadPixmap("capslock"); } QSize sizeHint() const { - return QSize(nl_pm.width()+2,nl_pm.width()+nl_pm.height()+1); + return QSize(nl_pm.width()+2,nl_pm.width()+nl_pm.height()+1); } void toggleNumLockState() { - nl = !nl; repaint(); + nl = !nl; repaint(); } void toggleCapsLockState() { - cl = !cl; repaint(); + cl = !cl; repaint(); } void paintEvent( QPaintEvent * ) { - int y = (height()-sizeHint().height())/2; - QPainter p(this); - if ( nl ) - p.drawPixmap(1,y,nl_pm); - if ( cl ) - p.drawPixmap(1,y+nl_pm.height()+1,cl_pm); + int y = (height()-sizeHint().height())/2; + QPainter p(this); + if ( nl ) + p.drawPixmap(1,y,nl_pm); + if ( cl ) + p.drawPixmap(1,y+nl_pm.height()+1,cl_pm); } private: QPixmap nl_pm, cl_pm; bool nl, cl; }; TaskBar::~TaskBar() { } TaskBar::TaskBar() : QHBox(0, 0, WStyle_Customize | WStyle_Tool | WStyle_StaysOnTop | WGroupLeader) { Global::setBuiltinCommands(builtins); sm = new StartMenu( this ); inputMethods = new InputMethods( this ); connect( inputMethods, SIGNAL(inputToggled(bool)), - this, SLOT(calcMaxWindowRect()) ); + this, SLOT(calcMaxWindowRect()) ); //new QuickLauncher( this ); stack = new QWidgetStack( this ); stack->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Minimum ) ); label = new QLabel(stack); mru = new MRUList( stack ); stack->raiseWidget( mru ); waitIcon = new Wait( this ); (void) new AppIcons( this ); sysTray = new SysTray( this ); // ## make customizable in some way? #ifdef QT_QWS_CUSTOM lockState = new LockKeyState( this ); #else lockState = 0; #endif #if defined(Q_WS_QWS) #if !defined(QT_NO_COP) QCopChannel *channel = new QCopChannel( "QPE/TaskBar", this ); connect( channel, SIGNAL(received(const QCString&, const QByteArray&)), - this, SLOT(receive(const QCString&, const QByteArray&)) ); + this, SLOT(receive(const QCString&, const QByteArray&)) ); #endif #endif waitTimer = new QTimer( this ); connect( waitTimer, SIGNAL( timeout() ), this, SLOT( stopWait() ) ); clearer = new QTimer( this ); QObject::connect(clearer, SIGNAL(timeout()), SLOT(clearStatusBar())); QObject::connect(clearer, SIGNAL(timeout()), sysTray, SLOT(show())); } void TaskBar::setStatusMessage( const QString &text ) { label->setText( text ); stack->raiseWidget( label ); if ( sysTray && ( label->fontMetrics().width( text ) > label->width() ) ) - sysTray->hide(); + sysTray->hide(); clearer->start( 3000 ); } void TaskBar::clearStatusBar() { label->clear(); stack->raiseWidget( mru ); } void TaskBar::startWait() { waitIcon->setWaiting( true ); // a catchall stop after 10 seconds... waitTimer->start( 10 * 1000, true ); } void TaskBar::stopWait(const QString& app) { waitTimer->stop(); mru->addTask(sm->execToLink(app)); waitIcon->setWaiting( false ); } void TaskBar::stopWait() { waitTimer->stop(); waitIcon->setWaiting( false ); } void TaskBar::resizeEvent( QResizeEvent *e ) { QHBox::resizeEvent( e ); calcMaxWindowRect(); } void TaskBar::styleChange( QStyle &s ) { QHBox::styleChange( s ); calcMaxWindowRect(); } void TaskBar::calcMaxWindowRect() { #ifdef Q_WS_QWS QRect wr; int displayWidth = qApp->desktop()->width(); QRect ir = inputMethods->inputRect(); if ( ir.isValid() ) { - wr.setCoords( 0, 0, displayWidth-1, ir.top()-1 ); + wr.setCoords( 0, 0, displayWidth-1, ir.top()-1 ); } else { - wr.setCoords( 0, 0, displayWidth-1, y()-1 ); + wr.setCoords( 0, 0, displayWidth-1, y()-1 ); } #if QT_VERSION < 300 QWSServer::setMaxWindowRect( qt_screen->mapToDevice(wr, - QSize(qt_screen->width(),qt_screen->height())) - ); + QSize(qt_screen->width(),qt_screen->height())) + ); #else QWSServer::setMaxWindowRect( wr ); #endif #endif } void TaskBar::receive( const QCString &msg, const QByteArray &data ) { QDataStream stream( data, IO_ReadOnly ); if ( msg == "message(QString)" ) { QString text; stream >> text; setStatusMessage( text ); } else if ( msg == "hideInputMethod()" ) { - inputMethods->hideInputMethod(); + inputMethods->hideInputMethod(); } else if ( msg == "showInputMethod()" ) { - inputMethods->showInputMethod(); + inputMethods->showInputMethod(); } else if ( msg == "reloadInputMethods()" ) { - inputMethods->loadInputMethods(); + inputMethods->loadInputMethods(); } else if ( msg == "reloadApplets()" ) { - sysTray->loadApplets(); + sysTray->loadApplets(); } else if ( msg == "soundAlarm()" ) { - Desktop::soundAlarm(); + Desktop::soundAlarm(); } #ifdef CUSTOM_LEDS else if ( msg == "setLed(int,bool)" ) { - int led, status; - stream >> led >> status; - CUSTOM_LEDS( led, status ); + int led, status; + stream >> led >> status; + CUSTOM_LEDS( led, status ); } #endif } QWidget *TaskBar::calibrate(bool) { #ifdef Q_WS_QWS Calibrate *c = new Calibrate; c->show(); return c; #else return 0; #endif } void TaskBar::toggleNumLockState() { if ( lockState ) lockState->toggleNumLockState(); } void TaskBar::toggleCapsLockState() { if ( lockState ) lockState->toggleCapsLockState(); } void TaskBar::toggleSymbolInput() { if ( inputMethods->currentShown() == "Unicode" ) { - inputMethods->hideInputMethod(); + inputMethods->hideInputMethod(); } else { - inputMethods->showInputMethod("Unicode"); + inputMethods->showInputMethod("Unicode"); } } bool TaskBar::recoverMemory() { return mru->quitOldApps(); } |