diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2009-04-15 22:55:02 +0200 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2009-04-15 22:55:02 +0200 |
commit | ddd7f8acbbfbe7cf2787279babdb5c1279c7fd73 (patch) | |
tree | b803ae0a601e46cfa0539f79f76c731dc28652f2 /src/gui/skin.cpp | |
parent | 2a3f16f5673e6482e422a65f6f23f958dd78955f (diff) | |
download | mana-ddd7f8acbbfbe7cf2787279babdb5c1279c7fd73.tar.gz mana-ddd7f8acbbfbe7cf2787279babdb5c1279c7fd73.tar.bz2 mana-ddd7f8acbbfbe7cf2787279babdb5c1279c7fd73.tar.xz mana-ddd7f8acbbfbe7cf2787279babdb5c1279c7fd73.zip |
Made the PopupMenu a Popup subclass
It's a natural better fit. The SkinLoader was changed into a singleton,
since it's used by both Window and Popup classes.
Diffstat (limited to 'src/gui/skin.cpp')
-rw-r--r-- | src/gui/skin.cpp | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/gui/skin.cpp b/src/gui/skin.cpp index 6fcbb0e2..b1665f59 100644 --- a/src/gui/skin.cpp +++ b/src/gui/skin.cpp @@ -36,7 +36,7 @@ #include <algorithm> -SkinLoader *skinLoader = 0; +SkinLoader *SkinLoader::mInstance = 0; class SkinConfigListener : public ConfigListener @@ -113,7 +113,6 @@ int Skin::getMinHeight() const mBorder.grid[ImageRect::LOWER_LEFT]->getHeight(); } - SkinLoader::SkinLoader() : mSkinConfigListener(new SkinConfigListener(this)) { @@ -125,6 +124,20 @@ SkinLoader::~SkinLoader() delete mSkinConfigListener; } +SkinLoader *SkinLoader::instance() +{ + if (!mInstance) + mInstance = new SkinLoader; + + return mInstance; +} + +void SkinLoader::deleteInstance() +{ + delete mInstance; + mInstance = 0; +} + Skin *SkinLoader::load(const std::string &filename, const std::string &defaultPath) { |