summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-02-19 01:18:16 +0300
committerAndrei Karas <akaras@inbox.ru>2014-02-20 00:49:07 +0300
commit26f9aad24bc50d4e9fd161d185df049c9e7a62cf (patch)
treed8fd87aef6395b5a4704e9570fcbcddcc8ccca83 /src/gui
parent50b5afdb7e68cdec8f77020b578dc3f6874933bb (diff)
downloadmv-26f9aad24bc50d4e9fd161d185df049c9e7a62cf.tar.gz
mv-26f9aad24bc50d4e9fd161d185df049c9e7a62cf.tar.bz2
mv-26f9aad24bc50d4e9fd161d185df049c9e7a62cf.tar.xz
mv-26f9aad24bc50d4e9fd161d185df049c9e7a62cf.zip
improve includes.
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/base/basiccontainer.cpp2
-rw-r--r--src/gui/base/basiccontainer.hpp3
-rw-r--r--src/gui/base/gui.cpp5
-rw-r--r--src/gui/base/gui.hpp1
-rw-r--r--src/gui/base/rectangle.hpp3
-rw-r--r--src/gui/base/widget.cpp7
-rw-r--r--src/gui/base/widget.hpp4
-rw-r--r--src/gui/base/widgets/button.cpp5
-rw-r--r--src/gui/base/widgets/button.hpp2
-rw-r--r--src/gui/base/widgets/checkbox.cpp7
-rw-r--r--src/gui/base/widgets/checkbox.hpp2
-rw-r--r--src/gui/base/widgets/container.hpp6
-rw-r--r--src/gui/base/widgets/listbox.cpp8
-rw-r--r--src/gui/base/widgets/radiobutton.cpp7
-rw-r--r--src/gui/base/widgets/radiobutton.hpp2
-rw-r--r--src/gui/base/widgets/scrollarea.cpp3
-rw-r--r--src/gui/base/widgets/scrollarea.hpp2
-rw-r--r--src/gui/base/widgets/slider.cpp5
-rw-r--r--src/gui/base/widgets/textbox.cpp5
-rw-r--r--src/gui/base/widgets/textbox.hpp1
-rw-r--r--src/gui/base/widgets/textfield.cpp5
-rw-r--r--src/gui/base/widgets/window.cpp4
-rw-r--r--src/gui/focushandler.cpp2
-rw-r--r--src/gui/font.cpp1
-rw-r--r--src/gui/gui.cpp2
-rw-r--r--src/gui/gui.h3
-rw-r--r--src/gui/popups/beingpopup.cpp1
-rw-r--r--src/gui/popups/itempopup.cpp1
-rw-r--r--src/gui/popups/itempopup.h1
-rw-r--r--src/gui/popups/popupmenu.cpp2
-rw-r--r--src/gui/popups/popupmenu.h1
-rw-r--r--src/gui/popups/speechbubble.cpp2
-rw-r--r--src/gui/popups/spellpopup.cpp1
-rw-r--r--src/gui/sdlinput.h7
-rw-r--r--src/gui/widgets/browserbox.h2
-rw-r--r--src/gui/widgets/button.cpp2
-rw-r--r--src/gui/widgets/button.h2
-rw-r--r--src/gui/widgets/characterdisplay.cpp5
-rw-r--r--src/gui/widgets/characterdisplay.h8
-rw-r--r--src/gui/widgets/characterviewnormal.cpp1
-rw-r--r--src/gui/widgets/characterviewsmall.cpp2
-rw-r--r--src/gui/widgets/characterviewsmall.h2
-rw-r--r--src/gui/widgets/checkbox.cpp1
-rw-r--r--src/gui/widgets/checkbox.h2
-rw-r--r--src/gui/widgets/container.cpp2
-rw-r--r--src/gui/widgets/container.h2
-rw-r--r--src/gui/widgets/dropdown.cpp1
-rw-r--r--src/gui/widgets/dropdown.h7
-rw-r--r--src/gui/widgets/dropshortcutcontainer.h2
-rw-r--r--src/gui/widgets/emotepage.h2
-rw-r--r--src/gui/widgets/emoteshortcutcontainer.cpp2
-rw-r--r--src/gui/widgets/emoteshortcutcontainer.h6
-rw-r--r--src/gui/widgets/guitable.cpp4
-rw-r--r--src/gui/widgets/icon.cpp2
-rw-r--r--src/gui/widgets/icon.h2
-rw-r--r--src/gui/widgets/itemcontainer.h2
-rw-r--r--src/gui/widgets/label.cpp1
-rw-r--r--src/gui/widgets/layout.cpp2
-rw-r--r--src/gui/widgets/layout.h8
-rw-r--r--src/gui/widgets/layouthelper.cpp2
-rw-r--r--src/gui/widgets/listbox.h2
-rw-r--r--src/gui/widgets/playerbox.cpp2
-rw-r--r--src/gui/widgets/progressbar.h2
-rw-r--r--src/gui/widgets/progressindicator.cpp2
-rw-r--r--src/gui/widgets/progressindicator.h4
-rw-r--r--src/gui/widgets/radiobutton.cpp1
-rw-r--r--src/gui/widgets/radiobutton.h2
-rw-r--r--src/gui/widgets/scrollarea.cpp4
-rw-r--r--src/gui/widgets/scrollarea.h2
-rw-r--r--src/gui/widgets/setupitem.cpp4
-rw-r--r--src/gui/widgets/setupitem.h8
-rw-r--r--src/gui/widgets/setuptouchitem.cpp2
-rw-r--r--src/gui/widgets/shortcutcontainer.cpp2
-rw-r--r--src/gui/widgets/shortcutcontainer.h2
-rw-r--r--src/gui/widgets/slider.cpp2
-rw-r--r--src/gui/widgets/slider.h2
-rw-r--r--src/gui/widgets/sliderlist.cpp2
-rw-r--r--src/gui/widgets/sliderlist.h7
-rw-r--r--src/gui/widgets/spellshortcutcontainer.cpp1
-rw-r--r--src/gui/widgets/tabbedarea.cpp2
-rw-r--r--src/gui/widgets/tabbedarea.h2
-rw-r--r--src/gui/widgets/tabs/chattab.cpp1
-rw-r--r--src/gui/widgets/tabs/setup_audio.h2
-rw-r--r--src/gui/widgets/tabs/setup_colors.cpp1
-rw-r--r--src/gui/widgets/tabs/setup_colors.h2
-rw-r--r--src/gui/widgets/tabs/setup_input.cpp1
-rw-r--r--src/gui/widgets/tabs/setup_relations.h2
-rw-r--r--src/gui/widgets/tabs/setup_theme.cpp2
-rw-r--r--src/gui/widgets/tabs/setup_touch.cpp2
-rw-r--r--src/gui/widgets/tabs/setup_touch.h5
-rw-r--r--src/gui/widgets/tabs/setup_visual.h2
-rw-r--r--src/gui/widgets/tabs/tab.cpp4
-rw-r--r--src/gui/widgets/tabs/tab.h2
-rw-r--r--src/gui/widgets/textbox.cpp1
-rw-r--r--src/gui/widgets/textbox.h2
-rw-r--r--src/gui/widgets/textfield.cpp2
-rw-r--r--src/gui/widgets/textpreview.h2
-rw-r--r--src/gui/widgets/widget2.h1
-rw-r--r--src/gui/widgets/window.h2
-rw-r--r--src/gui/windowmenu.cpp2
-rw-r--r--src/gui/windowmenu.h4
-rw-r--r--src/gui/windows/buydialog.h1
-rw-r--r--src/gui/windows/charcreatedialog.cpp1
-rw-r--r--src/gui/windows/charcreatedialog.h4
-rw-r--r--src/gui/windows/charselectdialog.cpp1
-rw-r--r--src/gui/windows/charselectdialog.h1
-rw-r--r--src/gui/windows/chatwindow.cpp3
-rw-r--r--src/gui/windows/didyouknowwindow.cpp5
-rw-r--r--src/gui/windows/helpwindow.cpp5
-rw-r--r--src/gui/windows/inventorywindow.cpp3
-rw-r--r--src/gui/windows/inventorywindow.h1
-rw-r--r--src/gui/windows/itemamountwindow.cpp2
-rw-r--r--src/gui/windows/npcdialog.h1
-rw-r--r--src/gui/windows/questswindow.cpp3
-rw-r--r--src/gui/windows/serverdialog.cpp4
-rw-r--r--src/gui/windows/serverdialog.h2
-rw-r--r--src/gui/windows/setupwindow.cpp1
-rw-r--r--src/gui/windows/textcommandeditor.cpp2
-rw-r--r--src/gui/windows/tradewindow.cpp1
119 files changed, 158 insertions, 169 deletions
diff --git a/src/gui/base/basiccontainer.cpp b/src/gui/base/basiccontainer.cpp
index 05d89f172..edc465726 100644
--- a/src/gui/base/basiccontainer.cpp
+++ b/src/gui/base/basiccontainer.cpp
@@ -71,8 +71,6 @@
#include "gui/focushandler.h"
-#include "input/mouseinput.h"
-
#include "render/graphics.h"
#include "debug.h"
diff --git a/src/gui/base/basiccontainer.hpp b/src/gui/base/basiccontainer.hpp
index cc3aee808..fd28ef7b6 100644
--- a/src/gui/base/basiccontainer.hpp
+++ b/src/gui/base/basiccontainer.hpp
@@ -64,7 +64,6 @@
#ifndef GCN_BASICCONTAINER_HPP
#define GCN_BASICCONTAINER_HPP
-#include <list>
#include <vector>
#include "gui/base/widget.hpp"
@@ -85,7 +84,7 @@ namespace gcn
public DeathListener
{
public:
- BasicContainer(const Widget2 *const widget) :
+ explicit BasicContainer(const Widget2 *const widget) :
Widget(widget),
DeathListener(),
mWidgets()
diff --git a/src/gui/base/gui.cpp b/src/gui/base/gui.cpp
index f62e24260..d5b23e960 100644
--- a/src/gui/base/gui.cpp
+++ b/src/gui/base/gui.cpp
@@ -67,20 +67,15 @@
#include "gui/base/gui.hpp"
-#include "gui/base/basiccontainer.hpp"
#include "gui/base/widget.hpp"
#include "gui/focushandler.h"
-#include "gui/sdlinput.h"
-#include "input/keyinput.h"
#include "input/mouseinput.h"
#include "listeners/keylistener.h"
#include "listeners/mouselistener.h"
-#include "render/graphics.h"
-
#include "debug.h"
namespace gcn
diff --git a/src/gui/base/gui.hpp b/src/gui/base/gui.hpp
index f614c00fd..391a0520e 100644
--- a/src/gui/base/gui.hpp
+++ b/src/gui/base/gui.hpp
@@ -68,7 +68,6 @@
#include <deque>
#include "events/keyevent.h"
-#include "events/mouseevent.h"
#include "input/mouseinput.h"
diff --git a/src/gui/base/rectangle.hpp b/src/gui/base/rectangle.hpp
index b8503db98..299ce99b9 100644
--- a/src/gui/base/rectangle.hpp
+++ b/src/gui/base/rectangle.hpp
@@ -95,6 +95,9 @@ namespace gcn
*/
Rectangle(const int x, const int y, const int width, const int height);
+ virtual ~Rectangle()
+ { }
+
/**
* Sets the dimension of a rectangle.
*
diff --git a/src/gui/base/widget.cpp b/src/gui/base/widget.cpp
index f5994d1af..692ea479c 100644
--- a/src/gui/base/widget.cpp
+++ b/src/gui/base/widget.cpp
@@ -71,17 +71,10 @@
#include "events/event.h"
-#include "gui/base/basiccontainer.hpp"
-
#include "gui/focushandler.h"
-#include "input/keyinput.h"
-#include "input/mouseinput.h"
-
#include "listeners/actionlistener.h"
#include "listeners/deathlistener.h"
-#include "listeners/keylistener.h"
-#include "listeners/mouselistener.h"
#include "listeners/widgetlistener.h"
#include "render/graphics.h"
diff --git a/src/gui/base/widget.hpp b/src/gui/base/widget.hpp
index 013ead3b8..6245d3c98 100644
--- a/src/gui/base/widget.hpp
+++ b/src/gui/base/widget.hpp
@@ -89,8 +89,6 @@ class WidgetListener;
namespace gcn
{
- class BasicContainer;
-
/**
* Abstract class for widgets of Guichan. It contains basic functions
* every widget should have.
@@ -110,7 +108,7 @@ namespace gcn
* focusable as default, therefore, widgets that are supposed to be
* focusable should overide this default in their own constructor.
*/
- Widget(const Widget2 *const widget);
+ explicit Widget(const Widget2 *const widget);
A_DELETE_COPY(Widget)
diff --git a/src/gui/base/widgets/button.cpp b/src/gui/base/widgets/button.cpp
index e4285cffd..5187c625b 100644
--- a/src/gui/base/widgets/button.cpp
+++ b/src/gui/base/widgets/button.cpp
@@ -67,11 +67,6 @@
#include "gui/base/widgets/button.hpp"
-#include "gui/font.h"
-
-#include "input/key.h"
-#include "input/mouseinput.h"
-
#include "events/mouseevent.h"
#include "render/graphics.h"
diff --git a/src/gui/base/widgets/button.hpp b/src/gui/base/widgets/button.hpp
index 7fd5613bd..fea175362 100644
--- a/src/gui/base/widgets/button.hpp
+++ b/src/gui/base/widgets/button.hpp
@@ -70,8 +70,6 @@
#include "listeners/keylistener.h"
#include "listeners/mouselistener.h"
-#include "events/mouseevent.h"
-
#include "gui/base/widget.hpp"
#include "render/graphics.h"
diff --git a/src/gui/base/widgets/checkbox.cpp b/src/gui/base/widgets/checkbox.cpp
index d75fb5cb0..a5ec72dfa 100644
--- a/src/gui/base/widgets/checkbox.cpp
+++ b/src/gui/base/widgets/checkbox.cpp
@@ -67,13 +67,6 @@
#include "gui/base/widgets/checkbox.hpp"
-#include "gui/font.h"
-
-#include "input/key.h"
-#include "input/mouseinput.h"
-
-#include "render/graphics.h"
-
#include "debug.h"
namespace gcn
diff --git a/src/gui/base/widgets/checkbox.hpp b/src/gui/base/widgets/checkbox.hpp
index d87a6b206..c79ccaff9 100644
--- a/src/gui/base/widgets/checkbox.hpp
+++ b/src/gui/base/widgets/checkbox.hpp
@@ -90,7 +90,7 @@ namespace gcn
/**
* Contructor.
*/
- CheckBox(const Widget2 *const widget);
+ explicit CheckBox(const Widget2 *const widget);
/**
* Constructor. The check box will be automatically resized
diff --git a/src/gui/base/widgets/container.hpp b/src/gui/base/widgets/container.hpp
index ba3cff153..3e6c0a587 100644
--- a/src/gui/base/widgets/container.hpp
+++ b/src/gui/base/widgets/container.hpp
@@ -64,12 +64,8 @@
#ifndef GCN_CONTAINER_HPP
#define GCN_CONTAINER_HPP
-#include <list>
-
#include "gui/base/basiccontainer.hpp"
-#include "render/graphics.h"
-
namespace gcn
{
/**
@@ -89,7 +85,7 @@ namespace gcn
*
* @see setOpaque, isOpaque
*/
- Container(const Widget2 *const widget);
+ explicit Container(const Widget2 *const widget);
/**
* Destructor.
diff --git a/src/gui/base/widgets/listbox.cpp b/src/gui/base/widgets/listbox.cpp
index 0dd5c88f7..02d94626c 100644
--- a/src/gui/base/widgets/listbox.cpp
+++ b/src/gui/base/widgets/listbox.cpp
@@ -69,16 +69,8 @@
#include "gui/font.h"
-#include "gui/base/basiccontainer.hpp"
-#include "gui/base/listmodel.hpp"
-
-#include "input/key.h"
-#include "input/mouseinput.h"
-
#include "listeners/selectionlistener.h"
-#include "render/graphics.h"
-
#include "debug.h"
namespace gcn
diff --git a/src/gui/base/widgets/radiobutton.cpp b/src/gui/base/widgets/radiobutton.cpp
index 832c00bbe..e17b9f776 100644
--- a/src/gui/base/widgets/radiobutton.cpp
+++ b/src/gui/base/widgets/radiobutton.cpp
@@ -67,13 +67,6 @@
#include "gui/base/widgets/radiobutton.hpp"
-#include "gui/font.h"
-
-#include "input/key.h"
-#include "input/mouseinput.h"
-
-#include "render/graphics.h"
-
#include "debug.h"
namespace gcn
diff --git a/src/gui/base/widgets/radiobutton.hpp b/src/gui/base/widgets/radiobutton.hpp
index 4d4403fac..f4bfd53fa 100644
--- a/src/gui/base/widgets/radiobutton.hpp
+++ b/src/gui/base/widgets/radiobutton.hpp
@@ -93,7 +93,7 @@ namespace gcn
/**
* Constructor.
*/
- RadioButton(const Widget2 *const widget);
+ explicit RadioButton(const Widget2 *const widget);
/**
* Constructor. The radio button will be automatically resized
diff --git a/src/gui/base/widgets/scrollarea.cpp b/src/gui/base/widgets/scrollarea.cpp
index 68e1b72d3..0fc605fa3 100644
--- a/src/gui/base/widgets/scrollarea.cpp
+++ b/src/gui/base/widgets/scrollarea.cpp
@@ -67,9 +67,6 @@
#include "gui/base/widgets/scrollarea.hpp"
-
-#include "render/graphics.h"
-
#include "debug.h"
namespace gcn
diff --git a/src/gui/base/widgets/scrollarea.hpp b/src/gui/base/widgets/scrollarea.hpp
index e2d8aada5..669ccfbdd 100644
--- a/src/gui/base/widgets/scrollarea.hpp
+++ b/src/gui/base/widgets/scrollarea.hpp
@@ -64,8 +64,6 @@
#ifndef GCN_SCROLLAREA_HPP
#define GCN_SCROLLAREA_HPP
-#include <string>
-
#include "gui/base/basiccontainer.hpp"
#include "listeners/mouselistener.h"
diff --git a/src/gui/base/widgets/slider.cpp b/src/gui/base/widgets/slider.cpp
index e995ff55a..4e9df0341 100644
--- a/src/gui/base/widgets/slider.cpp
+++ b/src/gui/base/widgets/slider.cpp
@@ -67,11 +67,6 @@
#include "gui/base/widgets/slider.hpp"
-#include "input/key.h"
-#include "input/mouseinput.h"
-
-#include "render/graphics.h"
-
#include "debug.h"
namespace gcn
diff --git a/src/gui/base/widgets/textbox.cpp b/src/gui/base/widgets/textbox.cpp
index 7a5b63a50..bb22a6f46 100644
--- a/src/gui/base/widgets/textbox.cpp
+++ b/src/gui/base/widgets/textbox.cpp
@@ -69,11 +69,6 @@
#include "gui/font.h"
-#include "gui/base/basiccontainer.hpp"
-
-#include "input/key.h"
-#include "input/mouseinput.h"
-
#include "render/graphics.h"
#include "debug.h"
diff --git a/src/gui/base/widgets/textbox.hpp b/src/gui/base/widgets/textbox.hpp
index 0c96096ec..151af8c00 100644
--- a/src/gui/base/widgets/textbox.hpp
+++ b/src/gui/base/widgets/textbox.hpp
@@ -64,7 +64,6 @@
#ifndef GCN_TEXTBOX_HPP
#define GCN_TEXTBOX_HPP
-#include <ctime>
#include <string>
#include <vector>
diff --git a/src/gui/base/widgets/textfield.cpp b/src/gui/base/widgets/textfield.cpp
index 6ca37c4af..ddcbec1b4 100644
--- a/src/gui/base/widgets/textfield.cpp
+++ b/src/gui/base/widgets/textfield.cpp
@@ -69,11 +69,6 @@
#include "gui/font.h"
-#include "input/key.h"
-#include "input/mouseinput.h"
-
-#include "render/graphics.h"
-
#include "debug.h"
namespace gcn
diff --git a/src/gui/base/widgets/window.cpp b/src/gui/base/widgets/window.cpp
index 0ead95bc1..401e3ab6d 100644
--- a/src/gui/base/widgets/window.cpp
+++ b/src/gui/base/widgets/window.cpp
@@ -67,10 +67,6 @@
#include "gui/base/widgets/window.hpp"
-#include "gui/font.h"
-
-#include "input/mouseinput.h"
-
#include "render/graphics.h"
#include "debug.h"
diff --git a/src/gui/focushandler.cpp b/src/gui/focushandler.cpp
index 22153c91f..0d45b6432 100644
--- a/src/gui/focushandler.cpp
+++ b/src/gui/focushandler.cpp
@@ -69,6 +69,8 @@
#include "gui/widgets/window.h"
+#include "listeners/focuslistener.h"
+
#include "debug.h"
FocusHandler::FocusHandler() :
diff --git a/src/gui/font.cpp b/src/gui/font.cpp
index a154d8c54..fcc8e8344 100644
--- a/src/gui/font.cpp
+++ b/src/gui/font.cpp
@@ -77,7 +77,6 @@
#include "resources/surfaceimagehelper.h"
#include "utils/paths.h"
-#include "utils/physfsrwops.h"
#include "utils/sdlcheckutils.h"
#include "utils/stringutils.h"
#include "utils/timer.h"
diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp
index 243b3817e..fdaa299af 100644
--- a/src/gui/gui.cpp
+++ b/src/gui/gui.cpp
@@ -40,6 +40,8 @@
#include "events/keyevent.h"
+#include "listeners/focuslistener.h"
+
#include "input/keydata.h"
#include "input/keyinput.h"
#include "input/mouseinput.h"
diff --git a/src/gui/gui.h b/src/gui/gui.h
index aacd33946..f6b4fbbf6 100644
--- a/src/gui/gui.h
+++ b/src/gui/gui.h
@@ -26,10 +26,9 @@
#include "gui/base/color.hpp"
#include "gui/base/gui.hpp"
-#include "listeners/focuslistener.h"
-
#include "localconsts.h"
+class FocusListener;
class Graphics;
class GuiConfigListener;
class ImageSet;
diff --git a/src/gui/popups/beingpopup.cpp b/src/gui/popups/beingpopup.cpp
index 32aa11454..07d4b064a 100644
--- a/src/gui/popups/beingpopup.cpp
+++ b/src/gui/popups/beingpopup.cpp
@@ -25,6 +25,7 @@
#include "being/playerrelations.h"
#include "gui/font.h"
+#include "gui/gui.h"
#include "gui/widgets/label.h"
diff --git a/src/gui/popups/itempopup.cpp b/src/gui/popups/itempopup.cpp
index d6ea5a48a..0a65ce3bc 100644
--- a/src/gui/popups/itempopup.cpp
+++ b/src/gui/popups/itempopup.cpp
@@ -28,6 +28,7 @@
#include "units.h"
#include "gui/font.h"
+#include "gui/gui.h"
#include "gui/widgets/icon.h"
#include "gui/widgets/label.h"
diff --git a/src/gui/popups/itempopup.h b/src/gui/popups/itempopup.h
index 714e0305c..f1cedf046 100644
--- a/src/gui/popups/itempopup.h
+++ b/src/gui/popups/itempopup.h
@@ -29,6 +29,7 @@
#include "resources/iteminfo.h"
class Icon;
+class Item;
class Label;
class TextBox;
diff --git a/src/gui/popups/popupmenu.cpp b/src/gui/popups/popupmenu.cpp
index 450bd504f..a37994884 100644
--- a/src/gui/popups/popupmenu.cpp
+++ b/src/gui/popups/popupmenu.cpp
@@ -23,6 +23,7 @@
#include "gui/popups/popupmenu.h"
#include "actormanager.h"
+#include "commands.h"
#include "commandhandler.h"
#include "configuration.h"
#include "dropshortcut.h"
@@ -56,6 +57,7 @@
#include "gui/viewport.h"
+#include "gui/widgets/button.h"
#include "gui/widgets/browserbox.h"
#include "gui/widgets/tabs/chattab.h"
#include "gui/widgets/progressbar.h"
diff --git a/src/gui/popups/popupmenu.h b/src/gui/popups/popupmenu.h
index 1ebb0dd89..70f8b7885 100644
--- a/src/gui/popups/popupmenu.h
+++ b/src/gui/popups/popupmenu.h
@@ -29,6 +29,7 @@
#include "being/actorsprite.h"
#include "listeners/actionlistener.h"
+
#include "gui/base/listmodel.hpp"
#include "localconsts.h"
diff --git a/src/gui/popups/speechbubble.cpp b/src/gui/popups/speechbubble.cpp
index c74f3f5e6..9bb6157bc 100644
--- a/src/gui/popups/speechbubble.cpp
+++ b/src/gui/popups/speechbubble.cpp
@@ -24,11 +24,11 @@
#include "gui/popups/speechbubble.h"
#include "gui/font.h"
+#include "gui/gui.h"
#include "gui/viewport.h"
#include "gui/widgets/browserbox.h"
#include "gui/widgets/label.h"
-#include "gui/widgets/textbox.h"
#include "debug.h"
diff --git a/src/gui/popups/spellpopup.cpp b/src/gui/popups/spellpopup.cpp
index 141879da4..8849a53cb 100644
--- a/src/gui/popups/spellpopup.cpp
+++ b/src/gui/popups/spellpopup.cpp
@@ -24,6 +24,7 @@
#include "gui/popups/spellpopup.h"
#include "gui/font.h"
+#include "gui/gui.h"
#include "gui/widgets/label.h"
diff --git a/src/gui/sdlinput.h b/src/gui/sdlinput.h
index 8a9128920..29cb5ce1f 100644
--- a/src/gui/sdlinput.h
+++ b/src/gui/sdlinput.h
@@ -75,11 +75,10 @@
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef GUI_INPUT_H
-#define GUI_INPUT_H
+#ifndef GUI_SDLINPUT_H
+#define GUI_SDLINPUT_H
#include "input/keyinput.h"
-#include "input/mouseinput.h"
#include <SDL_events.h>
@@ -163,4 +162,4 @@ protected:
bool mMouseInWindow;
};
-#endif // GUI_INPUT_H
+#endif // GUI_SDLINPUT_H
diff --git a/src/gui/widgets/browserbox.h b/src/gui/widgets/browserbox.h
index 23f221e63..1f09dd0b1 100644
--- a/src/gui/widgets/browserbox.h
+++ b/src/gui/widgets/browserbox.h
@@ -24,8 +24,6 @@
#ifndef GUI_WIDGETS_BROWSERBOX_H
#define GUI_WIDGETS_BROWSERBOX_H
-#include "gui/widgets/widget2.h"
-
#include "listeners/mouselistener.h"
#include "gui/base/widget.hpp"
diff --git a/src/gui/widgets/button.cpp b/src/gui/widgets/button.cpp
index a9b621d90..d7871503e 100644
--- a/src/gui/widgets/button.cpp
+++ b/src/gui/widgets/button.cpp
@@ -29,9 +29,11 @@
#include "input/keydata.h"
+#include "resources/image.h"
#include "resources/imageset.h"
#include "gui/font.h"
+#include "gui/gui.h"
#include "debug.h"
diff --git a/src/gui/widgets/button.h b/src/gui/widgets/button.h
index 73c0d70eb..4f2e9fd89 100644
--- a/src/gui/widgets/button.h
+++ b/src/gui/widgets/button.h
@@ -23,8 +23,6 @@
#ifndef GUI_WIDGETS_BUTTON_H
#define GUI_WIDGETS_BUTTON_H
-#include "gui/widgets/widget2.h"
-
#include "gui/base/widgets/button.hpp"
#include "listeners/widgetlistener.h"
diff --git a/src/gui/widgets/characterdisplay.cpp b/src/gui/widgets/characterdisplay.cpp
index bdd740874..7bfc938de 100644
--- a/src/gui/widgets/characterdisplay.cpp
+++ b/src/gui/widgets/characterdisplay.cpp
@@ -24,6 +24,8 @@
#include "units.h"
+#include "gui/gui.h"
+
#include "gui/windows/charselectdialog.h"
#include "gui/popups/textpopup.h"
@@ -32,8 +34,7 @@
#include "gui/widgets/layouthelper.h"
#include "utils/gettext.h"
-
-#include <SDL_mouse.h>
+#include "utils/stringutils.h"
#include "debug.h"
diff --git a/src/gui/widgets/characterdisplay.h b/src/gui/widgets/characterdisplay.h
index 8571363c3..8f9acf462 100644
--- a/src/gui/widgets/characterdisplay.h
+++ b/src/gui/widgets/characterdisplay.h
@@ -26,9 +26,6 @@
#include "gui/widgets/container.h"
#include "gui/widgets/playerbox.h"
-#include "net/charserverhandler.h"
-#include "net/net.h"
-
#include "listeners/widgetlistener.h"
#include "localconsts.h"
@@ -37,6 +34,11 @@ class CharSelectDialog;
class Label;
class TextPopup;
+namespace Net
+{
+ struct Character;
+}
+
class CharacterDisplay final : public Container,
public MouseListener,
public WidgetListener
diff --git a/src/gui/widgets/characterviewnormal.cpp b/src/gui/widgets/characterviewnormal.cpp
index 75481268b..1df98d85e 100644
--- a/src/gui/widgets/characterviewnormal.cpp
+++ b/src/gui/widgets/characterviewnormal.cpp
@@ -23,7 +23,6 @@
#include "configuration.h"
#include "gui/widgets/characterdisplay.h"
-#include "gui/widgets/characterviewsmall.h"
#include "debug.h"
diff --git a/src/gui/widgets/characterviewsmall.cpp b/src/gui/widgets/characterviewsmall.cpp
index eda1e4a71..4d2c93b48 100644
--- a/src/gui/widgets/characterviewsmall.cpp
+++ b/src/gui/widgets/characterviewsmall.cpp
@@ -24,6 +24,8 @@
#include "gui/widgets/characterdisplay.h"
#include "gui/widgets/label.h"
+#include "utils/stringutils.h"
+
#include "debug.h"
CharacterViewSmall::CharacterViewSmall(CharSelectDialog *const widget,
diff --git a/src/gui/widgets/characterviewsmall.h b/src/gui/widgets/characterviewsmall.h
index 17a549718..a9f6d7f9b 100644
--- a/src/gui/widgets/characterviewsmall.h
+++ b/src/gui/widgets/characterviewsmall.h
@@ -25,6 +25,8 @@
#include "localconsts.h"
+class Label;
+
class CharacterViewSmall final : public CharacterViewBase
{
public:
diff --git a/src/gui/widgets/checkbox.cpp b/src/gui/widgets/checkbox.cpp
index e500815c0..63e32a0f9 100644
--- a/src/gui/widgets/checkbox.cpp
+++ b/src/gui/widgets/checkbox.cpp
@@ -31,6 +31,7 @@
#include "resources/image.h"
#include "gui/font.h"
+#include "gui/gui.h"
#include "debug.h"
diff --git a/src/gui/widgets/checkbox.h b/src/gui/widgets/checkbox.h
index e05ab29d3..28eadb75c 100644
--- a/src/gui/widgets/checkbox.h
+++ b/src/gui/widgets/checkbox.h
@@ -23,8 +23,6 @@
#ifndef GUI_WIDGETS_CHECKBOX_H
#define GUI_WIDGETS_CHECKBOX_H
-#include "gui/widgets/widget2.h"
-
#include "gui/base/widgets/checkbox.hpp"
#include "localconsts.h"
diff --git a/src/gui/widgets/container.cpp b/src/gui/widgets/container.cpp
index 3c048d630..2d8aad965 100644
--- a/src/gui/widgets/container.cpp
+++ b/src/gui/widgets/container.cpp
@@ -22,6 +22,8 @@
#include "gui/widgets/container.h"
+#include "gui/gui.h"
+
#include "debug.h"
Container::Container(const Widget2 *const widget) :
diff --git a/src/gui/widgets/container.h b/src/gui/widgets/container.h
index efddb1566..36d7cce86 100644
--- a/src/gui/widgets/container.h
+++ b/src/gui/widgets/container.h
@@ -23,8 +23,6 @@
#ifndef GUI_WIDGETS_CONTAINER_H
#define GUI_WIDGETS_CONTAINER_H
-#include "gui/widgets/widget2.h"
-
#include "gui/base/widgets/container.hpp"
/**
diff --git a/src/gui/widgets/dropdown.cpp b/src/gui/widgets/dropdown.cpp
index 86170036c..6189af75e 100644
--- a/src/gui/widgets/dropdown.cpp
+++ b/src/gui/widgets/dropdown.cpp
@@ -34,6 +34,7 @@
#include "resources/image.h"
#include "gui/font.h"
+#include "gui/gui.h"
#include <algorithm>
diff --git a/src/gui/widgets/dropdown.h b/src/gui/widgets/dropdown.h
index b638a2a05..a1908a3c6 100644
--- a/src/gui/widgets/dropdown.h
+++ b/src/gui/widgets/dropdown.h
@@ -26,7 +26,7 @@
#include "gui/widgets/widget2.h"
#include "gui/base/basiccontainer.hpp"
-#include "gui/base/listmodel.hpp"
+//#include "gui/base/listmodel.hpp"
#include "listeners/actionlistener.h"
#include "listeners/focuslistener.h"
@@ -43,6 +43,11 @@ class PopupList;
class ScrollArea;
class Skin;
+namespace gcn
+{
+ class ListModel;
+}
+
/**
* A drop down box from which you can select different values.
*
diff --git a/src/gui/widgets/dropshortcutcontainer.h b/src/gui/widgets/dropshortcutcontainer.h
index dbaac1d9c..236415b32 100644
--- a/src/gui/widgets/dropshortcutcontainer.h
+++ b/src/gui/widgets/dropshortcutcontainer.h
@@ -38,7 +38,7 @@ class DropShortcutContainer final : public ShortcutContainer
/**
* Constructor. Initializes the graphic.
*/
- DropShortcutContainer(Widget2 *const widget);
+ explicit DropShortcutContainer(Widget2 *const widget);
A_DELETE_COPY(DropShortcutContainer)
diff --git a/src/gui/widgets/emotepage.h b/src/gui/widgets/emotepage.h
index 8eb1e5f7b..8a508bd26 100644
--- a/src/gui/widgets/emotepage.h
+++ b/src/gui/widgets/emotepage.h
@@ -21,8 +21,6 @@
#ifndef GUI_WIDGETS_EMOTEPAGE_H
#define GUI_WIDGETS_EMOTEPAGE_H
-#include "gui/widgets/widget2.h"
-
#include "listeners/mouselistener.h"
#include "listeners/widgetlistener.h"
diff --git a/src/gui/widgets/emoteshortcutcontainer.cpp b/src/gui/widgets/emoteshortcutcontainer.cpp
index 47c45c2dd..296f21126 100644
--- a/src/gui/widgets/emoteshortcutcontainer.cpp
+++ b/src/gui/widgets/emoteshortcutcontainer.cpp
@@ -34,6 +34,8 @@
#include "resources/image.h"
+#include "resources/db/emotedb.h"
+
#include "debug.h"
static const int MAX_ITEMS = 48;
diff --git a/src/gui/widgets/emoteshortcutcontainer.h b/src/gui/widgets/emoteshortcutcontainer.h
index ec0e98675..a3061441f 100644
--- a/src/gui/widgets/emoteshortcutcontainer.h
+++ b/src/gui/widgets/emoteshortcutcontainer.h
@@ -24,12 +24,12 @@
#include "gui/widgets/shortcutcontainer.h"
-#include "resources/db/emotedb.h"
-
#include <vector>
class TextPopup;
+struct EmoteSprite;
+
/**
* An emote shortcut container. Used to quickly use emoticons.
*
@@ -41,7 +41,7 @@ class EmoteShortcutContainer final : public ShortcutContainer
/**
* Constructor. Initializes the graphic.
*/
- EmoteShortcutContainer(Widget2 *const widget);
+ explicit EmoteShortcutContainer(Widget2 *const widget);
A_DELETE_COPY(EmoteShortcutContainer)
diff --git a/src/gui/widgets/guitable.cpp b/src/gui/widgets/guitable.cpp
index 84bc19e0e..324d4b23e 100644
--- a/src/gui/widgets/guitable.cpp
+++ b/src/gui/widgets/guitable.cpp
@@ -24,6 +24,8 @@
#include "client.h"
+#include "gui/gui.h"
+
#include "events/keyevent.h"
#include "input/keydata.h"
@@ -32,8 +34,6 @@
#include "listeners/actionlistener.h"
-#include "input/key.h"
-
#include "render/graphics.h"
#include "debug.h"
diff --git a/src/gui/widgets/icon.cpp b/src/gui/widgets/icon.cpp
index 73607c048..73c0db76c 100644
--- a/src/gui/widgets/icon.cpp
+++ b/src/gui/widgets/icon.cpp
@@ -22,6 +22,8 @@
#include "gui/widgets/icon.h"
+#include "gui/gui.h"
+
#include "resources/image.h"
#include "resources/resourcemanager.h"
diff --git a/src/gui/widgets/icon.h b/src/gui/widgets/icon.h
index 9dc4827ac..dffdb8e8c 100644
--- a/src/gui/widgets/icon.h
+++ b/src/gui/widgets/icon.h
@@ -23,8 +23,6 @@
#ifndef GUI_WIDGETS_ICON_H
#define GUI_WIDGETS_ICON_H
-#include "gui/widgets/widget2.h"
-
#include "gui/base/widget.hpp"
#include "localconsts.h"
diff --git a/src/gui/widgets/itemcontainer.h b/src/gui/widgets/itemcontainer.h
index 76dd51ef7..ab813b08f 100644
--- a/src/gui/widgets/itemcontainer.h
+++ b/src/gui/widgets/itemcontainer.h
@@ -23,8 +23,6 @@
#ifndef GUI_WIDGETS_ITEMCONTAINER_H
#define GUI_WIDGETS_ITEMCONTAINER_H
-#include "gui/widgets/widget2.h"
-
#include "listeners/keylistener.h"
#include "listeners/mouselistener.h"
#include "listeners/widgetlistener.h"
diff --git a/src/gui/widgets/label.cpp b/src/gui/widgets/label.cpp
index 73e3bca64..0c19d03c3 100644
--- a/src/gui/widgets/label.cpp
+++ b/src/gui/widgets/label.cpp
@@ -22,6 +22,7 @@
#include "gui/widgets/label.h"
#include "gui/font.h"
+#include "gui/gui.h"
#include "debug.h"
diff --git a/src/gui/widgets/layout.cpp b/src/gui/widgets/layout.cpp
index d9a818e0f..f16f40322 100644
--- a/src/gui/widgets/layout.cpp
+++ b/src/gui/widgets/layout.cpp
@@ -24,6 +24,8 @@
#include "logger.h"
+#include "gui/base/widgets/container.hpp"
+
#include <cassert>
#include "debug.h"
diff --git a/src/gui/widgets/layout.h b/src/gui/widgets/layout.h
index 013963bfa..85998d8e7 100644
--- a/src/gui/widgets/layout.h
+++ b/src/gui/widgets/layout.h
@@ -25,12 +25,16 @@
#include "localconsts.h"
-#include "gui/base/widgets/container.hpp"
-
#include <vector>
class LayoutCell;
+namespace gcn
+{
+ class Container;
+ class Widget;
+}
+
/**
* This class is a helper for adding widgets to nested tables in a window.
*/
diff --git a/src/gui/widgets/layouthelper.cpp b/src/gui/widgets/layouthelper.cpp
index 066cabaf8..7b8a428a9 100644
--- a/src/gui/widgets/layouthelper.cpp
+++ b/src/gui/widgets/layouthelper.cpp
@@ -22,6 +22,8 @@
#include "gui/widgets/layouthelper.h"
+#include "gui/base/widgets/container.hpp"
+
#include "debug.h"
LayoutHelper::LayoutHelper(gcn::Container *const container) :
diff --git a/src/gui/widgets/listbox.h b/src/gui/widgets/listbox.h
index cd20ea50a..f1ebee317 100644
--- a/src/gui/widgets/listbox.h
+++ b/src/gui/widgets/listbox.h
@@ -23,8 +23,6 @@
#ifndef GUI_WIDGETS_LISTBOX_H
#define GUI_WIDGETS_LISTBOX_H
-#include "gui/widgets/widget2.h"
-
#include "gui/base/widgets/listbox.hpp"
#include "localconsts.h"
diff --git a/src/gui/widgets/playerbox.cpp b/src/gui/widgets/playerbox.cpp
index 976a1c8f9..7ef543511 100644
--- a/src/gui/widgets/playerbox.cpp
+++ b/src/gui/widgets/playerbox.cpp
@@ -26,6 +26,8 @@
#include "being/being.h"
+#include "gui/gui.h"
+
#include "resources/image.h"
#include "debug.h"
diff --git a/src/gui/widgets/progressbar.h b/src/gui/widgets/progressbar.h
index 1d4d83687..a2c55e077 100644
--- a/src/gui/widgets/progressbar.h
+++ b/src/gui/widgets/progressbar.h
@@ -23,8 +23,6 @@
#ifndef GUI_WIDGETS_PROGRESSBAR_H
#define GUI_WIDGETS_PROGRESSBAR_H
-#include "gui/widgets/widget2.h"
-
#include "gui/base/widget.hpp"
#include "listeners/widgetlistener.h"
diff --git a/src/gui/widgets/progressindicator.cpp b/src/gui/widgets/progressindicator.cpp
index 8d4cdd67c..f5b295ec8 100644
--- a/src/gui/widgets/progressindicator.cpp
+++ b/src/gui/widgets/progressindicator.cpp
@@ -23,6 +23,8 @@
#include "simpleanimation.h"
+#include "gui/gui.h"
+
#include "resources/animation.h"
#include "resources/imageset.h"
diff --git a/src/gui/widgets/progressindicator.h b/src/gui/widgets/progressindicator.h
index 08526c7c2..e62e7ec90 100644
--- a/src/gui/widgets/progressindicator.h
+++ b/src/gui/widgets/progressindicator.h
@@ -22,8 +22,6 @@
#ifndef GUI_WIDGETS_PROGRESSINDICATOR_H
#define GUI_WIDGETS_PROGRESSINDICATOR_H
-#include "gui/widgets/widget2.h"
-
#include "gui/base/widget.hpp"
#include "localconsts.h"
@@ -37,7 +35,7 @@ class SimpleAnimation;
class ProgressIndicator final : public gcn::Widget
{
public:
- ProgressIndicator(Widget2 *const widget);
+ explicit ProgressIndicator(Widget2 *const widget);
A_DELETE_COPY(ProgressIndicator)
diff --git a/src/gui/widgets/radiobutton.cpp b/src/gui/widgets/radiobutton.cpp
index d52295b57..7b5c5fa11 100644
--- a/src/gui/widgets/radiobutton.cpp
+++ b/src/gui/widgets/radiobutton.cpp
@@ -31,6 +31,7 @@
#include "resources/image.h"
#include "gui/font.h"
+#include "gui/gui.h"
#include "debug.h"
diff --git a/src/gui/widgets/radiobutton.h b/src/gui/widgets/radiobutton.h
index faff6bc0e..2deb9a772 100644
--- a/src/gui/widgets/radiobutton.h
+++ b/src/gui/widgets/radiobutton.h
@@ -23,8 +23,6 @@
#ifndef GUI_WIDGETS_RADIOBUTTON_H
#define GUI_WIDGETS_RADIOBUTTON_H
-#include "gui/widgets/widget2.h"
-
#include "gui/base/widgets/radiobutton.hpp"
#include "localconsts.h"
diff --git a/src/gui/widgets/scrollarea.cpp b/src/gui/widgets/scrollarea.cpp
index 6dd2be526..0cadee888 100644
--- a/src/gui/widgets/scrollarea.cpp
+++ b/src/gui/widgets/scrollarea.cpp
@@ -25,6 +25,10 @@
#include "client.h"
#include "graphicsvertexes.h"
+#include "gui/gui.h"
+
+#include "resources/image.h"
+
#include "debug.h"
int ScrollArea::instances = 0;
diff --git a/src/gui/widgets/scrollarea.h b/src/gui/widgets/scrollarea.h
index bc652e296..39a7eea80 100644
--- a/src/gui/widgets/scrollarea.h
+++ b/src/gui/widgets/scrollarea.h
@@ -23,8 +23,6 @@
#ifndef GUI_WIDGETS_SCROLLAREA_H
#define GUI_WIDGETS_SCROLLAREA_H
-#include "gui/widgets/widget2.h"
-
#include "gui/base/widgets/scrollarea.hpp"
#include "listeners/widgetlistener.h"
diff --git a/src/gui/widgets/setupitem.cpp b/src/gui/widgets/setupitem.cpp
index 649388d04..1f5d48d06 100644
--- a/src/gui/widgets/setupitem.cpp
+++ b/src/gui/widgets/setupitem.cpp
@@ -25,9 +25,11 @@
#include "soundmanager.h"
#include "gui/font.h"
+#include "gui/gui.h"
#include "gui/windows/editdialog.h"
+#include "gui/widgets/button.h"
#include "gui/widgets/checkbox.h"
#include "gui/widgets/dropdown.h"
#include "gui/widgets/horizontcontainer.h"
@@ -37,6 +39,8 @@
#include "gui/widgets/sliderlist.h"
#include "gui/widgets/vertcontainer.h"
+#include "gui/widgets/tabs/setuptabscroll.h"
+
#include "utils/base64.h"
#include "utils/gettext.h"
#include "utils/mathutils.h"
diff --git a/src/gui/widgets/setupitem.h b/src/gui/widgets/setupitem.h
index b5261e2f4..87b7c46f9 100644
--- a/src/gui/widgets/setupitem.h
+++ b/src/gui/widgets/setupitem.h
@@ -21,14 +21,17 @@
#ifndef GUI_WIDGETS_SETUPITEM_H
#define GUI_WIDGETS_SETUPITEM_H
-#include "gui/widgets/button.h"
-#include "gui/widgets/tabs/setuptabscroll.h"
+//#include "gui/widgets/button.h"
+//#include "gui/widgets/tabs/setuptabscroll.h"
+
+#include "gui/widgets/widget2.h"
#include "listeners/actionlistener.h"
#include <list>
#include <vector>
+class Button;
class CheckBox;
class Configuration;
class DropDown;
@@ -36,6 +39,7 @@ class EditDialog;
class HorizontContainer;
class IntTextField;
class Label;
+class SetupTabScroll;
class Slider;
class SliderList;
class TextField;
diff --git a/src/gui/widgets/setuptouchitem.cpp b/src/gui/widgets/setuptouchitem.cpp
index b080de428..f4c213b2f 100644
--- a/src/gui/widgets/setuptouchitem.cpp
+++ b/src/gui/widgets/setuptouchitem.cpp
@@ -27,6 +27,8 @@
#include "gui/widgets/label.h"
#include "gui/widgets/vertcontainer.h"
+#include "gui/widgets/tabs/setuptabscroll.h"
+
#include <algorithm>
#include "debug.h"
diff --git a/src/gui/widgets/shortcutcontainer.cpp b/src/gui/widgets/shortcutcontainer.cpp
index 5df0eafb0..0482281ed 100644
--- a/src/gui/widgets/shortcutcontainer.cpp
+++ b/src/gui/widgets/shortcutcontainer.cpp
@@ -24,6 +24,8 @@
#include "graphicsvertexes.h"
+#include "gui/gui.h"
+
#include "debug.h"
float ShortcutContainer::mAlpha = 1.0;
diff --git a/src/gui/widgets/shortcutcontainer.h b/src/gui/widgets/shortcutcontainer.h
index 610cfef1f..115298081 100644
--- a/src/gui/widgets/shortcutcontainer.h
+++ b/src/gui/widgets/shortcutcontainer.h
@@ -23,8 +23,6 @@
#ifndef GUI_WIDGETS_SHORTCUTCONTAINER_H
#define GUI_WIDGETS_SHORTCUTCONTAINER_H
-#include "gui/widgets/widget2.h"
-
#include "listeners/mouselistener.h"
#include "gui/base/widget.hpp"
#include "listeners/widgetlistener.h"
diff --git a/src/gui/widgets/slider.cpp b/src/gui/widgets/slider.cpp
index 0c9b74202..c785f4016 100644
--- a/src/gui/widgets/slider.cpp
+++ b/src/gui/widgets/slider.cpp
@@ -29,6 +29,8 @@
#include "input/keydata.h"
+#include "gui/gui.h"
+
#include "resources/image.h"
#include "debug.h"
diff --git a/src/gui/widgets/slider.h b/src/gui/widgets/slider.h
index d03799cae..2f21127d1 100644
--- a/src/gui/widgets/slider.h
+++ b/src/gui/widgets/slider.h
@@ -23,8 +23,6 @@
#ifndef GUI_WIDGETS_SLIDER_H
#define GUI_WIDGETS_SLIDER_H
-#include "gui/widgets/widget2.h"
-
#include "gui/base/widgets/slider.hpp"
#include "localconsts.h"
diff --git a/src/gui/widgets/sliderlist.cpp b/src/gui/widgets/sliderlist.cpp
index 93a6934ba..c5791f1c2 100644
--- a/src/gui/widgets/sliderlist.cpp
+++ b/src/gui/widgets/sliderlist.cpp
@@ -23,6 +23,8 @@
#include "gui/font.h"
#include "gui/gui.h"
+#include "gui/base/listmodel.hpp"
+
#include "gui/widgets/button.h"
#include "gui/widgets/label.h"
diff --git a/src/gui/widgets/sliderlist.h b/src/gui/widgets/sliderlist.h
index 785ada74b..9adba8080 100644
--- a/src/gui/widgets/sliderlist.h
+++ b/src/gui/widgets/sliderlist.h
@@ -21,8 +21,6 @@
#ifndef GUI_WIDGETS_SLIDERLIST_H
#define GUI_WIDGETS_SLIDERLIST_H
-#include "gui/base/listmodel.hpp"
-
#include "listeners/actionlistener.h"
#include "listeners/mouselistener.h"
@@ -33,6 +31,11 @@
class Button;
class Label;
+namespace gcn
+{
+ class ListModel;
+}
+
class SliderList final : public Container,
public ActionListener,
public MouseListener
diff --git a/src/gui/widgets/spellshortcutcontainer.cpp b/src/gui/widgets/spellshortcutcontainer.cpp
index 5441c4d8a..768206bdb 100644
--- a/src/gui/widgets/spellshortcutcontainer.cpp
+++ b/src/gui/widgets/spellshortcutcontainer.cpp
@@ -32,7 +32,6 @@
#include "gui/popups/spellpopup.h"
-#include "gui/windows/inventorywindow.h"
#include "gui/windows/shortcutwindow.h"
#include "resources/image.h"
diff --git a/src/gui/widgets/tabbedarea.cpp b/src/gui/widgets/tabbedarea.cpp
index af5892845..879ac8ec0 100644
--- a/src/gui/widgets/tabbedarea.cpp
+++ b/src/gui/widgets/tabbedarea.cpp
@@ -69,6 +69,8 @@
#include "input/keydata.h"
+#include "gui/gui.h"
+
#include "gui/widgets/button.h"
#include "gui/widgets/scrollarea.h"
#include "gui/widgets/tabs/tab.h"
diff --git a/src/gui/widgets/tabbedarea.h b/src/gui/widgets/tabbedarea.h
index 1d0794c5c..a95438605 100644
--- a/src/gui/widgets/tabbedarea.h
+++ b/src/gui/widgets/tabbedarea.h
@@ -66,8 +66,6 @@
#ifndef GUI_WIDGETS_TABBEDAREA_H
#define GUI_WIDGETS_TABBEDAREA_H
-#include "gui/widgets/widget2.h"
-
#include "listeners/keylistener.h"
#include "listeners/mouselistener.h"
#include "listeners/widgetlistener.h"
diff --git a/src/gui/widgets/tabs/chattab.cpp b/src/gui/widgets/tabs/chattab.cpp
index 283f1927e..b74dc53b8 100644
--- a/src/gui/widgets/tabs/chattab.cpp
+++ b/src/gui/widgets/tabs/chattab.cpp
@@ -24,6 +24,7 @@
#include "chatlogger.h"
#include "client.h"
+#include "commands.h"
#include "commandhandler.h"
#include "configuration.h"
#include "soundconsts.h"
diff --git a/src/gui/widgets/tabs/setup_audio.h b/src/gui/widgets/tabs/setup_audio.h
index 839734b39..aaadebf32 100644
--- a/src/gui/widgets/tabs/setup_audio.h
+++ b/src/gui/widgets/tabs/setup_audio.h
@@ -25,6 +25,8 @@
#include "gui/widgets/setupitem.h"
+#include "gui/widgets/tabs/setuptabscroll.h"
+
class Setup_Audio final : public SetupTabScroll
{
public:
diff --git a/src/gui/widgets/tabs/setup_colors.cpp b/src/gui/widgets/tabs/setup_colors.cpp
index 2aaad6301..9e78133f5 100644
--- a/src/gui/widgets/tabs/setup_colors.cpp
+++ b/src/gui/widgets/tabs/setup_colors.cpp
@@ -22,6 +22,7 @@
#include "gui/widgets/tabs/setup_colors.h"
#include "gui/font.h"
+#include "gui/gui.h"
#include "gui/userpalette.h"
#include "gui/widgets/browserbox.h"
diff --git a/src/gui/widgets/tabs/setup_colors.h b/src/gui/widgets/tabs/setup_colors.h
index 8864db7db..ce491706c 100644
--- a/src/gui/widgets/tabs/setup_colors.h
+++ b/src/gui/widgets/tabs/setup_colors.h
@@ -26,8 +26,6 @@
#include "listeners/selectionlistener.h"
-#include <string>
-
class BrowserBox;
class Label;
class ListBox;
diff --git a/src/gui/widgets/tabs/setup_input.cpp b/src/gui/widgets/tabs/setup_input.cpp
index 72d05d966..03c8f31e3 100644
--- a/src/gui/widgets/tabs/setup_input.cpp
+++ b/src/gui/widgets/tabs/setup_input.cpp
@@ -28,6 +28,7 @@
#include "input/inputmanager.h"
#include "input/keyboardconfig.h"
+#include "gui/gui.h"
#include "gui/setupactiondata.h"
#include "gui/windows/okdialog.h"
diff --git a/src/gui/widgets/tabs/setup_relations.h b/src/gui/widgets/tabs/setup_relations.h
index 55da0bedc..e32889008 100644
--- a/src/gui/widgets/tabs/setup_relations.h
+++ b/src/gui/widgets/tabs/setup_relations.h
@@ -27,6 +27,8 @@
#include "gui/widgets/tabs/setuptab.h"
+#include "listeners/playerrelationslistener.h"
+
class Button;
class CheckBox;
class DropDown;
diff --git a/src/gui/widgets/tabs/setup_theme.cpp b/src/gui/widgets/tabs/setup_theme.cpp
index fd70b9158..d27a095d5 100644
--- a/src/gui/widgets/tabs/setup_theme.cpp
+++ b/src/gui/widgets/tabs/setup_theme.cpp
@@ -22,6 +22,8 @@
#include "gui/widgets/tabs/setup_theme.h"
+#include "gui/gui.h"
+
#include "gui/windows/okdialog.h"
#include "gui/widgets/button.h"
diff --git a/src/gui/widgets/tabs/setup_touch.cpp b/src/gui/widgets/tabs/setup_touch.cpp
index 5d995f914..2baae029e 100644
--- a/src/gui/widgets/tabs/setup_touch.cpp
+++ b/src/gui/widgets/tabs/setup_touch.cpp
@@ -21,6 +21,8 @@
#include "gui/widgets/tabs/setup_touch.h"
#include "gui/widgets/layouthelper.h"
+#include "gui/widgets/namesmodel.h"
+#include "gui/widgets/setuptouchitem.h"
#include "gui/widgets/scrollarea.h"
#include "utils/gettext.h"
diff --git a/src/gui/widgets/tabs/setup_touch.h b/src/gui/widgets/tabs/setup_touch.h
index 9adc2d5cd..ef1afdda3 100644
--- a/src/gui/widgets/tabs/setup_touch.h
+++ b/src/gui/widgets/tabs/setup_touch.h
@@ -21,7 +21,10 @@
#ifndef GUI_WIDGETS_TABS_SETUP_TOUCH_H
#define GUI_WIDGETS_TABS_SETUP_TOUCH_H
-#include "gui/widgets/setuptouchitem.h"
+#include "gui/widgets/tabs/setuptabscroll.h"
+
+class NamesModel;
+class TouchActionsModel;
class Setup_Touch final : public SetupTabScroll
{
diff --git a/src/gui/widgets/tabs/setup_visual.h b/src/gui/widgets/tabs/setup_visual.h
index 2d40d3a08..1229757dd 100644
--- a/src/gui/widgets/tabs/setup_visual.h
+++ b/src/gui/widgets/tabs/setup_visual.h
@@ -24,6 +24,8 @@
#include "gui/widgets/setupitem.h"
+#include "gui/widgets/tabs/setuptabscroll.h"
+
class NamesModel;
class Setup_Visual final : public SetupTabScroll
diff --git a/src/gui/widgets/tabs/tab.cpp b/src/gui/widgets/tabs/tab.cpp
index c1650e8a8..2d91129f2 100644
--- a/src/gui/widgets/tabs/tab.cpp
+++ b/src/gui/widgets/tabs/tab.cpp
@@ -68,9 +68,13 @@
#include "client.h"
#include "graphicsvertexes.h"
+#include "gui/gui.h"
+
#include "gui/widgets/label.h"
#include "gui/widgets/tabbedarea.h"
+#include "resources/image.h"
+
#include "debug.h"
int Tab::mInstances = 0;
diff --git a/src/gui/widgets/tabs/tab.h b/src/gui/widgets/tabs/tab.h
index 878663e36..463a6b668 100644
--- a/src/gui/widgets/tabs/tab.h
+++ b/src/gui/widgets/tabs/tab.h
@@ -66,8 +66,6 @@
#ifndef GUI_WIDGETS_TABS_TAB_H
#define GUI_WIDGETS_TABS_TAB_H
-#include "gui/widgets/widget2.h"
-
#include "gui/base/basiccontainer.hpp"
#include "listeners/mouselistener.h"
diff --git a/src/gui/widgets/textbox.cpp b/src/gui/widgets/textbox.cpp
index 729d40ead..ec0d09a26 100644
--- a/src/gui/widgets/textbox.cpp
+++ b/src/gui/widgets/textbox.cpp
@@ -27,6 +27,7 @@
#include "input/keydata.h"
#include "gui/font.h"
+#include "gui/gui.h"
#include <sstream>
diff --git a/src/gui/widgets/textbox.h b/src/gui/widgets/textbox.h
index fe719faf8..24dd57adb 100644
--- a/src/gui/widgets/textbox.h
+++ b/src/gui/widgets/textbox.h
@@ -23,8 +23,6 @@
#ifndef GUI_WIDGETS_TEXTBOX_H
#define GUI_WIDGETS_TEXTBOX_H
-#include "gui/widgets/widget2.h"
-
#include "gui/base/widgets/textbox.hpp"
#include "localconsts.h"
diff --git a/src/gui/widgets/textfield.cpp b/src/gui/widgets/textfield.cpp
index 226d9172c..c30045c02 100644
--- a/src/gui/widgets/textfield.cpp
+++ b/src/gui/widgets/textfield.cpp
@@ -29,7 +29,7 @@
#include "events/keyevent.h"
#include "gui/font.h"
-#include "gui/sdlinput.h"
+#include "gui/gui.h"
#include "gui/viewport.h"
#include "gui/popups/popupmenu.h"
diff --git a/src/gui/widgets/textpreview.h b/src/gui/widgets/textpreview.h
index 532175a82..31f64f545 100644
--- a/src/gui/widgets/textpreview.h
+++ b/src/gui/widgets/textpreview.h
@@ -23,8 +23,6 @@
#ifndef GUI_WIDGETS_TEXTPREVIEW_H
#define GUI_WIDGETS_TEXTPREVIEW_H
-#include "gui/widgets/widget2.h"
-
#include "gui/base/widget.hpp"
#include "localconsts.h"
diff --git a/src/gui/widgets/widget2.h b/src/gui/widgets/widget2.h
index a57ccbb41..c6317702f 100644
--- a/src/gui/widgets/widget2.h
+++ b/src/gui/widgets/widget2.h
@@ -21,7 +21,6 @@
#ifndef GUI_WIDGETS_WIDGET2_H
#define GUI_WIDGETS_WIDGET2_H
-#include "gui/gui.h"
#include "gui/theme.h"
#include "render/renderers.h"
diff --git a/src/gui/widgets/window.h b/src/gui/widgets/window.h
index 64963be3e..37a9900ee 100644
--- a/src/gui/widgets/window.h
+++ b/src/gui/widgets/window.h
@@ -25,8 +25,6 @@
#include "render/graphics.h"
-#include "gui/widgets/widget2.h"
-
#include "listeners/widgetlistener.h"
#include "gui/base/widgets/window.hpp"
diff --git a/src/gui/windowmenu.cpp b/src/gui/windowmenu.cpp
index 4417f18a6..27418b892 100644
--- a/src/gui/windowmenu.cpp
+++ b/src/gui/windowmenu.cpp
@@ -35,6 +35,8 @@
#include "gui/specialswindow.h"
#endif
+#include "gui/widgets/button.h"
+
#include "utils/dtor.h"
#include "utils/gettext.h"
diff --git a/src/gui/windowmenu.h b/src/gui/windowmenu.h
index 1f2d8adb2..a1ed66a7d 100644
--- a/src/gui/windowmenu.h
+++ b/src/gui/windowmenu.h
@@ -26,9 +26,9 @@
#include "listeners/configlistener.h"
#include "gui/widgets/container.h"
-#include "gui/widgets/button.h"
#include "listeners/actionlistener.h"
+#include "listeners/mouselistener.h"
#include "listeners/selectionlistener.h"
#include "localconsts.h"
@@ -36,8 +36,8 @@
#include <map>
#include <vector>
+class Button;
class TextPopup;
-class Window;
struct ButtonInfo final
{
diff --git a/src/gui/windows/buydialog.h b/src/gui/windows/buydialog.h
index 500f378ef..aa163d5d0 100644
--- a/src/gui/windows/buydialog.h
+++ b/src/gui/windows/buydialog.h
@@ -35,7 +35,6 @@ class ShopListBox;
class SortListModelBuy;
class IntTextField;
class Label;
-class ListBox;
class ScrollArea;
class Slider;
diff --git a/src/gui/windows/charcreatedialog.cpp b/src/gui/windows/charcreatedialog.cpp
index d6b572d40..fb407b9cc 100644
--- a/src/gui/windows/charcreatedialog.cpp
+++ b/src/gui/windows/charcreatedialog.cpp
@@ -31,6 +31,7 @@
#include "gui/windows/okdialog.h"
#include "gui/widgets/button.h"
+#include "gui/windows/charselectdialog.h"
#include "gui/widgets/label.h"
#include "gui/widgets/playerbox.h"
#include "gui/widgets/radiobutton.h"
diff --git a/src/gui/windows/charcreatedialog.h b/src/gui/windows/charcreatedialog.h
index 123d826f2..12ddf7970 100644
--- a/src/gui/windows/charcreatedialog.h
+++ b/src/gui/windows/charcreatedialog.h
@@ -25,11 +25,13 @@
#include "being/being.h"
-#include "gui/windows/charselectdialog.h"
+#include "gui/widgets/window.h"
#include "listeners/actionlistener.h"
#include "listeners/keylistener.h"
+class Button;
+class CharSelectDialog;
class Label;
class PlayerBox;
class RadioButton;
diff --git a/src/gui/windows/charselectdialog.cpp b/src/gui/windows/charselectdialog.cpp
index 7c6e387a4..12a78ce10 100644
--- a/src/gui/windows/charselectdialog.cpp
+++ b/src/gui/windows/charselectdialog.cpp
@@ -44,6 +44,7 @@
#include "net/logindata.h"
#include "net/loginhandler.h"
+#include "net/net.h"
#include "utils/gettext.h"
diff --git a/src/gui/windows/charselectdialog.h b/src/gui/windows/charselectdialog.h
index 348811ee3..38c307f30 100644
--- a/src/gui/windows/charselectdialog.h
+++ b/src/gui/windows/charselectdialog.h
@@ -35,7 +35,6 @@
class Button;
class CharacterDisplay;
class CharacterViewBase;
-class Label;
class LoginData;
class TextDialog;
diff --git a/src/gui/windows/chatwindow.cpp b/src/gui/windows/chatwindow.cpp
index 45a76495b..565d3644a 100644
--- a/src/gui/windows/chatwindow.cpp
+++ b/src/gui/windows/chatwindow.cpp
@@ -40,8 +40,7 @@
#include "input/inputmanager.h"
#include "gui/focushandler.h"
-#include "gui/font.h"
-#include "gui/sdlinput.h"
+#include "gui/gui.h"
#include "gui/viewport.h"
#include "gui/windows/emotewindow.h"
diff --git a/src/gui/windows/didyouknowwindow.cpp b/src/gui/windows/didyouknowwindow.cpp
index 95d657772..79ad4c208 100644
--- a/src/gui/windows/didyouknowwindow.cpp
+++ b/src/gui/windows/didyouknowwindow.cpp
@@ -24,7 +24,7 @@
#include "configuration.h"
-#include "gui/font.h"
+#include "gui/gui.h"
#include "gui/windows/setupwindow.h"
@@ -78,7 +78,8 @@ DidYouKnowWindow::DidYouKnowWindow() :
Button *const okButton = new Button(this, _("Close"), "close", this);
mBrowserBox->setLinkHandler(this);
- mBrowserBox->setFont(gui->getHelpFont());
+ if (gui)
+ mBrowserBox->setFont(gui->getHelpFont());
mBrowserBox->setProcessVersion(true);
mBrowserBox->setEnableImages(true);
mBrowserBox->setEnableKeys(true);
diff --git a/src/gui/windows/helpwindow.cpp b/src/gui/windows/helpwindow.cpp
index 7457c7b1e..fa9963217 100644
--- a/src/gui/windows/helpwindow.cpp
+++ b/src/gui/windows/helpwindow.cpp
@@ -24,7 +24,7 @@
#include "configuration.h"
-#include "gui/font.h"
+#include "gui/gui.h"
#include "gui/windows/didyouknowwindow.h"
#include "gui/windows/setupwindow.h"
@@ -73,7 +73,8 @@ HelpWindow::HelpWindow() :
mBrowserBox->setOpaque(false);
mBrowserBox->setLinkHandler(this);
- mBrowserBox->setFont(gui->getHelpFont());
+ if (gui)
+ mBrowserBox->setFont(gui->getHelpFont());
mBrowserBox->setProcessVersion(true);
mBrowserBox->setEnableImages(true);
mBrowserBox->setEnableKeys(true);
diff --git a/src/gui/windows/inventorywindow.cpp b/src/gui/windows/inventorywindow.cpp
index bc66f588c..603b1b26d 100644
--- a/src/gui/windows/inventorywindow.cpp
+++ b/src/gui/windows/inventorywindow.cpp
@@ -33,8 +33,11 @@
#include "input/inputmanager.h"
#include "gui/font.h"
+#include "gui/gui.h"
#include "gui/viewport.h"
+#include "gui/base/listmodel.hpp"
+
#include "gui/popups/textpopup.h"
#include "gui/windows/equipmentwindow.h"
diff --git a/src/gui/windows/inventorywindow.h b/src/gui/windows/inventorywindow.h
index 6a6999034..c81e83d77 100644
--- a/src/gui/windows/inventorywindow.h
+++ b/src/gui/windows/inventorywindow.h
@@ -37,7 +37,6 @@ class Button;
class DropDown;
class Item;
class ItemContainer;
-class Label;
class LayoutCell;
class ProgressBar;
class SortListModelInv;
diff --git a/src/gui/windows/itemamountwindow.cpp b/src/gui/windows/itemamountwindow.cpp
index 8e981ae96..c63157e27 100644
--- a/src/gui/windows/itemamountwindow.cpp
+++ b/src/gui/windows/itemamountwindow.cpp
@@ -33,6 +33,8 @@
#include "net/net.h"
#include "gui/viewport.h"
+#include "gui/base/listmodel.hpp"
+
#include "gui/popups/itempopup.h"
#include "gui/windows/shopwindow.h"
diff --git a/src/gui/windows/npcdialog.h b/src/gui/windows/npcdialog.h
index b7b036659..b9fa1aab8 100644
--- a/src/gui/windows/npcdialog.h
+++ b/src/gui/windows/npcdialog.h
@@ -45,7 +45,6 @@ class ItemContainer;
class NpcDialog;
class PlayerBox;
class ScrollArea;
-class TextBox;
class TextField;
typedef std::map<int, NpcDialog*> NpcDialogs;
diff --git a/src/gui/windows/questswindow.cpp b/src/gui/windows/questswindow.cpp
index 1a8749899..d62ca36ad 100644
--- a/src/gui/windows/questswindow.cpp
+++ b/src/gui/windows/questswindow.cpp
@@ -27,6 +27,7 @@
#include "being/localplayer.h"
#include "gui/font.h"
+#include "gui/gui.h"
#include "gui/widgets/browserbox.h"
#include "gui/widgets/button.h"
@@ -166,7 +167,7 @@ QuestsWindow::QuestsWindow() :
mText->setLinkHandler(mItemLinkHandler);
mTextScrollArea->setHorizontalScrollPolicy(gcn::ScrollArea::SHOW_NEVER);
mQuestsListBox->setWidth(500);
- if (gui->getNpcFont()->getHeight() < 20)
+ if (gui && gui->getNpcFont()->getHeight() < 20)
mQuestsListBox->setRowHeight(20);
else
mQuestsListBox->setRowHeight(gui->getNpcFont()->getHeight());
diff --git a/src/gui/windows/serverdialog.cpp b/src/gui/windows/serverdialog.cpp
index 6823c2649..a06257b10 100644
--- a/src/gui/windows/serverdialog.cpp
+++ b/src/gui/windows/serverdialog.cpp
@@ -32,7 +32,9 @@
#include "input/keydata.h"
#include "gui/font.h"
+#include "gui/gui.h"
+#include "gui/widgets/checkbox.h"
#include "gui/windows/editserverdialog.h"
#include "gui/windows/logindialog.h"
@@ -132,7 +134,7 @@ void ServersListModel::setVersionString(const int index,
if (index < 0 || index >= static_cast<int>(mVersionStrings.size()))
return;
- if (version.empty())
+ if (version.empty() || !gui)
{
mVersionStrings[index] = VersionString(0, "");
}
diff --git a/src/gui/windows/serverdialog.h b/src/gui/windows/serverdialog.h
index 112c8001d..3f63562f7 100644
--- a/src/gui/windows/serverdialog.h
+++ b/src/gui/windows/serverdialog.h
@@ -24,7 +24,6 @@
#define GUI_WINDOWS_SERVERDIALOG_H
#include "gui/widgets/window.h"
-#include "gui/widgets/checkbox.h"
#include "net/download.h"
#include "net/serverinfo.h"
@@ -41,6 +40,7 @@
#include <vector>
class Button;
+class CheckBox;
class Label;
class ListBox;
class ServerDialog;
diff --git a/src/gui/windows/setupwindow.cpp b/src/gui/windows/setupwindow.cpp
index a996d776b..9878807d9 100644
--- a/src/gui/windows/setupwindow.cpp
+++ b/src/gui/windows/setupwindow.cpp
@@ -44,6 +44,7 @@
#include "gui/widgets/tabs/setup_video.h"
#include "gui/widgets/tabs/setup_visual.h"
+#include "gui/widgets/button.h"
#include "gui/widgets/label.h"
#include "gui/widgets/tabbedarea.h"
diff --git a/src/gui/windows/textcommandeditor.cpp b/src/gui/windows/textcommandeditor.cpp
index 98b9cae60..82d1c9ef6 100644
--- a/src/gui/windows/textcommandeditor.cpp
+++ b/src/gui/windows/textcommandeditor.cpp
@@ -27,6 +27,8 @@
#include "input/keyboardconfig.h"
+#include "gui/base/listmodel.hpp"
+
#include "gui/widgets/button.h"
#include "gui/widgets/dropdown.h"
#include "gui/widgets/inttextfield.h"
diff --git a/src/gui/windows/tradewindow.cpp b/src/gui/windows/tradewindow.cpp
index 25d077d5d..7fe1a1e36 100644
--- a/src/gui/windows/tradewindow.cpp
+++ b/src/gui/windows/tradewindow.cpp
@@ -32,6 +32,7 @@
#include "being/playerrelations.h"
#include "gui/font.h"
+#include "gui/gui.h"
#include "gui/windows/inventorywindow.h"
#include "gui/windows/itemamountwindow.h"