author | simon <simon> | 2002-12-11 12:04:54 (UTC) |
---|---|---|
committer | simon <simon> | 2002-12-11 12:04:54 (UTC) |
commit | 882ddb046c81bdee5eeca59fde7ec458ae522dc7 (patch) (unidiff) | |
tree | b51292ac603f7ec41501c707a868dd462937224f | |
parent | d7b877a5532e6377f034514c89c0b45b96265471 (diff) | |
download | opie-882ddb046c81bdee5eeca59fde7ec458ae522dc7.zip opie-882ddb046c81bdee5eeca59fde7ec458ae522dc7.tar.gz opie-882ddb046c81bdee5eeca59fde7ec458ae522dc7.tar.bz2 |
- starting to factor out the actual skin image loading into a separate
class
-rw-r--r-- | noncore/multimedia/opieplayer2/mediawidget.cpp | 5 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/opieplayer2.pro | 6 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/skin.cpp | 18 | ||||
-rw-r--r-- | noncore/multimedia/opieplayer2/skin.h | 22 |
4 files changed, 48 insertions, 3 deletions
diff --git a/noncore/multimedia/opieplayer2/mediawidget.cpp b/noncore/multimedia/opieplayer2/mediawidget.cpp index 70ef8d9..617e0fe 100644 --- a/noncore/multimedia/opieplayer2/mediawidget.cpp +++ b/noncore/multimedia/opieplayer2/mediawidget.cpp | |||
@@ -22,8 +22,9 @@ | |||
22 | 22 | ||
23 | 23 | ||
24 | #include "mediawidget.h" | 24 | #include "mediawidget.h" |
25 | #include "playlistwidget.h" | 25 | #include "playlistwidget.h" |
26 | #include "skin.h" | ||
26 | 27 | ||
27 | #include <qpe/config.h> | 28 | #include <qpe/config.h> |
28 | #include <qpe/qpeapplication.h> | 29 | #include <qpe/qpeapplication.h> |
29 | 30 | ||
@@ -99,10 +100,12 @@ void MediaWidget::loadDefaultSkin( const SkinButtonInfo *skinInfo, uint buttonCo | |||
99 | } | 100 | } |
100 | 101 | ||
101 | void MediaWidget::loadSkin( const SkinButtonInfo *skinInfo, uint buttonCount, const QString &name, const QString &fileNameInfix ) | 102 | void MediaWidget::loadSkin( const SkinButtonInfo *skinInfo, uint buttonCount, const QString &name, const QString &fileNameInfix ) |
102 | { | 103 | { |
104 | Skin skin( name, fileNameInfix ); | ||
105 | |||
103 | QString skinPath = "opieplayer2/skins/" + name; | 106 | QString skinPath = "opieplayer2/skins/" + name; |
104 | backgroundPixmap = QPixmap( Resource::loadPixmap( QString( "%1/background" ).arg( skinPath ) ) ); | 107 | backgroundPixmap = skin.backgroundImage(); |
105 | buttonUpImage = QImage( Resource::loadImage( QString( "%1/skin%2_up" ).arg( skinPath ).arg( fileNameInfix ) ) ); | 108 | buttonUpImage = QImage( Resource::loadImage( QString( "%1/skin%2_up" ).arg( skinPath ).arg( fileNameInfix ) ) ); |
106 | buttonDownImage = QImage( Resource::loadImage( QString( "%1/skin%2_down" ).arg( skinPath ).arg( fileNameInfix ) ) ); | 109 | buttonDownImage = QImage( Resource::loadImage( QString( "%1/skin%2_down" ).arg( skinPath ).arg( fileNameInfix ) ) ); |
107 | 110 | ||
108 | setupButtons( skinInfo, buttonCount, | 111 | setupButtons( skinInfo, buttonCount, |
diff --git a/noncore/multimedia/opieplayer2/opieplayer2.pro b/noncore/multimedia/opieplayer2/opieplayer2.pro index 8d549b6..e1bb879 100644 --- a/noncore/multimedia/opieplayer2/opieplayer2.pro +++ b/noncore/multimedia/opieplayer2/opieplayer2.pro | |||
@@ -4,16 +4,18 @@ CONFIG = qt warn_on debug | |||
4 | DESTDIR = $(OPIEDIR)/bin | 4 | DESTDIR = $(OPIEDIR)/bin |
5 | HEADERS = playlistselection.h mediaplayerstate.h xinecontrol.h \ | 5 | HEADERS = playlistselection.h mediaplayerstate.h xinecontrol.h \ |
6 | videowidget.h audiowidget.h playlistwidget.h om3u.h mediaplayer.h inputDialog.h \ | 6 | videowidget.h audiowidget.h playlistwidget.h om3u.h mediaplayer.h inputDialog.h \ |
7 | frame.h lib.h xinevideowidget.h volumecontrol.h playlistwidgetgui.h\ | 7 | frame.h lib.h xinevideowidget.h volumecontrol.h playlistwidgetgui.h\ |
8 | alphablend.h yuv2rgb.h threadutil.h mediawidget.h playlistview.h playlistfileview.h | 8 | alphablend.h yuv2rgb.h threadutil.h mediawidget.h playlistview.h playlistfileview.h \ |
9 | skin.h | ||
9 | SOURCES = main.cpp \ | 10 | SOURCES = main.cpp \ |
10 | playlistselection.cpp mediaplayerstate.cpp xinecontrol.cpp \ | 11 | playlistselection.cpp mediaplayerstate.cpp xinecontrol.cpp \ |
11 | videowidget.cpp audiowidget.cpp playlistwidget.cpp om3u.cpp mediaplayer.cpp inputDialog.cpp \ | 12 | videowidget.cpp audiowidget.cpp playlistwidget.cpp om3u.cpp mediaplayer.cpp inputDialog.cpp \ |
12 | frame.cpp lib.cpp nullvideo.c xinevideowidget.cpp volumecontrol.cpp \ | 13 | frame.cpp lib.cpp nullvideo.c xinevideowidget.cpp volumecontrol.cpp \ |
13 | playlistwidgetgui.cpp\ | 14 | playlistwidgetgui.cpp\ |
14 | alphablend.c yuv2rgb.c yuv2rgb_arm.c yuv2rgb_arm4l.S \ | 15 | alphablend.c yuv2rgb.c yuv2rgb_arm.c yuv2rgb_arm4l.S \ |
15 | threadutil.cpp mediawidget.cpp playlistview.cpp playlistfileview.cpp | 16 | threadutil.cpp mediawidget.cpp playlistview.cpp playlistfileview.cpp \ |
17 | skin.cpp | ||
16 | TARGET = opieplayer2 | 18 | TARGET = opieplayer2 |
17 | INCLUDEPATH += $(OPIEDIR)/include | 19 | INCLUDEPATH += $(OPIEDIR)/include |
18 | DEPENDPATH += $(OPIEDIR)/include | 20 | DEPENDPATH += $(OPIEDIR)/include |
19 | LIBS += -lqpe -lpthread -lopie -lxine | 21 | LIBS += -lqpe -lpthread -lopie -lxine |
diff --git a/noncore/multimedia/opieplayer2/skin.cpp b/noncore/multimedia/opieplayer2/skin.cpp new file mode 100644 index 0000000..097b29a --- a/dev/null +++ b/noncore/multimedia/opieplayer2/skin.cpp | |||
@@ -0,0 +1,18 @@ | |||
1 | |||
2 | #include "skin.h" | ||
3 | |||
4 | #include <qpe/resource.h> | ||
5 | |||
6 | Skin::Skin( const QString &name, const QString &fileNameInfix ) | ||
7 | : m_name( name ), m_fileNameInfix( fileNameInfix ) | ||
8 | { | ||
9 | m_skinPath = "opieplayer2/skins/" + name; | ||
10 | } | ||
11 | |||
12 | QImage Skin::backgroundImage() const | ||
13 | { | ||
14 | return QImage( Resource::findPixmap( QString( "%1/background" ).arg( m_skinPath ) ) ); | ||
15 | } | ||
16 | |||
17 | /* vim: et sw=4 ts=4 | ||
18 | */ | ||
diff --git a/noncore/multimedia/opieplayer2/skin.h b/noncore/multimedia/opieplayer2/skin.h new file mode 100644 index 0000000..3c09e43 --- a/dev/null +++ b/noncore/multimedia/opieplayer2/skin.h | |||
@@ -0,0 +1,22 @@ | |||
1 | #ifndef SKIN_H | ||
2 | #define SKIN_H | ||
3 | |||
4 | #include <qstring.h> | ||
5 | #include <qimage.h> | ||
6 | |||
7 | class Skin | ||
8 | { | ||
9 | public: | ||
10 | Skin( const QString &name, const QString &fileNameInfix ); | ||
11 | |||
12 | QImage backgroundImage() const; | ||
13 | |||
14 | private: | ||
15 | QString m_name; | ||
16 | QString m_fileNameInfix; | ||
17 | QString m_skinPath; | ||
18 | }; | ||
19 | |||
20 | #endif // SKIN_H | ||
21 | /* vim: et sw=4 ts=4 | ||
22 | */ | ||