summaryrefslogtreecommitdiff
path: root/library
Unidiff
Diffstat (limited to 'library') (more/less context) (ignore whitespace changes)
-rw-r--r--library/backend/rohfeedback.cpp19
-rw-r--r--library/backend/rohfeedback.h19
2 files changed, 38 insertions, 0 deletions
diff --git a/library/backend/rohfeedback.cpp b/library/backend/rohfeedback.cpp
index 21aad34..9a19aac 100644
--- a/library/backend/rohfeedback.cpp
+++ b/library/backend/rohfeedback.cpp
@@ -1,48 +1,67 @@
1/**********************************************************************
2** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
3**
4** This file is part of the Qtopia Environment.
5**
6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file.
10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13**
14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15**
16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you.
18**
19**********************************************************************/
1#ifdef OPIE_WITHROHFEEDBACK 20#ifdef OPIE_WITHROHFEEDBACK
2 21
3#include <rohfeedback.h> 22#include <rohfeedback.h>
4#include <stdio.h> 23#include <stdio.h>
5#include <qpeapplication.h> 24#include <qpeapplication.h>
6#include <qevent.h> 25#include <qevent.h>
7#include <resource.h> 26#include <resource.h>
8#include <qpixmap.h> 27#include <qpixmap.h>
9#include <qbitmap.h> 28#include <qbitmap.h>
10 29
11#define SPEED 600 30#define SPEED 600
12#define DELAY 500 31#define DELAY 500
13 32
14namespace Opie { 33namespace Opie {
15namespace Internal { 34namespace Internal {
16/* 35/*
17 36
18 RightOnHold feedback 37 RightOnHold feedback
19 38
20*/ 39*/
21 40
22QPixmap * RoHFeedback::Imgs[NOOFICONS] = { 0, 0, 0, 0, 0 }; 41QPixmap * RoHFeedback::Imgs[NOOFICONS] = { 0, 0, 0, 0, 0 };
23QBitmap * RoHFeedback::Masks[NOOFICONS]; 42QBitmap * RoHFeedback::Masks[NOOFICONS];
24int RoHFeedback::IconWidth; 43int RoHFeedback::IconWidth;
25int RoHFeedback::IconHeight; 44int RoHFeedback::IconHeight;
26 45
27RoHFeedback::RoHFeedback() : 46RoHFeedback::RoHFeedback() :
28 QLabel( 0, 0, Qt::WType_Popup ), Timer() { 47 QLabel( 0, 0, Qt::WType_Popup ), Timer() {
29 48
30 Receiver = 0l; 49 Receiver = 0l;
31 connect( &Timer, SIGNAL( timeout() ), this, SLOT( iconShow() ) ); 50 connect( &Timer, SIGNAL( timeout() ), this, SLOT( iconShow() ) );
32 51
33 if( Imgs[0] == 0 ) { 52 if( Imgs[0] == 0 ) {
34 QString S; 53 QString S;
35 54
36 55
37 for( int i = 0; i < NOOFICONS ; i ++ ) { 56 for( int i = 0; i < NOOFICONS ; i ++ ) {
38 Imgs[i] = new QPixmap( Resource::loadPixmap( 57 Imgs[i] = new QPixmap( Resource::loadPixmap(
39 "RoH/star/"+ QString::number(i+1) + ".png" )); 58 "RoH/star/"+ QString::number(i+1) + ".png" ));
40 Masks[i] = new QBitmap(); 59 Masks[i] = new QBitmap();
41 (*Masks[i]) = Resource::loadPixmap( 60 (*Masks[i]) = Resource::loadPixmap(
42 "RoH/star/"+QString::number(i+1) + "-mask.png" ); 61 "RoH/star/"+QString::number(i+1) + "-mask.png" );
43 } 62 }
44 } 63 }
45 64
46 IconWidth = Imgs[0]->size().width(); 65 IconWidth = Imgs[0]->size().width();
47 IconHeight = Imgs[0]->size().height(); 66 IconHeight = Imgs[0]->size().height();
48 67
diff --git a/library/backend/rohfeedback.h b/library/backend/rohfeedback.h
index 9ffd35a..774ee85 100644
--- a/library/backend/rohfeedback.h
+++ b/library/backend/rohfeedback.h
@@ -1,48 +1,67 @@
1/**********************************************************************
2** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
3**
4** This file is part of the Qtopia Environment.
5**
6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file.
10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13**
14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15**
16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you.
18**
19**********************************************************************/
1#ifndef ROHFEEDBACK_H 20#ifndef ROHFEEDBACK_H
2#define ROHFEEDBACK_H 21#define ROHFEEDBACK_H
3 22
4#ifdef OPIE_WITHROHFEEDBACK 23#ifdef OPIE_WITHROHFEEDBACK
5 24
6/* 25/*
7 26
8 RightOnHold feedback show 27 RightOnHold feedback show
9 28
10*/ 29*/
11 30
12#define NOOFICONS 5 31#define NOOFICONS 5
13 32
14#include <qlabel.h> 33#include <qlabel.h>
15#include <qtimer.h> 34#include <qtimer.h>
16 35
17class QEvent; 36class QEvent;
18class QPixmap; 37class QPixmap;
19class QBitmap; 38class QBitmap;
20class QMouseEvent; 39class QMouseEvent;
21 40
22namespace Opie { 41namespace Opie {
23namespace Internal { 42namespace Internal {
24 43
25class RoHFeedback : public QLabel { 44class RoHFeedback : public QLabel {
26 45
27 Q_OBJECT 46 Q_OBJECT
28 47
29 enum Actions { 48 enum Actions {
30 FeedbackStopped = -2, 49 FeedbackStopped = -2,
31 FeedbackTimerStart = -1, 50 FeedbackTimerStart = -1,
32 FeedbackShow = 0 51 FeedbackShow = 0
33 }; 52 };
34public : 53public :
35 54
36 RoHFeedback(); 55 RoHFeedback();
37 ~RoHFeedback(); 56 ~RoHFeedback();
38 57
39 58
40 void init( const QPoint & P, QWidget* wid ); 59 void init( const QPoint & P, QWidget* wid );
41 void stop( void ); 60 void stop( void );
42 int delay( void ); 61 int delay( void );
43 62
44public slots : 63public slots :
45 64
46 void iconShow( void ); 65 void iconShow( void );
47 66
48protected : 67protected :