summaryrefslogtreecommitdiff
path: root/src/gui/skin.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/skin.h')
-rw-r--r--src/gui/skin.h29
1 files changed, 27 insertions, 2 deletions
diff --git a/src/gui/skin.h b/src/gui/skin.h
index 21bd84f2..1a603e29 100644
--- a/src/gui/skin.h
+++ b/src/gui/skin.h
@@ -27,12 +27,14 @@
#include "../graphics.h"
+class ConfigListener;
class Image;
class Skin
{
public:
- Skin(ImageRect skin, Image* close, std::string name = "");
+ Skin(ImageRect skin, Image* close, std::string filePath,
+ std::string name = "");
~Skin();
/**
@@ -43,6 +45,11 @@ class Skin
std::string getName() { return mName; }
/**
+ * Returns the skin's xml file path.
+ */
+ std::string getFilePath() { return mFilePath; }
+
+ /**
* Returns the background skin.
*/
ImageRect getBorder() { return border; }
@@ -67,9 +74,15 @@ class Skin
*/
int getMinHeight() const;
+ /**
+ * Updates the alpha value of the skin
+ */
+ void updateAlpha();
+
int instances;
private:
+ std::string mFilePath; /**< File name path for the skin */
std::string mName; /**< Name of the skin to use */
ImageRect border; /**< The window border and background */
Image *closeImage; /**< Close Button Image */
@@ -84,16 +97,28 @@ typedef Skins::iterator SkinIterator;
class SkinLoader
{
public:
+ friend class SkinConfigListener;
+
SkinLoader();
~SkinLoader();
/**
* Loads a skin
*/
- Skin* load(const std::string &filename);
+ Skin* load(const std::string &filename, const std::string &defaultPath);
+
+ /**
+ * Updates the alpha values of all of the skins
+ */
+ void updateAlpha();
private:
Skins mSkins;
+
+ /**
+ * The config listener that listens to changes relevant to all skins.
+ */
+ static ConfigListener *skinConfigListener;
};
extern SkinLoader* skinLoader;