From 63f0b730767b1185dc33f8892068d697e26a09bb Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 22 Feb 2014 14:59:26 +0300 Subject: Move Rectangle and ClipRectangle into gui directory. --- src/gui/widgets/avatarlistbox.cpp | 4 +- src/gui/widgets/browserbox.cpp | 8 +-- src/gui/widgets/button.cpp | 4 +- src/gui/widgets/colorpage.cpp | 2 +- src/gui/widgets/desktop.cpp | 10 ++-- src/gui/widgets/dropdown.cpp | 10 ++-- src/gui/widgets/dropdown.h | 2 +- src/gui/widgets/extendedlistbox.cpp | 2 +- src/gui/widgets/guitable.cpp | 16 +++--- src/gui/widgets/guitable.h | 2 +- src/gui/widgets/label.cpp | 2 +- src/gui/widgets/layout.cpp | 2 +- src/gui/widgets/layouthelper.cpp | 2 +- src/gui/widgets/listbox.cpp | 4 +- src/gui/widgets/popup.cpp | 4 +- src/gui/widgets/popup.h | 2 +- src/gui/widgets/progressbar.cpp | 2 +- src/gui/widgets/scrollarea.cpp | 82 +++++++++++++++--------------- src/gui/widgets/scrollarea.h | 16 +++--- src/gui/widgets/shoplistbox.cpp | 2 +- src/gui/widgets/shortcutcontainer.cpp | 2 +- src/gui/widgets/spellshortcutcontainer.cpp | 2 +- src/gui/widgets/tabbedarea.cpp | 4 +- src/gui/widgets/tabbedarea.h | 2 +- src/gui/widgets/tabs/chattab.cpp | 2 +- src/gui/widgets/tabs/setup_audio.cpp | 2 +- src/gui/widgets/tabs/setup_chat.cpp | 2 +- src/gui/widgets/tabs/setup_colors.cpp | 2 +- src/gui/widgets/tabs/setup_input.cpp | 2 +- src/gui/widgets/tabs/setup_joystick.cpp | 2 +- src/gui/widgets/tabs/setup_mods.cpp | 2 +- src/gui/widgets/tabs/setup_other.cpp | 2 +- src/gui/widgets/tabs/setup_perfomance.cpp | 2 +- src/gui/widgets/tabs/setup_players.cpp | 2 +- src/gui/widgets/tabs/setup_relations.cpp | 2 +- src/gui/widgets/tabs/setup_theme.cpp | 2 +- src/gui/widgets/tabs/setup_touch.cpp | 2 +- src/gui/widgets/tabs/setup_video.cpp | 2 +- src/gui/widgets/tabs/setup_visual.cpp | 2 +- src/gui/widgets/textbox.cpp | 2 +- src/gui/widgets/textfield.cpp | 2 +- src/gui/widgets/textpreview.cpp | 4 +- src/gui/widgets/window.cpp | 16 +++--- src/gui/widgets/window.h | 8 +-- 44 files changed, 125 insertions(+), 125 deletions(-) (limited to 'src/gui/widgets') 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(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(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( 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(mSelectedColumn) && r == static_cast(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(mBGColor->g), static_cast(mBGColor->b), static_cast(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(mTextBGColor->g), static_cast(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 */ -- cgit v1.2.3-60-g2f50