-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 | 4 | ||||
-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, 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 | |||
@@ -20,16 +20,17 @@ | |||
20 | #ifndef FILESELECTOR_H | 20 | #ifndef FILESELECTOR_H |
21 | #define FILESELECTOR_H | 21 | #define FILESELECTOR_H |
22 | 22 | ||
23 | #include <qhbox.h> | 23 | #include <qhbox.h> |
24 | #include <qvbox.h> | 24 | #include <qvbox.h> |
25 | #include <qtoolbutton.h> | 25 | #include <qtoolbutton.h> |
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" |
30 | 31 | ||
31 | class QPopupMenu; | 32 | class QPopupMenu; |
32 | class QPushButton; | 33 | class QPushButton; |
33 | class FileSelectorView; | 34 | class FileSelectorView; |
34 | 35 | ||
35 | class FileSelectorItem : public QListViewItem | 36 | class FileSelectorItem : public QListViewItem |
@@ -48,17 +49,17 @@ class FileSelectorPrivate; | |||
48 | class FileSelector : public QVBox | 49 | class FileSelector : public QVBox |
49 | { | 50 | { |
50 | Q_OBJECT | 51 | Q_OBJECT |
51 | 52 | ||
52 | public: | 53 | public: |
53 | FileSelector( const QString &mimefilter, QWidget *parent, const char *name=0, bool newVisible = TRUE, bool closeVisible = TRUE ); | 54 | FileSelector( const QString &mimefilter, QWidget *parent, const char *name=0, bool newVisible = TRUE, bool closeVisible = TRUE ); |
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 ); |
59 | void reread(); | 60 | void reread(); |
60 | int fileCount(); | 61 | int fileCount(); |
61 | DocLnk selectedDocument() const | 62 | DocLnk selectedDocument() const |
62 | { | 63 | { |
63 | const DocLnk* rp = ((FileSelector*)this)->selected(); | 64 | const DocLnk* rp = ((FileSelector*)this)->selected(); |
64 | if (!rp) { | 65 | if (!rp) { |
@@ -100,16 +101,16 @@ private slots: | |||
100 | void cardMessage( const QCString &, const QByteArray &); | 101 | void cardMessage( const QCString &, const QByteArray &); |
101 | 102 | ||
102 | private: | 103 | private: |
103 | void updateView(); | 104 | void updateView(); |
104 | void updateWhatsThis(); | 105 | void updateWhatsThis(); |
105 | 106 | ||
106 | private: | 107 | 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; |
110 | QString filter; | 111 | QString filter; |
111 | QToolButton *buttonNew, *buttonClose; | 112 | QToolButton *buttonNew, *buttonClose; |
112 | FileSelectorPrivate *d; | 113 | FileSelectorPrivate *d; |
113 | }; | 114 | }; |
114 | 115 | ||
115 | #endif | 116 | #endif |
diff --git a/library/library.pro b/library/library.pro index cdc1dab..45e69bc 100644 --- a/library/library.pro +++ b/library/library.pro | |||
@@ -112,17 +112,18 @@ SOURCES = calendar.cpp \ | |||
112 | categoryselect.cpp \ | 112 | categoryselect.cpp \ |
113 | categorywidget.cpp \ | 113 | categorywidget.cpp \ |
114 | ir.cpp \ | 114 | ir.cpp \ |
115 | backend/vcc_yacc.cpp \ | 115 | backend/vcc_yacc.cpp \ |
116 | backend/vobject.cpp \ | 116 | backend/vobject.cpp \ |
117 | findwidget_p.cpp \ | 117 | findwidget_p.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 | ||
123 | 124 | ||
124 | # Qt 3 compatibility | 125 | # Qt 3 compatibility |
125 | HEADERS += quuid.h qcom.h qlibrary.h qlibrary_p.h | 126 | HEADERS += quuid.h qcom.h qlibrary.h qlibrary_p.h |
126 | SOURCES += quuid.cpp qlibrary.cpp qlibrary_unix.cpp | 127 | SOURCES += quuid.cpp qlibrary.cpp qlibrary_unix.cpp |
127 | INCLUDEPATH += $(OPIEDIR)/include backend | 128 | INCLUDEPATH += $(OPIEDIR)/include backend |
128 | LIBS += -ldl -lcrypt -lm | 129 | LIBS += -ldl -lcrypt -lm |
diff --git a/library/qcom.h b/library/qcom.h index 9972d8f..5703800 100644 --- a/library/qcom.h +++ b/library/qcom.h | |||
@@ -21,16 +21,17 @@ | |||
21 | #ifndef QCOM_H | 21 | #ifndef QCOM_H |
22 | #define QCOM_H | 22 | #define QCOM_H |
23 | 23 | ||
24 | #include <qstringlist.h> | 24 | #include <qstringlist.h> |
25 | 25 | ||
26 | #ifndef QT_NO_COMPONENT | 26 | #ifndef QT_NO_COMPONENT |
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 |
31 | #define QS_OK (QRESULT)0x00000000 | 32 | #define QS_OK (QRESULT)0x00000000 |
32 | #define QS_FALSE (QRESULT)0x00000001 | 33 | #define QS_FALSE (QRESULT)0x00000001 |
33 | 34 | ||
34 | #define QE_NOTIMPL (QRESULT)0x80000001 | 35 | #define QE_NOTIMPL (QRESULT)0x80000001 |
35 | #define QE_OUTOFMEMORY (QRESULT)0x80000002 | 36 | #define QE_OUTOFMEMORY (QRESULT)0x80000002 |
36 | #define QE_INVALIDARG (QRESULT)0x80000003 | 37 | #define QE_INVALIDARG (QRESULT)0x80000003 |
@@ -146,17 +147,17 @@ struct Q_EXPORT QtULong | |||
146 | unsigned long operator++( int ) { return ref++; } | 147 | unsigned long operator++( int ) { return ref++; } |
147 | unsigned long& operator--() { return --ref; } | 148 | unsigned long& operator--() { return --ref; } |
148 | unsigned long operator--( int ) { return ref--; } | 149 | unsigned long operator--( int ) { return ref--; } |
149 | 150 | ||
150 | unsigned long ref; | 151 | unsigned long ref; |
151 | }; | 152 | }; |
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 \ |
157 | private: \ | 158 | private: \ |
158 | QtULong qtrefcount; \ | 159 | QtULong qtrefcount; \ |
159 | public: \ | 160 | public: \ |
160 | ulong addRef() {return qtrefcount++;} \ | 161 | ulong addRef() {return qtrefcount++;} \ |
161 | ulong release() {if(!--qtrefcount){delete this;return 0;}return qtrefcount;} | 162 | ulong release() {if(!--qtrefcount){delete this;return 0;}return qtrefcount;} |
162 | 163 | ||
diff --git a/library/qpeapplication.cpp b/library/qpeapplication.cpp index 4adfc8f..43a9be5 100644 --- a/library/qpeapplication.cpp +++ b/library/qpeapplication.cpp | |||
@@ -193,25 +193,25 @@ public: | |||
193 | #ifndef QT_NO_COP | 193 | #ifndef QT_NO_COP |
194 | QCopChannel::sendLocally( r->channel, r->message, r->data ); | 194 | QCopChannel::sendLocally( r->channel, r->message, r->data ); |
195 | #endif | 195 | #endif |
196 | 196 | ||
197 | delete r; | 197 | delete r; |
198 | } | 198 | } |
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 | { | ||
203 | if ( mw->inherits("QMainWindow") || mw->isA("QMainWindow") ) | 202 | if ( mw->inherits("QMainWindow") || mw->isA("QMainWindow") ) |
204 | { | 203 | { |
205 | ( ( QMainWindow* ) mw )->setUsesBigPixmaps( useBigPixmaps ); | 204 | ( ( QMainWindow* ) mw )->setUsesBigPixmaps( useBigPixmaps ); |
206 | } | 205 | } |
207 | QPoint p; | 206 | QPoint p; |
208 | QSize s; | 207 | QSize s; |
209 | bool max; | 208 | bool max; |
209 | |||
210 | if ( mw->isVisible() ) { | 210 | if ( mw->isVisible() ) { |
211 | 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) ) { |
212 | mw->resize(s); | 212 | mw->resize(s); |
213 | mw->move(p); | 213 | mw->move(p); |
214 | } | 214 | } |
215 | mw->raise(); | 215 | mw->raise(); |
216 | } else { | 216 | } else { |
217 | 217 | ||
diff --git a/library/qpeapplication.h b/library/qpeapplication.h index 579fc44..00d3d31 100644 --- a/library/qpeapplication.h +++ b/library/qpeapplication.h | |||
@@ -26,16 +26,17 @@ | |||
26 | #include <qapplication.h> | 26 | #include <qapplication.h> |
27 | #include <qdialog.h> | 27 | #include <qdialog.h> |
28 | #include <qwsdisplay_qws.h> | 28 | #include <qwsdisplay_qws.h> |
29 | #if defined(_WS_QWS_) && !defined(Q_WS_QWS) | 29 | #if defined(_WS_QWS_) && !defined(Q_WS_QWS) |
30 | #define Q_WS_QWS | 30 | #define Q_WS_QWS |
31 | #endif | 31 | #endif |
32 | #include "qpedecoration_qws.h" | 32 | #include "qpedecoration_qws.h" |
33 | #include "timestring.h" | 33 | #include "timestring.h" |
34 | #include "qpeglobal.h" | ||
34 | 35 | ||
35 | class QCopChannel; | 36 | class QCopChannel; |
36 | class QPEApplicationData; | 37 | class QPEApplicationData; |
37 | class QWSEvent; | 38 | class QWSEvent; |
38 | class QWSKeyEvent; | 39 | class QWSKeyEvent; |
39 | 40 | ||
40 | /** | 41 | /** |
41 | \brief The QPEApplication class implements various system services | 42 | \brief The QPEApplication class implements various system services |
@@ -115,19 +116,20 @@ public: | |||
115 | Enable = 100 | 116 | Enable = 100 |
116 | }; | 117 | }; |
117 | 118 | ||
118 | static void setInputMethodHint( QWidget *, InputMethodHint ); | 119 | static void setInputMethodHint( QWidget *, InputMethodHint ); |
119 | static InputMethodHint inputMethodHint( QWidget * ); | 120 | static InputMethodHint inputMethodHint( QWidget * ); |
120 | 121 | ||
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 |
128 | void initApp( int argv, char **argv ); | 130 | void initApp( int argv, char **argv ); |
129 | #endif | 131 | #endif |
130 | 132 | ||
131 | static void setKeepRunning(); | 133 | static void setKeepRunning(); |
132 | bool keepRunning() const; | 134 | bool keepRunning() const; |
133 | 135 | ||
@@ -178,60 +180,17 @@ private: | |||
178 | QCopChannel *pidChannel; | 180 | QCopChannel *pidChannel; |
179 | #endif | 181 | #endif |
180 | QPEApplicationData *d; | 182 | QPEApplicationData *d; |
181 | 183 | ||
182 | bool reserved_sh; | 184 | bool reserved_sh; |
183 | 185 | ||
184 | }; | 186 | }; |
185 | 187 | ||
186 | inline void QPEApplication::showDialog( QDialog* d, bool nomax ) | ||
187 | { | ||
188 | showWidget( d, nomax ); | ||
189 | } | ||
190 | 188 | ||
191 | inline int QPEApplication::execDialog( QDialog* d, bool nomax ) | ||
192 | { | ||
193 | showDialog( d, nomax ); | ||
194 | return d->exec(); | ||
195 | } | ||
196 | |||
197 | #ifdef Q_WS_QWS | ||
198 | extern Q_EXPORT QRect qt_maxWindowRect; | ||
199 | #endif | ||
200 | |||
201 | inline 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 | ||
231 | enum Transformation { Rot0, Rot90, Rot180, Rot270 }; /* from qgfxtransformed_qws.cpp */ | 190 | enum Transformation { Rot0, Rot90, Rot180, Rot270 }; /* from qgfxtransformed_qws.cpp */ |
232 | 191 | ||
233 | inline int TransToDeg ( Transformation t ) | 192 | inline int TransToDeg ( Transformation t ) |
234 | { | 193 | { |
235 | int d = static_cast<int>( t ); | 194 | int d = static_cast<int>( t ); |
236 | return d * 90; | 195 | return d * 90; |
237 | } | 196 | } |
@@ -257,9 +216,16 @@ inline void QPEApplication::setCurrentRotation( int r ) | |||
257 | ::setenv( "QWS_DISPLAY", QString( "Transformed:Rot%1:0" ).arg( r ).latin1(), 1 ); | 216 | ::setenv( "QWS_DISPLAY", QString( "Transformed:Rot%1:0" ).arg( r ).latin1(), 1 ); |
258 | qApp->desktop()->qwsDisplay()->setTransformation( e ); | 217 | qApp->desktop()->qwsDisplay()->setTransformation( e ); |
259 | #else | 218 | #else |
260 | setDefaultRotation( r ); | 219 | setDefaultRotation( r ); |
261 | #endif | 220 | #endif |
262 | } | 221 | } |
263 | 222 | ||
264 | 223 | ||
224 | /* | ||
225 | * -remove me | ||
226 | */ | ||
227 | #ifdef Q_WS_QWS | ||
228 | extern 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 | |||
@@ -105,17 +105,18 @@ public: | |||
105 | return (getWState() & WState_Reserved1 ) || | 105 | return (getWState() & WState_Reserved1 ) || |
106 | (inherits("QDialog") && !inherits("QMessageBox") | 106 | (inherits("QDialog") && !inherits("QMessageBox") |
107 | && !inherits("QWizard") ); | 107 | && !inherits("QWizard") ); |
108 | } | 108 | } |
109 | }; | 109 | }; |
110 | 110 | ||
111 | static QImage scaleButton( const QImage &img, int height ) | 111 | 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 ); |
115 | } else { | 116 | } else { |
116 | return img; | 117 | return img; |
117 | } | 118 | } |
118 | } | 119 | } |
119 | 120 | ||
120 | class TLWidget : public QWidget | 121 | class TLWidget : public QWidget |
121 | { | 122 | { |
diff --git a/library/qpeglobal.h b/library/qpeglobal.h index 96ce3a6..a84e435 100644 --- a/library/qpeglobal.h +++ b/library/qpeglobal.h | |||
@@ -1,11 +1,15 @@ | |||
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 |
6 | .> <`_, > . <= redistribute it and/or modify it under | 10 | .> <`_, > . <= redistribute it and/or modify it under |
7 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | 11 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public |
8 | .="- .-=="i, .._ License as published by the Free Software | 12 | .="- .-=="i, .._ License as published by the Free Software |
9 | - . .-<_> .<> Foundation; either version 2 of the License, | 13 | - . .-<_> .<> Foundation; either version 2 of the License, |
10 | ._= =} : or (at your option) any later version. | 14 | ._= =} : or (at your option) any later version. |
11 | .%`+i> _;_. | 15 | .%`+i> _;_. |
@@ -21,35 +25,64 @@ | |||
21 | -_. . . )=. = Library General Public License along with | 25 | -_. . . )=. = Library General Public License along with |
22 | -- :-=` this library; see the file COPYING.LIB. | 26 | -- :-=` this library; see the file COPYING.LIB. |
23 | If not, write to the Free Software Foundation, | 27 | If not, write to the Free Software Foundation, |
24 | Inc., 59 Temple Place - Suite 330, | 28 | Inc., 59 Temple Place - Suite 330, |
25 | Boston, MA 02111-1307, USA. | 29 | Boston, MA 02111-1307, USA. |
26 | 30 | ||
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 | /** |
33 | * Defines for used compiler attributes | 37 | * Defines for used compiler attributes |
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_) |
42 | #define QPE_WEAK_SYMBOL __attribute__((weak)) | 54 | #define QPE_WEAK_SYMBOL __attribute__((weak)) |
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 | ||
47 | #else // defined(Q_OS_WIN32) | 79 | #else // defined(Q_OS_WIN32) |
48 | #define QPE_WEAK_SYMBOL | 80 | #define QPE_WEAK_SYMBOL |
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 | ||
53 | 86 | ||
54 | 87 | ||
55 | #endif | 88 | #endif |
diff --git a/library/qpemenubar.h b/library/qpemenubar.h index 66d0c85..64bf39c 100644 --- a/library/qpemenubar.h +++ b/library/qpemenubar.h | |||
@@ -20,16 +20,18 @@ | |||
20 | 20 | ||
21 | #ifndef QPEMENUBAR_H | 21 | #ifndef QPEMENUBAR_H |
22 | #define QPEMENUBAR_H | 22 | #define QPEMENUBAR_H |
23 | 23 | ||
24 | #include <qmenubar.h> | 24 | #include <qmenubar.h> |
25 | #include <qguardedptr.h> | 25 | #include <qguardedptr.h> |
26 | #include <qvaluelist.h> | 26 | #include <qvaluelist.h> |
27 | 27 | ||
28 | #include <qtopia/qpeglobal.h> | ||
29 | |||
28 | class QPEMenuToolFocusManager : public QObject | 30 | class QPEMenuToolFocusManager : public QObject |
29 | { | 31 | { |
30 | Q_OBJECT | 32 | Q_OBJECT |
31 | public: | 33 | public: |
32 | QPEMenuToolFocusManager(); | 34 | QPEMenuToolFocusManager(); |
33 | 35 | ||
34 | void addWidget( QWidget *w ); | 36 | void addWidget( QWidget *w ); |
35 | void removeWidget( QWidget *w ); | 37 | void removeWidget( QWidget *w ); |
@@ -54,17 +56,17 @@ private: | |||
54 | GuardedWidget oldFocus; | 56 | GuardedWidget oldFocus; |
55 | static QPEMenuToolFocusManager *me; | 57 | static QPEMenuToolFocusManager *me; |
56 | 58 | ||
57 | private: // Sharp ROM compatibility | 59 | private: // Sharp ROM compatibility |
58 | void setMenukeyEnabled ( bool b ); | 60 | void setMenukeyEnabled ( bool b ); |
59 | }; | 61 | }; |
60 | 62 | ||
61 | 63 | ||
62 | class QPEMenuBar : public QMenuBar | 64 | class QPE_DEPRECATED QPEMenuBar : public QMenuBar |
63 | { | 65 | { |
64 | Q_OBJECT | 66 | Q_OBJECT |
65 | public: | 67 | public: |
66 | QPEMenuBar( QWidget *parent=0, const char* name=0 ); | 68 | QPEMenuBar( QWidget *parent=0, const char* name=0 ); |
67 | ~QPEMenuBar(); | 69 | ~QPEMenuBar(); |
68 | 70 | ||
69 | protected: | 71 | protected: |
70 | virtual void keyPressEvent( QKeyEvent *e ); | 72 | virtual void keyPressEvent( QKeyEvent *e ); |
diff --git a/library/qpetoolbar.h b/library/qpetoolbar.h index 53d21c0..c894ec9 100644 --- a/library/qpetoolbar.h +++ b/library/qpetoolbar.h | |||
@@ -17,20 +17,21 @@ | |||
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | 20 | ||
21 | #ifndef QPETOOLBAR_H | 21 | #ifndef QPETOOLBAR_H |
22 | #define QPETOOLBAR_H | 22 | #define QPETOOLBAR_H |
23 | 23 | ||
24 | #include <qtoolbar.h> | 24 | #include <qtoolbar.h> |
25 | #include <qtopia/qpeglobal.h> | ||
25 | 26 | ||
26 | class QMainWindow; | 27 | class QMainWindow; |
27 | 28 | ||
28 | class QPEToolBar : public QToolBar | 29 | class QPE_DEPRECATED QPEToolBar : public QToolBar |
29 | { | 30 | { |
30 | Q_OBJECT | 31 | Q_OBJECT |
31 | public: | 32 | public: |
32 | QPEToolBar( QMainWindow *parent = 0, const char *name = 0 ); | 33 | QPEToolBar( QMainWindow *parent = 0, const char *name = 0 ); |
33 | 34 | ||
34 | protected: | 35 | protected: |
35 | virtual void childEvent( QChildEvent *e ); | 36 | virtual void childEvent( QChildEvent *e ); |
36 | }; | 37 | }; |
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 | ||
35 | extern Q_EXPORT QRect qt_maxWindowRect; | ||
36 | #endif | ||
37 | |||
38 | void QPEApplication::showDialog( QDialog* d, bool nomax ) | ||
39 | { | ||
40 | showWidget( d, nomax ); | ||
41 | } | ||
42 | |||
43 | int QPEApplication::execDialog( QDialog* d, bool nomax ) | ||
44 | { | ||
45 | showDialog( d, nomax ); | ||
46 | return d->exec(); | ||
47 | } | ||
48 | |||
49 | void 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 | } | ||