author | wimpie <wimpie> | 2004-08-25 01:47:35 (UTC) |
---|---|---|
committer | wimpie <wimpie> | 2004-08-25 01:47:35 (UTC) |
commit | f6a6fe57c9e0047379f4b8b40da4776f1c4d7b25 (patch) (side-by-side diff) | |
tree | 2db64e885b1a67058fa45533819993c8dcb4fb96 /library/backend | |
parent | 49c47e98bed6e35d0bdc8e1e4cc40bdbb07eab06 (diff) | |
download | opie-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
-rw-r--r-- | library/backend/rohfeedback.cpp | 28 | ||||
-rw-r--r-- | library/backend/rohfeedback.h | 3 |
2 files changed, 17 insertions, 14 deletions
diff --git a/library/backend/rohfeedback.cpp b/library/backend/rohfeedback.cpp index ff76a36..21aad34 100644 --- a/library/backend/rohfeedback.cpp +++ b/library/backend/rohfeedback.cpp @@ -1,9 +1,9 @@ -#include <rohfeedback.h> - +#ifdef OPIE_WITHROHFEEDBACK +#include <rohfeedback.h> #include <stdio.h> #include <qpeapplication.h> #include <qevent.h> #include <resource.h> #include <qpixmap.h> #include <qbitmap.h> @@ -32,18 +32,17 @@ RoHFeedback::RoHFeedback() : if( Imgs[0] == 0 ) { QString S; for( int i = 0; i < NOOFICONS ; i ++ ) { - Imgs[i] = new QPixmap( Resource::loadPixmap("RoH/star/"+ - QString::number(i+1) + - ".png" )); + Imgs[i] = new QPixmap( Resource::loadPixmap( + "RoH/star/"+ QString::number(i+1) + ".png" )); Masks[i] = new QBitmap(); - (*Masks[i]) = Resource::loadPixmap("RoH/star/"+QString::number(i+1) + - ".png" ); + (*Masks[i]) = Resource::loadPixmap( + "RoH/star/"+QString::number(i+1) + "-mask.png" ); } } IconWidth = Imgs[0]->size().width(); IconHeight = Imgs[0]->size().height(); @@ -63,22 +62,20 @@ RoHFeedback::~RoHFeedback() { void RoHFeedback::init( const QPoint & P, QWidget* wid ) { if( ! IconWidth ) return; Receiver = wid; - IconNr = -1; + IconNr = FeedbackTimerStart; move( P.x()-IconWidth/2, P.y() - IconHeight/2 ); // to initialize - Timer.start( DELAY - SPEED/NOOFICONS ); + Timer.start( DELAY ); } void RoHFeedback::stop( void ) { - IconNr = -2; // stop - hide(); - Timer.stop(); + IconNr = FeedbackStopped; // stop } bool RoHFeedback::event( QEvent * E ) { if( E->type() >= QEvent::MouseButtonPress && E->type() <= QEvent::MouseMove ) { @@ -97,19 +94,20 @@ bool RoHFeedback::event( QEvent * E ) { return QLabel::event( E ); } void RoHFeedback::iconShow( void ) { switch( IconNr ) { case FeedbackTimerStart: - IconNr = 0; + IconNr = FeedbackShow; Timer.start( SPEED/NOOFICONS ); break; case FeedbackStopped: // stopped IconNr = FeedbackTimerStart; hide(); + Timer.stop(); break; case FeedbackShow: // first show(); // FT default : // show @@ -119,7 +117,9 @@ void RoHFeedback::iconShow( void ) { IconNr = (IconNr+1)%NOOFICONS; // rotate break; } } } -}
\ No newline at end of file +} + +#endif diff --git a/library/backend/rohfeedback.h b/library/backend/rohfeedback.h index f38a095..9ffd35a 100644 --- a/library/backend/rohfeedback.h +++ b/library/backend/rohfeedback.h @@ -1,9 +1,11 @@ #ifndef ROHFEEDBACK_H #define ROHFEEDBACK_H +#ifdef OPIE_WITHROHFEEDBACK + /* RightOnHold feedback show */ @@ -57,6 +59,7 @@ protected : static QBitmap * Masks[NOOFICONS]; }; } } #endif +#endif |