summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-06-24 01:13:26 +0300
committerAndrei Karas <akaras@inbox.ru>2015-06-24 01:13:26 +0300
commit1498a699f89f7b5aebdc4629c645c3702ee04f92 (patch)
tree24d74cc7efc31ba2447c76ad301e3192e38b4cf4 /src/gui
parentc551f8981eba838d07245d1597e9deaa00427cee (diff)
downloadplus-1498a699f89f7b5aebdc4629c645c3702ee04f92.tar.gz
plus-1498a699f89f7b5aebdc4629c645c3702ee04f92.tar.bz2
plus-1498a699f89f7b5aebdc4629c645c3702ee04f92.tar.xz
plus-1498a699f89f7b5aebdc4629c645c3702ee04f92.zip
Add A_NONNULL attribute to all parameters with class Graphics.
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/fonts/font.h3
-rw-r--r--src/gui/gui.h2
-rw-r--r--src/gui/viewport.h9
-rw-r--r--src/gui/widgets/avatarlistbox.h4
-rw-r--r--src/gui/widgets/basiccontainer2.h4
-rw-r--r--src/gui/widgets/browserbox.h4
-rw-r--r--src/gui/widgets/button.h4
-rw-r--r--src/gui/widgets/checkbox.h6
-rw-r--r--src/gui/widgets/colorpage.h4
-rw-r--r--src/gui/widgets/desktop.h4
-rw-r--r--src/gui/widgets/dropdown.h8
-rw-r--r--src/gui/widgets/emotepage.h4
-rw-r--r--src/gui/widgets/emoteshortcutcontainer.h4
-rw-r--r--src/gui/widgets/extendedlistbox.h4
-rw-r--r--src/gui/widgets/guitable.h4
-rw-r--r--src/gui/widgets/itemcontainer.h4
-rw-r--r--src/gui/widgets/itemshortcutcontainer.h4
-rw-r--r--src/gui/widgets/label.h4
-rw-r--r--src/gui/widgets/listbox.h4
-rw-r--r--src/gui/widgets/passwordfield.h4
-rw-r--r--src/gui/widgets/playerbox.h4
-rw-r--r--src/gui/widgets/popup.h4
-rw-r--r--src/gui/widgets/progressbar.h4
-rw-r--r--src/gui/widgets/progressindicator.h4
-rw-r--r--src/gui/widgets/radiobutton.h4
-rw-r--r--src/gui/widgets/scrollarea.h28
-rw-r--r--src/gui/widgets/serverslistbox.h2
-rw-r--r--src/gui/widgets/shoplistbox.h4
-rw-r--r--src/gui/widgets/skilllistbox.h2
-rw-r--r--src/gui/widgets/slider.h4
-rw-r--r--src/gui/widgets/sliderlist.h4
-rw-r--r--src/gui/widgets/spellshortcutcontainer.h4
-rw-r--r--src/gui/widgets/tabbedarea.h4
-rw-r--r--src/gui/widgets/tabs/tab.h4
-rw-r--r--src/gui/widgets/textbox.h8
-rw-r--r--src/gui/widgets/textfield.h4
-rw-r--r--src/gui/widgets/textpreview.h4
-rw-r--r--src/gui/widgets/virtshortcutcontainer.h4
-rw-r--r--src/gui/widgets/widget.h8
-rw-r--r--src/gui/widgets/window.h4
-rw-r--r--src/gui/widgets/windowcontainer.h2
-rw-r--r--src/gui/windows/chatwindow.h4
-rw-r--r--src/gui/windows/connectiondialog.h4
-rw-r--r--src/gui/windows/debugwindow.h4
-rw-r--r--src/gui/windows/equipmentwindow.h4
-rw-r--r--src/gui/windows/minimap.h6
-rw-r--r--src/gui/windows/ministatuswindow.h4
-rw-r--r--src/gui/windows/outfitwindow.h4
48 files changed, 117 insertions, 111 deletions
diff --git a/src/gui/fonts/font.h b/src/gui/fonts/font.h
index 3da6d9c7d..0188586b3 100644
--- a/src/gui/fonts/font.h
+++ b/src/gui/fonts/font.h
@@ -110,7 +110,8 @@ class Font final
Color col,
const Color &col2,
const std::string &text,
- const int x, const int y);
+ const int x,
+ const int y) A_NONNULL(2);
void clear();
diff --git a/src/gui/gui.h b/src/gui/gui.h
index 8a2935208..a8b862f63 100644
--- a/src/gui/gui.h
+++ b/src/gui/gui.h
@@ -127,7 +127,7 @@ class Gui final
*/
~Gui();
- void postInit(Graphics *const graphics);
+ void postInit(Graphics *const graphics) A_NONNULL(2);
/**
* Performs logic of the GUI. Overridden to track mouse pointer
diff --git a/src/gui/viewport.h b/src/gui/viewport.h
index e459afcae..0963bd394 100644
--- a/src/gui/viewport.h
+++ b/src/gui/viewport.h
@@ -74,9 +74,9 @@ class Viewport final : public WindowContainer,
/**
* Draws the viewport.
*/
- void draw(Graphics *graphics) override final;
+ void draw(Graphics *graphics) override final A_NONNULL(2);
- void safeDraw(Graphics *graphics) override final;
+ void safeDraw(Graphics *graphics) override final A_NONNULL(2);
/**
* Implements player to keep following mouse.
@@ -183,14 +183,15 @@ class Viewport final : public WindowContainer,
* Finds a path from the player to the mouse, and draws it. This is for
* debug purposes.
*/
- void drawDebugPath(Graphics *const graphics);
+ void drawDebugPath(Graphics *const graphics) A_NONNULL(2);
/**
* Draws the given path.
*/
void drawPath(Graphics *const graphics,
const Path &path,
- const Color &color = Color(255, 0, 0)) const;
+ const Color &color = Color(255, 0, 0))
+ const A_NONNULL(2);
bool leftMouseAction();
diff --git a/src/gui/widgets/avatarlistbox.h b/src/gui/widgets/avatarlistbox.h
index 7c59f0924..3040b3261 100644
--- a/src/gui/widgets/avatarlistbox.h
+++ b/src/gui/widgets/avatarlistbox.h
@@ -41,9 +41,9 @@ class AvatarListBox final : public ListBox,
/**
* Draws the list box.
*/
- void draw(Graphics *gcnGraphics) override final;
+ void draw(Graphics *gcnGraphics) override final A_NONNULL(2);
- void safeDraw(Graphics *gcnGraphics) override final;
+ void safeDraw(Graphics *gcnGraphics) override final A_NONNULL(2);
void mousePressed(MouseEvent &event) override final;
diff --git a/src/gui/widgets/basiccontainer2.h b/src/gui/widgets/basiccontainer2.h
index 7243e68d3..dc5a65234 100644
--- a/src/gui/widgets/basiccontainer2.h
+++ b/src/gui/widgets/basiccontainer2.h
@@ -137,9 +137,9 @@ class BasicContainer2: public BasicContainer
// Inherited from Widget
- void draw(Graphics* graphics) override;
+ void draw(Graphics* graphics) override A_NONNULL(2);
- void safeDraw(Graphics* graphics) override;
+ void safeDraw(Graphics* graphics) override A_NONNULL(2);
protected:
/**
diff --git a/src/gui/widgets/browserbox.h b/src/gui/widgets/browserbox.h
index 012c04dd7..a3e7ad7f2 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;
+ void draw(Graphics *graphics) override final A_NONNULL(2);
- void safeDraw(Graphics *graphics) override final;
+ void safeDraw(Graphics *graphics) override final A_NONNULL(2);
void updateHeight();
diff --git a/src/gui/widgets/button.h b/src/gui/widgets/button.h
index 233906d06..a4222c395 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;
+ void draw(Graphics *graphics) override final A_NONNULL(2);
- void safeDraw(Graphics *graphics) override final;
+ void safeDraw(Graphics *graphics) override final A_NONNULL(2);
/**
* Update the alpha value to the button components.
diff --git a/src/gui/widgets/checkbox.h b/src/gui/widgets/checkbox.h
index 2f2fe812d..23b75ddae 100644
--- a/src/gui/widgets/checkbox.h
+++ b/src/gui/widgets/checkbox.h
@@ -109,9 +109,9 @@ class CheckBox final : public Widget,
/**
* Draws the caption, then calls drawBox to draw the check box.
*/
- void draw(Graphics *const graphics) override final;
+ void draw(Graphics *const graphics) override final A_NONNULL(2);
- void safeDraw(Graphics *const graphics) override final;
+ void safeDraw(Graphics *const graphics) override final A_NONNULL(2);
/**
* Update the alpha value to the checkbox components.
@@ -121,7 +121,7 @@ class CheckBox final : public Widget,
/**
* Draws the check box, not the caption.
*/
- void drawBox(Graphics *const graphics);
+ void drawBox(Graphics *const graphics) A_NONNULL(2);
/**
* Called when the mouse enteres the widget area.
diff --git a/src/gui/widgets/colorpage.h b/src/gui/widgets/colorpage.h
index 4863aaa60..7049ef2bc 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;
+ void draw(Graphics *graphics) override final A_NONNULL(2);
- void safeDraw(Graphics *graphics) override final;
+ void safeDraw(Graphics *graphics) override final A_NONNULL(2);
void resetAction();
diff --git a/src/gui/widgets/desktop.h b/src/gui/widgets/desktop.h
index 21da974cd..ec75c588d 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;
+ void draw(Graphics *graphics) override final A_NONNULL(2);
- void safeDraw(Graphics *graphics) override final;
+ void safeDraw(Graphics *graphics) override final A_NONNULL(2);
void postInit() override final;
diff --git a/src/gui/widgets/dropdown.h b/src/gui/widgets/dropdown.h
index aea2752d0..df8e93d49 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;
+ void draw(Graphics *graphics) override final A_NONNULL(2);
- void safeDraw(Graphics *graphics) override final;
+ void safeDraw(Graphics *graphics) override final A_NONNULL(2);
- void drawFrame(Graphics *graphics) override final;
+ void drawFrame(Graphics *graphics) override final A_NONNULL(2);
- void safeDrawFrame(Graphics *graphics) override final;
+ void safeDrawFrame(Graphics *graphics) override final A_NONNULL(2);
// Inherited from KeyListener
diff --git a/src/gui/widgets/emotepage.h b/src/gui/widgets/emotepage.h
index 24d166750..74829c13e 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;
+ void draw(Graphics *graphics) override final A_NONNULL(2);
- void safeDraw(Graphics *graphics) override final;
+ void safeDraw(Graphics *graphics) override final A_NONNULL(2);
void mousePressed(MouseEvent &event) override final;
diff --git a/src/gui/widgets/emoteshortcutcontainer.h b/src/gui/widgets/emoteshortcutcontainer.h
index c1ba76b2b..9dba54e5f 100644
--- a/src/gui/widgets/emoteshortcutcontainer.h
+++ b/src/gui/widgets/emoteshortcutcontainer.h
@@ -49,9 +49,9 @@ class EmoteShortcutContainer final : public ShortcutContainer
/**
* Draws the items.
*/
- void draw(Graphics *graphics) override final;
+ void draw(Graphics *graphics) override final A_NONNULL(2);
- void safeDraw(Graphics *graphics) override final;
+ void safeDraw(Graphics *graphics) override final A_NONNULL(2);
/**
* Handles mouse when dragged.
diff --git a/src/gui/widgets/extendedlistbox.h b/src/gui/widgets/extendedlistbox.h
index aca0ba8a8..3f2e30af4 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;
+ void draw(Graphics *graphics) override final A_NONNULL(2);
- void safeDraw(Graphics *graphics) override final;
+ void safeDraw(Graphics *graphics) override final A_NONNULL(2);
void adjustSize() override;
diff --git a/src/gui/widgets/guitable.h b/src/gui/widgets/guitable.h
index af94c4ec9..ff9342661 100644
--- a/src/gui/widgets/guitable.h
+++ b/src/gui/widgets/guitable.h
@@ -110,9 +110,9 @@ class GuiTable final : public Widget,
{ mLinewiseMode = linewise; }
// Inherited from Widget
- void draw(Graphics* graphics) override final;
+ void draw(Graphics* graphics) override final A_NONNULL(2);
- void safeDraw(Graphics* graphics) override final;
+ void safeDraw(Graphics* graphics) override final A_NONNULL(2);
Widget *getWidgetAt(int x, int y) override final A_WARN_UNUSED;
diff --git a/src/gui/widgets/itemcontainer.h b/src/gui/widgets/itemcontainer.h
index 8b30e5f8b..243104ead 100644
--- a/src/gui/widgets/itemcontainer.h
+++ b/src/gui/widgets/itemcontainer.h
@@ -74,9 +74,9 @@ class ItemContainer final : public Widget,
/**
* Draws the items.
*/
- void draw(Graphics *graphics) override final;
+ void draw(Graphics *graphics) override final A_NONNULL(2);
- void safeDraw(Graphics *graphics) override final;
+ void safeDraw(Graphics *graphics) override final A_NONNULL(2);
// KeyListener
void keyPressed(KeyEvent &event) override final;
diff --git a/src/gui/widgets/itemshortcutcontainer.h b/src/gui/widgets/itemshortcutcontainer.h
index a211941c2..424db2ac3 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;
+ void draw(Graphics *graphics) override final A_NONNULL(2);
- void safeDraw(Graphics *graphics) override final;
+ void safeDraw(Graphics *graphics) override final A_NONNULL(2);
/**
* Handles mouse when dragged.
diff --git a/src/gui/widgets/label.h b/src/gui/widgets/label.h
index bbe49a1e0..fd7e144e0 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;
+ void draw(Graphics *graphics) override final A_NONNULL(2);
- void safeDraw(Graphics *graphics) override final;
+ void safeDraw(Graphics *graphics) override final A_NONNULL(2);
void adjustSize();
diff --git a/src/gui/widgets/listbox.h b/src/gui/widgets/listbox.h
index 9dff11e09..382f56dfe 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;
+ void draw(Graphics *graphics) override A_NONNULL(2);
- void safeDraw(Graphics *graphics) override;
+ void safeDraw(Graphics *graphics) override A_NONNULL(2);
/**
* Update the alpha value to the graphic components.
diff --git a/src/gui/widgets/passwordfield.h b/src/gui/widgets/passwordfield.h
index 0efce0dcf..6b3da5e50 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;
+ void draw(Graphics *graphics) override final A_NONNULL(2);
- void safeDraw(Graphics *graphics) override final;
+ void safeDraw(Graphics *graphics) override final A_NONNULL(2);
protected:
unsigned char mPasswordChar;
diff --git a/src/gui/widgets/playerbox.h b/src/gui/widgets/playerbox.h
index b331b7a1b..ee15f32ba 100644
--- a/src/gui/widgets/playerbox.h
+++ b/src/gui/widgets/playerbox.h
@@ -76,9 +76,9 @@ class PlayerBox final : public Widget,
/**
* Draws the scroll area.
*/
- void draw(Graphics *graphics) override final;
+ void draw(Graphics *graphics) override final A_NONNULL(2);
- void safeDraw(Graphics *graphics) override final;
+ void safeDraw(Graphics *graphics) override final A_NONNULL(2);
/**
* Draws the background and border of the scroll area.
diff --git a/src/gui/widgets/popup.h b/src/gui/widgets/popup.h
index a784990ec..9f043114e 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;
+ void draw(Graphics *graphics) override A_NONNULL(2);
- void safeDraw(Graphics *graphics) override;
+ void safeDraw(Graphics *graphics) override A_NONNULL(2);
/**
* Sets the size of this popup.
diff --git a/src/gui/widgets/progressbar.h b/src/gui/widgets/progressbar.h
index 89ee13e85..4b45f1aab 100644
--- a/src/gui/widgets/progressbar.h
+++ b/src/gui/widgets/progressbar.h
@@ -71,9 +71,9 @@ class ProgressBar final : public Widget,
/**
* Draws the progress bar.
*/
- void draw(Graphics *graphics) override final;
+ void draw(Graphics *graphics) override final A_NONNULL(2);
- void safeDraw(Graphics *graphics) override final;
+ void safeDraw(Graphics *graphics) override final A_NONNULL(2);
/**
* Sets the current progress.
diff --git a/src/gui/widgets/progressindicator.h b/src/gui/widgets/progressindicator.h
index cc278e8a2..6957b6993 100644
--- a/src/gui/widgets/progressindicator.h
+++ b/src/gui/widgets/progressindicator.h
@@ -43,9 +43,9 @@ class ProgressIndicator final : public Widget
void logic() override final;
- void draw(Graphics *graphics) override final;
+ void draw(Graphics *graphics) override final A_NONNULL(2);
- void safeDraw(Graphics *graphics) override final;
+ void safeDraw(Graphics *graphics) override final A_NONNULL(2);
private:
SimpleAnimation *mIndicator;
diff --git a/src/gui/widgets/radiobutton.h b/src/gui/widgets/radiobutton.h
index f1e4748e1..50b000f31 100644
--- a/src/gui/widgets/radiobutton.h
+++ b/src/gui/widgets/radiobutton.h
@@ -112,9 +112,9 @@ class RadioButton final : public Widget,
* Implementation of the draw methods.
* Thus, avoiding the rhomb around the radio button.
*/
- void draw(Graphics* graphics) override final;
+ void draw(Graphics* graphics) override final A_NONNULL(2);
- void safeDraw(Graphics* graphics) override final;
+ void safeDraw(Graphics* graphics) override final A_NONNULL(2);
/**
* Called when the mouse enteres the widget area.
diff --git a/src/gui/widgets/scrollarea.h b/src/gui/widgets/scrollarea.h
index deb24ff79..5d9b2e70b 100644
--- a/src/gui/widgets/scrollarea.h
+++ b/src/gui/widgets/scrollarea.h
@@ -137,9 +137,9 @@ class ScrollArea final : public BasicContainer,
/**
* Draws the scroll area.
*/
- void draw(Graphics *graphics) override final;
+ void draw(Graphics *graphics) override final A_NONNULL(2);
- void safeDraw(Graphics *graphics) override final;
+ void safeDraw(Graphics *graphics) override final A_NONNULL(2);
/**
* Draws the background and border of the scroll area.
@@ -449,21 +449,23 @@ class ScrollArea final : public BasicContainer,
*/
void checkPolicies();
- void drawButton(Graphics *const graphics, const BUTTON_DIR dir);
- void calcButton(Graphics *const graphics, const BUTTON_DIR dir);
- void drawVBar(Graphics *const graphics) const;
- void drawHBar(Graphics *const graphics) const;
- void drawVMarker(Graphics *const graphics);
- void drawHMarker(Graphics *const graphics);
+ void drawButton(Graphics *const graphics,
+ const BUTTON_DIR dir) A_NONNULL(2);
+ void calcButton(Graphics *const graphics,
+ const BUTTON_DIR dir) A_NONNULL(2);
+ void drawVBar(Graphics *const graphics) const A_NONNULL(2);
+ void drawHBar(Graphics *const graphics) const A_NONNULL(2);
+ void drawVMarker(Graphics *const graphics) A_NONNULL(2);
+ void drawHMarker(Graphics *const graphics) A_NONNULL(2);
- void calcVBar(const Graphics *const graphics);
- void calcHBar(const Graphics *const graphics);
- void calcVMarker(Graphics *const graphics);
- void calcHMarker(Graphics *const graphics);
+ void calcVBar(const Graphics *const graphics) A_NONNULL(2);
+ void calcHBar(const Graphics *const graphics) A_NONNULL(2);
+ void calcVMarker(Graphics *const graphics) A_NONNULL(2);
+ void calcHMarker(Graphics *const graphics) A_NONNULL(2);
Image *getImageByState(Rect &dim, const BUTTON_DIR dir);
- void updateCalcFlag(Graphics *const graphics);
+ void updateCalcFlag(Graphics *const graphics) A_NONNULL(2);
static int instances;
static float mAlpha;
diff --git a/src/gui/widgets/serverslistbox.h b/src/gui/widgets/serverslistbox.h
index 5586cf1d1..e15bebb41 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
+ void draw(Graphics *graphics) override final A_NONNULL(2)
{
if (!mListModel)
return;
diff --git a/src/gui/widgets/shoplistbox.h b/src/gui/widgets/shoplistbox.h
index ff7835dd0..d0c230f9d 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;
+ void draw(Graphics *graphics) override final A_NONNULL(2);
- void safeDraw(Graphics *graphics) override final;
+ void safeDraw(Graphics *graphics) override final A_NONNULL(2);
/**
* gives information about the current player's money
diff --git a/src/gui/widgets/skilllistbox.h b/src/gui/widgets/skilllistbox.h
index 4eda139a5..a27c57147 100644
--- a/src/gui/widgets/skilllistbox.h
+++ b/src/gui/widgets/skilllistbox.h
@@ -90,7 +90,7 @@ class SkillListBox final : public ListBox
return static_cast<SkillModel*>(mListModel)->getSkillAt(selected);
}
- void draw(Graphics *graphics) override final
+ void draw(Graphics *graphics) override final A_NONNULL(2)
{
if (!mListModel)
return;
diff --git a/src/gui/widgets/slider.h b/src/gui/widgets/slider.h
index d31c9e9fc..256c64819 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;
+ void draw(Graphics *graphics) override final A_NONNULL(2);
- void safeDraw(Graphics *graphics) override final;
+ void safeDraw(Graphics *graphics) override final A_NONNULL(2);
/**
* Called when the mouse enteres the widget area.
diff --git a/src/gui/widgets/sliderlist.h b/src/gui/widgets/sliderlist.h
index a48ffeb4a..525fd3c92 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;
+ void draw(Graphics *graphics) override final A_NONNULL(2);
- void safeDraw(Graphics *graphics) override final;
+ void safeDraw(Graphics *graphics) override final A_NONNULL(2);
void action(const ActionEvent &event) override final;
diff --git a/src/gui/widgets/spellshortcutcontainer.h b/src/gui/widgets/spellshortcutcontainer.h
index eb2dbec49..21fc0d5b9 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;
+ void draw(Graphics *graphics) override final A_NONNULL(2);
- void safeDraw(Graphics *graphics) override final;
+ void safeDraw(Graphics *graphics) override final A_NONNULL(2);
/**
* Handles mouse when dragged.
diff --git a/src/gui/widgets/tabbedarea.h b/src/gui/widgets/tabbedarea.h
index 3d123f2ec..40ac05753 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;
+ void draw(Graphics *graphics) override final A_NONNULL(2);
- void safeDraw(Graphics *graphics) override final;
+ void safeDraw(Graphics *graphics) override final A_NONNULL(2);
/**
* Return how many tabs have been created.
diff --git a/src/gui/widgets/tabs/tab.h b/src/gui/widgets/tabs/tab.h
index 65ebc57b7..ded1e6709 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;
+ void draw(Graphics *graphics) override final A_NONNULL(2);
- void safeDraw(Graphics *graphics) override final;
+ void safeDraw(Graphics *graphics) override final A_NONNULL(2);
/**
* Set the normal color for the tab's text.
diff --git a/src/gui/widgets/textbox.h b/src/gui/widgets/textbox.h
index 611efd4a0..6fe3aefd9 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;
+ void draw(Graphics* graphics) override final A_NONNULL(2);
- void safeDraw(Graphics* graphics) override final;
+ void safeDraw(Graphics* graphics) override final A_NONNULL(2);
void setForegroundColor(const Color &color);
@@ -287,7 +287,9 @@ class TextBox final : public Widget,
* @param x the x position.
* @param y the y position.
*/
- void drawCaret(Graphics *const graphics, const int x, const int y);
+ void drawCaret(Graphics *const graphics,
+ const int x,
+ const int y) A_NONNULL(2);
/**
* Adjusts the text box's size to fit the text.
diff --git a/src/gui/widgets/textfield.h b/src/gui/widgets/textfield.h
index 0c5335143..75c3d9253 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;
+ void draw(Graphics *graphics) override A_NONNULL(2);
- void safeDraw(Graphics *graphics) override;
+ void safeDraw(Graphics *graphics) override A_NONNULL(2);
/**
* Update the alpha value to the graphic components.
diff --git a/src/gui/widgets/textpreview.h b/src/gui/widgets/textpreview.h
index 62e3d1cd1..f56eac5bb 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;
+ void draw(Graphics *graphics) override final A_NONNULL(2);
- void safeDraw(Graphics *graphics) override final;
+ void safeDraw(Graphics *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.h b/src/gui/widgets/virtshortcutcontainer.h
index 96aea1012..5405c2046 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;
+ void draw(Graphics *graphics) override final A_NONNULL(2);
- void safeDraw(Graphics *graphics) override final;
+ void safeDraw(Graphics *graphics) override final A_NONNULL(2);
/**
* Handles mouse when dragged.
diff --git a/src/gui/widgets/widget.h b/src/gui/widgets/widget.h
index 416782dc2..c5573b404 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) = 0;
+ virtual void draw(Graphics* graphics) A_NONNULL(2) = 0;
- virtual void safeDraw(Graphics* graphics) = 0;
+ virtual void safeDraw(Graphics* graphics) A_NONNULL(2) = 0;
/**
* Called when a widget is given a chance to draw a frame around itself.
@@ -145,10 +145,10 @@ class Widget notfinal : public Widget2
* @see setFrameSize, getFrameSize
* @since 0.8.0
*/
- virtual void drawFrame(Graphics* graphics A_UNUSED)
+ virtual void drawFrame(Graphics* graphics A_UNUSED) A_NONNULL(2)
{ }
- virtual void safeDrawFrame(Graphics* graphics A_UNUSED)
+ virtual void safeDrawFrame(Graphics* graphics A_UNUSED) A_NONNULL(2)
{ }
/**
diff --git a/src/gui/widgets/window.h b/src/gui/widgets/window.h
index e062de671..ae1e922c9 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;
+ void draw(Graphics *graphics) override A_NONNULL(2);
- void safeDraw(Graphics *graphics) override;
+ void safeDraw(Graphics *graphics) override A_NONNULL(2);
/**
* Sets the size of this window.
diff --git a/src/gui/widgets/windowcontainer.h b/src/gui/widgets/windowcontainer.h
index 59fd54af1..6188777d2 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;
+ void draw(Graphics* graphics) override A_NONNULL(2);
#endif
private:
diff --git a/src/gui/windows/chatwindow.h b/src/gui/windows/chatwindow.h
index c5b5aea1a..ea71e4716 100644
--- a/src/gui/windows/chatwindow.h
+++ b/src/gui/windows/chatwindow.h
@@ -280,9 +280,9 @@ class ChatWindow final : public Window,
void mouseExited(MouseEvent& event A_UNUSED) override final;
- void draw(Graphics* graphics) override final;
+ void draw(Graphics* graphics) override final A_NONNULL(2);
- void safeDraw(Graphics* graphics) override final;
+ void safeDraw(Graphics* graphics) override final A_NONNULL(2);
void updateVisibility();
diff --git a/src/gui/windows/connectiondialog.h b/src/gui/windows/connectiondialog.h
index 6fdeeff00..b7318d79f 100644
--- a/src/gui/windows/connectiondialog.h
+++ b/src/gui/windows/connectiondialog.h
@@ -58,9 +58,9 @@ class ConnectionDialog final : public Window,
*/
void action(const ActionEvent &) override final;
- void draw(Graphics *graphics) override final;
+ void draw(Graphics *graphics) override final A_NONNULL(2);
- void safeDraw(Graphics *graphics) override final;
+ void safeDraw(Graphics *graphics) override final A_NONNULL(2);
private:
State mCancelState;
diff --git a/src/gui/windows/debugwindow.h b/src/gui/windows/debugwindow.h
index 5496852f6..0ccbae3a1 100644
--- a/src/gui/windows/debugwindow.h
+++ b/src/gui/windows/debugwindow.h
@@ -54,9 +54,9 @@ class DebugWindow final : public Window
*/
void slowLogic();
- void draw(Graphics *g) override final;
+ void draw(Graphics *g) override final A_NONNULL(2);
- void safeDraw(Graphics *g) override final;
+ void safeDraw(Graphics *g) override final A_NONNULL(2);
void setPing(int pingTime);
diff --git a/src/gui/windows/equipmentwindow.h b/src/gui/windows/equipmentwindow.h
index 6ad9b2fd2..640aa2564 100644
--- a/src/gui/windows/equipmentwindow.h
+++ b/src/gui/windows/equipmentwindow.h
@@ -70,9 +70,9 @@ class EquipmentWindow final : public Window,
/**
* Draws the equipment window.
*/
- void draw(Graphics *graphics) override final;
+ void draw(Graphics *graphics) override final A_NONNULL(2);
- void safeDraw(Graphics *graphics) override final;
+ void safeDraw(Graphics *graphics) override final A_NONNULL(2);
void action(const ActionEvent &event) override final;
diff --git a/src/gui/windows/minimap.h b/src/gui/windows/minimap.h
index 8c7150080..bd9126bba 100644
--- a/src/gui/windows/minimap.h
+++ b/src/gui/windows/minimap.h
@@ -59,11 +59,11 @@ class Minimap final : public Window, public ConfigListener
/**
* Draws the minimap.
*/
- void draw(Graphics *graphics) override final;
+ void draw(Graphics *graphics) override final A_NONNULL(2);
- void safeDraw(Graphics *graphics) override final;
+ void safeDraw(Graphics *graphics) override final A_NONNULL(2);
- void draw2(Graphics *const graphics);
+ void draw2(Graphics *const graphics) A_NONNULL(2);
void mouseMoved(MouseEvent &event) override final;
diff --git a/src/gui/windows/ministatuswindow.h b/src/gui/windows/ministatuswindow.h
index 0146b3f00..c1a93d6d9 100644
--- a/src/gui/windows/ministatuswindow.h
+++ b/src/gui/windows/ministatuswindow.h
@@ -69,9 +69,9 @@ class MiniStatusWindow final : public Window,
void logic() override final;
- void draw(Graphics *graphics) override final;
+ void draw(Graphics *graphics) override final A_NONNULL(2);
- void safeDraw(Graphics *graphics) override final;
+ void safeDraw(Graphics *graphics) override final A_NONNULL(2);
void mouseMoved(MouseEvent &event) override final;
diff --git a/src/gui/windows/outfitwindow.h b/src/gui/windows/outfitwindow.h
index b27bd7d4a..7033a3f13 100644
--- a/src/gui/windows/outfitwindow.h
+++ b/src/gui/windows/outfitwindow.h
@@ -52,9 +52,9 @@ class OutfitWindow final : public Window,
void action(const ActionEvent &event) override final;
- void draw(Graphics *graphics) override final;
+ void draw(Graphics *graphics) override final A_NONNULL(2);
- void safeDraw(Graphics *graphics) override final;
+ void safeDraw(Graphics *graphics) override final A_NONNULL(2);
void mousePressed(MouseEvent &event) override final;