summaryrefslogtreecommitdiff
path: root/src/gui/theme.h
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-07-30 02:53:13 +0300
committerAndrei Karas <akaras@inbox.ru>2012-07-30 22:00:10 +0300
commit793bcbe5d8308c8c33419f67378df9dc83462445 (patch)
treead03064158e791e4831c5f67e174babeba66a1f7 /src/gui/theme.h
parent03d04b42b9578616715a4483b0ef581f1fb11fd8 (diff)
downloadmanaverse-793bcbe5d8308c8c33419f67378df9dc83462445.tar.gz
manaverse-793bcbe5d8308c8c33419f67378df9dc83462445.tar.bz2
manaverse-793bcbe5d8308c8c33419f67378df9dc83462445.tar.xz
manaverse-793bcbe5d8308c8c33419f67378df9dc83462445.zip
Add addition options to skin objects.
Diffstat (limited to 'src/gui/theme.h')
-rw-r--r--src/gui/theme.h23
1 files changed, 18 insertions, 5 deletions
diff --git a/src/gui/theme.h b/src/gui/theme.h
index 1cf8d9aa6..69a08bff0 100644
--- a/src/gui/theme.h
+++ b/src/gui/theme.h
@@ -42,9 +42,10 @@ class ProgressBar;
class Skin
{
public:
- Skin(ImageRect skin, Image *close, Image *stickyUp, Image *stickyDown,
- const std::string &filePath, const std::string &name = "",
- int padding = 3, int titlePadding = 4);
+ Skin(ImageRect skin, ImageRect images, const std::string &filePath,
+ const std::string &name = "", int padding = 3,
+ int titlePadding = 4,
+ std::map<std::string, int> *options = nullptr);
~Skin();
@@ -101,6 +102,14 @@ class Skin
int getTitlePadding() const
{ return mTitlePadding; }
+ int getOption(std::string name)
+ {
+ if (mOptions->find(name) != mOptions->end())
+ return (*mOptions)[name];
+ else
+ return 0;
+ }
+
int instances;
private:
@@ -112,6 +121,7 @@ class Skin
Image *mStickyImageDown; /**< Sticky Button Image */
int mPadding;
int mTitlePadding;
+ std::map<std::string, int> *mOptions;
};
class Theme : public Palette, public ConfigListener
@@ -249,9 +259,12 @@ class Theme : public Palette, public ConfigListener
/**
* Loads a skin.
*/
- Skin *load(const std::string &filename,
+ Skin *load(const std::string &filename, bool full = true,
const std::string &defaultPath = getThemePath());
+ Skin *loadSkinRect(ImageRect &image, std::string name,
+ int start = 0, int end = 8);
+
void unload(Skin *skin);
/**
@@ -284,7 +297,7 @@ class Theme : public Palette, public ConfigListener
Theme();
~Theme();
- Skin *readSkin(const std::string &filename0);
+ Skin *readSkin(const std::string &filename0, bool full);
// Map containing all window skins
typedef std::map<std::string, Skin*> Skins;