-rw-r--r-- | library/fileselector.h | 5 | ||||
-rw-r--r-- | library/library.pro | 3 | ||||
-rw-r--r-- | library/qcom.h | 3 | ||||
-rw-r--r-- | library/qpeapplication.cpp | 80 | ||||
-rw-r--r-- | library/qpeapplication.h | 58 | ||||
-rw-r--r-- | library/qpedecoration_qws.cpp | 3 | ||||
-rw-r--r-- | library/qpeglobal.h | 41 | ||||
-rw-r--r-- | library/qpemenubar.h | 4 | ||||
-rw-r--r-- | library/qpetoolbar.h | 3 | ||||
-rw-r--r-- | library/widget_showing.cpp | 74 |
10 files changed, 177 insertions, 97 deletions
diff --git a/library/fileselector.h b/library/fileselector.h index e3ae891..f1738db 100644 --- a/library/fileselector.h +++ b/library/fileselector.h @@ -27,2 +27,3 @@ +#include "qpeglobal.h" #include "filemanager.h" @@ -55,3 +56,3 @@ public: void setNewVisible( bool b ); - void setCloseVisible( bool b ); + void setCloseVisible( bool b ) QPE_DEPRECATED; void setTypeComboVisible( bool b = TRUE ); @@ -107,3 +108,3 @@ private: // RESOLVE please -zecke@handhelds.org - const DocLnk *selected(); // use selectedDocument() luckily no compiler is putting the access into the symbol name + const DocLnk *selected() QPE_DEPRECATED; // use selectedDocument() luckily no compiler is putting the access into the symbol name FileSelectorView *view; diff --git a/library/library.pro b/library/library.pro index cdc1dab..45e69bc 100644 --- a/library/library.pro +++ b/library/library.pro @@ -119,3 +119,4 @@ SOURCES = calendar.cpp \ lnkproperties.cpp \ - qt_override.cpp + qt_override.cpp \ + widget_showing.cpp diff --git a/library/qcom.h b/library/qcom.h index 9972d8f..5703800 100644 --- a/library/qcom.h +++ b/library/qcom.h @@ -28,2 +28,3 @@ #include <qpe/quuid.h> +#include <qpe/qpeglobal.h> @@ -153,3 +154,3 @@ struct Q_EXPORT QtULong #define Q_EXPORT_INTERFACE() \ - extern "C" QUnknownInterface* ucm_instantiate() + extern "C" QUnknownInterface* ucm_instantiate QPE_EXPORT_SYMBOL () diff --git a/library/qpeapplication.cpp b/library/qpeapplication.cpp index 4adfc8f..43a9be5 100644 --- a/library/qpeapplication.cpp +++ b/library/qpeapplication.cpp @@ -200,8 +200,7 @@ public: - static void show_mx(QWidget* mw, bool nomaximize, QString &strName) - { - if ( mw->inherits("QMainWindow") || mw->isA("QMainWindow") ) - { - ( ( QMainWindow* ) mw )->setUsesBigPixmaps( useBigPixmaps ); - } + static void show_mx(QWidget* mw, bool nomaximize, QString &strName) { + if ( mw->inherits("QMainWindow") || mw->isA("QMainWindow") ) + { + ( ( QMainWindow* ) mw )->setUsesBigPixmaps( useBigPixmaps ); + } QPoint p; @@ -209,42 +208,43 @@ public: bool max; - if ( mw->isVisible() ) { - if ( read_widget_rect(strName, max, p, s) && validate_widget_size(mw, p, s) ) { - mw->resize(s); - mw->move(p); - } - mw->raise(); - } else { - if ( mw->layout() && mw->inherits("QDialog") ) { - if ( read_widget_rect(strName, max, p, s) && validate_widget_size(mw, p, s) ) { - mw->resize(s); - mw->move(p); + if ( mw->isVisible() ) { + if ( read_widget_rect(strName, max, p, s) && validate_widget_size(mw, p, s) ) { + mw->resize(s); + mw->move(p); + } + mw->raise(); + } else { - if ( max && !nomaximize ) { - mw->showMaximized(); - } else { - mw->show(); + if ( mw->layout() && mw->inherits("QDialog") ) { + if ( read_widget_rect(strName, max, p, s) && validate_widget_size(mw, p, s) ) { + mw->resize(s); + mw->move(p); + + if ( max && !nomaximize ) { + mw->showMaximized(); + } else { + mw->show(); + } + } else { + QPEApplication::showDialog((QDialog*)mw,nomaximize); } - } else { - QPEApplication::showDialog((QDialog*)mw,nomaximize); - } - } else { - if ( read_widget_rect(strName, max, p, s) && validate_widget_size(mw, p, s) ) { - mw->resize(s); - mw->move(p); - } else { //no stored rectangle, make an estimation - int x = (qApp->desktop()->width()-mw->frameGeometry().width())/2; - int y = (qApp->desktop()->height()-mw->frameGeometry().height())/2; - mw->move( QMAX(x,0), QMAX(y,0) ); + } else { + if ( read_widget_rect(strName, max, p, s) && validate_widget_size(mw, p, s) ) { + mw->resize(s); + mw->move(p); + } else { //no stored rectangle, make an estimation + int x = (qApp->desktop()->width()-mw->frameGeometry().width())/2; + int y = (qApp->desktop()->height()-mw->frameGeometry().height())/2; + mw->move( QMAX(x,0), QMAX(y,0) ); #ifdef Q_WS_QWS - if ( !nomaximize ) - mw->showMaximized(); + if ( !nomaximize ) + mw->showMaximized(); #endif + } + if ( max && !nomaximize ) + mw->showMaximized(); + else + mw->show(); + } } - if ( max && !nomaximize ) - mw->showMaximized(); - else - mw->show(); - } - } } diff --git a/library/qpeapplication.h b/library/qpeapplication.h index 579fc44..00d3d31 100644 --- a/library/qpeapplication.h +++ b/library/qpeapplication.h @@ -33,2 +33,3 @@ #include "timestring.h" +#include "qpeglobal.h" @@ -122,5 +123,6 @@ public: void showMainDocumentWidget( QWidget*, bool nomax=FALSE ); - static void showDialog( QDialog*, bool nomax=FALSE ); - static int execDialog( QDialog*, bool nomax=FALSE ); - static void showWidget( QWidget*, bool nomax=FALSE ); + + static void showDialog( QDialog*, bool nomax=FALSE ) QPE_WEAK_SYMBOL; + static int execDialog ( QDialog*, bool nomax=FALSE ) QPE_WEAK_SYMBOL; + static void showWidget( QWidget*, bool nomax=FALSE ) QPE_WEAK_SYMBOL; /* Merge setTempScreenSaverMode */ @@ -185,46 +187,3 @@ private: -inline void QPEApplication::showDialog( QDialog* d, bool nomax ) -{ - showWidget( d, nomax ); -} -inline int QPEApplication::execDialog( QDialog* d, bool nomax ) -{ - showDialog( d, nomax ); - return d->exec(); -} - -#ifdef Q_WS_QWS -extern Q_EXPORT QRect qt_maxWindowRect; -#endif - -inline void QPEApplication::showWidget( QWidget* wg, bool nomax ) -{ - if ( wg->isVisible() ) - wg->show(); - else - { - if ( !nomax - && ( qApp->desktop()->width() <= 320 ) ) - { - wg->showMaximized(); - } else { - #ifdef Q_WS_QWS - QSize desk = QSize( qApp->desktop()->width(), qApp->desktop()->height() ); - #else - QSize desk = QSize( qt_maxWindowRect.width(), qt_maxWindowRect.height() ); - #endif - - QSize sh = wg->sizeHint(); - int w = QMAX( sh.width(), wg->width() ); - int h = QMAX( sh.height(), wg->height() ); - // desktop widget-frame taskbar - w = QMIN( w, ( desk.width() - ( wg->frameGeometry().width() - wg->geometry().width() ) - 25 ) ); - h = QMIN( h, ( desk.height() - ( wg->frameGeometry().height() - wg->geometry().height() ) - 25 ) ); - - wg->resize( w, h ); - wg->show(); - } - } -} @@ -264,2 +223,9 @@ inline void QPEApplication::setCurrentRotation( int r ) +/* + * -remove me + */ +#ifdef Q_WS_QWS +extern Q_EXPORT QRect qt_maxWindowRect; +#endif + #endif diff --git a/library/qpedecoration_qws.cpp b/library/qpedecoration_qws.cpp index 8b02de6..fa38180 100644 --- a/library/qpedecoration_qws.cpp +++ b/library/qpedecoration_qws.cpp @@ -112,3 +112,4 @@ static QImage scaleButton( const QImage &img, int height ) { - if ( img.height() != 0 && img.height() != height ) { + //ML: We don't want to scale if the difference is less than 4 pixels to prevent blurring + if ( img.height() != 0 && ::abs( img.height()-height ) > 4 ) { return img.smoothScale( img.width()*height/img.height(), height ); diff --git a/library/qpeglobal.h b/library/qpeglobal.h index 96ce3a6..a84e435 100644 --- a/library/qpeglobal.h +++ b/library/qpeglobal.h @@ -1,4 +1,8 @@ /* - =. This file is part of the OPIE Project - .=l. Copyright (c) 2002,2003,2004 Holger Hans Peter Freyther <freyther@handhelds.org> + This file is part of the OPIE Project + Copyright (c) 2002,2003,2004 Holger Hans Peter Freyther <freyther@handhelds.org> + Copyright (c) 2002,2003,2004 Stefan Eilers <eilers@handhelds.org> + + =. + .=l. .>+-= @@ -28,4 +32,4 @@ -#ifndef QPE_GLOBAL_H -#define QPE_GLOBAL_H +#ifndef QPE_GLOBAL_DEFINES_H +#define QPE_GLOBAL_DEFINES_H @@ -35,2 +39,9 @@ */ + +/* + * commons + */ +#define QPE_DEPRECATED + + #if defined(Q_OS_MACX) @@ -39,2 +50,3 @@ #define QPE_SYMBOL_UNUSED +#define QPE_EXPORT_SYMBOL @@ -44,2 +56,22 @@ #define QPE_SYMBOL_UNUSED __attribute__((unused)) +#define QPE_EXPORT_SYMBOL + + +/* + * mark method as deprecated + */ +#if __GNUC__ - 0 > 3 || (__GNUC__ - 0 == 3 && __GNUC_MINOR__ - 0 >= 2) + /* gcc >= 3.2 */ +#undef QPE_DEPRECATED +#define QPE_DEPRECATED __attribute__((deprecated)) +#endif + +/* + * Defined if Compiler supports attributes + */ +#ifdef GCC_SUPPORTS_VISIBILITY +#undef QPE_EXPORT_SYMBOL +#define QPE_EXPORT_SYMBOL __attribute__((visibility("default"))) +#endif + @@ -50,2 +82,3 @@ #define QPE_SYMBOL_UNUSED +#define QPE_EXPORT_SYMBOL #endif diff --git a/library/qpemenubar.h b/library/qpemenubar.h index 66d0c85..64bf39c 100644 --- a/library/qpemenubar.h +++ b/library/qpemenubar.h @@ -27,2 +27,4 @@ +#include <qtopia/qpeglobal.h> + class QPEMenuToolFocusManager : public QObject @@ -61,3 +63,3 @@ private: // Sharp ROM compatibility -class QPEMenuBar : public QMenuBar +class QPE_DEPRECATED QPEMenuBar : public QMenuBar { diff --git a/library/qpetoolbar.h b/library/qpetoolbar.h index 53d21c0..c894ec9 100644 --- a/library/qpetoolbar.h +++ b/library/qpetoolbar.h @@ -24,2 +24,3 @@ #include <qtoolbar.h> +#include <qtopia/qpeglobal.h> @@ -27,3 +28,3 @@ class QMainWindow; -class QPEToolBar : public QToolBar +class QPE_DEPRECATED QPEToolBar : public QToolBar { diff --git a/library/widget_showing.cpp b/library/widget_showing.cpp new file mode 100644 index 0000000..43ece64 --- a/dev/null +++ b/library/widget_showing.cpp @@ -0,0 +1,74 @@ +/* + This file is part of the OPIE Project + Copyright (c) 2004 Andreas Richter <ar@handhelds.org> + Copyright (c) 2004 Holger Hans Peter Freyther <freyther@handhelds.org> + =. + .=l. + .>+-= + _;:, .> :=|. This library is free software; you can +.> <`_, > . <= redistribute it and/or modify it under +:`=1 )Y*s>-.-- : the terms of the GNU Library General Public +.="- .-=="i, .._ License as published by the Free Software + - . .-<_> .<> Foundation; either version 2 of the License, + ._= =} : or (at your option) any later version. + .%`+i> _;_. + .i_,=:_. -<s. This library is distributed in the hope that + + . -:. = it will be useful, but WITHOUT ANY WARRANTY; + : .. .:, . . . without even the implied warranty of + =_ + =;=|` 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 <qtopia/qpeapplication.h> + +#ifdef Q_WS_QWS +extern Q_EXPORT QRect qt_maxWindowRect; +#endif + +void QPEApplication::showDialog( QDialog* d, bool nomax ) +{ + showWidget( d, nomax ); +} + +int QPEApplication::execDialog( QDialog* d, bool nomax ) +{ + showDialog( d, nomax ); + return d->exec(); +} + +void QPEApplication::showWidget( QWidget* wg, bool nomax ) { + if ( wg->isVisible() ) { + wg->show(); + return; + } + + if ( !nomax + && ( qApp->desktop()->width() <= 320 ) ){ + wg->showMaximized(); + } else { +#ifdef Q_WS_QWS + QSize desk = QSize( qApp->desktop()->width(), qApp->desktop()->height() ); +#else + QSize desk = QSize( qt_maxWindowRect.width(), qt_maxWindowRect.height() ); +#endif + + QSize sh = wg->sizeHint(); + int w = QMAX( sh.width(), wg->width() ); + int h = QMAX( sh.height(), wg->height() ); +// desktop widget-frame taskbar + w = QMIN( w, ( desk.width() - ( wg->frameGeometry().width() - wg->geometry().width() ) - 25 ) ); + h = QMIN( h, ( desk.height() - ( wg->frameGeometry().height() - wg->geometry().height() ) - 25 ) ); + wg->resize( w, h ); + wg->show(); + } +} |