author | simon <simon> | 2002-12-09 17:43:32 (UTC) |
---|---|---|
committer | simon <simon> | 2002-12-09 17:43:32 (UTC) |
commit | 29b5784bba7b19497b5984418bacee261075ccf7 (patch) (unidiff) | |
tree | 5c69ec713600ca03ccbbf419bc9a5e0c76ec775e | |
parent | 73278bac12a0af959fde6d12280ed08859a5abaf (diff) | |
download | opie-29b5784bba7b19497b5984418bacee261075ccf7.zip opie-29b5784bba7b19497b5984418bacee261075ccf7.tar.gz opie-29b5784bba7b19497b5984418bacee261075ccf7.tar.bz2 |
- apparently gcc2 is too stupid to grok this :-(
-rw-r--r-- | noncore/multimedia/opieplayer2/mediawidget.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/noncore/multimedia/opieplayer2/mediawidget.h b/noncore/multimedia/opieplayer2/mediawidget.h index c19fdbb..c261728 100644 --- a/noncore/multimedia/opieplayer2/mediawidget.h +++ b/noncore/multimedia/opieplayer2/mediawidget.h | |||
@@ -1,120 +1,120 @@ | |||
1 | /* | 1 | /* |
2 | Copyright (C) 2002 Simon Hausmann <hausmann@kde.org> | 2 | Copyright (C) 2002 Simon Hausmann <hausmann@kde.org> |
3 | (C) 2002 Max Reiss <harlekin@handhelds.org> | 3 | (C) 2002 Max Reiss <harlekin@handhelds.org> |
4 | (C) 2002 L. Potter <ljp@llornkcor.com> | 4 | (C) 2002 L. Potter <ljp@llornkcor.com> |
5 | (C) 2002 Holger Freyther <zecke@handhelds.org> | 5 | (C) 2002 Holger Freyther <zecke@handhelds.org> |
6 | 6 | ||
7 | This library is free software; you can redistribute it and/or | 7 | This library is free software; you can redistribute it and/or |
8 | modify it under the terms of the GNU Library General Public | 8 | modify it under the terms of the GNU Library General Public |
9 | License as published by the Free Software Foundation; either | 9 | License as published by the Free Software Foundation; either |
10 | version 2 of the License, or (at your option) any later version. | 10 | version 2 of the License, or (at your option) any later version. |
11 | 11 | ||
12 | This library is distributed in the hope that it will be useful, | 12 | This library is distributed in the hope that it will be useful, |
13 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
15 | Library General Public License for more details. | 15 | Library General Public License for more details. |
16 | 16 | ||
17 | You should have received a copy of the GNU Library General Public License | 17 | You should have received a copy of the GNU Library General Public License |
18 | along with this library; see the file COPYING.LIB. If not, write to | 18 | along with this library; see the file COPYING.LIB. If not, write to |
19 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 19 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
20 | Boston, MA 02111-1307, USA. | 20 | Boston, MA 02111-1307, USA. |
21 | */ | 21 | */ |
22 | 22 | ||
23 | #ifndef MEDIAWIDGET_H | 23 | #ifndef MEDIAWIDGET_H |
24 | #define MEDIAWIDGET_H | 24 | #define MEDIAWIDGET_H |
25 | 25 | ||
26 | #include <qwidget.h> | 26 | #include <qwidget.h> |
27 | #include <qmap.h> | 27 | #include <qmap.h> |
28 | 28 | ||
29 | #include "mediaplayerstate.h" | 29 | #include "mediaplayerstate.h" |
30 | #include "playlistwidget.h" | 30 | #include "playlistwidget.h" |
31 | 31 | ||
32 | #include <vector> | 32 | #include <vector> |
33 | 33 | ||
34 | class MediaWidget : public QWidget | 34 | class MediaWidget : public QWidget |
35 | { | 35 | { |
36 | Q_OBJECT | 36 | Q_OBJECT |
37 | public: | 37 | public: |
38 | enum Command { Play = 0, Stop, Next, Previous, VolumeUp, VolumeDown, Loop, PlayList, Forward, Back, FullScreen, Undefined }; | 38 | enum Command { Play = 0, Stop, Next, Previous, VolumeUp, VolumeDown, Loop, PlayList, Forward, Back, FullScreen, Undefined }; |
39 | enum ButtonType { NormalButton, ToggleButton }; | 39 | enum ButtonType { NormalButton, ToggleButton }; |
40 | 40 | ||
41 | struct Button | 41 | struct Button |
42 | { | 42 | { |
43 | Button() : command( Undefined ), type( NormalButton ), isHeld( false ), isDown( false ) {} | 43 | Button() : command( Undefined ), type( NormalButton ), isHeld( false ), isDown( false ) {} |
44 | 44 | ||
45 | Command command; | 45 | Command command; |
46 | 46 | ||
47 | ButtonType type : 1; | 47 | ButtonType type; // this should be part of the bitfield but gcc2 is too buggy to support this :-( |
48 | bool isHeld : 1; | 48 | bool isHeld : 1; |
49 | bool isDown : 1; | 49 | bool isDown : 1; |
50 | 50 | ||
51 | QBitmap mask; | 51 | QBitmap mask; |
52 | QPixmap pixUp; | 52 | QPixmap pixUp; |
53 | QPixmap pixDown; | 53 | QPixmap pixDown; |
54 | }; | 54 | }; |
55 | typedef std::vector<Button> ButtonVector; | 55 | typedef std::vector<Button> ButtonVector; |
56 | 56 | ||
57 | struct SkinButtonInfo | 57 | struct SkinButtonInfo |
58 | { | 58 | { |
59 | Command command; | 59 | Command command; |
60 | const char *fileName; | 60 | const char *fileName; |
61 | ButtonType type; | 61 | ButtonType type; |
62 | }; | 62 | }; |
63 | 63 | ||
64 | typedef std::vector<QBitmap> MaskVector; | 64 | typedef std::vector<QBitmap> MaskVector; |
65 | typedef std::vector<QPixmap> PixmapVector; | 65 | typedef std::vector<QPixmap> PixmapVector; |
66 | 66 | ||
67 | MediaWidget( PlayListWidget &_playList, MediaPlayerState &_mediaPlayerState, QWidget *parent = 0, const char *name = 0 ); | 67 | MediaWidget( PlayListWidget &_playList, MediaPlayerState &_mediaPlayerState, QWidget *parent = 0, const char *name = 0 ); |
68 | virtual ~MediaWidget(); | 68 | virtual ~MediaWidget(); |
69 | 69 | ||
70 | public slots: | 70 | public slots: |
71 | virtual void setDisplayType( MediaPlayerState::DisplayType displayType ) = 0; | 71 | virtual void setDisplayType( MediaPlayerState::DisplayType displayType ) = 0; |
72 | virtual void setLength( long length ) = 0; | 72 | virtual void setLength( long length ) = 0; |
73 | virtual void setPlaying( bool playing ) = 0; | 73 | virtual void setPlaying( bool playing ) = 0; |
74 | 74 | ||
75 | signals: | 75 | signals: |
76 | void moreReleased(); | 76 | void moreReleased(); |
77 | void lessReleased(); | 77 | void lessReleased(); |
78 | void forwardReleased(); | 78 | void forwardReleased(); |
79 | void backReleased(); | 79 | void backReleased(); |
80 | void forwardClicked(); | 80 | void forwardClicked(); |
81 | void backClicked(); | 81 | void backClicked(); |
82 | void moreClicked(); | 82 | void moreClicked(); |
83 | void lessClicked(); | 83 | void lessClicked(); |
84 | 84 | ||
85 | protected: | 85 | protected: |
86 | virtual void closeEvent( QCloseEvent * ); | 86 | virtual void closeEvent( QCloseEvent * ); |
87 | 87 | ||
88 | virtual void paintEvent( QPaintEvent *pe ); | 88 | virtual void paintEvent( QPaintEvent *pe ); |
89 | 89 | ||
90 | virtual void mouseMoveEvent( QMouseEvent *event ); | 90 | virtual void mouseMoveEvent( QMouseEvent *event ); |
91 | 91 | ||
92 | virtual void makeVisible(); | 92 | virtual void makeVisible(); |
93 | 93 | ||
94 | void handleCommand( Command command, bool buttonDown ); | 94 | void handleCommand( Command command, bool buttonDown ); |
95 | 95 | ||
96 | bool isOverButton( const QPoint &position, int buttonId ) const; | 96 | bool isOverButton( const QPoint &position, int buttonId ) const; |
97 | 97 | ||
98 | void paintAllButtons( QPainter &p ); | 98 | void paintAllButtons( QPainter &p ); |
99 | void paintButton( const Button &button ); | 99 | void paintButton( const Button &button ); |
100 | void paintButton( QPainter &p, const Button &button ); | 100 | void paintButton( QPainter &p, const Button &button ); |
101 | 101 | ||
102 | void setToggleButton( Button &button, bool down ); | 102 | void setToggleButton( Button &button, bool down ); |
103 | void setToggleButton( Command command, bool down ); | 103 | void setToggleButton( Command command, bool down ); |
104 | void toggleButton( Button &button ); | 104 | void toggleButton( Button &button ); |
105 | 105 | ||
106 | MediaPlayerState &mediaPlayerState; | 106 | MediaPlayerState &mediaPlayerState; |
107 | PlayListWidget &playList; | 107 | PlayListWidget &playList; |
108 | 108 | ||
109 | ButtonVector buttons; | 109 | ButtonVector buttons; |
110 | 110 | ||
111 | QImage buttonMask; | 111 | QImage buttonMask; |
112 | 112 | ||
113 | QPoint upperLeftOfButtonMask; | 113 | QPoint upperLeftOfButtonMask; |
114 | 114 | ||
115 | QPixmap backgroundPixmap; | 115 | QPixmap backgroundPixmap; |
116 | }; | 116 | }; |
117 | 117 | ||
118 | #endif // MEDIAWIDGET_H | 118 | #endif // MEDIAWIDGET_H |
119 | /* vim: et sw=4 ts=4 | 119 | /* vim: et sw=4 ts=4 |
120 | */ | 120 | */ |