Diffstat (limited to 'noncore/multimedia/opieplayer2/mediawidget.h') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/multimedia/opieplayer2/mediawidget.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/noncore/multimedia/opieplayer2/mediawidget.h b/noncore/multimedia/opieplayer2/mediawidget.h index 2641df6..504b705 100644 --- a/noncore/multimedia/opieplayer2/mediawidget.h +++ b/noncore/multimedia/opieplayer2/mediawidget.h | |||
@@ -15,44 +15,49 @@ | |||
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 | 28 | ||
28 | #include "mediaplayerstate.h" | 29 | #include "mediaplayerstate.h" |
29 | #include "playlistwidget.h" | 30 | #include "playlistwidget.h" |
30 | 31 | ||
31 | #include <vector> | 32 | #include <vector> |
32 | 33 | ||
33 | class MediaWidget : public QWidget | 34 | class MediaWidget : public QWidget |
34 | { | 35 | { |
35 | Q_OBJECT | 36 | Q_OBJECT |
36 | public: | 37 | public: |
37 | enum Command { Play = 0, Stop, Next, Previous, VolumeUp, VolumeDown, Loop, PlayList, Forward, Back }; | 38 | enum Command { Play = 0, Stop, Next, Previous, VolumeUp, VolumeDown, Loop, PlayList, Forward, Back }; |
38 | enum ButtonType { NormalButton, ToggleButton }; | 39 | enum ButtonType { NormalButton, ToggleButton }; |
39 | 40 | ||
40 | struct Button | 41 | struct Button |
41 | { | 42 | { |
42 | Button() : type( NormalButton ), isHeld( false ), isDown( false ) {} | 43 | Button() : type( NormalButton ), isHeld( false ), isDown( false ) {} |
43 | 44 | ||
44 | ButtonType type : 1; | 45 | ButtonType type : 1; |
45 | bool isHeld : 1; | 46 | bool isHeld : 1; |
46 | bool isDown : 1; | 47 | bool isDown : 1; |
48 | |||
49 | QBitmap mask; | ||
50 | QPixmap pixUp; | ||
51 | QPixmap pixDown; | ||
47 | }; | 52 | }; |
48 | typedef std::vector<Button> ButtonVector; | 53 | typedef std::vector<Button> ButtonVector; |
49 | 54 | ||
50 | struct SkinButtonInfo | 55 | struct SkinButtonInfo |
51 | { | 56 | { |
52 | Command command; | 57 | Command command; |
53 | const char *fileName; | 58 | const char *fileName; |
54 | ButtonType type; | 59 | ButtonType type; |
55 | }; | 60 | }; |
56 | 61 | ||
57 | typedef std::vector<QBitmap> MaskVector; | 62 | typedef std::vector<QBitmap> MaskVector; |
58 | typedef std::vector<QPixmap> PixmapVector; | 63 | typedef std::vector<QPixmap> PixmapVector; |
@@ -81,22 +86,18 @@ protected: | |||
81 | void paintButton( int buttonId ); | 86 | void paintButton( int buttonId ); |
82 | virtual void paintButton( QPainter &p, int i ) = 0; | 87 | virtual void paintButton( QPainter &p, int i ) = 0; |
83 | 88 | ||
84 | void toggleButton( int buttonId ); | 89 | void toggleButton( int buttonId ); |
85 | 90 | ||
86 | MediaPlayerState &mediaPlayerState; | 91 | MediaPlayerState &mediaPlayerState; |
87 | PlayListWidget &playList; | 92 | PlayListWidget &playList; |
88 | 93 | ||
89 | ButtonVector buttons; | 94 | ButtonVector buttons; |
90 | 95 | ||
91 | QImage buttonMask; | 96 | QImage buttonMask; |
92 | 97 | ||
93 | MaskVector masks; | ||
94 | PixmapVector buttonPixUp; | ||
95 | PixmapVector buttonPixDown; | ||
96 | |||
97 | QPoint upperLeftOfButtonMask; | 98 | QPoint upperLeftOfButtonMask; |
98 | }; | 99 | }; |
99 | 100 | ||
100 | #endif // MEDIAWIDGET_H | 101 | #endif // MEDIAWIDGET_H |
101 | /* vim: et sw=4 ts=4 | 102 | /* vim: et sw=4 ts=4 |
102 | */ | 103 | */ |