summaryrefslogtreecommitdiff
path: root/src/gui/widgets
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-02-20 21:19:35 +0300
committerAndrei Karas <akaras@inbox.ru>2016-02-20 21:19:35 +0300
commit3e8fecc9a62afff0054fa0fa23af86c8ef15a1c9 (patch)
tree2053748aba4fd1e01020effe9322757426354d28 /src/gui/widgets
parent2577a25f8a4acf587526809fda2ded95875e1222 (diff)
downloadplus-3e8fecc9a62afff0054fa0fa23af86c8ef15a1c9.tar.gz
plus-3e8fecc9a62afff0054fa0fa23af86c8ef15a1c9.tar.bz2
plus-3e8fecc9a62afff0054fa0fa23af86c8ef15a1c9.tar.xz
plus-3e8fecc9a62afff0054fa0fa23af86c8ef15a1c9.zip
Add missing const in gui directory.
Diffstat (limited to 'src/gui/widgets')
-rw-r--r--src/gui/widgets/avatarlistbox.cpp4
-rw-r--r--src/gui/widgets/basiccontainer.cpp25
-rw-r--r--src/gui/widgets/basiccontainer.h12
-rw-r--r--src/gui/widgets/basiccontainer2.cpp8
-rw-r--r--src/gui/widgets/basiccontainer2.h8
-rw-r--r--src/gui/widgets/browserbox.cpp4
-rw-r--r--src/gui/widgets/browserbox.h4
-rw-r--r--src/gui/widgets/browserbox_unittest.cc5
-rw-r--r--src/gui/widgets/button.cpp4
-rw-r--r--src/gui/widgets/button.h4
-rw-r--r--src/gui/widgets/colorpage.cpp4
-rw-r--r--src/gui/widgets/colorpage.h4
-rw-r--r--src/gui/widgets/desktop.cpp4
-rw-r--r--src/gui/widgets/desktop.h4
-rw-r--r--src/gui/widgets/dropdown.cpp10
-rw-r--r--src/gui/widgets/dropdown.h10
-rw-r--r--src/gui/widgets/emotepage.cpp4
-rw-r--r--src/gui/widgets/emotepage.h4
-rw-r--r--src/gui/widgets/extendedlistbox.cpp4
-rw-r--r--src/gui/widgets/extendedlistbox.h4
-rw-r--r--src/gui/widgets/flowcontainer.cpp2
-rw-r--r--src/gui/widgets/flowcontainer.h2
-rw-r--r--src/gui/widgets/guitable.cpp12
-rw-r--r--src/gui/widgets/guitable.h12
-rw-r--r--src/gui/widgets/horizontcontainer.cpp2
-rw-r--r--src/gui/widgets/horizontcontainer.h2
-rw-r--r--src/gui/widgets/icon.cpp4
-rw-r--r--src/gui/widgets/icon.h4
-rw-r--r--src/gui/widgets/itemcontainer.cpp4
-rw-r--r--src/gui/widgets/itemcontainer.h4
-rw-r--r--src/gui/widgets/itemlinkhandler.cpp3
-rw-r--r--src/gui/widgets/itemshortcutcontainer.cpp4
-rw-r--r--src/gui/widgets/itemshortcutcontainer.h4
-rw-r--r--src/gui/widgets/label.cpp6
-rw-r--r--src/gui/widgets/label.h6
-rw-r--r--src/gui/widgets/listbox.cpp4
-rw-r--r--src/gui/widgets/listbox.h4
-rw-r--r--src/gui/widgets/passwordfield.cpp4
-rw-r--r--src/gui/widgets/passwordfield.h4
-rw-r--r--src/gui/widgets/playerbox.cpp8
-rw-r--r--src/gui/widgets/playerbox.h9
-rw-r--r--src/gui/widgets/popup.cpp4
-rw-r--r--src/gui/widgets/popup.h4
-rw-r--r--src/gui/widgets/popuplist.cpp2
-rw-r--r--src/gui/widgets/popuplist.h2
-rw-r--r--src/gui/widgets/progressbar.cpp4
-rw-r--r--src/gui/widgets/progressbar.h4
-rw-r--r--src/gui/widgets/progressindicator.cpp14
-rw-r--r--src/gui/widgets/progressindicator.h6
-rw-r--r--src/gui/widgets/radiobutton.cpp6
-rw-r--r--src/gui/widgets/radiobutton.h6
-rw-r--r--src/gui/widgets/scrollarea.cpp8
-rw-r--r--src/gui/widgets/scrollarea.h9
-rw-r--r--src/gui/widgets/serverslistbox.h4
-rw-r--r--src/gui/widgets/setupquickitem.cpp4
-rw-r--r--src/gui/widgets/shoplistbox.cpp4
-rw-r--r--src/gui/widgets/shoplistbox.h4
-rw-r--r--src/gui/widgets/shortcutcontainer.cpp4
-rw-r--r--src/gui/widgets/shortcutcontainer.h4
-rw-r--r--src/gui/widgets/skilllistbox.h4
-rw-r--r--src/gui/widgets/slider.cpp4
-rw-r--r--src/gui/widgets/slider.h4
-rw-r--r--src/gui/widgets/sliderlist.cpp4
-rw-r--r--src/gui/widgets/sliderlist.h4
-rw-r--r--src/gui/widgets/spellshortcutcontainer.cpp4
-rw-r--r--src/gui/widgets/spellshortcutcontainer.h4
-rw-r--r--src/gui/widgets/tabbedarea.cpp13
-rw-r--r--src/gui/widgets/tabbedarea.h4
-rw-r--r--src/gui/widgets/tabs/tab.cpp4
-rw-r--r--src/gui/widgets/tabs/tab.h4
-rw-r--r--src/gui/widgets/textbox.cpp13
-rw-r--r--src/gui/widgets/textbox.h6
-rw-r--r--src/gui/widgets/textfield.cpp8
-rw-r--r--src/gui/widgets/textfield.h9
-rw-r--r--src/gui/widgets/textpreview.cpp4
-rw-r--r--src/gui/widgets/textpreview.h4
-rw-r--r--src/gui/widgets/virtshortcutcontainer.cpp4
-rw-r--r--src/gui/widgets/virtshortcutcontainer.h4
-rw-r--r--src/gui/widgets/widget.cpp2
-rw-r--r--src/gui/widgets/widget.h6
-rw-r--r--src/gui/widgets/window.cpp4
-rw-r--r--src/gui/widgets/window.h4
-rw-r--r--src/gui/widgets/windowcontainer.cpp2
-rw-r--r--src/gui/widgets/windowcontainer.h2
84 files changed, 236 insertions, 216 deletions
diff --git a/src/gui/widgets/avatarlistbox.cpp b/src/gui/widgets/avatarlistbox.cpp
index 25ef34135..7caf28d7d 100644
--- a/src/gui/widgets/avatarlistbox.cpp
+++ b/src/gui/widgets/avatarlistbox.cpp
@@ -98,7 +98,7 @@ AvatarListBox::~AvatarListBox()
}
}
-void AvatarListBox::draw(Graphics *graphics)
+void AvatarListBox::draw(Graphics *const graphics)
{
BLOCK_START("AvatarListBox::draw")
if (!mListModel || !localPlayer)
@@ -343,7 +343,7 @@ void AvatarListBox::draw(Graphics *graphics)
BLOCK_END("AvatarListBox::draw")
}
-void AvatarListBox::safeDraw(Graphics *graphics)
+void AvatarListBox::safeDraw(Graphics *const graphics)
{
BLOCK_START("AvatarListBox::draw")
if (!mListModel || !localPlayer)
diff --git a/src/gui/widgets/basiccontainer.cpp b/src/gui/widgets/basiccontainer.cpp
index 15042b971..26434d7e9 100644
--- a/src/gui/widgets/basiccontainer.cpp
+++ b/src/gui/widgets/basiccontainer.cpp
@@ -72,7 +72,7 @@ BasicContainer::~BasicContainer()
clear();
}
-void BasicContainer::moveToTop(Widget *widget) restrict2
+void BasicContainer::moveToTop(Widget *const widget) restrict2
{
FOR_EACH (WidgetListIterator, iter, mWidgets)
{
@@ -94,9 +94,9 @@ void BasicContainer::moveToTop(Widget *widget) restrict2
}
}
-void BasicContainer::moveToBottom(Widget *widget) restrict2
+void BasicContainer::moveToBottom(Widget *const widget) restrict2
{
- WidgetListIterator iter = std::find(mWidgets.begin(),
+ const WidgetListIterator iter = std::find(mWidgets.begin(),
mWidgets.end(), widget);
if (iter != mWidgets.end())
{
@@ -104,7 +104,7 @@ void BasicContainer::moveToBottom(Widget *widget) restrict2
mWidgets.insert(mWidgets.begin(), widget);
}
- WidgetListIterator iter2 = std::find(mLogicWidgets.begin(),
+ const WidgetListIterator iter2 = std::find(mLogicWidgets.begin(),
mLogicWidgets.end(), widget);
if (iter2 != mLogicWidgets.end())
{
@@ -115,12 +115,12 @@ void BasicContainer::moveToBottom(Widget *widget) restrict2
void BasicContainer::death(const Event &restrict event) restrict2
{
- WidgetListIterator iter = std::find(mWidgets.begin(),
+ const WidgetListIterator iter = std::find(mWidgets.begin(),
mWidgets.end(), event.getSource());
if (iter != mWidgets.end())
mWidgets.erase(iter);
- WidgetListIterator iter2 = std::find(mLogicWidgets.begin(),
+ const WidgetListIterator iter2 = std::find(mLogicWidgets.begin(),
mLogicWidgets.end(), event.getSource());
if (iter2 != mLogicWidgets.end())
mLogicWidgets.erase(iter2);
@@ -141,7 +141,7 @@ void BasicContainer::focusNext() restrict2
break;
}
- WidgetListConstIterator end = it;
+ const WidgetListConstIterator end = it;
if (it == mWidgets.end())
it = mWidgets.begin();
@@ -256,7 +256,7 @@ void BasicContainer::add(Widget *const widget) restrict2
widget->addDeathListener(this);
}
-void BasicContainer::remove(Widget *restrict widget) restrict2
+void BasicContainer::remove(Widget *const restrict widget) restrict2
{
if (!widget)
return;
@@ -297,7 +297,7 @@ void BasicContainer::clear() restrict2
mLogicWidgets.clear();
}
-void BasicContainer::drawChildren(Graphics *restrict graphics) restrict2
+void BasicContainer::drawChildren(Graphics *const restrict graphics) restrict2
{
BLOCK_START("BasicContainer::drawChildren")
graphics->pushClipArea(getChildrenArea());
@@ -337,7 +337,8 @@ void BasicContainer::drawChildren(Graphics *restrict graphics) restrict2
BLOCK_END("BasicContainer::drawChildren")
}
-void BasicContainer::safeDrawChildren(Graphics *restrict graphics) restrict2
+void BasicContainer::safeDrawChildren(Graphics *const restrict graphics)
+ restrict2
{
BLOCK_START("BasicContainer::drawChildren")
graphics->pushClipArea(getChildrenArea());
@@ -409,12 +410,12 @@ void BasicContainer::showWidgetPart(Widget *restrict const widget,
widget->setY(widgetArea.height - area.y - area.height);
}
-void BasicContainer::setInternalFocusHandler(FocusHandler *restrict
+void BasicContainer::setInternalFocusHandler(FocusHandler *const restrict
focusHandler) restrict2
{
Widget::setInternalFocusHandler(focusHandler);
- FocusHandler *restrict handler = mInternalFocusHandler ?
+ FocusHandler *const restrict handler = mInternalFocusHandler ?
mInternalFocusHandler : getFocusHandler();
FOR_EACH (WidgetListConstIterator, iter, mWidgets)
{
diff --git a/src/gui/widgets/basiccontainer.h b/src/gui/widgets/basiccontainer.h
index 8fe2bc54b..a6420db67 100644
--- a/src/gui/widgets/basiccontainer.h
+++ b/src/gui/widgets/basiccontainer.h
@@ -110,9 +110,9 @@ class BasicContainer notfinal : public Widget,
// Inherited from Widget
- void moveToTop(Widget *widget) restrict2 override;
+ void moveToTop(Widget *const widget) restrict2 override;
- void moveToBottom(Widget *widget) restrict2 override;
+ void moveToBottom(Widget *const widget) restrict2 override;
Rect getChildrenArea() restrict2 override A_WARN_UNUSED;
@@ -125,7 +125,7 @@ class BasicContainer notfinal : public Widget,
void setFocusHandler(FocusHandler *restrict const focusHandler)
restrict2 override;
- void setInternalFocusHandler(FocusHandler *restrict focusHandler)
+ void setInternalFocusHandler(FocusHandler *const restrict focusHandler)
restrict2;
Widget *getWidgetAt(int x, int y) restrict2 override A_WARN_UNUSED;
@@ -151,7 +151,7 @@ class BasicContainer notfinal : public Widget,
* @param widget The widget to remove.
* @see add, clear
*/
- virtual void remove(Widget *restrict widget) restrict2;
+ virtual void remove(Widget *const restrict widget) restrict2;
/**
* Clears the basic container from all widgets.
@@ -166,10 +166,10 @@ class BasicContainer notfinal : public Widget,
*
* @param graphics A graphics object to draw with.
*/
- virtual void drawChildren(Graphics *restrict graphics)
+ virtual void drawChildren(Graphics *const restrict graphics)
restrict2 A_NONNULL(2);
- virtual void safeDrawChildren(Graphics *restrict graphics)
+ virtual void safeDrawChildren(Graphics *const restrict graphics)
restrict2 A_NONNULL(2);
/**
diff --git a/src/gui/widgets/basiccontainer2.cpp b/src/gui/widgets/basiccontainer2.cpp
index 3d67c5ace..862fa641c 100644
--- a/src/gui/widgets/basiccontainer2.cpp
+++ b/src/gui/widgets/basiccontainer2.cpp
@@ -79,7 +79,7 @@ BasicContainer2::~BasicContainer2()
{
}
-void BasicContainer2::draw(Graphics* graphics)
+void BasicContainer2::draw(Graphics *const graphics)
{
BLOCK_START("BasicContainer2::draw")
if (mOpaque)
@@ -93,7 +93,7 @@ void BasicContainer2::draw(Graphics* graphics)
BLOCK_END("BasicContainer2::draw")
}
-void BasicContainer2::safeDraw(Graphics* graphics)
+void BasicContainer2::safeDraw(Graphics *const graphics)
{
BLOCK_START("BasicContainer2::draw")
if (isOpaque())
@@ -107,7 +107,7 @@ void BasicContainer2::safeDraw(Graphics* graphics)
BLOCK_END("BasicContainer2::draw")
}
-void BasicContainer2::add(Widget* widget)
+void BasicContainer2::add(Widget *const widget)
{
// +++ need move all add() calls from constructors
// and after this method can be deleted
@@ -115,7 +115,7 @@ void BasicContainer2::add(Widget* widget)
BasicContainer::add(widget);
}
-void BasicContainer2::addXY(Widget* widget,
+void BasicContainer2::addXY(Widget *const widget,
const int x,
const int y)
{
diff --git a/src/gui/widgets/basiccontainer2.h b/src/gui/widgets/basiccontainer2.h
index 8de344264..e7cba01d6 100644
--- a/src/gui/widgets/basiccontainer2.h
+++ b/src/gui/widgets/basiccontainer2.h
@@ -120,7 +120,7 @@ class BasicContainer2: public BasicContainer
* @param widget The widget to add.
* @see remove, clear
*/
- virtual void add(Widget* widget);
+ virtual void add(Widget *const widget);
/**
* Adds a widget to the container and also specifies the widget's
@@ -132,14 +132,14 @@ class BasicContainer2: public BasicContainer
* @param y The y coordinate for the widget.
* @see remove, clear
*/
- void addXY(Widget* widget,
+ void addXY(Widget *const widget,
const int x, const int y);
// Inherited from Widget
- void draw(Graphics* graphics) override A_NONNULL(2);
+ void draw(Graphics *const graphics) override A_NONNULL(2);
- void safeDraw(Graphics* graphics) override A_NONNULL(2);
+ void safeDraw(Graphics *const graphics) override A_NONNULL(2);
protected:
/**
diff --git a/src/gui/widgets/browserbox.cpp b/src/gui/widgets/browserbox.cpp
index 52ba88a7b..2c936ac96 100644
--- a/src/gui/widgets/browserbox.cpp
+++ b/src/gui/widgets/browserbox.cpp
@@ -486,7 +486,7 @@ void BrowserBox::mouseExited(MouseEvent &event A_UNUSED)
mSelectedLink = -1;
}
-void BrowserBox::draw(Graphics *graphics)
+void BrowserBox::draw(Graphics *const graphics)
{
BLOCK_START("BrowserBox::draw")
const ClipRect &cr = graphics->getTopClip();
@@ -568,7 +568,7 @@ void BrowserBox::draw(Graphics *graphics)
BLOCK_END("BrowserBox::draw")
}
-void BrowserBox::safeDraw(Graphics *graphics)
+void BrowserBox::safeDraw(Graphics *const graphics)
{
BrowserBox::draw(graphics);
}
diff --git a/src/gui/widgets/browserbox.h b/src/gui/widgets/browserbox.h
index 7bff334c2..d0655631c 100644
--- a/src/gui/widgets/browserbox.h
+++ b/src/gui/widgets/browserbox.h
@@ -122,9 +122,9 @@ class BrowserBox final : public Widget,
/**
* Draws the browser box.
*/
- void draw(Graphics *graphics) override final A_NONNULL(2);
+ void draw(Graphics *const graphics) override final A_NONNULL(2);
- void safeDraw(Graphics *graphics) override final A_NONNULL(2);
+ void safeDraw(Graphics *const graphics) override final A_NONNULL(2);
void updateHeight();
diff --git a/src/gui/widgets/browserbox_unittest.cc b/src/gui/widgets/browserbox_unittest.cc
index 9fe75dda5..1bae1f294 100644
--- a/src/gui/widgets/browserbox_unittest.cc
+++ b/src/gui/widgets/browserbox_unittest.cc
@@ -43,7 +43,10 @@ TEST_CASE("BrowserBox tests", "browserbox")
theme = new Theme;
Widget::setGlobalFont(new Font("/usr/share/fonts/truetype/"
"ttf-dejavu/DejaVuSans-Oblique.ttf", 18));
- BrowserBox *box = new BrowserBox(nullptr, BrowserBox::AUTO_WRAP, true, "");
+ BrowserBox *const box = new BrowserBox(nullptr,
+ BrowserBox::AUTO_WRAP,
+ true,
+ "");
box->setWidth(100);
std::string row = "test";
box->addRow(row);
diff --git a/src/gui/widgets/button.cpp b/src/gui/widgets/button.cpp
index 97291276b..246e08a8e 100644
--- a/src/gui/widgets/button.cpp
+++ b/src/gui/widgets/button.cpp
@@ -460,7 +460,7 @@ void Button::updateAlpha()
}
}
-void Button::draw(Graphics *graphics)
+void Button::draw(Graphics *const graphics)
{
BLOCK_START("Button::draw")
int mode;
@@ -639,7 +639,7 @@ void Button::draw(Graphics *graphics)
BLOCK_END("Button::draw")
}
-void Button::safeDraw(Graphics *graphics)
+void Button::safeDraw(Graphics *const graphics)
{
BLOCK_START("Button::safeDraw")
int mode;
diff --git a/src/gui/widgets/button.h b/src/gui/widgets/button.h
index 952b412a2..f994f413b 100644
--- a/src/gui/widgets/button.h
+++ b/src/gui/widgets/button.h
@@ -151,9 +151,9 @@ class Button final : public Widget,
/**
* Draws the button.
*/
- void draw(Graphics *graphics) override final A_NONNULL(2);
+ void draw(Graphics *const graphics) override final A_NONNULL(2);
- void safeDraw(Graphics *graphics) override final A_NONNULL(2);
+ void safeDraw(Graphics *const graphics) override final A_NONNULL(2);
/**
* Update the alpha value to the button components.
diff --git a/src/gui/widgets/colorpage.cpp b/src/gui/widgets/colorpage.cpp
index 53e312769..82ed92b69 100644
--- a/src/gui/widgets/colorpage.cpp
+++ b/src/gui/widgets/colorpage.cpp
@@ -49,7 +49,7 @@ ColorPage::~ColorPage()
{
}
-void ColorPage::draw(Graphics *graphics)
+void ColorPage::draw(Graphics *const graphics)
{
BLOCK_START("ColorPage::draw")
@@ -99,7 +99,7 @@ void ColorPage::draw(Graphics *graphics)
BLOCK_END("ColorPage::draw")
}
-void ColorPage::safeDraw(Graphics *graphics)
+void ColorPage::safeDraw(Graphics *const graphics)
{
ColorPage::draw(graphics);
}
diff --git a/src/gui/widgets/colorpage.h b/src/gui/widgets/colorpage.h
index 67b45a3ce..f191966cc 100644
--- a/src/gui/widgets/colorpage.h
+++ b/src/gui/widgets/colorpage.h
@@ -36,9 +36,9 @@ class ColorPage final : public ListBox
~ColorPage();
- void draw(Graphics *graphics) override final A_NONNULL(2);
+ void draw(Graphics *const graphics) override final A_NONNULL(2);
- void safeDraw(Graphics *graphics) override final A_NONNULL(2);
+ void safeDraw(Graphics *const graphics) override final A_NONNULL(2);
void resetAction();
diff --git a/src/gui/widgets/desktop.cpp b/src/gui/widgets/desktop.cpp
index 4eee2de9d..aab966f9c 100644
--- a/src/gui/widgets/desktop.cpp
+++ b/src/gui/widgets/desktop.cpp
@@ -114,7 +114,7 @@ void Desktop::widgetResized(const Event &event A_UNUSED)
setBestFittingWallpaper();
}
-void Desktop::draw(Graphics *graphics)
+void Desktop::draw(Graphics *const graphics)
{
BLOCK_START("Desktop::draw")
GLDEBUG_START("Desktop::draw")
@@ -155,7 +155,7 @@ void Desktop::draw(Graphics *graphics)
BLOCK_END("Desktop::draw")
}
-void Desktop::safeDraw(Graphics *graphics)
+void Desktop::safeDraw(Graphics *const graphics)
{
Desktop::draw(graphics);
}
diff --git a/src/gui/widgets/desktop.h b/src/gui/widgets/desktop.h
index 4bc41771d..263bbabce 100644
--- a/src/gui/widgets/desktop.h
+++ b/src/gui/widgets/desktop.h
@@ -65,9 +65,9 @@ class Desktop final : public Container,
void widgetResized(const Event &event) override final;
- void draw(Graphics *graphics) override final A_NONNULL(2);
+ void draw(Graphics *const graphics) override final A_NONNULL(2);
- void safeDraw(Graphics *graphics) override final A_NONNULL(2);
+ void safeDraw(Graphics *const graphics) override final A_NONNULL(2);
void postInit() override final;
diff --git a/src/gui/widgets/dropdown.cpp b/src/gui/widgets/dropdown.cpp
index 506503e01..8f1a811e2 100644
--- a/src/gui/widgets/dropdown.cpp
+++ b/src/gui/widgets/dropdown.cpp
@@ -207,7 +207,7 @@ void DropDown::updateAlpha()
}
}
-void DropDown::draw(Graphics* graphics)
+void DropDown::draw(Graphics *const graphics)
{
BLOCK_START("DropDown::draw")
int h;
@@ -286,12 +286,12 @@ void DropDown::draw(Graphics* graphics)
BLOCK_END("DropDown::draw")
}
-void DropDown::safeDraw(Graphics* graphics)
+void DropDown::safeDraw(Graphics *const graphics)
{
DropDown::draw(graphics);
}
-void DropDown::drawFrame(Graphics *graphics)
+void DropDown::drawFrame(Graphics *const graphics)
{
BLOCK_START("DropDown::drawFrame")
const int bs2 = CAST_S32(getFrameSize());
@@ -302,7 +302,7 @@ void DropDown::drawFrame(Graphics *graphics)
BLOCK_END("DropDown::drawFrame")
}
-void DropDown::safeDrawFrame(Graphics *graphics)
+void DropDown::safeDrawFrame(Graphics *const graphics)
{
BLOCK_START("DropDown::drawFrame")
const int bs2 = CAST_S32(getFrameSize());
@@ -313,7 +313,7 @@ void DropDown::safeDrawFrame(Graphics *graphics)
BLOCK_END("DropDown::drawFrame")
}
-void DropDown::drawButton(Graphics *graphics)
+void DropDown::drawButton(Graphics *const graphics)
{
const int height = mDroppedDown ? mFoldedUpHeight : mDimension.height;
diff --git a/src/gui/widgets/dropdown.h b/src/gui/widgets/dropdown.h
index e485aa65b..c3f7c002c 100644
--- a/src/gui/widgets/dropdown.h
+++ b/src/gui/widgets/dropdown.h
@@ -79,13 +79,13 @@ class DropDown final : public ActionListener,
*/
void updateAlpha();
- void draw(Graphics *graphics) override final A_NONNULL(2);
+ void draw(Graphics *const graphics) override final A_NONNULL(2);
- void safeDraw(Graphics *graphics) override final A_NONNULL(2);
+ void safeDraw(Graphics *const graphics) override final A_NONNULL(2);
- void drawFrame(Graphics *graphics) override final A_NONNULL(2);
+ void drawFrame(Graphics *const graphics) override final A_NONNULL(2);
- void safeDrawFrame(Graphics *graphics) override final A_NONNULL(2);
+ void safeDrawFrame(Graphics *const graphics) override final A_NONNULL(2);
// Inherited from KeyListener
@@ -143,7 +143,7 @@ class DropDown final : public ActionListener,
*
* @param graphics a Graphics object to draw with.
*/
- void drawButton(Graphics *graphics) A_NONNULL(2);
+ void drawButton(Graphics *const graphics) A_NONNULL(2);
PopupList *mPopup A_NONNULLPOINTER;
Color mShadowColor;
diff --git a/src/gui/widgets/emotepage.cpp b/src/gui/widgets/emotepage.cpp
index 6e3732413..d6903d49d 100644
--- a/src/gui/widgets/emotepage.cpp
+++ b/src/gui/widgets/emotepage.cpp
@@ -59,7 +59,7 @@ EmotePage::~EmotePage()
delete2(mVertexes);
}
-void EmotePage::draw(Graphics *graphics)
+void EmotePage::draw(Graphics *const graphics)
{
BLOCK_START("EmotePage::draw")
@@ -97,7 +97,7 @@ void EmotePage::draw(Graphics *graphics)
BLOCK_END("EmotePage::draw")
}
-void EmotePage::safeDraw(Graphics *graphics)
+void EmotePage::safeDraw(Graphics *const graphics)
{
BLOCK_START("EmotePage::safeDraw")
diff --git a/src/gui/widgets/emotepage.h b/src/gui/widgets/emotepage.h
index 75a9ec730..a12bc5f1a 100644
--- a/src/gui/widgets/emotepage.h
+++ b/src/gui/widgets/emotepage.h
@@ -39,9 +39,9 @@ class EmotePage final : public Widget,
~EmotePage();
- void draw(Graphics *graphics) override final A_NONNULL(2);
+ void draw(Graphics *const graphics) override final A_NONNULL(2);
- void safeDraw(Graphics *graphics) override final A_NONNULL(2);
+ void safeDraw(Graphics *const graphics) override final A_NONNULL(2);
void mousePressed(MouseEvent &event) override final;
diff --git a/src/gui/widgets/extendedlistbox.cpp b/src/gui/widgets/extendedlistbox.cpp
index fd9b4c660..927b2132b 100644
--- a/src/gui/widgets/extendedlistbox.cpp
+++ b/src/gui/widgets/extendedlistbox.cpp
@@ -47,7 +47,7 @@ ExtendedListBox::~ExtendedListBox()
{
}
-void ExtendedListBox::draw(Graphics *graphics)
+void ExtendedListBox::draw(Graphics *const graphics)
{
if (!mListModel)
return;
@@ -215,7 +215,7 @@ void ExtendedListBox::draw(Graphics *graphics)
BLOCK_END("ExtendedListBox::draw")
}
-void ExtendedListBox::safeDraw(Graphics *graphics)
+void ExtendedListBox::safeDraw(Graphics *const graphics)
{
ExtendedListBox::draw(graphics);
}
diff --git a/src/gui/widgets/extendedlistbox.h b/src/gui/widgets/extendedlistbox.h
index 56950ca27..6e40ecc2b 100644
--- a/src/gui/widgets/extendedlistbox.h
+++ b/src/gui/widgets/extendedlistbox.h
@@ -42,9 +42,9 @@ class ExtendedListBox final : public ListBox
/**
* Draws the list box.
*/
- void draw(Graphics *graphics) override final A_NONNULL(2);
+ void draw(Graphics *const graphics) override final A_NONNULL(2);
- void safeDraw(Graphics *graphics) override final A_NONNULL(2);
+ void safeDraw(Graphics *const graphics) override final A_NONNULL(2);
void adjustSize() override;
diff --git a/src/gui/widgets/flowcontainer.cpp b/src/gui/widgets/flowcontainer.cpp
index d6f10248e..851cf9db3 100644
--- a/src/gui/widgets/flowcontainer.cpp
+++ b/src/gui/widgets/flowcontainer.cpp
@@ -86,7 +86,7 @@ void FlowContainer::widgetResized(const Event &event A_UNUSED)
}
}
-void FlowContainer::add(Widget *widget)
+void FlowContainer::add(Widget *const widget)
{
if (!widget)
return;
diff --git a/src/gui/widgets/flowcontainer.h b/src/gui/widgets/flowcontainer.h
index bbb5ba041..5e47af759 100644
--- a/src/gui/widgets/flowcontainer.h
+++ b/src/gui/widgets/flowcontainer.h
@@ -64,7 +64,7 @@ class FlowContainer final : public Container,
int getBoxHeight() const A_WARN_UNUSED
{ return mBoxHeight; }
- void add(Widget *widget) override final;
+ void add(Widget *const widget) override final;
private:
int mBoxWidth;
diff --git a/src/gui/widgets/guitable.cpp b/src/gui/widgets/guitable.cpp
index c41d4886c..c6acc33da 100644
--- a/src/gui/widgets/guitable.cpp
+++ b/src/gui/widgets/guitable.cpp
@@ -220,7 +220,7 @@ void GuiTable::installActionListeners()
}
// -- widget ops
-void GuiTable::draw(Graphics* graphics)
+void GuiTable::draw(Graphics *const graphics)
{
if (!getRowHeight())
return;
@@ -338,7 +338,7 @@ void GuiTable::draw(Graphics* graphics)
BLOCK_END("GuiTable::draw")
}
-void GuiTable::safeDraw(Graphics* graphics)
+void GuiTable::safeDraw(Graphics *const graphics)
{
if (!getRowHeight())
return;
@@ -456,13 +456,13 @@ void GuiTable::safeDraw(Graphics* graphics)
BLOCK_END("GuiTable::draw")
}
-void GuiTable::moveToTop(Widget *widget)
+void GuiTable::moveToTop(Widget *const widget)
{
Widget::moveToTop(widget);
mTopWidget = widget;
}
-void GuiTable::moveToBottom(Widget *widget)
+void GuiTable::moveToBottom(Widget *const widget)
{
Widget::moveToBottom(widget);
if (widget == mTopWidget)
@@ -608,7 +608,7 @@ Widget *GuiTable::getWidgetAt(int x, int y)
return nullptr;
}
-int GuiTable::getRowForY(int y) const
+int GuiTable::getRowForY(const int y) const
{
int row = -1;
@@ -622,7 +622,7 @@ int GuiTable::getRowForY(int y) const
return row;
}
-int GuiTable::getColumnForX(int x) const
+int GuiTable::getColumnForX(const int x) const
{
int column;
int delta = 0;
diff --git a/src/gui/widgets/guitable.h b/src/gui/widgets/guitable.h
index 4b9e7e8a0..35000ccff 100644
--- a/src/gui/widgets/guitable.h
+++ b/src/gui/widgets/guitable.h
@@ -110,15 +110,15 @@ class GuiTable final : public Widget,
{ mLinewiseMode = linewise; }
// Inherited from Widget
- void draw(Graphics* graphics) override final A_NONNULL(2);
+ void draw(Graphics *const graphics) override final A_NONNULL(2);
- void safeDraw(Graphics* graphics) override final A_NONNULL(2);
+ void safeDraw(Graphics *const graphics) override final A_NONNULL(2);
Widget *getWidgetAt(int x, int y) override final A_WARN_UNUSED;
- void moveToTop(Widget *child) override final;
+ void moveToTop(Widget *const widget) override final;
- void moveToBottom(Widget *child) override final;
+ void moveToBottom(Widget *const widget) override final;
void setFocusHandler(FocusHandler *const focusHandler) override final;
@@ -172,9 +172,9 @@ class GuiTable final : public Widget,
int getColumnWidth(const int i) const A_WARN_UNUSED;
private:
- int getRowForY(int y) const A_WARN_UNUSED; // -1 on error
+ int getRowForY(const int y) const A_WARN_UNUSED; // -1 on error
- int getColumnForX(int x) const A_WARN_UNUSED; // -1 on error
+ int getColumnForX(const int x) const A_WARN_UNUSED; // -1 on error
void recomputeDimensions();
diff --git a/src/gui/widgets/horizontcontainer.cpp b/src/gui/widgets/horizontcontainer.cpp
index c4cd68249..9db91d4ab 100644
--- a/src/gui/widgets/horizontcontainer.cpp
+++ b/src/gui/widgets/horizontcontainer.cpp
@@ -38,7 +38,7 @@ HorizontContainer::HorizontContainer(const Widget2 *const widget,
addMouseListener(this);
}
-void HorizontContainer::add(Widget *widget)
+void HorizontContainer::add(Widget *const widget)
{
add(widget, mSpacing);
}
diff --git a/src/gui/widgets/horizontcontainer.h b/src/gui/widgets/horizontcontainer.h
index 7dde487f3..23ca5159c 100644
--- a/src/gui/widgets/horizontcontainer.h
+++ b/src/gui/widgets/horizontcontainer.h
@@ -45,7 +45,7 @@ class HorizontContainer final : public Container,
A_DELETE_COPY(HorizontContainer)
- void add(Widget *widget) override final;
+ void add(Widget *const widget) override final;
void add(Widget *const widget, const int spacing);
diff --git a/src/gui/widgets/icon.cpp b/src/gui/widgets/icon.cpp
index e5c61d941..855ea7a20 100644
--- a/src/gui/widgets/icon.cpp
+++ b/src/gui/widgets/icon.cpp
@@ -77,7 +77,7 @@ void Icon::setImage(Image *const image)
}
}
-void Icon::draw(Graphics *graphics)
+void Icon::draw(Graphics *const graphics)
{
BLOCK_START("Icon::draw")
if (mImage)
@@ -89,7 +89,7 @@ void Icon::draw(Graphics *graphics)
BLOCK_END("Icon::draw")
}
-void Icon::safeDraw(Graphics *graphics)
+void Icon::safeDraw(Graphics *const graphics)
{
BLOCK_START("Icon::draw")
if (mImage)
diff --git a/src/gui/widgets/icon.h b/src/gui/widgets/icon.h
index c82fb1ccc..e630339d8 100644
--- a/src/gui/widgets/icon.h
+++ b/src/gui/widgets/icon.h
@@ -71,9 +71,9 @@ class Icon final : public Widget
/**
* Draws the Icon.
*/
- void draw(Graphics *g) override final A_NONNULL(2);
+ void draw(Graphics *const g) override final A_NONNULL(2);
- void safeDraw(Graphics *g) override final A_NONNULL(2);
+ void safeDraw(Graphics *const g) override final A_NONNULL(2);
private:
Image *mImage;
diff --git a/src/gui/widgets/itemcontainer.cpp b/src/gui/widgets/itemcontainer.cpp
index 2a9ea0ed7..02ad10ee9 100644
--- a/src/gui/widgets/itemcontainer.cpp
+++ b/src/gui/widgets/itemcontainer.cpp
@@ -261,7 +261,7 @@ void ItemContainer::logic()
BLOCK_END("ItemContainer::logic")
}
-void ItemContainer::draw(Graphics *graphics)
+void ItemContainer::draw(Graphics *const graphics)
{
if (!mInventory || !mShowMatrix)
return;
@@ -392,7 +392,7 @@ void ItemContainer::draw(Graphics *graphics)
BLOCK_END("ItemContainer::draw")
}
-void ItemContainer::safeDraw(Graphics *graphics)
+void ItemContainer::safeDraw(Graphics *const graphics)
{
if (!mInventory || !mShowMatrix)
return;
diff --git a/src/gui/widgets/itemcontainer.h b/src/gui/widgets/itemcontainer.h
index 76f2c7f9b..b4fa698d7 100644
--- a/src/gui/widgets/itemcontainer.h
+++ b/src/gui/widgets/itemcontainer.h
@@ -79,9 +79,9 @@ class ItemContainer final : public Widget,
/**
* Draws the items.
*/
- void draw(Graphics *graphics) override final A_NONNULL(2);
+ void draw(Graphics *const graphics) override final A_NONNULL(2);
- void safeDraw(Graphics *graphics) override final A_NONNULL(2);
+ void safeDraw(Graphics *const graphics) override final A_NONNULL(2);
// KeyListener
void keyPressed(KeyEvent &event) override final A_CONST;
diff --git a/src/gui/widgets/itemlinkhandler.cpp b/src/gui/widgets/itemlinkhandler.cpp
index b7ffe5e70..80559b130 100644
--- a/src/gui/widgets/itemlinkhandler.cpp
+++ b/src/gui/widgets/itemlinkhandler.cpp
@@ -157,7 +157,8 @@ void ItemLinkHandler::handleSearchLink(const std::string &link)
}
}
-void ItemLinkHandler::handleLink(const std::string &link, MouseEvent *event)
+void ItemLinkHandler::handleLink(const std::string &link,
+ MouseEvent *const event)
{
logger->log("link: " + link);
if (strStartWith(link, "http://") || strStartWith(link, "https://"))
diff --git a/src/gui/widgets/itemshortcutcontainer.cpp b/src/gui/widgets/itemshortcutcontainer.cpp
index 75f045944..9604d33d8 100644
--- a/src/gui/widgets/itemshortcutcontainer.cpp
+++ b/src/gui/widgets/itemshortcutcontainer.cpp
@@ -84,7 +84,7 @@ void ItemShortcutContainer::setWidget2(const Widget2 *const widget)
mForegroundColor2 = getThemeColor(ThemeColorId::TEXT_OUTLINE);
}
-void ItemShortcutContainer::draw(Graphics *graphics)
+void ItemShortcutContainer::draw(Graphics *const graphics)
{
BLOCK_START("ItemShortcutContainer::draw")
const ItemShortcut *const selShortcut = itemShortcut[mNumber];
@@ -221,7 +221,7 @@ void ItemShortcutContainer::draw(Graphics *graphics)
BLOCK_END("ItemShortcutContainer::draw")
}
-void ItemShortcutContainer::safeDraw(Graphics *graphics)
+void ItemShortcutContainer::safeDraw(Graphics *const graphics)
{
BLOCK_START("ItemShortcutContainer::draw")
const ItemShortcut *const selShortcut = itemShortcut[mNumber];
diff --git a/src/gui/widgets/itemshortcutcontainer.h b/src/gui/widgets/itemshortcutcontainer.h
index f492f7dbd..9e043663b 100644
--- a/src/gui/widgets/itemshortcutcontainer.h
+++ b/src/gui/widgets/itemshortcutcontainer.h
@@ -49,9 +49,9 @@ class ItemShortcutContainer final : public ShortcutContainer
/**
* Draws the items.
*/
- void draw(Graphics *graphics) override final A_NONNULL(2);
+ void draw(Graphics *const graphics) override final A_NONNULL(2);
- void safeDraw(Graphics *graphics) override final A_NONNULL(2);
+ void safeDraw(Graphics *const graphics) override final A_NONNULL(2);
/**
* Handles mouse when dragged.
diff --git a/src/gui/widgets/label.cpp b/src/gui/widgets/label.cpp
index cdecb9115..2f3ec268e 100644
--- a/src/gui/widgets/label.cpp
+++ b/src/gui/widgets/label.cpp
@@ -141,7 +141,7 @@ void Label::init()
mPadding = 0;
}
-void Label::draw(Graphics* graphics)
+void Label::draw(Graphics *const graphics)
{
BLOCK_START("Label::draw")
int textX;
@@ -183,7 +183,7 @@ void Label::draw(Graphics* graphics)
BLOCK_END("Label::draw")
}
-void Label::safeDraw(Graphics* graphics)
+void Label::safeDraw(Graphics *const graphics)
{
Label::draw(graphics);
}
@@ -259,7 +259,7 @@ void Label::setCaption(const std::string& caption)
mCaption = caption;
}
-void Label::setParent(Widget *widget)
+void Label::setParent(Widget *const widget)
{
if (mWindow)
mWindow->addWidgetListener(this);
diff --git a/src/gui/widgets/label.h b/src/gui/widgets/label.h
index cb1ab4072..3d9e5f941 100644
--- a/src/gui/widgets/label.h
+++ b/src/gui/widgets/label.h
@@ -108,9 +108,9 @@ class Label final : public Widget,
/**
* Draws the label.
*/
- void draw(Graphics *graphics) override final A_NONNULL(2);
+ void draw(Graphics *const graphics) override final A_NONNULL(2);
- void safeDraw(Graphics *graphics) override final A_NONNULL(2);
+ void safeDraw(Graphics *const graphics) override final A_NONNULL(2);
void adjustSize();
@@ -160,7 +160,7 @@ class Label final : public Widget,
Graphics::Alignment getAlignment() const
{ return mAlignment; }
- void setParent(Widget *widget) override final;
+ void setParent(Widget *const widget) override final;
void setWindow(Widget *const widget) override final;
diff --git a/src/gui/widgets/listbox.cpp b/src/gui/widgets/listbox.cpp
index ced9dcb99..180a0e877 100644
--- a/src/gui/widgets/listbox.cpp
+++ b/src/gui/widgets/listbox.cpp
@@ -149,7 +149,7 @@ void ListBox::updateAlpha()
mAlpha = alpha;
}
-void ListBox::draw(Graphics *graphics)
+void ListBox::draw(Graphics *const graphics)
{
if (!mListModel)
return;
@@ -269,7 +269,7 @@ void ListBox::keyPressed(KeyEvent &event)
}
}
-void ListBox::safeDraw(Graphics *graphics)
+void ListBox::safeDraw(Graphics *const graphics)
{
ListBox::draw(graphics);
}
diff --git a/src/gui/widgets/listbox.h b/src/gui/widgets/listbox.h
index 8a6f34373..97ee63ba7 100644
--- a/src/gui/widgets/listbox.h
+++ b/src/gui/widgets/listbox.h
@@ -108,9 +108,9 @@ class ListBox notfinal : public Widget,
/**
* Draws the list box.
*/
- void draw(Graphics *graphics) override A_NONNULL(2);
+ void draw(Graphics *const graphics) override A_NONNULL(2);
- void safeDraw(Graphics *graphics) override A_NONNULL(2);
+ void safeDraw(Graphics *const graphics) override A_NONNULL(2);
/**
* Update the alpha value to the graphic components.
diff --git a/src/gui/widgets/passwordfield.cpp b/src/gui/widgets/passwordfield.cpp
index ae47d4500..0017fddc9 100644
--- a/src/gui/widgets/passwordfield.cpp
+++ b/src/gui/widgets/passwordfield.cpp
@@ -35,7 +35,7 @@ PasswordField::PasswordField(const Widget2 *const widget,
{
}
-void PasswordField::draw(Graphics *graphics)
+void PasswordField::draw(Graphics *const graphics)
{
BLOCK_START("PasswordField::draw")
// std::string uses cow, thus cheap copy
@@ -49,7 +49,7 @@ void PasswordField::draw(Graphics *graphics)
BLOCK_END("PasswordField::draw")
}
-void PasswordField::safeDraw(Graphics *graphics)
+void PasswordField::safeDraw(Graphics *const graphics)
{
PasswordField::draw(graphics);
}
diff --git a/src/gui/widgets/passwordfield.h b/src/gui/widgets/passwordfield.h
index 78b4f94ac..305adf739 100644
--- a/src/gui/widgets/passwordfield.h
+++ b/src/gui/widgets/passwordfield.h
@@ -44,9 +44,9 @@ class PasswordField final : public TextField
/**
* Draws the password field.
*/
- void draw(Graphics *graphics) override final A_NONNULL(2);
+ void draw(Graphics *const graphics) override final A_NONNULL(2);
- void safeDraw(Graphics *graphics) override final A_NONNULL(2);
+ void safeDraw(Graphics *const graphics) override final A_NONNULL(2);
protected:
char mPasswordChar;
diff --git a/src/gui/widgets/playerbox.cpp b/src/gui/widgets/playerbox.cpp
index ac893b850..d796458da 100644
--- a/src/gui/widgets/playerbox.cpp
+++ b/src/gui/widgets/playerbox.cpp
@@ -115,7 +115,7 @@ void PlayerBox::init(std::string name, std::string selectedName)
}
}
-void PlayerBox::draw(Graphics *graphics)
+void PlayerBox::draw(Graphics *const graphics)
{
BLOCK_START("PlayerBox::draw")
if (mBeing)
@@ -138,12 +138,12 @@ void PlayerBox::draw(Graphics *graphics)
BLOCK_END("PlayerBox::draw")
}
-void PlayerBox::safeDraw(Graphics *graphics)
+void PlayerBox::safeDraw(Graphics *const graphics)
{
PlayerBox::draw(graphics);
}
-void PlayerBox::drawFrame(Graphics *graphics)
+void PlayerBox::drawFrame(Graphics *const graphics)
{
BLOCK_START("PlayerBox::drawFrame")
if (mDrawBackground)
@@ -160,7 +160,7 @@ void PlayerBox::drawFrame(Graphics *graphics)
BLOCK_END("PlayerBox::drawFrame")
}
-void PlayerBox::safeDrawFrame(Graphics *graphics)
+void PlayerBox::safeDrawFrame(Graphics *const graphics)
{
BLOCK_START("PlayerBox::drawFrame")
if (mDrawBackground)
diff --git a/src/gui/widgets/playerbox.h b/src/gui/widgets/playerbox.h
index c13704b44..1a122fbbd 100644
--- a/src/gui/widgets/playerbox.h
+++ b/src/gui/widgets/playerbox.h
@@ -76,16 +76,17 @@ class PlayerBox final : public Widget,
/**
* Draws the scroll area.
*/
- void draw(Graphics *graphics) override final A_NONNULL(2);
+ void draw(Graphics *const graphics) override final A_NONNULL(2);
- void safeDraw(Graphics *graphics) override final A_NONNULL(2);
+ void safeDraw(Graphics *const graphics) override final A_NONNULL(2);
/**
* Draws the background and border of the scroll area.
*/
- void drawFrame(Graphics *graphics) override final A_NONNULL(2);
+ void drawFrame(Graphics *const graphics) override final A_NONNULL(2);
- void safeDrawFrame(Graphics *graphics) override final A_NONNULL(2);
+ void safeDrawFrame(Graphics *const graphics) override final
+ A_NONNULL(2);
Being *getBeing() A_WARN_UNUSED
{ return mBeing; }
diff --git a/src/gui/widgets/popup.cpp b/src/gui/widgets/popup.cpp
index bd94236b9..9a15bd6de 100644
--- a/src/gui/widgets/popup.cpp
+++ b/src/gui/widgets/popup.cpp
@@ -100,7 +100,7 @@ void Popup::setWindowContainer(WindowContainer *const wc)
windowContainer = wc;
}
-void Popup::draw(Graphics *graphics)
+void Popup::draw(Graphics *const graphics)
{
BLOCK_START("Popup::draw")
@@ -124,7 +124,7 @@ void Popup::draw(Graphics *graphics)
BLOCK_END("Popup::draw")
}
-void Popup::safeDraw(Graphics *graphics)
+void Popup::safeDraw(Graphics *const graphics)
{
BLOCK_START("Popup::safeDraw")
diff --git a/src/gui/widgets/popup.h b/src/gui/widgets/popup.h
index 60de2f264..bf09e4a51 100644
--- a/src/gui/widgets/popup.h
+++ b/src/gui/widgets/popup.h
@@ -76,9 +76,9 @@ class Popup notfinal : public Container,
/**
* Draws the popup.
*/
- void draw(Graphics *graphics) override A_NONNULL(2);
+ void draw(Graphics *const graphics) override A_NONNULL(2);
- void safeDraw(Graphics *graphics) override A_NONNULL(2);
+ void safeDraw(Graphics *const graphics) override A_NONNULL(2);
/**
* Sets the size of this popup.
diff --git a/src/gui/widgets/popuplist.cpp b/src/gui/widgets/popuplist.cpp
index a0fda7559..3d876b4cf 100644
--- a/src/gui/widgets/popuplist.cpp
+++ b/src/gui/widgets/popuplist.cpp
@@ -101,7 +101,7 @@ void PopupList::widgetResized(const Event &event)
adjustSize();
}
-void PopupList::setSelected(int selected)
+void PopupList::setSelected(const int selected)
{
if (!mListBox)
return;
diff --git a/src/gui/widgets/popuplist.h b/src/gui/widgets/popuplist.h
index 8af5c4ce8..e6fa74d83 100644
--- a/src/gui/widgets/popuplist.h
+++ b/src/gui/widgets/popuplist.h
@@ -53,7 +53,7 @@ class PopupList final : public Popup,
void widgetResized(const Event &event) override final;
- void setSelected(int selected);
+ void setSelected(const int selected);
int getSelected() const;
diff --git a/src/gui/widgets/progressbar.cpp b/src/gui/widgets/progressbar.cpp
index 455ccc31c..bb0824aaa 100644
--- a/src/gui/widgets/progressbar.cpp
+++ b/src/gui/widgets/progressbar.cpp
@@ -151,7 +151,7 @@ void ProgressBar::updateAlpha()
mAlpha = alpha;
}
-void ProgressBar::draw(Graphics *graphics)
+void ProgressBar::draw(Graphics *const graphics)
{
BLOCK_START("ProgressBar::draw")
if (!mSkin)
@@ -230,7 +230,7 @@ void ProgressBar::draw(Graphics *graphics)
BLOCK_END("ProgressBar::draw")
}
-void ProgressBar::safeDraw(Graphics *graphics)
+void ProgressBar::safeDraw(Graphics *const graphics)
{
BLOCK_START("ProgressBar::safeDraw")
if (!mSkin)
diff --git a/src/gui/widgets/progressbar.h b/src/gui/widgets/progressbar.h
index c90940ebc..289633f3d 100644
--- a/src/gui/widgets/progressbar.h
+++ b/src/gui/widgets/progressbar.h
@@ -73,9 +73,9 @@ class ProgressBar final : public Widget,
/**
* Draws the progress bar.
*/
- void draw(Graphics *graphics) override final A_NONNULL(2);
+ void draw(Graphics *const graphics) override final A_NONNULL(2);
- void safeDraw(Graphics *graphics) override final A_NONNULL(2);
+ void safeDraw(Graphics *const graphics) override final A_NONNULL(2);
/**
* Sets the current progress.
diff --git a/src/gui/widgets/progressindicator.cpp b/src/gui/widgets/progressindicator.cpp
index a01557217..7c633e377 100644
--- a/src/gui/widgets/progressindicator.cpp
+++ b/src/gui/widgets/progressindicator.cpp
@@ -32,7 +32,7 @@
#include "debug.h"
-ProgressIndicator::ProgressIndicator(Widget2 *const widget) :
+ProgressIndicator::ProgressIndicator(const Widget2 *const widget) :
Widget(widget),
mIndicator(nullptr)
{
@@ -42,8 +42,12 @@ ProgressIndicator::ProgressIndicator(Widget2 *const widget) :
if (images)
{
Animation *const anim = new Animation;
- for (ImageSet::size_type i = 0, sz = images->size(); i < sz; ++i)
- anim->addFrame(images->get(i), 100, 0, 0, 100);
+ for (ImageSet::size_type i = 0, fsz = images->size();
+ i < fsz;
+ ++i)
+ {
+ anim->addFrame(images->get(i), 100, 0, 0, 100);
+ }
mIndicator = new SimpleAnimation(anim);
images->decRef();
}
@@ -67,7 +71,7 @@ void ProgressIndicator::logic()
BLOCK_END("ProgressIndicator::logic")
}
-void ProgressIndicator::draw(Graphics *graphics)
+void ProgressIndicator::draw(Graphics *const graphics)
{
BLOCK_START("ProgressIndicator::draw")
if (mIndicator)
@@ -80,7 +84,7 @@ void ProgressIndicator::draw(Graphics *graphics)
BLOCK_END("ProgressIndicator::draw")
}
-void ProgressIndicator::safeDraw(Graphics *graphics)
+void ProgressIndicator::safeDraw(Graphics *const graphics)
{
BLOCK_START("ProgressIndicator::draw")
if (mIndicator)
diff --git a/src/gui/widgets/progressindicator.h b/src/gui/widgets/progressindicator.h
index fec26dbcc..773750365 100644
--- a/src/gui/widgets/progressindicator.h
+++ b/src/gui/widgets/progressindicator.h
@@ -35,7 +35,7 @@ class SimpleAnimation;
class ProgressIndicator final : public Widget
{
public:
- explicit ProgressIndicator(Widget2 *const widget);
+ explicit ProgressIndicator(const Widget2 *const widget);
A_DELETE_COPY(ProgressIndicator)
@@ -43,9 +43,9 @@ class ProgressIndicator final : public Widget
void logic() override final;
- void draw(Graphics *graphics) override final A_NONNULL(2);
+ void draw(Graphics *const graphics) override final A_NONNULL(2);
- void safeDraw(Graphics *graphics) override final A_NONNULL(2);
+ void safeDraw(Graphics *const graphics) override final A_NONNULL(2);
private:
SimpleAnimation *mIndicator;
diff --git a/src/gui/widgets/radiobutton.cpp b/src/gui/widgets/radiobutton.cpp
index 89b9b2341..d0583a7c8 100644
--- a/src/gui/widgets/radiobutton.cpp
+++ b/src/gui/widgets/radiobutton.cpp
@@ -177,7 +177,7 @@ void RadioButton::updateAlpha()
}
}
-void RadioButton::drawBox(Graphics* graphics)
+void RadioButton::drawBox(Graphics *const graphics)
{
if (!mSkin)
return;
@@ -222,7 +222,7 @@ void RadioButton::drawBox(Graphics* graphics)
}
}
-void RadioButton::draw(Graphics* graphics)
+void RadioButton::draw(Graphics *const graphics)
{
BLOCK_START("RadioButton::draw")
drawBox(graphics);
@@ -247,7 +247,7 @@ void RadioButton::draw(Graphics* graphics)
BLOCK_END("RadioButton::draw")
}
-void RadioButton::safeDraw(Graphics* graphics)
+void RadioButton::safeDraw(Graphics *const graphics)
{
RadioButton::draw(graphics);
}
diff --git a/src/gui/widgets/radiobutton.h b/src/gui/widgets/radiobutton.h
index fe09ce921..79f1aefae 100644
--- a/src/gui/widgets/radiobutton.h
+++ b/src/gui/widgets/radiobutton.h
@@ -106,15 +106,15 @@ class RadioButton final : public Widget,
/**
* Draws the radiobutton, not the caption.
*/
- void drawBox(Graphics* graphics) A_NONNULL(2);
+ void drawBox(Graphics *const graphics) A_NONNULL(2);
/**
* Implementation of the draw methods.
* Thus, avoiding the rhomb around the radio button.
*/
- void draw(Graphics* graphics) override final A_NONNULL(2);
+ void draw(Graphics *const graphics) override final A_NONNULL(2);
- void safeDraw(Graphics* graphics) override final A_NONNULL(2);
+ void safeDraw(Graphics *const graphics) override final A_NONNULL(2);
/**
* Called when the mouse enteres the widget area.
diff --git a/src/gui/widgets/scrollarea.cpp b/src/gui/widgets/scrollarea.cpp
index d515f3c66..11a9905d4 100644
--- a/src/gui/widgets/scrollarea.cpp
+++ b/src/gui/widgets/scrollarea.cpp
@@ -311,7 +311,7 @@ void ScrollArea::updateAlpha()
}
}
-void ScrollArea::draw(Graphics *graphics)
+void ScrollArea::draw(Graphics *const graphics)
{
BLOCK_START("ScrollArea::draw")
if (mVBarVisible || mHBarVisible)
@@ -365,7 +365,7 @@ void ScrollArea::draw(Graphics *graphics)
BLOCK_END("ScrollArea::draw")
}
-void ScrollArea::safeDraw(Graphics *graphics)
+void ScrollArea::safeDraw(Graphics *const graphics)
{
BLOCK_START("ScrollArea::draw")
if (mVBarVisible)
@@ -423,7 +423,7 @@ void ScrollArea::updateCalcFlag(Graphics *const graphics)
}
}
-void ScrollArea::drawFrame(Graphics *graphics)
+void ScrollArea::drawFrame(Graphics *const graphics)
{
BLOCK_START("ScrollArea::drawFrame")
if (mOpaque)
@@ -448,7 +448,7 @@ void ScrollArea::drawFrame(Graphics *graphics)
BLOCK_END("ScrollArea::drawFrame")
}
-void ScrollArea::safeDrawFrame(Graphics *graphics)
+void ScrollArea::safeDrawFrame(Graphics *const graphics)
{
BLOCK_START("ScrollArea::drawFrame")
if (mOpaque)
diff --git a/src/gui/widgets/scrollarea.h b/src/gui/widgets/scrollarea.h
index 49c7617e3..cf02e0317 100644
--- a/src/gui/widgets/scrollarea.h
+++ b/src/gui/widgets/scrollarea.h
@@ -137,16 +137,17 @@ class ScrollArea final : public BasicContainer,
/**
* Draws the scroll area.
*/
- void draw(Graphics *graphics) override final A_NONNULL(2);
+ void draw(Graphics *const graphics) override final A_NONNULL(2);
- void safeDraw(Graphics *graphics) override final A_NONNULL(2);
+ void safeDraw(Graphics *const graphics) override final A_NONNULL(2);
/**
* Draws the background and border of the scroll area.
*/
- void drawFrame(Graphics *graphics) override final A_NONNULL(2);
+ void drawFrame(Graphics *const graphics) override final A_NONNULL(2);
- void safeDrawFrame(Graphics *graphics) override final A_NONNULL(2);
+ void safeDrawFrame(Graphics *const graphics) override final
+ A_NONNULL(2);
/**
* Sets whether the widget should draw its background or not.
diff --git a/src/gui/widgets/serverslistbox.h b/src/gui/widgets/serverslistbox.h
index 444e70c9b..ff3262296 100644
--- a/src/gui/widgets/serverslistbox.h
+++ b/src/gui/widgets/serverslistbox.h
@@ -43,7 +43,7 @@ class ServersListBox final : public ListBox
mHighlightColor = getThemeColor(ThemeColorId::HIGHLIGHT);
}
- void draw(Graphics *graphics) override final A_NONNULL(2)
+ void draw(Graphics *const graphics) override final A_NONNULL(2)
{
if (!mListModel)
return;
@@ -140,7 +140,7 @@ class ServersListBox final : public ListBox
}
}
- void safeDraw(Graphics *graphics) override final A_NONNULL(2)
+ void safeDraw(Graphics *const graphics) override final A_NONNULL(2)
{
ServersListBox::draw(graphics);
}
diff --git a/src/gui/widgets/setupquickitem.cpp b/src/gui/widgets/setupquickitem.cpp
index f86a121c6..db7edabf7 100644
--- a/src/gui/widgets/setupquickitem.cpp
+++ b/src/gui/widgets/setupquickitem.cpp
@@ -32,8 +32,8 @@
SetupQuickItem::SetupQuickItem(const std::string &restrict description,
SetupTabScroll *restrict const parent,
const std::string &restrict eventName,
- ModifierGetFuncPtr getFunc,
- ModifierChangeFuncPtr changeFunc) :
+ const ModifierGetFuncPtr getFunc,
+ const ModifierChangeFuncPtr changeFunc) :
SetupItem("", description, "", parent, eventName, MainConfig_false),
mHorizont(nullptr),
mButton(nullptr),
diff --git a/src/gui/widgets/shoplistbox.cpp b/src/gui/widgets/shoplistbox.cpp
index 6dd871825..2a515b2e9 100644
--- a/src/gui/widgets/shoplistbox.cpp
+++ b/src/gui/widgets/shoplistbox.cpp
@@ -79,7 +79,7 @@ void ShopListBox::setPlayersMoney(const int money)
mPlayerMoney = money;
}
-void ShopListBox::draw(Graphics *graphics)
+void ShopListBox::draw(Graphics *const graphics)
{
BLOCK_START("ShopListBox::draw")
if (!mListModel || !mShopItems)
@@ -177,7 +177,7 @@ void ShopListBox::draw(Graphics *graphics)
BLOCK_END("ShopListBox::draw")
}
-void ShopListBox::safeDraw(Graphics *graphics)
+void ShopListBox::safeDraw(Graphics *const graphics)
{
ShopListBox::draw(graphics);
}
diff --git a/src/gui/widgets/shoplistbox.h b/src/gui/widgets/shoplistbox.h
index cb02a7a90..cc4504c82 100644
--- a/src/gui/widgets/shoplistbox.h
+++ b/src/gui/widgets/shoplistbox.h
@@ -55,9 +55,9 @@ class ShopListBox final : public ListBox
/**
* Draws the list box.
*/
- void draw(Graphics *graphics) override final A_NONNULL(2);
+ void draw(Graphics *const graphics) override final A_NONNULL(2);
- void safeDraw(Graphics *graphics) override final A_NONNULL(2);
+ void safeDraw(Graphics *const graphics) override final A_NONNULL(2);
/**
* gives information about the current player's money
diff --git a/src/gui/widgets/shortcutcontainer.cpp b/src/gui/widgets/shortcutcontainer.cpp
index 8470d0b57..c173dc97e 100644
--- a/src/gui/widgets/shortcutcontainer.cpp
+++ b/src/gui/widgets/shortcutcontainer.cpp
@@ -118,7 +118,7 @@ int ShortcutContainer::getIndexFromGrid(const int pointX,
return index;
}
-void ShortcutContainer::drawBackground(Graphics *g)
+void ShortcutContainer::drawBackground(Graphics *const g)
{
if (mBackgroundImg)
{
@@ -138,7 +138,7 @@ void ShortcutContainer::drawBackground(Graphics *g)
}
}
-void ShortcutContainer::safeDrawBackground(Graphics *g)
+void ShortcutContainer::safeDrawBackground(Graphics *const g)
{
if (mBackgroundImg)
{
diff --git a/src/gui/widgets/shortcutcontainer.h b/src/gui/widgets/shortcutcontainer.h
index a87a7cef7..d56f74f6f 100644
--- a/src/gui/widgets/shortcutcontainer.h
+++ b/src/gui/widgets/shortcutcontainer.h
@@ -86,9 +86,9 @@ class ShortcutContainer notfinal : public Widget,
int getBoxHeight() const A_WARN_UNUSED
{ return mBoxHeight; }
- void drawBackground(Graphics *g) A_NONNULL(2);
+ void drawBackground(Graphics *const g) A_NONNULL(2);
- void safeDrawBackground(Graphics *g) A_NONNULL(2);
+ void safeDrawBackground(Graphics *const g) A_NONNULL(2);
protected:
/**
diff --git a/src/gui/widgets/skilllistbox.h b/src/gui/widgets/skilllistbox.h
index e0d1b2d91..41994e10a 100644
--- a/src/gui/widgets/skilllistbox.h
+++ b/src/gui/widgets/skilllistbox.h
@@ -85,7 +85,7 @@ class SkillListBox final : public ListBox
return static_cast<SkillModel*>(mListModel)->getSkillAt(selected);
}
- void draw(Graphics *graphics) override final A_NONNULL(2)
+ void draw(Graphics *const graphics) override final A_NONNULL(2)
{
if (!mListModel)
return;
@@ -169,7 +169,7 @@ class SkillListBox final : public ListBox
}
}
- void safeDraw(Graphics *graphics) override final A_NONNULL(2)
+ void safeDraw(Graphics *const graphics) override final A_NONNULL(2)
{
SkillListBox::draw(graphics);
}
diff --git a/src/gui/widgets/slider.cpp b/src/gui/widgets/slider.cpp
index d642354bc..f885b5e7d 100644
--- a/src/gui/widgets/slider.cpp
+++ b/src/gui/widgets/slider.cpp
@@ -185,7 +185,7 @@ void Slider::updateAlpha()
}
}
-void Slider::draw(Graphics *graphics)
+void Slider::draw(Graphics *const graphics)
{
BLOCK_START("Slider::draw")
if (!buttons[0].grid[HSTART] || !buttons[1].grid[HSTART]
@@ -283,7 +283,7 @@ void Slider::draw(Graphics *graphics)
BLOCK_END("Slider::draw")
}
-void Slider::safeDraw(Graphics *graphics)
+void Slider::safeDraw(Graphics *const graphics)
{
BLOCK_START("Slider::draw")
if (!buttons[0].grid[HSTART] || !buttons[1].grid[HSTART]
diff --git a/src/gui/widgets/slider.h b/src/gui/widgets/slider.h
index 87e788098..db3dc346c 100644
--- a/src/gui/widgets/slider.h
+++ b/src/gui/widgets/slider.h
@@ -125,9 +125,9 @@ class Slider final : public Widget,
/**
* Draws the slider.
*/
- void draw(Graphics *graphics) override final A_NONNULL(2);
+ void draw(Graphics *const graphics) override final A_NONNULL(2);
- void safeDraw(Graphics *graphics) override final A_NONNULL(2);
+ void safeDraw(Graphics *const graphics) override final A_NONNULL(2);
/**
* Called when the mouse enteres the widget area.
diff --git a/src/gui/widgets/sliderlist.cpp b/src/gui/widgets/sliderlist.cpp
index dc2cba7b8..0d4332d85 100644
--- a/src/gui/widgets/sliderlist.cpp
+++ b/src/gui/widgets/sliderlist.cpp
@@ -107,7 +107,7 @@ void SliderList::resize()
updateLabel();
}
-void SliderList::draw(Graphics *graphics)
+void SliderList::draw(Graphics *const graphics)
{
BLOCK_START("SliderList::draw")
const int width = mDimension.width;
@@ -120,7 +120,7 @@ void SliderList::draw(Graphics *graphics)
BLOCK_END("SliderList::draw")
}
-void SliderList::safeDraw(Graphics *graphics)
+void SliderList::safeDraw(Graphics *const graphics)
{
BLOCK_START("SliderList::draw")
const int width = mDimension.width;
diff --git a/src/gui/widgets/sliderlist.h b/src/gui/widgets/sliderlist.h
index 6289d381a..622fa95dc 100644
--- a/src/gui/widgets/sliderlist.h
+++ b/src/gui/widgets/sliderlist.h
@@ -55,9 +55,9 @@ class SliderList final : public Container,
void resize();
- void draw(Graphics *graphics) override final A_NONNULL(2);
+ void draw(Graphics *const graphics) override final A_NONNULL(2);
- void safeDraw(Graphics *graphics) override final A_NONNULL(2);
+ void safeDraw(Graphics *const graphics) override final A_NONNULL(2);
void action(const ActionEvent &event) override final;
diff --git a/src/gui/widgets/spellshortcutcontainer.cpp b/src/gui/widgets/spellshortcutcontainer.cpp
index 4b67977dd..db257ecd8 100644
--- a/src/gui/widgets/spellshortcutcontainer.cpp
+++ b/src/gui/widgets/spellshortcutcontainer.cpp
@@ -63,7 +63,7 @@ void SpellShortcutContainer::setWidget2(const Widget2 *const widget)
mForegroundColor2 = getThemeColor(ThemeColorId::TEXT_OUTLINE);
}
-void SpellShortcutContainer::draw(Graphics *graphics)
+void SpellShortcutContainer::draw(Graphics *const graphics)
{
if (!spellShortcut)
return;
@@ -123,7 +123,7 @@ void SpellShortcutContainer::draw(Graphics *graphics)
BLOCK_END("SpellShortcutContainer::draw")
}
-void SpellShortcutContainer::safeDraw(Graphics *graphics)
+void SpellShortcutContainer::safeDraw(Graphics *const graphics)
{
if (!spellShortcut)
return;
diff --git a/src/gui/widgets/spellshortcutcontainer.h b/src/gui/widgets/spellshortcutcontainer.h
index 2ba25f551..3a044a79f 100644
--- a/src/gui/widgets/spellshortcutcontainer.h
+++ b/src/gui/widgets/spellshortcutcontainer.h
@@ -49,9 +49,9 @@ class SpellShortcutContainer final : public ShortcutContainer
/**
* Draws the items.
*/
- void draw(Graphics *graphics) override final A_NONNULL(2);
+ void draw(Graphics *const graphics) override final A_NONNULL(2);
- void safeDraw(Graphics *graphics) override final A_NONNULL(2);
+ void safeDraw(Graphics *const graphics) override final A_NONNULL(2);
/**
* Handles mouse when dragged.
diff --git a/src/gui/widgets/tabbedarea.cpp b/src/gui/widgets/tabbedarea.cpp
index aea5bf252..2d1acc5fc 100644
--- a/src/gui/widgets/tabbedarea.cpp
+++ b/src/gui/widgets/tabbedarea.cpp
@@ -175,7 +175,7 @@ Tab *TabbedArea::getTab(const std::string &name) const
return nullptr;
}
-void TabbedArea::draw(Graphics *graphics)
+void TabbedArea::draw(Graphics *const graphics)
{
BLOCK_START("TabbedArea::draw")
if (mTabs.empty())
@@ -188,7 +188,7 @@ void TabbedArea::draw(Graphics *graphics)
BLOCK_END("TabbedArea::draw")
}
-void TabbedArea::safeDraw(Graphics *graphics)
+void TabbedArea::safeDraw(Graphics *const graphics)
{
BLOCK_START("TabbedArea::draw")
if (mTabs.empty())
@@ -421,8 +421,9 @@ void TabbedArea::setSelectedTab(Tab *const tab)
int TabbedArea::getSelectedTabIndex() const
{
- for (unsigned int i = 0, sz = CAST_U32(mTabs.size());
- i < sz; i++)
+ for (unsigned int i = 0, fsz = CAST_U32(mTabs.size());
+ i < fsz;
+ i++)
{
if (mTabs[i].first == mSelectedTab)
return i;
@@ -709,24 +710,28 @@ void TabbedArea::removeAll(const bool del)
void TabbedArea::setWidth(int width)
{
+ // +++ need use virtual
Widget::setWidth(width);
adjustSize();
}
void TabbedArea::setHeight(int height)
{
+ // +++ need use virtual
Widget::setHeight(height);
adjustSize();
}
void TabbedArea::setSize(int width, int height)
{
+ // +++ need use virtual
Widget::setSize(width, height);
adjustSize();
}
void TabbedArea::setDimension(const Rect &dimension)
{
+ // +++ need use virtual
Widget::setDimension(dimension);
adjustSize();
}
diff --git a/src/gui/widgets/tabbedarea.h b/src/gui/widgets/tabbedarea.h
index c14fb837f..083f178f7 100644
--- a/src/gui/widgets/tabbedarea.h
+++ b/src/gui/widgets/tabbedarea.h
@@ -102,9 +102,9 @@ class TabbedArea final : public ActionListener,
/**
* Draw the tabbed area.
*/
- void draw(Graphics *graphics) override final A_NONNULL(2);
+ void draw(Graphics *const graphics) override final A_NONNULL(2);
- void safeDraw(Graphics *graphics) override final A_NONNULL(2);
+ void safeDraw(Graphics *const graphics) override final A_NONNULL(2);
/**
* Return how many tabs have been created.
diff --git a/src/gui/widgets/tabs/tab.cpp b/src/gui/widgets/tabs/tab.cpp
index 93d2c72d8..7f5c26c8f 100644
--- a/src/gui/widgets/tabs/tab.cpp
+++ b/src/gui/widgets/tabs/tab.cpp
@@ -204,7 +204,7 @@ void Tab::updateAlpha()
}
}
-void Tab::draw(Graphics *graphics)
+void Tab::draw(Graphics *const graphics)
{
BLOCK_START("Tab::draw")
int mode = TAB_STANDARD;
@@ -307,7 +307,7 @@ void Tab::draw(Graphics *graphics)
BLOCK_END("Tab::draw")
}
-void Tab::safeDraw(Graphics *graphics)
+void Tab::safeDraw(Graphics *const graphics)
{
BLOCK_START("Tab::draw")
int mode = TAB_STANDARD;
diff --git a/src/gui/widgets/tabs/tab.h b/src/gui/widgets/tabs/tab.h
index dfa126b90..d32cc176c 100644
--- a/src/gui/widgets/tabs/tab.h
+++ b/src/gui/widgets/tabs/tab.h
@@ -109,9 +109,9 @@ class Tab notfinal : public BasicContainer,
/**
* Draw the tabbed area.
*/
- void draw(Graphics *graphics) override final A_NONNULL(2);
+ void draw(Graphics *const graphics) override final A_NONNULL(2);
- void safeDraw(Graphics *graphics) override final A_NONNULL(2);
+ void safeDraw(Graphics *const graphics) override final A_NONNULL(2);
/**
* Set the normal color for the tab's text.
diff --git a/src/gui/widgets/textbox.cpp b/src/gui/widgets/textbox.cpp
index 8478e767e..d1c10be67 100644
--- a/src/gui/widgets/textbox.cpp
+++ b/src/gui/widgets/textbox.cpp
@@ -437,7 +437,7 @@ void TextBox::keyPressed(KeyEvent& event)
event.consume();
}
-void TextBox::draw(Graphics* graphics)
+void TextBox::draw(Graphics *const graphics)
{
BLOCK_START("TextBox::draw")
if (mOpaque)
@@ -468,7 +468,7 @@ void TextBox::draw(Graphics* graphics)
BLOCK_END("TextBox::draw")
}
-void TextBox::safeDraw(Graphics* graphics)
+void TextBox::safeDraw(Graphics *const graphics)
{
TextBox::draw(graphics);
}
@@ -514,8 +514,9 @@ void TextBox::setTextRow(const int row, const std::string& text)
void TextBox::setCaretPosition(unsigned int position)
{
- for (int row = 0, sz = CAST_S32(mTextRows.size());
- row < sz; row ++)
+ for (int row = 0, fsz = CAST_S32(mTextRows.size());
+ row < fsz;
+ row ++)
{
if (position <= mTextRows[row].size())
{
@@ -619,7 +620,9 @@ void TextBox::mouseDragged(MouseEvent& event)
event.consume();
}
-void TextBox::drawCaret(Graphics *const graphics, const int x, const int y)
+void TextBox::drawCaret(Graphics *const graphics,
+ const int x,
+ const int y) const
{
graphics->setColor(mForegroundColor);
graphics->drawLine(x, getFont()->getHeight() + y, x, y);
diff --git a/src/gui/widgets/textbox.h b/src/gui/widgets/textbox.h
index bdeca3c5d..10a76c85d 100644
--- a/src/gui/widgets/textbox.h
+++ b/src/gui/widgets/textbox.h
@@ -107,9 +107,9 @@ class TextBox final : public Widget,
void keyPressed(KeyEvent& event) override final;
- void draw(Graphics* graphics) override final A_NONNULL(2);
+ void draw(Graphics *const graphics) override final A_NONNULL(2);
- void safeDraw(Graphics* graphics) override final A_NONNULL(2);
+ void safeDraw(Graphics *const graphics) override final A_NONNULL(2);
void setForegroundColor(const Color &color);
@@ -289,7 +289,7 @@ class TextBox final : public Widget,
*/
void drawCaret(Graphics *const graphics,
const int x,
- const int y) A_NONNULL(2);
+ const int y) const A_NONNULL(2);
/**
* Adjusts the text box's size to fit the text.
diff --git a/src/gui/widgets/textfield.cpp b/src/gui/widgets/textfield.cpp
index 291a5fa22..f9fec2852 100644
--- a/src/gui/widgets/textfield.cpp
+++ b/src/gui/widgets/textfield.cpp
@@ -197,7 +197,7 @@ void TextField::updateAlpha()
}
}
-void TextField::draw(Graphics *graphics)
+void TextField::draw(Graphics *const graphics)
{
BLOCK_START("TextField::draw")
updateAlpha();
@@ -227,12 +227,12 @@ void TextField::draw(Graphics *graphics)
BLOCK_END("TextField::draw")
}
-void TextField::safeDraw(Graphics *graphics)
+void TextField::safeDraw(Graphics *const graphics)
{
TextField::draw(graphics);
}
-void TextField::drawFrame(Graphics *graphics)
+void TextField::drawFrame(Graphics *const graphics)
{
BLOCK_START("TextField::drawFrame")
const int bs = 2 * mFrameSize;
@@ -244,7 +244,7 @@ void TextField::drawFrame(Graphics *graphics)
BLOCK_END("TextField::drawFrame")
}
-void TextField::safeDrawFrame(Graphics *graphics)
+void TextField::safeDrawFrame(Graphics *const graphics)
{
BLOCK_START("TextField::drawFrame")
const int bs = 2 * mFrameSize;
diff --git a/src/gui/widgets/textfield.h b/src/gui/widgets/textfield.h
index 90fb0b571..89606d27c 100644
--- a/src/gui/widgets/textfield.h
+++ b/src/gui/widgets/textfield.h
@@ -107,9 +107,9 @@ class TextField notfinal : public Widget,
/**
* Draws the text field.
*/
- void draw(Graphics *graphics) override A_NONNULL(2);
+ void draw(Graphics *const graphics) override A_NONNULL(2);
- void safeDraw(Graphics *graphics) override A_NONNULL(2);
+ void safeDraw(Graphics *const graphics) override A_NONNULL(2);
/**
* Update the alpha value to the graphic components.
@@ -119,9 +119,10 @@ class TextField notfinal : public Widget,
/**
* Draws the background and border.
*/
- void drawFrame(Graphics *graphics) override final A_NONNULL(2);
+ void drawFrame(Graphics *const graphics) override final A_NONNULL(2);
- void safeDrawFrame(Graphics *graphics) override final A_NONNULL(2);
+ void safeDrawFrame(Graphics *const graphics) override final
+ A_NONNULL(2);
/**
* Determine whether the field should be numeric or not
diff --git a/src/gui/widgets/textpreview.cpp b/src/gui/widgets/textpreview.cpp
index 6e61a16a5..63b26e444 100644
--- a/src/gui/widgets/textpreview.cpp
+++ b/src/gui/widgets/textpreview.cpp
@@ -79,7 +79,7 @@ TextPreview::~TextPreview()
}
}
-void TextPreview::draw(Graphics* graphics)
+void TextPreview::draw(Graphics *const graphics)
{
if (!mFont)
return;
@@ -138,7 +138,7 @@ void TextPreview::draw(Graphics* graphics)
BLOCK_END("TextPreview::draw")
}
-void TextPreview::safeDraw(Graphics* graphics)
+void TextPreview::safeDraw(Graphics *const graphics)
{
TextPreview::draw(graphics);
}
diff --git a/src/gui/widgets/textpreview.h b/src/gui/widgets/textpreview.h
index 01953b9c1..e32b911e7 100644
--- a/src/gui/widgets/textpreview.h
+++ b/src/gui/widgets/textpreview.h
@@ -100,9 +100,9 @@ class TextPreview final : public Widget
*
* @param graphics graphics to draw into
*/
- void draw(Graphics *graphics) override final A_NONNULL(2);
+ void draw(Graphics *const graphics) override final A_NONNULL(2);
- void safeDraw(Graphics *graphics) override final A_NONNULL(2);
+ void safeDraw(Graphics *const graphics) override final A_NONNULL(2);
/**
* Set opacity for this widget (whether or not to show the background
diff --git a/src/gui/widgets/virtshortcutcontainer.cpp b/src/gui/widgets/virtshortcutcontainer.cpp
index c57722596..7ed1eb0d1 100644
--- a/src/gui/widgets/virtshortcutcontainer.cpp
+++ b/src/gui/widgets/virtshortcutcontainer.cpp
@@ -71,7 +71,7 @@ void VirtShortcutContainer::setWidget2(const Widget2 *const widget)
mUnEquipedColor2 = getThemeColor(ThemeColorId::ITEM_NOT_EQUIPPED_OUTLINE);
}
-void VirtShortcutContainer::draw(Graphics *graphics)
+void VirtShortcutContainer::draw(Graphics *const graphics)
{
if (!mShortcut)
return;
@@ -145,7 +145,7 @@ void VirtShortcutContainer::draw(Graphics *graphics)
BLOCK_END("VirtShortcutContainer::draw")
}
-void VirtShortcutContainer::safeDraw(Graphics *graphics)
+void VirtShortcutContainer::safeDraw(Graphics *const graphics)
{
if (!mShortcut)
return;
diff --git a/src/gui/widgets/virtshortcutcontainer.h b/src/gui/widgets/virtshortcutcontainer.h
index e93abfdc0..a8ee392f9 100644
--- a/src/gui/widgets/virtshortcutcontainer.h
+++ b/src/gui/widgets/virtshortcutcontainer.h
@@ -51,9 +51,9 @@ class VirtShortcutContainer final : public ShortcutContainer
/**
* Draws the items.
*/
- void draw(Graphics *graphics) override final A_NONNULL(2);
+ void draw(Graphics *const graphics) override final A_NONNULL(2);
- void safeDraw(Graphics *graphics) override final A_NONNULL(2);
+ void safeDraw(Graphics *const graphics) override final A_NONNULL(2);
/**
* Handles mouse when dragged.
diff --git a/src/gui/widgets/widget.cpp b/src/gui/widgets/widget.cpp
index 71f9d1260..1ddd2c120 100644
--- a/src/gui/widgets/widget.cpp
+++ b/src/gui/widgets/widget.cpp
@@ -353,7 +353,7 @@ void Widget::distributeWindowResizeEvent()
(*iter)->windowResized();
}
-bool Widget::widgetExists(const Widget* widget)
+bool Widget::widgetExists(const Widget *const widget)
{
return mWidgetsSet.find(const_cast<Widget*>(widget))
!= mWidgetsSet.end();
diff --git a/src/gui/widgets/widget.h b/src/gui/widgets/widget.h
index e69e1c061..b94f81251 100644
--- a/src/gui/widgets/widget.h
+++ b/src/gui/widgets/widget.h
@@ -121,9 +121,9 @@ class Widget notfinal : public Widget2
* @param graphics aA graphics object to draw with.
* @since 0.1.0
*/
- virtual void draw(Graphics* graphics) A_NONNULL(2) = 0;
+ virtual void draw(Graphics *const graphics) A_NONNULL(2) = 0;
- virtual void safeDraw(Graphics* graphics) A_NONNULL(2) = 0;
+ virtual void safeDraw(Graphics *const graphics) A_NONNULL(2) = 0;
/**
* Called when a widget is given a chance to draw a frame around itself.
@@ -721,7 +721,7 @@ class Widget notfinal : public Widget2
* @return True if an instance of the widget exists, false otherwise.
* @since 0.1.0
*/
- static bool widgetExists(const Widget* widget) A_WARN_UNUSED;
+ static bool widgetExists(const Widget *const widget) A_WARN_UNUSED;
/**
* Checks if tab in is enabled. Tab in means that you can set focus
diff --git a/src/gui/widgets/window.cpp b/src/gui/widgets/window.cpp
index 886372035..9de9b431f 100644
--- a/src/gui/widgets/window.cpp
+++ b/src/gui/widgets/window.cpp
@@ -287,7 +287,7 @@ void Window::setWindowContainer(WindowContainer *const wc)
windowContainer = wc;
}
-void Window::draw(Graphics *graphics)
+void Window::draw(Graphics *const graphics)
{
if (!mSkin)
return;
@@ -399,7 +399,7 @@ void Window::draw(Graphics *graphics)
BLOCK_END("Window::draw")
}
-void Window::safeDraw(Graphics *graphics)
+void Window::safeDraw(Graphics *const graphics)
{
if (!mSkin)
return;
diff --git a/src/gui/widgets/window.h b/src/gui/widgets/window.h
index 22378b59a..c5bcb2215 100644
--- a/src/gui/widgets/window.h
+++ b/src/gui/widgets/window.h
@@ -128,9 +128,9 @@ class Window notfinal : public BasicContainer2,
/**
* Draws the window.
*/
- void draw(Graphics *graphics) override A_NONNULL(2);
+ void draw(Graphics *const graphics) override A_NONNULL(2);
- void safeDraw(Graphics *graphics) override A_NONNULL(2);
+ void safeDraw(Graphics *const graphics) override A_NONNULL(2);
/**
* Sets the size of this window.
diff --git a/src/gui/widgets/windowcontainer.cpp b/src/gui/widgets/windowcontainer.cpp
index 830224602..b3f01d0fe 100644
--- a/src/gui/widgets/windowcontainer.cpp
+++ b/src/gui/widgets/windowcontainer.cpp
@@ -95,7 +95,7 @@ void WindowContainer::moveWidgetAfter(Widget *const after,
}
#ifdef USE_PROFILER
-void WindowContainer::draw(Graphics* graphics)
+void WindowContainer::draw(Graphics *const graphics)
{
BLOCK_START("WindowContainer::draw")
Container::draw(graphics);
diff --git a/src/gui/widgets/windowcontainer.h b/src/gui/widgets/windowcontainer.h
index 61fc04ce2..cc9b3c814 100644
--- a/src/gui/widgets/windowcontainer.h
+++ b/src/gui/widgets/windowcontainer.h
@@ -55,7 +55,7 @@ class WindowContainer notfinal : public Container
Widget *const widget);
#ifdef USE_PROFILER
- void draw(Graphics* graphics) override A_NONNULL(2);
+ void draw(Graphics *const graphics) override A_NONNULL(2);
#endif
private: