summaryrefslogtreecommitdiff
path: root/library
authorzecke <zecke>2004-12-20 22:11:44 (UTC)
committer zecke <zecke>2004-12-20 22:11:44 (UTC)
commita50334dddaa542fd63726a639e852c30036f53a0 (patch) (unidiff)
tree30d0a41308f752c72d2c685fab60e2bd7c650bec /library
parent29e93ce47f7a52ded8956811d50b93e754caa3a6 (diff)
downloadopie-a50334dddaa542fd63726a639e852c30036f53a0.zip
opie-a50334dddaa542fd63726a639e852c30036f53a0.tar.gz
opie-a50334dddaa542fd63726a639e852c30036f53a0.tar.bz2
Restore Files:
-QWSDecoration scaling fixes by mickeyl -Readd macros for DEPRECATED and VISIBILITY -Move out showWidget and execDialog to widget_sowing.cpp -QPE_EXPORT_SYMBOL for Q_EXPORT_INTERFACE -Deprecated for FileSelector, QPEMenubar and Toolbar
Diffstat (limited to 'library') (more/less context) (show 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.cpp4
-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, 139 insertions, 59 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 @@
27 27
28#include "qpeglobal.h"
28#include "filemanager.h" 29#include "filemanager.h"
@@ -55,3 +56,3 @@ public:
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 );
@@ -107,3 +108,3 @@ private:
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;
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 \
119 lnkproperties.cpp \ 119 lnkproperties.cpp \
120 qt_override.cpp 120 qt_override.cpp \
121 widget_showing.cpp
121 122
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 @@
28#include <qpe/quuid.h> 28#include <qpe/quuid.h>
29#include <qpe/qpeglobal.h>
29 30
@@ -153,3 +154,3 @@ struct Q_EXPORT QtULong
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
diff --git a/library/qpeapplication.cpp b/library/qpeapplication.cpp
index 4adfc8f..43a9be5 100644
--- a/library/qpeapplication.cpp
+++ b/library/qpeapplication.cpp
@@ -200,4 +200,3 @@ public:
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 {
203 if ( mw->inherits("QMainWindow") || mw->isA("QMainWindow") ) 202 if ( mw->inherits("QMainWindow") || mw->isA("QMainWindow") )
@@ -209,2 +208,3 @@ public:
209 bool max; 208 bool max;
209
210 if ( mw->isVisible() ) { 210 if ( mw->isVisible() ) {
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 @@
33#include "timestring.h" 33#include "timestring.h"
34#include "qpeglobal.h"
34 35
@@ -122,5 +123,6 @@ public:
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 */
@@ -185,46 +187,3 @@ private:
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
@@ -264,2 +223,9 @@ inline void QPEApplication::setCurrentRotation( int r )
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
@@ -112,3 +112,4 @@ static 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 );
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 @@
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           .>+-=
@@ -28,4 +32,4 @@
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
@@ -35,2 +39,9 @@
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)
@@ -39,2 +50,3 @@
39#define QPE_SYMBOL_UNUSED 50#define QPE_SYMBOL_UNUSED
51#define QPE_EXPORT_SYMBOL
40 52
@@ -44,2 +56,22 @@
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
@@ -50,2 +82,3 @@
50#define QPE_SYMBOL_UNUSED 82#define QPE_SYMBOL_UNUSED
83#define QPE_EXPORT_SYMBOL
51#endif 84#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 @@
27 27
28#include <qtopia/qpeglobal.h>
29
28class QPEMenuToolFocusManager : public QObject 30class QPEMenuToolFocusManager : public QObject
@@ -61,3 +63,3 @@ private: // Sharp ROM compatibility
61 63
62class QPEMenuBar : public QMenuBar 64class QPE_DEPRECATED QPEMenuBar : public QMenuBar
63{ 65{
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 @@
24#include <qtoolbar.h> 24#include <qtoolbar.h>
25#include <qtopia/qpeglobal.h>
25 26
@@ -27,3 +28,3 @@ class QMainWindow;
27 28
28class QPEToolBar : public QToolBar 29class QPE_DEPRECATED QPEToolBar : public QToolBar
29{ 30{
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}