summaryrefslogtreecommitdiff
path: root/src/gui/skin.h
diff options
context:
space:
mode:
authorIra Rice <irarice@gmail.com>2009-03-11 21:38:17 -0600
committerIra Rice <irarice@gmail.com>2009-03-11 21:38:17 -0600
commitc410a861fddc7829408d687e61c67c6101555067 (patch)
treec97f3ddaab9184b00d8e91cc65b759bcc719ff41 /src/gui/skin.h
parent1e2fbea2e6d4ab319763c6ffb35e4e4acdd4d5f5 (diff)
downloadmana-c410a861fddc7829408d687e61c67c6101555067.tar.gz
mana-c410a861fddc7829408d687e61c67c6101555067.tar.bz2
mana-c410a861fddc7829408d687e61c67c6101555067.tar.xz
mana-c410a861fddc7829408d687e61c67c6101555067.zip
Modified Skin class to use proper encapsulation, instead of leaving its
skin variables public. Signed-off-by: Ira Rice <irarice@gmail.com>
Diffstat (limited to 'src/gui/skin.h')
-rw-r--r--src/gui/skin.h40
1 files changed, 37 insertions, 3 deletions
diff --git a/src/gui/skin.h b/src/gui/skin.h
index 6dddb4a8..b7e70330 100644
--- a/src/gui/skin.h
+++ b/src/gui/skin.h
@@ -32,13 +32,47 @@ class Image;
class Skin
{
public:
- Skin();
+ Skin(ImageRect skin, Image* close, std::string name = "");
~Skin();
+ /**
+ * Returns the skin's name. Useful for giving a human friendly skin
+ * name if a dialog for skin selection for a specific window type is
+ * done.
+ */
+ std::string getName() { return mName; }
+
+ /**
+ * Returns the background skin.
+ */
+ ImageRect getBorder() { return border; }
+
+ /**
+ * Returns the image used by a close button for this skin.
+ */
+ Image* getCloseImage() { return closeImage; }
+
+ /**
+ * Returns the number of instances which use this skin.
+ */
+ int getNumberOfInstances() { return instances; }
+
+ /**
+ * Returns the minimum width which can be used with this skin.
+ */
+ int getMinWidth();
+
+ /**
+ * Returns the minimum height which can be used with this skin.
+ */
+ int getMinHeight();
+
+ int instances;
+
+ private:
std::string mName; /**< Name of the skin to use */
ImageRect border; /**< The window border and background */
Image *closeImage; /**< Close Button Image */
- int instances;
};
// Map containing all window skins
@@ -47,7 +81,7 @@ typedef std::map<std::string, Skin*> Skins;
// Iterator for window skins
typedef Skins::iterator SkinIterator;
-class SkinLoader
+class SkinLoader
{
public:
SkinLoader();