summaryrefslogtreecommitdiff
path: root/src/gui/windows
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-02-22 14:59:26 +0300
committerAndrei Karas <akaras@inbox.ru>2014-02-22 14:59:26 +0300
commit63f0b730767b1185dc33f8892068d697e26a09bb (patch)
tree9f3bcba891cb747b2b4696651b8df464a8a1fc86 /src/gui/windows
parent48646db55005a0da079bd2c945875dc8225e2f86 (diff)
downloadmanaplus-63f0b730767b1185dc33f8892068d697e26a09bb.tar.gz
manaplus-63f0b730767b1185dc33f8892068d697e26a09bb.tar.bz2
manaplus-63f0b730767b1185dc33f8892068d697e26a09bb.tar.xz
manaplus-63f0b730767b1185dc33f8892068d697e26a09bb.zip
Move Rectangle and ClipRectangle into gui directory.
Diffstat (limited to 'src/gui/windows')
-rw-r--r--src/gui/windows/charcreatedialog.cpp6
-rw-r--r--src/gui/windows/chatwindow.cpp2
-rw-r--r--src/gui/windows/debugwindow.cpp10
-rw-r--r--src/gui/windows/debugwindow.h2
-rw-r--r--src/gui/windows/equipmentwindow.cpp12
-rw-r--r--src/gui/windows/inventorywindow.cpp2
-rw-r--r--src/gui/windows/minimap.cpp14
-rw-r--r--src/gui/windows/ministatuswindow.cpp8
-rw-r--r--src/gui/windows/ministatuswindow.h2
-rw-r--r--src/gui/windows/npcpostdialog.cpp2
-rw-r--r--src/gui/windows/outfitwindow.cpp6
-rw-r--r--src/gui/windows/selldialog.cpp2
-rw-r--r--src/gui/windows/serverdialog.cpp2
-rw-r--r--src/gui/windows/setupwindow.cpp6
-rw-r--r--src/gui/windows/skilldialog.cpp2
-rw-r--r--src/gui/windows/whoisonline.cpp6
16 files changed, 42 insertions, 42 deletions
diff --git a/src/gui/windows/charcreatedialog.cpp b/src/gui/windows/charcreatedialog.cpp
index fb407b9cc..1ddaaa7b2 100644
--- a/src/gui/windows/charcreatedialog.cpp
+++ b/src/gui/windows/charcreatedialog.cpp
@@ -208,13 +208,13 @@ CharCreateDialog::CharCreateDialog(CharSelectDialog *const parent,
const int h = 350;
setContentSize(w, h);
- mPlayerBox->setDimension(gcn::Rectangle(360, 0, 110, 90));
+ mPlayerBox->setDimension(Rectangle(360, 0, 110, 90));
mActionButton->setPosition(385, 100);
mRotateButton->setPosition(415, 100);
mNameLabel->setPosition(5, 2);
mNameField->setDimension(
- gcn::Rectangle(60, 2, 300, mNameField->getHeight()));
+ Rectangle(60, 2, 300, mNameField->getHeight()));
const int leftX = 120;
const int rightX = 300;
@@ -530,7 +530,7 @@ void CharCreateDialog::setAttributes(const StringVect &labels,
add(mAttributeLabel[i]);
mAttributeSlider[i] = new Slider(this, min, max);
- mAttributeSlider[i]->setDimension(gcn::Rectangle(140, y + i * 24,
+ mAttributeSlider[i]->setDimension(Rectangle(140, y + i * 24,
150, 12));
mAttributeSlider[i]->setActionEventId("statslider");
mAttributeSlider[i]->addActionListener(this);
diff --git a/src/gui/windows/chatwindow.cpp b/src/gui/windows/chatwindow.cpp
index 565d3644a..1754ca0bf 100644
--- a/src/gui/windows/chatwindow.cpp
+++ b/src/gui/windows/chatwindow.cpp
@@ -377,7 +377,7 @@ void ChatWindow::updateTabsMargin()
void ChatWindow::adjustTabSize()
{
- const gcn::Rectangle area = getChildrenArea();
+ const Rectangle area = getChildrenArea();
const int aw = area.width;
const int ah = area.height;
diff --git a/src/gui/windows/debugwindow.cpp b/src/gui/windows/debugwindow.cpp
index 7e68aa6d8..2a227c4e2 100644
--- a/src/gui/windows/debugwindow.cpp
+++ b/src/gui/windows/debugwindow.cpp
@@ -75,7 +75,7 @@ DebugWindow::DebugWindow() :
// TRANSLATORS: debug window tab
mTabs->addTab(std::string(_("Net")), mNetWidget);
- mTabs->setDimension(gcn::Rectangle(0, 0, 600, 300));
+ mTabs->setDimension(Rectangle(0, 0, 600, 300));
const int w = mDimension.width;
const int h = mDimension.height;
@@ -151,7 +151,7 @@ void DebugWindow::widgetResized(const Event &event)
{
Window::widgetResized(event);
- mTabs->setDimension(gcn::Rectangle(0, 0,
+ mTabs->setDimension(Rectangle(0, 0,
mDimension.width, mDimension.height));
}
@@ -267,7 +267,7 @@ MapDebugTab::MapDebugTab(const Widget2 *const widget) :
#endif
place.getCell().matchColWidth(0, 0);
place = h.getPlacer(0, 1);
- setDimension(gcn::Rectangle(0, 0, 600, 300));
+ setDimension(Rectangle(0, 0, 600, 300));
}
void MapDebugTab::logic()
@@ -412,7 +412,7 @@ TargetDebugTab::TargetDebugTab(const Widget2 *const widget) :
place.getCell().matchColWidth(0, 0);
place = h.getPlacer(0, 1);
- setDimension(gcn::Rectangle(0, 0, 600, 300));
+ setDimension(Rectangle(0, 0, 600, 300));
}
void TargetDebugTab::logic()
@@ -531,7 +531,7 @@ NetDebugTab::NetDebugTab(const Widget2 *const widget) :
place.getCell().matchColWidth(0, 0);
place = h.getPlacer(0, 1);
- setDimension(gcn::Rectangle(0, 0, 600, 300));
+ setDimension(Rectangle(0, 0, 600, 300));
}
void NetDebugTab::logic()
diff --git a/src/gui/windows/debugwindow.h b/src/gui/windows/debugwindow.h
index aa7bdfe6c..194385b06 100644
--- a/src/gui/windows/debugwindow.h
+++ b/src/gui/windows/debugwindow.h
@@ -41,7 +41,7 @@ class DebugTab : public Container
}
void resize(const int x, const int y)
- { setDimension(gcn::Rectangle(0, 0, x, y)); }
+ { setDimension(Rectangle(0, 0, x, y)); }
protected:
explicit DebugTab(const Widget2 *const widget) :
diff --git a/src/gui/windows/equipmentwindow.cpp b/src/gui/windows/equipmentwindow.cpp
index 01f74c50d..a50d0e9fa 100644
--- a/src/gui/windows/equipmentwindow.cpp
+++ b/src/gui/windows/equipmentwindow.cpp
@@ -92,7 +92,7 @@ EquipmentWindow::EquipmentWindow(Equipment *const equipment,
mBoxSize = 36;
// Control that shows the Player
- mPlayerBox->setDimension(gcn::Rectangle(50, 80, 74, 168));
+ mPlayerBox->setDimension(Rectangle(50, 80, 74, 168));
mPlayerBox->setPlayer(being);
if (foring)
@@ -116,7 +116,7 @@ EquipmentWindow::EquipmentWindow(Equipment *const equipment,
void EquipmentWindow::postInit()
{
- const gcn::Rectangle &area = getChildrenArea();
+ const Rectangle &area = getChildrenArea();
mUnequip->setPosition(area.width - mUnequip->getWidth() - mButtonPadding,
area.height - mUnequip->getHeight() - mButtonPadding);
mUnequip->setEnabled(false);
@@ -283,7 +283,7 @@ Item *EquipmentWindow::getItem(const int x, const int y) const
const EquipmentBox *const box = *it;
if (!box)
continue;
- const gcn::Rectangle tRect(box->x, box->y, mBoxSize, mBoxSize);
+ const Rectangle tRect(box->x, box->y, mBoxSize, mBoxSize);
if (tRect.isPointInRect(x, y))
return mEquipment->getEquipment(i);
@@ -321,7 +321,7 @@ void EquipmentWindow::mousePressed(MouseEvent& mouseEvent)
if (!box)
continue;
const Item *const item = mEquipment->getEquipment(i);
- const gcn::Rectangle tRect(box->x, box->y, mBoxSize, mBoxSize);
+ const Rectangle tRect(box->x, box->y, mBoxSize, mBoxSize);
if (tRect.isPointInRect(x, y))
{
@@ -402,7 +402,7 @@ void EquipmentWindow::mouseReleased(MouseEvent &mouseEvent)
const EquipmentBox *const box = *it;
if (!box)
continue;
- const gcn::Rectangle tRect(box->x, box->y, mBoxSize, mBoxSize);
+ const Rectangle tRect(box->x, box->y, mBoxSize, mBoxSize);
if (tRect.isPointInRect(x, y))
return;
@@ -514,7 +514,7 @@ void EquipmentWindow::fillBoxes()
void EquipmentWindow::loadPlayerBox(const XmlNodePtr playerBoxNode)
{
- mPlayerBox->setDimension(gcn::Rectangle(
+ mPlayerBox->setDimension(Rectangle(
XML::getProperty(playerBoxNode, "x", 50),
XML::getProperty(playerBoxNode, "y", 80),
XML::getProperty(playerBoxNode, "width", 74),
diff --git a/src/gui/windows/inventorywindow.cpp b/src/gui/windows/inventorywindow.cpp
index 603b1b26d..bd6719df9 100644
--- a/src/gui/windows/inventorywindow.cpp
+++ b/src/gui/windows/inventorywindow.cpp
@@ -598,7 +598,7 @@ void InventoryWindow::mouseMoved(MouseEvent &event)
{
const int x = event.getX();
const int y = event.getY();
- const gcn::Rectangle &rect = mDimension;
+ const Rectangle &rect = mDimension;
mTextPopup->show(rect.x + x, rect.y + y, strprintf(_("Money: %s"),
Units::formatCurrency(PlayerInfo::getAttribute(
PlayerInfo::MONEY)).c_str()));
diff --git a/src/gui/windows/minimap.cpp b/src/gui/windows/minimap.cpp
index 0f0938e20..dd8a1d2b7 100644
--- a/src/gui/windows/minimap.cpp
+++ b/src/gui/windows/minimap.cpp
@@ -213,7 +213,7 @@ void Minimap::setMap(const Map *const map)
setHeight(height);
}
- const gcn::Rectangle &rect = mDimension;
+ const Rectangle &rect = mDimension;
setDefaultSize(rect.x, rect.y, rect.width, rect.height);
resetToDefaultSize();
@@ -244,7 +244,7 @@ void Minimap::draw(Graphics *graphics)
return;
}
- const gcn::Rectangle a = getChildrenArea();
+ const Rectangle a = getChildrenArea();
graphics->pushClipArea(a);
@@ -346,7 +346,7 @@ void Minimap::draw(Graphics *graphics)
dotSize - 1) * mWidthProportion);
const Vector &pos = being->getPosition();
- graphics->fillRectangle(gcn::Rectangle(
+ graphics->fillRectangle(Rectangle(
static_cast<float>(pos.x * mWidthProportion) / 32
+ mMapOriginX - offsetWidth,
static_cast<float>(pos.y * mHeightProportion) / 32
@@ -384,7 +384,7 @@ void Minimap::draw(Graphics *graphics)
const int offsetWidth = static_cast<int>(
mWidthProportion);
- graphics->fillRectangle(gcn::Rectangle(
+ graphics->fillRectangle(Rectangle(
static_cast<int>(member->getX()
* mWidthProportion) + mMapOriginX - offsetWidth,
static_cast<int>(member->getY()
@@ -429,7 +429,7 @@ void Minimap::draw(Graphics *graphics)
}
graphics->setColor(userPalette->getColor(UserPalette::PC));
- graphics->drawRectangle(gcn::Rectangle(x, y, w, h));
+ graphics->drawRectangle(Rectangle(x, y, w, h));
graphics->popClipArea();
BLOCK_END("Minimap::draw")
}
@@ -463,7 +463,7 @@ void Minimap::mouseMoved(MouseEvent &event)
Window::mouseMoved(event);
const int x = event.getX();
const int y = event.getY();
- const gcn::Rectangle &rect = mDimension;
+ const Rectangle &rect = mDimension;
mTextPopup->show(x + rect.x, y + rect.y, mCaption);
}
@@ -475,7 +475,7 @@ void Minimap::mouseExited(MouseEvent &event)
void Minimap::screenToMap(int &x, int &y)
{
- const gcn::Rectangle a = getChildrenArea();
+ const Rectangle a = getChildrenArea();
x = (x - a.x - mMapOriginX + mWidthProportion) / mWidthProportion;
y = (y - a.y - mMapOriginY + mHeightProportion) / mHeightProportion;
}
diff --git a/src/gui/windows/ministatuswindow.cpp b/src/gui/windows/ministatuswindow.cpp
index b8f2fd7ea..655ccb277 100644
--- a/src/gui/windows/ministatuswindow.cpp
+++ b/src/gui/windows/ministatuswindow.cpp
@@ -322,7 +322,7 @@ void MiniStatusWindow::mouseMoved(MouseEvent &event)
const int x = event.getX();
const int y = event.getY();
- const gcn::Rectangle &rect = mDimension;
+ const Rectangle &rect = mDimension;
if (event.getSource() == mStatusBar)
{
mStatusPopup->view(x + rect.x, y + rect.y);
@@ -535,12 +535,12 @@ void MiniStatusWindow::updateArrows()
StatusWindow::updateArrowsBar(mArrowsBar);
}
-gcn::Rectangle MiniStatusWindow::getChildrenArea()
+Rectangle MiniStatusWindow::getChildrenArea()
{
const int padding = mPadding;
const int padding2 = padding * 2;
- const gcn::Rectangle &rect = mDimension;
- return gcn::Rectangle(padding, padding,
+ const Rectangle &rect = mDimension;
+ return Rectangle(padding, padding,
rect.width - padding2,
rect.height - padding2);
}
diff --git a/src/gui/windows/ministatuswindow.h b/src/gui/windows/ministatuswindow.h
index bb1991c19..e061cbfae 100644
--- a/src/gui/windows/ministatuswindow.h
+++ b/src/gui/windows/ministatuswindow.h
@@ -88,7 +88,7 @@ class MiniStatusWindow final : public Popup,
std::vector <ProgressBar*> &getBars() A_WARN_UNUSED
{ return mBars; }
- gcn::Rectangle getChildrenArea() override final A_WARN_UNUSED;
+ Rectangle getChildrenArea() override final A_WARN_UNUSED;
#ifdef USE_PROFILER
void logicChildren();
diff --git a/src/gui/windows/npcpostdialog.cpp b/src/gui/windows/npcpostdialog.cpp
index 23c21da0c..aa510b88e 100644
--- a/src/gui/windows/npcpostdialog.cpp
+++ b/src/gui/windows/npcpostdialog.cpp
@@ -76,7 +76,7 @@ void NpcPostDialog::postInit()
// create scroll box for letter text
ScrollArea *const scrollArea = new ScrollArea(this, mText);
scrollArea->setHorizontalScrollPolicy(gcn::ScrollArea::SHOW_NEVER);
- scrollArea->setDimension(gcn::Rectangle(
+ scrollArea->setDimension(Rectangle(
5, mSender->getHeight() + 5,
380, 140 - (mSender->getHeight() + sendButton->getHeight())));
diff --git a/src/gui/windows/outfitwindow.cpp b/src/gui/windows/outfitwindow.cpp
index d1413cc0a..acf681cf4 100644
--- a/src/gui/windows/outfitwindow.cpp
+++ b/src/gui/windows/outfitwindow.cpp
@@ -328,9 +328,9 @@ void OutfitWindow::draw(Graphics *graphics)
+ ((i / mGridWidth) * mBoxHeight);
graphics->setColor(mBorderColor);
- graphics->drawRectangle(gcn::Rectangle(itemX, itemY, 32, 32));
+ graphics->drawRectangle(Rectangle(itemX, itemY, 32, 32));
graphics->setColor(mBackgroundColor);
- graphics->fillRectangle(gcn::Rectangle(itemX, itemY, 32, 32));
+ graphics->fillRectangle(Rectangle(itemX, itemY, 32, 32));
if (mItems[mCurrentOutfit][i] < 0)
continue;
@@ -483,7 +483,7 @@ void OutfitWindow::mouseReleased(MouseEvent &event)
int OutfitWindow::getIndexFromGrid(const int pointX, const int pointY) const
{
- const gcn::Rectangle tRect = gcn::Rectangle(mPadding, mTitleBarHeight,
+ const Rectangle tRect = Rectangle(mPadding, mTitleBarHeight,
mGridWidth * mBoxWidth, mGridHeight * mBoxHeight);
if (!tRect.isPointInRect(pointX, pointY))
return -1;
diff --git a/src/gui/windows/selldialog.cpp b/src/gui/windows/selldialog.cpp
index dc932ca69..a89f7655a 100644
--- a/src/gui/windows/selldialog.cpp
+++ b/src/gui/windows/selldialog.cpp
@@ -291,7 +291,7 @@ void SellDialog::action(const ActionEvent &event)
delete mShopItems->at(selectedItem);
mShopItems->erase(selectedItem);
- gcn::Rectangle scroll;
+ Rectangle scroll;
scroll.y = mShopItemList->getRowHeight() * (selectedItem + 1);
scroll.height = mShopItemList->getRowHeight();
mShopItemList->showPart(scroll);
diff --git a/src/gui/windows/serverdialog.cpp b/src/gui/windows/serverdialog.cpp
index cbab4710d..a6e3637fb 100644
--- a/src/gui/windows/serverdialog.cpp
+++ b/src/gui/windows/serverdialog.cpp
@@ -177,7 +177,7 @@ public:
// Draw filled rectangle around the selected list element
if (mSelected >= 0)
{
- graphics->fillRectangle(gcn::Rectangle(mPadding,
+ graphics->fillRectangle(Rectangle(mPadding,
height * mSelected + mPadding, getWidth() - 2 * mPadding,
height));
}
diff --git a/src/gui/windows/setupwindow.cpp b/src/gui/windows/setupwindow.cpp
index 9878807d9..0f4468882 100644
--- a/src/gui/windows/setupwindow.cpp
+++ b/src/gui/windows/setupwindow.cpp
@@ -113,7 +113,7 @@ void SetupWindow::postInit()
mResetWindows = btn;
}
- mPanel->setDimension(gcn::Rectangle(5, 5, width - 10, height - 40));
+ mPanel->setDimension(Rectangle(5, 5, width - 10, height - 40));
mPanel->enableScrollButtons(true);
mTabs.push_back(new Setup_Video(this));
@@ -265,12 +265,12 @@ void SetupWindow::widgetResized(const Event &event)
{
Window::widgetResized(event);
- const gcn::Rectangle area = getChildrenArea();
+ const Rectangle area = getChildrenArea();
int x = area.width;
const int height = area.height;
const int width = area.width;
const int buttonPadding = getOption("buttonPadding", 5);
- mPanel->setDimension(gcn::Rectangle(5, 5, width - 10, height - 40));
+ mPanel->setDimension(Rectangle(5, 5, width - 10, height - 40));
FOR_EACH (std::vector<Button*>::iterator, it, mButtons)
{
Button *const btn = *it;
diff --git a/src/gui/windows/skilldialog.cpp b/src/gui/windows/skilldialog.cpp
index 2e9a8be10..f5f233402 100644
--- a/src/gui/windows/skilldialog.cpp
+++ b/src/gui/windows/skilldialog.cpp
@@ -114,7 +114,7 @@ class SkillListBox final : public ListBox
// Draw filled rectangle around the selected list element
if (mSelected >= 0)
{
- graphics->fillRectangle(gcn::Rectangle(mPadding, getRowHeight()
+ graphics->fillRectangle(Rectangle(mPadding, getRowHeight()
* mSelected + mPadding, getWidth() - 2 * mPadding,
getRowHeight()));
}
diff --git a/src/gui/windows/whoisonline.cpp b/src/gui/windows/whoisonline.cpp
index 76f12f795..70edccad1 100644
--- a/src/gui/windows/whoisonline.cpp
+++ b/src/gui/windows/whoisonline.cpp
@@ -116,10 +116,10 @@ void WhoIsOnline::postInit()
setSaveVisible(true);
mUpdateButton->setEnabled(false);
- mUpdateButton->setDimension(gcn::Rectangle(5, 5, w - 10, 20 + 5));
+ mUpdateButton->setDimension(Rectangle(5, 5, w - 10, 20 + 5));
mBrowserBox->setOpaque(false);
- mScrollArea->setDimension(gcn::Rectangle(5, 20 + 10, w - 10, h - 10 - 30));
+ mScrollArea->setDimension(Rectangle(5, 20 + 10, w - 10, h - 10 - 30));
mScrollArea->setSize(w - 10, h - 10 - 30);
mBrowserBox->setLinkHandler(this);
@@ -723,7 +723,7 @@ void WhoIsOnline::widgetResized(const Event &event)
void WhoIsOnline::updateSize()
{
- const gcn::Rectangle area = getChildrenArea();
+ const Rectangle area = getChildrenArea();
if (mUpdateButton)
mUpdateButton->setWidth(area.width - 10);