diff options
author | Ira Rice <irarice@gmail.com> | 2009-03-10 17:33:32 -0600 |
---|---|---|
committer | Ira Rice <irarice@gmail.com> | 2009-03-10 17:33:32 -0600 |
commit | 265172dc1e7b97611c485752dc10345545c4e296 (patch) | |
tree | 6ab80d8fde1593ae5b137cebc8578a269781d4c2 /src/gui/window.h | |
parent | 43eca19b045f30c6456dd936b2baddff945cc047 (diff) | |
download | mana-265172dc1e7b97611c485752dc10345545c4e296.tar.gz mana-265172dc1e7b97611c485752dc10345545c4e296.tar.bz2 mana-265172dc1e7b97611c485752dc10345545c4e296.tar.xz mana-265172dc1e7b97611c485752dc10345545c4e296.zip |
Introduced in a Skin holder class, to reduce the amount of needed XML
skin loads.
Signed-off-by: Ira Rice <irarice@gmail.com>
Diffstat (limited to 'src/gui/window.h')
-rw-r--r-- | src/gui/window.h | 35 |
1 files changed, 32 insertions, 3 deletions
diff --git a/src/gui/window.h b/src/gui/window.h index 4fc6c862..c5660c58 100644 --- a/src/gui/window.h +++ b/src/gui/window.h @@ -23,6 +23,8 @@ #ifndef WINDOW_H #define WINDOW_H +#include <map> + #include <guichan/widgetlistener.hpp> #include <guichan/widgets/window.hpp> @@ -39,6 +41,18 @@ class LayoutCell; class ResizeGrip; class WindowContainer; +class Skin +{ + public: + Skin(); + ~Skin(); + + std::string mName; /**< Name of the skin to use */ + ImageRect border; /**< The window border and background */ + Image *closeImage; /**< Close Button Image */ + int instances; +}; + /** * A window. This window can be dragged around and has a title bar. Windows are * invisible by default. @@ -297,7 +311,23 @@ class Window : public gcn::Window, gcn::WidgetListener */ ContainerPlacer getPlacer(int x, int y); + /** + * Overrideable functionality for when the window is to close. This + * allows for class implementations to clean up or do certain actions + * on window close they couldn't do otherwise. + */ virtual void close(); + + /** + * Map containing all window skins + */ + typedef std::map<std::string, Skin*> Skins; + + /** + * Iterator for window skins + */ + typedef Skins::iterator SkinIterator; + protected: /** The window container windows add themselves to. */ @@ -341,7 +371,6 @@ class Window : public gcn::Window, gcn::WidgetListener int mDefaultY; /**< Default window Y position */ int mDefaultWidth; /**< Default window width */ int mDefaultHeight; /**< Default window height */ - std::string mSkin; /**< Name of the skin to use */ /** * The config listener that listens to changes relevant to all windows. @@ -350,8 +379,8 @@ class Window : public gcn::Window, gcn::WidgetListener static int mouseResize; /**< Active resize handles */ static int instances; /**< Number of Window instances */ - ImageRect border; /**< The window border and background */ - static Image *closeImage; /**< Close Button Image */ + + Skin* mSkin; /**< Skin in use by this window */ /** * The width of the resize border. Is independent of the actual window |