
Positions and sizes of the numbers are now correct NumberDisplay now unused -> removed renamed file to lowercase and moved to subdir mainwindow
271 lines
5.5 KiB
C++
271 lines
5.5 KiB
C++
/**
|
|
* This file is a part of Promoe, an XMMS2 Client.
|
|
*
|
|
* Copyright (C) 2005-2008 XMMS2 Team
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License as published by
|
|
* the Free Software Foundation; version 2 of the License.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*/
|
|
|
|
#ifndef __SKIN_H__
|
|
#define __SKIN_H__
|
|
|
|
#include <QObject>
|
|
#include <QList>
|
|
#include <QMap>
|
|
|
|
#include <QSize>
|
|
#include <QPoint>
|
|
#include <QIcon>
|
|
#include <QPixmap>
|
|
|
|
class QDir;
|
|
|
|
typedef QList <QPixmap> QPixmapList;
|
|
typedef QMap <int, QPixmap> PixmapMap;
|
|
|
|
class Skin : public QObject
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
static Skin *getInstance (void);
|
|
|
|
void setSkin (const QString& name);
|
|
static QPixmap getPixmap (const QString&, QDir);
|
|
|
|
const QSize getSize (uint item) const { return m_sizes[item]; };
|
|
const QPoint getPos (uint item) const { return m_positions[item]; };
|
|
const QIcon getIcon (uint item) const { return m_icons.value(item); };
|
|
const QPixmapList getBackgrounds (uint item) const
|
|
{ return m_backgrounds.value(item); };
|
|
const PixmapMap getNumbers () const { return m_numbers; }
|
|
|
|
const QPixmap getItem (uint part) const { return m_items[part]; }
|
|
const QPixmap getPls (uint part) const { return m_playlist[part]; }
|
|
const QPixmap getLetter (uint c) const { return m_letterMap[c]; }
|
|
const QPixmap getNumber (uint c) const { return m_numbers[c]; }
|
|
uint getNumberSize () { return m_numbers.size(); }
|
|
const QByteArray getPLeditValue (QByteArray c) const { return m_pledit_txt[c]; }
|
|
|
|
enum Part {
|
|
/* Mainwindow buttons */
|
|
BUTTON_MW_MENU,
|
|
BUTTON_MW_MINIMIZE,
|
|
BUTTON_MW_CLOSE,
|
|
BUTTON_MW_SHADE,
|
|
BUTTON_MW_PREV,
|
|
BUTTON_MW_PLAY,
|
|
BUTTON_MW_PAUSE,
|
|
BUTTON_MW_STOP,
|
|
BUTTON_MW_NEXT,
|
|
BUTTON_MW_EJECT,
|
|
BUTTON_MW_EQ,
|
|
BUTTON_MW_PLS,
|
|
BUTTON_MW_SHUFFLE,
|
|
BUTTON_MW_REPEAT,
|
|
/* Mainwindow buttons shaded */
|
|
BUTTON_MW_SHADED_UNSHADE,
|
|
/* Equalizer buttons */
|
|
BUTTON_EQ_CLOSE,
|
|
BUTTON_EQ_SHADE,
|
|
BUTTON_EQ_ACTIVE,
|
|
BUTTON_EQ_AUTO,
|
|
BUTTON_EQ_PRESET,
|
|
/* Equalizer buttons shaded */
|
|
BUTTON_EQ_SHADED_CLOSE,
|
|
BUTTON_EQ_SHADED_UNSHADE,
|
|
/* Playlist buttons */
|
|
BUTTON_PLS_CLOSE,
|
|
BUTTON_PLS_SHADE,
|
|
/* Playlist buttons shaded */
|
|
BUTTON_PLS_SHADED_UNSHADE,
|
|
/* Sliders */
|
|
SLIDER_POSBAR,
|
|
SLIDER_POSBAR_BGS,
|
|
SLIDER_VOLUMEBAR,
|
|
SLIDER_VOLUMEBAR_BGS,
|
|
SLIDER_BALANCEBAR,
|
|
SLIDER_BALANCEBAR_BGS,
|
|
SLIDER_EQUALIZER,
|
|
SLIDER_EQUALIZER_BGS,
|
|
// };
|
|
//
|
|
// enum Part { // Old and not yet sorted enum
|
|
NONE,
|
|
MAIN_WINDOW,
|
|
ABOUT_0,
|
|
ABOUT_1,
|
|
MONO_0,
|
|
MONO_1,
|
|
STEREO_0,
|
|
STEREO_1,
|
|
TITLEBAR_0,
|
|
TITLEBAR_1,
|
|
STATUSBAR_0,
|
|
STATUSBAR_1,
|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void);
|
|
void BuildButtons (void);
|
|
void BuildToggleButtons (void);
|
|
void BuildTitleBar (void);
|
|
void BuildSliders (void);
|
|
void BuildOther (void);
|
|
void BuildNumbers (void);
|
|
void BuildPlaylist (void);
|
|
void ParsePLEdit (void);
|
|
void BuildEqualizer (void);
|
|
|
|
|
|
QString m_skinname;
|
|
QString m_path;
|
|
|
|
QList<QPoint> m_positions;
|
|
QList<QSize> m_sizes;
|
|
|
|
QMap<uint, QIcon> m_icons;
|
|
QMap<uint, QPixmapList> m_backgrounds;
|
|
|
|
QMap<int, QPixmap> m_numbers;
|
|
QMap<uint, QPixmap> m_items;
|
|
QMap<uint, QPixmap> m_letterMap;
|
|
QMap<uint, QPixmap> m_playlist;
|
|
|
|
QMap<QByteArray, QByteArray> m_pledit_txt;
|
|
|
|
signals:
|
|
void skinChanged (Skin *skin);
|
|
};
|
|
|
|
#endif
|