From 882ddb046c81bdee5eeca59fde7ec458ae522dc7 Mon Sep 17 00:00:00 2001 From: simon Date: Wed, 11 Dec 2002 12:04:54 +0000 Subject: - starting to factor out the actual skin image loading into a separate class --- (limited to 'noncore/multimedia/opieplayer2') 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 @@ -23,6 +23,7 @@ #include "mediawidget.h" #include "playlistwidget.h" +#include "skin.h" #include #include @@ -100,8 +101,10 @@ void MediaWidget::loadDefaultSkin( const SkinButtonInfo *skinInfo, uint buttonCo void MediaWidget::loadSkin( const SkinButtonInfo *skinInfo, uint buttonCount, const QString &name, const QString &fileNameInfix ) { + Skin skin( name, fileNameInfix ); + QString skinPath = "opieplayer2/skins/" + name; - backgroundPixmap = QPixmap( Resource::loadPixmap( QString( "%1/background" ).arg( skinPath ) ) ); + backgroundPixmap = skin.backgroundImage(); buttonUpImage = QImage( Resource::loadImage( QString( "%1/skin%2_up" ).arg( skinPath ).arg( fileNameInfix ) ) ); buttonDownImage = QImage( Resource::loadImage( QString( "%1/skin%2_down" ).arg( skinPath ).arg( fileNameInfix ) ) ); 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 @@ -5,14 +5,16 @@ DESTDIR = $(OPIEDIR)/bin HEADERS = playlistselection.h mediaplayerstate.h xinecontrol.h \ videowidget.h audiowidget.h playlistwidget.h om3u.h mediaplayer.h inputDialog.h \ frame.h lib.h xinevideowidget.h volumecontrol.h playlistwidgetgui.h\ - alphablend.h yuv2rgb.h threadutil.h mediawidget.h playlistview.h playlistfileview.h + alphablend.h yuv2rgb.h threadutil.h mediawidget.h playlistview.h playlistfileview.h \ + skin.h SOURCES = main.cpp \ playlistselection.cpp mediaplayerstate.cpp xinecontrol.cpp \ videowidget.cpp audiowidget.cpp playlistwidget.cpp om3u.cpp mediaplayer.cpp inputDialog.cpp \ frame.cpp lib.cpp nullvideo.c xinevideowidget.cpp volumecontrol.cpp \ playlistwidgetgui.cpp\ alphablend.c yuv2rgb.c yuv2rgb_arm.c yuv2rgb_arm4l.S \ - threadutil.cpp mediawidget.cpp playlistview.cpp playlistfileview.cpp + threadutil.cpp mediawidget.cpp playlistview.cpp playlistfileview.cpp \ + skin.cpp TARGET = opieplayer2 INCLUDEPATH += $(OPIEDIR)/include DEPENDPATH += $(OPIEDIR)/include 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 @@ + +#include "skin.h" + +#include + +Skin::Skin( const QString &name, const QString &fileNameInfix ) + : m_name( name ), m_fileNameInfix( fileNameInfix ) +{ + m_skinPath = "opieplayer2/skins/" + name; +} + +QImage Skin::backgroundImage() const +{ + return QImage( Resource::findPixmap( QString( "%1/background" ).arg( m_skinPath ) ) ); +} + +/* vim: et sw=4 ts=4 + */ 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 @@ +#ifndef SKIN_H +#define SKIN_H + +#include +#include + +class Skin +{ +public: + Skin( const QString &name, const QString &fileNameInfix ); + + QImage backgroundImage() const; + +private: + QString m_name; + QString m_fileNameInfix; + QString m_skinPath; +}; + +#endif // SKIN_H +/* vim: et sw=4 ts=4 + */ -- cgit v0.9.0.2