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,11 +1,11 @@ -#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> #define SPEED 600 @@ -30,22 +30,21 @@ RoHFeedback::RoHFeedback() : Receiver = 0l; connect( &Timer, SIGNAL( timeout() ), this, SLOT( iconShow() ) ); 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(); resize( IconWidth, IconHeight ); } @@ -61,26 +60,24 @@ 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 ) { // pass the event to the receiver with translated coord QMouseEvent QME( ((QMouseEvent *)E)->type(), @@ -95,31 +92,34 @@ bool RoHFeedback::event( QEvent * E ) { // first let the label treat the event 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 setPixmap( *(Imgs[IconNr]) ); setMask( *(Masks[IconNr]) ); 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,11 +1,13 @@ #ifndef ROHFEEDBACK_H #define ROHFEEDBACK_H +#ifdef OPIE_WITHROHFEEDBACK + /* RightOnHold feedback show */ #define NOOFICONS 5 @@ -55,8 +57,9 @@ protected : static int IconHeight; static QPixmap * Imgs[NOOFICONS]; static QBitmap * Masks[NOOFICONS]; }; } } #endif +#endif |