summaryrefslogtreecommitdiff
path: root/src/gui/base
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-02-15 20:31:52 +0300
committerAndrei Karas <akaras@inbox.ru>2014-02-15 20:31:52 +0300
commit29f929794c7519b049de0be3af635f05d7e83be6 (patch)
tree5627bfcb7f19a349f065c207476c871bc5c3aa40 /src/gui/base
parent41d545176ffad2fb33158ca3415d2a0a983fffdb (diff)
downloadplus-29f929794c7519b049de0be3af635f05d7e83be6.tar.gz
plus-29f929794c7519b049de0be3af635f05d7e83be6.tar.bz2
plus-29f929794c7519b049de0be3af635f05d7e83be6.tar.xz
plus-29f929794c7519b049de0be3af635f05d7e83be6.zip
move some methods from base/graphics into render/graphics.
Remove base/graphcs.
Diffstat (limited to 'src/gui/base')
-rw-r--r--src/gui/base/basiccontainer.cpp3
-rw-r--r--src/gui/base/font.hpp4
-rw-r--r--src/gui/base/graphics.cpp179
-rw-r--r--src/gui/base/graphics.hpp294
-rw-r--r--src/gui/base/gui.cpp3
-rw-r--r--src/gui/base/gui.hpp3
-rw-r--r--src/gui/base/widget.cpp3
-rw-r--r--src/gui/base/widget.hpp3
-rw-r--r--src/gui/base/widgets/button.cpp3
-rw-r--r--src/gui/base/widgets/button.hpp3
-rw-r--r--src/gui/base/widgets/checkbox.cpp3
-rw-r--r--src/gui/base/widgets/container.cpp3
-rw-r--r--src/gui/base/widgets/container.hpp3
-rw-r--r--src/gui/base/widgets/label.cpp3
-rw-r--r--src/gui/base/widgets/label.hpp3
-rw-r--r--src/gui/base/widgets/listbox.cpp3
-rw-r--r--src/gui/base/widgets/radiobutton.cpp3
-rw-r--r--src/gui/base/widgets/scrollarea.cpp3
-rw-r--r--src/gui/base/widgets/slider.cpp3
-rw-r--r--src/gui/base/widgets/textbox.cpp3
-rw-r--r--src/gui/base/widgets/textfield.cpp3
-rw-r--r--src/gui/base/widgets/window.cpp3
22 files changed, 40 insertions, 494 deletions
diff --git a/src/gui/base/basiccontainer.cpp b/src/gui/base/basiccontainer.cpp
index 45bb1e231..7a937fb42 100644
--- a/src/gui/base/basiccontainer.cpp
+++ b/src/gui/base/basiccontainer.cpp
@@ -71,9 +71,10 @@
#include "gui/base/exception.hpp"
#include "gui/base/focushandler.hpp"
-#include "gui/base/graphics.hpp"
#include "gui/base/mouseinput.hpp"
+#include "render/graphics.h"
+
#include "debug.h"
namespace gcn
diff --git a/src/gui/base/font.hpp b/src/gui/base/font.hpp
index 8e8ad18c9..075af4136 100644
--- a/src/gui/base/font.hpp
+++ b/src/gui/base/font.hpp
@@ -68,10 +68,10 @@
#include "localconsts.h"
+class Graphics;
+
namespace gcn
{
- class Graphics;
-
/**
* Interface for a font.
*
diff --git a/src/gui/base/graphics.cpp b/src/gui/base/graphics.cpp
deleted file mode 100644
index fd76a1e6f..000000000
--- a/src/gui/base/graphics.cpp
+++ /dev/null
@@ -1,179 +0,0 @@
-/*
- * The ManaPlus Client
- * 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/>.
- */
-
-/* _______ __ __ __ ______ __ __ _______ __ __
- * / _____/\ / /\ / /\ / /\ / ____/\ / /\ / /\ / ___ /\ / |\/ /\
- * / /\____\// / // / // / // /\___\// /_// / // /\_/ / // , |/ / /
- * / / /__ / / // / // / // / / / ___ / // ___ / // /| ' / /
- * / /_// /\ / /_// / // / // /_/_ / / // / // /\_/ / // / | / /
- * /______/ //______/ //_/ //_____/\ /_/ //_/ //_/ //_/ //_/ /|_/ /
- * \______\/ \______\/ \_\/ \_____\/ \_\/ \_\/ \_\/ \_\/ \_\/ \_\/
- *
- * Copyright (c) 2004 - 2008 Olof Naessén and Per Larsson
- *
- *
- * Per Larsson a.k.a finalman
- * Olof Naessén a.k.a jansem/yakslem
- *
- * Visit: http://guichan.sourceforge.net
- *
- * License: (BSD)
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * 3. Neither the name of Guichan nor the names of its contributors may
- * be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
- * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/*
- * For comments regarding functions please see the header file.
- */
-
-#include "gui/base/graphics.hpp"
-
-#include "gui/base/exception.hpp"
-#include "gui/base/font.hpp"
-#include "resources/image.h"
-
-#include "debug.h"
-
-namespace gcn
-{
-
- Graphics::Graphics() :
- mClipStack(),
- mFont(nullptr)
- {
- }
-
- bool Graphics::pushClipArea(Rectangle area)
- {
- // Ignore area with a negate width or height
- // by simple pushing an empty clip area
- // to the stack.
- if (area.width < 0 || area.height < 0)
- {
- ClipRectangle carea;
- mClipStack.push(carea);
- return true;
- }
-
- if (mClipStack.empty())
- {
- ClipRectangle carea;
- carea.x = area.x;
- carea.y = area.y;
- carea.width = area.width;
- carea.height = area.height;
- carea.xOffset = area.x;
- carea.yOffset = area.y;
- mClipStack.push(carea);
- return true;
- }
-
- const ClipRectangle &top = mClipStack.top();
- ClipRectangle carea;
- carea = area;
- carea.xOffset = top.xOffset + carea.x;
- carea.yOffset = top.yOffset + carea.y;
- carea.x += top.xOffset;
- carea.y += top.yOffset;
-
- // Clamp the pushed clip rectangle.
- if (carea.x < top.x)
- carea.x = top.x;
-
- if (carea.y < top.y)
- carea.y = top.y;
-
- if (carea.x + carea.width > top.x + top.width)
- {
- carea.width = top.x + top.width - carea.x;
-
- if (carea.width < 0)
- carea.width = 0;
- }
-
- if (carea.y + carea.height > top.y + top.height)
- {
- carea.height = top.y + top.height - carea.y;
-
- if (carea.height < 0)
- carea.height = 0;
- }
-
- const bool result = carea.isIntersecting(top);
-
- mClipStack.push(carea);
-
- return result;
- }
-
- void Graphics::popClipArea()
- {
- if (mClipStack.empty())
- throw GCN_EXCEPTION("Tried to pop clip area from empty stack.");
-
- mClipStack.pop();
- }
-
- const ClipRectangle& Graphics::getCurrentClipArea()
- {
- if (mClipStack.empty())
- throw GCN_EXCEPTION("The clip area stack is empty.");
-
- return mClipStack.top();
- }
-
- void Graphics::drawImage(const Image* image A_UNUSED,
- int dstX A_UNUSED, int dstY A_UNUSED)
- {
- }
-
-/*
- void Graphics::setFont(Font* font)
- {
- }
-
- void Graphics::drawText(const std::string& text, int x, int y,
- Alignment alignment)
- {
- }
-*/
-} // namespace gcn
diff --git a/src/gui/base/graphics.hpp b/src/gui/base/graphics.hpp
deleted file mode 100644
index d3128c8ae..000000000
--- a/src/gui/base/graphics.hpp
+++ /dev/null
@@ -1,294 +0,0 @@
-/*
- * The ManaPlus Client
- * 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/>.
- */
-
-/* _______ __ __ __ ______ __ __ _______ __ __
- * / _____/\ / /\ / /\ / /\ / ____/\ / /\ / /\ / ___ /\ / |\/ /\
- * / /\____\// / // / // / // /\___\// /_// / // /\_/ / // , |/ / /
- * / / /__ / / // / // / // / / / ___ / // ___ / // /| ' / /
- * / /_// /\ / /_// / // / // /_/_ / / // / // /\_/ / // / | / /
- * /______/ //______/ //_/ //_____/\ /_/ //_/ //_/ //_/ //_/ /|_/ /
- * \______\/ \______\/ \_\/ \_____\/ \_\/ \_\/ \_\/ \_\/ \_\/ \_\/
- *
- * Copyright (c) 2004 - 2008 Olof Naessén and Per Larsson
- *
- *
- * Per Larsson a.k.a finalman
- * Olof Naessén a.k.a jansem/yakslem
- *
- * Visit: http://guichan.sourceforge.net
- *
- * License: (BSD)
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in
- * the documentation and/or other materials provided with the
- * distribution.
- * 3. Neither the name of Guichan nor the names of its contributors may
- * be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
- * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef GCN_GRAPHICS_HPP
-#define GCN_GRAPHICS_HPP
-
-#include <iosfwd>
-#include <stack>
-
-#include "gui/base/cliprectangle.hpp"
-
-namespace gcn
-{
- class Color;
- class Font;
- class Image;
-
- /**
- * Abstract class for providing drawing primitve functions.
- * It contains all vital functions for drawing.
- *
- * Guichan contains implementations of Graphics for common
- * libraries like the Allegro library, the HGE library,
- * the OpenGL library, the OpenLayer library, and the SDL library.
- * To make Guichan usable with other libraries, a Graphics class
- * must be implemented.
- *
- * In Graphics you can set clip areas to limit drawing to certain
- * areas of the screen. Clip areas are put on a stack, which
- * means that you can push smaller and smaller clip areas onto the
- * stack. All coordinates will be relative to the top most clip area.
- * In most cases you won't have to worry about the clip areas,
- * unless you want to implement some really complex widget.
- * Pushing and poping of clip areas are handled automatically by
- * container widgets when their child widgets are drawn.
- *
- * IMPORTANT: Remember to pop each clip area that you pushed on the stack
- * after you are done with it.
- *
- * If you feel that Graphics is to restrictive for your needs,
- * there is no one stopping you from using your own code for drawing
- * in widgets. You could for instance use pure SDL in the drawing of
- * widgets bypassing Graphics. This might however hurt portability of
- * your application.
- *
- * If you implement a Graphics class not present in Guichan we would
- * be very happy to add it to Guichan.
- *
- * @see AllegroGraphics, HGEGraphics, OpenLayerGraphics, OpenGLGraphics,
- * SDLGraphics, Image
- * @since 0.1.0
- */
- class Graphics
- {
- public:
- /**
- * Alignments for text drawing.
- */
- enum Alignment
- {
- LEFT = 0,
- CENTER,
- RIGHT
- };
-
- /**
- * Constructor.
- */
- Graphics();
-
- A_DELETE_COPY(Graphics)
-
- /**
- * Destructor.
- */
- virtual ~Graphics()
- { }
-
- /**
- * Initializes drawing. Called by the Gui when Gui::draw() is called.
- * It is needed by some implementations of Graphics to perform
- * preparations before drawing. An example of such an implementation
- * is the OpenGLGraphics.
- *
- * NOTE: You will never need to call this function yourself, unless
- * you use a Graphics object outside of Guichan.
- *
- * @see _endDraw, Gui::draw
- */
- virtual void _beginDraw()
- { }
-
- /**
- * Deinitializes drawing. Called by the Gui when a Gui::draw() is done.
- * done. It should reset any state changes made by _beginDraw().
- *
- * NOTE: You will never need to call this function yourself, unless
- * you use a Graphics object outside of Guichan.
- *
- * @see _beginDraw, Gui::draw
- */
- virtual void _endDraw()
- { }
-
- /**
- * Pushes a clip area onto the stack. The x and y coordinates in the
- * rectangle is relative to the last pushed clip area.
- * If the new area falls outside the current clip area, it will be
- * clipped as necessary.
- *
- * If a clip area is outside of the top clip area a clip area with
- * zero width and height will be pushed.
- *
- * @param area The clip area to be pushed onto the stack.
- * @return False if the the new area lays outside the current clip
- * area.
- */
- virtual bool pushClipArea(Rectangle area);
-
- /**
- * Removes the top most clip area from the stack.
- *
- * @throws Exception if the stack is empty.
- */
- virtual void popClipArea();
-
- /**
- * Gets the current clip area. Usefull if you want to do drawing
- * bypassing Graphics.
- *
- * @return The current clip area.
- */
- virtual const ClipRectangle& getCurrentClipArea();
-
- /**
- * Draws a part of an image.
- *
- * NOTE: Width and height arguments will not scale the image but
- * specifies the size of the part to be drawn. If you want
- * to draw the whole image there is a simplified version of
- * this function.
- *
- * EXAMPLE: @code drawImage(myImage, 10, 10, 20, 20, 40, 40); @endcode
- * Will draw a rectangular piece of myImage starting at
- * coordinate (10, 10) in myImage, with width and height 40.
- * The piece will be drawn with it's top left corner at
- * coordinate (20, 20).
- *
- * @param image The image to draw.
- * @param srcX The source image x coordinate.
- * @param srcY The source image y coordinate.
- * @param dstX The destination x coordinate.
- * @param dstY The destination y coordinate.
- * @param width The width of the piece.
- * @param height The height of the piece.
- */
- virtual void drawImage(const Image* image,
- int srcX,
- int srcY,
- int dstX,
- int dstY,
- int width,
- int height) = 0;
- /**
- * Draws an image. A simplified version of the other drawImage.
- * It will draw a whole image at the coordinate you specify.
- * It is equivalent to calling:
- * @code drawImage(myImage, 0, 0, dstX, dstY, image->getWidth(), \
- image->getHeight()); @endcode
- */
- virtual void drawImage(const Image* image, int dstX, int dstY);
-
- /**
- * Draws a single point/pixel.
- *
- * @param x The x coordinate.
- * @param y The y coordinate.
- */
- virtual void drawPoint(int x, int y) = 0;
-
- /**
- * Ddraws a line.
- *
- * @param x1 The first x coordinate.
- * @param y1 The first y coordinate.
- * @param x2 The second x coordinate.
- * @param y2 The second y coordinate.
- */
- virtual void drawLine(int x1, int y1, int x2, int y2) = 0;
-
- /**
- * Draws a simple, non-filled, rectangle with a one pixel width.
- *
- * @param rectangle The rectangle to draw.
- */
- virtual void drawRectangle(const Rectangle& rectangle) = 0;
-
- /**
- * Draws a filled rectangle.
- *
- * @param rectangle The filled rectangle to draw.
- */
- virtual void fillRectangle(const Rectangle& rectangle) = 0;
-
- /**
- * Sets the color to use when drawing.
- *
- * @param color A color.
- * @see getColor
- */
- virtual void setColor(const Color& color) = 0;
-
- /**
- * Gets the color to use when drawing.
- *
- * @return The color used when drawing.
- * @see setColor
- */
- virtual const Color& getColor() const = 0;
-
- protected:
- /**
- * Holds the clip area stack.
- */
- std::stack<ClipRectangle> mClipStack;
-
- /**
- * Holds the current font.
- */
- Font* mFont;
- };
-} // namespace gcn
-
-#endif // end GCN_GRAPHICS_HPP
diff --git a/src/gui/base/gui.cpp b/src/gui/base/gui.cpp
index e4827f716..73d6ff380 100644
--- a/src/gui/base/gui.cpp
+++ b/src/gui/base/gui.cpp
@@ -70,7 +70,6 @@
#include "gui/base/basiccontainer.hpp"
#include "gui/base/exception.hpp"
#include "gui/base/focushandler.hpp"
-#include "gui/base/graphics.hpp"
#include "gui/base/input.hpp"
#include "gui/base/keyinput.hpp"
#include "gui/base/keylistener.hpp"
@@ -78,6 +77,8 @@
#include "gui/base/mouselistener.hpp"
#include "gui/base/widget.hpp"
+#include "render/graphics.h"
+
#include "debug.h"
namespace gcn
diff --git a/src/gui/base/gui.hpp b/src/gui/base/gui.hpp
index b1daba0fc..28a231101 100644
--- a/src/gui/base/gui.hpp
+++ b/src/gui/base/gui.hpp
@@ -71,10 +71,11 @@
#include "gui/base/mouseevent.hpp"
#include "gui/base/mouseinput.hpp"
+class Graphics;
+
namespace gcn
{
class FocusHandler;
- class Graphics;
class Input;
class KeyListener;
class Widget;
diff --git a/src/gui/base/widget.cpp b/src/gui/base/widget.cpp
index 2e8719446..eeb5849c7 100644
--- a/src/gui/base/widget.cpp
+++ b/src/gui/base/widget.cpp
@@ -74,13 +74,14 @@
#include "gui/base/event.hpp"
#include "gui/base/exception.hpp"
#include "gui/base/focushandler.hpp"
-#include "gui/base/graphics.hpp"
#include "gui/base/keyinput.hpp"
#include "gui/base/keylistener.hpp"
#include "gui/base/mouseinput.hpp"
#include "gui/base/mouselistener.hpp"
#include "gui/base/widgetlistener.hpp"
+#include "render/graphics.h"
+
#include "debug.h"
namespace gcn
diff --git a/src/gui/base/widget.hpp b/src/gui/base/widget.hpp
index 847e340e1..b6a81261e 100644
--- a/src/gui/base/widget.hpp
+++ b/src/gui/base/widget.hpp
@@ -73,6 +73,8 @@
#include "localconsts.h"
+class Graphics;
+
namespace gcn
{
class ActionListener;
@@ -81,7 +83,6 @@ namespace gcn
class FocusHandler;
class FocusListener;
class Font;
- class Graphics;
class KeyInput;
class KeyListener;
class MouseInput;
diff --git a/src/gui/base/widgets/button.cpp b/src/gui/base/widgets/button.cpp
index a52bf2d78..3e699670a 100644
--- a/src/gui/base/widgets/button.cpp
+++ b/src/gui/base/widgets/button.cpp
@@ -69,11 +69,12 @@
#include "gui/base/exception.hpp"
#include "gui/base/font.hpp"
-#include "gui/base/graphics.hpp"
#include "gui/base/key.hpp"
#include "gui/base/mouseevent.hpp"
#include "gui/base/mouseinput.hpp"
+#include "render/graphics.h"
+
#include "debug.h"
namespace gcn
diff --git a/src/gui/base/widgets/button.hpp b/src/gui/base/widgets/button.hpp
index 4ae08eb16..cd41a1b02 100644
--- a/src/gui/base/widgets/button.hpp
+++ b/src/gui/base/widgets/button.hpp
@@ -67,12 +67,13 @@
#include <string>
#include "gui/base/focuslistener.hpp"
-#include "gui/base/graphics.hpp"
#include "gui/base/keylistener.hpp"
#include "gui/base/mouseevent.hpp"
#include "gui/base/mouselistener.hpp"
#include "gui/base/widget.hpp"
+#include "render/graphics.h"
+
namespace gcn
{
/**
diff --git a/src/gui/base/widgets/checkbox.cpp b/src/gui/base/widgets/checkbox.cpp
index 908b4f509..615808a85 100644
--- a/src/gui/base/widgets/checkbox.cpp
+++ b/src/gui/base/widgets/checkbox.cpp
@@ -68,10 +68,11 @@
#include "gui/base/widgets/checkbox.hpp"
#include "gui/base/font.hpp"
-#include "gui/base/graphics.hpp"
#include "gui/base/key.hpp"
#include "gui/base/mouseinput.hpp"
+#include "render/graphics.h"
+
#include "debug.h"
namespace gcn
diff --git a/src/gui/base/widgets/container.cpp b/src/gui/base/widgets/container.cpp
index 1e6de018b..d72f2a682 100644
--- a/src/gui/base/widgets/container.cpp
+++ b/src/gui/base/widgets/container.cpp
@@ -68,7 +68,8 @@
#include "gui/base/widgets/container.hpp"
#include "gui/base/exception.hpp"
-#include "gui/base/graphics.hpp"
+
+#include "render/graphics.h"
#include "debug.h"
diff --git a/src/gui/base/widgets/container.hpp b/src/gui/base/widgets/container.hpp
index a5cbdb31b..bffe6e884 100644
--- a/src/gui/base/widgets/container.hpp
+++ b/src/gui/base/widgets/container.hpp
@@ -67,7 +67,8 @@
#include <list>
#include "gui/base/basiccontainer.hpp"
-#include "gui/base/graphics.hpp"
+
+#include "render/graphics.h"
namespace gcn
{
diff --git a/src/gui/base/widgets/label.cpp b/src/gui/base/widgets/label.cpp
index 42fcd78f4..f4576d908 100644
--- a/src/gui/base/widgets/label.cpp
+++ b/src/gui/base/widgets/label.cpp
@@ -69,7 +69,8 @@
#include "gui/base/exception.hpp"
#include "gui/base/font.hpp"
-#include "gui/base/graphics.hpp"
+
+#include "render/graphics.h"
#include "debug.h"
diff --git a/src/gui/base/widgets/label.hpp b/src/gui/base/widgets/label.hpp
index f1ef30b89..90a395f7b 100644
--- a/src/gui/base/widgets/label.hpp
+++ b/src/gui/base/widgets/label.hpp
@@ -66,9 +66,10 @@
#include <string>
-#include "gui/base/graphics.hpp"
#include "gui/base/widget.hpp"
+#include "render/graphics.h"
+
namespace gcn
{
/**
diff --git a/src/gui/base/widgets/listbox.cpp b/src/gui/base/widgets/listbox.cpp
index b97bf47d4..dcf443c77 100644
--- a/src/gui/base/widgets/listbox.cpp
+++ b/src/gui/base/widgets/listbox.cpp
@@ -69,12 +69,13 @@
#include "gui/base/basiccontainer.hpp"
#include "gui/base/font.hpp"
-#include "gui/base/graphics.hpp"
#include "gui/base/key.hpp"
#include "gui/base/listmodel.hpp"
#include "gui/base/mouseinput.hpp"
#include "gui/base/selectionlistener.hpp"
+#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 bfd5b1ff8..1e1da2622 100644
--- a/src/gui/base/widgets/radiobutton.cpp
+++ b/src/gui/base/widgets/radiobutton.cpp
@@ -68,10 +68,11 @@
#include "gui/base/widgets/radiobutton.hpp"
#include "gui/base/font.hpp"
-#include "gui/base/graphics.hpp"
#include "gui/base/key.hpp"
#include "gui/base/mouseinput.hpp"
+#include "render/graphics.h"
+
#include "debug.h"
namespace gcn
diff --git a/src/gui/base/widgets/scrollarea.cpp b/src/gui/base/widgets/scrollarea.cpp
index e3dcfc61c..308cee473 100644
--- a/src/gui/base/widgets/scrollarea.cpp
+++ b/src/gui/base/widgets/scrollarea.cpp
@@ -68,7 +68,8 @@
#include "gui/base/widgets/scrollarea.hpp"
#include "gui/base/exception.hpp"
-#include "gui/base/graphics.hpp"
+
+#include "render/graphics.h"
#include "debug.h"
diff --git a/src/gui/base/widgets/slider.cpp b/src/gui/base/widgets/slider.cpp
index a1a106303..e9ab36e86 100644
--- a/src/gui/base/widgets/slider.cpp
+++ b/src/gui/base/widgets/slider.cpp
@@ -67,10 +67,11 @@
#include "gui/base/widgets/slider.hpp"
-#include "gui/base/graphics.hpp"
#include "gui/base/key.hpp"
#include "gui/base/mouseinput.hpp"
+#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 2e9ca0563..411fc7dd5 100644
--- a/src/gui/base/widgets/textbox.cpp
+++ b/src/gui/base/widgets/textbox.cpp
@@ -69,10 +69,11 @@
#include "gui/base/basiccontainer.hpp"
#include "gui/base/font.hpp"
-#include "gui/base/graphics.hpp"
#include "gui/base/key.hpp"
#include "gui/base/mouseinput.hpp"
+#include "render/graphics.h"
+
#include "debug.h"
namespace gcn
diff --git a/src/gui/base/widgets/textfield.cpp b/src/gui/base/widgets/textfield.cpp
index 586e49663..3349ebccb 100644
--- a/src/gui/base/widgets/textfield.cpp
+++ b/src/gui/base/widgets/textfield.cpp
@@ -68,10 +68,11 @@
#include "gui/base/widgets/textfield.hpp"
#include "gui/base/font.hpp"
-#include "gui/base/graphics.hpp"
#include "gui/base/key.hpp"
#include "gui/base/mouseinput.hpp"
+#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 c7a108ab8..6373bcb63 100644
--- a/src/gui/base/widgets/window.cpp
+++ b/src/gui/base/widgets/window.cpp
@@ -69,9 +69,10 @@
#include "gui/base/exception.hpp"
#include "gui/base/font.hpp"
-#include "gui/base/graphics.hpp"
#include "gui/base/mouseinput.hpp"
+#include "render/graphics.h"
+
#include "debug.h"
namespace gcn