summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorBjörn Steinbrink <B.Steinbrink@gmx.de>2005-08-13 12:49:52 +0000
committerBjörn Steinbrink <B.Steinbrink@gmx.de>2005-08-13 12:49:52 +0000
commit10b881f997384378a299bff358716db5183b65a5 (patch)
tree2231d834a69c1db68980c1ccefdc6586df351fc0 /src/gui
parentda5a71f65682dbb3f830be4d5ffcd0046aa7b7ce (diff)
downloadmana-10b881f997384378a299bff358716db5183b65a5.tar.gz
mana-10b881f997384378a299bff358716db5183b65a5.tar.bz2
mana-10b881f997384378a299bff358716db5183b65a5.tar.xz
mana-10b881f997384378a299bff358716db5183b65a5.zip
Huge header cleanup to reduce dependencies and compile time.
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/box.h4
-rw-r--r--src/gui/browserbox.cpp13
-rw-r--r--src/gui/browserbox.h11
-rw-r--r--src/gui/buddywindow.h6
-rw-r--r--src/gui/button.cpp10
-rw-r--r--src/gui/button.h8
-rw-r--r--src/gui/buy.cpp19
-rw-r--r--src/gui/buy.h10
-rw-r--r--src/gui/buysell.h2
-rw-r--r--src/gui/char_select.cpp19
-rw-r--r--src/gui/char_select.h10
-rw-r--r--src/gui/char_server.cpp11
-rw-r--r--src/gui/char_server.h4
-rw-r--r--src/gui/chargedialog.cpp5
-rw-r--r--src/gui/chargedialog.h6
-rw-r--r--src/gui/chat.cpp9
-rw-r--r--src/gui/chat.h15
-rw-r--r--src/gui/chatinput.cpp1
-rw-r--r--src/gui/checkbox.cpp4
-rw-r--r--src/gui/checkbox.h8
-rw-r--r--src/gui/confirm_dialog.cpp5
-rw-r--r--src/gui/confirm_dialog.h3
-rw-r--r--src/gui/equipmentwindow.cpp10
-rw-r--r--src/gui/equipmentwindow.h3
-rw-r--r--src/gui/focushandler.h2
-rw-r--r--src/gui/gui.cpp54
-rw-r--r--src/gui/gui.h13
-rw-r--r--src/gui/help.cpp6
-rw-r--r--src/gui/help.h6
-rw-r--r--src/gui/inttextbox.cpp2
-rw-r--r--src/gui/inttextbox.h3
-rw-r--r--src/gui/inventorywindow.cpp17
-rw-r--r--src/gui/inventorywindow.h6
-rw-r--r--src/gui/item_amount.cpp9
-rw-r--r--src/gui/item_amount.h9
-rw-r--r--src/gui/itemcontainer.cpp14
-rw-r--r--src/gui/itemcontainer.h12
-rw-r--r--src/gui/listbox.cpp2
-rw-r--r--src/gui/listbox.h2
-rw-r--r--src/gui/login.cpp20
-rw-r--r--src/gui/login.h8
-rw-r--r--src/gui/minimap.cpp6
-rw-r--r--src/gui/minimap.h5
-rw-r--r--src/gui/newskill.cpp6
-rw-r--r--src/gui/newskill.h8
-rw-r--r--src/gui/npc.h9
-rw-r--r--src/gui/npc_text.h7
-rw-r--r--src/gui/ok_dialog.cpp4
-rw-r--r--src/gui/ok_dialog.h2
-rw-r--r--src/gui/passwordfield.h1
-rw-r--r--src/gui/playerbox.cpp10
-rw-r--r--src/gui/playerbox.h5
-rw-r--r--src/gui/popupmenu.cpp19
-rw-r--r--src/gui/popupmenu.h11
-rw-r--r--src/gui/progressbar.cpp6
-rw-r--r--src/gui/progressbar.h7
-rw-r--r--src/gui/radiobutton.cpp3
-rw-r--r--src/gui/radiobutton.h6
-rw-r--r--src/gui/requesttrade.cpp6
-rw-r--r--src/gui/requesttrade.h8
-rw-r--r--src/gui/scrollarea.cpp7
-rw-r--r--src/gui/scrollarea.h6
-rw-r--r--src/gui/sell.cpp18
-rw-r--r--src/gui/sell.h11
-rw-r--r--src/gui/setup.cpp17
-rw-r--r--src/gui/setup.h7
-rw-r--r--src/gui/skill.h8
-rw-r--r--src/gui/slider.cpp3
-rw-r--r--src/gui/slider.h6
-rw-r--r--src/gui/stats.cpp5
-rw-r--r--src/gui/stats.h6
-rw-r--r--src/gui/status.cpp13
-rw-r--r--src/gui/status.h10
-rw-r--r--src/gui/textbox.cpp3
-rw-r--r--src/gui/textbox.h2
-rw-r--r--src/gui/textfield.cpp6
-rw-r--r--src/gui/textfield.h5
-rw-r--r--src/gui/trade.cpp54
-rw-r--r--src/gui/trade.h13
-rw-r--r--src/gui/updatewindow.cpp29
-rw-r--r--src/gui/updatewindow.h13
-rw-r--r--src/gui/window.cpp14
-rw-r--r--src/gui/window.h12
-rw-r--r--src/gui/windowcontainer.h2
84 files changed, 563 insertions, 217 deletions
diff --git a/src/gui/box.h b/src/gui/box.h
index d65a6ac3..dccbfc78 100644
--- a/src/gui/box.h
+++ b/src/gui/box.h
@@ -25,7 +25,9 @@
#ifndef BOX_H
#define BOX_H
-#include <guichan.hpp>
+#include <guichan/widgets/container.hpp>
+
+#include "../guichanfwd.h"
class Box : public gcn::Container
{
diff --git a/src/gui/browserbox.cpp b/src/gui/browserbox.cpp
index 504fb987..e00494cd 100644
--- a/src/gui/browserbox.cpp
+++ b/src/gui/browserbox.cpp
@@ -21,11 +21,14 @@
* $Id$
*/
-#include <guichan.hpp>
-#include "../graphics.h"
+#include <guichan/imagefont.hpp>
+
#include "../main.h"
+#ifdef USE_OPENGL
#include "../resources/resourcemanager.h"
+#endif
#include "browserbox.h"
+#include "linkhandler.h"
#include "gui.h"
int BrowserBox::instances = 0;
@@ -44,6 +47,7 @@ BrowserBox::BrowserBox(unsigned int mode):
if (instances == 0)
{
+#ifdef USE_OPENGL
if (useOpenGL) {
browserFont = new gcn::ImageFont(
ResourceManager::getInstance()->getRealPath(
@@ -51,8 +55,9 @@ BrowserBox::BrowserBox(unsigned int mode):
" abcdefghijklmnopqrstuvwxyz"
"ABCDEFGHIJKLMNOPQRSTUVWXYZ01234567"
"89:@!\"$%&/=?^+*#[]{}()<>_;'.,\\|-~`");
- }
- else {
+ } else
+#endif
+ {
browserFont = gui->getFont();
}
}
diff --git a/src/gui/browserbox.h b/src/gui/browserbox.h
index d9c88b14..3a829381 100644
--- a/src/gui/browserbox.h
+++ b/src/gui/browserbox.h
@@ -24,8 +24,15 @@
#ifndef __TMW_BROWSERBOX_H__
#define __TMW_BROWSERBOX_H__
-#include <guichan.hpp>
-#include "linkhandler.h"
+#include <iosfwd>
+#include <vector>
+
+#include <guichan/widget.hpp>
+#include <guichan/mouselistener.hpp>
+
+#include "../guichanfwd.h"
+
+class LinkHandler;
struct BROWSER_LINK {
int x1, x2, y1, y2; /**< Where link is placed */
diff --git a/src/gui/buddywindow.h b/src/gui/buddywindow.h
index 02f0bd77..4468f74e 100644
--- a/src/gui/buddywindow.h
+++ b/src/gui/buddywindow.h
@@ -24,8 +24,12 @@
#ifndef _TMW_BUDDYWINDOW_H
#define _TMW_BUDDYWINDOW_H
-#include <guichan.hpp>
+#include <guichan/widgets/button.hpp>
+#include <guichan/widgets/listbox.hpp>
+#include <guichan/widgets/scrollarea.hpp>
+
#include "window.h"
+
#include "../resources/buddylist.h"
/**
diff --git a/src/gui/button.cpp b/src/gui/button.cpp
index 0fe207c7..680a9152 100644
--- a/src/gui/button.cpp
+++ b/src/gui/button.cpp
@@ -22,6 +22,16 @@
*/
#include "button.h"
+
+#include <guichan/exception.hpp>
+#include <guichan/graphics.hpp>
+#include <guichan/imagefont.hpp>
+
+#include "../graphics.h"
+
+#include "../graphic/imagerect.h"
+
+#include "../resources/image.h"
#include "../resources/resourcemanager.h"
ImageRect Button::button[4];
diff --git a/src/gui/button.h b/src/gui/button.h
index c3be49f2..8873358d 100644
--- a/src/gui/button.h
+++ b/src/gui/button.h
@@ -24,9 +24,11 @@
#ifndef _TMW_BUTTON_H
#define _TMW_BUTTON_H
-#include <guichan.hpp>
-#include <string>
-#include "../graphics.h"
+#include <iosfwd>
+
+#include <guichan/widgets/button.hpp>
+
+class ImageRect;
/**
* Button widget. Same as the Guichan button but with custom look.
diff --git a/src/gui/buy.cpp b/src/gui/buy.cpp
index ecb1343e..9d7cd7b2 100644
--- a/src/gui/buy.cpp
+++ b/src/gui/buy.cpp
@@ -22,16 +22,25 @@
*/
#include "buy.h"
+
+#include <assert.h>
+#include <sstream>
+
+#include <guichan/widgets/label.hpp>
+
#include "button.h"
-#include "slider.h"
-#include "scrollarea.h"
#include "listbox.h"
-#include "../resources/itemmanager.h"
+#include "scrollarea.h"
+#include "shop.h"
+#include "slider.h"
+
#include "../game.h"
+
+#include "../resources/iteminfo.h"
+#include "../resources/itemmanager.h"
+
#include "../net/network.h"
-#include <sstream>
-#include <assert.h>
BuyDialog::BuyDialog():
Window("Buy"),
diff --git a/src/gui/buy.h b/src/gui/buy.h
index 50c92acd..92221a45 100644
--- a/src/gui/buy.h
+++ b/src/gui/buy.h
@@ -24,10 +24,16 @@
#ifndef _TMW_BUY_H
#define _TMW_BUY_H
+#include <vector>
+
+#include <guichan/actionlistener.hpp>
+#include <guichan/listmodel.hpp>
+
#include "window.h"
-#include "shop.h"
-#include <vector>
+#include "../guichanfwd.h"
+
+struct ITEM_SHOP;
/**
* The buy dialog.
diff --git a/src/gui/buysell.h b/src/gui/buysell.h
index dcba4ac0..4ff4f768 100644
--- a/src/gui/buysell.h
+++ b/src/gui/buysell.h
@@ -24,6 +24,8 @@
#ifndef _TMW_BUYSELL_H
#define _TMW_BUYSELL_H
+#include <guichan/widgets/button.hpp>
+
#include "window.h"
/**
diff --git a/src/gui/char_select.cpp b/src/gui/char_select.cpp
index c2bba9bc..245d11c7 100644
--- a/src/gui/char_select.cpp
+++ b/src/gui/char_select.cpp
@@ -22,14 +22,27 @@
*/
#include "char_select.h"
-#include "textfield.h"
+
+#include <sstream>
+
+#include <guichan/sdl/sdlinput.hpp>
+
#include "button.h"
+#include "gui.h"
#include "ok_dialog.h"
-#include "../main.h"
+#include "playerbox.h"
+#include "textfield.h"
+#include "windowcontainer.h"
+
+#include "../being.h"
#include "../game.h"
+#include "../graphics.h"
#include "../log.h"
+#include "../main.h"
+#include "../playerinfo.h"
+
+#include "../net/network.h"
#include "../net/protocol.h"
-#include <sstream>
CharSelectDialog::CharDeleteConfirm::CharDeleteConfirm(CharSelectDialog *m):
ConfirmDialog(m,
diff --git a/src/gui/char_select.h b/src/gui/char_select.h
index 5cdb0712..b229a04c 100644
--- a/src/gui/char_select.h
+++ b/src/gui/char_select.h
@@ -24,11 +24,13 @@
#ifndef _CHAR_SELECT_H
#define _CHAR_SELECT_H
-#include "../playerinfo.h"
-#include "../net/network.h"
-#include "gui.h"
#include "confirm_dialog.h"
-#include "playerbox.h"
+#include "window.h"
+
+#include "../guichanfwd.h"
+
+class PlayerBox;
+struct PLAYER_INFO;
/**
* Character selection dialog.
diff --git a/src/gui/char_server.cpp b/src/gui/char_server.cpp
index 01b39135..2f86590e 100644
--- a/src/gui/char_server.cpp
+++ b/src/gui/char_server.cpp
@@ -22,16 +22,23 @@
*/
#include "char_server.h"
+
+#include <guichan/sdl/sdlinput.hpp>
+
#include "button.h"
-#include "scrollarea.h"
+#include "gui.h"
#include "listbox.h"
#include "ok_dialog.h"
+#include "scrollarea.h"
+
+#include "../graphics.h"
#include "../log.h"
#include "../main.h"
#include "../playerinfo.h"
#include "../serverinfo.h"
+
#include "../net/network.h"
-#include "gui.h"
+
char server[30];
int showServerList = 1;
diff --git a/src/gui/char_server.h b/src/gui/char_server.h
index bd41a479..2457634d 100644
--- a/src/gui/char_server.h
+++ b/src/gui/char_server.h
@@ -24,8 +24,12 @@
#ifndef _CHAR_SEL_SERVER_H
#define _CHAR_SEL_SERVER_H
+#include <guichan/listmodel.hpp>
+
#include "window.h"
+#include "../guichanfwd.h"
+
/**
* The list model for the server list.
diff --git a/src/gui/chargedialog.cpp b/src/gui/chargedialog.cpp
index 25f4297e..5a475d72 100644
--- a/src/gui/chargedialog.cpp
+++ b/src/gui/chargedialog.cpp
@@ -25,11 +25,14 @@
*/
#include "chargedialog.h"
+
+#include "progressbar.h"
+
#include "../playerinfo.h"
ChargeDialog::ChargeDialog():
Window("")
-{
+{
setContentSize(180,70);
progBar = new ProgressBar(0.0f,20,40,140,25,128,128,128);
add(progBar);
diff --git a/src/gui/chargedialog.h b/src/gui/chargedialog.h
index 92eb1dd4..de1169b0 100644
--- a/src/gui/chargedialog.h
+++ b/src/gui/chargedialog.h
@@ -23,10 +23,10 @@
#ifndef _TMW_CHARGE_H
#define _TMW_CHARGE_H
-#include <guichan.hpp>
#include "window.h"
-#include "progressbar.h"
-
+
+class ProgressBar;
+
#define CHARGE_TIME 1000 // time in milliseconds it takes to charge up an attack
/**
diff --git a/src/gui/chat.cpp b/src/gui/chat.cpp
index 1a7eca65..16a1b662 100644
--- a/src/gui/chat.cpp
+++ b/src/gui/chat.cpp
@@ -22,14 +22,15 @@
*/
#include "chat.h"
-#include "textfield.h"
-#include "textbox.h"
+
+#include "browserbox.h"
#include "chatinput.h"
#include "gui.h"
+#include "scrollarea.h"
+
#include "../playerinfo.h"
+
#include "../net/network.h"
-#include <iostream>
-#include <guichan.hpp>
ChatWindow::ChatWindow(const std::string &logfile):
Window("")
diff --git a/src/gui/chat.h b/src/gui/chat.h
index 34e9c027..248aabc6 100644
--- a/src/gui/chat.h
+++ b/src/gui/chat.h
@@ -24,15 +24,16 @@
#ifndef _TMW_CHAT_H
#define _TMW_CHAT_H
-#include <guichan.hpp>
-#include <guichan/key.hpp>
-#include "window.h"
-#include "scrollarea.h"
-#include "browserbox.h"
-#include <SDL.h>
+#include <fstream>
#include <list>
#include <string>
-#include <fstream>
+
+#include "window.h"
+
+#include "../guichanfwd.h"
+
+class BrowserBox;
+class ScrollArea;
#define BY_GM 0 // those should be self-explanatory =)
#define BY_PLAYER 1
diff --git a/src/gui/chatinput.cpp b/src/gui/chatinput.cpp
index 028b7151..52e91f3a 100644
--- a/src/gui/chatinput.cpp
+++ b/src/gui/chatinput.cpp
@@ -22,7 +22,6 @@
*/
#include "chatinput.h"
-#include "../graphics.h"
ChatInput::ChatInput()
{
diff --git a/src/gui/checkbox.cpp b/src/gui/checkbox.cpp
index 052957ec..ce7762d9 100644
--- a/src/gui/checkbox.cpp
+++ b/src/gui/checkbox.cpp
@@ -22,9 +22,11 @@
*/
#include "checkbox.h"
+
#include "../graphics.h"
+
+#include "../resources/image.h"
#include "../resources/resourcemanager.h"
-#include <guichan.hpp>
int CheckBox::instances = 0;
Image *CheckBox::checkBoxNormal;
diff --git a/src/gui/checkbox.h b/src/gui/checkbox.h
index 947e6432..468a7f38 100644
--- a/src/gui/checkbox.h
+++ b/src/gui/checkbox.h
@@ -24,9 +24,11 @@
#ifndef _TMW_CHECKBOX_H
#define _TMW_CHECKBOX_H
-#include <guichan.hpp>
-#include <string>
-#include "../resources/image.h"
+#include <iosfwd>
+
+#include <guichan/widgets/checkbox.hpp>
+
+class Image;
/**
* Check box widget. Same as the Guichan check box but with custom look.
diff --git a/src/gui/confirm_dialog.cpp b/src/gui/confirm_dialog.cpp
index 61c4b009..75553f58 100644
--- a/src/gui/confirm_dialog.cpp
+++ b/src/gui/confirm_dialog.cpp
@@ -22,7 +22,12 @@
*/
#include "confirm_dialog.h"
+
+#include <guichan/widgets/label.hpp>
+
#include "button.h"
+#include "windowcontainer.h"
+
ConfirmDialog::ConfirmDialog(const std::string &title, const std::string &msg,
gcn::ActionListener *listener):
diff --git a/src/gui/confirm_dialog.h b/src/gui/confirm_dialog.h
index 3e24b0e2..cec13cc5 100644
--- a/src/gui/confirm_dialog.h
+++ b/src/gui/confirm_dialog.h
@@ -26,6 +26,9 @@
#include "window.h"
+#include "../guichanfwd.h"
+
+
/**
* An option dialog.
*
diff --git a/src/gui/equipmentwindow.cpp b/src/gui/equipmentwindow.cpp
index 8410750c..0aeb58e4 100644
--- a/src/gui/equipmentwindow.cpp
+++ b/src/gui/equipmentwindow.cpp
@@ -21,12 +21,18 @@
* $Id$
*/
-#include <guichan.hpp>
#include "equipmentwindow.h"
+
#include "../equipment.h"
+#include "../graphics.h"
+#include "../item.h"
#include "../log.h"
-#include "../resources/resourcemanager.h"
+
+#include "../graphic/spriteset.h"
+
#include "../resources/image.h"
+#include "../resources/iteminfo.h"
+#include "../resources/resourcemanager.h"
#include <sstream>
diff --git a/src/gui/equipmentwindow.h b/src/gui/equipmentwindow.h
index 2767a558..66ee420f 100644
--- a/src/gui/equipmentwindow.h
+++ b/src/gui/equipmentwindow.h
@@ -24,9 +24,10 @@
#ifndef _TMW_EQUIPMENT_H
#define _TMW_EQUIPMENT_H
-#include "../graphic/spriteset.h"
#include "window.h"
+class Spriteset;
+
/**
* Equipment dialog.
*
diff --git a/src/gui/focushandler.h b/src/gui/focushandler.h
index 39eda8bb..82476d17 100644
--- a/src/gui/focushandler.h
+++ b/src/gui/focushandler.h
@@ -24,7 +24,7 @@
#ifndef _TMW_FOCUSHANDLER_H
#define _TMW_FOCUSHANDLER_H
-#include <guichan.hpp>
+#include <guichan/focushandler.hpp>
/**
* The focus handler. This focus handler does exactly the same as the Guichan
diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp
index bd6a9ba4..95cd85d7 100644
--- a/src/gui/gui.cpp
+++ b/src/gui/gui.cpp
@@ -22,14 +22,33 @@
*/
#include "gui.h"
+
+#include <guichan/exception.hpp>
+#include <guichan/imagefont.hpp>
+
+#ifdef USE_OPENGL
+#include <guichan/opengl/openglimageloader.hpp>
+#endif
+
+#include <guichan/sdl/sdlimageloader.hpp>
+#include <guichan/sdl/sdlinput.hpp>
+
+#include "focushandler.h"
#include "window.h"
#include "windowcontainer.h"
-#include "focushandler.h"
-#include "../net/protocol.h"
-#include "../main.h"
+
+#include "../being.h"
+#include "../configuration.h"
#include "../engine.h"
#include "../game.h"
+#include "../graphics.h"
#include "../log.h"
+#include "../main.h"
+#include "../map.h"
+
+#include "../net/protocol.h"
+
+#include "../resources/image.h"
#include "../resources/resourcemanager.h"
extern Being* autoTarget;
@@ -52,35 +71,30 @@ Gui::Gui(Graphics *graphics):
mMouseCursor(NULL),
mCustomCursor(false)
{
- // Set graphics
guiGraphics = graphics;
//setGraphics(graphics);
- if (useOpenGL) {
#ifdef USE_OPENGL
+ if (useOpenGL) {
+ // Set graphics
setGraphics((gcn::OpenGLGraphics*)graphics);
+
+ // Set image loader
+ mHostImageLoader = new gcn::SDLImageLoader();
+ mImageLoader = new gcn::OpenGLImageLoader(mHostImageLoader);
+ } else
#endif
- }
- else {
+ {
+ // Set graphics
setGraphics((gcn::SDLGraphics*)graphics);
+
+ // Set image loader
+ mImageLoader = new gcn::SDLImageLoader();
}
// Set input
guiInput = new gcn::SDLInput();
setInput(guiInput);
- // Set image loader
-#ifdef USE_OPENGL
- if (useOpenGL) {
- mHostImageLoader = new gcn::SDLImageLoader();
- mImageLoader = new gcn::OpenGLImageLoader(mHostImageLoader);
- }
- else {
- mImageLoader = new gcn::SDLImageLoader();
- }
-#else
- mImageLoader = new gcn::SDLImageLoader();
-#endif
-
gcn::Image::setImageLoader(mImageLoader);
// Set focus handler
diff --git a/src/gui/gui.h b/src/gui/gui.h
index 02ea7caa..1075910e 100644
--- a/src/gui/gui.h
+++ b/src/gui/gui.h
@@ -24,11 +24,14 @@
#ifndef _TMW_GUI
#define _TMW_GUI
-#include <guichan.hpp>
-#include <guichan/sdl.hpp>
-#include "windowcontainer.h"
-#include "../graphics.h"
-#include "../configuration.h"
+#include <guichan/gui.hpp>
+
+#include "../configlistener.h"
+#include "../guichanfwd.h"
+
+class Graphics;
+class Image;
+class WindowContainer;
/**
* \defgroup GUI Core GUI related classes (widgets)
diff --git a/src/gui/help.cpp b/src/gui/help.cpp
index 3ff8f0f4..29a2d24b 100644
--- a/src/gui/help.cpp
+++ b/src/gui/help.cpp
@@ -22,10 +22,14 @@
*/
#include "help.h"
-#include "scrollarea.h"
+
#include "button.h"
+#include "browserbox.h"
+#include "scrollarea.h"
#include "textbox.h"
+
#include "../log.h"
+
#include "../resources/resourcemanager.h"
HelpWindow::HelpWindow():
diff --git a/src/gui/help.h b/src/gui/help.h
index 21e27c34..d2bada56 100644
--- a/src/gui/help.h
+++ b/src/gui/help.h
@@ -24,10 +24,12 @@
#ifndef _TMW_HELP_H
#define _TMW_HELP_H
-#include <guichan.hpp>
#include "window.h"
#include "linkhandler.h"
-#include "browserbox.h"
+
+#include "../guichanfwd.h"
+
+class BrowserBox;
/**
* The help dialog.
diff --git a/src/gui/inttextbox.cpp b/src/gui/inttextbox.cpp
index 16650799..781fb580 100644
--- a/src/gui/inttextbox.cpp
+++ b/src/gui/inttextbox.cpp
@@ -23,6 +23,8 @@
#include "inttextbox.h"
+#include <sstream>
+
IntTextBox::IntTextBox():
value(0)
{
diff --git a/src/gui/inttextbox.h b/src/gui/inttextbox.h
index c9eec49e..e3517c62 100644
--- a/src/gui/inttextbox.h
+++ b/src/gui/inttextbox.h
@@ -24,9 +24,6 @@
#ifndef INTTEXTBOX_H
#define INTTEXTBOX_H
-#include <iostream>
-#include <sstream>
-#include <guichan.hpp>
#include "textbox.h"
/**
diff --git a/src/gui/inventorywindow.cpp b/src/gui/inventorywindow.cpp
index 28dbd35e..81b4b7b6 100644
--- a/src/gui/inventorywindow.cpp
+++ b/src/gui/inventorywindow.cpp
@@ -22,13 +22,20 @@
*/
#include "inventorywindow.h"
-#include "popupmenu.h"
-#include "../playerinfo.h"
-#include "../inventory.h"
+
+#include <string>
+
#include "button.h"
-#include "scrollarea.h"
#include "item_amount.h"
-#include <string>
+#include "itemcontainer.h"
+#include "popupmenu.h"
+#include "scrollarea.h"
+
+#include "../inventory.h"
+#include "../item.h"
+#include "../playerinfo.h"
+
+#include "resources/iteminfo.h"
InventoryWindow::InventoryWindow():
Window("Inventory")
diff --git a/src/gui/inventorywindow.h b/src/gui/inventorywindow.h
index cb7f08f5..7d86d1aa 100644
--- a/src/gui/inventorywindow.h
+++ b/src/gui/inventorywindow.h
@@ -24,9 +24,13 @@
#ifndef _TMW_INVENTORYWINDOW_H
#define _TMW_INVENTORYWINDOW_H
-#include "itemcontainer.h"
#include "window.h"
+#include "../guichanfwd.h"
+
+class Item;
+class ItemContainer;
+
/**
* Inventory dialog.
*
diff --git a/src/gui/item_amount.cpp b/src/gui/item_amount.cpp
index e67992ea..a6ca9437 100644
--- a/src/gui/item_amount.cpp
+++ b/src/gui/item_amount.cpp
@@ -22,10 +22,15 @@
*/
#include "item_amount.h"
-#include "inventorywindow.h"
-#include "trade.h"
+
#include "button.h"
+#include "inttextbox.h"
+#include "inventorywindow.h"
#include "slider.h"
+#include "trade.h"
+
+#include "../inventory.h"
+#include "../item.h"
ItemAmountWindow::ItemAmountWindow(int usage, Window *parent):
Window("Select amount of items to drop.", true, parent)
diff --git a/src/gui/item_amount.h b/src/gui/item_amount.h
index add2a66c..5e485b6e 100644
--- a/src/gui/item_amount.h
+++ b/src/gui/item_amount.h
@@ -24,10 +24,13 @@
#ifndef _TMW_ITEM_AMOUNT_WINDOW_H
#define _TMW_ITEM_AMOUNT_WINDOW_H
+#include <iosfwd>
+
#include "window.h"
-#include "inttextbox.h"
-#include <string>
-#include <sstream>
+
+#include "../guichanfwd.h"
+
+class IntTextBox;
#define AMOUNT_TRADE_ADD 1
#define AMOUNT_ITEM_DROP 2
diff --git a/src/gui/itemcontainer.cpp b/src/gui/itemcontainer.cpp
index a4e7a7d0..e2eb6085 100644
--- a/src/gui/itemcontainer.cpp
+++ b/src/gui/itemcontainer.cpp
@@ -22,11 +22,19 @@
*/
#include "itemcontainer.h"
-#include "../main.h"
-#include "../log.h"
+
+#include <sstream>
+
#include "../graphics.h"
+#include "../inventory.h"
+#include "../item.h"
+#include "../log.h"
+
+#include "../graphic/spriteset.h"
+
+#include "../resources/image.h"
+#include "../resources/iteminfo.h"
#include "../resources/resourcemanager.h"
-#include <sstream>
ItemContainer::ItemContainer(Inventory *inventory):
inventory(inventory)
diff --git a/src/gui/itemcontainer.h b/src/gui/itemcontainer.h
index 6c1834ef..9cd92812 100644
--- a/src/gui/itemcontainer.h
+++ b/src/gui/itemcontainer.h
@@ -24,13 +24,13 @@
#ifndef _TMW_ITEMCONTAINER_H__
#define _TMW_ITEMCONTAINER_H__
-#include <iostream>
-#include <guichan.hpp>
+#include <guichan/mouselistener.hpp>
+#include <guichan/widget.hpp>
-#include "../item.h"
-#include "../inventory.h"
-#include "../resources/image.h"
-#include "../graphic/spriteset.h"
+class Image;
+class Inventory;
+class Item;
+class Spriteset;
/**
* An item container. Used to show items in inventory and trade dialog.
diff --git a/src/gui/listbox.cpp b/src/gui/listbox.cpp
index 0dd9203c..1e266fb8 100644
--- a/src/gui/listbox.cpp
+++ b/src/gui/listbox.cpp
@@ -22,8 +22,6 @@
*/
#include "listbox.h"
-#include "../graphics.h"
-#include "../main.h"
ListBox::ListBox():
gcn::ListBox()
diff --git a/src/gui/listbox.h b/src/gui/listbox.h
index 2238bffb..23b81a57 100644
--- a/src/gui/listbox.h
+++ b/src/gui/listbox.h
@@ -24,7 +24,7 @@
#ifndef __TMW_LISTBOX_H__
#define __TMW_LISTBOX_H__
-#include <guichan.hpp>
+#include <guichan/widgets/listbox.hpp>
/**
* A list box, meant to be used inside a scroll area. Same as the Guichan list
diff --git a/src/gui/login.cpp b/src/gui/login.cpp
index 38bcf6b3..09e9c925 100644
--- a/src/gui/login.cpp
+++ b/src/gui/login.cpp
@@ -22,17 +22,27 @@
*/
#include "login.h"
+
+#include <string>
+
+#include <guichan/sdl/sdlinput.hpp>
+
+#include <guichan/widgets/label.hpp>
+
#include "button.h"
#include "checkbox.h"
-#include "textfield.h"
-#include "passwordfield.h"
-#include "ok_dialog.h"
#include "gui.h"
+#include "ok_dialog.h"
+#include "passwordfield.h"
+#include "textfield.h"
+
+#include "../configuration.h"
+#include "../graphics.h"
+#include "../log.h"
#include "../main.h"
#include "../serverinfo.h"
-#include "../log.h"
+
#include "../net/network.h"
-#include <string>
LoginDialog::LoginDialog():
Window("Login")
diff --git a/src/gui/login.h b/src/gui/login.h
index dba74856..1ddb927f 100644
--- a/src/gui/login.h
+++ b/src/gui/login.h
@@ -24,10 +24,14 @@
#ifndef _TMW_LOGIN_H
#define _TMW_LOGIN_H
-#include <guichan.hpp>
-#include <string>
+#include <iosfwd>
+
+#include <guichan/actionlistener.hpp>
+
#include "window.h"
+#include "../guichanfwd.h"
+
/**
* The login dialog.
*
diff --git a/src/gui/minimap.cpp b/src/gui/minimap.cpp
index b4ef3491..7b2367c0 100644
--- a/src/gui/minimap.cpp
+++ b/src/gui/minimap.cpp
@@ -22,8 +22,12 @@
*/
#include "minimap.h"
+
#include "../being.h"
-#include "../main.h"
+#include "../graphics.h"
+#include "../map.h"
+
+#include "../resources/image.h"
#include "../resources/resourcemanager.h"
Minimap::Minimap():
diff --git a/src/gui/minimap.h b/src/gui/minimap.h
index 20063d15..aa9649f6 100644
--- a/src/gui/minimap.h
+++ b/src/gui/minimap.h
@@ -25,8 +25,9 @@
#define _TMW_MINIMAP_H
#include "window.h"
-#include "../map.h"
-#include "../resources/image.h"
+
+class Map;
+class Image;
/**
* Minimap dialog.
diff --git a/src/gui/newskill.cpp b/src/gui/newskill.cpp
index 800c4a28..12c87b36 100644
--- a/src/gui/newskill.cpp
+++ b/src/gui/newskill.cpp
@@ -26,7 +26,13 @@
*/
#include "newskill.h"
+
+#include <guichan/widgets/label.hpp>
+
#include "button.h"
+#include "progressbar.h"
+
+#include "../graphics.h"
char *skill_name[] = {
// 0-99
diff --git a/src/gui/newskill.h b/src/gui/newskill.h
index db15958b..cdd82ad2 100644
--- a/src/gui/newskill.h
+++ b/src/gui/newskill.h
@@ -24,10 +24,12 @@
#ifndef _TMW_NSKILL_H
#define _TMW_NSKILL_H
-#include <guichan.hpp>
#include "window.h"
-#include "progressbar.h"
-
+
+#include "../guichanfwd.h"
+
+class ProgressBar;
+
#define N_SKILL 100 // skill count constant
#define N_SKILL_CAT 9 // skill category count
#define N_SKILL_CAT_SIZE 10 // skill category maximum size
diff --git a/src/gui/npc.h b/src/gui/npc.h
index afe56805..8b694341 100644
--- a/src/gui/npc.h
+++ b/src/gui/npc.h
@@ -24,11 +24,16 @@
#ifndef _TMW_NPC_H
#define _TMW_NPC_H
-#include <guichan.hpp>
+#include <iosfwd>
#include <vector>
-#include <string>
+
+#include <guichan/actionlistener.hpp>
+#include <guichan/listmodel.hpp>
+
#include "window.h"
+#include "../guichanfwd.h"
+
/**
* The npc list dialog.
*
diff --git a/src/gui/npc_text.h b/src/gui/npc_text.h
index e3f16293..2930a00a 100644
--- a/src/gui/npc_text.h
+++ b/src/gui/npc_text.h
@@ -24,11 +24,12 @@
#ifndef _TMW_NPC_TEXT_H
#define _TMW_NPC_TEXT_H
-#include <guichan.hpp>
-#include <vector>
-#include <string>
+#include <iosfwd>
+
#include "window.h"
+#include "../guichanfwd.h"
+
/**
* The npc text dialog.
*
diff --git a/src/gui/ok_dialog.cpp b/src/gui/ok_dialog.cpp
index 8b7ef6d4..fd0408ac 100644
--- a/src/gui/ok_dialog.cpp
+++ b/src/gui/ok_dialog.cpp
@@ -22,7 +22,11 @@
*/
#include "ok_dialog.h"
+
+#include <guichan/widgets/label.hpp>
+
#include "button.h"
+#include "windowcontainer.h"
OkDialog::OkDialog(const std::string &title, const std::string &msg,
gcn::ActionListener *listener):
diff --git a/src/gui/ok_dialog.h b/src/gui/ok_dialog.h
index 1287bc7f..1db3dd4e 100644
--- a/src/gui/ok_dialog.h
+++ b/src/gui/ok_dialog.h
@@ -26,6 +26,8 @@
#include "window.h"
+#include "../guichanfwd.h"
+
/**
* An 'Ok' button dialog.
*
diff --git a/src/gui/passwordfield.h b/src/gui/passwordfield.h
index 05643f2f..15ca85c9 100644
--- a/src/gui/passwordfield.h
+++ b/src/gui/passwordfield.h
@@ -24,7 +24,6 @@
#ifndef __PASSWORDFIELD_H__
#define __PASSWORDFIELD_H__
-#include <guichan.hpp>
#include "textfield.h"
/**
diff --git a/src/gui/playerbox.cpp b/src/gui/playerbox.cpp
index 3b23f3f2..169c37fc 100644
--- a/src/gui/playerbox.cpp
+++ b/src/gui/playerbox.cpp
@@ -22,10 +22,18 @@
*/
#include "playerbox.h"
-#include "../main.h"
+
#include "../being.h"
+#include "../graphics.h"
+
+#include "../graphic/imagerect.h"
+#include "../graphic/spriteset.h"
+
+#include "../resources/image.h"
#include "../resources/resourcemanager.h"
+extern Spriteset *hairset, *playerset;
+
int PlayerBox::instances = 0;
ImageRect PlayerBox::background;
diff --git a/src/gui/playerbox.h b/src/gui/playerbox.h
index 39fa39b4..0f1a653f 100644
--- a/src/gui/playerbox.h
+++ b/src/gui/playerbox.h
@@ -24,8 +24,9 @@
#ifndef __TMW_PLAYERBOX_H__
#define __TMW_PLAYERBOX_H__
-#include <guichan.hpp>
-#include "../graphics.h"
+#include <guichan/widgets/scrollarea.hpp>
+
+class ImageRect;
/**
* A box showing a player. Draws the various hair styles a player can have
diff --git a/src/gui/popupmenu.cpp b/src/gui/popupmenu.cpp
index bd178ce1..17ca9edb 100644
--- a/src/gui/popupmenu.cpp
+++ b/src/gui/popupmenu.cpp
@@ -21,18 +21,29 @@
* $Id$
*/
+#include "popupmenu.h"
+
#include <assert.h>
+#include <iostream>
-#include "popupmenu.h"
+#include <guichan/focushandler.hpp>
+
+#include "browserbox.h"
#include "gui.h"
#include "inventorywindow.h"
#include "item_amount.h"
-#include "../graphics.h"
+
+#include "../being.h"
+#include "../floor_item.h"
#include "../game.h"
+#include "../graphics.h"
+#include "../inventory.h"
+#include "../item.h"
+
#include "../net/network.h"
+
+#include "../resources/iteminfo.h"
#include "../resources/itemmanager.h"
-#include "../item.h"
-#include "../inventory.h"
PopupMenu::PopupMenu():
diff --git a/src/gui/popupmenu.h b/src/gui/popupmenu.h
index f1bebabc..0ba9f485 100644
--- a/src/gui/popupmenu.h
+++ b/src/gui/popupmenu.h
@@ -24,13 +24,14 @@
#ifndef _TMW_POPUP_MENU_H
#define _TMW_POPUP_MENU_H
-#include <guichan.hpp>
#include "window.h"
#include "linkhandler.h"
-#include "browserbox.h"
-#include "../being.h"
-#include "../item.h"
-#include "../floor_item.h"
+
+class Being;
+class BrowserBox;
+class FloorItem;
+class Item;
+
/**
* Window showing popup menu.
diff --git a/src/gui/progressbar.cpp b/src/gui/progressbar.cpp
index 505262b6..26933e22 100644
--- a/src/gui/progressbar.cpp
+++ b/src/gui/progressbar.cpp
@@ -22,8 +22,12 @@
*/
#include "progressbar.h"
+
#include "../graphics.h"
-#include "../main.h"
+
+#include "../graphic/imagerect.h"
+
+#include "../resources/image.h"
#include "../resources/resourcemanager.h"
ImageRect ProgressBar::mBorder;
diff --git a/src/gui/progressbar.h b/src/gui/progressbar.h
index 9b0a1041..fe9e7085 100644
--- a/src/gui/progressbar.h
+++ b/src/gui/progressbar.h
@@ -24,9 +24,10 @@
#ifndef _TMW_PROGRESSBAR_H
#define _TMW_PROGRESSBAR_H
-#include <guichan.hpp>
-#include "../graphics.h"
-#include "../resources/image.h"
+#include <guichan/widget.hpp>
+
+class ImageRect;
+
/**
* A progress bar.
diff --git a/src/gui/radiobutton.cpp b/src/gui/radiobutton.cpp
index 7eae469f..d3358604 100644
--- a/src/gui/radiobutton.cpp
+++ b/src/gui/radiobutton.cpp
@@ -22,7 +22,10 @@
*/
#include "radiobutton.h"
+
#include "../graphics.h"
+
+#include "../resources/image.h"
#include "../resources/resourcemanager.h"
int RadioButton::instances = 0;
diff --git a/src/gui/radiobutton.h b/src/gui/radiobutton.h
index 2249059d..4f868fdb 100644
--- a/src/gui/radiobutton.h
+++ b/src/gui/radiobutton.h
@@ -24,8 +24,10 @@
#ifndef _TMW_RADIOBUTTON_H
#define _TMW_RADIOBUTTON_H
-#include <guichan.hpp>
-#include "../resources/image.h"
+#include <guichan/widgets/radiobutton.hpp>
+
+class Image;
+
/*
* Guichan based RadioButton with custom look
diff --git a/src/gui/requesttrade.cpp b/src/gui/requesttrade.cpp
index 4d9fe919..35654562 100644
--- a/src/gui/requesttrade.cpp
+++ b/src/gui/requesttrade.cpp
@@ -22,7 +22,13 @@
*/
#include "requesttrade.h"
+
+#include <sstream>
+
+#include <guichan/widgets/label.hpp>
+
#include "button.h"
+
#include "../net/network.h"
bool requestTradeDialogOpen = false;
diff --git a/src/gui/requesttrade.h b/src/gui/requesttrade.h
index 3ec36f6a..b6783331 100644
--- a/src/gui/requesttrade.h
+++ b/src/gui/requesttrade.h
@@ -24,12 +24,12 @@
#ifndef _TMW_REQUESTTRADE_H
#define _TMW_REQUESTTRADE_H
-#include <guichan.hpp>
-#include <vector>
-#include <string>
-#include <sstream>
+#include <iosfwd>
+
#include "window.h"
+#include "../guichanfwd.h"
+
extern bool requestTradeDialogOpen;
/**
diff --git a/src/gui/scrollarea.cpp b/src/gui/scrollarea.cpp
index 05fb49ce..6bc428e2 100644
--- a/src/gui/scrollarea.cpp
+++ b/src/gui/scrollarea.cpp
@@ -22,7 +22,12 @@
*/
#include "scrollarea.h"
-#include "../main.h"
+
+#include "../graphics.h"
+
+#include "../graphic/imagerect.h"
+
+#include "../resources/image.h"
#include "../resources/resourcemanager.h"
int ScrollArea::instances = 0;
diff --git a/src/gui/scrollarea.h b/src/gui/scrollarea.h
index 54f41690..f2e00466 100644
--- a/src/gui/scrollarea.h
+++ b/src/gui/scrollarea.h
@@ -24,8 +24,10 @@
#ifndef __TMW_SCROLLAREA_H__
#define __TMW_SCROLLAREA_H__
-#include <guichan.hpp>
-#include "../graphics.h"
+#include <guichan/widgets/scrollarea.hpp>
+
+class Image;
+class ImageRect;
/**
* A scroll area.
diff --git a/src/gui/sell.cpp b/src/gui/sell.cpp
index ed7658f2..920d90f6 100644
--- a/src/gui/sell.cpp
+++ b/src/gui/sell.cpp
@@ -22,16 +22,26 @@
*/
#include "sell.h"
+
+#include <assert.h>
+#include <sstream>
+
+#include <guichan/widgets/label.hpp>
+
#include "button.h"
-#include "slider.h"
-#include "scrollarea.h"
#include "listbox.h"
+#include "scrollarea.h"
+#include "shop.h"
+#include "slider.h"
+
#include "../game.h"
#include "../inventory.h"
+#include "../item.h"
+
+#include "../resources/iteminfo.h"
+
#include "../net/network.h"
-#include <sstream>
-#include <assert.h>
SellDialog::SellDialog():
Window("Sell")
diff --git a/src/gui/sell.h b/src/gui/sell.h
index e96eb712..9d1325a0 100644
--- a/src/gui/sell.h
+++ b/src/gui/sell.h
@@ -24,10 +24,17 @@
#ifndef _TMW_SELL_H
#define _TMW_SELL_H
+#include <vector>
+
+#include <guichan/actionlistener.hpp>
+#include <guichan/listmodel.hpp>
+
#include "window.h"
-#include "shop.h"
-#include <vector>
+#include "../guichanfwd.h"
+
+struct ITEM_SHOP;
+
/**
* The sell dialog.
diff --git a/src/gui/setup.cpp b/src/gui/setup.cpp
index ad38bae3..fa58d03b 100644
--- a/src/gui/setup.cpp
+++ b/src/gui/setup.cpp
@@ -22,16 +22,25 @@
*/
#include "setup.h"
-#include "gui.h"
+
+#include <iostream>
+#include <sstream>
+
+#include <guichan/widgets/label.hpp>
+
#include "button.h"
#include "checkbox.h"
-#include "scrollarea.h"
+#include "gui.h"
#include "listbox.h"
-#include "slider.h"
#include "ok_dialog.h"
+#include "scrollarea.h"
+#include "slider.h"
+
+#include "../configuration.h"
+#include "../graphics.h"
#include "../log.h"
#include "../main.h"
-#include <sstream>
+#include "../sound.h"
#define SETUP_WIDTH 240
diff --git a/src/gui/setup.h b/src/gui/setup.h
index 70491957..cfe709dc 100644
--- a/src/gui/setup.h
+++ b/src/gui/setup.h
@@ -24,8 +24,14 @@
#ifndef _TMW_SETUP_H
#define _TMW_SETUP_H
+#include <vector>
+
+#include <guichan/listmodel.hpp>
+
#include "window.h"
+#include "../guichanfwd.h"
+
/**
* The list model for mode list.
*
@@ -104,7 +110,6 @@ class Setup : public Window, public gcn::ActionListener
*/
void
action(const std::string& eventId);
-
};
extern Setup *setupWindow;
diff --git a/src/gui/skill.h b/src/gui/skill.h
index 7bff96cf..ffbea16f 100644
--- a/src/gui/skill.h
+++ b/src/gui/skill.h
@@ -24,7 +24,13 @@
#ifndef _TMW_SKILL_H
#define _TMW_SKILL_H
-#include <guichan.hpp>
+#include <vector>
+
+#include <guichan/widgets/button.hpp>
+#include <guichan/widgets/label.hpp>
+#include <guichan/widgets/listbox.hpp>
+#include <guichan/widgets/scrollarea.hpp>
+
#include "window.h"
struct SKILL {
diff --git a/src/gui/slider.cpp b/src/gui/slider.cpp
index 2d4e6c78..088b2794 100644
--- a/src/gui/slider.cpp
+++ b/src/gui/slider.cpp
@@ -22,7 +22,10 @@
*/
#include "slider.h"
+
#include "../graphics.h"
+
+#include "../resources/image.h"
#include "../resources/resourcemanager.h"
Image *Slider::hStart, *Slider::hMid, *Slider::hEnd, *Slider::hGrip;
diff --git a/src/gui/slider.h b/src/gui/slider.h
index dcfc8005..dc38b738 100644
--- a/src/gui/slider.h
+++ b/src/gui/slider.h
@@ -24,8 +24,10 @@
#ifndef _TMW_SLIDER_H
#define _TMW_SLIDER_H
-#include <guichan.hpp>
-#include "../resources/image.h"
+#include <guichan/widgets/slider.hpp>
+
+class Image;
+
/**
* Slider widget. Same as the Guichan slider but with custom look.
diff --git a/src/gui/stats.cpp b/src/gui/stats.cpp
index 2282301c..3948d25e 100644
--- a/src/gui/stats.cpp
+++ b/src/gui/stats.cpp
@@ -22,8 +22,13 @@
*/
#include "stats.h"
+
+#include <sstream>
+
#include "button.h"
+
#include "../playerinfo.h"
+
#include "../net/network.h"
StatsWindow::StatsWindow():
diff --git a/src/gui/stats.h b/src/gui/stats.h
index 03c4cda4..54bd892b 100644
--- a/src/gui/stats.h
+++ b/src/gui/stats.h
@@ -24,9 +24,11 @@
#ifndef _TMW_STATS_WINDOW_H
#define _TMW_STATS_WINDOW_H
+#include <iosfwd>
+
#include "window.h"
-#include <string>
-#include <sstream>
+
+#include "../guichanfwd.h"
/**
* Window showing player stats.
diff --git a/src/gui/status.cpp b/src/gui/status.cpp
index 941e9a01..67ca4458 100644
--- a/src/gui/status.cpp
+++ b/src/gui/status.cpp
@@ -22,13 +22,18 @@
*/
#include "status.h"
-#include "stats.h"
-#include "inventorywindow.h"
-#include "setup.h"
-#include "equipmentwindow.h"
+
#include "button.h"
+#include "equipmentwindow.h"
+#include "inventorywindow.h"
+#include "progressbar.h"
+#include "skill.h"
+#include "stats.h"
+
#include "../playerinfo.h"
+extern Window *setupWindow;
+
#define WIN_BORDER 5
#define CONTROLS_SEPARATOR 4
diff --git a/src/gui/status.h b/src/gui/status.h
index 02bd0a2f..7ef57ed9 100644
--- a/src/gui/status.h
+++ b/src/gui/status.h
@@ -24,10 +24,14 @@
#ifndef _TMW_STATS_H
#define _TMW_STATS_H
-#include <string>
+#include <iosfwd>
#include "window.h"
-#include "progressbar.h"
+
+#include "../guichanfwd.h"
+
+class ProgressBar;
+
/**
* The player status dialog.
@@ -62,7 +66,7 @@ class StatusWindow : public Window, public gcn::ActionListener {
gcn::Label *expLabel, *jobExpLabel;
ProgressBar *healthBar, *manaBar;
ProgressBar *xpBar, *jobXpBar;
- gcn::Button *statsButton, *skillsButton, *inventoryButton, *setupButton, *equipmentButton;
+ gcn::Button *statsButton, *skillsButton, *inventoryButton, *setupButton, *equipmentButton;
};
extern StatusWindow *statusWindow;
diff --git a/src/gui/textbox.cpp b/src/gui/textbox.cpp
index 06ee3598..315e0c0b 100644
--- a/src/gui/textbox.cpp
+++ b/src/gui/textbox.cpp
@@ -22,8 +22,11 @@
*/
#include "textbox.h"
+
#include <sstream>
+#include <guichan/basiccontainer.hpp>
+
TextBox::TextBox():
gcn::TextBox()
{
diff --git a/src/gui/textbox.h b/src/gui/textbox.h
index 5c315d15..54523281 100644
--- a/src/gui/textbox.h
+++ b/src/gui/textbox.h
@@ -24,7 +24,7 @@
#ifndef __TMW_TEXTBOX_H__
#define __TMW_TEXTBOX_H__
-#include <guichan.hpp>
+#include <guichan/widgets/textbox.hpp>
/**
* A text box, meant to be used inside a scroll area. Same as the Guichan text
diff --git a/src/gui/textfield.cpp b/src/gui/textfield.cpp
index 9470fd54..94ab856e 100644
--- a/src/gui/textfield.cpp
+++ b/src/gui/textfield.cpp
@@ -22,6 +22,12 @@
*/
#include "textfield.h"
+
+#include "../graphics.h"
+
+#include "../graphic/imagerect.h"
+
+#include "../resources/image.h"
#include "../resources/resourcemanager.h"
int TextField::instances = 0;
diff --git a/src/gui/textfield.h b/src/gui/textfield.h
index 6105e2f8..1ed802d7 100644
--- a/src/gui/textfield.h
+++ b/src/gui/textfield.h
@@ -24,9 +24,10 @@
#ifndef __TMW_TEXTFIELD_H__
#define __TMW_TEXTFIELD_H__
-#include <guichan.hpp>
+#include <guichan/widgets/textfield.hpp>
+
+class ImageRect;
-#include "../graphics.h"
/**
* A text field.
diff --git a/src/gui/trade.cpp b/src/gui/trade.cpp
index 87328f0c..0afa4a21 100644
--- a/src/gui/trade.cpp
+++ b/src/gui/trade.cpp
@@ -22,15 +22,25 @@
*/
#include "trade.h"
+
+#include <sstream>
+
+#include <guichan/widgets/label.hpp>
+
+#include "button.h"
#include "chat.h"
#include "inventorywindow.h"
#include "item_amount.h"
-#include "button.h"
+#include "itemcontainer.h"
#include "scrollarea.h"
#include "textfield.h"
+
+#include "../inventory.h"
+#include "../item.h"
+
#include "../net/network.h"
-#include "../equipment.h"
-#include <sstream>
+
+#include "../resources/iteminfo.h"
TradeWindow::TradeWindow():
Window("Trade: You")
@@ -42,21 +52,24 @@ TradeWindow::TradeWindow():
cancelButton = new Button("Cancel");
tradeButton = new Button("Trade");
- myItemContainer = new ItemContainer(&myInventory);
+ myInventory = new Inventory();
+ partnerInventory = new Inventory();
+
+ myItemContainer = new ItemContainer(myInventory);
myItemContainer->setPosition(2, 2);
myScroll = new ScrollArea(myItemContainer);
myScroll->setPosition(8, 8);
- partnerItemContainer = new ItemContainer(&partnerInventory);
+ partnerItemContainer = new ItemContainer(partnerInventory);
partnerItemContainer->setPosition(2, 58);
partnerScroll = new ScrollArea(partnerItemContainer);
partnerScroll->setPosition(8, 64);
-
+
moneyLabel = new gcn::Label("You get: 0z");
moneyField = new TextField();
-
+
addButton->setEventId("add");
okButton->setEventId("ok");
cancelButton->setEventId("cancel");
@@ -131,6 +144,9 @@ TradeWindow::~TradeWindow()
delete itemDescriptionLabel;
delete moneyField;
delete moneyLabel;
+
+ delete myInventory;
+ delete partnerInventory;
}
void TradeWindow::addMoney(int amount)
@@ -145,43 +161,43 @@ void TradeWindow::addItem(int id, bool own, int quantity,
bool equipment)
{
if (own) {
- myInventory.addItem(id, quantity, equipment);
+ myInventory->addItem(id, quantity, equipment);
} else {
- partnerInventory.addItem(id, quantity, equipment);
+ partnerInventory->addItem(id, quantity, equipment);
}
}
void TradeWindow::removeItem(int id, bool own)
{
if (own) {
- myInventory.removeItem(id);
+ myInventory->removeItem(id);
} else {
- partnerInventory.removeItem(id);
+ partnerInventory->removeItem(id);
}
}
void TradeWindow::changeQuantity(int index, bool own, int quantity)
{
if (own) {
- myInventory.getItem(index)->setQuantity(quantity);
+ myInventory->getItem(index)->setQuantity(quantity);
} else {
- partnerInventory.getItem(index)->setQuantity(quantity);
+ partnerInventory->getItem(index)->setQuantity(quantity);
}
}
void TradeWindow::increaseQuantity(int index, bool own, int quantity)
{
if (own) {
- myInventory.getItem(index)->increaseQuantity(quantity);
+ myInventory->getItem(index)->increaseQuantity(quantity);
} else {
- partnerInventory.getItem(index)->increaseQuantity(quantity);
+ partnerInventory->getItem(index)->increaseQuantity(quantity);
}
}
void TradeWindow::reset()
{
- myInventory.resetItems();
- partnerInventory.resetItems();
+ myInventory->resetItems();
+ partnerInventory->resetItems();
tradeButton->setEnabled(false);
okButton->setEnabled(true);
ok_other = false;
@@ -274,11 +290,11 @@ void TradeWindow::action(const std::string &eventId)
return;
}
- if (myInventory.getFreeSlot() < 1) {
+ if (myInventory->getFreeSlot() < 1) {
return;
}
- if (myInventory.contains(item)) {
+ if (myInventory->contains(item)) {
chatWindow->chat_log("Failed adding item. You can not "
"overlap one kind of item on the window.", BY_SERVER);
return;
diff --git a/src/gui/trade.h b/src/gui/trade.h
index b767d47b..44815d66 100644
--- a/src/gui/trade.h
+++ b/src/gui/trade.h
@@ -24,9 +24,14 @@
#ifndef _TMW_TRADE_H
#define _TMW_TRADE_H
-#include "itemcontainer.h"
#include "window.h"
-#include "scrollarea.h"
+
+#include "../guichanfwd.h"
+
+class Inventory;
+class Item;
+class ItemContainer;
+class ScrollArea;
/**
* Trade dialog.
@@ -101,8 +106,8 @@ class TradeWindow : public Window, gcn::ActionListener
*/
void action(const std::string& eventId);
- Inventory myInventory;
- Inventory partnerInventory;
+ Inventory *myInventory;
+ Inventory *partnerInventory;
ItemContainer *myItemContainer;
ItemContainer *partnerItemContainer;
diff --git a/src/gui/updatewindow.cpp b/src/gui/updatewindow.cpp
index 4295b8cf..480372d3 100644
--- a/src/gui/updatewindow.cpp
+++ b/src/gui/updatewindow.cpp
@@ -22,16 +22,31 @@
*/
#include "updatewindow.h"
-#include "ok_dialog.h"
+
+#include <cstdio>
+#include <iostream>
+#include <sstream>
+#include <SDL_thread.h>
+
+#include <curl/curl.h>
+
+#include <guichan/sdl/sdlinput.hpp>
+
+#include <guichan/widgets/label.hpp>
+
+#include "browserbox.h"
+#include "button.h"
#include "gui.h"
-#include "../main.h"
+#include "ok_dialog.h"
+#include "progressbar.h"
+#include "scrollarea.h"
+
+#include "../configuration.h"
+#include "../graphics.h"
#include "../log.h"
+#include "../main.h"
+
#include "../resources/resourcemanager.h"
-#include <curl/curl.h>
-#include <sstream>
-#include <iostream>
-#include <cstdio>
-#include <SDL_thread.h>
UpdaterWindow::UpdaterWindow():
diff --git a/src/gui/updatewindow.h b/src/gui/updatewindow.h
index b1d58a78..95c4f9d6 100644
--- a/src/gui/updatewindow.h
+++ b/src/gui/updatewindow.h
@@ -25,11 +25,14 @@
#define _UPDATERWINDOW_H
#include "window.h"
-#include "vbox.h"
-#include "progressbar.h"
-#include "button.h"
-#include "browserbox.h"
-#include "scrollarea.h"
+
+#include "../guichanfwd.h"
+
+class BrowserBox;
+class Button;
+class ProgressBar;
+class ScrollArea;
+class VBox;
/**
* Update progress window GUI
diff --git a/src/gui/window.cpp b/src/gui/window.cpp
index 0228e183..2ded3858 100644
--- a/src/gui/window.cpp
+++ b/src/gui/window.cpp
@@ -22,10 +22,20 @@
*/
#include "window.h"
+
+#include <guichan/exception.hpp>
+
#include "gui.h"
-#include "../resources/resourcemanager.h"
+#include "windowcontainer.h"
+
+#include "../configuration.h"
+#include "../graphics.h"
#include "../log.h"
-#include "../main.h"
+
+#include "../graphic/imagerect.h"
+
+#include "../resources/image.h"
+#include "../resources/resourcemanager.h"
WindowContainer *Window::windowContainer = NULL;
int Window::instances = 0;
diff --git a/src/gui/window.h b/src/gui/window.h
index 7441c804..731b7e9d 100644
--- a/src/gui/window.h
+++ b/src/gui/window.h
@@ -24,10 +24,14 @@
#ifndef _TMW_WINDOW_H__
#define _TMW_WINDOW_H__
-#include <guichan.hpp>
-#include "windowcontainer.h"
-#include "../graphics.h"
-#include "../configuration.h"
+#include <guichan/widgets/window.hpp>
+
+#include "../configlistener.h"
+#include "../guichanfwd.h"
+
+class ImageRect;
+class WindowContainer;
+
/**
* A window. This window can be dragged around and has a title bar.
diff --git a/src/gui/windowcontainer.h b/src/gui/windowcontainer.h
index c2cf59fd..f41a4a33 100644
--- a/src/gui/windowcontainer.h
+++ b/src/gui/windowcontainer.h
@@ -24,7 +24,7 @@
#ifndef _TMW_WINDOWCONTAINER_H_
#define _TMW_WINDOWCONTAINER_H_
-#include <guichan.hpp>
+#include <guichan/widgets/container.hpp>
class Window;