author | kergoth <kergoth> | 2003-01-26 19:58:41 (UTC) |
---|---|---|
committer | kergoth <kergoth> | 2003-01-26 19:58:41 (UTC) |
commit | 808181587c1cea5a089c75df7d2833f100bddbf1 (patch) (side-by-side diff) | |
tree | 94b59d3b5d649cf9c7a15f76f5b049030684913e | |
parent | f389dd4e3d5ceacb15b5c0b751a618d7586d6c31 (diff) | |
download | opie-808181587c1cea5a089c75df7d2833f100bddbf1.zip opie-808181587c1cea5a089c75df7d2833f100bddbf1.tar.gz opie-808181587c1cea5a089c75df7d2833f100bddbf1.tar.bz2 |
Add setCurrentRotation QCop call for later use of on the fly rotation. Also adapt depends to the actual required qt version.
-rw-r--r-- | library/libqpe1.control | 2 | ||||
-rw-r--r-- | library/qpeapplication.cpp | 5 | ||||
-rw-r--r-- | library/qpeapplication.h | 63 |
3 files changed, 52 insertions, 18 deletions
diff --git a/library/libqpe1.control b/library/libqpe1.control index 6743e28..94992b1 100644 --- a/library/libqpe1.control +++ b/library/libqpe1.control @@ -1,8 +1,8 @@ Files: $OPIEDIR/lib/libqpe.so.1 $OPIEDIR/lib/libqpe.so.1.5 $OPIEDIR/lib/libqpe.so.1.5.0 Priority: required Section: opie/system Maintainer: Project Opie <opie@handhelds.org> Architecture: arm Version: $QPE_VERSION-$SUB_VERSION.1 -Depends: libqt2-emb (>=$QTE_VERSION), libqt2-emb-fonts (>=$QTE_VERSION) +Depends: libqt2-emb (>=2.3.4-beta4), libqt2-emb-fonts (>=$QTE_VERSION) Description: libqpe, base qtopia/opie library. diff --git a/library/qpeapplication.cpp b/library/qpeapplication.cpp index b21428a..95c4a1b 100644 --- a/library/qpeapplication.cpp +++ b/library/qpeapplication.cpp @@ -1057,24 +1057,29 @@ void QPEApplication::systemMessage( const QCString& msg, const QByteArray& data if ( !oldactive && !man-> isActive ( )) { // no menubar to toggle -> try O-Menu QCopEnvelope e ( "QPE/TaskBar", "toggleStartMenu()" ); } } } else if ( msg == "setDefaultRotation(int)" ) { if ( type() == GuiServer ) { int r; stream >> r; setDefaultRotation( r ); } } + else if ( msg == "setCurrentRotation(int)" ) { + int r; + stream >> r; + setCurrentRotation( r ); + } else if ( msg == "shutdown()" ) { if ( type() == GuiServer ) shutdown(); } else if ( msg == "quit()" ) { if ( type() != GuiServer ) tryQuit(); } else if ( msg == "forceQuit()" ) { if ( type() != GuiServer ) quit(); } diff --git a/library/qpeapplication.h b/library/qpeapplication.h index 7d956a3..7505115 100644 --- a/library/qpeapplication.h +++ b/library/qpeapplication.h @@ -12,72 +12,75 @@ ** 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 __QPE_APPLICATION_H__ #define __QPE_APPLICATION_H__ +#include <qglobal.h> #include <qapplication.h> #include <qdialog.h> +#include <qwsdisplay_qws.h> #if defined(_WS_QWS_) && !defined(Q_WS_QWS) #define Q_WS_QWS #endif #include "qpedecoration_qws.h" #include "timestring.h" class QCopChannel; class QPEApplicationData; class QWSEvent; class QWSKeyEvent; class QPEApplication : public QApplication { Q_OBJECT public: QPEApplication( int& argc, char **argv, Type=GuiClient ); ~QPEApplication(); static QString qpeDir(); static QString documentDir(); void applyStyle(); static int defaultRotation(); static void setDefaultRotation(int r); + static void setCurrentRotation(int r); static void grabKeyboard(); static void ungrabKeyboard(); enum StylusMode { - LeftOnly, - RightOnHold - // RightOnHoldLeftDelayed, etc. + LeftOnly, + RightOnHold + // RightOnHoldLeftDelayed, etc. }; static void setStylusOperation( QWidget*, StylusMode ); static StylusMode stylusOperation( QWidget* ); enum InputMethodHint { - Normal, - AlwaysOff, - AlwaysOn + Normal, + AlwaysOff, + AlwaysOn }; enum screenSaverHint { - Disable = 0, - DisableLightOff = 1, - DisableSuspend = 2, - Enable = 100 + Disable = 0, + DisableLightOff = 1, + DisableSuspend = 2, + Enable = 100 }; static void setInputMethodHint( QWidget *, InputMethodHint ); static InputMethodHint inputMethodHint( QWidget * ); void showMainWidget( QWidget*, bool nomax=FALSE ); void showMainDocumentWidget( QWidget*, bool nomax=FALSE ); static void showDialog( QDialog*, bool nomax=FALSE ); static int execDialog( QDialog*, bool nomax=FALSE ); static void setKeepRunning(); bool keepRunning() const; @@ -106,54 +109,80 @@ private slots: protected: bool qwsEventFilter( QWSEvent * ); void internalSetStyle( const QString &style ); void prepareForTermination(bool willrestart); virtual void restart(); virtual void shutdown(); bool eventFilter( QObject *, QEvent * ); void timerEvent( QTimerEvent * ); bool raiseAppropriateWindow(); virtual void tryQuit(); - virtual void polish ( QWidget * ); // this is actually implemented in qt_override.cpp (!) + virtual void polish ( QWidget * ); // this is actually implemented in qt_override.cpp (!) private: void mapToDefaultAction( QWSKeyEvent *ke, int defKey ); #if defined(Q_WS_QWS) && !defined(QT_NO_COP) QCopChannel *sysChannel; QCopChannel *pidChannel; #endif QPEApplicationData *d; bool reserved_sh; }; inline void QPEApplication::showDialog( QDialog* d, bool nomax ) { QSize sh = d->sizeHint(); int w = QMAX(sh.width(),d->width()); int h = QMAX(sh.height(),d->height()); if ( !nomax - && ( w > qApp->desktop()->width()*3/4 - || h > qApp->desktop()->height()*3/4 ) ) + && ( w > qApp->desktop()->width()*3/4 + || h > qApp->desktop()->height()*3/4 ) ) { - d->showMaximized(); + d->showMaximized(); } else { - d->resize(w,h); - d->show(); + d->resize(w,h); + d->show(); } } inline int QPEApplication::execDialog( QDialog* d, bool nomax ) { showDialog(d,nomax); return d->exec(); } +enum Transformation { None, Rot90, Rot180, Rot270 }; /* from qgfxtransformed_qws.cpp */ -#endif +inline void QPEApplication::setCurrentRotation( int r ) +{ + Transformation e; + + switch (r) { + case 0: + e = None; + break; + case 90: + e = Rot90; + break; + case 180: + e = Rot180; + break; + case 270: + e = Rot270; + break; + default: + return; + } + qDebug("calling qApp->desktop()->qwsDisplay()->setTransformation( %d )\n", e); + qApp->desktop()->qwsDisplay()->setTransformation( e ); +} + + +#endif |