diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-02-22 14:59:26 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-02-22 14:59:26 +0300 |
commit | 63f0b730767b1185dc33f8892068d697e26a09bb (patch) | |
tree | 9f3bcba891cb747b2b4696651b8df464a8a1fc86 | |
parent | 48646db55005a0da079bd2c945875dc8225e2f86 (diff) | |
download | manaverse-63f0b730767b1185dc33f8892068d697e26a09bb.tar.gz manaverse-63f0b730767b1185dc33f8892068d697e26a09bb.tar.bz2 manaverse-63f0b730767b1185dc33f8892068d697e26a09bb.tar.xz manaverse-63f0b730767b1185dc33f8892068d697e26a09bb.zip |
Move Rectangle and ClipRectangle into gui directory.
92 files changed, 528 insertions, 537 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index cf8a905f2..69304d442 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -766,7 +766,7 @@ SET(SRCS events/actionevent.h listeners/actionlistener.h gui/base/basiccontainer.hpp - gui/base/cliprectangle.hpp + gui/cliprectangle.h gui/color.h listeners/deathlistener.h events/event.h @@ -779,7 +779,7 @@ SET(SRCS gui/base/listmodel.hpp events/mouseevent.h listeners/mouselistener.h - gui/base/rectangle.hpp + gui/rectangle.h events/selectionevent.h listeners/selectionlistener.h utils/sdlpixel.h @@ -797,11 +797,11 @@ SET(SRCS gui/base/widgets/textfield.hpp gui/base/widgets/window.hpp gui/base/basiccontainer.cpp - gui/base/cliprectangle.cpp + gui/cliprectangle.cpp gui/color.cpp gui/base/gui.cpp input/key.cpp - gui/base/rectangle.cpp + gui/rectangle.cpp gui/base/widget.cpp gui/base/widgets/button.cpp gui/base/widgets/checkbox.cpp diff --git a/src/Makefile.am b/src/Makefile.am index 5a2fa34d7..0b03f22f0 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -26,14 +26,14 @@ manaplus_SOURCES = endif dyecmd_CXXFLAGS = -dyecmd_SOURCES = gui/base/cliprectangle.cpp \ +dyecmd_SOURCES = gui/cliprectangle.cpp \ gui/color.cpp \ - gui/base/rectangle.cpp \ + gui/rectangle.cpp \ events/actionevent.h \ - gui/base/cliprectangle.hpp \ + gui/cliprectangle.h \ gui/color.h \ events/event.h \ - gui/base/rectangle.hpp + gui/rectangle.h dyecmd_SOURCES += dyetool/dyemain.cpp \ animatedsprite.cpp \ @@ -151,7 +151,7 @@ endif manaplus_SOURCES += events/actionevent.h \ listeners/actionlistener.h \ gui/base/basiccontainer.hpp \ - gui/base/cliprectangle.hpp \ + gui/cliprectangle.h \ gui/color.h \ listeners/deathlistener.h \ events/event.h \ @@ -165,7 +165,7 @@ manaplus_SOURCES += events/actionevent.h \ gui/base/listmodel.hpp \ events/mouseevent.h \ listeners/mouselistener.h \ - gui/base/rectangle.hpp \ + gui/rectangle.h \ events/selectionevent.h \ listeners/selectionlistener.h \ utils/sdlpixel.h \ @@ -183,11 +183,11 @@ manaplus_SOURCES += events/actionevent.h \ gui/base/widgets/textfield.hpp \ gui/base/widgets/window.hpp \ gui/base/basiccontainer.cpp \ - gui/base/cliprectangle.cpp \ + gui/cliprectangle.cpp \ gui/color.cpp \ gui/base/gui.cpp \ input/key.cpp \ - gui/base/rectangle.cpp \ + gui/rectangle.cpp \ gui/base/widget.cpp \ gui/base/widgets/button.cpp \ gui/base/widgets/checkbox.cpp \ diff --git a/src/being/being.cpp b/src/being/being.cpp index 485b439af..f1d8a7aa6 100644 --- a/src/being/being.cpp +++ b/src/being/being.cpp @@ -2515,7 +2515,7 @@ void Being::drawSpriteAt(Graphics *const graphics, graphics->setColor(userPalette-> getColorWithAlpha(UserPalette::PORTAL_HIGHLIGHT)); - graphics->fillRectangle(gcn::Rectangle(x, y, + graphics->fillRectangle(Rectangle(x, y, mapTileSize, mapTileSize)); if (mDrawHotKeys && !mName.empty()) @@ -2541,7 +2541,7 @@ void Being::drawSpriteAt(Graphics *const graphics, graphics->setColor(userPalette->getColorWithAlpha( UserPalette::MONSTER_ATTACK_RANGE)); - graphics->fillRectangle(gcn::Rectangle( + graphics->fillRectangle(Rectangle( x - attackRange, y - attackRange, 2 * attackRange + mapTileSize, 2 * attackRange + mapTileSize)); } @@ -2606,14 +2606,14 @@ void Being::drawHpBar(Graphics *const graphics, const int maxHP, const int hp, || (!hp && maxHP == damage)) { graphics->setColor(userPalette->getColorWithAlpha(color1)); - graphics->fillRectangle(gcn::Rectangle( + graphics->fillRectangle(Rectangle( x, y, dx, height)); return; } else if (width - dx <= 0) { graphics->setColor(userPalette->getColorWithAlpha(color2)); - graphics->fillRectangle(gcn::Rectangle( + graphics->fillRectangle(Rectangle( x, y, width, height)); return; } @@ -2623,26 +2623,25 @@ void Being::drawHpBar(Graphics *const graphics, const int maxHP, const int hp, if (hp == maxHP) { graphics->setColor(userPalette->getColorWithAlpha(color1)); - graphics->fillRectangle(gcn::Rectangle( + graphics->fillRectangle(Rectangle( x, y, dx, height)); return; } else if (width - dx <= 0) { graphics->setColor(userPalette->getColorWithAlpha(color2)); - graphics->fillRectangle(gcn::Rectangle( + graphics->fillRectangle(Rectangle( x, y, width, height)); return; } } graphics->setColor(userPalette->getColorWithAlpha(color1)); - graphics->fillRectangle(gcn::Rectangle( + graphics->fillRectangle(Rectangle( x, y, dx, height)); graphics->setColor(userPalette->getColorWithAlpha(color2)); - graphics->fillRectangle(gcn::Rectangle( - x + dx, y, width - dx, height)); + graphics->fillRectangle(Rectangle(x + dx, y, width - dx, height)); } void Being::setHP(const int hp) diff --git a/src/client.cpp b/src/client.cpp index 4aa5d4cd4..0babef941 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -617,7 +617,7 @@ static void updateProgress(int cnt) mainGraphics->setColor(Color(255, 255, 255)); const int maxSize = mainGraphics->mWidth - 100; const int width = maxSize * progress / 450; - mainGraphics->fillRectangle(gcn::Rectangle(50, h - 100, width, 50)); + mainGraphics->fillRectangle(Rectangle(50, h - 100, width, 50)); mainGraphics->updateScreen(); } diff --git a/src/flooritem.cpp b/src/flooritem.cpp index 6780b10fa..fd6a6afd3 100644 --- a/src/flooritem.cpp +++ b/src/flooritem.cpp @@ -123,7 +123,7 @@ void FloorItem::draw(Graphics *const graphics, if (curTime > mDropTime + 28 && curTime < mDropTime + 50) { graphics->setColor(Color(80, 200, 20, 200)); - graphics->fillRectangle(gcn::Rectangle( + graphics->fillRectangle(Rectangle( x, y, dx, dy)); } else if (curTime > mDropTime + 19 @@ -131,15 +131,14 @@ void FloorItem::draw(Graphics *const graphics, { graphics->setColor(Color(200, 80, 20, 80 + 10 * (curTime - mDropTime - 18))); - graphics->fillRectangle(gcn::Rectangle( + graphics->fillRectangle(Rectangle( x, y, dx, dy)); } else if (curTime > mDropTime && curTime < mDropTime + 20) { graphics->setColor(Color(20, 20, 255, 7 * (curTime - mDropTime))); - graphics->fillRectangle(gcn::Rectangle( - x, y, dx, dy)); + graphics->fillRectangle(Rectangle(x, y, dx, dy)); } } } diff --git a/src/gui/base/widget.hpp b/src/gui/base/widget.hpp index 31d61312e..a180cbd12 100644 --- a/src/gui/base/widget.hpp +++ b/src/gui/base/widget.hpp @@ -69,8 +69,7 @@ #include <string> #include "gui/color.h" - -#include "gui/base/rectangle.hpp" +#include "gui/rectangle.h" #include "gui/widgets/widget2.h" diff --git a/src/gui/base/cliprectangle.cpp b/src/gui/cliprectangle.cpp index f52bc384a..ff393281c 100644 --- a/src/gui/base/cliprectangle.cpp +++ b/src/gui/cliprectangle.cpp @@ -65,43 +65,40 @@ * For comments regarding functions please see the header file. */ -#include "gui/base/cliprectangle.hpp" +#include "gui/cliprectangle.h" #include "debug.h" -namespace gcn +ClipRectangle::ClipRectangle() : + Rectangle(), + xOffset(0), + yOffset(0) { - ClipRectangle::ClipRectangle() : - Rectangle(), - xOffset(0), - yOffset(0) - { - x = 0; - y = 0; - width = 0; - height = 0; - } + x = 0; + y = 0; + width = 0; + height = 0; +} - ClipRectangle::ClipRectangle(const int x0, const int y0, - const int width0, const int height0, - const int xOffset0, const int yOffset0) : - Rectangle(), - xOffset(xOffset0), - yOffset(yOffset0) - { - x = x0; - y = y0; - width = width0; - height = height0; - } +ClipRectangle::ClipRectangle(const int x0, const int y0, + const int width0, const int height0, + const int xOffset0, const int yOffset0) : + Rectangle(), + xOffset(xOffset0), + yOffset(yOffset0) +{ + x = x0; + y = y0; + width = width0; + height = height0; +} - const ClipRectangle& ClipRectangle::operator=(const Rectangle& other) - { - x = other.x; - y = other.y; - width = other.width; - height = other.height; +const ClipRectangle& ClipRectangle::operator=(const Rectangle& other) +{ + x = other.x; + y = other.y; + width = other.width; + height = other.height; - return *this; - } -} // namespace gcn + return *this; +} diff --git a/src/gui/base/cliprectangle.hpp b/src/gui/cliprectangle.h index 1fdbfbe8d..776bc702f 100644 --- a/src/gui/base/cliprectangle.hpp +++ b/src/gui/cliprectangle.h @@ -61,43 +61,41 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef GCN_CLIPRECTANGLE_HPP -#define GCN_CLIPRECTANGLE_HPP +#ifndef GUI_CLIPRECTANGLE_H +#define GUI_CLIPRECTANGLE_H -#include "gui/base/rectangle.hpp" +#include "gui/rectangle.h" #include "localconsts.h" -namespace gcn +/** + * A rectangle used when dealing with clipping. A clip rectangle is + * a regular rectangle extended with variables for x offsets and y + * offsets. The offsets are used for calculations from relative + * screen coordinates to actual screen coordinates. + */ +class ClipRectangle final : public Rectangle { - /** - * A rectangle used when dealing with clipping. A clip rectangle is - * a regular rectangle extended with variables for x offsets and y - * offsets. The offsets are used for calculations from relative - * screen coordinates to actual screen coordinates. - */ - class ClipRectangle final : public Rectangle - { public: /** - * Constructor. - */ + * Constructor. + */ ClipRectangle(); /** - * Constructor. - * - * @param x0 The rectangle x coordinate. - * @param y0 The rectangle y coordinate. - * @param width0 The rectangle width. - * @param height0 The rectangle height. - * @param xOffset0 The offset of the x coordinate. Used to for - * calculating the actual screen coordinate from - * the relative screen coordinate. - * @param yOffset0 The offset of the y coordinate. Used to for - * calculating the actual screen coordinate from - * the relative screen coordinate. - */ + * Constructor. + * + * @param x0 The rectangle x coordinate. + * @param y0 The rectangle y coordinate. + * @param width0 The rectangle width. + * @param height0 The rectangle height. + * @param xOffset0 The offset of the x coordinate. Used to for + * calculating the actual screen coordinate from + * the relative screen coordinate. + * @param yOffset0 The offset of the y coordinate. Used to for + * calculating the actual screen coordinate from + * the relative screen coordinate. + */ ClipRectangle(const int x0, const int y0, const int width0, @@ -106,24 +104,23 @@ namespace gcn const int yOffset0); /** - * Copy constructor. Copies x, y, width and height - * field from a rectangle to a clip rectangle. - * - * @param other The rectangle to copy data from. - * @returns A clip rectangle with data copyied from a rectangle. - */ + * Copy constructor. Copies x, y, width and height + * field from a rectangle to a clip rectangle. + * + * @param other The rectangle to copy data from. + * @returns A clip rectangle with data copyied from a rectangle. + */ const ClipRectangle& operator=(const Rectangle& other); /** - * Holds the x offset of the x coordinate. - */ + * Holds the x offset of the x coordinate. + */ int xOffset; /** - * Holds the y offset of the y coordinate. - */ + * Holds the y offset of the y coordinate. + */ int yOffset; - }; -} // namespace gcn +}; -#endif // end GCN_CLIPRECTANGLE_HPP +#endif // GUI_CLIPRECTANGLE_H diff --git a/src/gui/popups/spellpopup.cpp b/src/gui/popups/spellpopup.cpp index 07bcc2330..2dc1751d3 100644 --- a/src/gui/popups/spellpopup.cpp +++ b/src/gui/popups/spellpopup.cpp @@ -90,7 +90,7 @@ void SpellPopup::view(const int x, const int y) int posX = std::max(0, x - getWidth() / 2); int posY = y + distance; - const gcn::Rectangle &rect = mDimension; + const Rectangle &rect = mDimension; const int w = rect.width; const int h = rect.height; if (posX + w > mainGraphics->mWidth) diff --git a/src/gui/popups/textpopup.cpp b/src/gui/popups/textpopup.cpp index 0ae53ac1f..72ac26f0f 100644 --- a/src/gui/popups/textpopup.cpp +++ b/src/gui/popups/textpopup.cpp @@ -86,7 +86,7 @@ void TextPopup::show(const int x, const int y, const std::string &str1, setHeight(pad2 + mText[0]->getFont()->getHeight() * cnt); const int distance = 20; - const gcn::Rectangle &rect = mDimension; + const Rectangle &rect = mDimension; int posX = std::max(0, x - rect.width / 2); int posY = y + distance; diff --git a/src/gui/base/rectangle.cpp b/src/gui/rectangle.cpp index a29069b18..d7de61c39 100644 --- a/src/gui/base/rectangle.cpp +++ b/src/gui/rectangle.cpp @@ -65,92 +65,92 @@ * For comments regarding functions please see the header file. */ -#include "gui/base/rectangle.hpp" +#include "gui/rectangle.h" #include "debug.h" -namespace gcn +Rectangle::Rectangle() + : x(0), + y(0), + width(0), + height(0) { - Rectangle::Rectangle() - : x(0), - y(0), - width(0), - height(0) - { - } +} + +Rectangle::Rectangle(const int x_, const int y_, + const int width_, const int height_) : + x(x_), + y(y_), + width(width_), + height(height_) +{ +} + +void Rectangle::setAll(const int x0, + const int y0, + const int width0, + const int height0) +{ + x = x0; + y = y0; + width = width0; + height = height0; +} - Rectangle::Rectangle(const int x_, const int y_, - const int width_, const int height_) : - x(x_), - y(y_), - width(width_), - height(height_) +bool Rectangle::isIntersecting(const Rectangle& rectangle) const +{ + int x_ = x; + int y_ = y; + int width_ = width; + int height_ = height; + + x_ -= rectangle.x; + y_ -= rectangle.y; + + if (x_ < 0) { + width_ += x_; +// x_ = 0; } - - void Rectangle::setAll(int x_, int y_, int width_, int height_) + else if (x_ + width_ > rectangle.width) { - x = x_; - y = y_; - width = width_; - height = height_; + width_ = rectangle.width - x_; } - bool Rectangle::isIntersecting(const Rectangle& rectangle) const + if (y_ < 0) { - int x_ = x; - int y_ = y; - int width_ = width; - int height_ = height; - - x_ -= rectangle.x; - y_ -= rectangle.y; - - if (x_ < 0) - { - width_ += x_; -// x_ = 0; - } - else if (x_ + width_ > rectangle.width) - { - width_ = rectangle.width - x_; - } - - if (y_ < 0) - { - height_ += y_; + height_ += y_; // y_ = 0; - } - else if (y_ + height_ > rectangle.height) - { - height_ = rectangle.height - y_; - } - - if (width_ <= 0 || height_ <= 0) - { - return false; - } - - return true; } - - bool Rectangle::isPointInRect(int x_, int y_) const + else if (y_ + height_ > rectangle.height) { - return x_ >= x - && y_ >= y - && x_ < x + width - && y_ < y + height; + height_ = rectangle.height - y_; } - std::ostream& operator<<(std::ostream& out, - const Rectangle& rectangle) + if (width_ <= 0 || height_ <= 0) { - out << "Rectangle [x = " << rectangle.x - << ", y = " << rectangle.y - << ", width = " << rectangle.width - << ", height = " << rectangle.height - << "]"; - - return out; + return false; } -} // namespace gcn + + return true; +} + +bool Rectangle::isPointInRect(int x_, int y_) const +{ + return x_ >= x + && y_ >= y + && x_ < x + width + && y_ < y + height; +} + +std::ostream& operator<<(std::ostream& out, + const Rectangle& rectangle) +{ + out << "Rectangle [x = " << rectangle.x + << ", y = " << rectangle.y + << ", width = " << rectangle.width + << ", height = " << rectangle.height + << "]"; + + return out; +} diff --git a/src/gui/base/rectangle.hpp b/src/gui/rectangle.h index 299ce99b9..ae8364417 100644 --- a/src/gui/base/rectangle.hpp +++ b/src/gui/rectangle.h @@ -61,102 +61,102 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef GCN_RECTANGLE_HPP -#define GCN_RECTANGLE_HPP +#ifndef GUI_RECTANGLE_H +#define GUI_RECTANGLE_H #include <iostream> #include "localconsts.h" -namespace gcn +/** + * Represents a rectangle. + * + * @since 0.1.0 + */ +class Rectangle { - /** - * Represents a rectangle. - * - * @since 0.1.0 - */ - class Rectangle - { public: /** - * Constructor. The default rectangle is an empty rectangle - * at the coordinates (0,0). - */ + * Constructor. The default rectangle is an empty rectangle + * at the coordinates (0,0). + */ Rectangle(); /** - * Constructor. - * - * @param x The x coordinate of the rectangle. - * @param y The y coordinate of the rectangle. - * @param width The width of the rectangle. - * @param height The height of the rectangle. - * @since 0.1.0 - */ + * Constructor. + * + * @param x The x coordinate of the rectangle. + * @param y The y coordinate of the rectangle. + * @param width The width of the rectangle. + * @param height The height of the rectangle. + * @since 0.1.0 + */ Rectangle(const int x, const int y, const int width, const int height); virtual ~Rectangle() { } /** - * Sets the dimension of a rectangle. - * - * @param x The x coordinate of the rectangle. - * @param y The y coordinate of the rectangle. - * @param width The width of the rectangle. - * @param height The height of the rectangle. - * @since 0.1.0 - */ - void setAll(int x, int y, int width, int height); + * Sets the dimension of a rectangle. + * + * @param x The x coordinate of the rectangle. + * @param y The y coordinate of the rectangle. + * @param width The width of the rectangle. + * @param height The height of the rectangle. + * @since 0.1.0 + */ + void setAll(const int x, + const int y, + const int width0, + const int height0); /** - * Checks if another rectangle intersects with the rectangle. - * - * @param rectangle Another rectangle to check for intersection. - * @return True if the rectangles intersect, false otherwise. - * @since 0.1.0 - */ + * Checks if another rectangle intersects with the rectangle. + * + * @param rectangle Another rectangle to check for intersection. + * @return True if the rectangles intersect, false otherwise. + * @since 0.1.0 + */ bool isIntersecting(const Rectangle& rectangle) const A_WARN_UNUSED; /** - * Checks if a point is inside the rectangle - * - * @param x The x coordinate of the point. - * @param y The y coordinate of the point. - * @return True if the point is inside the rectangle. - * @since 0.1.0 - */ + * Checks if a point is inside the rectangle + * + * @param x The x coordinate of the point. + * @param y The y coordinate of the point. + * @return True if the point is inside the rectangle. + * @since 0.1.0 + */ bool isPointInRect(int x, int y) const A_WARN_UNUSED; /** - * Output operator for output. - * - * @param out The stream to output to. - * @param rectangle The rectangle to output. - */ + * Output operator for output. + * + * @param out The stream to output to. + * @param rectangle The rectangle to output. + */ friend std::ostream& operator<<(std::ostream& out, const Rectangle& rectangle); /** - * Holds the x coordinate of the rectangle. - */ + * Holds the x coordinate of the rectangle. + */ int x; /** - * Holds the x coordinate of the rectangle. - */ + * Holds the x coordinate of the rectangle. + */ int y; /** - * Holds the width of the rectangle. - */ + * Holds the width of the rectangle. + */ int width; /** - * Holds the height of the rectangle. - */ + * Holds the height of the rectangle. + */ int height; - }; -} // namespace gcn +}; -#endif // end GCN_RECTANGEL_HPP +#endif // GUI_RECTANGEL_H diff --git a/src/gui/viewport.cpp b/src/gui/viewport.cpp index 54619c3e6..d9175a07f 100644 --- a/src/gui/viewport.cpp +++ b/src/gui/viewport.cpp @@ -123,7 +123,7 @@ void Viewport::draw(Graphics *graphics) { graphics->setColor(Color(64, 64, 64)); graphics->fillRectangle( - gcn::Rectangle(0, 0, getWidth(), getHeight())); + Rectangle(0, 0, getWidth(), getHeight())); BLOCK_END("Viewport::draw 1") return; } @@ -353,7 +353,7 @@ void Viewport::_drawPath(Graphics *const graphics, const Path &path, const int squareX = i->x * mapTileSize - mPixelViewX + 12; const int squareY = i->y * mapTileSize - mPixelViewY + 12; - graphics->fillRectangle(gcn::Rectangle(squareX, squareY, 8, 8)); + graphics->fillRectangle(Rectangle(squareX, squareY, 8, 8)); if (mMap) { const std::string str = toString(cnt); @@ -371,8 +371,8 @@ void Viewport::_drawPath(Graphics *const graphics, const Path &path, const int squareX = i->x - mPixelViewX; const int squareY = i->y - mPixelViewY; - graphics->fillRectangle(gcn::Rectangle(squareX - 4, squareY - 4, - 8, 8)); + graphics->fillRectangle(Rectangle( + squareX - 4, squareY - 4, 8, 8)); if (mMap) { const std::string str = toString(mMap->getMetaTile( diff --git a/src/gui/widgets/avatarlistbox.cpp b/src/gui/widgets/avatarlistbox.cpp index a71051b5d..4300f4ea8 100644 --- a/src/gui/widgets/avatarlistbox.cpp +++ b/src/gui/widgets/avatarlistbox.cpp @@ -160,7 +160,7 @@ void AvatarListBox::draw(Graphics *graphics) color.a = 80; graphics->setColor(color); - graphics->fillRectangle(gcn::Rectangle(mPadding, y + mPadding, + graphics->fillRectangle(Rectangle(mPadding, y + mPadding, parent->getWidth() * a->getHp() / a->getMaxHp() - 2 * mPadding, fontHeight)); } @@ -184,7 +184,7 @@ void AvatarListBox::draw(Graphics *graphics) color.a = 80; graphics->setColor(color); - graphics->fillRectangle(gcn::Rectangle(mPadding, y + mPadding, + graphics->fillRectangle(Rectangle(mPadding, y + mPadding, parent->getWidth() * a->getDamageHp() / 1024 - 2 * mPadding, fontHeight)); diff --git a/src/gui/widgets/browserbox.cpp b/src/gui/widgets/browserbox.cpp index b6644cbc1..6e506eeeb 100644 --- a/src/gui/widgets/browserbox.cpp +++ b/src/gui/widgets/browserbox.cpp @@ -37,7 +37,7 @@ #include "utils/stringutils.h" #include "utils/timer.h" -#include "gui/base/cliprectangle.hpp" +#include "gui/cliprectangle.h" #include "render/graphics.h" @@ -448,7 +448,7 @@ void BrowserBox::mouseMoved(MouseEvent &event) void BrowserBox::draw(Graphics *graphics) { BLOCK_START("BrowserBox::draw") - const gcn::ClipRectangle *const cr = graphics->getCurrentClipArea(); + const ClipRectangle *const cr = graphics->getCurrentClipArea(); if (!cr) return; mYStart = cr->y - cr->yOffset; @@ -462,7 +462,7 @@ void BrowserBox::draw(Graphics *graphics) if (mOpaque) { graphics->setColor(mBackgroundColor); - graphics->fillRectangle(gcn::Rectangle(0, 0, getWidth(), getHeight())); + graphics->fillRectangle(Rectangle(0, 0, getWidth(), getHeight())); } if (mSelectedLink >= 0 && mSelectedLink @@ -471,7 +471,7 @@ void BrowserBox::draw(Graphics *graphics) if ((mHighMode & BACKGROUND)) { graphics->setColor(mHighlightColor); - graphics->fillRectangle(gcn::Rectangle( + graphics->fillRectangle(Rectangle( mLinks[mSelectedLink].x1, mLinks[mSelectedLink].y1, mLinks[mSelectedLink].x2 - mLinks[mSelectedLink].x1, diff --git a/src/gui/widgets/button.cpp b/src/gui/widgets/button.cpp index d7871503e..90c1706b5 100644 --- a/src/gui/widgets/button.cpp +++ b/src/gui/widgets/button.cpp @@ -380,7 +380,7 @@ void Button::draw(Graphics *graphics) { // because we don't know where parent windows was moved, // need recalc vertexes - gcn::ClipRectangle &rect = graphics->getTopClip(); + ClipRectangle &rect = graphics->getTopClip(); if (rect.xOffset != mXOffset || rect.yOffset != mYOffset) { recalc = true; @@ -420,7 +420,7 @@ void Button::draw(Graphics *graphics) int imageX = 0; int imageY = 0; int textX = 0; - const gcn::Rectangle &rect = mDimension; + const Rectangle &rect = mDimension; const int width = rect.width; const int height = rect.height; Font *const font = getFont(); diff --git a/src/gui/widgets/colorpage.cpp b/src/gui/widgets/colorpage.cpp index 6803fbe3c..2bc085208 100644 --- a/src/gui/widgets/colorpage.cpp +++ b/src/gui/widgets/colorpage.cpp @@ -64,7 +64,7 @@ void ColorPage::draw(Graphics *graphics) if (mSelected >= 0) { - graphics->fillRectangle(gcn::Rectangle(mPadding, + graphics->fillRectangle(Rectangle(mPadding, rowHeight * mSelected + mPadding, mDimension.width - 2 * mPadding, rowHeight)); diff --git a/src/gui/widgets/desktop.cpp b/src/gui/widgets/desktop.cpp index 8e0496fea..a296fb49d 100644 --- a/src/gui/widgets/desktop.cpp +++ b/src/gui/widgets/desktop.cpp @@ -107,7 +107,7 @@ void Desktop::draw(Graphics *graphics) { BLOCK_START("Desktop::draw") - const gcn::Rectangle &rect = mDimension; + const Rectangle &rect = mDimension; const int width = rect.width; const int height = rect.height; if (mWallpaper) @@ -118,7 +118,7 @@ void Desktop::draw(Graphics *graphics) if (width > wallpWidth || height > wallpHeight) { graphics->setColor(mBackgroundGrayColor); - graphics->fillRectangle(gcn::Rectangle(0, 0, width, height)); + graphics->fillRectangle(Rectangle(0, 0, width, height)); } if (imageHelper->useOpenGL() == RENDER_SOFTWARE) @@ -135,12 +135,12 @@ void Desktop::draw(Graphics *graphics) else { graphics->setColor(mBackgroundGrayColor); - graphics->fillRectangle(gcn::Rectangle(0, 0, width, height)); + graphics->fillRectangle(Rectangle(0, 0, width, height)); } // Draw a thin border under the application version... graphics->setColor(mBackgroundColor); - graphics->fillRectangle(gcn::Rectangle(mVersionLabel->getDimension())); + graphics->fillRectangle(Rectangle(mVersionLabel->getDimension())); Container::draw(graphics); BLOCK_END("Desktop::draw") @@ -165,7 +165,7 @@ void Desktop::setBestFittingWallpaper() mWallpaper = nullptr; } - const gcn::Rectangle &rect = mDimension; + const Rectangle &rect = mDimension; const int width = rect.width; const int height = rect.height; diff --git a/src/gui/widgets/dropdown.cpp b/src/gui/widgets/dropdown.cpp index 6189af75e..63f102f5a 100644 --- a/src/gui/widgets/dropdown.cpp +++ b/src/gui/widgets/dropdown.cpp @@ -267,7 +267,7 @@ void DropDown::draw(Graphics* graphics) if (isFocused()) { graphics->setColor(mHighlightColor); - graphics->drawRectangle(gcn::Rectangle(mPadding, mPadding, + graphics->drawRectangle(Rectangle(mPadding, mPadding, mDimension.width - h - pad, h - pad)); } @@ -290,7 +290,7 @@ void DropDown::drawFrame(Graphics *graphics) { BLOCK_START("DropDown::drawFrame") const int bs2 = getFrameSize(); - const gcn::Rectangle &rect = mDimension; + const Rectangle &rect = mDimension; graphics->drawImageRect(0, 0, rect.width + bs2, rect.height + bs2, skinRect); @@ -512,16 +512,16 @@ void DropDown::action(const ActionEvent &actionEvent A_UNUSED) distributeActionEvent(); } -gcn::Rectangle DropDown::getChildrenArea() +Rectangle DropDown::getChildrenArea() { if (mDroppedDown) { // Calculate the children area (with the one pixel border in mind) - return gcn::Rectangle(1, mFoldedUpHeight + 1, + return Rectangle(1, mFoldedUpHeight + 1, mDimension.width - 2, mDimension.height - mFoldedUpHeight - 2); } - return gcn::Rectangle(); + return Rectangle(); } void DropDown::valueChanged(const SelectionEvent& event A_UNUSED) diff --git a/src/gui/widgets/dropdown.h b/src/gui/widgets/dropdown.h index 815e4a85d..81e3b6e8f 100644 --- a/src/gui/widgets/dropdown.h +++ b/src/gui/widgets/dropdown.h @@ -129,7 +129,7 @@ class DropDown final : public ActionListener, void removeSelectionListener(SelectionListener* selectionListener); - gcn::Rectangle getChildrenArea() override; + Rectangle getChildrenArea() override; void action(const ActionEvent &actionEvent) override; diff --git a/src/gui/widgets/extendedlistbox.cpp b/src/gui/widgets/extendedlistbox.cpp index 1fcbabd2b..53b7c7060 100644 --- a/src/gui/widgets/extendedlistbox.cpp +++ b/src/gui/widgets/extendedlistbox.cpp @@ -134,7 +134,7 @@ void ExtendedListBox::draw(Graphics *graphics) { mHighlightColor.a = static_cast<int>(mAlpha * 255.0F); graphics->setColor(mHighlightColor); - graphics->fillRectangle(gcn::Rectangle(mPadding, minY + mPadding, + graphics->fillRectangle(Rectangle(mPadding, minY + mPadding, width - pad2, maxY - minY + height)); } diff --git a/src/gui/widgets/guitable.cpp b/src/gui/widgets/guitable.cpp index 324d4b23e..7bd920046 100644 --- a/src/gui/widgets/guitable.cpp +++ b/src/gui/widgets/guitable.cpp @@ -304,7 +304,7 @@ void GuiTable::draw(Graphics* graphics) if (client->getGuiAlpha() != mAlpha) mAlpha = client->getGuiAlpha(); - const gcn::Rectangle &rect = mDimension; + const Rectangle &rect = mDimension; const int width = rect.width; const int height = rect.height; const int y = rect.y; @@ -312,7 +312,7 @@ void GuiTable::draw(Graphics* graphics) { mBackgroundColor.a = static_cast<int>(mAlpha * 255.0F); graphics->setColor(mBackgroundColor); - graphics->fillRectangle(gcn::Rectangle(0, 0, width, height)); + graphics->fillRectangle(Rectangle(0, 0, width, height)); } // First, determine how many rows we need to draw, @@ -351,7 +351,7 @@ void GuiTable::draw(Graphics* graphics) const int cWidth = getColumnWidth(c); if (widget) { - gcn::Rectangle bounds(x_offset, y_offset, cWidth, rHeight); + Rectangle bounds(x_offset, y_offset, cWidth, rHeight); if (widget == mTopWidget) { @@ -369,14 +369,14 @@ void GuiTable::draw(Graphics* graphics) if (mLinewiseMode && r == static_cast<unsigned>( mSelectedRow) && c == 0) { - graphics->fillRectangle(gcn::Rectangle(0, y_offset, + graphics->fillRectangle(Rectangle(0, y_offset, width, rHeight)); } else if (!mLinewiseMode && mSelectedColumn > 0 && c == static_cast<unsigned>(mSelectedColumn) && r == static_cast<unsigned>(mSelectedRow)) { - graphics->fillRectangle(gcn::Rectangle( + graphics->fillRectangle(Rectangle( x_offset, y_offset, cWidth, rHeight)); } } @@ -393,7 +393,7 @@ void GuiTable::draw(Graphics* graphics) if (mTopWidget) { - const gcn::Rectangle &bounds = mTopWidget->getDimension(); + const Rectangle &bounds = mTopWidget->getDimension(); graphics->pushClipArea(bounds); mTopWidget->draw(graphics); graphics->popClipArea(); @@ -414,9 +414,9 @@ void GuiTable::moveToBottom(gcn::Widget *widget) mTopWidget = nullptr; } -gcn::Rectangle GuiTable::getChildrenArea() +Rectangle GuiTable::getChildrenArea() { - return gcn::Rectangle(0, 0, mDimension.width, mDimension.height); + return Rectangle(0, 0, mDimension.width, mDimension.height); } // -- KeyListener notifications diff --git a/src/gui/widgets/guitable.h b/src/gui/widgets/guitable.h index b2c7c5620..055c6c5f2 100644 --- a/src/gui/widgets/guitable.h +++ b/src/gui/widgets/guitable.h @@ -93,7 +93,7 @@ public: void setWrappingEnabled(bool wrappingEnabled) { mWrappingEnabled = wrappingEnabled; } - gcn::Rectangle getChildrenArea() override final A_WARN_UNUSED; + Rectangle getChildrenArea() override final A_WARN_UNUSED; /** * Toggle whether to use linewise selection mode, in which the table selects diff --git a/src/gui/widgets/label.cpp b/src/gui/widgets/label.cpp index c02f37adb..5b1804667 100644 --- a/src/gui/widgets/label.cpp +++ b/src/gui/widgets/label.cpp @@ -80,7 +80,7 @@ void Label::draw(Graphics* graphics) { BLOCK_START("Label::draw") int textX; - const gcn::Rectangle &rect = mDimension; + const Rectangle &rect = mDimension; const int textY = rect.height / 2 - getFont()->getHeight() / 2; Font *const font = getFont(); diff --git a/src/gui/widgets/layout.cpp b/src/gui/widgets/layout.cpp index f16f40322..4132741e4 100644 --- a/src/gui/widgets/layout.cpp +++ b/src/gui/widgets/layout.cpp @@ -80,7 +80,7 @@ void LayoutCell::reflow(int nx, int ny, int nw, int nh) if (mType == ARRAY) mArray->reflow(nx, ny, nw, nh); else - mWidget->setDimension(gcn::Rectangle(nx, ny, nw, nh)); + mWidget->setDimension(Rectangle(nx, ny, nw, nh)); } void LayoutCell::computeSizes() diff --git a/src/gui/widgets/layouthelper.cpp b/src/gui/widgets/layouthelper.cpp index 7b8a428a9..e4b931c92 100644 --- a/src/gui/widgets/layouthelper.cpp +++ b/src/gui/widgets/layouthelper.cpp @@ -65,7 +65,7 @@ void LayoutHelper::reflowLayout(int w, int h) void LayoutHelper::widgetResized(const Event &event A_UNUSED) { - const gcn::Rectangle area = mContainer->getChildrenArea(); + const Rectangle area = mContainer->getChildrenArea(); int w = area.width; int h = area.height; mLayout.reflow(w, h); diff --git a/src/gui/widgets/listbox.cpp b/src/gui/widgets/listbox.cpp index a57dc07cd..ebe1ca279 100644 --- a/src/gui/widgets/listbox.cpp +++ b/src/gui/widgets/listbox.cpp @@ -118,7 +118,7 @@ void ListBox::draw(Graphics *graphics) // Draw filled rectangle around the selected list element if (mSelected >= 0) { - graphics->fillRectangle(gcn::Rectangle(mPadding, + graphics->fillRectangle(Rectangle(mPadding, rowHeight * mSelected + mPadding, mDimension.width - 2 * mPadding, rowHeight)); @@ -148,7 +148,7 @@ void ListBox::draw(Graphics *graphics) // Draw filled rectangle around the selected list element if (mSelected >= 0) { - graphics->fillRectangle(gcn::Rectangle(mPadding, + graphics->fillRectangle(Rectangle(mPadding, rowHeight * mSelected + mPadding, mDimension.width - 2 * mPadding, rowHeight)); diff --git a/src/gui/widgets/popup.cpp b/src/gui/widgets/popup.cpp index 178695891..76eb3707a 100644 --- a/src/gui/widgets/popup.cpp +++ b/src/gui/widgets/popup.cpp @@ -122,10 +122,10 @@ void Popup::draw(Graphics *graphics) BLOCK_END("Popup::draw") } -gcn::Rectangle Popup::getChildrenArea() +Rectangle Popup::getChildrenArea() { const int pad2 = mPadding * 2; - return gcn::Rectangle(mPadding, mPadding, + return Rectangle(mPadding, mPadding, mDimension.width - pad2, mDimension.height - pad2); } diff --git a/src/gui/widgets/popup.h b/src/gui/widgets/popup.h index d64bc4b3f..d1709a328 100644 --- a/src/gui/widgets/popup.h +++ b/src/gui/widgets/popup.h @@ -152,7 +152,7 @@ class Popup : public Container, // Inherited from BasicContainer - virtual gcn::Rectangle getChildrenArea() override; + virtual Rectangle getChildrenArea() override; /** * Sets the location to display the popup. Tries to horizontally center diff --git a/src/gui/widgets/progressbar.cpp b/src/gui/widgets/progressbar.cpp index 7d2d00ad4..db199a714 100644 --- a/src/gui/widgets/progressbar.cpp +++ b/src/gui/widgets/progressbar.cpp @@ -261,7 +261,7 @@ void ProgressBar::render(Graphics *graphics) { if (width > maxWidth) width = maxWidth; - graphics->fillRectangle(gcn::Rectangle(mFillPadding, mFillPadding, + graphics->fillRectangle(Rectangle(mFillPadding, mFillPadding, width, mDimension.height - pad)); } } diff --git a/src/gui/widgets/scrollarea.cpp b/src/gui/widgets/scrollarea.cpp index 0cadee888..b508e2dd4 100644 --- a/src/gui/widgets/scrollarea.cpp +++ b/src/gui/widgets/scrollarea.cpp @@ -318,7 +318,7 @@ void ScrollArea::updateCalcFlag(Graphics *const graphics) { // because we don't know where parent windows was moved, // need recalc vertexes - const gcn::ClipRectangle &rect = graphics->getTopClip(); + const ClipRectangle &rect = graphics->getTopClip(); if (rect.xOffset != mXOffset || rect.yOffset != mYOffset) { mRedraw = true; @@ -381,7 +381,7 @@ void ScrollArea::drawButton(Graphics *const graphics, const BUTTON_DIR dir) { int state = 0; - gcn::Rectangle dim; + Rectangle dim; switch (dir) { @@ -416,7 +416,7 @@ void ScrollArea::calcButton(Graphics *const graphics, const BUTTON_DIR dir) { int state = 0; - gcn::Rectangle dim; + Rectangle dim; switch (dir) { @@ -452,7 +452,7 @@ void ScrollArea::calcButton(Graphics *const graphics, void ScrollArea::drawVBar(Graphics *const graphics) { - const gcn::Rectangle &dim = getVerticalBarDimension(); + const Rectangle &dim = getVerticalBarDimension(); if (vBackground.grid[4]) { @@ -475,7 +475,7 @@ void ScrollArea::drawVBar(Graphics *const graphics) void ScrollArea::calcVBar(Graphics *const graphics) { - const gcn::Rectangle &dim = getVerticalBarDimension(); + const Rectangle &dim = getVerticalBarDimension(); if (vBackground.grid[4]) { @@ -502,7 +502,7 @@ void ScrollArea::calcVBar(Graphics *const graphics) void ScrollArea::drawHBar(Graphics *const graphics) { - const gcn::Rectangle &dim = getHorizontalBarDimension(); + const Rectangle &dim = getHorizontalBarDimension(); if (hBackground.grid[4]) { @@ -530,7 +530,7 @@ void ScrollArea::drawHBar(Graphics *const graphics) void ScrollArea::calcHBar(Graphics *const graphics) { - const gcn::Rectangle &dim = getHorizontalBarDimension(); + const Rectangle &dim = getHorizontalBarDimension(); if (hBackground.grid[4]) { @@ -561,7 +561,7 @@ void ScrollArea::calcHBar(Graphics *const graphics) void ScrollArea::drawVMarker(Graphics *const graphics) { - const gcn::Rectangle &dim = getVerticalMarkerDimension(); + const Rectangle &dim = getVerticalMarkerDimension(); if ((mHasMouse) && (mX > (mDimension.width - mScrollbarWidth))) { @@ -579,7 +579,7 @@ void ScrollArea::drawVMarker(Graphics *const graphics) void ScrollArea::calcVMarker(Graphics *const graphics) { - const gcn::Rectangle &dim = getVerticalMarkerDimension(); + const Rectangle &dim = getVerticalMarkerDimension(); if ((mHasMouse) && (mX > (mDimension.width - mScrollbarWidth))) { @@ -599,7 +599,7 @@ void ScrollArea::calcVMarker(Graphics *const graphics) void ScrollArea::drawHMarker(Graphics *const graphics) { - const gcn::Rectangle dim = getHorizontalMarkerDimension(); + const Rectangle dim = getHorizontalMarkerDimension(); if ((mHasMouse) && (mY > (mDimension.height - mScrollbarWidth))) { @@ -618,7 +618,7 @@ void ScrollArea::drawHMarker(Graphics *const graphics) void ScrollArea::calcHMarker(Graphics *const graphics) { - const gcn::Rectangle dim = getHorizontalMarkerDimension(); + const Rectangle dim = getHorizontalMarkerDimension(); if ((mHasMouse) && (mY > (mDimension.height - mScrollbarWidth))) { @@ -811,7 +811,7 @@ void ScrollArea::mouseDragged(MouseEvent &event) { if (mIsVerticalMarkerDragged) { - const gcn::Rectangle barDim = getVerticalBarDimension(); + const Rectangle barDim = getVerticalBarDimension(); const int pos = event.getY() - barDim.y - mVerticalMarkerDragOffset; @@ -830,7 +830,7 @@ void ScrollArea::mouseDragged(MouseEvent &event) if (mIsHorizontalMarkerDragged) { - const gcn::Rectangle barDim = getHorizontalBarDimension(); + const Rectangle barDim = getHorizontalBarDimension(); const int pos = event.getX() - barDim.x - mHorizontalMarkerDragOffset; @@ -851,50 +851,50 @@ void ScrollArea::mouseDragged(MouseEvent &event) mRedraw = true; } -gcn::Rectangle ScrollArea::getVerticalBarDimension() const +Rectangle ScrollArea::getVerticalBarDimension() const { if (!mVBarVisible) - return gcn::Rectangle(0, 0, 0, 0); + return Rectangle(0, 0, 0, 0); const int height = (mVBarVisible && mShowButtons) ? mScrollbarWidth : 0; if (mHBarVisible) { - return gcn::Rectangle(mDimension.width - mScrollbarWidth, + return Rectangle(mDimension.width - mScrollbarWidth, height, mScrollbarWidth, mDimension.height - 2 * height - mScrollbarWidth); } - return gcn::Rectangle(mDimension.width - mScrollbarWidth, + return Rectangle(mDimension.width - mScrollbarWidth, height, mScrollbarWidth, mDimension.height - 2 * height); } -gcn::Rectangle ScrollArea::getHorizontalBarDimension() const +Rectangle ScrollArea::getHorizontalBarDimension() const { if (!mHBarVisible) - return gcn::Rectangle(0, 0, 0, 0); + return Rectangle(0, 0, 0, 0); const int width = mShowButtons ? mScrollbarWidth : 0; if (mVBarVisible) { - return gcn::Rectangle(width, + return Rectangle(width, mDimension.height - mScrollbarWidth, mDimension.width - 2 * width - mScrollbarWidth, mScrollbarWidth); } - return gcn::Rectangle(width, + return Rectangle(width, mDimension.height - mScrollbarWidth, mDimension.width - 2 * width, mScrollbarWidth); } -gcn::Rectangle ScrollArea::getVerticalMarkerDimension() +Rectangle ScrollArea::getVerticalMarkerDimension() { if (!mVBarVisible) - return gcn::Rectangle(0, 0, 0, 0); + return Rectangle(0, 0, 0, 0); int length, pos; int height; @@ -945,14 +945,14 @@ gcn::Rectangle ScrollArea::getVerticalMarkerDimension() pos = 0; } - return gcn::Rectangle(mDimension.width - mScrollbarWidth, h2 + pos, + return Rectangle(mDimension.width - mScrollbarWidth, h2 + pos, mScrollbarWidth, length); } -gcn::Rectangle ScrollArea::getHorizontalMarkerDimension() +Rectangle ScrollArea::getHorizontalMarkerDimension() { if (!mHBarVisible) - return gcn::Rectangle(0, 0, 0, 0); + return Rectangle(0, 0, 0, 0); int length, pos; int width; @@ -1007,61 +1007,61 @@ gcn::Rectangle ScrollArea::getHorizontalMarkerDimension() } } - return gcn::Rectangle(w2 + pos, mDimension.height - mScrollbarWidth, + return Rectangle(w2 + pos, mDimension.height - mScrollbarWidth, length, mScrollbarWidth); } -gcn::Rectangle ScrollArea::getUpButtonDimension() const +Rectangle ScrollArea::getUpButtonDimension() const { if (!mVBarVisible || !mShowButtons) - return gcn::Rectangle(0, 0, 0, 0); + return Rectangle(0, 0, 0, 0); - return gcn::Rectangle(mDimension.width - mScrollbarWidth, 0, + return Rectangle(mDimension.width - mScrollbarWidth, 0, mScrollbarWidth, mScrollbarWidth); } -gcn::Rectangle ScrollArea::getDownButtonDimension() const +Rectangle ScrollArea::getDownButtonDimension() const { if (!mVBarVisible || !mShowButtons) - return gcn::Rectangle(0, 0, 0, 0); + return Rectangle(0, 0, 0, 0); if (mVBarVisible && mHBarVisible) { - return gcn::Rectangle(mDimension.width - mScrollbarWidth, + return Rectangle(mDimension.width - mScrollbarWidth, mDimension.height - mScrollbarWidth*2, mScrollbarWidth, mScrollbarWidth); } - return gcn::Rectangle(mDimension.width - mScrollbarWidth, + return Rectangle(mDimension.width - mScrollbarWidth, mDimension.height - mScrollbarWidth, mScrollbarWidth, mScrollbarWidth); } -gcn::Rectangle ScrollArea::getLeftButtonDimension() const +Rectangle ScrollArea::getLeftButtonDimension() const { if (!mHBarVisible || !mShowButtons) - return gcn::Rectangle(0, 0, 0, 0); + return Rectangle(0, 0, 0, 0); - return gcn::Rectangle(0, mDimension.height - mScrollbarWidth, + return Rectangle(0, mDimension.height - mScrollbarWidth, mScrollbarWidth, mScrollbarWidth); } -gcn::Rectangle ScrollArea::getRightButtonDimension() const +Rectangle ScrollArea::getRightButtonDimension() const { if (!mHBarVisible || !mShowButtons) - return gcn::Rectangle(0, 0, 0, 0); + return Rectangle(0, 0, 0, 0); if (mVBarVisible && mHBarVisible) { - return gcn::Rectangle(mDimension.width - mScrollbarWidth*2, + return Rectangle(mDimension.width - mScrollbarWidth*2, mDimension.height - mScrollbarWidth, mScrollbarWidth, mScrollbarWidth); } - return gcn::Rectangle(mDimension.width - mScrollbarWidth, + return Rectangle(mDimension.width - mScrollbarWidth, mDimension.height - mScrollbarWidth, mScrollbarWidth, mScrollbarWidth); diff --git a/src/gui/widgets/scrollarea.h b/src/gui/widgets/scrollarea.h index 39a7eea80..e5c9ffb79 100644 --- a/src/gui/widgets/scrollarea.h +++ b/src/gui/widgets/scrollarea.h @@ -119,21 +119,21 @@ class ScrollArea final : public gcn::ScrollArea, void widgetMoved(const Event &event) override final; - gcn::Rectangle getVerticalBarDimension() const; + Rectangle getVerticalBarDimension() const; - gcn::Rectangle getHorizontalBarDimension() const; + Rectangle getHorizontalBarDimension() const; - gcn::Rectangle getVerticalMarkerDimension(); + Rectangle getVerticalMarkerDimension(); - gcn::Rectangle getHorizontalMarkerDimension(); + Rectangle getHorizontalMarkerDimension(); - gcn::Rectangle getUpButtonDimension() const; + Rectangle getUpButtonDimension() const; - gcn::Rectangle getDownButtonDimension() const; + Rectangle getDownButtonDimension() const; - gcn::Rectangle getLeftButtonDimension() const; + Rectangle getLeftButtonDimension() const; - gcn::Rectangle getRightButtonDimension() const; + Rectangle getRightButtonDimension() const; protected: enum BUTTON_DIR diff --git a/src/gui/widgets/shoplistbox.cpp b/src/gui/widgets/shoplistbox.cpp index 59ae1059e..28af43cec 100644 --- a/src/gui/widgets/shoplistbox.cpp +++ b/src/gui/widgets/shoplistbox.cpp @@ -144,7 +144,7 @@ void ShopListBox::draw(Graphics *graphics) if (needDraw) { graphics->setColor(*backgroundColor); - graphics->fillRectangle(gcn::Rectangle(mPadding, y + mPadding, + graphics->fillRectangle(Rectangle(mPadding, y + mPadding, width, mRowHeight)); } diff --git a/src/gui/widgets/shortcutcontainer.cpp b/src/gui/widgets/shortcutcontainer.cpp index 0482281ed..a8acb3f5f 100644 --- a/src/gui/widgets/shortcutcontainer.cpp +++ b/src/gui/widgets/shortcutcontainer.cpp @@ -73,7 +73,7 @@ void ShortcutContainer::widgetResized(const Event &event A_UNUSED) int ShortcutContainer::getIndexFromGrid(const int pointX, const int pointY) const { - const gcn::Rectangle tRect = gcn::Rectangle(0, 0, + const Rectangle tRect = Rectangle(0, 0, mGridWidth * mBoxWidth, mGridHeight * mBoxHeight); int index = ((pointY / mBoxHeight) * mGridWidth) + pointX / mBoxWidth; diff --git a/src/gui/widgets/spellshortcutcontainer.cpp b/src/gui/widgets/spellshortcutcontainer.cpp index 768206bdb..239fc6797 100644 --- a/src/gui/widgets/spellshortcutcontainer.cpp +++ b/src/gui/widgets/spellshortcutcontainer.cpp @@ -116,7 +116,7 @@ void SpellShortcutContainer::draw(Graphics *graphics) const int itemId = getItemByIndex(i); if (selectedId >= 0 && itemId == selectedId) { - graphics->drawRectangle(gcn::Rectangle(itemX + 1, itemY + 1, + graphics->drawRectangle(Rectangle(itemX + 1, itemY + 1, mBoxWidth - 1, mBoxHeight - 1)); } diff --git a/src/gui/widgets/tabbedarea.cpp b/src/gui/widgets/tabbedarea.cpp index 879ac8ec0..ce2c02886 100644 --- a/src/gui/widgets/tabbedarea.cpp +++ b/src/gui/widgets/tabbedarea.cpp @@ -457,7 +457,7 @@ void TabbedArea::widgetResized(const Event &event A_UNUSED) { if (mFollowDownScroll && height != 0) { - const gcn::Rectangle &rect = w->getDimension(); + const Rectangle &rect = w->getDimension(); if (rect.height != 0 && rect.height > height + 2) { if (scr->getVerticalScrollAmount() @@ -722,7 +722,7 @@ void TabbedArea::setSize(int width, int height) adjustSize(); } -void TabbedArea::setDimension(const gcn::Rectangle &dimension) +void TabbedArea::setDimension(const Rectangle &dimension) { gcn::Widget::setDimension(dimension); adjustSize(); diff --git a/src/gui/widgets/tabbedarea.h b/src/gui/widgets/tabbedarea.h index a95438605..2affd7368 100644 --- a/src/gui/widgets/tabbedarea.h +++ b/src/gui/widgets/tabbedarea.h @@ -222,7 +222,7 @@ class TabbedArea final : public ActionListener, void setSize(int width, int height); - void setDimension(const gcn::Rectangle &dimension); + void setDimension(const Rectangle &dimension); void death(const Event &event); diff --git a/src/gui/widgets/tabs/chattab.cpp b/src/gui/widgets/tabs/chattab.cpp index b74dc53b8..70018f999 100644 --- a/src/gui/widgets/tabs/chattab.cpp +++ b/src/gui/widgets/tabs/chattab.cpp @@ -407,7 +407,7 @@ void ChatTab::chatInput(const std::string &message) void ChatTab::scroll(const int amount) { const int range = mScrollArea->getHeight() / 8 * amount; - gcn::Rectangle scr; + Rectangle scr; scr.y = mScrollArea->getVerticalScrollAmount() + range; scr.height = abs(range); mTextOutput->showPart(scr); diff --git a/src/gui/widgets/tabs/setup_audio.cpp b/src/gui/widgets/tabs/setup_audio.cpp index 1bb119ee4..d70e4e1b4 100644 --- a/src/gui/widgets/tabs/setup_audio.cpp +++ b/src/gui/widgets/tabs/setup_audio.cpp @@ -168,7 +168,7 @@ Setup_Audio::Setup_Audio(const Widget2 *const widget) : new SetupItemCheckBox(_("Download music"), "", "download-music", this, "download-musicEvent"); - setDimension(gcn::Rectangle(0, 0, 550, 350)); + setDimension(Rectangle(0, 0, 550, 350)); } Setup_Audio::~Setup_Audio() diff --git a/src/gui/widgets/tabs/setup_chat.cpp b/src/gui/widgets/tabs/setup_chat.cpp index 3aa6d39d2..94a65163b 100644 --- a/src/gui/widgets/tabs/setup_chat.cpp +++ b/src/gui/widgets/tabs/setup_chat.cpp @@ -195,7 +195,7 @@ Setup_Chat::Setup_Chat(const Widget2 *const widget) : new SetupItemCheckBox(_("Show motd server message on start"), "", "showmotd", this, "showmotdEvent"); - setDimension(gcn::Rectangle(0, 0, 550, 350)); + setDimension(Rectangle(0, 0, 550, 350)); } void Setup_Chat::apply() diff --git a/src/gui/widgets/tabs/setup_colors.cpp b/src/gui/widgets/tabs/setup_colors.cpp index 61219fa98..41be92454 100644 --- a/src/gui/widgets/tabs/setup_colors.cpp +++ b/src/gui/widgets/tabs/setup_colors.cpp @@ -192,7 +192,7 @@ Setup_Colors::Setup_Colors(const Widget2 *const widget) : mGradTypeText->setCaption(""); - setDimension(gcn::Rectangle(0, 0, 365, 350)); + setDimension(Rectangle(0, 0, 365, 350)); } Setup_Colors::~Setup_Colors() diff --git a/src/gui/widgets/tabs/setup_input.cpp b/src/gui/widgets/tabs/setup_input.cpp index 03c8f31e3..24bf229ef 100644 --- a/src/gui/widgets/tabs/setup_input.cpp +++ b/src/gui/widgets/tabs/setup_input.cpp @@ -164,7 +164,7 @@ Setup_Input::Setup_Input(const Widget2 *const widget) : if (config.getIntValue("screenwidth") >= 730) width += 100; - setDimension(gcn::Rectangle(0, 0, width, 350)); + setDimension(Rectangle(0, 0, width, 350)); } Setup_Input::~Setup_Input() diff --git a/src/gui/widgets/tabs/setup_joystick.cpp b/src/gui/widgets/tabs/setup_joystick.cpp index 7f96ee468..aa1180cef 100644 --- a/src/gui/widgets/tabs/setup_joystick.cpp +++ b/src/gui/widgets/tabs/setup_joystick.cpp @@ -93,7 +93,7 @@ Setup_Joystick::Setup_Joystick(const Widget2 *const widget) : place(0, 4, mCalibrateLabel); place(0, 5, mCalibrateButton); - setDimension(gcn::Rectangle(0, 0, 365, 75)); + setDimension(Rectangle(0, 0, 365, 75)); } Setup_Joystick::~Setup_Joystick() diff --git a/src/gui/widgets/tabs/setup_mods.cpp b/src/gui/widgets/tabs/setup_mods.cpp index ada0ef686..657d09658 100644 --- a/src/gui/widgets/tabs/setup_mods.cpp +++ b/src/gui/widgets/tabs/setup_mods.cpp @@ -44,7 +44,7 @@ Setup_Mods::Setup_Mods(const Widget2 *const widget) : ContainerPlacer place = h.getPlacer(0, 0); place(0, 0, mScroll, 10, 10); - setDimension(gcn::Rectangle(0, 0, 550, 350)); + setDimension(Rectangle(0, 0, 550, 350)); } Setup_Mods::~Setup_Mods() diff --git a/src/gui/widgets/tabs/setup_other.cpp b/src/gui/widgets/tabs/setup_other.cpp index 985baa744..4640150e4 100644 --- a/src/gui/widgets/tabs/setup_other.cpp +++ b/src/gui/widgets/tabs/setup_other.cpp @@ -390,7 +390,7 @@ Setup_Other::Setup_Other(const Widget2 *const widget) : new SetupItemDropDown(_("Screen density override"), "", "screenDensity", this, "screenDensityEvent", mDensityList, 100); - setDimension(gcn::Rectangle(0, 0, 550, 350)); + setDimension(Rectangle(0, 0, 550, 350)); } Setup_Other::~Setup_Other() diff --git a/src/gui/widgets/tabs/setup_perfomance.cpp b/src/gui/widgets/tabs/setup_perfomance.cpp index 271501e38..88cf6279c 100644 --- a/src/gui/widgets/tabs/setup_perfomance.cpp +++ b/src/gui/widgets/tabs/setup_perfomance.cpp @@ -153,7 +153,7 @@ Setup_Perfomance::Setup_Perfomance(const Widget2 *const widget) : "", "uselonglivesounds", this, "uselonglivesoundsEvent"); - setDimension(gcn::Rectangle(0, 0, 550, 350)); + setDimension(Rectangle(0, 0, 550, 350)); } Setup_Perfomance::~Setup_Perfomance() diff --git a/src/gui/widgets/tabs/setup_players.cpp b/src/gui/widgets/tabs/setup_players.cpp index d4f29fa2c..a612a51c4 100644 --- a/src/gui/widgets/tabs/setup_players.cpp +++ b/src/gui/widgets/tabs/setup_players.cpp @@ -100,5 +100,5 @@ Setup_Players::Setup_Players(const Widget2 *const widget) : new SetupItemCheckBox(_("Use special diagonal speed in players moving"), "", "useDiagonalSpeed", this, "useDiagonalSpeedEvent"); - setDimension(gcn::Rectangle(0, 0, 550, 350)); + setDimension(Rectangle(0, 0, 550, 350)); } diff --git a/src/gui/widgets/tabs/setup_relations.cpp b/src/gui/widgets/tabs/setup_relations.cpp index 35bd2094a..30e1c96bd 100644 --- a/src/gui/widgets/tabs/setup_relations.cpp +++ b/src/gui/widgets/tabs/setup_relations.cpp @@ -319,7 +319,7 @@ Setup_Relations::Setup_Relations(const Widget2 *const widget) : player_relations.addListener(this); - setDimension(gcn::Rectangle(0, 0, 500, 350)); + setDimension(Rectangle(0, 0, 500, 350)); } Setup_Relations::~Setup_Relations() diff --git a/src/gui/widgets/tabs/setup_theme.cpp b/src/gui/widgets/tabs/setup_theme.cpp index d27a095d5..b744eb0eb 100644 --- a/src/gui/widgets/tabs/setup_theme.cpp +++ b/src/gui/widgets/tabs/setup_theme.cpp @@ -389,7 +389,7 @@ Setup_Theme::Setup_Theme(const Widget2 *const widget) : else if (size > maxWidth) size = maxWidth; - setDimension(gcn::Rectangle(0, 0, size, 500)); + setDimension(Rectangle(0, 0, size, 500)); } Setup_Theme::~Setup_Theme() diff --git a/src/gui/widgets/tabs/setup_touch.cpp b/src/gui/widgets/tabs/setup_touch.cpp index 2baae029e..1d9149fbd 100644 --- a/src/gui/widgets/tabs/setup_touch.cpp +++ b/src/gui/widgets/tabs/setup_touch.cpp @@ -119,7 +119,7 @@ Setup_Touch::Setup_Touch(const Widget2 *const widget) : key, this, event, mActionsList, 250); } - setDimension(gcn::Rectangle(0, 0, 550, 350)); + setDimension(Rectangle(0, 0, 550, 350)); } Setup_Touch::~Setup_Touch() diff --git a/src/gui/widgets/tabs/setup_video.cpp b/src/gui/widgets/tabs/setup_video.cpp index d2ef01378..4e4408ce6 100644 --- a/src/gui/widgets/tabs/setup_video.cpp +++ b/src/gui/widgets/tabs/setup_video.cpp @@ -304,7 +304,7 @@ Setup_Video::Setup_Video(const Widget2 *const widget) : if (config.getIntValue("screenwidth") >= 730) width += 100; - setDimension(gcn::Rectangle(0, 0, width, 300)); + setDimension(Rectangle(0, 0, width, 300)); } Setup_Video::~Setup_Video() diff --git a/src/gui/widgets/tabs/setup_visual.cpp b/src/gui/widgets/tabs/setup_visual.cpp index ac608f756..d7c2ff788 100644 --- a/src/gui/widgets/tabs/setup_visual.cpp +++ b/src/gui/widgets/tabs/setup_visual.cpp @@ -202,7 +202,7 @@ Setup_Visual::Setup_Visual(const Widget2 *const widget) : new SetupItemCheckBox(_("Allow screensaver to run"), "", "allowscreensaver", this, "allowscreensaverEvent"); - setDimension(gcn::Rectangle(0, 0, 550, 350)); + setDimension(Rectangle(0, 0, 550, 350)); } Setup_Visual::~Setup_Visual() diff --git a/src/gui/widgets/textbox.cpp b/src/gui/widgets/textbox.cpp index e0327e670..59e61f8d2 100644 --- a/src/gui/widgets/textbox.cpp +++ b/src/gui/widgets/textbox.cpp @@ -357,7 +357,7 @@ void TextBox::draw(Graphics* graphics) if (mOpaque) { graphics->setColor(mBackgroundColor); - graphics->fillRectangle(gcn::Rectangle(0, 0, getWidth(), getHeight())); + graphics->fillRectangle(Rectangle(0, 0, getWidth(), getHeight())); } Font *const font = getFont(); diff --git a/src/gui/widgets/textfield.cpp b/src/gui/widgets/textfield.cpp index 0d4d53dd3..3b4c5302c 100644 --- a/src/gui/widgets/textfield.cpp +++ b/src/gui/widgets/textfield.cpp @@ -662,7 +662,7 @@ void TextField::handleCopy() const void TextField::drawCaret(Graphics* graphics, int x) { - const gcn::Rectangle *const clipArea = graphics->getCurrentClipArea(); + const Rectangle *const clipArea = graphics->getCurrentClipArea(); if (!clipArea) return; diff --git a/src/gui/widgets/textpreview.cpp b/src/gui/widgets/textpreview.cpp index 462ba17d9..0676dec25 100644 --- a/src/gui/widgets/textpreview.cpp +++ b/src/gui/widgets/textpreview.cpp @@ -93,7 +93,7 @@ void TextPreview::draw(Graphics* graphics) static_cast<int>(mBGColor->g), static_cast<int>(mBGColor->b), static_cast<int>(mAlpha * 255.0F))); - graphics->fillRectangle(gcn::Rectangle(0, 0, + graphics->fillRectangle(Rectangle(0, 0, mDimension.width, mDimension.height)); } @@ -109,7 +109,7 @@ void TextPreview::draw(Graphics* graphics) static_cast<int>(mTextBGColor->g), static_cast<int>(mTextBGColor->b), intAlpha)); - graphics->fillRectangle(gcn::Rectangle(mPadding, mPadding, x, y)); + graphics->fillRectangle(Rectangle(mPadding, mPadding, x, y)); } } diff --git a/src/gui/widgets/window.cpp b/src/gui/widgets/window.cpp index d26580fc2..cccb1cdc7 100644 --- a/src/gui/widgets/window.cpp +++ b/src/gui/widgets/window.cpp @@ -487,7 +487,7 @@ void Window::setResizable(const bool r) void Window::widgetResized(const Event &event A_UNUSED) { - const gcn::Rectangle area = getChildrenArea(); + const Rectangle area = getChildrenArea(); if (mGrip) { @@ -794,7 +794,7 @@ void Window::mouseDragged(MouseEvent &event) { const int dx = event.getX() - mDragOffsetX; const int dy = event.getY() - mDragOffsetY; - gcn::Rectangle newDim = getDimension(); + Rectangle newDim = getDimension(); if (mouseResize & (TOP | BOTTOM)) { @@ -1192,7 +1192,7 @@ void Window::redraw() { if (mLayout) { - const gcn::Rectangle area = getChildrenArea(); + const Rectangle area = getChildrenArea(); int w = area.width; int h = area.height; mLayout->reflow(w, h); @@ -1228,12 +1228,12 @@ void Window::ensureOnScreen() mDimension.y = 0; } -gcn::Rectangle Window::getWindowArea() const +Rectangle Window::getWindowArea() const { - return gcn::Rectangle(mPadding, - mPadding, - mDimension.width - mPadding * 2, - mDimension.height - mPadding * 2); + return Rectangle(mPadding, + mPadding, + mDimension.width - mPadding * 2, + mDimension.height - mPadding * 2); } int Window::getOption(const std::string &name, const int def) const diff --git a/src/gui/widgets/window.h b/src/gui/widgets/window.h index 37a9900ee..10c9123be 100644 --- a/src/gui/widgets/window.h +++ b/src/gui/widgets/window.h @@ -405,7 +405,7 @@ class Window : public gcn::Window, */ int getGuiAlpha() const A_WARN_UNUSED; - gcn::Rectangle getWindowArea() const A_WARN_UNUSED; + Rectangle getWindowArea() const A_WARN_UNUSED; bool isResizeAllowed(const MouseEvent &event) const A_WARN_UNUSED; @@ -476,9 +476,9 @@ class Window : public gcn::Window, Image *mGrip; /**< Resize grip */ Window *mParent; /**< The parent window */ Layout *mLayout; /**< Layout handler */ - gcn::Rectangle mCloseRect; /**< Close button rectangle */ - gcn::Rectangle mStickyRect; /**< Sticky button rectangle */ - gcn::Rectangle mGripRect; /**< Resize grip rectangle */ + Rectangle mCloseRect; /**< Close button rectangle */ + Rectangle mStickyRect; /**< Sticky button rectangle */ + Rectangle mGripRect; /**< Resize grip rectangle */ std::string mWindowName; /**< Name of the window */ int mMinWinWidth; /**< Minimum window width */ int mMinWinHeight; /**< Minimum window height */ diff --git a/src/gui/windowmenu.cpp b/src/gui/windowmenu.cpp index 27418b892..79ed7255d 100644 --- a/src/gui/windowmenu.cpp +++ b/src/gui/windowmenu.cpp @@ -168,7 +168,7 @@ WindowMenu::WindowMenu(const Widget2 *const widget) : x += mPadding - mSpacing; if (mainGraphics) - setDimension(gcn::Rectangle(mainGraphics->mWidth - x, 0, x, h)); + setDimension(Rectangle(mainGraphics->mWidth - x, 0, x, h)); loadButtons(); @@ -293,7 +293,7 @@ void WindowMenu::mouseMoved(MouseEvent &event) const int x = event.getX(); const int y = event.getY(); const int key = btn->getTag(); - const gcn::Rectangle &rect = mDimension; + const Rectangle &rect = mDimension; if (key != Input::KEY_NO_VALUE) { mTextPopup->show(x + rect.x, y + rect.y, btn->getDescription(), @@ -350,7 +350,7 @@ void WindowMenu::updateButtons() } x += mPadding - mSpacing; if (mainGraphics) - setDimension(gcn::Rectangle(mainGraphics->mWidth - x, 0, x, h)); + setDimension(Rectangle(mainGraphics->mWidth - x, 0, x, h)); } void WindowMenu::loadButtons() diff --git a/src/gui/windows/charcreatedialog.cpp b/src/gui/windows/charcreatedialog.cpp index fb407b9cc..1ddaaa7b2 100644 --- a/src/gui/windows/charcreatedialog.cpp +++ b/src/gui/windows/charcreatedialog.cpp @@ -208,13 +208,13 @@ CharCreateDialog::CharCreateDialog(CharSelectDialog *const parent, const int h = 350; setContentSize(w, h); - mPlayerBox->setDimension(gcn::Rectangle(360, 0, 110, 90)); + mPlayerBox->setDimension(Rectangle(360, 0, 110, 90)); mActionButton->setPosition(385, 100); mRotateButton->setPosition(415, 100); mNameLabel->setPosition(5, 2); mNameField->setDimension( - gcn::Rectangle(60, 2, 300, mNameField->getHeight())); + Rectangle(60, 2, 300, mNameField->getHeight())); const int leftX = 120; const int rightX = 300; @@ -530,7 +530,7 @@ void CharCreateDialog::setAttributes(const StringVect &labels, add(mAttributeLabel[i]); mAttributeSlider[i] = new Slider(this, min, max); - mAttributeSlider[i]->setDimension(gcn::Rectangle(140, y + i * 24, + mAttributeSlider[i]->setDimension(Rectangle(140, y + i * 24, 150, 12)); mAttributeSlider[i]->setActionEventId("statslider"); mAttributeSlider[i]->addActionListener(this); diff --git a/src/gui/windows/chatwindow.cpp b/src/gui/windows/chatwindow.cpp index 565d3644a..1754ca0bf 100644 --- a/src/gui/windows/chatwindow.cpp +++ b/src/gui/windows/chatwindow.cpp @@ -377,7 +377,7 @@ void ChatWindow::updateTabsMargin() void ChatWindow::adjustTabSize() { - const gcn::Rectangle area = getChildrenArea(); + const Rectangle area = getChildrenArea(); const int aw = area.width; const int ah = area.height; diff --git a/src/gui/windows/debugwindow.cpp b/src/gui/windows/debugwindow.cpp index 7e68aa6d8..2a227c4e2 100644 --- a/src/gui/windows/debugwindow.cpp +++ b/src/gui/windows/debugwindow.cpp @@ -75,7 +75,7 @@ DebugWindow::DebugWindow() : // TRANSLATORS: debug window tab mTabs->addTab(std::string(_("Net")), mNetWidget); - mTabs->setDimension(gcn::Rectangle(0, 0, 600, 300)); + mTabs->setDimension(Rectangle(0, 0, 600, 300)); const int w = mDimension.width; const int h = mDimension.height; @@ -151,7 +151,7 @@ void DebugWindow::widgetResized(const Event &event) { Window::widgetResized(event); - mTabs->setDimension(gcn::Rectangle(0, 0, + mTabs->setDimension(Rectangle(0, 0, mDimension.width, mDimension.height)); } @@ -267,7 +267,7 @@ MapDebugTab::MapDebugTab(const Widget2 *const widget) : #endif place.getCell().matchColWidth(0, 0); place = h.getPlacer(0, 1); - setDimension(gcn::Rectangle(0, 0, 600, 300)); + setDimension(Rectangle(0, 0, 600, 300)); } void MapDebugTab::logic() @@ -412,7 +412,7 @@ TargetDebugTab::TargetDebugTab(const Widget2 *const widget) : place.getCell().matchColWidth(0, 0); place = h.getPlacer(0, 1); - setDimension(gcn::Rectangle(0, 0, 600, 300)); + setDimension(Rectangle(0, 0, 600, 300)); } void TargetDebugTab::logic() @@ -531,7 +531,7 @@ NetDebugTab::NetDebugTab(const Widget2 *const widget) : place.getCell().matchColWidth(0, 0); place = h.getPlacer(0, 1); - setDimension(gcn::Rectangle(0, 0, 600, 300)); + setDimension(Rectangle(0, 0, 600, 300)); } void NetDebugTab::logic() diff --git a/src/gui/windows/debugwindow.h b/src/gui/windows/debugwindow.h index aa7bdfe6c..194385b06 100644 --- a/src/gui/windows/debugwindow.h +++ b/src/gui/windows/debugwindow.h @@ -41,7 +41,7 @@ class DebugTab : public Container } void resize(const int x, const int y) - { setDimension(gcn::Rectangle(0, 0, x, y)); } + { setDimension(Rectangle(0, 0, x, y)); } protected: explicit DebugTab(const Widget2 *const widget) : diff --git a/src/gui/windows/equipmentwindow.cpp b/src/gui/windows/equipmentwindow.cpp index 01f74c50d..a50d0e9fa 100644 --- a/src/gui/windows/equipmentwindow.cpp +++ b/src/gui/windows/equipmentwindow.cpp @@ -92,7 +92,7 @@ EquipmentWindow::EquipmentWindow(Equipment *const equipment, mBoxSize = 36; // Control that shows the Player - mPlayerBox->setDimension(gcn::Rectangle(50, 80, 74, 168)); + mPlayerBox->setDimension(Rectangle(50, 80, 74, 168)); mPlayerBox->setPlayer(being); if (foring) @@ -116,7 +116,7 @@ EquipmentWindow::EquipmentWindow(Equipment *const equipment, void EquipmentWindow::postInit() { - const gcn::Rectangle &area = getChildrenArea(); + const Rectangle &area = getChildrenArea(); mUnequip->setPosition(area.width - mUnequip->getWidth() - mButtonPadding, area.height - mUnequip->getHeight() - mButtonPadding); mUnequip->setEnabled(false); @@ -283,7 +283,7 @@ Item *EquipmentWindow::getItem(const int x, const int y) const const EquipmentBox *const box = *it; if (!box) continue; - const gcn::Rectangle tRect(box->x, box->y, mBoxSize, mBoxSize); + const Rectangle tRect(box->x, box->y, mBoxSize, mBoxSize); if (tRect.isPointInRect(x, y)) return mEquipment->getEquipment(i); @@ -321,7 +321,7 @@ void EquipmentWindow::mousePressed(MouseEvent& mouseEvent) if (!box) continue; const Item *const item = mEquipment->getEquipment(i); - const gcn::Rectangle tRect(box->x, box->y, mBoxSize, mBoxSize); + const Rectangle tRect(box->x, box->y, mBoxSize, mBoxSize); if (tRect.isPointInRect(x, y)) { @@ -402,7 +402,7 @@ void EquipmentWindow::mouseReleased(MouseEvent &mouseEvent) const EquipmentBox *const box = *it; if (!box) continue; - const gcn::Rectangle tRect(box->x, box->y, mBoxSize, mBoxSize); + const Rectangle tRect(box->x, box->y, mBoxSize, mBoxSize); if (tRect.isPointInRect(x, y)) return; @@ -514,7 +514,7 @@ void EquipmentWindow::fillBoxes() void EquipmentWindow::loadPlayerBox(const XmlNodePtr playerBoxNode) { - mPlayerBox->setDimension(gcn::Rectangle( + mPlayerBox->setDimension(Rectangle( XML::getProperty(playerBoxNode, "x", 50), XML::getProperty(playerBoxNode, "y", 80), XML::getProperty(playerBoxNode, "width", 74), diff --git a/src/gui/windows/inventorywindow.cpp b/src/gui/windows/inventorywindow.cpp index 603b1b26d..bd6719df9 100644 --- a/src/gui/windows/inventorywindow.cpp +++ b/src/gui/windows/inventorywindow.cpp @@ -598,7 +598,7 @@ void InventoryWindow::mouseMoved(MouseEvent &event) { const int x = event.getX(); const int y = event.getY(); - const gcn::Rectangle &rect = mDimension; + const Rectangle &rect = mDimension; mTextPopup->show(rect.x + x, rect.y + y, strprintf(_("Money: %s"), Units::formatCurrency(PlayerInfo::getAttribute( PlayerInfo::MONEY)).c_str())); diff --git a/src/gui/windows/minimap.cpp b/src/gui/windows/minimap.cpp index 0f0938e20..dd8a1d2b7 100644 --- a/src/gui/windows/minimap.cpp +++ b/src/gui/windows/minimap.cpp @@ -213,7 +213,7 @@ void Minimap::setMap(const Map *const map) setHeight(height); } - const gcn::Rectangle &rect = mDimension; + const Rectangle &rect = mDimension; setDefaultSize(rect.x, rect.y, rect.width, rect.height); resetToDefaultSize(); @@ -244,7 +244,7 @@ void Minimap::draw(Graphics *graphics) return; } - const gcn::Rectangle a = getChildrenArea(); + const Rectangle a = getChildrenArea(); graphics->pushClipArea(a); @@ -346,7 +346,7 @@ void Minimap::draw(Graphics *graphics) dotSize - 1) * mWidthProportion); const Vector &pos = being->getPosition(); - graphics->fillRectangle(gcn::Rectangle( + graphics->fillRectangle(Rectangle( static_cast<float>(pos.x * mWidthProportion) / 32 + mMapOriginX - offsetWidth, static_cast<float>(pos.y * mHeightProportion) / 32 @@ -384,7 +384,7 @@ void Minimap::draw(Graphics *graphics) const int offsetWidth = static_cast<int>( mWidthProportion); - graphics->fillRectangle(gcn::Rectangle( + graphics->fillRectangle(Rectangle( static_cast<int>(member->getX() * mWidthProportion) + mMapOriginX - offsetWidth, static_cast<int>(member->getY() @@ -429,7 +429,7 @@ void Minimap::draw(Graphics *graphics) } graphics->setColor(userPalette->getColor(UserPalette::PC)); - graphics->drawRectangle(gcn::Rectangle(x, y, w, h)); + graphics->drawRectangle(Rectangle(x, y, w, h)); graphics->popClipArea(); BLOCK_END("Minimap::draw") } @@ -463,7 +463,7 @@ void Minimap::mouseMoved(MouseEvent &event) Window::mouseMoved(event); const int x = event.getX(); const int y = event.getY(); - const gcn::Rectangle &rect = mDimension; + const Rectangle &rect = mDimension; mTextPopup->show(x + rect.x, y + rect.y, mCaption); } @@ -475,7 +475,7 @@ void Minimap::mouseExited(MouseEvent &event) void Minimap::screenToMap(int &x, int &y) { - const gcn::Rectangle a = getChildrenArea(); + const Rectangle a = getChildrenArea(); x = (x - a.x - mMapOriginX + mWidthProportion) / mWidthProportion; y = (y - a.y - mMapOriginY + mHeightProportion) / mHeightProportion; } diff --git a/src/gui/windows/ministatuswindow.cpp b/src/gui/windows/ministatuswindow.cpp index b8f2fd7ea..655ccb277 100644 --- a/src/gui/windows/ministatuswindow.cpp +++ b/src/gui/windows/ministatuswindow.cpp @@ -322,7 +322,7 @@ void MiniStatusWindow::mouseMoved(MouseEvent &event) const int x = event.getX(); const int y = event.getY(); - const gcn::Rectangle &rect = mDimension; + const Rectangle &rect = mDimension; if (event.getSource() == mStatusBar) { mStatusPopup->view(x + rect.x, y + rect.y); @@ -535,12 +535,12 @@ void MiniStatusWindow::updateArrows() StatusWindow::updateArrowsBar(mArrowsBar); } -gcn::Rectangle MiniStatusWindow::getChildrenArea() +Rectangle MiniStatusWindow::getChildrenArea() { const int padding = mPadding; const int padding2 = padding * 2; - const gcn::Rectangle &rect = mDimension; - return gcn::Rectangle(padding, padding, + const Rectangle &rect = mDimension; + return Rectangle(padding, padding, rect.width - padding2, rect.height - padding2); } diff --git a/src/gui/windows/ministatuswindow.h b/src/gui/windows/ministatuswindow.h index bb1991c19..e061cbfae 100644 --- a/src/gui/windows/ministatuswindow.h +++ b/src/gui/windows/ministatuswindow.h @@ -88,7 +88,7 @@ class MiniStatusWindow final : public Popup, std::vector <ProgressBar*> &getBars() A_WARN_UNUSED { return mBars; } - gcn::Rectangle getChildrenArea() override final A_WARN_UNUSED; + Rectangle getChildrenArea() override final A_WARN_UNUSED; #ifdef USE_PROFILER void logicChildren(); diff --git a/src/gui/windows/npcpostdialog.cpp b/src/gui/windows/npcpostdialog.cpp index 23c21da0c..aa510b88e 100644 --- a/src/gui/windows/npcpostdialog.cpp +++ b/src/gui/windows/npcpostdialog.cpp @@ -76,7 +76,7 @@ void NpcPostDialog::postInit() // create scroll box for letter text ScrollArea *const scrollArea = new ScrollArea(this, mText); scrollArea->setHorizontalScrollPolicy(gcn::ScrollArea::SHOW_NEVER); - scrollArea->setDimension(gcn::Rectangle( + scrollArea->setDimension(Rectangle( 5, mSender->getHeight() + 5, 380, 140 - (mSender->getHeight() + sendButton->getHeight()))); diff --git a/src/gui/windows/outfitwindow.cpp b/src/gui/windows/outfitwindow.cpp index d1413cc0a..acf681cf4 100644 --- a/src/gui/windows/outfitwindow.cpp +++ b/src/gui/windows/outfitwindow.cpp @@ -328,9 +328,9 @@ void OutfitWindow::draw(Graphics *graphics) + ((i / mGridWidth) * mBoxHeight); graphics->setColor(mBorderColor); - graphics->drawRectangle(gcn::Rectangle(itemX, itemY, 32, 32)); + graphics->drawRectangle(Rectangle(itemX, itemY, 32, 32)); graphics->setColor(mBackgroundColor); - graphics->fillRectangle(gcn::Rectangle(itemX, itemY, 32, 32)); + graphics->fillRectangle(Rectangle(itemX, itemY, 32, 32)); if (mItems[mCurrentOutfit][i] < 0) continue; @@ -483,7 +483,7 @@ void OutfitWindow::mouseReleased(MouseEvent &event) int OutfitWindow::getIndexFromGrid(const int pointX, const int pointY) const { - const gcn::Rectangle tRect = gcn::Rectangle(mPadding, mTitleBarHeight, + const Rectangle tRect = Rectangle(mPadding, mTitleBarHeight, mGridWidth * mBoxWidth, mGridHeight * mBoxHeight); if (!tRect.isPointInRect(pointX, pointY)) return -1; diff --git a/src/gui/windows/selldialog.cpp b/src/gui/windows/selldialog.cpp index dc932ca69..a89f7655a 100644 --- a/src/gui/windows/selldialog.cpp +++ b/src/gui/windows/selldialog.cpp @@ -291,7 +291,7 @@ void SellDialog::action(const ActionEvent &event) delete mShopItems->at(selectedItem); mShopItems->erase(selectedItem); - gcn::Rectangle scroll; + Rectangle scroll; scroll.y = mShopItemList->getRowHeight() * (selectedItem + 1); scroll.height = mShopItemList->getRowHeight(); mShopItemList->showPart(scroll); diff --git a/src/gui/windows/serverdialog.cpp b/src/gui/windows/serverdialog.cpp index cbab4710d..a6e3637fb 100644 --- a/src/gui/windows/serverdialog.cpp +++ b/src/gui/windows/serverdialog.cpp @@ -177,7 +177,7 @@ public: // Draw filled rectangle around the selected list element if (mSelected >= 0) { - graphics->fillRectangle(gcn::Rectangle(mPadding, + graphics->fillRectangle(Rectangle(mPadding, height * mSelected + mPadding, getWidth() - 2 * mPadding, height)); } diff --git a/src/gui/windows/setupwindow.cpp b/src/gui/windows/setupwindow.cpp index 9878807d9..0f4468882 100644 --- a/src/gui/windows/setupwindow.cpp +++ b/src/gui/windows/setupwindow.cpp @@ -113,7 +113,7 @@ void SetupWindow::postInit() mResetWindows = btn; } - mPanel->setDimension(gcn::Rectangle(5, 5, width - 10, height - 40)); + mPanel->setDimension(Rectangle(5, 5, width - 10, height - 40)); mPanel->enableScrollButtons(true); mTabs.push_back(new Setup_Video(this)); @@ -265,12 +265,12 @@ void SetupWindow::widgetResized(const Event &event) { Window::widgetResized(event); - const gcn::Rectangle area = getChildrenArea(); + const Rectangle area = getChildrenArea(); int x = area.width; const int height = area.height; const int width = area.width; const int buttonPadding = getOption("buttonPadding", 5); - mPanel->setDimension(gcn::Rectangle(5, 5, width - 10, height - 40)); + mPanel->setDimension(Rectangle(5, 5, width - 10, height - 40)); FOR_EACH (std::vector<Button*>::iterator, it, mButtons) { Button *const btn = *it; diff --git a/src/gui/windows/skilldialog.cpp b/src/gui/windows/skilldialog.cpp index 2e9a8be10..f5f233402 100644 --- a/src/gui/windows/skilldialog.cpp +++ b/src/gui/windows/skilldialog.cpp @@ -114,7 +114,7 @@ class SkillListBox final : public ListBox // Draw filled rectangle around the selected list element if (mSelected >= 0) { - graphics->fillRectangle(gcn::Rectangle(mPadding, getRowHeight() + graphics->fillRectangle(Rectangle(mPadding, getRowHeight() * mSelected + mPadding, getWidth() - 2 * mPadding, getRowHeight())); } diff --git a/src/gui/windows/whoisonline.cpp b/src/gui/windows/whoisonline.cpp index 76f12f795..70edccad1 100644 --- a/src/gui/windows/whoisonline.cpp +++ b/src/gui/windows/whoisonline.cpp @@ -116,10 +116,10 @@ void WhoIsOnline::postInit() setSaveVisible(true); mUpdateButton->setEnabled(false); - mUpdateButton->setDimension(gcn::Rectangle(5, 5, w - 10, 20 + 5)); + mUpdateButton->setDimension(Rectangle(5, 5, w - 10, 20 + 5)); mBrowserBox->setOpaque(false); - mScrollArea->setDimension(gcn::Rectangle(5, 20 + 10, w - 10, h - 10 - 30)); + mScrollArea->setDimension(Rectangle(5, 20 + 10, w - 10, h - 10 - 30)); mScrollArea->setSize(w - 10, h - 10 - 30); mBrowserBox->setLinkHandler(this); @@ -723,7 +723,7 @@ void WhoIsOnline::widgetResized(const Event &event) void WhoIsOnline::updateSize() { - const gcn::Rectangle area = getChildrenArea(); + const Rectangle area = getChildrenArea(); if (mUpdateButton) mUpdateButton->setWidth(area.width - 10); diff --git a/src/map.cpp b/src/map.cpp index 5dc1bfc0f..257516381 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -401,7 +401,7 @@ void Map::draw(Graphics *const graphics, int scrollX, int scrollY) graphics->setColor(userPalette->getColorWithAlpha( UserPalette::WALKABLE_HIGHLIGHT)); - graphics->fillRectangle(gcn::Rectangle(0, 0, + graphics->fillRectangle(Rectangle(0, 0, graphics->mWidth, graphics->mHeight)); } @@ -549,7 +549,7 @@ void Map::draw(Graphics *const graphics, int scrollX, int scrollY) {\ graphics->setColor(userPalette->getColorWithAlpha(\ UserPalette::color));\ - graphics->fillRectangle(gcn::Rectangle(\ + graphics->fillRectangle(Rectangle(\ x0 * mTileWidth - scrollX, \ y * mTileHeight - scrollY, \ width, mapTileSize));\ diff --git a/src/maplayer.cpp b/src/maplayer.cpp index b4fbc6da6..93434aca9 100644 --- a/src/maplayer.cpp +++ b/src/maplayer.cpp @@ -538,10 +538,10 @@ void MapLayer::drawFringe(Graphics *const graphics, int startX, int startY, { graphics->setColor(userPalette->getColorWithAlpha( UserPalette::ATTACK_RANGE)); - graphics->fillRectangle(gcn::Rectangle(x, y, w, h)); + graphics->fillRectangle(Rectangle(x, y, w, h)); graphics->setColor(userPalette->getColorWithAlpha( UserPalette::ATTACK_RANGE_BORDER)); - graphics->drawRectangle(gcn::Rectangle(x, y, w, h)); + graphics->drawRectangle(Rectangle(x, y, w, h)); } } } @@ -806,17 +806,17 @@ void MapItem::draw(Graphics *const graphics, const int x, const int y, case CROSS: graphics->setColor(userPalette->getColorWithAlpha( UserPalette::ROAD_POINT)); - graphics->fillRectangle(gcn::Rectangle(x + dx / 3, y + dy / 3, + graphics->fillRectangle(Rectangle(x + dx / 3, y + dy / 3, dx / 3, dy / 3)); break; case HOME: { graphics->setColor(userPalette->getColorWithAlpha( UserPalette::HOME_PLACE)); - graphics->fillRectangle(gcn::Rectangle(x, y, dx, dy)); + graphics->fillRectangle(Rectangle(x, y, dx, dy)); graphics->setColor(userPalette->getColorWithAlpha( UserPalette::HOME_PLACE_BORDER)); - graphics->drawRectangle(gcn::Rectangle(x, y, dx, dy)); + graphics->drawRectangle(Rectangle(x, y, dx, dy)); break; } default: diff --git a/src/render/graphics.cpp b/src/render/graphics.cpp index 653b4d4c0..bac987695 100644 --- a/src/render/graphics.cpp +++ b/src/render/graphics.cpp @@ -547,21 +547,21 @@ void Graphics::setWindowSize(const int width A_UNUSED, #endif } -bool Graphics::pushClipArea(gcn::Rectangle area) +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) { - gcn::ClipRectangle carea; + ClipRectangle carea; mClipStack.push(carea); return true; } if (mClipStack.empty()) { - gcn::ClipRectangle carea; + ClipRectangle carea; carea.x = area.x; carea.y = area.y; carea.width = area.width; @@ -572,8 +572,8 @@ bool Graphics::pushClipArea(gcn::Rectangle area) return true; } - const gcn::ClipRectangle &top = mClipStack.top(); - gcn::ClipRectangle carea; + const ClipRectangle &top = mClipStack.top(); + ClipRectangle carea; carea = area; carea.xOffset = top.xOffset + carea.x; carea.yOffset = top.yOffset + carea.y; @@ -618,7 +618,7 @@ void Graphics::popClipArea() mClipStack.pop(); } -const gcn::ClipRectangle *Graphics::getCurrentClipArea() const +const ClipRectangle *Graphics::getCurrentClipArea() const { if (mClipStack.empty()) return nullptr; diff --git a/src/render/graphics.h b/src/render/graphics.h index 2356d2d31..35e2a3ba3 100644 --- a/src/render/graphics.h +++ b/src/render/graphics.h @@ -74,7 +74,7 @@ #include "render/renderers.h" -#include "gui/base/cliprectangle.hpp" +#include "gui/cliprectangle.h" #ifdef USE_SDL2 #include <SDL_render.h> @@ -259,7 +259,7 @@ class Graphics const int w, const int h, const ImageRect &imgRect) = 0; - virtual void fillRectangle(const gcn::Rectangle& rectangle) = 0; + virtual void fillRectangle(const Rectangle& rectangle) = 0; /** * Updates the screen. This is done by either copying the buffer to the @@ -293,7 +293,7 @@ class Graphics const int x2, const int y2, const int width, const int height); - gcn::ClipRectangle &getTopClip() A_WARN_UNUSED + ClipRectangle &getTopClip() A_WARN_UNUSED { return mClipStack.top(); } void setRedraw(const bool n) @@ -410,7 +410,7 @@ class Graphics * @return False if the the new area lays outside the current clip * area. */ - virtual bool pushClipArea(gcn::Rectangle area); + virtual bool pushClipArea(Rectangle area); /** * Removes the top most clip area from the stack. @@ -434,7 +434,7 @@ class Graphics * * @param rectangle The rectangle to draw. */ - virtual void drawRectangle(const gcn::Rectangle &rectangle) = 0; + virtual void drawRectangle(const Rectangle &rectangle) = 0; /** * Gets the current clip area. Usefull if you want to do drawing @@ -442,7 +442,7 @@ class Graphics * * @return The current clip area. */ - virtual const gcn::ClipRectangle *getCurrentClipArea() const; + virtual const ClipRectangle *getCurrentClipArea() const; /** * Draws a single point/pixel. @@ -510,7 +510,7 @@ class Graphics /** * Holds the clip area stack. */ - std::stack<gcn::ClipRectangle> mClipStack; + std::stack<ClipRectangle> mClipStack; SDL_Window *mWindow; diff --git a/src/render/mobileopenglgraphics.cpp b/src/render/mobileopenglgraphics.cpp index 252dc0766..a2f7909ff 100644 --- a/src/render/mobileopenglgraphics.cpp +++ b/src/render/mobileopenglgraphics.cpp @@ -884,7 +884,7 @@ void MobileOpenGLGraphics::_beginDraw() // glScalef(0.5F, 0.5F, 0.5F); - pushClipArea(gcn::Rectangle(0, 0, mRect.w, mRect.h)); + pushClipArea(Rectangle(0, 0, mRect.w, mRect.h)); } void MobileOpenGLGraphics::_endDraw() @@ -951,21 +951,21 @@ SDL_Surface* MobileOpenGLGraphics::getScreenshot() return screenshot; } -bool MobileOpenGLGraphics::pushClipArea(gcn::Rectangle area) +bool MobileOpenGLGraphics::pushClipArea(Rectangle area) { int transX = 0; int transY = 0; if (!mClipStack.empty()) { - const gcn::ClipRectangle &clipArea = mClipStack.top(); + const ClipRectangle &clipArea = mClipStack.top(); transX = -clipArea.xOffset; transY = -clipArea.yOffset; } const bool result = Graphics::pushClipArea(area); - const gcn::ClipRectangle &clipArea = mClipStack.top(); + const ClipRectangle &clipArea = mClipStack.top(); transX += clipArea.xOffset; transY += clipArea.yOffset; @@ -986,7 +986,7 @@ void MobileOpenGLGraphics::popClipArea() if (mClipStack.empty()) return; - const gcn::ClipRectangle &clipArea1 = mClipStack.top(); + const ClipRectangle &clipArea1 = mClipStack.top(); int transX = -clipArea1.xOffset; int transY = -clipArea1.yOffset; @@ -995,7 +995,7 @@ void MobileOpenGLGraphics::popClipArea() if (mClipStack.empty()) return; - const gcn::ClipRectangle &clipArea = mClipStack.top(); + const ClipRectangle &clipArea = mClipStack.top(); transX += clipArea.xOffset; transY += clipArea.yOffset; if (transX || transY) @@ -1040,12 +1040,12 @@ void MobileOpenGLGraphics::drawLine(int x1, int y1, int x2, int y2) drawLineArrays(4); } -void MobileOpenGLGraphics::drawRectangle(const gcn::Rectangle& rect) +void MobileOpenGLGraphics::drawRectangle(const Rectangle& rect) { drawRectangle(rect, false); } -void MobileOpenGLGraphics::fillRectangle(const gcn::Rectangle& rect) +void MobileOpenGLGraphics::fillRectangle(const Rectangle& rect) { drawRectangle(rect, true); } @@ -1090,7 +1090,7 @@ void MobileOpenGLGraphics::setTexturingAndBlending(const bool enable) } } -void MobileOpenGLGraphics::drawRectangle(const gcn::Rectangle& rect, +void MobileOpenGLGraphics::drawRectangle(const Rectangle& rect, const bool filled) { BLOCK_START("Graphics::drawRectangle") diff --git a/src/render/normalopenglgraphics.cpp b/src/render/normalopenglgraphics.cpp index aea3f5d24..67a18bde5 100644 --- a/src/render/normalopenglgraphics.cpp +++ b/src/render/normalopenglgraphics.cpp @@ -1145,7 +1145,7 @@ void NormalOpenGLGraphics::_beginDraw() #endif #endif - pushClipArea(gcn::Rectangle(0, 0, w, h)); + pushClipArea(Rectangle(0, 0, w, h)); } void NormalOpenGLGraphics::_endDraw() @@ -1211,21 +1211,21 @@ SDL_Surface* NormalOpenGLGraphics::getScreenshot() return screenshot; } -bool NormalOpenGLGraphics::pushClipArea(gcn::Rectangle area) +bool NormalOpenGLGraphics::pushClipArea(Rectangle area) { int transX = 0; int transY = 0; if (!mClipStack.empty()) { - const gcn::ClipRectangle &clipArea = mClipStack.top(); + const ClipRectangle &clipArea = mClipStack.top(); transX = -clipArea.xOffset; transY = -clipArea.yOffset; } const bool result = Graphics::pushClipArea(area); - const gcn::ClipRectangle &clipArea = mClipStack.top(); + const ClipRectangle &clipArea = mClipStack.top(); transX += clipArea.xOffset; transY += clipArea.yOffset; @@ -1247,7 +1247,7 @@ void NormalOpenGLGraphics::popClipArea() if (mClipStack.empty()) return; - const gcn::ClipRectangle &clipArea1 = mClipStack.top(); + const ClipRectangle &clipArea1 = mClipStack.top(); int transX = -clipArea1.xOffset; int transY = -clipArea1.yOffset; @@ -1256,7 +1256,7 @@ void NormalOpenGLGraphics::popClipArea() if (mClipStack.empty()) return; - const gcn::ClipRectangle &clipArea = mClipStack.top(); + const ClipRectangle &clipArea = mClipStack.top(); transX += clipArea.xOffset; transY += clipArea.yOffset; if (transX || transY) @@ -1297,12 +1297,12 @@ void NormalOpenGLGraphics::drawLine(int x1, int y1, int x2, int y2) drawLineArrayf(4); } -void NormalOpenGLGraphics::drawRectangle(const gcn::Rectangle& rect) +void NormalOpenGLGraphics::drawRectangle(const Rectangle& rect) { drawRectangle(rect, false); } -void NormalOpenGLGraphics::fillRectangle(const gcn::Rectangle& rect) +void NormalOpenGLGraphics::fillRectangle(const Rectangle& rect) { drawRectangle(rect, true); } @@ -1347,7 +1347,7 @@ void NormalOpenGLGraphics::setTexturingAndBlending(const bool enable) } } -void NormalOpenGLGraphics::drawRectangle(const gcn::Rectangle& rect, +void NormalOpenGLGraphics::drawRectangle(const Rectangle& rect, const bool filled) { BLOCK_START("Graphics::drawRectangle") diff --git a/src/render/nullopenglgraphics.cpp b/src/render/nullopenglgraphics.cpp index d1c6ed0a6..6018247f9 100644 --- a/src/render/nullopenglgraphics.cpp +++ b/src/render/nullopenglgraphics.cpp @@ -918,7 +918,7 @@ void NullOpenGLGraphics::updateScreen() void NullOpenGLGraphics::_beginDraw() { - pushClipArea(gcn::Rectangle(0, 0, 640, 480)); + pushClipArea(Rectangle(0, 0, 640, 480)); } void NullOpenGLGraphics::_endDraw() @@ -935,21 +935,21 @@ SDL_Surface* NullOpenGLGraphics::getScreenshot() return nullptr; } -bool NullOpenGLGraphics::pushClipArea(gcn::Rectangle area) +bool NullOpenGLGraphics::pushClipArea(Rectangle area) { int transX = 0; int transY = 0; if (!mClipStack.empty()) { - const gcn::ClipRectangle &clipArea = mClipStack.top(); + const ClipRectangle &clipArea = mClipStack.top(); transX = -clipArea.xOffset; transY = -clipArea.yOffset; } const bool result = Graphics::pushClipArea(area); - const gcn::ClipRectangle &clipArea = mClipStack.top(); + const ClipRectangle &clipArea = mClipStack.top(); transX += clipArea.xOffset; transY += clipArea.yOffset; @@ -984,12 +984,12 @@ void NullOpenGLGraphics::drawLine(int x1, int y1, drawLineArrayf(4); } -void NullOpenGLGraphics::drawRectangle(const gcn::Rectangle& rect) +void NullOpenGLGraphics::drawRectangle(const Rectangle& rect) { drawRectangle(rect, false); } -void NullOpenGLGraphics::fillRectangle(const gcn::Rectangle& rect) +void NullOpenGLGraphics::fillRectangle(const Rectangle& rect) { drawRectangle(rect, true); } @@ -1017,7 +1017,7 @@ void NullOpenGLGraphics::setTexturingAndBlending(const bool enable) } } -void NullOpenGLGraphics::drawRectangle(const gcn::Rectangle& rect A_UNUSED, +void NullOpenGLGraphics::drawRectangle(const Rectangle& rect A_UNUSED, const bool filled A_UNUSED) { BLOCK_START("Graphics::drawRectangle") diff --git a/src/render/openglgraphicsdef.hpp b/src/render/openglgraphicsdef.hpp index 99bf8e82a..a582d9043 100644 --- a/src/render/openglgraphicsdef.hpp +++ b/src/render/openglgraphicsdef.hpp @@ -88,7 +88,7 @@ void _endDraw() override final; - bool pushClipArea(gcn::Rectangle area) override final; + bool pushClipArea(Rectangle area) override final; void popClipArea() override final; @@ -110,12 +110,12 @@ void drawLine(int x1, int y1, int x2, int y2) override final; - void drawRectangle(const gcn::Rectangle &rect, + void drawRectangle(const Rectangle &rect, const bool filled); - void drawRectangle(const gcn::Rectangle &rect) override final; + void drawRectangle(const Rectangle &rect) override final; - void fillRectangle(const gcn::Rectangle &rect) override final; + void fillRectangle(const Rectangle &rect) override final; static void dumpSettings(); diff --git a/src/render/safeopenglgraphics.cpp b/src/render/safeopenglgraphics.cpp index c27db4f47..c1c266464 100644 --- a/src/render/safeopenglgraphics.cpp +++ b/src/render/safeopenglgraphics.cpp @@ -459,7 +459,7 @@ void SafeOpenGLGraphics::_beginDraw() glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - pushClipArea(gcn::Rectangle(0, 0, mRect.w, mRect.h)); + pushClipArea(Rectangle(0, 0, mRect.w, mRect.h)); } void SafeOpenGLGraphics::_endDraw() @@ -523,21 +523,21 @@ SDL_Surface* SafeOpenGLGraphics::getScreenshot() return screenshot; } -bool SafeOpenGLGraphics::pushClipArea(gcn::Rectangle area) +bool SafeOpenGLGraphics::pushClipArea(Rectangle area) { int transX = 0; int transY = 0; if (!mClipStack.empty()) { - const gcn::ClipRectangle &clipArea = mClipStack.top(); + const ClipRectangle &clipArea = mClipStack.top(); transX = -clipArea.xOffset; transY = -clipArea.yOffset; } const bool result = Graphics::pushClipArea(area); - const gcn::ClipRectangle &clipArea = mClipStack.top(); + const ClipRectangle &clipArea = mClipStack.top(); glPushMatrix(); glTranslatef(static_cast<GLfloat>(transX + clipArea.xOffset), @@ -557,7 +557,7 @@ void SafeOpenGLGraphics::popClipArea() return; glPopMatrix(); - const gcn::ClipRectangle &clipArea = mClipStack.top(); + const ClipRectangle &clipArea = mClipStack.top(); glScissor(clipArea.x * mScale, (mRect.h - clipArea.y - clipArea.height) * mScale, clipArea.width * mScale, @@ -613,12 +613,12 @@ void SafeOpenGLGraphics::drawLine(int x1, int y1, int x2, int y2) glEnd(); } -void SafeOpenGLGraphics::drawRectangle(const gcn::Rectangle& rect) +void SafeOpenGLGraphics::drawRectangle(const Rectangle& rect) { drawRectangle(rect, false); } -void SafeOpenGLGraphics::fillRectangle(const gcn::Rectangle& rect) +void SafeOpenGLGraphics::fillRectangle(const Rectangle& rect) { drawRectangle(rect, true); } @@ -661,7 +661,7 @@ void SafeOpenGLGraphics::setTexturingAndBlending(const bool enable) } } -void SafeOpenGLGraphics::drawRectangle(const gcn::Rectangle& rect, +void SafeOpenGLGraphics::drawRectangle(const Rectangle& rect, const bool filled) { BLOCK_START("Graphics::drawRectangle") diff --git a/src/render/sdl2graphics.cpp b/src/render/sdl2graphics.cpp index 933120080..053049cef 100644 --- a/src/render/sdl2graphics.cpp +++ b/src/render/sdl2graphics.cpp @@ -136,7 +136,7 @@ bool SDLGraphics::drawRescaledImage(const Image *const image, if (!image->mTexture) return false; - const gcn::ClipRectangle &top = mClipStack.top(); + const ClipRectangle &top = mClipStack.top(); const SDL_Rect &bounds = image->mBounds; const SDL_Rect srcRect = { @@ -171,7 +171,7 @@ bool SDLGraphics::drawImageInline(const Image *const image, if (!mWindow || !image || !image->mTexture) return false; - const gcn::ClipRectangle &top = mClipStack.top(); + const ClipRectangle &top = mClipStack.top(); if (!top.width || !top.height) return false; @@ -203,7 +203,7 @@ void SDLGraphics::drawImageCached(const Image *const image, if (!mWindow || !image || !image->mTexture) return; - const gcn::ClipRectangle &top = mClipStack.top(); + const ClipRectangle &top = mClipStack.top(); if (!top.width || !top.height) return; @@ -238,7 +238,7 @@ void SDLGraphics::drawPatternCached(const Image *const image, if (!image->mTexture) return; - const gcn::ClipRectangle &top = mClipStack.top(); + const ClipRectangle &top = mClipStack.top(); if (!top.width || !top.height) return; @@ -296,7 +296,7 @@ void SDLGraphics::drawPatternInline(const Image *const image, if (!image->mTexture) return; - const gcn::ClipRectangle &top = mClipStack.top(); + const ClipRectangle &top = mClipStack.top(); if (!top.width || !top.height) return; @@ -347,7 +347,7 @@ void SDLGraphics::drawRescaledPattern(const Image *const image, if (scaledHeight == 0 || scaledWidth == 0) return; - const gcn::ClipRectangle &top = mClipStack.top(); + const ClipRectangle &top = mClipStack.top(); if (!top.width || !top.height) return; @@ -407,7 +407,7 @@ void SDLGraphics::calcPatternInline(ImageVertexes* const vert, if (!vert || !mWindow || !image || !image->mTexture) return; - const gcn::ClipRectangle &top = mClipStack.top(); + const ClipRectangle &top = mClipStack.top(); if (!top.width || !top.height) return; @@ -492,7 +492,7 @@ void SDLGraphics::calcTileSDL(ImageVertexes *const vert, int x, int y) const if (!vert || !vert->image || !vert->image->mTexture) return; - const gcn::ClipRectangle &top = mClipStack.top(); + const ClipRectangle &top = mClipStack.top(); if (!top.width || !top.height) return; @@ -638,9 +638,9 @@ void SDLGraphics::calcWindow(ImageCollection *const vertCol, calcImageRect(vert, x, y, w, h, imgRect); } -void SDLGraphics::fillRectangle(const gcn::Rectangle &rectangle) +void SDLGraphics::fillRectangle(const Rectangle &rectangle) { - const gcn::ClipRectangle &top = mClipStack.top(); + const ClipRectangle &top = mClipStack.top(); const SDL_Rect rect = { static_cast<int32_t>(rectangle.x + top.xOffset), @@ -655,7 +655,7 @@ void SDLGraphics::fillRectangle(const gcn::Rectangle &rectangle) void SDLGraphics::_beginDraw() { - pushClipArea(gcn::Rectangle(0, 0, mRect.w, mRect.h)); + pushClipArea(Rectangle(0, 0, mRect.w, mRect.h)); } void SDLGraphics::_endDraw() @@ -663,11 +663,11 @@ void SDLGraphics::_endDraw() popClipArea(); } -bool SDLGraphics::pushClipArea(gcn::Rectangle area) +bool SDLGraphics::pushClipArea(Rectangle area) { const bool result = Graphics::pushClipArea(area); - const gcn::ClipRectangle &carea = mClipStack.top(); + const ClipRectangle &carea = mClipStack.top(); const SDL_Rect rect = { static_cast<int32_t>(carea.x), @@ -686,7 +686,7 @@ void SDLGraphics::popClipArea() if (mClipStack.empty()) return; - const gcn::ClipRectangle &carea = mClipStack.top(); + const ClipRectangle &carea = mClipStack.top(); const SDL_Rect rect = { static_cast<int32_t>(carea.x), @@ -703,7 +703,7 @@ void SDLGraphics::drawPoint(int x, int y) if (mClipStack.empty()) return; - const gcn::ClipRectangle &top = mClipStack.top(); + const ClipRectangle &top = mClipStack.top(); x += top.xOffset; y += top.yOffset; @@ -722,9 +722,9 @@ void SDLGraphics::drawPoint(int x, int y) } -void SDLGraphics::drawRectangle(const gcn::Rectangle &rectangle) +void SDLGraphics::drawRectangle(const Rectangle &rectangle) { - const gcn::ClipRectangle &top = mClipStack.top(); + const ClipRectangle &top = mClipStack.top(); SDL_SetRenderDrawColor(mRenderer, mColor.r, mColor.g, mColor.b, mColor.a); @@ -746,7 +746,7 @@ void SDLGraphics::drawRectangle(const gcn::Rectangle &rectangle) void SDLGraphics::drawLine(int x1, int y1, int x2, int y2) { - const gcn::ClipRectangle &top = mClipStack.top(); + const ClipRectangle &top = mClipStack.top(); SDL_SetRenderDrawColor(mRenderer, mColor.r, mColor.g, mColor.b, mColor.a); diff --git a/src/render/sdl2graphics.h b/src/render/sdl2graphics.h index 1e581dc39..cce15e270 100644 --- a/src/render/sdl2graphics.h +++ b/src/render/sdl2graphics.h @@ -101,7 +101,7 @@ class SDLGraphics final : public Graphics void _endDraw() override final; - bool pushClipArea(gcn::Rectangle rect) override final; + bool pushClipArea(Rectangle rect) override final; void popClipArea() override final; @@ -163,9 +163,9 @@ class SDLGraphics final : public Graphics const int w, const int h, const ImageRect &imgRect) override final; - void fillRectangle(const gcn::Rectangle &rect) override final; + void fillRectangle(const Rectangle &rect) override final; - void drawRectangle(const gcn::Rectangle &rect) override final; + void drawRectangle(const Rectangle &rect) override final; void drawPoint(int x, int y) override final; diff --git a/src/render/sdl2softwaregraphics.cpp b/src/render/sdl2softwaregraphics.cpp index e6cce9c35..05b1fa2ef 100644 --- a/src/render/sdl2softwaregraphics.cpp +++ b/src/render/sdl2softwaregraphics.cpp @@ -82,7 +82,7 @@ bool SDL2SoftwareGraphics::drawRescaledImage(const Image *const image, if (!tmpImage->mSDLSurface) return false; - const gcn::ClipRectangle &top = mClipStack.top(); + const ClipRectangle &top = mClipStack.top(); const SDL_Rect &bounds = image->mBounds; SDL_Rect srcRect = @@ -123,7 +123,7 @@ bool SDL2SoftwareGraphics::drawImageInline(const Image *const image, if (!mSurface || !image || !image->mSDLSurface) return false; - const gcn::ClipRectangle &top = mClipStack.top(); + const ClipRectangle &top = mClipStack.top(); const SDL_Rect &bounds = image->mBounds; SDL_Surface *const src = image->mSDLSurface; @@ -211,7 +211,7 @@ void SDL2SoftwareGraphics::drawImageCached(const Image *const image, if (!mSurface || !image || !image->mSDLSurface) return; - const gcn::ClipRectangle &top = mClipStack.top(); + const ClipRectangle &top = mClipStack.top(); const SDL_Rect &bounds = image->mBounds; SDL_Surface *const src = image->mSDLSurface; @@ -307,7 +307,7 @@ void SDL2SoftwareGraphics::drawPatternCached(const Image *const image, if (iw == 0 || ih == 0) return; - const gcn::ClipRectangle &top = mClipStack.top(); + const ClipRectangle &top = mClipStack.top(); const int xOffset = top.xOffset + x; const int yOffset = top.yOffset + y; const int srcX = bounds.x; @@ -428,7 +428,7 @@ void SDL2SoftwareGraphics::drawPatternInline(const Image *const image, if (iw == 0 || ih == 0) return; - const gcn::ClipRectangle &top = mClipStack.top(); + const ClipRectangle &top = mClipStack.top(); const int xOffset = top.xOffset + x; const int yOffset = top.yOffset + y; const int srcX = bounds.x; @@ -547,7 +547,7 @@ void SDL2SoftwareGraphics::drawRescaledPattern(const Image *const image, if (iw == 0 || ih == 0) return; - const gcn::ClipRectangle &top = mClipStack.top(); + const ClipRectangle &top = mClipStack.top(); const int xOffset = top.xOffset + x; const int yOffset = top.yOffset + y; const int srcX = bounds.x; @@ -610,7 +610,7 @@ void SDL2SoftwareGraphics::calcPatternInline(ImageVertexes* const vert, if (iw == 0 || ih == 0) return; - const gcn::ClipRectangle &top = mClipStack.top(); + const ClipRectangle &top = mClipStack.top(); const int xOffset = top.xOffset + x; const int yOffset = top.yOffset + y; const int srcX = bounds.x; @@ -695,7 +695,7 @@ void SDL2SoftwareGraphics::calcTileSDL(ImageVertexes *const vert, return; const Image *const image = vert->image; - const gcn::ClipRectangle &top = mClipStack.top(); + const ClipRectangle &top = mClipStack.top(); const SDL_Rect &bounds = image->mBounds; DoubleRect *rect = new DoubleRect(); @@ -917,15 +917,15 @@ int SDL2SoftwareGraphics::SDL_FakeUpperBlit(const SDL_Surface *const src, return 0; } -void SDL2SoftwareGraphics::fillRectangle(const gcn::Rectangle &rectangle) +void SDL2SoftwareGraphics::fillRectangle(const Rectangle &rectangle) { FUNC_BLOCK("Graphics::fillRectangle", 1) if (mClipStack.empty()) return; - const gcn::ClipRectangle& top = mClipStack.top(); + const ClipRectangle& top = mClipStack.top(); - gcn::Rectangle area = rectangle; + Rectangle area = rectangle; area.x += top.xOffset; area.y += top.yOffset; @@ -1117,7 +1117,7 @@ void SDL2SoftwareGraphics::fillRectangle(const gcn::Rectangle &rectangle) void SDL2SoftwareGraphics::_beginDraw() { - pushClipArea(gcn::Rectangle(0, 0, mRect.w, mRect.h)); + pushClipArea(Rectangle(0, 0, mRect.w, mRect.h)); } void SDL2SoftwareGraphics::_endDraw() @@ -1125,11 +1125,11 @@ void SDL2SoftwareGraphics::_endDraw() popClipArea(); } -bool SDL2SoftwareGraphics::pushClipArea(gcn::Rectangle area) +bool SDL2SoftwareGraphics::pushClipArea(Rectangle area) { const bool result = Graphics::pushClipArea(area); - const gcn::ClipRectangle &carea = mClipStack.top(); + const ClipRectangle &carea = mClipStack.top(); const SDL_Rect rect = { static_cast<int32_t>(carea.x), @@ -1148,7 +1148,7 @@ void SDL2SoftwareGraphics::popClipArea() if (mClipStack.empty()) return; - const gcn::ClipRectangle &carea = mClipStack.top(); + const ClipRectangle &carea = mClipStack.top(); const SDL_Rect rect = { static_cast<int32_t>(carea.x), @@ -1165,7 +1165,7 @@ void SDL2SoftwareGraphics::drawPoint(int x, int y) if (mClipStack.empty()) return; - const gcn::ClipRectangle& top = mClipStack.top(); + const ClipRectangle& top = mClipStack.top(); x += top.xOffset; y += top.yOffset; @@ -1184,7 +1184,7 @@ void SDL2SoftwareGraphics::drawHLine(int x1, int y, int x2) if (mClipStack.empty()) return; - const gcn::ClipRectangle& top = mClipStack.top(); + const ClipRectangle& top = mClipStack.top(); const int xOffset = top.xOffset; x1 += xOffset; @@ -1310,7 +1310,7 @@ void SDL2SoftwareGraphics::drawVLine(int x, int y1, int y2) if (mClipStack.empty()) return; - const gcn::ClipRectangle& top = mClipStack.top(); + const ClipRectangle& top = mClipStack.top(); const int yOffset = top.yOffset; x += top.xOffset; @@ -1440,7 +1440,7 @@ void SDL2SoftwareGraphics::drawVLine(int x, int y1, int y2) SDL_UnlockSurface(mSurface); } -void SDL2SoftwareGraphics::drawRectangle(const gcn::Rectangle &rectangle) +void SDL2SoftwareGraphics::drawRectangle(const Rectangle &rectangle) { const int x1 = rectangle.x; const int x2 = x1 + rectangle.width - 1; diff --git a/src/render/sdl2softwaregraphics.h b/src/render/sdl2softwaregraphics.h index 3ac6cb212..270536e11 100644 --- a/src/render/sdl2softwaregraphics.h +++ b/src/render/sdl2softwaregraphics.h @@ -58,7 +58,7 @@ class SDL2SoftwareGraphics final : public Graphics void _endDraw(); - bool pushClipArea(gcn::Rectangle rect); + bool pushClipArea(Rectangle rect); void popClipArea(); @@ -120,9 +120,9 @@ class SDL2SoftwareGraphics final : public Graphics const int w, const int h, const ImageRect &imgRect) override final; - void fillRectangle(const gcn::Rectangle &rect) override final; + void fillRectangle(const Rectangle &rect) override final; - void drawRectangle(const gcn::Rectangle &rect) override final; + void drawRectangle(const Rectangle &rect) override final; void drawPoint(int x, int y) override final; diff --git a/src/render/sdlgraphics.cpp b/src/render/sdlgraphics.cpp index 2f4f6c0c2..9694eb0fb 100644 --- a/src/render/sdlgraphics.cpp +++ b/src/render/sdlgraphics.cpp @@ -76,7 +76,7 @@ bool SDLGraphics::drawRescaledImage(const Image *const image, if (!tmpImage->mSDLSurface) return false; - const gcn::ClipRectangle &top = mClipStack.top(); + const ClipRectangle &top = mClipStack.top(); const SDL_Rect &bounds = image->mBounds; SDL_Rect srcRect = @@ -117,7 +117,7 @@ bool SDLGraphics::drawImageInline(const Image *const image, if (!mWindow || !image || !image->mSDLSurface) return false; - const gcn::ClipRectangle &top = mClipStack.top(); + const ClipRectangle &top = mClipStack.top(); const SDL_Rect &bounds = image->mBounds; SDL_Surface *const src = image->mSDLSurface; @@ -205,7 +205,7 @@ void SDLGraphics::drawImageCached(const Image *const image, if (!mWindow || !image || !image->mSDLSurface) return; - const gcn::ClipRectangle &top = mClipStack.top(); + const ClipRectangle &top = mClipStack.top(); const SDL_Rect &bounds = image->mBounds; SDL_Surface *const src = image->mSDLSurface; @@ -301,7 +301,7 @@ void SDLGraphics::drawPatternCached(const Image *const image, if (iw == 0 || ih == 0) return; - const gcn::ClipRectangle &top = mClipStack.top(); + const ClipRectangle &top = mClipStack.top(); const int xOffset = top.xOffset + x; const int yOffset = top.yOffset + y; const int srcX = bounds.x; @@ -422,7 +422,7 @@ void SDLGraphics::drawPatternInline(const Image *const image, if (iw == 0 || ih == 0) return; - const gcn::ClipRectangle &top = mClipStack.top(); + const ClipRectangle &top = mClipStack.top(); const int xOffset = top.xOffset + x; const int yOffset = top.yOffset + y; const int srcX = bounds.x; @@ -541,7 +541,7 @@ void SDLGraphics::drawRescaledPattern(const Image *const image, if (iw == 0 || ih == 0) return; - const gcn::ClipRectangle &top = mClipStack.top(); + const ClipRectangle &top = mClipStack.top(); const int xOffset = top.xOffset + x; const int yOffset = top.yOffset + y; const int srcX = bounds.x; @@ -604,7 +604,7 @@ void SDLGraphics::calcPatternInline(ImageVertexes* const vert, if (iw == 0 || ih == 0) return; - const gcn::ClipRectangle &top = mClipStack.top(); + const ClipRectangle &top = mClipStack.top(); const int xOffset = top.xOffset + x; const int yOffset = top.yOffset + y; const int srcX = bounds.x; @@ -688,7 +688,7 @@ void SDLGraphics::calcTileSDL(ImageVertexes *const vert, int x, int y) const return; const Image *const image = vert->image; - const gcn::ClipRectangle &top = mClipStack.top(); + const ClipRectangle &top = mClipStack.top(); const SDL_Rect &bounds = image->mBounds; DoubleRect *rect = new DoubleRect(); @@ -914,15 +914,15 @@ int SDLGraphics::SDL_FakeUpperBlit(const SDL_Surface *const src, return 0; } -void SDLGraphics::fillRectangle(const gcn::Rectangle& rectangle) +void SDLGraphics::fillRectangle(const Rectangle& rectangle) { FUNC_BLOCK("Graphics::fillRectangle", 1) if (mClipStack.empty()) return; - const gcn::ClipRectangle& top = mClipStack.top(); + const ClipRectangle& top = mClipStack.top(); - gcn::Rectangle area = rectangle; + Rectangle area = rectangle; area.x += top.xOffset; area.y += top.yOffset; @@ -1114,7 +1114,7 @@ void SDLGraphics::fillRectangle(const gcn::Rectangle& rectangle) void SDLGraphics::_beginDraw() { - pushClipArea(gcn::Rectangle(0, 0, mRect.w, mRect.h)); + pushClipArea(Rectangle(0, 0, mRect.w, mRect.h)); } void SDLGraphics::_endDraw() @@ -1122,10 +1122,10 @@ void SDLGraphics::_endDraw() popClipArea(); } -bool SDLGraphics::pushClipArea(gcn::Rectangle area) +bool SDLGraphics::pushClipArea(Rectangle area) { const bool result = Graphics::pushClipArea(area); - const gcn::ClipRectangle &carea = mClipStack.top(); + const ClipRectangle &carea = mClipStack.top(); const SDL_Rect rect = { static_cast<int16_t>(carea.x), @@ -1145,7 +1145,7 @@ void SDLGraphics::popClipArea() if (mClipStack.empty()) return; - const gcn::ClipRectangle &carea = mClipStack.top(); + const ClipRectangle &carea = mClipStack.top(); const SDL_Rect rect = { static_cast<int16_t>(carea.x), @@ -1162,7 +1162,7 @@ void SDLGraphics::drawPoint(int x, int y) if (mClipStack.empty()) return; - const gcn::ClipRectangle& top = mClipStack.top(); + const ClipRectangle& top = mClipStack.top(); x += top.xOffset; y += top.yOffset; @@ -1181,7 +1181,7 @@ void SDLGraphics::drawHLine(int x1, int y, int x2) if (mClipStack.empty()) return; - const gcn::ClipRectangle& top = mClipStack.top(); + const ClipRectangle& top = mClipStack.top(); const int xOffset = top.xOffset; x1 += xOffset; @@ -1307,7 +1307,7 @@ void SDLGraphics::drawVLine(int x, int y1, int y2) if (mClipStack.empty()) return; - const gcn::ClipRectangle& top = mClipStack.top(); + const ClipRectangle& top = mClipStack.top(); const int yOffset = top.yOffset; x += top.xOffset; @@ -1437,7 +1437,7 @@ void SDLGraphics::drawVLine(int x, int y1, int y2) SDL_UnlockSurface(mWindow); } -void SDLGraphics::drawRectangle(const gcn::Rectangle &rectangle) +void SDLGraphics::drawRectangle(const Rectangle &rectangle) { const int x1 = rectangle.x; const int x2 = x1 + rectangle.width - 1; diff --git a/src/render/sdlgraphics.h b/src/render/sdlgraphics.h index 484b24e31..f5ca099de 100644 --- a/src/render/sdlgraphics.h +++ b/src/render/sdlgraphics.h @@ -58,7 +58,7 @@ class SDLGraphics final : public Graphics void _endDraw() override final; - bool pushClipArea(gcn::Rectangle rect) override final; + bool pushClipArea(Rectangle rect) override final; void popClipArea() override final; @@ -120,9 +120,9 @@ class SDLGraphics final : public Graphics const int w, const int h, const ImageRect &imgRect) override final; - void fillRectangle(const gcn::Rectangle &rect) override final; + void fillRectangle(const Rectangle &rect) override final; - void drawRectangle(const gcn::Rectangle &rect) override final; + void drawRectangle(const Rectangle &rect) override final; void drawPoint(int x, int y) override final; diff --git a/src/render/surfacegraphics.h b/src/render/surfacegraphics.h index c3e6cb2ee..cadd19876 100644 --- a/src/render/surfacegraphics.h +++ b/src/render/surfacegraphics.h @@ -63,7 +63,7 @@ class SurfaceGraphics final : public Graphics void _endDraw() override final { } - bool pushClipArea(gcn::Rectangle rect A_UNUSED) override final + bool pushClipArea(Rectangle rect A_UNUSED) override final { return true; } void popClipArea() override final @@ -158,10 +158,10 @@ class SurfaceGraphics final : public Graphics BlitMode getBlitMode() const A_WARN_UNUSED { return mBlitMode; } - void fillRectangle(const gcn::Rectangle &rect A_UNUSED) override final + void fillRectangle(const Rectangle &rect A_UNUSED) override final { } - void drawRectangle(const gcn::Rectangle &rect A_UNUSED) override final + void drawRectangle(const Rectangle &rect A_UNUSED) override final { } void drawPoint(int x A_UNUSED, int y A_UNUSED) override final diff --git a/src/touchmanager.cpp b/src/touchmanager.cpp index 49a5a0d3d..f560b8817 100644 --- a/src/touchmanager.cpp +++ b/src/touchmanager.cpp @@ -163,7 +163,7 @@ void TouchManager::loadTouchItem(TouchItem **item, const std::string &name, default: break; } - *item = new TouchItem(text, gcn::Rectangle(x + diff, y + diff, + *item = new TouchItem(text, Rectangle(x + diff, y + diff, width + border2, height + border2), type, eventPressed, eventReleased, images, icon, x + pad, y + pad, width, height, @@ -270,7 +270,7 @@ bool TouchManager::processEvent(const MouseInput &mouseInput) const TouchItem *const item = *it; if (!item || (!mShow && (item != mKeyboard || !mShowKeyboard))) continue; - const gcn::Rectangle &rect = item->rect; + const Rectangle &rect = item->rect; if (rect.isPointInRect(x, y)) { MouseInput event = mouseInput; diff --git a/src/touchmanager.h b/src/touchmanager.h index 09eaabad5..7e670b1a6 100644 --- a/src/touchmanager.h +++ b/src/touchmanager.h @@ -25,7 +25,7 @@ #include "input/keydata.h" -#include "gui/base/rectangle.hpp" +#include "gui/rectangle.h" #include <string> #include <vector> @@ -45,7 +45,7 @@ const int buttonsCount = 12; struct TouchItem final { TouchItem(const std::string &text0, - const gcn::Rectangle &rect0, const int type0, + const Rectangle &rect0, const int type0, const std::string &eventPressed0, const std::string &eventReleased0, ImageRect *const images0, Image *const icon0, @@ -73,7 +73,7 @@ struct TouchItem final A_DELETE_COPY(TouchItem) std::string text; - gcn::Rectangle rect; + Rectangle rect; int type; std::string eventPressed; std::string eventReleased; |