summaryrefslogtreecommitdiff
path: root/src/gui/skin.h
diff options
context:
space:
mode:
authorBertram <bertram@cegetel.net>2010-03-03 23:38:18 +0100
committerBertram <bertram@cegetel.net>2010-03-03 23:38:18 +0100
commit1e52781e7d425cffcc6a5319b4cb5bf5eebe2ea9 (patch)
tree596305e9bfd4ad8448efd477a43f86490b1974c5 /src/gui/skin.h
parent8cc31b582f372238ce6bd2c86888d312cf1fe5b2 (diff)
parentf5f7a7d5990d1133f714b6cd431aecf6a332fbd5 (diff)
downloadmana-client-1e52781e7d425cffcc6a5319b4cb5bf5eebe2ea9.tar.gz
mana-client-1e52781e7d425cffcc6a5319b4cb5bf5eebe2ea9.tar.bz2
mana-client-1e52781e7d425cffcc6a5319b4cb5bf5eebe2ea9.tar.xz
mana-client-1e52781e7d425cffcc6a5319b4cb5bf5eebe2ea9.zip
Merge branch 'master' of gitorious.org:mana/mana
Diffstat (limited to 'src/gui/skin.h')
-rw-r--r--src/gui/skin.h19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/gui/skin.h b/src/gui/skin.h
index 15d55972..091d3001 100644
--- a/src/gui/skin.h
+++ b/src/gui/skin.h
@@ -31,6 +31,7 @@
class ConfigListener;
class Image;
+class ImageSet;
class Skin
{
@@ -101,11 +102,24 @@ class SkinLoader
static SkinLoader *instance();
static void deleteInstance();
+ static void prepareThemePath();
+ static std::string getThemePath() { return mThemePath; }
+
+ /**
+ * Returns the patch to the given gui resource relative to the theme
+ * or, if it isn't in the theme, relative to 'graphics/gui'.
+ */
+ static std::string resolveThemePath(const std::string &path);
+
+ static Image *getImageFromTheme(const std::string &path);
+ static ImageSet *getImageSetFromTheme(const std::string &path,
+ int w, int h);
+
/**
* Loads a skin.
*/
Skin *load(const std::string &filename,
- const std::string &defaultPath);
+ const std::string &defaultPath = getThemePath());
/**
* Updates the alpha values of all of the skins.
@@ -141,8 +155,11 @@ class SkinLoader
*/
ConfigListener *mSkinConfigListener;
+ static std::string mThemePath;
static SkinLoader *mInstance;
+ static bool tryThemePath(std::string themePath);
+
/**
* Tells if the current skins opacity
* should not get less than the given value