summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--library/fileselector.h5
-rw-r--r--library/library.pro3
-rw-r--r--library/qcom.h3
-rw-r--r--library/qpeapplication.cpp80
-rw-r--r--library/qpeapplication.h58
-rw-r--r--library/qpedecoration_qws.cpp3
-rw-r--r--library/qpeglobal.h41
-rw-r--r--library/qpemenubar.h4
-rw-r--r--library/qpetoolbar.h3
-rw-r--r--library/widget_showing.cpp74
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
@@ -26,4 +26,5 @@
26#include <qlistview.h> 26#include <qlistview.h>
27 27
28#include "qpeglobal.h"
28#include "filemanager.h" 29#include "filemanager.h"
29#include "applnk.h" 30#include "applnk.h"
@@ -54,5 +55,5 @@ public:
54 ~FileSelector(); 55 ~FileSelector();
55 void setNewVisible( bool b ); 56 void setNewVisible( bool b );
56 void setCloseVisible( bool b ); 57 void setCloseVisible( bool b ) QPE_DEPRECATED;
57 void setTypeComboVisible( bool b = TRUE ); 58 void setTypeComboVisible( bool b = TRUE );
58 void setCategorySelectVisible( bool b = TRUE ); 59 void setCategorySelectVisible( bool b = TRUE );
@@ -106,5 +107,5 @@ private:
106private: 107private:
107 // RESOLVE please -zecke@handhelds.org 108 // RESOLVE please -zecke@handhelds.org
108 const DocLnk *selected(); // use selectedDocument() luckily no compiler is putting the access into the symbol name 109 const DocLnk *selected() QPE_DEPRECATED; // use selectedDocument() luckily no compiler is putting the access into the symbol name
109 FileSelectorView *view; 110 FileSelectorView *view;
110 QString filter; 111 QString filter;
diff --git a/library/library.pro b/library/library.pro
index cdc1dab..45e69bc 100644
--- a/library/library.pro
+++ b/library/library.pro
@@ -118,5 +118,6 @@ SOURCES = calendar.cpp \
118 finddialog.cpp \ 118 finddialog.cpp \
119 lnkproperties.cpp \ 119 lnkproperties.cpp \
120 qt_override.cpp 120 qt_override.cpp \
121 widget_showing.cpp
121 122
122 123
diff --git a/library/qcom.h b/library/qcom.h
index 9972d8f..5703800 100644
--- a/library/qcom.h
+++ b/library/qcom.h
@@ -27,4 +27,5 @@
27 27
28#include <qpe/quuid.h> 28#include <qpe/quuid.h>
29#include <qpe/qpeglobal.h>
29 30
30#define QRESULT unsigned long 31#define QRESULT unsigned long
@@ -152,5 +153,5 @@ struct Q_EXPORT QtULong
152 153
153#define Q_EXPORT_INTERFACE() \ 154#define Q_EXPORT_INTERFACE() \
154 extern "C" QUnknownInterface* ucm_instantiate() 155 extern "C" QUnknownInterface* ucm_instantiate QPE_EXPORT_SYMBOL ()
155 156
156#define Q_REFCOUNT \ 157#define Q_REFCOUNT \
diff --git a/library/qpeapplication.cpp b/library/qpeapplication.cpp
index 4adfc8f..43a9be5 100644
--- a/library/qpeapplication.cpp
+++ b/library/qpeapplication.cpp
@@ -199,53 +199,53 @@ public:
199 } 199 }
200 200
201 static void show_mx(QWidget* mw, bool nomaximize, QString &strName) 201 static void show_mx(QWidget* mw, bool nomaximize, QString &strName) {
202 { 202 if ( mw->inherits("QMainWindow") || mw->isA("QMainWindow") )
203 if ( mw->inherits("QMainWindow") || mw->isA("QMainWindow") ) 203 {
204 { 204 ( ( QMainWindow* ) mw )->setUsesBigPixmaps( useBigPixmaps );
205 ( ( QMainWindow* ) mw )->setUsesBigPixmaps( useBigPixmaps ); 205 }
206 }
207 QPoint p; 206 QPoint p;
208 QSize s; 207 QSize s;
209 bool max; 208 bool max;
210 if ( mw->isVisible() ) {
211 if ( read_widget_rect(strName, max, p, s) && validate_widget_size(mw, p, s) ) {
212 mw->resize(s);
213 mw->move(p);
214 }
215 mw->raise();
216 } else {
217 209
218 if ( mw->layout() && mw->inherits("QDialog") ) { 210 if ( mw->isVisible() ) {
219 if ( read_widget_rect(strName, max, p, s) && validate_widget_size(mw, p, s) ) { 211 if ( read_widget_rect(strName, max, p, s) && validate_widget_size(mw, p, s) ) {
220 mw->resize(s); 212 mw->resize(s);
221 mw->move(p); 213 mw->move(p);
214 }
215 mw->raise();
216 } else {
222 217
223 if ( max && !nomaximize ) { 218 if ( mw->layout() && mw->inherits("QDialog") ) {
224 mw->showMaximized(); 219 if ( read_widget_rect(strName, max, p, s) && validate_widget_size(mw, p, s) ) {
225 } else { 220 mw->resize(s);
226 mw->show(); 221 mw->move(p);
222
223 if ( max && !nomaximize ) {
224 mw->showMaximized();
225 } else {
226 mw->show();
227 }
228 } else {
229 QPEApplication::showDialog((QDialog*)mw,nomaximize);
227 } 230 }
228 } else { 231 } else {
229 QPEApplication::showDialog((QDialog*)mw,nomaximize); 232 if ( read_widget_rect(strName, max, p, s) && validate_widget_size(mw, p, s) ) {
230 } 233 mw->resize(s);
231 } else { 234 mw->move(p);
232 if ( read_widget_rect(strName, max, p, s) && validate_widget_size(mw, p, s) ) { 235 } else { //no stored rectangle, make an estimation
233 mw->resize(s); 236 int x = (qApp->desktop()->width()-mw->frameGeometry().width())/2;
234 mw->move(p); 237 int y = (qApp->desktop()->height()-mw->frameGeometry().height())/2;
235 } else { //no stored rectangle, make an estimation 238 mw->move( QMAX(x,0), QMAX(y,0) );
236 int x = (qApp->desktop()->width()-mw->frameGeometry().width())/2;
237 int y = (qApp->desktop()->height()-mw->frameGeometry().height())/2;
238 mw->move( QMAX(x,0), QMAX(y,0) );
239#ifdef Q_WS_QWS 239#ifdef Q_WS_QWS
240 if ( !nomaximize ) 240 if ( !nomaximize )
241 mw->showMaximized(); 241 mw->showMaximized();
242#endif 242#endif
243 }
244 if ( max && !nomaximize )
245 mw->showMaximized();
246 else
247 mw->show();
248 }
243 } 249 }
244 if ( max && !nomaximize )
245 mw->showMaximized();
246 else
247 mw->show();
248 }
249 }
250 } 250 }
251 251
diff --git a/library/qpeapplication.h b/library/qpeapplication.h
index 579fc44..00d3d31 100644
--- a/library/qpeapplication.h
+++ b/library/qpeapplication.h
@@ -32,4 +32,5 @@
32#include "qpedecoration_qws.h" 32#include "qpedecoration_qws.h"
33#include "timestring.h" 33#include "timestring.h"
34#include "qpeglobal.h"
34 35
35class QCopChannel; 36class QCopChannel;
@@ -121,7 +122,8 @@ public:
121 void showMainWidget( QWidget*, bool nomax=FALSE ); 122 void showMainWidget( QWidget*, bool nomax=FALSE );
122 void showMainDocumentWidget( QWidget*, bool nomax=FALSE ); 123 void showMainDocumentWidget( QWidget*, bool nomax=FALSE );
123 static void showDialog( QDialog*, bool nomax=FALSE ); 124
124 static int execDialog( QDialog*, bool nomax=FALSE ); 125 static void showDialog( QDialog*, bool nomax=FALSE ) QPE_WEAK_SYMBOL;
125 static void showWidget( QWidget*, bool nomax=FALSE ); 126 static int execDialog ( QDialog*, bool nomax=FALSE ) QPE_WEAK_SYMBOL;
127 static void showWidget( QWidget*, bool nomax=FALSE ) QPE_WEAK_SYMBOL;
126 /* Merge setTempScreenSaverMode */ 128 /* Merge setTempScreenSaverMode */
127#ifdef QTOPIA_INTERNAL_INITAPP 129#ifdef QTOPIA_INTERNAL_INITAPP
@@ -184,48 +186,5 @@ private:
184}; 186};
185 187
186inline void QPEApplication::showDialog( QDialog* d, bool nomax )
187{
188 showWidget( d, nomax );
189}
190 188
191inline int QPEApplication::execDialog( QDialog* d, bool nomax )
192{
193 showDialog( d, nomax );
194 return d->exec();
195}
196
197#ifdef Q_WS_QWS
198extern Q_EXPORT QRect qt_maxWindowRect;
199#endif
200
201inline void QPEApplication::showWidget( QWidget* wg, bool nomax )
202{
203 if ( wg->isVisible() )
204 wg->show();
205 else
206 {
207 if ( !nomax
208 && ( qApp->desktop()->width() <= 320 ) )
209 {
210 wg->showMaximized();
211 } else {
212 #ifdef Q_WS_QWS
213 QSize desk = QSize( qApp->desktop()->width(), qApp->desktop()->height() );
214 #else
215 QSize desk = QSize( qt_maxWindowRect.width(), qt_maxWindowRect.height() );
216 #endif
217
218 QSize sh = wg->sizeHint();
219 int w = QMAX( sh.width(), wg->width() );
220 int h = QMAX( sh.height(), wg->height() );
221 // desktop widget-frame taskbar
222 w = QMIN( w, ( desk.width() - ( wg->frameGeometry().width() - wg->geometry().width() ) - 25 ) );
223 h = QMIN( h, ( desk.height() - ( wg->frameGeometry().height() - wg->geometry().height() ) - 25 ) );
224
225 wg->resize( w, h );
226 wg->show();
227 }
228 }
229}
230 189
231enum Transformation { Rot0, Rot90, Rot180, Rot270 }; /* from qgfxtransformed_qws.cpp */ 190enum Transformation { Rot0, Rot90, Rot180, Rot270 }; /* from qgfxtransformed_qws.cpp */
@@ -263,3 +222,10 @@ inline void QPEApplication::setCurrentRotation( int r )
263 222
264 223
224/*
225 * -remove me
226 */
227#ifdef Q_WS_QWS
228extern Q_EXPORT QRect qt_maxWindowRect;
229#endif
230
265#endif 231#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
@@ -111,5 +111,6 @@ public:
111static QImage scaleButton( const QImage &img, int height ) 111static QImage scaleButton( const QImage &img, int height )
112{ 112{
113 if ( img.height() != 0 && img.height() != height ) { 113 //ML: We don't want to scale if the difference is less than 4 pixels to prevent blurring
114 if ( img.height() != 0 && ::abs( img.height()-height ) > 4 ) {
114 return img.smoothScale( img.width()*height/img.height(), height ); 115 return img.smoothScale( img.width()*height/img.height(), height );
115 } else { 116 } else {
diff --git a/library/qpeglobal.h b/library/qpeglobal.h
index 96ce3a6..a84e435 100644
--- a/library/qpeglobal.h
+++ b/library/qpeglobal.h
@@ -1,5 +1,9 @@
1/* 1/*
2               =. This file is part of the OPIE Project 2 This file is part of the OPIE Project
3             .=l. Copyright (c) 2002,2003,2004 Holger Hans Peter Freyther <freyther@handhelds.org> 3 Copyright (c) 2002,2003,2004 Holger Hans Peter Freyther <freyther@handhelds.org>
4 Copyright (c) 2002,2003,2004 Stefan Eilers <eilers@handhelds.org>
5
6               =.
7             .=l.
4           .>+-= 8           .>+-=
5 _;:,     .>    :=|. This library is free software; you can 9 _;:,     .>    :=|. This library is free software; you can
@@ -27,6 +31,6 @@
27*/ 31*/
28 32
29#ifndef QPE_GLOBAL_H 33#ifndef QPE_GLOBAL_DEFINES_H
30#define QPE_GLOBAL_H 34#define QPE_GLOBAL_DEFINES_H
31 35
32/** 36/**
@@ -34,8 +38,16 @@
34 * 38 *
35 */ 39 */
40
41/*
42 * commons
43 */
44#define QPE_DEPRECATED
45
46
36#if defined(Q_OS_MACX) 47#if defined(Q_OS_MACX)
37#define QPE_WEAK_SYMBOL __attribute__((weak_import)) 48#define QPE_WEAK_SYMBOL __attribute__((weak_import))
38#define QPE_SYMBOL_USED 49#define QPE_SYMBOL_USED
39#define QPE_SYMBOL_UNUSED 50#define QPE_SYMBOL_UNUSED
51#define QPE_EXPORT_SYMBOL
40 52
41#elif defined(_OS_UNIX_) 53#elif defined(_OS_UNIX_)
@@ -43,4 +55,24 @@
43#define QPE_SYMBOL_USED __attribute__((used)) 55#define QPE_SYMBOL_USED __attribute__((used))
44#define QPE_SYMBOL_UNUSED __attribute__((unused)) 56#define QPE_SYMBOL_UNUSED __attribute__((unused))
57#define QPE_EXPORT_SYMBOL
58
59
60/*
61 * mark method as deprecated
62 */
63#if __GNUC__ - 0 > 3 || (__GNUC__ - 0 == 3 && __GNUC_MINOR__ - 0 >= 2)
64 /* gcc >= 3.2 */
65#undef QPE_DEPRECATED
66#define QPE_DEPRECATED __attribute__((deprecated))
67#endif
68
69/*
70 * Defined if Compiler supports attributes
71 */
72#ifdef GCC_SUPPORTS_VISIBILITY
73#undef QPE_EXPORT_SYMBOL
74#define QPE_EXPORT_SYMBOL __attribute__((visibility("default")))
75#endif
76
45 77
46 78
@@ -49,4 +81,5 @@
49#define QPE_SYMBOL_USED 81#define QPE_SYMBOL_USED
50#define QPE_SYMBOL_UNUSED 82#define QPE_SYMBOL_UNUSED
83#define QPE_EXPORT_SYMBOL
51#endif 84#endif
52 85
diff --git a/library/qpemenubar.h b/library/qpemenubar.h
index 66d0c85..64bf39c 100644
--- a/library/qpemenubar.h
+++ b/library/qpemenubar.h
@@ -26,4 +26,6 @@
26#include <qvaluelist.h> 26#include <qvaluelist.h>
27 27
28#include <qtopia/qpeglobal.h>
29
28class QPEMenuToolFocusManager : public QObject 30class QPEMenuToolFocusManager : public QObject
29{ 31{
@@ -60,5 +62,5 @@ private: // Sharp ROM compatibility
60 62
61 63
62class QPEMenuBar : public QMenuBar 64class QPE_DEPRECATED QPEMenuBar : public QMenuBar
63{ 65{
64 Q_OBJECT 66 Q_OBJECT
diff --git a/library/qpetoolbar.h b/library/qpetoolbar.h
index 53d21c0..c894ec9 100644
--- a/library/qpetoolbar.h
+++ b/library/qpetoolbar.h
@@ -23,8 +23,9 @@
23 23
24#include <qtoolbar.h> 24#include <qtoolbar.h>
25#include <qtopia/qpeglobal.h>
25 26
26class QMainWindow; 27class QMainWindow;
27 28
28class QPEToolBar : public QToolBar 29class QPE_DEPRECATED QPEToolBar : public QToolBar
29{ 30{
30 Q_OBJECT 31 Q_OBJECT
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 @@
1/*
2 This file is part of the OPIE Project
3 Copyright (c) 2004 Andreas Richter <ar@handhelds.org>
4 Copyright (c) 2004 Holger Hans Peter Freyther <freyther@handhelds.org>
5               =.
6             .=l.
7           .>+-=
8 _;:,     .>    :=|. This library is free software; you can
9.> <`_,   >  .   <= redistribute it and/or modify it under
10:`=1 )Y*s>-.--   : the terms of the GNU Library General Public
11.="- .-=="i,     .._ License as published by the Free Software
12 - .   .-<_>     .<> Foundation; either version 2 of the License,
13     ._= =}       : or (at your option) any later version.
14    .%`+i>       _;_.
15    .i_,=:_.      -<s. This library is distributed in the hope that
16     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
17    : ..    .:,     . . . without even the implied warranty of
18    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
19  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
20..}^=.=       =       ; Library General Public License for more
21++=   -.     .`     .: details.
22 :     =  ...= . :.=-
23 -.   .:....=;==+<; You should have received a copy of the GNU
24  -_. . .   )=.  = Library General Public License along with
25    --        :-=` this library; see the file COPYING.LIB.
26 If not, write to the Free Software Foundation,
27 Inc., 59 Temple Place - Suite 330,
28 Boston, MA 02111-1307, USA.
29
30*/
31
32#include <qtopia/qpeapplication.h>
33
34#ifdef Q_WS_QWS
35extern Q_EXPORT QRect qt_maxWindowRect;
36#endif
37
38void QPEApplication::showDialog( QDialog* d, bool nomax )
39{
40 showWidget( d, nomax );
41}
42
43int QPEApplication::execDialog( QDialog* d, bool nomax )
44{
45 showDialog( d, nomax );
46 return d->exec();
47}
48
49void QPEApplication::showWidget( QWidget* wg, bool nomax ) {
50 if ( wg->isVisible() ) {
51 wg->show();
52 return;
53 }
54
55 if ( !nomax
56 && ( qApp->desktop()->width() <= 320 ) ){
57 wg->showMaximized();
58 } else {
59#ifdef Q_WS_QWS
60 QSize desk = QSize( qApp->desktop()->width(), qApp->desktop()->height() );
61#else
62 QSize desk = QSize( qt_maxWindowRect.width(), qt_maxWindowRect.height() );
63#endif
64
65 QSize sh = wg->sizeHint();
66 int w = QMAX( sh.width(), wg->width() );
67 int h = QMAX( sh.height(), wg->height() );
68// desktop widget-frame taskbar
69 w = QMIN( w, ( desk.width() - ( wg->frameGeometry().width() - wg->geometry().width() ) - 25 ) );
70 h = QMIN( h, ( desk.height() - ( wg->frameGeometry().height() - wg->geometry().height() ) - 25 ) );
71 wg->resize( w, h );
72 wg->show();
73 }
74}