From dd96213cdf64c5481c8d07dbd39ce1247f42d04e Mon Sep 17 00:00:00 2001
From: Bjørn Lindeijer <bjorn@lindeijer.nl>
Date: Sun, 5 Nov 2006 18:41:34 +0000
Subject: Merged the definition of ImageRect into graphics.h.

---
 ChangeLog                    |  6 ++++++
 src/CMakeLists.txt           |  1 -
 src/Makefile.am              |  3 +--
 src/graphic/imagerect.h      | 50 --------------------------------------------
 src/graphics.cpp             |  2 --
 src/graphics.h               | 21 +++++++++++++++++++
 src/gui/button.cpp           |  2 --
 src/gui/playerbox.cpp        |  2 --
 src/gui/progressbar.cpp      |  2 --
 src/gui/scrollarea.cpp       |  2 --
 src/gui/textfield.cpp        |  2 --
 src/gui/widgets/dropdown.cpp | 24 ++++++++++-----------
 src/gui/window.cpp           |  2 --
 13 files changed, 39 insertions(+), 80 deletions(-)
 delete mode 100644 src/graphic/imagerect.h

diff --git a/ChangeLog b/ChangeLog
index 16171bd1..531a8c25 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -9,6 +9,12 @@
 	wallpaper.
 	* src/resources/resourcemanager.cpp: More useful logging about
 	resources that are being loaded (including source).
