author | zecke <zecke> | 2003-10-04 07:23:27 (UTC) |
---|---|---|
committer | zecke <zecke> | 2003-10-04 07:23:27 (UTC) |
commit | 271ba635536db4a9f4ae1e575194d0f388b1c991 (patch) (unidiff) | |
tree | dbd2664b1a6422c6195a3b4eb17b591ff82a4499 /library/qpeapplication.cpp | |
parent | a4793f5226e9eb5c8a718cca9335c23530e08b08 (diff) | |
download | opie-271ba635536db4a9f4ae1e575194d0f388b1c991.zip opie-271ba635536db4a9f4ae1e575194d0f388b1c991.tar.gz opie-271ba635536db4a9f4ae1e575194d0f388b1c991.tar.bz2 |
merges of qcopQok
and QPIxmapCache 'calibration' for PDA needs
-rw-r--r-- | library/qpeapplication.cpp | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/library/qpeapplication.cpp b/library/qpeapplication.cpp index 0e469ae..28fb13a 100644 --- a/library/qpeapplication.cpp +++ b/library/qpeapplication.cpp | |||
@@ -50,8 +50,9 @@ | |||
50 | #include <qtooltip.h> | 50 | #include <qtooltip.h> |
51 | #include <qsignal.h> | 51 | #include <qsignal.h> |
52 | #include <qmainwindow.h> | 52 | #include <qmainwindow.h> |
53 | #include <qwidgetlist.h> | 53 | #include <qwidgetlist.h> |
54 | #include <qpixmapcache.h> | ||
54 | 55 | ||
55 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) | 56 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) |
56 | #define QTOPIA_INTERNAL_INITAPP | 57 | #define QTOPIA_INTERNAL_INITAPP |
57 | #include "qpeapplication.h" | 58 | #include "qpeapplication.h" |
@@ -98,9 +99,9 @@ class QPEApplicationData | |||
98 | public: | 99 | public: |
99 | QPEApplicationData ( ) | 100 | QPEApplicationData ( ) |
100 | : presstimer( 0 ), presswidget( 0 ), rightpressed( false ), kbgrabbed( false ), | 101 | : presstimer( 0 ), presswidget( 0 ), rightpressed( false ), kbgrabbed( false ), |
101 | notbusysent( false ), preloaded( false ), forceshow( false ), nomaximize( false ), | 102 | notbusysent( false ), preloaded( false ), forceshow( false ), nomaximize( false ), |
102 | keep_running( true ), qpe_main_widget( 0 ), qcopQok( false ) | 103 | keep_running( true ), qcopQok( false ), qpe_main_widget( 0 ) |
103 | 104 | ||
104 | {} | 105 | {} |
105 | 106 | ||
106 | int presstimer; | 107 | int presstimer; |
@@ -112,10 +113,10 @@ public: | |||
112 | bool notbusysent : 1; | 113 | bool notbusysent : 1; |
113 | bool preloaded : 1; | 114 | bool preloaded : 1; |
114 | bool forceshow : 1; | 115 | bool forceshow : 1; |
115 | bool nomaximize : 1; | 116 | bool nomaximize : 1; |
116 | bool qcopQok : 1; | ||
117 | bool keep_running : 1; | 117 | bool keep_running : 1; |
118 | bool qcopQok : 1; | ||
118 | 119 | ||
119 | 120 | ||
120 | QStringList langs; | 121 | QStringList langs; |
121 | QString appName; | 122 | QString appName; |
@@ -213,8 +214,9 @@ public: | |||
213 | { | 214 | { |
214 | setWidgetCaptionFromAppName( mw, appName, QPEApplication::qpeDir() + "apps" ); | 215 | setWidgetCaptionFromAppName( mw, appName, QPEApplication::qpeDir() + "apps" ); |
215 | nomaximize = nomax; | 216 | nomaximize = nomax; |
216 | qpe_main_widget = mw; | 217 | qpe_main_widget = mw; |
218 | qcopQok = TRUE; | ||
217 | #ifndef QT_NO_COP | 219 | #ifndef QT_NO_COP |
218 | 220 | ||
219 | sendQCopQ(); | 221 | sendQCopQ(); |
220 | #endif | 222 | #endif |
@@ -575,8 +577,10 @@ void QPEApplication::processQCopFile() | |||
575 | */ | 577 | */ |
576 | QPEApplication::QPEApplication( int & argc, char **argv, Type t ) | 578 | QPEApplication::QPEApplication( int & argc, char **argv, Type t ) |
577 | : QApplication( hack(argc), argv, t ), pidChannel( 0 ) | 579 | : QApplication( hack(argc), argv, t ), pidChannel( 0 ) |
578 | { | 580 | { |
581 | QPixmapCache::setCacheLimit(256); // sensible default for smaller devices. | ||
582 | |||
579 | d = new QPEApplicationData; | 583 | d = new QPEApplicationData; |
580 | d->loadTextCodecs(); | 584 | d->loadTextCodecs(); |
581 | d->loadImageCodecs(); | 585 | d->loadImageCodecs(); |
582 | int dw = desktop() ->width(); | 586 | int dw = desktop() ->width(); |
@@ -1775,17 +1779,21 @@ void QPEApplication::setStylusOperation( QWidget * w, StylusMode mode ) | |||
1775 | \reimp | 1779 | \reimp |
1776 | */ | 1780 | */ |
1777 | bool QPEApplication::eventFilter( QObject *o, QEvent *e ) | 1781 | bool QPEApplication::eventFilter( QObject *o, QEvent *e ) |
1778 | { | 1782 | { |
1783 | if ( !o->isWidgetType() ) | ||
1784 | return FALSE; | ||
1785 | |||
1779 | if ( stylusDict && e->type() >= QEvent::MouseButtonPress && e->type() <= QEvent::MouseMove ) { | 1786 | if ( stylusDict && e->type() >= QEvent::MouseButtonPress && e->type() <= QEvent::MouseMove ) { |
1780 | QMouseEvent * me = ( QMouseEvent* ) e; | 1787 | QMouseEvent * me = ( QMouseEvent* ) e; |
1781 | StylusMode mode = (StylusMode)(int)stylusDict->find(o); | 1788 | StylusMode mode = (StylusMode)(int)stylusDict->find(o); |
1782 | switch (mode) { | 1789 | switch (mode) { |
1783 | case RightOnHold: | 1790 | case RightOnHold: |
1784 | switch ( me->type() ) { | 1791 | switch ( me->type() ) { |
1785 | case QEvent::MouseButtonPress: | 1792 | case QEvent::MouseButtonPress: |
1786 | if ( me->button() == LeftButton ) { | 1793 | if ( me->button() == LeftButton ) { |
1787 | d->presstimer = startTimer(500); // #### pref. | 1794 | if (!d->presstimer ) |
1795 | d->presstimer = startTimer(500); // #### pref. | ||
1788 | d->presswidget = (QWidget*)o; | 1796 | d->presswidget = (QWidget*)o; |
1789 | d->presspos = me->pos(); | 1797 | d->presspos = me->pos(); |
1790 | d->rightpressed = FALSE; | 1798 | d->rightpressed = FALSE; |
1791 | } | 1799 | } |
@@ -1903,8 +1911,10 @@ int QPEApplication::exec() | |||
1903 | { | 1911 | { |
1904 | d->qcopQok = true; | 1912 | d->qcopQok = true; |
1905 | #ifndef QT_NO_COP | 1913 | #ifndef QT_NO_COP |
1906 | d->sendQCopQ(); | 1914 | d->sendQCopQ(); |
1915 | if ( !d->keep_running ) | ||
1916 | processEvents(); // we may have received QCop messages in the meantime. | ||
1907 | #endif | 1917 | #endif |
1908 | 1918 | ||
1909 | if ( d->keep_running ) | 1919 | if ( d->keep_running ) |
1910 | //|| d->qpe_main_widget && d->qpe_main_widget->isVisible() ) | 1920 | //|| d->qpe_main_widget && d->qpe_main_widget->isVisible() ) |