diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-02-24 14:01:32 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-02-24 21:18:57 +0300 |
commit | 0a8b5d325f2d2c326b6da27399711b198417a499 (patch) | |
tree | 9e89aa7610f3f74ef9df53f6afce6655fc95ab07 /src/gui | |
parent | 779b65f15d3350b2d95a095e24a90526c64dcecb (diff) | |
download | manaverse-0a8b5d325f2d2c326b6da27399711b198417a499.tar.gz manaverse-0a8b5d325f2d2c326b6da27399711b198417a499.tar.bz2 manaverse-0a8b5d325f2d2c326b6da27399711b198417a499.tar.xz manaverse-0a8b5d325f2d2c326b6da27399711b198417a499.zip |
Rename Rectangle into Rect.
Rename ClipRectangle into ClipRect.
Diffstat (limited to 'src/gui')
77 files changed, 253 insertions, 251 deletions
diff --git a/src/gui/base/basiccontainer.cpp b/src/gui/base/basiccontainer.cpp index 9f2806016..e854e15ff 100644 --- a/src/gui/base/basiccontainer.cpp +++ b/src/gui/base/basiccontainer.cpp @@ -117,9 +117,9 @@ namespace gcn mWidgets.erase(iter); } - Rectangle BasicContainer::getChildrenArea() + Rect BasicContainer::getChildrenArea() { - return Rectangle(0, 0, getWidth(), getHeight()); + return Rect(0, 0, getWidth(), getHeight()); } void BasicContainer::focusNext() @@ -184,7 +184,7 @@ namespace gcn Widget *BasicContainer::getWidgetAt(int x, int y) { - const Rectangle r = getChildrenArea(); + const Rect r = getChildrenArea(); if (!r.isPointInRect(x, y)) return nullptr; @@ -284,7 +284,7 @@ namespace gcn // draw it before drawing the widget if (widget->getFrameSize() > 0) { - Rectangle rec = widget->getDimension(); + Rect rec = widget->getDimension(); const int frame = widget->getFrameSize(); const int frame2 = frame * 2; rec.x -= frame; @@ -321,9 +321,9 @@ namespace gcn BLOCK_END("BasicContainer::logicChildren") } - void BasicContainer::showWidgetPart(Widget* widget, Rectangle area) + void BasicContainer::showWidgetPart(Widget* widget, Rect area) { - const Rectangle widgetArea = getChildrenArea(); + const Rect widgetArea = getChildrenArea(); area.x += widget->getX(); area.y += widget->getY(); diff --git a/src/gui/base/basiccontainer.hpp b/src/gui/base/basiccontainer.hpp index 6d30db100..e1947c652 100644 --- a/src/gui/base/basiccontainer.hpp +++ b/src/gui/base/basiccontainer.hpp @@ -108,7 +108,7 @@ namespace gcn * itself to be visible. * @param rectangle The rectangle to be visible. */ - virtual void showWidgetPart(Widget* widget, Rectangle area); + virtual void showWidgetPart(Widget* widget, Rect area); // Inherited from Widget @@ -116,7 +116,7 @@ namespace gcn virtual void moveToBottom(Widget* widget); - virtual Rectangle getChildrenArea() A_WARN_UNUSED; + virtual Rect getChildrenArea() A_WARN_UNUSED; virtual void focusNext(); diff --git a/src/gui/base/widgets/container.cpp b/src/gui/base/widgets/container.cpp index c79f8fcbc..53a900ec4 100644 --- a/src/gui/base/widgets/container.cpp +++ b/src/gui/base/widgets/container.cpp @@ -91,7 +91,7 @@ namespace gcn if (isOpaque()) { graphics->setColor(getBaseColor()); - graphics->fillRectangle(Rectangle(0, 0, getWidth(), getHeight())); + graphics->fillRectangle(Rect(0, 0, getWidth(), getHeight())); } drawChildren(graphics); diff --git a/src/gui/base/widgets/listbox.cpp b/src/gui/base/widgets/listbox.cpp index 62a3062a5..2e9606f0a 100644 --- a/src/gui/base/widgets/listbox.cpp +++ b/src/gui/base/widgets/listbox.cpp @@ -139,7 +139,7 @@ namespace gcn mSelected = selected; } - Rectangle scroll; + Rect scroll; if (mSelected < 0) scroll.y = 0; diff --git a/src/gui/base/widgets/scrollarea.cpp b/src/gui/base/widgets/scrollarea.cpp index 0fc605fa3..665830ce4 100644 --- a/src/gui/base/widgets/scrollarea.cpp +++ b/src/gui/base/widgets/scrollarea.cpp @@ -471,19 +471,19 @@ namespace gcn } } - Rectangle ScrollArea::getChildrenArea() + Rect ScrollArea::getChildrenArea() { - const Rectangle area = Rectangle(0, 0, + const Rect area = Rect(0, 0, mVBarVisible ? (getWidth() - mScrollbarWidth) : getWidth(), mHBarVisible ? (getHeight() - mScrollbarWidth) : getHeight()); if (area.width < 0 || area.height < 0) - return Rectangle(); + return Rect(); return area; } - void ScrollArea::showWidgetPart(Widget* widget, Rectangle area) + void ScrollArea::showWidgetPart(Widget* widget, Rect area) { const Widget *const content = getContent(); if (widget != content) @@ -539,7 +539,7 @@ namespace gcn checkPolicies(); } - void ScrollArea::setDimension(const Rectangle& dimension) + void ScrollArea::setDimension(const Rect& dimension) { Widget::setDimension(dimension); checkPolicies(); diff --git a/src/gui/base/widgets/scrollarea.hpp b/src/gui/base/widgets/scrollarea.hpp index 669ccfbdd..879792019 100644 --- a/src/gui/base/widgets/scrollarea.hpp +++ b/src/gui/base/widgets/scrollarea.hpp @@ -345,9 +345,9 @@ namespace gcn // Inherited from BasicContainer - virtual void showWidgetPart(Widget* widget, Rectangle area); + virtual void showWidgetPart(Widget* widget, Rect area); - virtual Rectangle getChildrenArea(); + virtual Rect getChildrenArea(); virtual Widget *getWidgetAt(int x, int y); @@ -362,7 +362,7 @@ namespace gcn void setHeight(int height); - void setDimension(const Rectangle& dimension); + void setDimension(const Rect& dimension); // Inherited from MouseListener diff --git a/src/gui/base/widgets/textbox.cpp b/src/gui/base/widgets/textbox.cpp index 04b506c59..f74db9a29 100644 --- a/src/gui/base/widgets/textbox.cpp +++ b/src/gui/base/widgets/textbox.cpp @@ -304,7 +304,7 @@ namespace gcn void TextBox::scrollToCaret() { - Rectangle scroll; + Rect scroll; scroll.x = getFont()->getWidth( mTextRows[mCaretRow].substr(0, mCaretColumn)); scroll.y = getFont()->getHeight() * mCaretRow; diff --git a/src/gui/cliprectangle.cpp b/src/gui/cliprect.cpp index ff393281c..5255a4c98 100644 --- a/src/gui/cliprectangle.cpp +++ b/src/gui/cliprect.cpp @@ -65,12 +65,12 @@ * For comments regarding functions please see the header file. */ -#include "gui/cliprectangle.h" +#include "gui/cliprect.h" #include "debug.h" -ClipRectangle::ClipRectangle() : - Rectangle(), +ClipRect::ClipRect() : + Rect(), xOffset(0), yOffset(0) { @@ -80,10 +80,10 @@ ClipRectangle::ClipRectangle() : height = 0; } -ClipRectangle::ClipRectangle(const int x0, const int y0, - const int width0, const int height0, - const int xOffset0, const int yOffset0) : - Rectangle(), +ClipRect::ClipRect(const int x0, const int y0, + const int width0, const int height0, + const int xOffset0, const int yOffset0) : + Rect(), xOffset(xOffset0), yOffset(yOffset0) { @@ -93,7 +93,7 @@ ClipRectangle::ClipRectangle(const int x0, const int y0, height = height0; } -const ClipRectangle& ClipRectangle::operator=(const Rectangle& other) +const ClipRect& ClipRect::operator=(const Rect& other) { x = other.x; y = other.y; diff --git a/src/gui/cliprectangle.h b/src/gui/cliprect.h index 776bc702f..3bbf5e47e 100644 --- a/src/gui/cliprectangle.h +++ b/src/gui/cliprect.h @@ -64,7 +64,7 @@ #ifndef GUI_CLIPRECTANGLE_H #define GUI_CLIPRECTANGLE_H -#include "gui/rectangle.h" +#include "gui/rect.h" #include "localconsts.h" @@ -74,13 +74,13 @@ * offsets. The offsets are used for calculations from relative * screen coordinates to actual screen coordinates. */ -class ClipRectangle final : public Rectangle +class ClipRect final : public Rect { public: /** * Constructor. */ - ClipRectangle(); + ClipRect(); /** * Constructor. @@ -96,7 +96,7 @@ class ClipRectangle final : public Rectangle * calculating the actual screen coordinate from * the relative screen coordinate. */ - ClipRectangle(const int x0, + ClipRect(const int x0, const int y0, const int width0, const int height0, @@ -110,7 +110,7 @@ class ClipRectangle final : public 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); + const ClipRect& operator=(const Rect& other); /** * Holds the x offset of the x coordinate. diff --git a/src/gui/popups/spellpopup.cpp b/src/gui/popups/spellpopup.cpp index 2dc1751d3..bf6ea1799 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 Rectangle &rect = mDimension; + const Rect &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 72ac26f0f..d5cc918d3 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 Rectangle &rect = mDimension; + const Rect &rect = mDimension; int posX = std::max(0, x - rect.width / 2); int posY = y + distance; diff --git a/src/gui/rectangle.cpp b/src/gui/rect.cpp index d7de61c39..5f9d2bf0f 100644 --- a/src/gui/rectangle.cpp +++ b/src/gui/rect.cpp @@ -65,20 +65,20 @@ * For comments regarding functions please see the header file. */ -#include "gui/rectangle.h" +#include "gui/rect.h" #include "debug.h" -Rectangle::Rectangle() - : x(0), - y(0), - width(0), - height(0) +Rect::Rect() : + x(0), + y(0), + width(0), + height(0) { } -Rectangle::Rectangle(const int x_, const int y_, - const int width_, const int height_) : +Rect::Rect(const int x_, const int y_, + const int width_, const int height_) : x(x_), y(y_), width(width_), @@ -86,10 +86,10 @@ Rectangle::Rectangle(const int x_, const int y_, { } -void Rectangle::setAll(const int x0, - const int y0, - const int width0, - const int height0) +void Rect::setAll(const int x0, + const int y0, + const int width0, + const int height0) { x = x0; y = y0; @@ -97,7 +97,7 @@ void Rectangle::setAll(const int x0, height = height0; } -bool Rectangle::isIntersecting(const Rectangle& rectangle) const +bool Rect::isIntersecting(const Rect& rectangle) const { int x_ = x; int y_ = y; @@ -135,7 +135,7 @@ bool Rectangle::isIntersecting(const Rectangle& rectangle) const return true; } -bool Rectangle::isPointInRect(int x_, int y_) const +bool Rect::isPointInRect(int x_, int y_) const { return x_ >= x && y_ >= y @@ -144,9 +144,9 @@ bool Rectangle::isPointInRect(int x_, int y_) const } std::ostream& operator<<(std::ostream& out, - const Rectangle& rectangle) + const Rect& rectangle) { - out << "Rectangle [x = " << rectangle.x + out << "Rect [x = " << rectangle.x << ", y = " << rectangle.y << ", width = " << rectangle.width << ", height = " << rectangle.height diff --git a/src/gui/rectangle.h b/src/gui/rect.h index ae8364417..f7cb7ae92 100644 --- a/src/gui/rectangle.h +++ b/src/gui/rect.h @@ -61,8 +61,8 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef GUI_RECTANGLE_H -#define GUI_RECTANGLE_H +#ifndef GUI_RECT_H +#define GUI_RECT_H #include <iostream> @@ -73,14 +73,14 @@ * * @since 0.1.0 */ -class Rectangle +class Rect { public: /** * Constructor. The default rectangle is an empty rectangle * at the coordinates (0,0). */ - Rectangle(); + Rect(); /** * Constructor. @@ -91,9 +91,9 @@ class 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); + Rect(const int x, const int y, const int width, const int height); - virtual ~Rectangle() + virtual ~Rect() { } /** @@ -117,7 +117,7 @@ class Rectangle * @return True if the rectangles intersect, false otherwise. * @since 0.1.0 */ - bool isIntersecting(const Rectangle& rectangle) const A_WARN_UNUSED; + bool isIntersecting(const Rect& rectangle) const A_WARN_UNUSED; /** * Checks if a point is inside the rectangle @@ -136,7 +136,7 @@ class Rectangle * @param rectangle The rectangle to output. */ friend std::ostream& operator<<(std::ostream& out, - const Rectangle& rectangle); + const Rect& rectangle); /** * Holds the x coordinate of the rectangle. diff --git a/src/gui/viewport.cpp b/src/gui/viewport.cpp index d9175a07f..500378628 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( - Rectangle(0, 0, getWidth(), getHeight())); + Rect(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(Rectangle(squareX, squareY, 8, 8)); + graphics->fillRectangle(Rect(squareX, squareY, 8, 8)); if (mMap) { const std::string str = toString(cnt); @@ -371,7 +371,7 @@ void Viewport::_drawPath(Graphics *const graphics, const Path &path, const int squareX = i->x - mPixelViewX; const int squareY = i->y - mPixelViewY; - graphics->fillRectangle(Rectangle( + graphics->fillRectangle(Rect( squareX - 4, squareY - 4, 8, 8)); if (mMap) { diff --git a/src/gui/widgets/avatarlistbox.cpp b/src/gui/widgets/avatarlistbox.cpp index 46a78d99e..01126f8ac 100644 --- a/src/gui/widgets/avatarlistbox.cpp +++ b/src/gui/widgets/avatarlistbox.cpp @@ -162,7 +162,7 @@ void AvatarListBox::draw(Graphics *graphics) color.a = 80; graphics->setColor(color); - graphics->fillRectangle(Rectangle(mPadding, y + mPadding, + graphics->fillRectangle(Rect(mPadding, y + mPadding, parent->getWidth() * a->getHp() / a->getMaxHp() - 2 * mPadding, fontHeight)); } @@ -186,7 +186,7 @@ void AvatarListBox::draw(Graphics *graphics) color.a = 80; graphics->setColor(color); - graphics->fillRectangle(Rectangle(mPadding, y + mPadding, + graphics->fillRectangle(Rect(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 c36a607f4..100281d94 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/cliprectangle.h" +#include "gui/cliprect.h" #include "render/graphics.h" @@ -448,7 +448,7 @@ void BrowserBox::mouseMoved(MouseEvent &event) void BrowserBox::draw(Graphics *graphics) { BLOCK_START("BrowserBox::draw") - const ClipRectangle *const cr = graphics->getCurrentClipArea(); + const ClipRect *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(Rectangle(0, 0, getWidth(), getHeight())); + graphics->fillRectangle(Rect(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(Rectangle( + graphics->fillRectangle(Rect( 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 2642a67a3..3cb6d823d 100644 --- a/src/gui/widgets/button.cpp +++ b/src/gui/widgets/button.cpp @@ -35,6 +35,8 @@ #include "gui/font.h" #include "gui/gui.h" +#include "gui/rect.h" + #include "debug.h" int Button::mInstances = 0; @@ -380,7 +382,7 @@ void Button::draw(Graphics *graphics) { // because we don't know where parent windows was moved, // need recalc vertexes - ClipRectangle &rect = graphics->getTopClip(); + ClipRect &rect = graphics->getTopClip(); if (rect.xOffset != mXOffset || rect.yOffset != mYOffset) { recalc = true; @@ -420,7 +422,7 @@ void Button::draw(Graphics *graphics) int imageX = 0; int imageY = 0; int textX = 0; - const Rectangle &rect = mDimension; + const Rect &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 5e10b885c..501b3dea7 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(Rectangle(mPadding, + graphics->fillRectangle(Rect(mPadding, rowHeight * mSelected + mPadding, mDimension.width - 2 * mPadding, rowHeight)); diff --git a/src/gui/widgets/desktop.cpp b/src/gui/widgets/desktop.cpp index 5dca7578c..a77516c62 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 Rectangle &rect = mDimension; + const Rect &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(Rectangle(0, 0, width, height)); + graphics->fillRectangle(Rect(0, 0, width, height)); } if (imageHelper->useOpenGL() == RENDER_SOFTWARE) @@ -135,12 +135,12 @@ void Desktop::draw(Graphics *graphics) else { graphics->setColor(mBackgroundGrayColor); - graphics->fillRectangle(Rectangle(0, 0, width, height)); + graphics->fillRectangle(Rect(0, 0, width, height)); } // Draw a thin border under the application version... graphics->setColor(mBackgroundColor); - graphics->fillRectangle(Rectangle(mVersionLabel->getDimension())); + graphics->fillRectangle(Rect(mVersionLabel->getDimension())); Container::draw(graphics); BLOCK_END("Desktop::draw") @@ -165,7 +165,7 @@ void Desktop::setBestFittingWallpaper() mWallpaper = nullptr; } - const Rectangle &rect = mDimension; + const Rect &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 982b2cf0d..dfc17e17b 100644 --- a/src/gui/widgets/dropdown.cpp +++ b/src/gui/widgets/dropdown.cpp @@ -268,7 +268,7 @@ void DropDown::draw(Graphics* graphics) if (isFocused()) { graphics->setColor(mHighlightColor); - graphics->drawRectangle(Rectangle(mPadding, mPadding, + graphics->drawRectangle(Rect(mPadding, mPadding, mDimension.width - h - pad, h - pad)); } @@ -291,7 +291,7 @@ void DropDown::drawFrame(Graphics *graphics) { BLOCK_START("DropDown::drawFrame") const int bs2 = getFrameSize(); - const Rectangle &rect = mDimension; + const Rect &rect = mDimension; graphics->drawImageRect(0, 0, rect.width + bs2, rect.height + bs2, skinRect); @@ -513,16 +513,16 @@ void DropDown::action(const ActionEvent &actionEvent A_UNUSED) distributeActionEvent(); } -Rectangle DropDown::getChildrenArea() +Rect DropDown::getChildrenArea() { if (mDroppedDown) { // Calculate the children area (with the one pixel border in mind) - return Rectangle(1, mFoldedUpHeight + 1, + return Rect(1, mFoldedUpHeight + 1, mDimension.width - 2, mDimension.height - mFoldedUpHeight - 2); } - return Rectangle(); + return Rect(); } void DropDown::valueChanged(const SelectionEvent& event A_UNUSED) diff --git a/src/gui/widgets/dropdown.h b/src/gui/widgets/dropdown.h index b8c3e7150..8e463a2c1 100644 --- a/src/gui/widgets/dropdown.h +++ b/src/gui/widgets/dropdown.h @@ -125,7 +125,7 @@ class DropDown final : public ActionListener, void removeSelectionListener(SelectionListener* selectionListener); - Rectangle getChildrenArea() override; + Rect getChildrenArea() override; void action(const ActionEvent &actionEvent) override; diff --git a/src/gui/widgets/extendedlistbox.cpp b/src/gui/widgets/extendedlistbox.cpp index 15a52ee82..7245ddd19 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(Rectangle(mPadding, minY + mPadding, + graphics->fillRectangle(Rect(mPadding, minY + mPadding, width - pad2, maxY - minY + height)); } diff --git a/src/gui/widgets/guitable.cpp b/src/gui/widgets/guitable.cpp index 98e7e5f23..70ebb77d6 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 Rectangle &rect = mDimension; + const Rect &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(Rectangle(0, 0, width, height)); + graphics->fillRectangle(Rect(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) { - Rectangle bounds(x_offset, y_offset, cWidth, rHeight); + Rect 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(Rectangle(0, y_offset, + graphics->fillRectangle(Rect(0, y_offset, width, rHeight)); } else if (!mLinewiseMode && mSelectedColumn > 0 && c == static_cast<unsigned>(mSelectedColumn) && r == static_cast<unsigned>(mSelectedRow)) { - graphics->fillRectangle(Rectangle( + graphics->fillRectangle(Rect( x_offset, y_offset, cWidth, rHeight)); } } @@ -393,7 +393,7 @@ void GuiTable::draw(Graphics* graphics) if (mTopWidget) { - const Rectangle &bounds = mTopWidget->getDimension(); + const Rect &bounds = mTopWidget->getDimension(); graphics->pushClipArea(bounds); mTopWidget->draw(graphics); graphics->popClipArea(); @@ -414,9 +414,9 @@ void GuiTable::moveToBottom(Widget *widget) mTopWidget = nullptr; } -Rectangle GuiTable::getChildrenArea() +Rect GuiTable::getChildrenArea() { - return Rectangle(0, 0, mDimension.width, mDimension.height); + return Rect(0, 0, mDimension.width, mDimension.height); } // -- KeyListener notifications diff --git a/src/gui/widgets/guitable.h b/src/gui/widgets/guitable.h index 8f5d0d300..fb0c34784 100644 --- a/src/gui/widgets/guitable.h +++ b/src/gui/widgets/guitable.h @@ -93,7 +93,7 @@ public: void setWrappingEnabled(bool wrappingEnabled) { mWrappingEnabled = wrappingEnabled; } - Rectangle getChildrenArea() override final A_WARN_UNUSED; + Rect 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 5b1804667..56c949964 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 Rectangle &rect = mDimension; + const Rect &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 2af27a21c..24722510b 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(Rectangle(nx, ny, nw, nh)); + mWidget->setDimension(Rect(nx, ny, nw, nh)); } void LayoutCell::computeSizes() diff --git a/src/gui/widgets/layouthelper.cpp b/src/gui/widgets/layouthelper.cpp index 83e6d050a..c225c7543 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 Rectangle area = mContainer->getChildrenArea(); + const Rect 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 949c52455..c6e431634 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(Rectangle(mPadding, + graphics->fillRectangle(Rect(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(Rectangle(mPadding, + graphics->fillRectangle(Rect(mPadding, rowHeight * mSelected + mPadding, mDimension.width - 2 * mPadding, rowHeight)); diff --git a/src/gui/widgets/popup.cpp b/src/gui/widgets/popup.cpp index 9a0a38013..1114b4a5e 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") } -Rectangle Popup::getChildrenArea() +Rect Popup::getChildrenArea() { const int pad2 = mPadding * 2; - return Rectangle(mPadding, mPadding, + return Rect(mPadding, mPadding, mDimension.width - pad2, mDimension.height - pad2); } diff --git a/src/gui/widgets/popup.h b/src/gui/widgets/popup.h index 3c8947fce..01247cf61 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 Rectangle getChildrenArea() override; + virtual Rect 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 1a1b8dc0e..5bccd61ca 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(Rectangle(mFillPadding, mFillPadding, + graphics->fillRectangle(Rect(mFillPadding, mFillPadding, width, mDimension.height - pad)); } } diff --git a/src/gui/widgets/scrollarea.cpp b/src/gui/widgets/scrollarea.cpp index f28f45d78..dcc3a871b 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 ClipRectangle &rect = graphics->getTopClip(); + const ClipRect &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; - Rectangle dim; + Rect dim; switch (dir) { @@ -416,7 +416,7 @@ void ScrollArea::calcButton(Graphics *const graphics, const BUTTON_DIR dir) { int state = 0; - Rectangle dim; + Rect dim; switch (dir) { @@ -452,7 +452,7 @@ void ScrollArea::calcButton(Graphics *const graphics, void ScrollArea::drawVBar(Graphics *const graphics) { - const Rectangle &dim = getVerticalBarDimension(); + const Rect &dim = getVerticalBarDimension(); if (vBackground.grid[4]) { @@ -475,7 +475,7 @@ void ScrollArea::drawVBar(Graphics *const graphics) void ScrollArea::calcVBar(Graphics *const graphics) { - const Rectangle &dim = getVerticalBarDimension(); + const Rect &dim = getVerticalBarDimension(); if (vBackground.grid[4]) { @@ -502,7 +502,7 @@ void ScrollArea::calcVBar(Graphics *const graphics) void ScrollArea::drawHBar(Graphics *const graphics) { - const Rectangle &dim = getHorizontalBarDimension(); + const Rect &dim = getHorizontalBarDimension(); if (hBackground.grid[4]) { @@ -530,7 +530,7 @@ void ScrollArea::drawHBar(Graphics *const graphics) void ScrollArea::calcHBar(Graphics *const graphics) { - const Rectangle &dim = getHorizontalBarDimension(); + const Rect &dim = getHorizontalBarDimension(); if (hBackground.grid[4]) { @@ -561,7 +561,7 @@ void ScrollArea::calcHBar(Graphics *const graphics) void ScrollArea::drawVMarker(Graphics *const graphics) { - const Rectangle &dim = getVerticalMarkerDimension(); + const Rect &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 Rectangle &dim = getVerticalMarkerDimension(); + const Rect &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 Rectangle dim = getHorizontalMarkerDimension(); + const Rect 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 Rectangle dim = getHorizontalMarkerDimension(); + const Rect dim = getHorizontalMarkerDimension(); if ((mHasMouse) && (mY > (mDimension.height - mScrollbarWidth))) { @@ -811,7 +811,7 @@ void ScrollArea::mouseDragged(MouseEvent &event) { if (mIsVerticalMarkerDragged) { - const Rectangle barDim = getVerticalBarDimension(); + const Rect barDim = getVerticalBarDimension(); const int pos = event.getY() - barDim.y - mVerticalMarkerDragOffset; @@ -830,7 +830,7 @@ void ScrollArea::mouseDragged(MouseEvent &event) if (mIsHorizontalMarkerDragged) { - const Rectangle barDim = getHorizontalBarDimension(); + const Rect barDim = getHorizontalBarDimension(); const int pos = event.getX() - barDim.x - mHorizontalMarkerDragOffset; @@ -851,50 +851,50 @@ void ScrollArea::mouseDragged(MouseEvent &event) mRedraw = true; } -Rectangle ScrollArea::getVerticalBarDimension() const +Rect ScrollArea::getVerticalBarDimension() const { if (!mVBarVisible) - return Rectangle(0, 0, 0, 0); + return Rect(0, 0, 0, 0); const int height = (mVBarVisible && mShowButtons) ? mScrollbarWidth : 0; if (mHBarVisible) { - return Rectangle(mDimension.width - mScrollbarWidth, + return Rect(mDimension.width - mScrollbarWidth, height, mScrollbarWidth, mDimension.height - 2 * height - mScrollbarWidth); } - return Rectangle(mDimension.width - mScrollbarWidth, + return Rect(mDimension.width - mScrollbarWidth, height, mScrollbarWidth, mDimension.height - 2 * height); } -Rectangle ScrollArea::getHorizontalBarDimension() const +Rect ScrollArea::getHorizontalBarDimension() const { if (!mHBarVisible) - return Rectangle(0, 0, 0, 0); + return Rect(0, 0, 0, 0); const int width = mShowButtons ? mScrollbarWidth : 0; if (mVBarVisible) { - return Rectangle(width, + return Rect(width, mDimension.height - mScrollbarWidth, mDimension.width - 2 * width - mScrollbarWidth, mScrollbarWidth); } - return Rectangle(width, + return Rect(width, mDimension.height - mScrollbarWidth, mDimension.width - 2 * width, mScrollbarWidth); } -Rectangle ScrollArea::getVerticalMarkerDimension() +Rect ScrollArea::getVerticalMarkerDimension() { if (!mVBarVisible) - return Rectangle(0, 0, 0, 0); + return Rect(0, 0, 0, 0); int length, pos; int height; @@ -945,14 +945,14 @@ Rectangle ScrollArea::getVerticalMarkerDimension() pos = 0; } - return Rectangle(mDimension.width - mScrollbarWidth, h2 + pos, + return Rect(mDimension.width - mScrollbarWidth, h2 + pos, mScrollbarWidth, length); } -Rectangle ScrollArea::getHorizontalMarkerDimension() +Rect ScrollArea::getHorizontalMarkerDimension() { if (!mHBarVisible) - return Rectangle(0, 0, 0, 0); + return Rect(0, 0, 0, 0); int length, pos; int width; @@ -1007,61 +1007,61 @@ Rectangle ScrollArea::getHorizontalMarkerDimension() } } - return Rectangle(w2 + pos, mDimension.height - mScrollbarWidth, + return Rect(w2 + pos, mDimension.height - mScrollbarWidth, length, mScrollbarWidth); } -Rectangle ScrollArea::getUpButtonDimension() const +Rect ScrollArea::getUpButtonDimension() const { if (!mVBarVisible || !mShowButtons) - return Rectangle(0, 0, 0, 0); + return Rect(0, 0, 0, 0); - return Rectangle(mDimension.width - mScrollbarWidth, 0, + return Rect(mDimension.width - mScrollbarWidth, 0, mScrollbarWidth, mScrollbarWidth); } -Rectangle ScrollArea::getDownButtonDimension() const +Rect ScrollArea::getDownButtonDimension() const { if (!mVBarVisible || !mShowButtons) - return Rectangle(0, 0, 0, 0); + return Rect(0, 0, 0, 0); if (mVBarVisible && mHBarVisible) { - return Rectangle(mDimension.width - mScrollbarWidth, + return Rect(mDimension.width - mScrollbarWidth, mDimension.height - mScrollbarWidth*2, mScrollbarWidth, mScrollbarWidth); } - return Rectangle(mDimension.width - mScrollbarWidth, + return Rect(mDimension.width - mScrollbarWidth, mDimension.height - mScrollbarWidth, mScrollbarWidth, mScrollbarWidth); } -Rectangle ScrollArea::getLeftButtonDimension() const +Rect ScrollArea::getLeftButtonDimension() const { if (!mHBarVisible || !mShowButtons) - return Rectangle(0, 0, 0, 0); + return Rect(0, 0, 0, 0); - return Rectangle(0, mDimension.height - mScrollbarWidth, + return Rect(0, mDimension.height - mScrollbarWidth, mScrollbarWidth, mScrollbarWidth); } -Rectangle ScrollArea::getRightButtonDimension() const +Rect ScrollArea::getRightButtonDimension() const { if (!mHBarVisible || !mShowButtons) - return Rectangle(0, 0, 0, 0); + return Rect(0, 0, 0, 0); if (mVBarVisible && mHBarVisible) { - return Rectangle(mDimension.width - mScrollbarWidth*2, + return Rect(mDimension.width - mScrollbarWidth*2, mDimension.height - mScrollbarWidth, mScrollbarWidth, mScrollbarWidth); } - return Rectangle(mDimension.width - mScrollbarWidth, + return Rect(mDimension.width - mScrollbarWidth, mDimension.height - mScrollbarWidth, mScrollbarWidth, mScrollbarWidth); diff --git a/src/gui/widgets/scrollarea.h b/src/gui/widgets/scrollarea.h index a6081e506..7d2b39a96 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; - Rectangle getVerticalBarDimension() const; + Rect getVerticalBarDimension() const; - Rectangle getHorizontalBarDimension() const; + Rect getHorizontalBarDimension() const; - Rectangle getVerticalMarkerDimension(); + Rect getVerticalMarkerDimension(); - Rectangle getHorizontalMarkerDimension(); + Rect getHorizontalMarkerDimension(); - Rectangle getUpButtonDimension() const; + Rect getUpButtonDimension() const; - Rectangle getDownButtonDimension() const; + Rect getDownButtonDimension() const; - Rectangle getLeftButtonDimension() const; + Rect getLeftButtonDimension() const; - Rectangle getRightButtonDimension() const; + Rect getRightButtonDimension() const; protected: enum BUTTON_DIR diff --git a/src/gui/widgets/shoplistbox.cpp b/src/gui/widgets/shoplistbox.cpp index 45d3022c8..007dc6442 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(Rectangle(mPadding, y + mPadding, + graphics->fillRectangle(Rect(mPadding, y + mPadding, width, mRowHeight)); } diff --git a/src/gui/widgets/shortcutcontainer.cpp b/src/gui/widgets/shortcutcontainer.cpp index b059098b5..d3781b421 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 Rectangle tRect = Rectangle(0, 0, + const Rect tRect = Rect(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 f1d4d0cd1..ed92b62e1 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(Rectangle(itemX + 1, itemY + 1, + graphics->drawRectangle(Rect(itemX + 1, itemY + 1, mBoxWidth - 1, mBoxHeight - 1)); } diff --git a/src/gui/widgets/tabbedarea.cpp b/src/gui/widgets/tabbedarea.cpp index 7f58a061e..d2bb24720 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 Rectangle &rect = w->getDimension(); + const Rect &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 Rectangle &dimension) +void TabbedArea::setDimension(const Rect &dimension) { Widget::setDimension(dimension); adjustSize(); diff --git a/src/gui/widgets/tabbedarea.h b/src/gui/widgets/tabbedarea.h index 0ad4fbbe6..dbaa4334b 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 Rectangle &dimension); + void setDimension(const Rect &dimension); void death(const Event &event); diff --git a/src/gui/widgets/tabs/chattab.cpp b/src/gui/widgets/tabs/chattab.cpp index 70018f999..fe979ae5a 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; - Rectangle scr; + Rect 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 c5cb8cef1..c8e625ca4 100644 --- a/src/gui/widgets/tabs/setup_audio.cpp +++ b/src/gui/widgets/tabs/setup_audio.cpp @@ -156,7 +156,7 @@ Setup_Audio::Setup_Audio(const Widget2 *const widget) : new SetupItemCheckBox(_("Download music"), "", "download-music", this, "download-musicEvent"); - setDimension(Rectangle(0, 0, 550, 350)); + setDimension(Rect(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 94a65163b..7ac88ab0a 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(Rectangle(0, 0, 550, 350)); + setDimension(Rect(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 41be92454..ac6bf2837 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(Rectangle(0, 0, 365, 350)); + setDimension(Rect(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 ed371b364..b04937881 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(Rectangle(0, 0, width, 350)); + setDimension(Rect(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 ba5c37b5a..b3d7b78b9 100644 --- a/src/gui/widgets/tabs/setup_joystick.cpp +++ b/src/gui/widgets/tabs/setup_joystick.cpp @@ -94,7 +94,7 @@ Setup_Joystick::Setup_Joystick(const Widget2 *const widget) : place(0, 4, mCalibrateLabel); place(0, 5, mCalibrateButton); - setDimension(Rectangle(0, 0, 365, 75)); + setDimension(Rect(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 657d09658..b30b84c16 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(Rectangle(0, 0, 550, 350)); + setDimension(Rect(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 678dc2672..e4801506c 100644 --- a/src/gui/widgets/tabs/setup_other.cpp +++ b/src/gui/widgets/tabs/setup_other.cpp @@ -391,7 +391,7 @@ Setup_Other::Setup_Other(const Widget2 *const widget) : new SetupItemDropDown(_("Screen density override"), "", "screenDensity", this, "screenDensityEvent", mDensityList, 100); - setDimension(Rectangle(0, 0, 550, 350)); + setDimension(Rect(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 cd92c8542..5a0566ec2 100644 --- a/src/gui/widgets/tabs/setup_perfomance.cpp +++ b/src/gui/widgets/tabs/setup_perfomance.cpp @@ -154,7 +154,7 @@ Setup_Perfomance::Setup_Perfomance(const Widget2 *const widget) : "", "uselonglivesounds", this, "uselonglivesoundsEvent"); - setDimension(Rectangle(0, 0, 550, 350)); + setDimension(Rect(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 a612a51c4..01bb60f53 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(Rectangle(0, 0, 550, 350)); + setDimension(Rect(0, 0, 550, 350)); } diff --git a/src/gui/widgets/tabs/setup_relations.cpp b/src/gui/widgets/tabs/setup_relations.cpp index 1f85a23b4..1458ecd25 100644 --- a/src/gui/widgets/tabs/setup_relations.cpp +++ b/src/gui/widgets/tabs/setup_relations.cpp @@ -260,7 +260,7 @@ Setup_Relations::Setup_Relations(const Widget2 *const widget) : player_relations.addListener(this); - setDimension(Rectangle(0, 0, 500, 350)); + setDimension(Rect(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 4bde4b35e..419400853 100644 --- a/src/gui/widgets/tabs/setup_theme.cpp +++ b/src/gui/widgets/tabs/setup_theme.cpp @@ -367,7 +367,7 @@ Setup_Theme::Setup_Theme(const Widget2 *const widget) : else if (size > maxWidth) size = maxWidth; - setDimension(Rectangle(0, 0, size, 500)); + setDimension(Rect(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 d141691d4..fb50ab4d5 100644 --- a/src/gui/widgets/tabs/setup_touch.cpp +++ b/src/gui/widgets/tabs/setup_touch.cpp @@ -121,7 +121,7 @@ Setup_Touch::Setup_Touch(const Widget2 *const widget) : key, this, event, mActionsList, 250); } - setDimension(Rectangle(0, 0, 550, 350)); + setDimension(Rect(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 b587e8d5d..f55dceaa4 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(Rectangle(0, 0, width, 300)); + setDimension(Rect(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 525d73d07..9666b224a 100644 --- a/src/gui/widgets/tabs/setup_visual.cpp +++ b/src/gui/widgets/tabs/setup_visual.cpp @@ -203,7 +203,7 @@ Setup_Visual::Setup_Visual(const Widget2 *const widget) : new SetupItemCheckBox(_("Allow screensaver to run"), "", "allowscreensaver", this, "allowscreensaverEvent"); - setDimension(Rectangle(0, 0, 550, 350)); + setDimension(Rect(0, 0, 550, 350)); } Setup_Visual::~Setup_Visual() diff --git a/src/gui/widgets/textbox.cpp b/src/gui/widgets/textbox.cpp index 6fce77641..a1ce0e61d 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(Rectangle(0, 0, getWidth(), getHeight())); + graphics->fillRectangle(Rect(0, 0, getWidth(), getHeight())); } Font *const font = getFont(); diff --git a/src/gui/widgets/textfield.cpp b/src/gui/widgets/textfield.cpp index 3b4c5302c..78a2826d5 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 Rectangle *const clipArea = graphics->getCurrentClipArea(); + const Rect *const clipArea = graphics->getCurrentClipArea(); if (!clipArea) return; diff --git a/src/gui/widgets/textpreview.cpp b/src/gui/widgets/textpreview.cpp index 3772f3bbc..8ac49bfd6 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(Rectangle(0, 0, + graphics->fillRectangle(Rect(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(Rectangle(mPadding, mPadding, x, y)); + graphics->fillRectangle(Rect(mPadding, mPadding, x, y)); } } diff --git a/src/gui/widgets/widget.cpp b/src/gui/widgets/widget.cpp index f93107bc5..23edadac0 100644 --- a/src/gui/widgets/widget.cpp +++ b/src/gui/widgets/widget.cpp @@ -162,7 +162,7 @@ void Widget::_setParent(Widget* parent) void Widget::setWidth(int width) { - Rectangle newDimension = mDimension; + Rect newDimension = mDimension; newDimension.width = width; setDimension(newDimension); @@ -170,7 +170,7 @@ void Widget::setWidth(int width) void Widget::setHeight(int height) { - Rectangle newDimension = mDimension; + Rect newDimension = mDimension; newDimension.height = height; setDimension(newDimension); @@ -178,7 +178,7 @@ void Widget::setHeight(int height) void Widget::setX(int x) { - Rectangle newDimension = mDimension; + Rect newDimension = mDimension; newDimension.x = x; setDimension(newDimension); @@ -186,7 +186,7 @@ void Widget::setX(int x) void Widget::setY(int y) { - Rectangle newDimension = mDimension; + Rect newDimension = mDimension; newDimension.y = y; setDimension(newDimension); @@ -194,16 +194,16 @@ void Widget::setY(int y) void Widget::setPosition(int x, int y) { - Rectangle newDimension = mDimension; + Rect newDimension = mDimension; newDimension.x = x; newDimension.y = y; setDimension(newDimension); } -void Widget::setDimension(const Rectangle& dimension) +void Widget::setDimension(const Rect& dimension) { - const Rectangle oldDimension = mDimension; + const Rect oldDimension = mDimension; mDimension = dimension; if (mDimension.width != oldDimension.width @@ -229,7 +229,7 @@ unsigned int Widget::getFrameSize() const return mFrameSize; } -const Rectangle& Widget::getDimension() const +const Rect& Widget::getDimension() const { return mDimension; } @@ -434,7 +434,7 @@ void Widget::getAbsolutePosition(int& x, int& y) const mParent->getAbsolutePosition(parentX, parentY); - const Rectangle &rect = mParent->getChildrenArea(); + const Rect &rect = mParent->getChildrenArea(); x = parentX + mDimension.x + rect.x; y = parentY + mDimension.y + rect.y; } @@ -492,7 +492,7 @@ void Widget::setTabOutEnabled(bool enabled) void Widget::setSize(int width, int height) { - Rectangle newDimension = mDimension; + Rect newDimension = mDimension; newDimension.width = width; newDimension.height = height; @@ -589,9 +589,9 @@ const std::list<FocusListener*>& Widget::_getFocusListeners() return mFocusListeners; } -Rectangle Widget::getChildrenArea() +Rect Widget::getChildrenArea() { - return Rectangle(0, 0, 0, 0); + return Rect(0, 0, 0, 0); } FocusHandler* Widget::_getInternalFocusHandler() @@ -669,7 +669,7 @@ void Widget::distributeShownEvent() } } -void Widget::showPart(Rectangle rectangle) +void Widget::showPart(Rect rectangle) { if (mParent) mParent->showWidgetPart(this, rectangle); diff --git a/src/gui/widgets/widget.h b/src/gui/widgets/widget.h index 08f1456b0..e05844e4c 100644 --- a/src/gui/widgets/widget.h +++ b/src/gui/widgets/widget.h @@ -69,7 +69,7 @@ #include <string> #include "gui/color.h" -#include "gui/rectangle.h" +#include "gui/rect.h" #include "gui/widgets/widget2.h" @@ -313,7 +313,7 @@ class Widget : public Widget2 * @see getDimension, setX, getX, setY, getY, setPosition * @since 0.1.0 */ - void setDimension(const Rectangle& dimension); + void setDimension(const Rect& dimension); /** * Gets the dimension of the widget. The dimension is @@ -323,7 +323,7 @@ class Widget : public Widget2 * @see getDimension, setX, getX, setY, getY, setPosition * @since 0.1.0 */ - const Rectangle& getDimension() const A_WARN_UNUSED; + const Rect& getDimension() const A_WARN_UNUSED; /** * Sets the widget to be fosusable, or not. @@ -888,7 +888,7 @@ class Widget : public Widget2 * @see BasicContainer::drawChildren * @since 0.1.0 */ - virtual Rectangle getChildrenArea() A_WARN_UNUSED; + virtual Rect getChildrenArea() A_WARN_UNUSED; /** * Gets the internal focus handler used. @@ -960,7 +960,7 @@ class Widget : public Widget2 * @since 0.1.0 */ virtual void showWidgetPart(Widget* widget A_UNUSED, - Rectangle area A_UNUSED) + Rect area A_UNUSED) { } /** @@ -997,7 +997,7 @@ class Widget : public Widget2 * @param rectangle The rectangle to be shown. * @since 0.8.0 */ - virtual void showPart(Rectangle rectangle); + virtual void showPart(Rect rectangle); protected: /** @@ -1165,7 +1165,7 @@ class Widget : public Widget2 /** * Holds the dimension of the widget. */ - Rectangle mDimension; + Rect mDimension; /** * Holds the frame size of the widget. diff --git a/src/gui/widgets/window.cpp b/src/gui/widgets/window.cpp index 9a43a305b..8b106b489 100644 --- a/src/gui/widgets/window.cpp +++ b/src/gui/widgets/window.cpp @@ -543,7 +543,7 @@ void Window::setResizable(const bool r) void Window::widgetResized(const Event &event A_UNUSED) { - const Rectangle area = getChildrenArea(); + const Rect area = getChildrenArea(); if (mGrip) { @@ -860,7 +860,7 @@ void Window::mouseDragged(MouseEvent &event) { const int dx = event.getX() - mDragOffsetX; const int dy = event.getY() - mDragOffsetY; - Rectangle newDim = getDimension(); + Rect newDim = getDimension(); if (mouseResize & (TOP | BOTTOM)) { @@ -1258,7 +1258,7 @@ void Window::redraw() { if (mLayout) { - const Rectangle area = getChildrenArea(); + const Rect area = getChildrenArea(); int w = area.width; int h = area.height; mLayout->reflow(w, h); @@ -1294,9 +1294,9 @@ void Window::ensureOnScreen() mDimension.y = 0; } -Rectangle Window::getWindowArea() const +Rect Window::getWindowArea() const { - return Rectangle(mPadding, + return Rect(mPadding, mPadding, mDimension.width - mPadding * 2, mDimension.height - mPadding * 2); @@ -1321,9 +1321,9 @@ bool Window::getOptionBool(const std::string &name, const bool def) const return def; } -Rectangle Window::getChildrenArea() +Rect Window::getChildrenArea() { - return Rectangle(mPadding, + return Rect(mPadding, mTitleBarHeight, mDimension.width - mPadding * 2, mDimension.height - mPadding - mTitleBarHeight); diff --git a/src/gui/widgets/window.h b/src/gui/widgets/window.h index 9bf1b4b7a..7cf34c67c 100644 --- a/src/gui/widgets/window.h +++ b/src/gui/widgets/window.h @@ -450,7 +450,7 @@ class Window : public gcn::Container, */ int getGuiAlpha() const A_WARN_UNUSED; - Rectangle getWindowArea() const A_WARN_UNUSED; + Rect getWindowArea() const A_WARN_UNUSED; bool isResizeAllowed(const MouseEvent &event) const A_WARN_UNUSED; @@ -574,7 +574,7 @@ class Window : public gcn::Container, bool isOpaque() { return mOpaque; } - virtual Rectangle getChildrenArea(); + virtual Rect getChildrenArea(); /** * Resizes the window to fit the content. @@ -688,9 +688,9 @@ class Window : public gcn::Container, Image *mGrip; /**< Resize grip */ Window *mParent; /**< The parent window */ Layout *mLayout; /**< Layout handler */ - Rectangle mCloseRect; /**< Close button rectangle */ - Rectangle mStickyRect; /**< Sticky button rectangle */ - Rectangle mGripRect; /**< Resize grip rectangle */ + Rect mCloseRect; /**< Close button rectangle */ + Rect mStickyRect; /**< Sticky button rectangle */ + Rect 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 79ed7255d..40a5445ca 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(Rectangle(mainGraphics->mWidth - x, 0, x, h)); + setDimension(Rect(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 Rectangle &rect = mDimension; + const Rect &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(Rectangle(mainGraphics->mWidth - x, 0, x, h)); + setDimension(Rect(mainGraphics->mWidth - x, 0, x, h)); } void WindowMenu::loadButtons() diff --git a/src/gui/windows/charcreatedialog.cpp b/src/gui/windows/charcreatedialog.cpp index 1ddaaa7b2..4f98cb931 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(Rectangle(360, 0, 110, 90)); + mPlayerBox->setDimension(Rect(360, 0, 110, 90)); mActionButton->setPosition(385, 100); mRotateButton->setPosition(415, 100); mNameLabel->setPosition(5, 2); mNameField->setDimension( - Rectangle(60, 2, 300, mNameField->getHeight())); + Rect(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(Rectangle(140, y + i * 24, + mAttributeSlider[i]->setDimension(Rect(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 3c0e09ad5..d769c4397 100644 --- a/src/gui/windows/chatwindow.cpp +++ b/src/gui/windows/chatwindow.cpp @@ -327,7 +327,7 @@ void ChatWindow::updateTabsMargin() void ChatWindow::adjustTabSize() { - const Rectangle area = getChildrenArea(); + const Rect 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 2a227c4e2..50dc5dbe5 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(Rectangle(0, 0, 600, 300)); + mTabs->setDimension(Rect(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(Rectangle(0, 0, + mTabs->setDimension(Rect(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(Rectangle(0, 0, 600, 300)); + setDimension(Rect(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(Rectangle(0, 0, 600, 300)); + setDimension(Rect(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(Rectangle(0, 0, 600, 300)); + setDimension(Rect(0, 0, 600, 300)); } void NetDebugTab::logic() diff --git a/src/gui/windows/debugwindow.h b/src/gui/windows/debugwindow.h index 194385b06..1a56f3164 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(Rectangle(0, 0, x, y)); } + { setDimension(Rect(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 ea7944f94..c793ba6ce 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(Rectangle(50, 80, 74, 168)); + mPlayerBox->setDimension(Rect(50, 80, 74, 168)); mPlayerBox->setPlayer(being); if (foring) @@ -116,7 +116,7 @@ EquipmentWindow::EquipmentWindow(Equipment *const equipment, void EquipmentWindow::postInit() { - const Rectangle &area = getChildrenArea(); + const Rect &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 Rectangle tRect(box->x, box->y, mBoxSize, mBoxSize); + const Rect 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 Rectangle tRect(box->x, box->y, mBoxSize, mBoxSize); + const Rect 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 Rectangle tRect(box->x, box->y, mBoxSize, mBoxSize); + const Rect 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(Rectangle( + mPlayerBox->setDimension(Rect( 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 af6a9a2c4..5323854fb 100644 --- a/src/gui/windows/inventorywindow.cpp +++ b/src/gui/windows/inventorywindow.cpp @@ -565,7 +565,7 @@ void InventoryWindow::mouseMoved(MouseEvent &event) { const int x = event.getX(); const int y = event.getY(); - const Rectangle &rect = mDimension; + const Rect &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 4c246aed4..ef1830763 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 Rectangle &rect = mDimension; + const Rect &rect = mDimension; setDefaultSize(rect.x, rect.y, rect.width, rect.height); resetToDefaultSize(); @@ -244,7 +244,7 @@ void Minimap::draw(Graphics *graphics) return; } - const Rectangle a = getChildrenArea(); + const Rect a = getChildrenArea(); graphics->pushClipArea(a); @@ -346,7 +346,7 @@ void Minimap::draw(Graphics *graphics) dotSize - 1) * mWidthProportion); const Vector &pos = being->getPosition(); - graphics->fillRectangle(Rectangle( + graphics->fillRectangle(Rect( 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(Rectangle( + graphics->fillRectangle(Rect( 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(Rectangle(x, y, w, h)); + graphics->drawRectangle(Rect(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 Rectangle &rect = mDimension; + const Rect &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 Rectangle a = getChildrenArea(); + const Rect 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 655ccb277..db4555b26 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 Rectangle &rect = mDimension; + const Rect &rect = mDimension; if (event.getSource() == mStatusBar) { mStatusPopup->view(x + rect.x, y + rect.y); @@ -535,12 +535,12 @@ void MiniStatusWindow::updateArrows() StatusWindow::updateArrowsBar(mArrowsBar); } -Rectangle MiniStatusWindow::getChildrenArea() +Rect MiniStatusWindow::getChildrenArea() { const int padding = mPadding; const int padding2 = padding * 2; - const Rectangle &rect = mDimension; - return Rectangle(padding, padding, + const Rect &rect = mDimension; + return Rect(padding, padding, rect.width - padding2, rect.height - padding2); } diff --git a/src/gui/windows/ministatuswindow.h b/src/gui/windows/ministatuswindow.h index e061cbfae..0344d6c3a 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; } - Rectangle getChildrenArea() override final A_WARN_UNUSED; + Rect 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 aa510b88e..3c63775fe 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(Rectangle( + scrollArea->setDimension(Rect( 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 0f25b84a6..be0c840f6 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(Rectangle(itemX, itemY, 32, 32)); + graphics->drawRectangle(Rect(itemX, itemY, 32, 32)); graphics->setColor(mBackgroundColor); - graphics->fillRectangle(Rectangle(itemX, itemY, 32, 32)); + graphics->fillRectangle(Rect(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 Rectangle tRect = Rectangle(mPadding, mTitleBarHeight, + const Rect tRect = Rect(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 525e3f133..524c77366 100644 --- a/src/gui/windows/selldialog.cpp +++ b/src/gui/windows/selldialog.cpp @@ -292,7 +292,7 @@ void SellDialog::action(const ActionEvent &event) delete mShopItems->at(selectedItem); mShopItems->erase(selectedItem); - Rectangle scroll; + Rect 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 18da8682e..579e9ad18 100644 --- a/src/gui/windows/serverdialog.cpp +++ b/src/gui/windows/serverdialog.cpp @@ -139,7 +139,7 @@ public: // Draw filled rectangle around the selected list element if (mSelected >= 0) { - graphics->fillRectangle(Rectangle(mPadding, + graphics->fillRectangle(Rect(mPadding, height * mSelected + mPadding, getWidth() - 2 * mPadding, height)); } diff --git a/src/gui/windows/setupwindow.cpp b/src/gui/windows/setupwindow.cpp index 0f4468882..2bcac85a5 100644 --- a/src/gui/windows/setupwindow.cpp +++ b/src/gui/windows/setupwindow.cpp @@ -113,7 +113,7 @@ void SetupWindow::postInit() mResetWindows = btn; } - mPanel->setDimension(Rectangle(5, 5, width - 10, height - 40)); + mPanel->setDimension(Rect(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 Rectangle area = getChildrenArea(); + const Rect area = getChildrenArea(); int x = area.width; const int height = area.height; const int width = area.width; const int buttonPadding = getOption("buttonPadding", 5); - mPanel->setDimension(Rectangle(5, 5, width - 10, height - 40)); + mPanel->setDimension(Rect(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 1346c8e95..21cc009bc 100644 --- a/src/gui/windows/skilldialog.cpp +++ b/src/gui/windows/skilldialog.cpp @@ -115,7 +115,7 @@ class SkillListBox final : public ListBox // Draw filled rectangle around the selected list element if (mSelected >= 0) { - graphics->fillRectangle(Rectangle(mPadding, getRowHeight() + graphics->fillRectangle(Rect(mPadding, getRowHeight() * mSelected + mPadding, getWidth() - 2 * mPadding, getRowHeight())); } diff --git a/src/gui/windows/whoisonline.cpp b/src/gui/windows/whoisonline.cpp index 70edccad1..dabc8c7c1 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(Rectangle(5, 5, w - 10, 20 + 5)); + mUpdateButton->setDimension(Rect(5, 5, w - 10, 20 + 5)); mBrowserBox->setOpaque(false); - mScrollArea->setDimension(Rectangle(5, 20 + 10, w - 10, h - 10 - 30)); + mScrollArea->setDimension(Rect(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 Rectangle area = getChildrenArea(); + const Rect area = getChildrenArea(); if (mUpdateButton) mUpdateButton->setWidth(area.width - 10); |