summaryrefslogtreecommitdiff
path: root/src/gui/widgets
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/widgets')
-rw-r--r--src/gui/widgets/characterdisplay.cpp1
-rw-r--r--src/gui/widgets/containerplacer.cpp40
-rw-r--r--src/gui/widgets/containerplacer.h67
-rw-r--r--src/gui/widgets/layout.cpp12
-rw-r--r--src/gui/widgets/layout.h34
-rw-r--r--src/gui/widgets/layouthelper.cpp1
-rw-r--r--src/gui/widgets/layouthelper.h2
-rw-r--r--src/gui/widgets/tabs/setup_audio.cpp1
-rw-r--r--src/gui/widgets/tabs/setup_chat.cpp1
-rw-r--r--src/gui/widgets/tabs/setup_colors.cpp1
-rw-r--r--src/gui/widgets/tabs/setup_input.cpp1
-rw-r--r--src/gui/widgets/tabs/setup_joystick.cpp1
-rw-r--r--src/gui/widgets/tabs/setup_mods.cpp1
-rw-r--r--src/gui/widgets/tabs/setup_other.cpp1
-rw-r--r--src/gui/widgets/tabs/setup_perfomance.cpp1
-rw-r--r--src/gui/widgets/tabs/setup_players.cpp1
-rw-r--r--src/gui/widgets/tabs/setup_relations.cpp1
-rw-r--r--src/gui/widgets/tabs/setup_theme.cpp1
-rw-r--r--src/gui/widgets/tabs/setup_touch.cpp1
-rw-r--r--src/gui/widgets/tabs/setup_video.cpp1
-rw-r--r--src/gui/widgets/tabs/setup_visual.cpp1
-rw-r--r--src/gui/widgets/window.cpp1
22 files changed, 126 insertions, 46 deletions
diff --git a/src/gui/widgets/characterdisplay.cpp b/src/gui/widgets/characterdisplay.cpp
index 85480db3a..6b21dac3b 100644
--- a/src/gui/widgets/characterdisplay.cpp
+++ b/src/gui/widgets/characterdisplay.cpp
@@ -32,6 +32,7 @@
#include "gui/popups/textpopup.h"
+#include "gui/widgets/containerplacer.h"
#include "gui/widgets/label.h"
#include "gui/widgets/layouthelper.h"
diff --git a/src/gui/widgets/containerplacer.cpp b/src/gui/widgets/containerplacer.cpp
new file mode 100644
index 000000000..1e9ac98ff
--- /dev/null
+++ b/src/gui/widgets/containerplacer.cpp
@@ -0,0 +1,40 @@
+/*
+ * The ManaPlus Client
+ * Copyright (C) 2007-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/widgets/containerplacer.h"
+
+#include "gui/widgets/basiccontainer2.h"
+#include "gui/widgets/layout.h"
+
+#include "debug.h"
+
+ContainerPlacer ContainerPlacer::at(const int x, const int y)
+{
+ return ContainerPlacer(mContainer, &mCell->at(x, y));
+}
+
+LayoutCell &ContainerPlacer::operator()
+ (const int x, const int y, Widget *const wg, const int w, const int h)
+{
+ mContainer->add(wg);
+ return mCell->place(wg, x, y, w, h);
+}
diff --git a/src/gui/widgets/containerplacer.h b/src/gui/widgets/containerplacer.h
new file mode 100644
index 000000000..379b2583d
--- /dev/null
+++ b/src/gui/widgets/containerplacer.h
@@ -0,0 +1,67 @@
+/*
+ * The ManaPlus Client
+ * Copyright (C) 2007-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_WIDGETS_CONTAINERPLACER_H
+#define GUI_WIDGETS_CONTAINERPLACER_H
+
+#include "localconsts.h"
+
+class BasicContainer2;
+class LayoutCell;
+class Widget;
+
+/**
+ * This class is a helper for adding widgets to nested tables in a window.
+ */
+class ContainerPlacer final
+{
+ public:
+ explicit ContainerPlacer(BasicContainer2 *c = nullptr,
+ LayoutCell *lc = nullptr) :
+ mContainer(c),
+ mCell(lc)
+ {}
+
+ /**
+ * Gets the pointed cell.
+ */
+ LayoutCell &getCell() A_WARN_UNUSED
+ { return *mCell; }
+
+ /**
+ * Returns a placer for the same container but to an inner cell.
+ */
+ ContainerPlacer at(const int x, const int y) A_WARN_UNUSED;
+
+ /**
+ * Adds the given widget to the container and places it in the layout.
+ * @see LayoutArray::place
+ */
+ LayoutCell &operator()(const int x, const int y, Widget *const wg,
+ const int w = 1, const int h = 1);
+
+ private:
+ BasicContainer2 *mContainer;
+ LayoutCell *mCell;
+};
+
+#endif // GUI_WIDGETS_CONTAINERPLACER_H
diff --git a/src/gui/widgets/layout.cpp b/src/gui/widgets/layout.cpp
index 410c8188e..d2f09864b 100644
--- a/src/gui/widgets/layout.cpp
+++ b/src/gui/widgets/layout.cpp
@@ -32,18 +32,6 @@
#include "debug.h"
-ContainerPlacer ContainerPlacer::at(const int x, const int y)
-{
- return ContainerPlacer(mContainer, &mCell->at(x, y));
-}
-
-LayoutCell &ContainerPlacer::operator()
- (const int x, const int y, Widget *const wg, const int w, const int h)
-{
- mContainer->add(wg);
- return mCell->place(wg, x, y, w, h);
-}
-
LayoutCell::~LayoutCell()
{
if (mType == ARRAY)
diff --git a/src/gui/widgets/layout.h b/src/gui/widgets/layout.h
index c9092f8bd..bf41e1c8e 100644
--- a/src/gui/widgets/layout.h
+++ b/src/gui/widgets/layout.h
@@ -32,40 +32,6 @@ class LayoutCell;
class Widget;
/**
- * This class is a helper for adding widgets to nested tables in a window.
- */
-class ContainerPlacer final
-{
- public:
- explicit ContainerPlacer(BasicContainer2 *c = nullptr,
- LayoutCell *lc = nullptr) :
- mContainer(c), mCell(lc)
- {}
-
- /**
- * Gets the pointed cell.
- */
- LayoutCell &getCell() A_WARN_UNUSED
- { return *mCell; }
-
- /**
- * Returns a placer for the same container but to an inner cell.
- */
- ContainerPlacer at(const int x, const int y) A_WARN_UNUSED;
-
- /**
- * Adds the given widget to the container and places it in the layout.
- * @see LayoutArray::place
- */
- LayoutCell &operator()(const int x, const int y, Widget *const wg,
- const int w = 1, const int h = 1);
-
- private:
- BasicContainer2 *mContainer;
- LayoutCell *mCell;
-};
-
-/**
* This class contains a rectangular array of cells.
*/
class LayoutArray final
diff --git a/src/gui/widgets/layouthelper.cpp b/src/gui/widgets/layouthelper.cpp
index a8cf28bea..f4f47d19d 100644
--- a/src/gui/widgets/layouthelper.cpp
+++ b/src/gui/widgets/layouthelper.cpp
@@ -23,6 +23,7 @@
#include "gui/widgets/layouthelper.h"
#include "gui/widgets/basiccontainer2.h"
+#include "gui/widgets/containerplacer.h"
#include "debug.h"
diff --git a/src/gui/widgets/layouthelper.h b/src/gui/widgets/layouthelper.h
index 78e34f419..1877e1940 100644
--- a/src/gui/widgets/layouthelper.h
+++ b/src/gui/widgets/layouthelper.h
@@ -27,6 +27,8 @@
#include "listeners/widgetlistener.h"
+class ContainerPlacer;
+
/**
* A helper class for adding a layout to a Guichan container widget. The layout
* will register itself as a widget listener and relayout the widgets in the
diff --git a/src/gui/widgets/tabs/setup_audio.cpp b/src/gui/widgets/tabs/setup_audio.cpp
index daf8ed8d2..9a4927dc9 100644
--- a/src/gui/widgets/tabs/setup_audio.cpp
+++ b/src/gui/widgets/tabs/setup_audio.cpp
@@ -33,6 +33,7 @@
#include "gui/models/soundsmodel.h"
+#include "gui/widgets/containerplacer.h"
#include "gui/widgets/layouthelper.h"
#include "gui/widgets/scrollarea.h"
diff --git a/src/gui/widgets/tabs/setup_chat.cpp b/src/gui/widgets/tabs/setup_chat.cpp
index 7ac88ab0a..897ae5d2a 100644
--- a/src/gui/widgets/tabs/setup_chat.cpp
+++ b/src/gui/widgets/tabs/setup_chat.cpp
@@ -24,6 +24,7 @@
#include "gui/windows/chatwindow.h"
+#include "gui/widgets/containerplacer.h"
#include "gui/widgets/layouthelper.h"
#include "gui/widgets/scrollarea.h"
#include "gui/widgets/setupitem.h"
diff --git a/src/gui/widgets/tabs/setup_colors.cpp b/src/gui/widgets/tabs/setup_colors.cpp
index 53260ff01..83b4c6c2a 100644
--- a/src/gui/widgets/tabs/setup_colors.cpp
+++ b/src/gui/widgets/tabs/setup_colors.cpp
@@ -26,6 +26,7 @@
#include "gui/userpalette.h"
#include "gui/widgets/browserbox.h"
+#include "gui/widgets/containerplacer.h"
#include "gui/widgets/label.h"
#include "gui/widgets/layouthelper.h"
#include "gui/widgets/listbox.h"
diff --git a/src/gui/widgets/tabs/setup_input.cpp b/src/gui/widgets/tabs/setup_input.cpp
index 74ee7a3dc..a22392fca 100644
--- a/src/gui/widgets/tabs/setup_input.cpp
+++ b/src/gui/widgets/tabs/setup_input.cpp
@@ -34,6 +34,7 @@
#include "gui/windows/okdialog.h"
#include "gui/widgets/button.h"
+#include "gui/widgets/containerplacer.h"
#include "gui/widgets/layouthelper.h"
#include "gui/widgets/listbox.h"
#include "gui/widgets/scrollarea.h"
diff --git a/src/gui/widgets/tabs/setup_joystick.cpp b/src/gui/widgets/tabs/setup_joystick.cpp
index eb7e163f0..385c29cf4 100644
--- a/src/gui/widgets/tabs/setup_joystick.cpp
+++ b/src/gui/widgets/tabs/setup_joystick.cpp
@@ -30,6 +30,7 @@
#include "gui/widgets/button.h"
#include "gui/widgets/checkbox.h"
+#include "gui/widgets/containerplacer.h"
#include "gui/widgets/dropdown.h"
#include "gui/widgets/label.h"
#include "gui/widgets/layouthelper.h"
diff --git a/src/gui/widgets/tabs/setup_mods.cpp b/src/gui/widgets/tabs/setup_mods.cpp
index b30b84c16..05a8af2a2 100644
--- a/src/gui/widgets/tabs/setup_mods.cpp
+++ b/src/gui/widgets/tabs/setup_mods.cpp
@@ -24,6 +24,7 @@
#include "configuration.h"
+#include "gui/widgets/containerplacer.h"
#include "gui/widgets/layouthelper.h"
#include "gui/widgets/setupitem.h"
#include "gui/widgets/scrollarea.h"
diff --git a/src/gui/widgets/tabs/setup_other.cpp b/src/gui/widgets/tabs/setup_other.cpp
index c00f68eef..2142d13f9 100644
--- a/src/gui/widgets/tabs/setup_other.cpp
+++ b/src/gui/widgets/tabs/setup_other.cpp
@@ -24,6 +24,7 @@
#include "gui/models/namesmodel.h"
+#include "gui/widgets/containerplacer.h"
#include "gui/widgets/layouthelper.h"
#include "gui/widgets/setupitem.h"
#include "gui/widgets/scrollarea.h"
diff --git a/src/gui/widgets/tabs/setup_perfomance.cpp b/src/gui/widgets/tabs/setup_perfomance.cpp
index dad054e83..c7c1edef8 100644
--- a/src/gui/widgets/tabs/setup_perfomance.cpp
+++ b/src/gui/widgets/tabs/setup_perfomance.cpp
@@ -24,6 +24,7 @@
#include "gui/models/namesmodel.h"
+#include "gui/widgets/containerplacer.h"
#include "gui/widgets/layouthelper.h"
#include "gui/widgets/scrollarea.h"
#include "gui/widgets/setupitem.h"
diff --git a/src/gui/widgets/tabs/setup_players.cpp b/src/gui/widgets/tabs/setup_players.cpp
index 441ebba58..728c7e1a9 100644
--- a/src/gui/widgets/tabs/setup_players.cpp
+++ b/src/gui/widgets/tabs/setup_players.cpp
@@ -22,6 +22,7 @@
#include "gui/widgets/tabs/setup_players.h"
+#include "gui/widgets/containerplacer.h"
#include "gui/widgets/layouthelper.h"
#include "gui/widgets/scrollarea.h"
#include "gui/widgets/setupitem.h"
diff --git a/src/gui/widgets/tabs/setup_relations.cpp b/src/gui/widgets/tabs/setup_relations.cpp
index 613e2c7f0..c6b820ec0 100644
--- a/src/gui/widgets/tabs/setup_relations.cpp
+++ b/src/gui/widgets/tabs/setup_relations.cpp
@@ -31,6 +31,7 @@
#include "gui/widgets/button.h"
#include "gui/widgets/checkbox.h"
+#include "gui/widgets/containerplacer.h"
#include "gui/widgets/dropdown.h"
#include "gui/widgets/label.h"
#include "gui/widgets/layouthelper.h"
diff --git a/src/gui/widgets/tabs/setup_theme.cpp b/src/gui/widgets/tabs/setup_theme.cpp
index 6994939fc..9e1eb558d 100644
--- a/src/gui/widgets/tabs/setup_theme.cpp
+++ b/src/gui/widgets/tabs/setup_theme.cpp
@@ -32,6 +32,7 @@
#include "gui/models/themesmodel.h"
#include "gui/widgets/button.h"
+#include "gui/widgets/containerplacer.h"
#include "gui/widgets/dropdown.h"
#include "gui/widgets/label.h"
#include "gui/widgets/layouthelper.h"
diff --git a/src/gui/widgets/tabs/setup_touch.cpp b/src/gui/widgets/tabs/setup_touch.cpp
index eab39ccb0..bb6f0ea42 100644
--- a/src/gui/widgets/tabs/setup_touch.cpp
+++ b/src/gui/widgets/tabs/setup_touch.cpp
@@ -23,6 +23,7 @@
#include "gui/models/namesmodel.h"
#include "gui/models/touchactionmodel.h"
+#include "gui/widgets/containerplacer.h"
#include "gui/widgets/layouthelper.h"
#include "gui/widgets/setuptouchitem.h"
#include "gui/widgets/scrollarea.h"
diff --git a/src/gui/widgets/tabs/setup_video.cpp b/src/gui/widgets/tabs/setup_video.cpp
index 7d6ac9fc3..9ecec5981 100644
--- a/src/gui/widgets/tabs/setup_video.cpp
+++ b/src/gui/widgets/tabs/setup_video.cpp
@@ -32,6 +32,7 @@
#include "gui/widgets/button.h"
#include "gui/widgets/checkbox.h"
+#include "gui/widgets/containerplacer.h"
#include "gui/widgets/label.h"
#include "gui/widgets/layouthelper.h"
#include "gui/widgets/listbox.h"
diff --git a/src/gui/widgets/tabs/setup_visual.cpp b/src/gui/widgets/tabs/setup_visual.cpp
index fa4e2f4ef..d9f3ec4cf 100644
--- a/src/gui/widgets/tabs/setup_visual.cpp
+++ b/src/gui/widgets/tabs/setup_visual.cpp
@@ -23,6 +23,7 @@
#include "gui/models/namesmodel.h"
+#include "gui/widgets/containerplacer.h"
#include "gui/widgets/layouthelper.h"
#include "gui/widgets/scrollarea.h"
diff --git a/src/gui/widgets/window.cpp b/src/gui/widgets/window.cpp
index 7e34476d0..1348b055c 100644
--- a/src/gui/widgets/window.cpp
+++ b/src/gui/widgets/window.cpp
@@ -78,6 +78,7 @@
#include "gui/skin.h"
#include "gui/viewport.h"
+#include "gui/widgets/containerplacer.h"
#include "gui/widgets/layout.h"
#include "resources/cursor.h"