summaryrefslogtreecommitdiff
path: root/core/multimedia/opieplayer/videowidget.cpp
Side-by-side diff
Diffstat (limited to 'core/multimedia/opieplayer/videowidget.cpp') (more/less context) (show whitespace changes)
-rw-r--r--core/multimedia/opieplayer/videowidget.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/core/multimedia/opieplayer/videowidget.cpp b/core/multimedia/opieplayer/videowidget.cpp
index c545511..89dd89e 100644
--- a/core/multimedia/opieplayer/videowidget.cpp
+++ b/core/multimedia/opieplayer/videowidget.cpp
@@ -1,55 +1,56 @@
/**********************************************************************
** Copyright (C) 2000 Trolltech AS. All rights reserved.
**
** This file is part of Qtopia Environment.
**
** This file may be distributed and/or modified under the terms of the
** GNU General Public License version 2 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
** See http://www.trolltech.com/gpl/ for GPL licensing information.
**
** Contact info@trolltech.com if any conditions of this licensing are
** not clear to you.
**
**********************************************************************/
#include "videowidget.h"
#include "mediaplayerstate.h"
/* OPIE */
-#include <qpe/resource.h>
#include <qpe/mediaplayerplugininterface.h>
#include <qpe/config.h>
#include <qpe/qpeapplication.h>
#include <opie2/odebug.h>
+#include <opie2/oresource.h>
/* QT */
+#include <qbitmap.h>
#include <qdir.h>
#include <qslider.h>
#ifdef Q_WS_QWS
# define USE_DIRECT_PAINTER
# include <qdirectpainter_qws.h>
# include <qgfxraster_qws.h>
#endif
extern MediaPlayerState *mediaPlayerState;
static const int xo = 2; // movable x offset
static const int yo = 0; // movable y offset
struct MediaButton {
// int xPos, yPos;
bool isToggle, isHeld, isDown;
// int controlType;
};
@@ -69,51 +70,51 @@ MediaButton videoButtons[] = {
const char *skinV_mask_file_names[7] = {
"stop","play","back","fwd","up","down","full"
};
static const int numVButtons = (sizeof(videoButtons)/sizeof(MediaButton));
VideoWidget::VideoWidget(QWidget* parent, const char* name, WFlags f) :
QWidget( parent, name, f ), scaledWidth( 0 ), scaledHeight( 0 )
{
setCaption( tr("OpiePlayer") );
Config cfg("OpiePlayer");
cfg.setGroup("Options");
skin = cfg.readEntry("Skin","default");
QString skinPath;
skinPath = "opieplayer2/skins/" + skin;
if(!QDir(QString(getenv("OPIEDIR")) +"/pics/"+skinPath).exists())
skinPath = "opieplayer2/skins/default";
// QString skinPath = "opieplayer2/skins/" + skin;
- pixBg = new QPixmap( Resource::loadPixmap( QString("%1/background").arg(skinPath) ) );
- imgUp = new QImage( Resource::loadImage( QString("%1/skinV_up").arg(skinPath) ) );
- imgDn = new QImage( Resource::loadImage( QString("%1/skinV_down").arg(skinPath) ) );
+ pixBg = new QPixmap( Opie::Core::OResource::loadPixmap( QString("%1/background").arg(skinPath) ) );
+ imgUp = new QImage( Opie::Core::OResource::loadImage( QString("%1/skinV_up").arg(skinPath) ) );
+ imgDn = new QImage( Opie::Core::OResource::loadImage( QString("%1/skinV_down").arg(skinPath) ) );
imgButtonMask = new QImage( imgUp->width(), imgUp->height(), 8, 255 );
imgButtonMask->fill( 0 );
for ( int i = 0; i < 7; i++ ) {
QString filename = QString( QPEApplication::qpeDir() + "pics/" + skinPath +
"/skinV_mask_" + skinV_mask_file_names[i] + ".png" );
// odebug << "loading "+filename << oendl;
masks[i] = new QBitmap( filename );
if ( !masks[i]->isNull() ) {
QImage imgMask = masks[i]->convertToImage();
uchar **dest = imgButtonMask->jumpTable();
for ( int y = 0; y < imgUp->height(); y++ ) {
uchar *line = dest[y];
for ( int x = 0; x < imgUp->width(); x++ ) {
if ( !qRed( imgMask.pixel( x, y ) ) )
line[x] = i + 1;
}
}
}
}
for ( int i = 0; i < 7; i++ ) {
buttonPixUp[i] = NULL;