summaryrefslogtreecommitdiff
path: root/library/qpeapplication.cpp
authorwimpie <wimpie>2004-08-25 01:47:35 (UTC)
committer wimpie <wimpie>2004-08-25 01:47:35 (UTC)
commitf6a6fe57c9e0047379f4b8b40da4776f1c4d7b25 (patch) (side-by-side diff)
tree2db64e885b1a67058fa45533819993c8dcb4fb96 /library/qpeapplication.cpp
parent49c47e98bed6e35d0bdc8e1e4cc40bdbb07eab06 (diff)
downloadopie-f6a6fe57c9e0047379f4b8b40da4776f1c4d7b25.zip
opie-f6a6fe57c9e0047379f4b8b40da4776f1c4d7b25.tar.gz
opie-f6a6fe57c9e0047379f4b8b40da4776f1c4d7b25.tar.bz2
Final changes for RoH Feedback
- changed *.pro file to compile in backend - some more fixes to rohfeedback and qpeapplication
Diffstat (limited to 'library/qpeapplication.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--library/qpeapplication.cpp58
1 files changed, 30 insertions, 28 deletions
diff --git a/library/qpeapplication.cpp b/library/qpeapplication.cpp
index 35f433c..c6d9cfd 100644
--- a/library/qpeapplication.cpp
+++ b/library/qpeapplication.cpp
@@ -94,18 +94,17 @@
#include <sys/ioctl.h>
#ifndef QT_NO_SOUND
#include <sys/soundcard.h>
#endif
#include "qt_override_p.h"
-#include <qpe/rohfeedback.h>
+#include <backend/rohfeedback.h>
static bool useBigPixmaps = 0;
-
class HackWidget : public QWidget
{
public:
bool needsOk()
{ return (getWState() & WState_Reserved1 ); }
@@ -113,35 +112,35 @@ public:
{ return topData()->normalGeometry; };
};
class QPEApplicationData
{
public:
- QPEApplicationData ( )
- : presstimer( 0 ), presswidget( 0 ), rightpressed( false ), kbgrabbed( false ),
+ QPEApplicationData ( ) :
+ presstimer( 0 ), presswidget( 0 ), rightpressed( false ), kbgrabbed( false ),
notbusysent( false ), preloaded( false ), forceshow( false ), nomaximize( false ),
keep_running( true ), qcopQok( false ),
fontFamily( "Vera" ), fontSize( 10 ), smallIconSize( 14 ),
bigIconSize( 32 ), qpe_main_widget( 0 )
{
Config cfg( "qpe" );
cfg.setGroup( "Appearance" );
useBigPixmaps = cfg.readBoolEntry( "useBigPixmaps", false );
fontFamily = cfg.readEntry( "FontFamily", "Vera" );
fontSize = cfg.readNumEntry( "FontSize", 10 );
smallIconSize = cfg.readNumEntry( "SmallIconSize", 14 );
bigIconSize = cfg.readNumEntry( "BigIconSize", 32 );
-#ifdef OPIE_ROHFEEDBACK
+#ifdef OPIE_WITHROHFEEDBACK
RoH = 0;
#endif
}
int presstimer;
QWidget* presswidget;
QPoint presspos;
-#ifdef OPIE_ROHFEEDBACK
+#ifdef OPIE_WITHROHFEEDBACK
Opie::Internal::RoHFeedback *RoH;
#endif
bool rightpressed : 1;
bool kbgrabbed : 1;
bool notbusysent : 1;
@@ -499,12 +498,13 @@ static void qpe_show_dialog( QDialog* d, bool nomax )
else {
lib->unload();
delete lib;
}
}
}
+
};
class ResourceMimeFactory : public QMimeSourceFactory
{
public:
ResourceMimeFactory() : resImage( 0 )
@@ -1212,14 +1212,16 @@ QPEApplication::~QPEApplication()
#if defined(Q_WS_QWS) && !defined(QT_NO_COP)
// Need to delete QCopChannels early, since the display will
// be gone by the time we get to ~QObject().
delete sysChannel;
delete pidChannel;
#endif
-#ifdef OPIE_ROHFEEDBACK
- delete d->RoH;
+
+#ifdef OPIE_WITHROHFEEDBACK
+ if( d->RoH )
+ delete d->RoH;
#endif
delete d;
}
/*!
Returns <tt>$OPIEDIR/</tt>.
@@ -2032,50 +2034,49 @@ bool QPEApplication::eventFilter( QObject *o, QEvent *e )
StylusMode mode = (StylusMode)(int)stylusDict->find(o);
switch (mode) {
case RightOnHold:
switch ( me->type() ) {
case QEvent::MouseButtonPress:
if ( me->button() == LeftButton ) {
+ static long Pref = 500; // #### pref.
d->presswidget = (QWidget*)o;
d->presspos = me->pos();
d->rightpressed = FALSE;
- // just for the time being
- static int pref = 500;
-#ifdef OPIE_ROHFEEDBACK
+#ifdef OPIE_WITHROHFEEDBACK
if( ! d->RoH )
d->RoH = new Opie::Internal::RoHFeedback;
d->RoH->init( me->globalPos(), d->presswidget );
- pref = d->RoH->delay();
+ Pref = d->RoH->delay();
+
#endif
if (!d->presstimer )
- d->presstimer = startTimer( pref ); // #### pref.
+ d->presstimer = startTimer( Pref ); // #### pref.
}
break;
case QEvent::MouseMove:
if (d->presstimer && (me->pos() - d->presspos).manhattanLength() > 8) {
killTimer(d->presstimer);
-#ifdef OPIE_ROHFEEDBACK
- if( d->RoH )
- d->RoH->stop( );
+#ifdef OPIE_WITHROHFEEDBACK
+ d->RoH->stop();
#endif
d->presstimer = 0;
}
break;
case QEvent::MouseButtonRelease:
if ( me->button() == LeftButton ) {
if ( d->presstimer ) {
killTimer(d->presstimer);
-#ifdef OPIE_ROHFEEDBACK
- if( d->RoH )
- d->RoH->stop( );
+#ifdef OPIE_WITHROHFEEDBACK
+ d->RoH->stop( );
#endif
d->presstimer = 0;
}
if ( d->rightpressed && d->presswidget ) {
+ printf( "Send ButtonRelease\n" );
// Right released
postEvent( d->presswidget,
new QMouseEvent( QEvent::MouseButtonRelease, me->pos(),
RightButton, LeftButton + RightButton ) );
// Left released, off-widget
postEvent( d->presswidget,
@@ -2113,21 +2114,22 @@ bool QPEApplication::eventFilter( QObject *o, QEvent *e )
/*!
\reimp
*/
void QPEApplication::timerEvent( QTimerEvent *e )
{
if ( e->timerId() == d->presstimer && d->presswidget ) {
- // Right pressed
- postEvent( d->presswidget,
- new QMouseEvent( QEvent::MouseButtonPress, d->presspos,
- RightButton, LeftButton ) );
- killTimer( d->presstimer );
- d->presstimer = 0;
- d->rightpressed = TRUE;
-#ifdef OPIE_ROHFEEDBACK
- d->RoH->stop();
+
+ // Right pressed
+ postEvent( d->presswidget,
+ new QMouseEvent( QEvent::MouseButtonPress, d->presspos,
+ RightButton, LeftButton ) );
+ killTimer( d->presstimer );
+ d->presstimer = 0;
+ d->rightpressed = TRUE;
+#ifdef OPIE_WITHROHFEEDBACK
+ d->RoH->stop();
#endif
}
}
void QPEApplication::removeSenderFromStylusDict()
{