summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-05-14 01:24:44 +0300
committerAndrei Karas <akaras@inbox.ru>2014-05-14 01:24:44 +0300
commiteea8d5e39b746b240a4720c4f48de91ec81c8563 (patch)
treec3524bb67524431d3a710bd0aae2cf9fccf178dd
parent95445bb5a7fa0c61e489d2f518cd3ebfd35c4fba (diff)
downloadmanaverse-eea8d5e39b746b240a4720c4f48de91ec81c8563.tar.gz
manaverse-eea8d5e39b746b240a4720c4f48de91ec81c8563.tar.bz2
manaverse-eea8d5e39b746b240a4720c4f48de91ec81c8563.tar.xz
manaverse-eea8d5e39b746b240a4720c4f48de91ec81c8563.zip
Move skin into separate file.
-rw-r--r--src/CMakeLists.txt2
-rw-r--r--src/Makefile.am2
-rw-r--r--src/client.cpp1
-rw-r--r--src/gui/popups/speechbubble.cpp1
-rw-r--r--src/gui/skin.cpp148
-rw-r--r--src/gui/skin.h136
-rw-r--r--src/gui/theme.cpp115
-rw-r--r--src/gui/theme.h101
-rw-r--r--src/gui/widgets/avatarlistbox.cpp1
-rw-r--r--src/gui/widgets/browserbox.cpp1
-rw-r--r--src/gui/widgets/button.cpp1
-rw-r--r--src/gui/widgets/checkbox.cpp1
-rw-r--r--src/gui/widgets/colorpage.cpp1
-rw-r--r--src/gui/widgets/desktop.cpp2
-rw-r--r--src/gui/widgets/dropdown.cpp7
-rw-r--r--src/gui/widgets/extendedlistbox.cpp1
-rw-r--r--src/gui/widgets/itemcontainer.cpp1
-rw-r--r--src/gui/widgets/label.cpp1
-rw-r--r--src/gui/widgets/listbox.cpp1
-rw-r--r--src/gui/widgets/passwordfield.cpp2
-rw-r--r--src/gui/widgets/playerbox.cpp1
-rw-r--r--src/gui/widgets/popup.cpp1
-rw-r--r--src/gui/widgets/progressbar.cpp1
-rw-r--r--src/gui/widgets/radiobutton.cpp1
-rw-r--r--src/gui/widgets/scrollarea.cpp1
-rw-r--r--src/gui/widgets/tabs/tab.cpp1
-rw-r--r--src/gui/widgets/textfield.cpp1
-rw-r--r--src/gui/widgets/textpreview.cpp1
-rw-r--r--src/gui/widgets/window.cpp1
-rw-r--r--src/gui/windowmenu.cpp1
-rw-r--r--src/gui/windows/chatwindow.cpp1
-rw-r--r--src/gui/windows/ministatuswindow.cpp1
-rw-r--r--src/gui/windows/skilldialog.cpp1
-rw-r--r--src/touchmanager.cpp1
34 files changed, 324 insertions, 216 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 3e3873c7e..3773dc41f 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -403,6 +403,8 @@ SET(SRCS
gui/windows/textdialog.h
gui/popups/textpopup.cpp
gui/popups/textpopup.h
+ gui/skin.cpp
+ gui/skin.h
gui/theme.cpp
gui/theme.h
gui/windows/tradewindow.cpp
diff --git a/src/Makefile.am b/src/Makefile.am
index 193cca732..14f9e4b14 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -489,6 +489,8 @@ manaplus_SOURCES += gui/widgets/avatarlistbox.cpp \
gui/windows/textdialog.h \
gui/popups/textpopup.cpp \
gui/popups/textpopup.h \
+ gui/skin.cpp \
+ gui/skin.h \
gui/theme.cpp \
gui/theme.h \
gui/windows/tradewindow.cpp \
diff --git a/src/client.cpp b/src/client.cpp
index f3d8371f4..4469c1efc 100644
--- a/src/client.cpp
+++ b/src/client.cpp
@@ -50,6 +50,7 @@
#include "input/keyboardconfig.h"
#include "gui/gui.h"
+#include "gui/skin.h"
#include "gui/theme.h"
#include "gui/windows/buyselldialog.h"
diff --git a/src/gui/popups/speechbubble.cpp b/src/gui/popups/speechbubble.cpp
index 3d0250a78..44699499f 100644
--- a/src/gui/popups/speechbubble.cpp
+++ b/src/gui/popups/speechbubble.cpp
@@ -25,6 +25,7 @@
#include "gui/font.h"
#include "gui/gui.h"
+#include "gui/skin.h"
#include "gui/viewport.h"
#include "gui/widgets/browserbox.h"
diff --git a/src/gui/skin.cpp b/src/gui/skin.cpp
new file mode 100644
index 000000000..5f7ed2be2
--- /dev/null
+++ b/src/gui/skin.cpp
@@ -0,0 +1,148 @@
+/*
+ * Gui Skinning
+ * Copyright (C) 2008 The Legend of Mazzeroth Development Team
+ * Copyright (C) 2009 Aethyra Development Team
+ * Copyright (C) 2009 The Mana World Development Team
+ * Copyright (C) 2009-2010 The Mana Developers
+ * Copyright (C) 2011-2014 The ManaPlus Developers
+ *
+ * This file is part of The ManaPlus Client.
+ *
+ * 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "gui/skin.h"
+
+#include "client.h"
+
+#include "resources/image.h"
+
+#include "render/graphics.h"
+
+#include "utils/delete2.h"
+
+#include "debug.h"
+
+Skin::Skin(ImageRect *const restrict skin,
+ const ImageRect *const restrict images,
+ const std::string &filePath, const std::string &name,
+ const int padding, const int titlePadding,
+ std::map<std::string, int> *restrict const options):
+ instances(1),
+ mFilePath(filePath),
+ mName(name),
+ mBorder(skin),
+ mCloseImage(images->grid[0]),
+ mCloseImageHighlighted(images->grid[1]),
+ mStickyImageUp(images->grid[2]),
+ mStickyImageDown(images->grid[3]),
+ mPadding(padding),
+ mTitlePadding(titlePadding),
+ mOptions(options)
+{
+ if (!mCloseImageHighlighted)
+ {
+ mCloseImageHighlighted = mCloseImage;
+ if (mCloseImageHighlighted)
+ mCloseImageHighlighted->incRef();
+ }
+}
+
+Skin::~Skin()
+{
+ for (int i = 0; i < 9; i++)
+ {
+ if (mBorder && mBorder->grid[i])
+ {
+ mBorder->grid[i]->decRef();
+ mBorder->grid[i] = nullptr;
+ }
+ }
+
+ if (mCloseImage)
+ {
+ mCloseImage->decRef();
+ mCloseImage = nullptr;
+ }
+
+ if (mCloseImageHighlighted)
+ {
+ mCloseImageHighlighted->decRef();
+ mCloseImageHighlighted = nullptr;
+ }
+
+ if (mStickyImageUp)
+ {
+ mStickyImageUp->decRef();
+ mStickyImageUp = nullptr;
+ }
+
+ if (mStickyImageDown)
+ {
+ mStickyImageDown->decRef();
+ mStickyImageDown = nullptr;
+ }
+
+ delete2(mOptions);
+ delete2(mBorder);
+}
+
+void Skin::updateAlpha(const float minimumOpacityAllowed)
+{
+ const float alpha = static_cast<float>(
+ std::max(static_cast<double>(minimumOpacityAllowed),
+ static_cast<double>(client->getGuiAlpha())));
+
+ if (mBorder)
+ {
+ for (int i = 0; i < 9; i++)
+ {
+ if (mBorder->grid[i])
+ mBorder->grid[i]->setAlpha(alpha);
+ }
+ }
+
+ if (mCloseImage)
+ mCloseImage->setAlpha(alpha);
+ if (mCloseImageHighlighted)
+ mCloseImageHighlighted->setAlpha(alpha);
+ if (mStickyImageUp)
+ mStickyImageUp->setAlpha(alpha);
+ if (mStickyImageDown)
+ mStickyImageDown->setAlpha(alpha);
+}
+
+int Skin::getMinWidth() const
+{
+ if (!mBorder || !mBorder->grid[ImageRect::UPPER_LEFT]
+ || !mBorder->grid[ImageRect::UPPER_RIGHT])
+ {
+ return 1;
+ }
+
+ return mBorder->grid[ImageRect::UPPER_LEFT]->getWidth() +
+ mBorder->grid[ImageRect::UPPER_RIGHT]->getWidth();
+}
+
+int Skin::getMinHeight() const
+{
+ if (!mBorder || !mBorder->grid[ImageRect::UPPER_LEFT]
+ || !mBorder->grid[ImageRect::LOWER_LEFT])
+ {
+ return 1;
+ }
+
+ return mBorder->grid[ImageRect::UPPER_LEFT]->getHeight() +
+ mBorder->grid[ImageRect::LOWER_LEFT]->getHeight();
+}
diff --git a/src/gui/skin.h b/src/gui/skin.h
new file mode 100644
index 000000000..7cafd7601
--- /dev/null
+++ b/src/gui/skin.h
@@ -0,0 +1,136 @@
+/*
+ * Gui Skinning
+ * Copyright (C) 2008 The Legend of Mazzeroth Development Team
+ * Copyright (C) 2009 Aethyra Development Team
+ * Copyright (C) 2009 The Mana World Development Team
+ * Copyright (C) 2009-2010 The Mana Developers
+ * Copyright (C) 2011-2014 The ManaPlus Developers
+ *
+ * This file is part of The ManaPlus Client.
+ *
+ * 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef GUI_SKIN_H
+#define GUI_SKIN_H
+
+#include <map>
+#include <string>
+
+#include "localconsts.h"
+
+class Image;
+class ImageRect;
+
+class Skin final
+{
+ public:
+ Skin(ImageRect *const restrict skin,
+ const ImageRect *const restrict images,
+ const std::string &filePath,
+ const std::string &name = "",
+ const int padding = 3,
+ const int titlePadding = 4,
+ std::map<std::string, int> *restrict const options = nullptr);
+
+ A_DELETE_COPY(Skin)
+
+ ~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.
+ */
+ const std::string &getName() const A_WARN_UNUSED
+ { return mName; }
+
+ /**
+ * Returns the skin's xml file path.
+ */
+ const std::string &getFilePath() const A_WARN_UNUSED
+ { return mFilePath; }
+
+ /**
+ * Returns the background skin.
+ */
+ const ImageRect &getBorder() const A_WARN_UNUSED
+ { return *mBorder; }
+
+ /**
+ * Returns the image used by a close button for this skin.
+ */
+ const Image *getCloseImage(const bool state) const A_WARN_UNUSED
+ { return state ? mCloseImageHighlighted : mCloseImage; }
+
+ /**
+ * Returns the image used by a sticky button for this skin.
+ */
+ const Image *getStickyImage(const bool state) const A_WARN_UNUSED
+ { return state ? mStickyImageDown : mStickyImageUp; }
+
+ /**
+ * Returns the minimum width which can be used with this skin.
+ */
+ int getMinWidth() const A_WARN_UNUSED;
+
+ /**
+ * Returns the minimum height which can be used with this skin.
+ */
+ int getMinHeight() const A_WARN_UNUSED;
+
+ /**
+ * Updates the alpha value of the skin
+ */
+ void updateAlpha(const float minimumOpacityAllowed = 0.0F);
+
+ int getPadding() const A_WARN_UNUSED
+ { return mPadding; }
+
+ int getTitlePadding() const A_WARN_UNUSED
+ { return mTitlePadding; }
+
+ int getOption(const std::string &name) const A_WARN_UNUSED
+ {
+ if (mOptions->find(name) != mOptions->end())
+ return (*mOptions)[name];
+ else
+ return 0;
+ }
+
+ int getOption(const std::string &name,
+ const int def) const A_WARN_UNUSED
+ {
+ if (mOptions->find(name) != mOptions->end())
+ return (*mOptions)[name];
+ else
+ return def;
+ }
+
+ int instances;
+
+ private:
+ std::string mFilePath; /**< File name path for the skin */
+ std::string mName; /**< Name of the skin to use */
+ ImageRect *mBorder; /**< The window border and background */
+ Image *mCloseImage; /**< Close Button Image */
+ Image *mCloseImageHighlighted; /**< Highlighted close Button Image */
+ Image *mStickyImageUp; /**< Sticky Button Image */
+ Image *mStickyImageDown; /**< Sticky Button Image */
+ int mPadding;
+ int mTitlePadding;
+ std::map<std::string, int> *mOptions;
+};
+
+#endif // GUI_SKIN_H
diff --git a/src/gui/theme.cpp b/src/gui/theme.cpp
index b42f8c234..0b0744286 100644
--- a/src/gui/theme.cpp
+++ b/src/gui/theme.cpp
@@ -28,6 +28,8 @@
#include "configuration.h"
#include "graphicsmanager.h"
+#include "gui/skin.h"
+
#include "resources/dye.h"
#include "resources/image.h"
#include "resources/resourcemanager.h"
@@ -62,119 +64,6 @@ static void initDefaultThemePath()
defaultThemePath = "themes/";
}
-Skin::Skin(ImageRect *const restrict skin,
- const ImageRect *const restrict images,
- const std::string &filePath, const std::string &name,
- const int padding, const int titlePadding,
- std::map<std::string, int> *restrict const options):
- instances(1),
- mFilePath(filePath),
- mName(name),
- mBorder(skin),
- mCloseImage(images->grid[0]),
- mCloseImageHighlighted(images->grid[1]),
- mStickyImageUp(images->grid[2]),
- mStickyImageDown(images->grid[3]),
- mPadding(padding),
- mTitlePadding(titlePadding),
- mOptions(options)
-{
- if (!mCloseImageHighlighted)
- {
- mCloseImageHighlighted = mCloseImage;
- if (mCloseImageHighlighted)
- mCloseImageHighlighted->incRef();
- }
-}
-
-Skin::~Skin()
-{
- for (int i = 0; i < 9; i++)
- {
- if (mBorder && mBorder->grid[i])
- {
- mBorder->grid[i]->decRef();
- mBorder->grid[i] = nullptr;
- }
- }
-
- if (mCloseImage)
- {
- mCloseImage->decRef();
- mCloseImage = nullptr;
- }
-
- if (mCloseImageHighlighted)
- {
- mCloseImageHighlighted->decRef();
- mCloseImageHighlighted = nullptr;
- }
-
- if (mStickyImageUp)
- {
- mStickyImageUp->decRef();
- mStickyImageUp = nullptr;
- }
-
- if (mStickyImageDown)
- {
- mStickyImageDown->decRef();
- mStickyImageDown = nullptr;
- }
-
- delete2(mOptions);
- delete2(mBorder);
-}
-
-void Skin::updateAlpha(const float minimumOpacityAllowed)
-{
- const float alpha = static_cast<float>(
- std::max(static_cast<double>(minimumOpacityAllowed),
- static_cast<double>(client->getGuiAlpha())));
-
- if (mBorder)
- {
- for (int i = 0; i < 9; i++)
- {
- if (mBorder->grid[i])
- mBorder->grid[i]->setAlpha(alpha);
- }
- }
-
- if (mCloseImage)
- mCloseImage->setAlpha(alpha);
- if (mCloseImageHighlighted)
- mCloseImageHighlighted->setAlpha(alpha);
- if (mStickyImageUp)
- mStickyImageUp->setAlpha(alpha);
- if (mStickyImageDown)
- mStickyImageDown->setAlpha(alpha);
-}
-
-int Skin::getMinWidth() const
-{
- if (!mBorder || !mBorder->grid[ImageRect::UPPER_LEFT]
- || !mBorder->grid[ImageRect::UPPER_RIGHT])
- {
- return 1;
- }
-
- return mBorder->grid[ImageRect::UPPER_LEFT]->getWidth() +
- mBorder->grid[ImageRect::UPPER_RIGHT]->getWidth();
-}
-
-int Skin::getMinHeight() const
-{
- if (!mBorder || !mBorder->grid[ImageRect::UPPER_LEFT]
- || !mBorder->grid[ImageRect::LOWER_LEFT])
- {
- return 1;
- }
-
- return mBorder->grid[ImageRect::UPPER_LEFT]->getHeight() +
- mBorder->grid[ImageRect::LOWER_LEFT]->getHeight();
-}
-
Theme::Theme() :
Palette(THEME_COLORS_END * THEME_PALETTES),
mSkins(),
diff --git a/src/gui/theme.h b/src/gui/theme.h
index 023918cf0..cd2c8aa4d 100644
--- a/src/gui/theme.h
+++ b/src/gui/theme.h
@@ -40,6 +40,7 @@
class DyePalette;
class Image;
class ImageSet;
+class Skin;
class Theme;
const int THEME_PALETTES = 5;
@@ -79,106 +80,6 @@ struct ThemeInfo final
float guiAlpha;
};
-class Skin final
-{
- public:
- Skin(ImageRect *const restrict skin,
- const ImageRect *const restrict images,
- const std::string &filePath,
- const std::string &name = "",
- const int padding = 3,
- const int titlePadding = 4,
- std::map<std::string, int> *restrict const options = nullptr);
-
- A_DELETE_COPY(Skin)
-
- ~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.
- */
- const std::string &getName() const A_WARN_UNUSED
- { return mName; }
-
- /**
- * Returns the skin's xml file path.
- */
- const std::string &getFilePath() const A_WARN_UNUSED
- { return mFilePath; }
-
- /**
- * Returns the background skin.
- */
- const ImageRect &getBorder() const A_WARN_UNUSED
- { return *mBorder; }
-
- /**
- * Returns the image used by a close button for this skin.
- */
- const Image *getCloseImage(const bool state) const A_WARN_UNUSED
- { return state ? mCloseImageHighlighted : mCloseImage; }
-
- /**
- * Returns the image used by a sticky button for this skin.
- */
- const Image *getStickyImage(const bool state) const A_WARN_UNUSED
- { return state ? mStickyImageDown : mStickyImageUp; }
-
- /**
- * Returns the minimum width which can be used with this skin.
- */
- int getMinWidth() const A_WARN_UNUSED;
-
- /**
- * Returns the minimum height which can be used with this skin.
- */
- int getMinHeight() const A_WARN_UNUSED;
-
- /**
- * Updates the alpha value of the skin
- */
- void updateAlpha(const float minimumOpacityAllowed = 0.0F);
-
- int getPadding() const A_WARN_UNUSED
- { return mPadding; }
-
- int getTitlePadding() const A_WARN_UNUSED
- { return mTitlePadding; }
-
- int getOption(const std::string &name) const A_WARN_UNUSED
- {
- if (mOptions->find(name) != mOptions->end())
- return (*mOptions)[name];
- else
- return 0;
- }
-
- int getOption(const std::string &name,
- const int def) const A_WARN_UNUSED
- {
- if (mOptions->find(name) != mOptions->end())
- return (*mOptions)[name];
- else
- return def;
- }
-
- int instances;
-
- private:
- std::string mFilePath; /**< File name path for the skin */
- std::string mName; /**< Name of the skin to use */
- ImageRect *mBorder; /**< The window border and background */
- Image *mCloseImage; /**< Close Button Image */
- Image *mCloseImageHighlighted; /**< Highlighted close Button Image */
- Image *mStickyImageUp; /**< Sticky Button Image */
- Image *mStickyImageDown; /**< Sticky Button Image */
- int mPadding;
- int mTitlePadding;
- std::map<std::string, int> *mOptions;
-};
-
class Theme final : public Palette,
public ConfigListener
{
diff --git a/src/gui/widgets/avatarlistbox.cpp b/src/gui/widgets/avatarlistbox.cpp
index 130245801..19eb86f44 100644
--- a/src/gui/widgets/avatarlistbox.cpp
+++ b/src/gui/widgets/avatarlistbox.cpp
@@ -29,6 +29,7 @@
#include "gui/font.h"
#include "gui/gui.h"
+#include "gui/skin.h"
#include "gui/viewport.h"
#include "gui/models/avatarlistmodel.h"
diff --git a/src/gui/widgets/browserbox.cpp b/src/gui/widgets/browserbox.cpp
index 25b5444fc..30b06e266 100644
--- a/src/gui/widgets/browserbox.cpp
+++ b/src/gui/widgets/browserbox.cpp
@@ -27,6 +27,7 @@
#include "gui/font.h"
#include "gui/gui.h"
+#include "gui/skin.h"
#include "gui/widgets/linkhandler.h"
diff --git a/src/gui/widgets/button.cpp b/src/gui/widgets/button.cpp
index b1f41e23e..4c806b2b0 100644
--- a/src/gui/widgets/button.cpp
+++ b/src/gui/widgets/button.cpp
@@ -77,6 +77,7 @@
#include "gui/font.h"
#include "gui/gui.h"
+#include "gui/skin.h"
#include "gui/rect.h"
#include "utils/delete2.h"
diff --git a/src/gui/widgets/checkbox.cpp b/src/gui/widgets/checkbox.cpp
index 765ff13ec..253092539 100644
--- a/src/gui/widgets/checkbox.cpp
+++ b/src/gui/widgets/checkbox.cpp
@@ -73,6 +73,7 @@
#include "gui/font.h"
#include "gui/gui.h"
+#include "gui/skin.h"
#include "debug.h"
diff --git a/src/gui/widgets/colorpage.cpp b/src/gui/widgets/colorpage.cpp
index 501b3dea7..42d8f3016 100644
--- a/src/gui/widgets/colorpage.cpp
+++ b/src/gui/widgets/colorpage.cpp
@@ -23,6 +23,7 @@
#include "gui/models/colormodel.h"
#include "gui/font.h"
+#include "gui/skin.h"
#include "debug.h"
diff --git a/src/gui/widgets/desktop.cpp b/src/gui/widgets/desktop.cpp
index 3e77a65a5..a1158a59b 100644
--- a/src/gui/widgets/desktop.cpp
+++ b/src/gui/widgets/desktop.cpp
@@ -24,6 +24,8 @@
#include "configuration.h"
#include "main.h"
+#include "gui/skin.h"
+
#include "gui/widgets/browserbox.h"
#include "input/inputmanager.h"
diff --git a/src/gui/widgets/dropdown.cpp b/src/gui/widgets/dropdown.cpp
index 8b636c04d..8de0cdc77 100644
--- a/src/gui/widgets/dropdown.cpp
+++ b/src/gui/widgets/dropdown.cpp
@@ -28,15 +28,16 @@
#include "input/keydata.h"
+#include "gui/font.h"
+#include "gui/gui.h"
+#include "gui/skin.h"
+
#include "gui/models/extendedlistmodel.h"
#include "gui/widgets/popuplist.h"
#include "resources/image.h"
-#include "gui/font.h"
-#include "gui/gui.h"
-
#include <algorithm>
#include "debug.h"
diff --git a/src/gui/widgets/extendedlistbox.cpp b/src/gui/widgets/extendedlistbox.cpp
index 89bcc7485..ca58bf95b 100644
--- a/src/gui/widgets/extendedlistbox.cpp
+++ b/src/gui/widgets/extendedlistbox.cpp
@@ -23,6 +23,7 @@
#include "gui/models/extendedlistmodel.h"
#include "gui/font.h"
+#include "gui/skin.h"
#include "gui/models/listmodel.h"
diff --git a/src/gui/widgets/itemcontainer.cpp b/src/gui/widgets/itemcontainer.cpp
index 4a944c276..e9d9e09bf 100644
--- a/src/gui/widgets/itemcontainer.cpp
+++ b/src/gui/widgets/itemcontainer.cpp
@@ -31,6 +31,7 @@
#include "gui/font.h"
#include "gui/gui.h"
+#include "gui/skin.h"
#include "gui/viewport.h"
#include "gui/popups/itempopup.h"
diff --git a/src/gui/widgets/label.cpp b/src/gui/widgets/label.cpp
index c37308a1e..bfdcc3ffd 100644
--- a/src/gui/widgets/label.cpp
+++ b/src/gui/widgets/label.cpp
@@ -66,6 +66,7 @@
#include "gui/font.h"
#include "gui/gui.h"
+#include "gui/skin.h"
#include "debug.h"
diff --git a/src/gui/widgets/listbox.cpp b/src/gui/widgets/listbox.cpp
index 341204505..69d5d665f 100644
--- a/src/gui/widgets/listbox.cpp
+++ b/src/gui/widgets/listbox.cpp
@@ -74,6 +74,7 @@
#include "gui/focushandler.h"
#include "gui/font.h"
#include "gui/gui.h"
+#include "gui/skin.h"
#include "gui/models/listmodel.h"
diff --git a/src/gui/widgets/passwordfield.cpp b/src/gui/widgets/passwordfield.cpp
index 1b562b7f0..27f0bc188 100644
--- a/src/gui/widgets/passwordfield.cpp
+++ b/src/gui/widgets/passwordfield.cpp
@@ -22,6 +22,8 @@
#include "gui/widgets/passwordfield.h"
+#include "gui/skin.h"
+
#include "debug.h"
PasswordField::PasswordField(const Widget2 *const widget,
diff --git a/src/gui/widgets/playerbox.cpp b/src/gui/widgets/playerbox.cpp
index 6a0fbd607..252f39727 100644
--- a/src/gui/widgets/playerbox.cpp
+++ b/src/gui/widgets/playerbox.cpp
@@ -27,6 +27,7 @@
#include "being/being.h"
#include "gui/gui.h"
+#include "gui/skin.h"
#include "resources/image.h"
diff --git a/src/gui/widgets/popup.cpp b/src/gui/widgets/popup.cpp
index 3c10a721f..ff6296d75 100644
--- a/src/gui/widgets/popup.cpp
+++ b/src/gui/widgets/popup.cpp
@@ -25,6 +25,7 @@
#include "graphicsvertexes.h"
+#include "gui/skin.h"
#include "gui/viewport.h"
#include "utils/delete2.h"
diff --git a/src/gui/widgets/progressbar.cpp b/src/gui/widgets/progressbar.cpp
index 4c82fe20c..f737f0153 100644
--- a/src/gui/widgets/progressbar.cpp
+++ b/src/gui/widgets/progressbar.cpp
@@ -27,6 +27,7 @@
#include "gui/font.h"
#include "gui/gui.h"
+#include "gui/skin.h"
#include "utils/delete2.h"
diff --git a/src/gui/widgets/radiobutton.cpp b/src/gui/widgets/radiobutton.cpp
index 27be9434b..8e122ece6 100644
--- a/src/gui/widgets/radiobutton.cpp
+++ b/src/gui/widgets/radiobutton.cpp
@@ -73,6 +73,7 @@
#include "gui/font.h"
#include "gui/gui.h"
+#include "gui/skin.h"
#include "debug.h"
diff --git a/src/gui/widgets/scrollarea.cpp b/src/gui/widgets/scrollarea.cpp
index e006302c7..29d185bac 100644
--- a/src/gui/widgets/scrollarea.cpp
+++ b/src/gui/widgets/scrollarea.cpp
@@ -69,6 +69,7 @@
#include "graphicsvertexes.h"
#include "gui/gui.h"
+#include "gui/skin.h"
#include "resources/image.h"
diff --git a/src/gui/widgets/tabs/tab.cpp b/src/gui/widgets/tabs/tab.cpp
index e31bc9ef1..dc063bb45 100644
--- a/src/gui/widgets/tabs/tab.cpp
+++ b/src/gui/widgets/tabs/tab.cpp
@@ -69,6 +69,7 @@
#include "graphicsvertexes.h"
#include "gui/gui.h"
+#include "gui/skin.h"
#include "gui/widgets/label.h"
#include "gui/widgets/tabbedarea.h"
diff --git a/src/gui/widgets/textfield.cpp b/src/gui/widgets/textfield.cpp
index db194419e..0080a8d22 100644
--- a/src/gui/widgets/textfield.cpp
+++ b/src/gui/widgets/textfield.cpp
@@ -71,6 +71,7 @@
#include "gui/font.h"
#include "gui/gui.h"
+#include "gui/skin.h"
#include "gui/viewport.h"
#include "gui/popups/popupmenu.h"
diff --git a/src/gui/widgets/textpreview.cpp b/src/gui/widgets/textpreview.cpp
index 6f358e956..c567c5f06 100644
--- a/src/gui/widgets/textpreview.cpp
+++ b/src/gui/widgets/textpreview.cpp
@@ -26,6 +26,7 @@
#include "gui/font.h"
#include "gui/gui.h"
+#include "gui/skin.h"
#include "debug.h"
diff --git a/src/gui/widgets/window.cpp b/src/gui/widgets/window.cpp
index c7212314d..7e34476d0 100644
--- a/src/gui/widgets/window.cpp
+++ b/src/gui/widgets/window.cpp
@@ -75,6 +75,7 @@
#include "gui/focushandler.h"
#include "gui/font.h"
#include "gui/gui.h"
+#include "gui/skin.h"
#include "gui/viewport.h"
#include "gui/widgets/layout.h"
diff --git a/src/gui/windowmenu.cpp b/src/gui/windowmenu.cpp
index c3b52ed59..30a517173 100644
--- a/src/gui/windowmenu.cpp
+++ b/src/gui/windowmenu.cpp
@@ -26,6 +26,7 @@
#include "input/inputmanager.h"
+#include "gui/skin.h"
#include "gui/viewport.h"
#include "gui/popups/textpopup.h"
diff --git a/src/gui/windows/chatwindow.cpp b/src/gui/windows/chatwindow.cpp
index d6ad291c6..17e8924f5 100644
--- a/src/gui/windows/chatwindow.cpp
+++ b/src/gui/windows/chatwindow.cpp
@@ -42,6 +42,7 @@
#include "gui/focushandler.h"
#include "gui/gui.h"
+#include "gui/skin.h"
#include "gui/viewport.h"
#include "gui/models/colorlistmodel.h"
diff --git a/src/gui/windows/ministatuswindow.cpp b/src/gui/windows/ministatuswindow.cpp
index d54954e78..d9e6e5479 100644
--- a/src/gui/windows/ministatuswindow.cpp
+++ b/src/gui/windows/ministatuswindow.cpp
@@ -30,6 +30,7 @@
#include "being/localplayer.h"
#include "being/playerinfo.h"
+#include "gui/skin.h"
#include "gui/viewport.h"
#include "gui/popups/textpopup.h"
diff --git a/src/gui/windows/skilldialog.cpp b/src/gui/windows/skilldialog.cpp
index b082e65d4..77ea9e959 100644
--- a/src/gui/windows/skilldialog.cpp
+++ b/src/gui/windows/skilldialog.cpp
@@ -31,6 +31,7 @@
#include "being/localplayer.h"
#include "gui/font.h"
+#include "gui/skin.h"
#include "gui/viewport.h"
#include "gui/popups/textpopup.h"
diff --git a/src/touchmanager.cpp b/src/touchmanager.cpp
index d1c29999c..177eb45be 100644
--- a/src/touchmanager.cpp
+++ b/src/touchmanager.cpp
@@ -28,6 +28,7 @@
#include "gui/font.h"
#include "gui/gui.h"
+#include "gui/skin.h"
#include "input/inputmanager.h"