summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/gui/skin.cpp14
-rw-r--r--src/gui/skin.h26
2 files changed, 23 insertions, 17 deletions
diff --git a/src/gui/skin.cpp b/src/gui/skin.cpp
index 0d62fea5..b16bdfe6 100644
--- a/src/gui/skin.cpp
+++ b/src/gui/skin.cpp
@@ -1,8 +1,9 @@
/*
- * Aethyra
+ * Gui Skinning
+ * Copyright (C) 2008 The Legend of Mazzeroth Development Team
* Copyright (C) 2009 Aethyra Development Team
*
- * This file is part of Aethyra.
+ * This file is part of The Mana World.
*
* 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
@@ -46,7 +47,9 @@ class SkinConfigListener : public ConfigListener
}
};
-Skin::Skin(ImageRect skin, Image *close, std::string filePath, std::string name):
+Skin::Skin(ImageRect skin, Image *close,
+ const std::string &filePath,
+ const std::string &name):
instances(0),
mFilePath(filePath),
mName(name),
@@ -225,10 +228,9 @@ Skin *SkinLoader::load(const std::string &filename,
return skin;
}
-SkinLoader::SkinLoader() :
- mSkins()
+SkinLoader::SkinLoader()
{
- skinConfigListener = new SkinConfigListener();
+ skinConfigListener = new SkinConfigListener;
// Send GUI alpha changed for initialization
skinConfigListener->optionChanged("guialpha");
config.addListener("guialpha", skinConfigListener);
diff --git a/src/gui/skin.h b/src/gui/skin.h
index 1a603e29..df905b05 100644
--- a/src/gui/skin.h
+++ b/src/gui/skin.h
@@ -1,8 +1,9 @@
/*
- * Aethyra
+ * Gui Skinning
+ * Copyright (C) 2008 The Legend of Mazzeroth Development Team
* Copyright (C) 2009 Aethyra Development Team
*
- * This file is part of Aethyra.
+ * This file is part of The Mana World.
*
* 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
@@ -33,8 +34,10 @@ class Image;
class Skin
{
public:
- Skin(ImageRect skin, Image* close, std::string filePath,
- std::string name = "");
+ Skin(ImageRect skin, Image *close,
+ const std::string &filePath,
+ const std::string &name = "");
+
~Skin();
/**
@@ -42,27 +45,27 @@ class Skin
* name if a dialog for skin selection for a specific window type is
* done.
*/
- std::string getName() { return mName; }
+ std::string getName() const { return mName; }
/**
* Returns the skin's xml file path.
*/
- std::string getFilePath() { return mFilePath; }
+ std::string getFilePath() const { return mFilePath; }
/**
* Returns the background skin.
*/
- ImageRect getBorder() { return border; }
+ ImageRect getBorder() const { return border; }
/**
* Returns the image used by a close button for this skin.
*/
- Image* getCloseImage() { return closeImage; }
+ Image *getCloseImage() const { return closeImage; }
/**
* Returns the number of instances which use this skin.
*/
- int getNumberOfInstances() { return instances; }
+ int getNumberOfInstances() const { return instances; }
/**
* Returns the minimum width which can be used with this skin.
@@ -105,7 +108,8 @@ class SkinLoader
/**
* Loads a skin
*/
- Skin* load(const std::string &filename, const std::string &defaultPath);
+ Skin *load(const std::string &filename,
+ const std::string &defaultPath);
/**
* Updates the alpha values of all of the skins
@@ -121,6 +125,6 @@ class SkinLoader
static ConfigListener *skinConfigListener;
};
-extern SkinLoader* skinLoader;
+extern SkinLoader *skinLoader;
#endif