summaryrefslogtreecommitdiff
path: root/library/qpeapplication.h
Unidiff
Diffstat (limited to 'library/qpeapplication.h') (more/less context) (ignore whitespace changes)
-rw-r--r--library/qpeapplication.h58
1 files changed, 12 insertions, 46 deletions
diff --git a/library/qpeapplication.h b/library/qpeapplication.h
index 579fc44..00d3d31 100644
--- a/library/qpeapplication.h
+++ b/library/qpeapplication.h
@@ -28,12 +28,13 @@
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
35class QCopChannel; 36class QCopChannel;
36class QPEApplicationData; 37class QPEApplicationData;
37class QWSEvent; 38class QWSEvent;
38class QWSKeyEvent; 39class QWSKeyEvent;
39 40
@@ -117,15 +118,16 @@ public:
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();
@@ -180,56 +182,13 @@ private:
180 QPEApplicationData *d; 182 QPEApplicationData *d;
181 183
182 bool reserved_sh; 184 bool reserved_sh;
183 185
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 */
232 191
233inline int TransToDeg ( Transformation t ) 192inline int TransToDeg ( Transformation t )
234{ 193{
235 int d = static_cast<int>( t ); 194 int d = static_cast<int>( t );
@@ -259,7 +218,14 @@ inline void QPEApplication::setCurrentRotation( int r )
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
228extern Q_EXPORT QRect qt_maxWindowRect;
229#endif
230
265#endif 231#endif