+	* src/graphics.cpp, src/gui/window.cpp, src/gui/button.cpp,
+	src/gui/widgets/dropdown.cpp, src/gui/textfield.cpp,
+	src/gui/playerbox.cpp, src/gui/progressbar.cpp,
+	src/gui/scrollarea.cpp, src/graphics.h, src/CMakeLists.txt,
+	src/Makefile.am, src/graphic, src/graphic/imagerect.h: Merged the
+	definition of ImageRect into graphics.h.
 
 2006-11-05  Yohann Ferreira  <bertram@cegetel.net>
 
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 8523b066..4fd8d880 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -36,7 +36,6 @@ INCLUDE_DIRECTORIES(
     )
 
 SET(SRCS
-    graphic/imagerect.h
     gui/box.cpp
     gui/box.h
     gui/browserbox.cpp
diff --git a/src/Makefile.am b/src/Makefile.am
index 5c8d77a0..09348700 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,8 +1,7 @@
 AUTOMAKE_OPTIONS = subdir-objects
 
 bin_PROGRAMS = tmw
-tmw_SOURCES = graphic/imagerect.h \
-	      gui/widgets/dropdown.cpp \
+tmw_SOURCES = gui/widgets/dropdown.cpp \
 	      gui/widgets/dropdown.h \
 	      gui/browserbox.cpp \
 	      gui/browserbox.h \
diff --git a/src/graphic/imagerect.h b/src/graphic/imagerect.h
deleted file mode 100644
index be63d4ac..00000000
--- a/src/graphic/imagerect.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- *  The Mana World
- *  Copyright 2004 The Mana World Development Team
- *
- *  This file is part of The Mana World.
- *
- *  The Mana World 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.
- *
- *  The Mana World 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 The Mana World; if not, write to the Free Software
- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- *
- *  $Id$
- */
-
-#ifndef _TMW_IMAGERECT_H
-#define _TMW_IMAGERECT_H
-
-class Image;
-
-/**
- * 9 images defining a rectangle. 4 corners, 4 sides and a middle area. The
- * topology is as follows:
- *
- * <pre>
- *  !-----!-----------------!-----!
- *  !  0  !        1        !  2  !
- *  !-----!-----------------!-----!
- *  !  3  !        4        !  5  !
- *  !-----!-----------------!-----!
- *  !  6  !        7        !  8  !
- *  !-----!-----------------!-----!
- * </pre>
- *
- * Sections 0, 2, 6 and 8 will remain as is. 1, 3, 4, 5 and 7 will be
- * repeated to fit the size of the widget.
- */
-struct ImageRect {
-    Image *grid[9];
-};
-
-#endif
diff --git a/src/graphics.cpp b/src/graphics.cpp
index 2757214a..065c0a46 100644
--- a/src/graphics.cpp
+++ b/src/graphics.cpp
@@ -25,8 +25,6 @@
 
 #include "log.h"
 
-#include "graphic/imagerect.h"
-
 #include "resources/image.h"
 
 Graphics::Graphics():
diff --git a/src/graphics.h b/src/graphics.h
index 3c060e97..b3d36653 100644
--- a/src/graphics.h
+++ b/src/graphics.h
@@ -31,6 +31,27 @@ class ImageRect;
 
 class SDL_Surface;
 
+/**
+ * 9 images defining a rectangle. 4 corners, 4 sides and a middle area. The
+ * topology is as follows:
+ *
+ * <pre>
+ *  !-----!-----------------!-----!
+ *  !  0  !        1        !  2  !
+ *  !-----!-----------------!-----!
+ *  !  3  !        4        !  5  !
+ *  !-----!-----------------!-----!
+ *  !  6  !        7        !  8  !
+ *  !-----!-----------------!-----!
+ * </pre>
+ *
+ * Sections 0, 2, 6 and 8 will remain as is. 1, 3, 4, 5 and 7 will be
+ * repeated to fit the size of the widget.
+ */
+struct ImageRect {
+    Image *grid[9];
+};
+
 /**
  * A central point of control for graphics.
  */
diff --git a/src/gui/button.cpp b/src/gui/button.cpp
index 9d01095b..31f38593 100644
--- a/src/gui/button.cpp
+++ b/src/gui/button.cpp
@@ -29,8 +29,6 @@
 
 #include "../graphics.h"
 
-#include "../graphic/imagerect.h"
-
 #include "../resources/image.h"
 #include "../resources/resourcemanager.h"
 
diff --git a/src/gui/playerbox.cpp b/src/gui/playerbox.cpp
index 46cd7e85..568c3350 100644
--- a/src/gui/playerbox.cpp
+++ b/src/gui/playerbox.cpp
@@ -26,8 +26,6 @@
 #include "../being.h"
 #include "../graphics.h"
 
-#include "../graphic/imagerect.h"
-
 #include "../resources/image.h"
 #include "../resources/resourcemanager.h"
 #include "../resources/spriteset.h"
diff --git a/src/gui/progressbar.cpp b/src/gui/progressbar.cpp
index 5f047c6a..2bdfc856 100644
--- a/src/gui/progressbar.cpp
+++ b/src/gui/progressbar.cpp
@@ -25,8 +25,6 @@
 
 #include "../graphics.h"
 
-#include "../graphic/imagerect.h"
-
 #include "../resources/image.h"
 #include "../resources/resourcemanager.h"
 
diff --git a/src/gui/scrollarea.cpp b/src/gui/scrollarea.cpp
index 18a1dfb4..903ec95d 100644
--- a/src/gui/scrollarea.cpp
+++ b/src/gui/scrollarea.cpp
@@ -25,8 +25,6 @@
 
 #include "../graphics.h"
 
-#include "../graphic/imagerect.h"
-
 #include "../resources/image.h"
 #include "../resources/resourcemanager.h"
 
diff --git a/src/gui/textfield.cpp b/src/gui/textfield.cpp
index 2e083d5a..adf41a9a 100644
--- a/src/gui/textfield.cpp
+++ b/src/gui/textfield.cpp
@@ -27,8 +27,6 @@
 
 #include "../graphics.h"
 
-#include "../graphic/imagerect.h"
-
 #include "../resources/image.h"
 #include "../resources/resourcemanager.h"
 
diff --git a/src/gui/widgets/dropdown.cpp b/src/gui/widgets/dropdown.cpp
index 34c6b93a..0bf0e673 100644
--- a/src/gui/widgets/dropdown.cpp
+++ b/src/gui/widgets/dropdown.cpp
@@ -25,8 +25,6 @@
 
 #include "../../graphics.h"
 
-#include "../../graphic/imagerect.h"
-
 #include "../../resources/image.h"
 #include "../../resources/resourcemanager.h"
 
@@ -138,17 +136,17 @@ void DropDown::draw(gcn::Graphics* graphics)
 
     drawButton(graphics);
 
-        if (mDroppedDown)
-        {
-            drawChildren(graphics);
-
-            // Draw two lines separating the ListBox with se selected
-            // element view.
-            graphics->setColor(highlightColor);
-            graphics->drawLine(0, h, getWidth(), h);
-            graphics->setColor(shadowColor);
-            graphics->drawLine(0, h + 1,getWidth(),h + 1);
-        }
+    if (mDroppedDown)
+    {
+        drawChildren(graphics);
+
+        // Draw two lines separating the ListBox with se selected
+        // element view.
+        graphics->setColor(highlightColor);
+        graphics->drawLine(0, h, getWidth(), h);
+        graphics->setColor(shadowColor);
+        graphics->drawLine(0, h + 1,getWidth(),h + 1);
+    }
 }
 
 void DropDown::drawBorder(gcn::Graphics *graphics)
diff --git a/src/gui/window.cpp b/src/gui/window.cpp
index c7860021..13d42c78 100644
--- a/src/gui/window.cpp
+++ b/src/gui/window.cpp
@@ -33,8 +33,6 @@
 #include "../graphics.h"
 #include "../log.h"
 
-#include "../graphic/imagerect.h"
-
 #include "../resources/image.h"
 #include "../resources/resourcemanager.h"
 
-- 
cgit v1.2.3-70-g09d2