summaryrefslogtreecommitdiff
path: root/src/gui/widgets
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-10-30 13:05:34 +0300
committerAndrei Karas <akaras@inbox.ru>2012-10-30 13:11:34 +0300
commit0cff44ef5c1383a638c30cc9f5f8c81b6b4318f9 (patch)
tree077c2ff59d6656096aa0acaaf4dd6bf4fb7867f7 /src/gui/widgets
parent6b1684d33dec02eb6308bb3d8d3707f4d5252ba5 (diff)
downloadmanaverse-0cff44ef5c1383a638c30cc9f5f8c81b6b4318f9.tar.gz
manaverse-0cff44ef5c1383a638c30cc9f5f8c81b6b4318f9.tar.bz2
manaverse-0cff44ef5c1383a638c30cc9f5f8c81b6b4318f9.tar.xz
manaverse-0cff44ef5c1383a638c30cc9f5f8c81b6b4318f9.zip
Add unused warnings to other files.
Diffstat (limited to 'src/gui/widgets')
-rw-r--r--src/gui/widgets/avatarlistbox.h4
-rw-r--r--src/gui/widgets/battletab.h2
-rw-r--r--src/gui/widgets/browserbox.h18
-rw-r--r--src/gui/widgets/button.h8
-rw-r--r--src/gui/widgets/channeltab.h2
-rw-r--r--src/gui/widgets/chattab.h12
-rw-r--r--src/gui/widgets/dropdown.h2
-rw-r--r--src/gui/widgets/extendedlistbox.h2
-rw-r--r--src/gui/widgets/extendedlistmodel.h2
-rw-r--r--src/gui/widgets/extendednamesmodel.h12
-rw-r--r--src/gui/widgets/flowcontainer.h4
-rw-r--r--src/gui/widgets/guildchattab.h2
-rw-r--r--src/gui/widgets/guitable.h22
-rw-r--r--src/gui/widgets/icon.h2
-rw-r--r--src/gui/widgets/inttextfield.h2
-rw-r--r--src/gui/widgets/itemcontainer.h5
-rw-r--r--src/gui/widgets/layout.h16
-rw-r--r--src/gui/widgets/layouthelper.h4
-rw-r--r--src/gui/widgets/namesmodel.h8
-rw-r--r--src/gui/widgets/playerbox.h2
-rw-r--r--src/gui/widgets/popup.h10
-rw-r--r--src/gui/widgets/progressbar.h6
-rw-r--r--src/gui/widgets/radiogroup.h3
-rw-r--r--src/gui/widgets/scrollarea.h2
-rw-r--r--src/gui/widgets/setupitem.cpp2
-rw-r--r--src/gui/widgets/setupitem.h8
-rw-r--r--src/gui/widgets/setuptab.h2
-rw-r--r--src/gui/widgets/setuptabscroll.h4
-rw-r--r--src/gui/widgets/shopitems.h13
-rw-r--r--src/gui/widgets/shoplistbox.h2
-rw-r--r--src/gui/widgets/shortcutcontainer.h9
-rw-r--r--src/gui/widgets/sliderlist.h6
-rw-r--r--src/gui/widgets/tab.h8
-rw-r--r--src/gui/widgets/tabbedarea.h28
-rw-r--r--src/gui/widgets/tablemodel.h26
-rw-r--r--src/gui/widgets/tabstrip.h3
-rw-r--r--src/gui/widgets/textbox.h2
-rw-r--r--src/gui/widgets/textfield.h2
-rw-r--r--src/gui/widgets/textpreview.h2
-rw-r--r--src/gui/widgets/tradetab.h2
-rw-r--r--src/gui/widgets/whispertab.h4
-rw-r--r--src/gui/widgets/widget2.h6
-rw-r--r--src/gui/widgets/widgetgroup.h3
-rw-r--r--src/gui/widgets/window.h39
44 files changed, 161 insertions, 162 deletions
diff --git a/src/gui/widgets/avatarlistbox.h b/src/gui/widgets/avatarlistbox.h
index ae9e2c734..0600feda2 100644
--- a/src/gui/widgets/avatarlistbox.h
+++ b/src/gui/widgets/avatarlistbox.h
@@ -37,9 +37,9 @@ class Image;
class AvatarListModel : public gcn::ListModel
{
public:
- virtual Avatar *getAvatarAt(const int i) = 0;
+ virtual Avatar *getAvatarAt(const int i) A_WARN_UNUSED = 0;
- std::string getElementAt(int i) override
+ std::string getElementAt(int i) override A_WARN_UNUSED
{ return getAvatarAt(i)->getName(); }
};
diff --git a/src/gui/widgets/battletab.h b/src/gui/widgets/battletab.h
index d8fe49314..abe0d6e78 100644
--- a/src/gui/widgets/battletab.h
+++ b/src/gui/widgets/battletab.h
@@ -37,7 +37,7 @@ class BattleTab final : public ChatTab
~BattleTab();
- int getType() const override
+ int getType() const override A_WARN_UNUSED
{ return ChatTab::TAB_BATTLE; }
void saveToLogFile(std::string &msg) override;
diff --git a/src/gui/widgets/browserbox.h b/src/gui/widgets/browserbox.h
index ceb4b1b3f..591d83a07 100644
--- a/src/gui/widgets/browserbox.h
+++ b/src/gui/widgets/browserbox.h
@@ -117,12 +117,6 @@ class BrowserBox final : public gcn::Widget,
{ mMaxRows = max; };
/**
- * Disable links & user defined colors to be used in chat input.
- */
-/*
- void disableLinksAndUserColors();
-*/
- /**
* Adds a text row to the browser.
*/
void addRow(const std::string &row, const bool atTop = false);
@@ -139,10 +133,6 @@ class BrowserBox final : public gcn::Widget,
*/
void clearRows();
-// void setSize(int width, int height);
-
-// void widgetResized(const gcn::Event &event);
-
/**
* Handles mouse actions.
*/
@@ -192,10 +182,10 @@ class BrowserBox final : public gcn::Widget,
typedef std::list<std::string> TextRows;
- TextRows &getRows()
+ TextRows &getRows() A_WARN_UNUSED
{ return mTextRows; }
- bool hasRows() const
+ bool hasRows() const A_WARN_UNUSED
{ return !mTextRows.empty(); }
void setAlwaysUpdate(bool n)
@@ -207,10 +197,10 @@ class BrowserBox final : public gcn::Widget,
void setEnableImages(bool n)
{ mEnableImages = n; }
- std::string getTextAtPos(const int x, const int y) const;
+ std::string getTextAtPos(const int x, const int y) const A_WARN_UNUSED;
private:
- int calcHeight();
+ int calcHeight() A_WARN_UNUSED;
typedef TextRows::iterator TextRowIterator;
typedef TextRows::const_iterator TextRowCIter;
diff --git a/src/gui/widgets/button.h b/src/gui/widgets/button.h
index 59fda30e6..25fa0da02 100644
--- a/src/gui/widgets/button.h
+++ b/src/gui/widgets/button.h
@@ -103,16 +103,16 @@ class Button final : public gcn::Button,
void setDescription(std::string text)
{ mDescription = text; }
- std::string getDescription() const
+ std::string getDescription() const A_WARN_UNUSED
{ return mDescription; }
- unsigned getClickCount() const
+ unsigned getClickCount() const A_WARN_UNUSED
{ return mClickCount; }
void setTag(int tag)
{ mTag = tag; }
- int getTag() const
+ int getTag() const A_WARN_UNUSED
{ return mTag; }
void setStick(bool b)
@@ -135,7 +135,7 @@ class Button final : public gcn::Button,
void keyReleased(gcn::KeyEvent &keyEvent) override;
- bool isPressed2() const;
+ bool isPressed2() const A_WARN_UNUSED;
private:
void init();
diff --git a/src/gui/widgets/channeltab.h b/src/gui/widgets/channeltab.h
index f2a42f03c..e0dbfb043 100644
--- a/src/gui/widgets/channeltab.h
+++ b/src/gui/widgets/channeltab.h
@@ -35,7 +35,7 @@ class ChannelTab final : public ChatTab
public:
A_DELETE_COPY(ChannelTab)
- Channel *getChannel() const
+ Channel *getChannel() const A_WARN_UNUSED
{ return mChannel; }
void showHelp() override;
diff --git a/src/gui/widgets/chattab.h b/src/gui/widgets/chattab.h
index 2a6b826f6..5a1dc2e82 100644
--- a/src/gui/widgets/chattab.h
+++ b/src/gui/widgets/chattab.h
@@ -133,31 +133,31 @@ class ChatTab : public Tab
/**
* Returns type of the being.
*/
- virtual int getType() const;
+ virtual int getType() const A_WARN_UNUSED;
virtual void saveToLogFile(std::string &msg);
- std::list<std::string> &getRows() const
+ std::list<std::string> &getRows() const A_WARN_UNUSED
{ return mTextOutput->getRows(); }
- bool hasRows() const
+ bool hasRows() const A_WARN_UNUSED
{ return mTextOutput->hasRows(); }
void loadFromLogFile(std::string name);
- bool getAllowHighlight() const
+ bool getAllowHighlight() const A_WARN_UNUSED
{ return mAllowHightlight; }
void setAllowHighlight(const bool n)
{ mAllowHightlight = n; }
- bool getRemoveNames() const
+ bool getRemoveNames() const A_WARN_UNUSED
{ return mRemoveNames; }
void setRemoveNames(const bool n)
{ mRemoveNames = n; }
- bool getNoAway() const
+ bool getNoAway() const A_WARN_UNUSED
{ return mNoAway; }
void setNoAway(const bool n)
diff --git a/src/gui/widgets/dropdown.h b/src/gui/widgets/dropdown.h
index ac1b23484..d02b86672 100644
--- a/src/gui/widgets/dropdown.h
+++ b/src/gui/widgets/dropdown.h
@@ -88,7 +88,7 @@ class DropDown final : public gcn::DropDown,
void setSelectedString(std::string str);
- std::string getSelectedString() const;
+ std::string getSelectedString() const A_WARN_UNUSED;
void adjustHeight();
diff --git a/src/gui/widgets/extendedlistbox.h b/src/gui/widgets/extendedlistbox.h
index 07280da5a..32fd274aa 100644
--- a/src/gui/widgets/extendedlistbox.h
+++ b/src/gui/widgets/extendedlistbox.h
@@ -41,7 +41,7 @@ class ExtendedListBox final : public ListBox
*/
void draw(gcn::Graphics *graphics) override;
- unsigned int getRowHeight() const override
+ unsigned int getRowHeight() const override A_WARN_UNUSED
{ return mRowHeight; }
void setRowHeight(unsigned int n)
diff --git a/src/gui/widgets/extendedlistmodel.h b/src/gui/widgets/extendedlistmodel.h
index 48b75dc95..536323b36 100644
--- a/src/gui/widgets/extendedlistmodel.h
+++ b/src/gui/widgets/extendedlistmodel.h
@@ -28,7 +28,7 @@
class ExtendedListModel : public gcn::ListModel
{
public:
- virtual const Image *getImageAt(int i) = 0;
+ virtual const Image *getImageAt(int i) A_WARN_UNUSED = 0;
};
#endif
diff --git a/src/gui/widgets/extendednamesmodel.h b/src/gui/widgets/extendednamesmodel.h
index 3078f977f..64941d089 100644
--- a/src/gui/widgets/extendednamesmodel.h
+++ b/src/gui/widgets/extendednamesmodel.h
@@ -36,19 +36,19 @@ class ExtendedNamesModel : public ExtendedListModel
virtual ~ExtendedNamesModel();
- virtual int getNumberOfElements() override;
+ virtual int getNumberOfElements() override A_WARN_UNUSED;
- virtual std::string getElementAt(int i) override;
+ virtual std::string getElementAt(int i) override A_WARN_UNUSED;
- virtual const Image *getImageAt(int i) override;
+ virtual const Image *getImageAt(int i) override A_WARN_UNUSED;
- StringVect &getNames()
+ StringVect &getNames() A_WARN_UNUSED
{ return mNames; }
- std::vector<Image*> &getImages()
+ std::vector<Image*> &getImages() A_WARN_UNUSED
{ return mImages; }
- size_t size()
+ size_t size() A_WARN_UNUSED
{ return mNames.size(); }
void clear();
diff --git a/src/gui/widgets/flowcontainer.h b/src/gui/widgets/flowcontainer.h
index 744ee25d8..0dc39dde2 100644
--- a/src/gui/widgets/flowcontainer.h
+++ b/src/gui/widgets/flowcontainer.h
@@ -57,10 +57,10 @@ class FlowContainer final : public Container,
*/
void widgetResized(const gcn::Event &event) override;
- int getBoxWidth() const
+ int getBoxWidth() const A_WARN_UNUSED
{ return mBoxWidth; }
- int getBoxHeight() const
+ int getBoxHeight() const A_WARN_UNUSED
{ return mBoxHeight; }
void add(gcn::Widget *widget);
diff --git a/src/gui/widgets/guildchattab.h b/src/gui/widgets/guildchattab.h
index 603088a43..f376eddf8 100644
--- a/src/gui/widgets/guildchattab.h
+++ b/src/gui/widgets/guildchattab.h
@@ -44,7 +44,7 @@ class GuildChatTab final : public ChatTab
void saveToLogFile(std::string &msg) override;
- int getType() const override
+ int getType() const override A_WARN_UNUSED
{ return ChatTab::TAB_GUILD; }
void playNewMessageSound() override;
diff --git a/src/gui/widgets/guitable.h b/src/gui/widgets/guitable.h
index 704276026..38026d5ab 100644
--- a/src/gui/widgets/guitable.h
+++ b/src/gui/widgets/guitable.h
@@ -66,7 +66,7 @@ public:
/**
* Retrieves the active table model
*/
- TableModel *getModel() const;
+ TableModel *getModel() const A_WARN_UNUSED;
/**
* Sets the table model
@@ -80,21 +80,21 @@ public:
void setSelected(int row, int column);
- int getSelectedRow() const;
+ int getSelectedRow() const A_WARN_UNUSED;
- int getSelectedColumn() const;
+ int getSelectedColumn() const A_WARN_UNUSED;
void setSelectedRow(int selected);
void setSelectedColumn(int selected);
- bool isWrappingEnabled() const
+ bool isWrappingEnabled() const A_WARN_UNUSED
{ return mWrappingEnabled; }
void setWrappingEnabled(bool wrappingEnabled)
{ mWrappingEnabled = wrappingEnabled; }
- gcn::Rectangle getChildrenArea() override;
+ gcn::Rectangle getChildrenArea() override A_WARN_UNUSED;
/**
* Toggle whether to use linewise selection mode, in which the table selects
@@ -112,7 +112,7 @@ public:
// Inherited from Widget
virtual void draw(gcn::Graphics* graphics) override;
- virtual gcn::Widget *getWidgetAt(int x, int y) override;
+ virtual gcn::Widget *getWidgetAt(int x, int y) override A_WARN_UNUSED;
virtual void moveToTop(gcn::Widget *child) override;
@@ -138,7 +138,7 @@ public:
*
* @return True if the table is opaque, false otherwise.
*/
- virtual bool isOpaque() const
+ virtual bool isOpaque() const A_WARN_UNUSED
{ return mOpaque; }
// Inherited from MouseListener
@@ -159,12 +159,12 @@ protected:
/** Installs all action listeners on inner widgets. */
virtual void installActionListeners();
- virtual int getRowHeight() const;
- virtual int getColumnWidth(int i) const;
+ virtual int getRowHeight() const A_WARN_UNUSED;
+ virtual int getColumnWidth(int i) const A_WARN_UNUSED;
private:
- int getRowForY(int y) const; // -1 on error
- int getColumnForX(int x) const; // -1 on error
+ int getRowForY(int y) const A_WARN_UNUSED; // -1 on error
+ int getColumnForX(int x) const A_WARN_UNUSED; // -1 on error
void recomputeDimensions();
bool mLinewiseMode;
bool mWrappingEnabled;
diff --git a/src/gui/widgets/icon.h b/src/gui/widgets/icon.h
index 761bbe584..90ab1a3bb 100644
--- a/src/gui/widgets/icon.h
+++ b/src/gui/widgets/icon.h
@@ -55,7 +55,7 @@ class Icon final : public gcn::Widget,
/**
* Gets the current Image.
*/
- Image *getImage() const
+ Image *getImage() const A_WARN_UNUSED
{ return mImage; }
/**
diff --git a/src/gui/widgets/inttextfield.h b/src/gui/widgets/inttextfield.h
index 1435fcccd..ee031687e 100644
--- a/src/gui/widgets/inttextfield.h
+++ b/src/gui/widgets/inttextfield.h
@@ -48,7 +48,7 @@ class IntTextField final : public TextField
/**
* Returns the value in the text box.
*/
- int getValue() const;
+ int getValue() const A_WARN_UNUSED;
/**
* Reset the field to the default value.
diff --git a/src/gui/widgets/itemcontainer.h b/src/gui/widgets/itemcontainer.h
index fed91e5ca..a8dbf3215 100644
--- a/src/gui/widgets/itemcontainer.h
+++ b/src/gui/widgets/itemcontainer.h
@@ -105,7 +105,7 @@ class ItemContainer final : public gcn::Widget,
/**
* Returns the selected item.
*/
- Item *getSelectedItem() const;
+ Item *getSelectedItem() const A_WARN_UNUSED;
/**
* Sets selected item to NULL.
@@ -135,7 +135,7 @@ class ItemContainer final : public gcn::Widget,
void updateMatrix();
- bool getClickCount()
+ bool getClickCount() A_WARN_UNUSED
{ return mClicks; }
private:
@@ -192,7 +192,6 @@ class ItemContainer final : public gcn::Widget,
*/
int getSlotIndex(const int x, const int y) const;
-
Inventory *mInventory;
int mGridColumns, mGridRows;
Image *mSelImg;
diff --git a/src/gui/widgets/layout.h b/src/gui/widgets/layout.h
index 895cf6019..b1788343c 100644
--- a/src/gui/widgets/layout.h
+++ b/src/gui/widgets/layout.h
@@ -44,13 +44,13 @@ class ContainerPlacer final
/**
* Gets the pointed cell.
*/
- LayoutCell &getCell()
+ LayoutCell &getCell() A_WARN_UNUSED
{ return *mCell; }
/**
* Returns a placer for the same container but to an inner cell.
*/
- ContainerPlacer at(const int x, const int y);
+ ContainerPlacer at(const int x, const int y) A_WARN_UNUSED;
/**
* Adds the given widget to the container and places it in the layout.
@@ -81,7 +81,7 @@ class LayoutArray final
* Returns a reference on the cell at given position.
*/
LayoutCell &at(const int x, const int y,
- const int w = 1, const int h = 1);
+ const int w = 1, const int h = 1) A_WARN_UNUSED;
/**
* Places a widget in a given cell.
@@ -141,12 +141,12 @@ class LayoutArray final
* Gets the column/row sizes along a given axis.
* @param upp target size for the array. Ignored if AUTO_DEF.
*/
- std::vector<int> getSizes(const int dim, int upp) const;
+ std::vector<int> getSizes(const int dim, int upp) const A_WARN_UNUSED;
/**
* Gets the total size along a given axis.
*/
- int getSize(const int dim) const;
+ int getSize(const int dim) const A_WARN_UNUSED;
std::vector<int> mSizes[2];
std::vector< std::vector < LayoutCell * > > mCells;
@@ -226,7 +226,7 @@ class LayoutCell
/**
* @see LayoutArray::at
*/
- LayoutCell &at(int x, int y)
+ LayoutCell &at(int x, int y) A_WARN_UNUSED
{ return getArray().at(x, y); }
/**
@@ -268,10 +268,10 @@ class LayoutCell
void setType(int t)
{ mType = t; }
- int getWidth() const
+ int getWidth() const A_WARN_UNUSED
{ return mExtent[0]; }
- int getHeight() const
+ int getHeight() const A_WARN_UNUSED
{ return mExtent[1]; }
void setWidth(int w)
diff --git a/src/gui/widgets/layouthelper.h b/src/gui/widgets/layouthelper.h
index 75443d8ac..c1ede2611 100644
--- a/src/gui/widgets/layouthelper.h
+++ b/src/gui/widgets/layouthelper.h
@@ -50,7 +50,7 @@ class LayoutHelper final : public gcn::WidgetListener
/**
* Gets the layout handler.
*/
- const Layout &getLayout() const;
+ const Layout &getLayout() const A_WARN_UNUSED;
/**
* Computes the position of the widgets according to the current
@@ -73,7 +73,7 @@ class LayoutHelper final : public gcn::WidgetListener
/**
* Returns a proxy for adding widgets in an inner table of the layout.
*/
- ContainerPlacer getPlacer(const int x, const int y);
+ ContainerPlacer getPlacer(const int x, const int y) A_WARN_UNUSED;
/**
* Called whenever the managed container changes size.
diff --git a/src/gui/widgets/namesmodel.h b/src/gui/widgets/namesmodel.h
index 9138f90ce..7f3ba934d 100644
--- a/src/gui/widgets/namesmodel.h
+++ b/src/gui/widgets/namesmodel.h
@@ -36,14 +36,14 @@ class NamesModel : public gcn::ListModel
virtual ~NamesModel();
- virtual int getNumberOfElements() override;
+ virtual int getNumberOfElements() override A_WARN_UNUSED;
- virtual std::string getElementAt(int i) override;
+ virtual std::string getElementAt(int i) override A_WARN_UNUSED;
- StringVect &getNames()
+ StringVect &getNames() A_WARN_UNUSED
{ return mNames; }
- size_t size()
+ size_t size() A_WARN_UNUSED
{ return mNames.size(); }
void clear()
diff --git a/src/gui/widgets/playerbox.h b/src/gui/widgets/playerbox.h
index d7729f5be..0833b63c3 100644
--- a/src/gui/widgets/playerbox.h
+++ b/src/gui/widgets/playerbox.h
@@ -77,7 +77,7 @@ class PlayerBox final : public Widget2,
*/
void drawFrame(gcn::Graphics *graphics) override;
- Being *getBeing()
+ Being *getBeing() A_WARN_UNUSED
{ return mBeing; }
private:
diff --git a/src/gui/widgets/popup.h b/src/gui/widgets/popup.h
index 278980322..bc2acffe3 100644
--- a/src/gui/widgets/popup.h
+++ b/src/gui/widgets/popup.h
@@ -95,7 +95,7 @@ class Popup : public Container, public gcn::MouseListener,
*/
void setMinWidth(const int width);
- int getMinWidth() const
+ int getMinWidth() const A_WARN_UNUSED
{ return mMinWidth; }
/**
@@ -103,7 +103,7 @@ class Popup : public Container, public gcn::MouseListener,
*/
void setMinHeight(const int height);
- int getMinHeight() const
+ int getMinHeight() const A_WARN_UNUSED
{ return mMinHeight; }
/**
@@ -111,7 +111,7 @@ class Popup : public Container, public gcn::MouseListener,
*/
void setMaxWidth(const int width);
- int getMaxWidth() const
+ int getMaxWidth() const A_WARN_UNUSED
{ return mMaxWidth; }
/**
@@ -119,7 +119,7 @@ class Popup : public Container, public gcn::MouseListener,
*/
void setMaxHeight(const int height);
- int getMaxHeight() const
+ int getMaxHeight() const A_WARN_UNUSED
{ return mMaxHeight; }
/**
@@ -129,7 +129,7 @@ class Popup : public Container, public gcn::MouseListener,
* @return The padding of the popup.
* @see setPadding
*/
- int getPadding() const
+ int getPadding() const A_WARN_UNUSED
{ return mPadding; }
void setPadding(int padding)
diff --git a/src/gui/widgets/progressbar.h b/src/gui/widgets/progressbar.h
index c754bcb6b..599292da5 100644
--- a/src/gui/widgets/progressbar.h
+++ b/src/gui/widgets/progressbar.h
@@ -81,7 +81,7 @@ class ProgressBar final : public gcn::Widget,
/**
* Returns the current progress.
*/
- float getProgress() const
+ float getProgress() const A_WARN_UNUSED
{ return mProgress; }
/**
@@ -98,7 +98,7 @@ class ProgressBar final : public gcn::Widget,
/**
* Returns the color of the progress bar.
*/
- const gcn::Color &getColor() const
+ const gcn::Color &getColor() const A_WARN_UNUSED
{ return mColor; }
/**
@@ -110,7 +110,7 @@ class ProgressBar final : public gcn::Widget,
/**
* Returns the text shown on the progress bar.
*/
- const std::string &text() const
+ const std::string &text() const A_WARN_UNUSED
{ return mText; }
/**
diff --git a/src/gui/widgets/radiogroup.h b/src/gui/widgets/radiogroup.h
index 57555c771..86f01fc79 100644
--- a/src/gui/widgets/radiogroup.h
+++ b/src/gui/widgets/radiogroup.h
@@ -34,7 +34,8 @@ class RadioGroup final : public WidgetGroup
A_DELETE_COPY(RadioGroup)
- gcn::Widget *createWidget(const std::string &name) override;
+ gcn::Widget *createWidget(const std::string &name)
+ override A_WARN_UNUSED;
};
#endif
diff --git a/src/gui/widgets/scrollarea.h b/src/gui/widgets/scrollarea.h
index d771819e6..c018763d9 100644
--- a/src/gui/widgets/scrollarea.h
+++ b/src/gui/widgets/scrollarea.h
@@ -98,7 +98,7 @@ class ScrollArea final : public gcn::ScrollArea,
/**
* Returns whether the widget draws its background or not.
*/
- bool isOpaque() const
+ bool isOpaque() const A_WARN_UNUSED
{ return mOpaque; }
/**
diff --git a/src/gui/widgets/setupitem.cpp b/src/gui/widgets/setupitem.cpp
index 437290bbf..3a273e419 100644
--- a/src/gui/widgets/setupitem.cpp
+++ b/src/gui/widgets/setupitem.cpp
@@ -134,7 +134,7 @@ void SetupItem::save() const
cfg->setValue(mKeyName, mValue);
}
-std::string SetupItem::getActionEventId()
+std::string SetupItem::getActionEventId() const
{
if (!mWidget)
return "";
diff --git a/src/gui/widgets/setupitem.h b/src/gui/widgets/setupitem.h
index 87e32bdaa..ec1a1de0b 100644
--- a/src/gui/widgets/setupitem.h
+++ b/src/gui/widgets/setupitem.h
@@ -85,12 +85,12 @@ class SetupItem : public gcn::ActionListener,
void setWidget(gcn::Widget *widget)
{ mWidget = widget; }
- gcn::Widget *getWidget() const
+ gcn::Widget *getWidget() const A_WARN_UNUSED
{ return mWidget; }
- Configuration *getConfig() const;
+ Configuration *getConfig() const A_WARN_UNUSED;
- virtual std::string getActionEventId();
+ virtual std::string getActionEventId() const A_WARN_UNUSED;
virtual void action(const gcn::ActionEvent &event) override;
@@ -102,7 +102,7 @@ class SetupItem : public gcn::ActionListener,
virtual void externalUpdated(std::string eventName);
- bool isMainConfig() const
+ bool isMainConfig() const A_WARN_UNUSED
{ return mMainConfig; }
void fixFirstItemSize(gcn::Widget *const widget);
diff --git a/src/gui/widgets/setuptab.h b/src/gui/widgets/setuptab.h
index dfcb3b315..66922120e 100644
--- a/src/gui/widgets/setuptab.h
+++ b/src/gui/widgets/setuptab.h
@@ -41,7 +41,7 @@ class SetupTab : public Container, public gcn::ActionListener
A_DELETE_COPY(SetupTab)
- const std::string &getName() const
+ const std::string &getName() const A_WARN_UNUSED
{ return mName; }
/**
diff --git a/src/gui/widgets/setuptabscroll.h b/src/gui/widgets/setuptabscroll.h
index ab8d7e5d9..a0c37c9a8 100644
--- a/src/gui/widgets/setuptabscroll.h
+++ b/src/gui/widgets/setuptabscroll.h
@@ -45,7 +45,7 @@ class SetupTabScroll : public SetupTab
void addControl(SetupItem *const widget, const std::string &event);
- VertContainer *getContainer() const
+ VertContainer *getContainer() const A_WARN_UNUSED
{ return mContainer; }
virtual void apply() override;
@@ -57,7 +57,7 @@ class SetupTabScroll : public SetupTab
virtual void action(const gcn::ActionEvent &event A_UNUSED) override
{ }
- int getPreferredFirstItemSize()
+ int getPreferredFirstItemSize() A_WARN_UNUSED
{ return mPreferredFirstItemSize; }
protected:
diff --git a/src/gui/widgets/shopitems.h b/src/gui/widgets/shopitems.h
index 5a9e36151..56c686242 100644
--- a/src/gui/widgets/shopitems.h
+++ b/src/gui/widgets/shopitems.h
@@ -81,10 +81,10 @@ class ShopItems final : public gcn::ListModel
/**
* Returns the number of items in the shop.
*/
- int getNumberOfElements() override
+ int getNumberOfElements() override A_WARN_UNUSED
{ return static_cast<int>(mShopItems.size()); }
- bool empty() const
+ bool empty() const A_WARN_UNUSED
{ return mShopItems.empty(); }
/**
@@ -92,12 +92,12 @@ class ShopItems final : public gcn::ListModel
*
* @param i the index to retrieve
*/
- std::string getElementAt(int i) override;
+ std::string getElementAt(int i) override A_WARN_UNUSED;
/**
* Returns the item number i in the shop.
*/
- ShopItem *at(unsigned int i) const;
+ ShopItem *at(unsigned int i) const A_WARN_UNUSED;
/**
* Removes an element from the shop.
@@ -118,7 +118,7 @@ class ShopItems final : public gcn::ListModel
*/
void clear();
- std::vector<ShopItem*> &items()
+ std::vector<ShopItem*> &items() A_WARN_UNUSED
{ return mShopItems; }
private:
@@ -128,7 +128,8 @@ class ShopItems final : public gcn::ListModel
*
* @return the item found or 0
*/
- ShopItem *findItem(const int id, const unsigned char color) const;
+ ShopItem *findItem(const int id,
+ const unsigned char color) const A_WARN_UNUSED;
/** The list of items in the shop. */
std::vector<ShopItem*> mShopItems;
diff --git a/src/gui/widgets/shoplistbox.h b/src/gui/widgets/shoplistbox.h
index cafa88d66..9e9b6884b 100644
--- a/src/gui/widgets/shoplistbox.h
+++ b/src/gui/widgets/shoplistbox.h
@@ -61,7 +61,7 @@ class ShopListBox final : public ListBox
/**
* Returns the height of a row.
*/
- unsigned int getRowHeight() const override
+ unsigned int getRowHeight() const override A_WARN_UNUSED
{ return mRowHeight; }
/**
diff --git a/src/gui/widgets/shortcutcontainer.h b/src/gui/widgets/shortcutcontainer.h
index f4851cf63..7cb51cbc5 100644
--- a/src/gui/widgets/shortcutcontainer.h
+++ b/src/gui/widgets/shortcutcontainer.h
@@ -81,13 +81,13 @@ class ShortcutContainer : public gcn::Widget,
*/
virtual void mouseReleased(gcn::MouseEvent &event) override = 0;
- int getMaxItems() const
+ int getMaxItems() const A_WARN_UNUSED
{ return mMaxItems; }
- int getBoxWidth() const
+ int getBoxWidth() const A_WARN_UNUSED
{ return mBoxWidth; }
- int getBoxHeight() const
+ int getBoxHeight() const A_WARN_UNUSED
{ return mBoxHeight; }
protected:
@@ -98,7 +98,8 @@ class ShortcutContainer : public gcn::Widget,
* @param pointY Y coordinate of the point.
* @return index on success, -1 on failure.
*/
- int getIndexFromGrid(const int pointX, const int pointY) const;
+ int getIndexFromGrid(const int pointX,
+ const int pointY) const A_WARN_UNUSED;
Image *mBackgroundImg;
static float mAlpha;
diff --git a/src/gui/widgets/sliderlist.h b/src/gui/widgets/sliderlist.h
index 1e57b1101..42e6cb575 100644
--- a/src/gui/widgets/sliderlist.h
+++ b/src/gui/widgets/sliderlist.h
@@ -60,19 +60,19 @@ class SliderList final : public Container,
void setSelectedString(std::string str);
- std::string getSelectedString() const;
+ std::string getSelectedString() const A_WARN_UNUSED;
void setSelected(int idx);
void adjustSize();
- int getSelected()
+ int getSelected() A_WARN_UNUSED
{ return mSelectedIndex; }
protected:
void updateLabel();
- int getMaxLabelWidth();
+ int getMaxLabelWidth() A_WARN_UNUSED;
Button *mButtons[2];
Label *mLabel;
diff --git a/src/gui/widgets/tab.h b/src/gui/widgets/tab.h
index 7947ea01a..3589b2905 100644
--- a/src/gui/widgets/tab.h
+++ b/src/gui/widgets/tab.h
@@ -99,7 +99,7 @@ class Tab : public gcn::BasicContainer,
void setFlash(const int flash)
{ mFlash = flash; }
- int getFlash() const
+ int getFlash() const A_WARN_UNUSED
{ return mFlash; }
void widgetResized(const gcn::Event &event) override;
@@ -108,18 +108,18 @@ class Tab : public gcn::BasicContainer,
void setLabelFont(gcn::Font *const font);
- Label *getLabel() const
+ Label *getLabel() const A_WARN_UNUSED
{ return mLabel; }
void adjustSize();
void setTabbedArea(TabbedArea* tabbedArea);
- TabbedArea* getTabbedArea();
+ TabbedArea* getTabbedArea() A_WARN_UNUSED;
void setCaption(const std::string& caption);
- const std::string &getCaption() const;
+ const std::string &getCaption() const A_WARN_UNUSED;
void mouseEntered(gcn::MouseEvent &mouseEvent) override;
diff --git a/src/gui/widgets/tabbedarea.h b/src/gui/widgets/tabbedarea.h
index e25183885..9c66acbfe 100644
--- a/src/gui/widgets/tabbedarea.h
+++ b/src/gui/widgets/tabbedarea.h
@@ -64,26 +64,26 @@ class TabbedArea final : public Widget2,
*
* @todo Remove this method when upgrading to Guichan 0.9.0
*/
- int getNumberOfTabs() const;
+ int getNumberOfTabs() const A_WARN_UNUSED;
/**
* Return tab with specified name as caption.
*/
- Tab *getTab(const std::string &name) const;
+ Tab *getTab(const std::string &name) const A_WARN_UNUSED;
- Tab *getTabByIndex(const int index) const;
+ Tab *getTabByIndex(const int index) const A_WARN_UNUSED;
- gcn::Widget *getWidgetByIndex(const int index) const;
+ gcn::Widget *getWidgetByIndex(const int index) const A_WARN_UNUSED;
/**
* Returns the widget with the tab that has specified caption
*/
- gcn::Widget *getWidget(const std::string &name) const;
+ gcn::Widget *getWidget(const std::string &name) const A_WARN_UNUSED;
/**
* Returns the widget for the current tab
*/
- gcn::Widget *getCurrentWidget();
+ gcn::Widget *getCurrentWidget() A_WARN_UNUSED;
/**
* Add a tab. Overridden since it needs to size the widget.
@@ -95,9 +95,9 @@ class TabbedArea final : public Widget2,
void addTab(const std::string &caption, gcn::Widget *const widget);
- bool isTabSelected(unsigned int index) const;
+ bool isTabSelected(unsigned int index) const A_WARN_UNUSED;
- bool isTabSelected(Tab* tab);
+ bool isTabSelected(Tab* tab) A_WARN_UNUSED;
/**
* Overload the remove tab function as it's broken in guichan 0.8.
@@ -111,22 +111,22 @@ class TabbedArea final : public Widget2,
*/
void logic() override;
- int getContainerHeight() const
+ int getContainerHeight() const A_WARN_UNUSED
{ return mWidgetContainer->getHeight(); }
void setSelectedTab(Tab *tab);
void setSelectedTab(unsigned int index);
- int getSelectedTabIndex() const;
+ int getSelectedTabIndex() const A_WARN_UNUSED;
- Tab* getSelectedTab()
+ Tab* getSelectedTab() A_WARN_UNUSED
{ return mSelectedTab; }
void setOpaque(bool opaque)
{ mOpaque = opaque; }
- bool isOpaque() const
+ bool isOpaque() const A_WARN_UNUSED
{ return mOpaque; }
void adjustSize();
@@ -155,13 +155,13 @@ class TabbedArea final : public Widget2,
void setRightMargin(int n)
{ mRightMargin = n; }
- int getRightMargin() const
+ int getRightMargin() const A_WARN_UNUSED
{ return mRightMargin; }
void setFollowDownScroll(bool n)
{ mFollowDownScroll = n; }
- bool getFollowDownScroll() const
+ bool getFollowDownScroll() const A_WARN_UNUSED
{ return mFollowDownScroll; }
void fixSize()
diff --git a/src/gui/widgets/tablemodel.h b/src/gui/widgets/tablemodel.h
index 6fa820467..3f6c465a4 100644
--- a/src/gui/widgets/tablemodel.h
+++ b/src/gui/widgets/tablemodel.h
@@ -63,27 +63,28 @@ public:
/**
* Determines the number of rows (lines) in the table
*/
- virtual int getRows() const = 0;
+ virtual int getRows() const A_WARN_UNUSED = 0;
/**
* Determines the number of columns in each row
*/
- virtual int getColumns() const = 0;
+ virtual int getColumns() const A_WARN_UNUSED = 0;
/**
* Determines the height for each row
*/
- virtual int getRowHeight() const = 0;
+ virtual int getRowHeight() const A_WARN_UNUSED = 0;
/**
* Determines the width of each individual column
*/
- virtual int getColumnWidth(int index) const = 0;
+ virtual int getColumnWidth(int index) const A_WARN_UNUSED = 0;
/**
* Retrieves the widget stored at the specified location within the table.
*/
- virtual gcn::Widget *getElementAt(int row, int column) const = 0;
+ virtual gcn::Widget *getElementAt(int row, int column)
+ const A_WARN_UNUSED = 0;
virtual void installListener(TableModelListener *const listener);
@@ -142,13 +143,14 @@ public:
*/
virtual void resize();
- virtual int getRows() const;
- virtual int getColumns() const;
- virtual int getRowHeight() const override;
- virtual int getWidth() const;
- virtual int getHeight() const;
- virtual int getColumnWidth(int index) const;
- virtual gcn::Widget *getElementAt(int row, int column) const override;
+ virtual int getRows() const A_WARN_UNUSED;
+ virtual int getColumns() const A_WARN_UNUSED;
+ virtual int getRowHeight() const override A_WARN_UNUSED;
+ virtual int getWidth() const A_WARN_UNUSED;
+ virtual int getHeight() const A_WARN_UNUSED;
+ virtual int getColumnWidth(int index) const A_WARN_UNUSED;
+ virtual gcn::Widget *getElementAt(int row, int column)
+ const override A_WARN_UNUSED;
protected:
int mRows, mColumns;
diff --git a/src/gui/widgets/tabstrip.h b/src/gui/widgets/tabstrip.h
index 7af9cbd78..a3d81bf97 100644
--- a/src/gui/widgets/tabstrip.h
+++ b/src/gui/widgets/tabstrip.h
@@ -38,7 +38,8 @@ class TabStrip final : public WidgetGroup
A_DELETE_COPY(TabStrip)
- gcn::Widget *createWidget(const std::string &name) override;
+ gcn::Widget *createWidget(const std::string &name)
+ override A_WARN_UNUSED;
void action(const gcn::ActionEvent &event) override;
};
diff --git a/src/gui/widgets/textbox.h b/src/gui/widgets/textbox.h
index 73de248cf..51402fad7 100644
--- a/src/gui/widgets/textbox.h
+++ b/src/gui/widgets/textbox.h
@@ -55,7 +55,7 @@ class TextBox final : public gcn::TextBox,
/**
* Get the minimum text width for the text box.
*/
- int getMinWidth() const
+ int getMinWidth() const A_WARN_UNUSED
{ return mMinWidth; }
void keyPressed(gcn::KeyEvent& keyEvent) override;
diff --git a/src/gui/widgets/textfield.h b/src/gui/widgets/textfield.h
index f4592e292..34ca88b4a 100644
--- a/src/gui/widgets/textfield.h
+++ b/src/gui/widgets/textfield.h
@@ -104,7 +104,7 @@ class TextField : public gcn::TextField,
/**
* Return the value for a numeric field
*/
- int getValue() const;
+ int getValue() const A_WARN_UNUSED;
void setSendAlwaysEvents(bool b)
{ mSendAlwaysEvents = b; }
diff --git a/src/gui/widgets/textpreview.h b/src/gui/widgets/textpreview.h
index 6af6cccf9..2d8dc6c74 100644
--- a/src/gui/widgets/textpreview.h
+++ b/src/gui/widgets/textpreview.h
@@ -121,7 +121,7 @@ class TextPreview final : public gcn::Widget,
* Gets opacity for this widget (whether or not the background color
* is shown below the widget)
*/
- bool isOpaque() const
+ bool isOpaque() const A_WARN_UNUSED
{ return mOpaque; }
void adjustSize();
diff --git a/src/gui/widgets/tradetab.h b/src/gui/widgets/tradetab.h
index a7d1bb0c7..0283db9a4 100644
--- a/src/gui/widgets/tradetab.h
+++ b/src/gui/widgets/tradetab.h
@@ -37,7 +37,7 @@ class TradeTab final : public ChatTab
~TradeTab();
- int getType() const override
+ int getType() const override A_WARN_UNUSED
{ return ChatTab::TAB_TRADE; }
void saveToLogFile(std::string &msg) override;
diff --git a/src/gui/widgets/whispertab.h b/src/gui/widgets/whispertab.h
index cef656816..185865058 100644
--- a/src/gui/widgets/whispertab.h
+++ b/src/gui/widgets/whispertab.h
@@ -35,7 +35,7 @@ class WhisperTab final : public ChatTab
public:
A_DELETE_COPY(WhisperTab)
- const std::string &getNick() const
+ const std::string &getNick() const A_WARN_UNUSED
{ return mNick; }
void showHelp() override;
@@ -43,7 +43,7 @@ class WhisperTab final : public ChatTab
bool handleCommand(const std::string &type,
const std::string &args) override;
- int getType() const override
+ int getType() const override A_WARN_UNUSED
{ return ChatTab::TAB_WHISPER; }
void saveToLogFile(std::string &msg) override;
diff --git a/src/gui/widgets/widget2.h b/src/gui/widgets/widget2.h
index ed2533287..3b4060899 100644
--- a/src/gui/widgets/widget2.h
+++ b/src/gui/widgets/widget2.h
@@ -42,13 +42,15 @@ class Widget2
}
inline const gcn::Color &getThemeColor(const int type,
- const int alpha = 255) const
+ const int alpha = 255)
+ const A_WARN_UNUSED
{
return Theme::getThemeColor(mPaletteOffset + type, alpha);
}
inline const gcn::Color &getThemeCharColor(const signed char c,
- bool &valid) const
+ bool &valid)
+ const A_WARN_UNUSED
{
const int colorId = Theme::getThemeIdByChar(c, valid);
if (valid)
diff --git a/src/gui/widgets/widgetgroup.h b/src/gui/widgets/widgetgroup.h
index 40b472a7b..69a6b1874 100644
--- a/src/gui/widgets/widgetgroup.h
+++ b/src/gui/widgets/widgetgroup.h
@@ -52,7 +52,8 @@ class WidgetGroup : public Container,
void widgetResized(const gcn::Event &event) override;
- virtual Widget *createWidget(const std::string &name) = 0;
+ virtual Widget *createWidget(const std::string &name)
+ A_WARN_UNUSED = 0;
protected:
int mSpacing;
diff --git a/src/gui/widgets/window.h b/src/gui/widgets/window.h
index 73cd1c2be..2f70bf763 100644
--- a/src/gui/widgets/window.h
+++ b/src/gui/widgets/window.h
@@ -131,14 +131,14 @@ class Window : public gcn::Window,
/**
* Returns whether the window can be resized.
*/
- bool isResizable() const;
+ bool isResizable() const A_WARN_UNUSED;
/**
* Sets the minimum width of the window.
*/
void setMinWidth(int width);
- int getMinWidth() const
+ int getMinWidth() const A_WARN_UNUSED
{ return mMinWinWidth; }
/**
@@ -146,7 +146,7 @@ class Window : public gcn::Window,
*/
void setMinHeight(int height);
- int getMinHeight() const
+ int getMinHeight() const A_WARN_UNUSED
{ return mMinWinHeight; }
/**
@@ -154,7 +154,7 @@ class Window : public gcn::Window,
*/
void setMaxWidth(const int width);
- int getMaxWidth() const
+ int getMaxWidth() const A_WARN_UNUSED
{ return mMaxWinWidth; }
/**
@@ -162,7 +162,7 @@ class Window : public gcn::Window,
*/
void setMaxHeight(const int height);
- int getMaxHeight() const
+ int getMaxHeight() const A_WARN_UNUSED
{ return mMaxWinHeight; }
/**
@@ -186,7 +186,7 @@ class Window : public gcn::Window,
/**
* Returns whether the window is sticky.
*/
- bool isSticky() const
+ bool isSticky() const A_WARN_UNUSED
{ return mSticky; }
/**
@@ -197,7 +197,7 @@ class Window : public gcn::Window,
/**
* Returns whether the window sticky locking window.
*/
- bool isStickyButtonLock() const
+ bool isStickyButtonLock() const A_WARN_UNUSED
{ return mStickyButtonLock; }
/**
@@ -215,7 +215,7 @@ class Window : public gcn::Window,
/**
* Returns whether the window is visible by default.
*/
- bool isDefaultVisible() const
+ bool isDefaultVisible() const A_WARN_UNUSED
{ return mDefaultVisible; }
/**
@@ -292,7 +292,7 @@ class Window : public gcn::Window,
/**
* Returns the name of the window. This is not the window title.
*/
- const std::string &getWindowName() const
+ const std::string &getWindowName() const A_WARN_UNUSED
{ return mWindowName; }
/**
@@ -348,7 +348,7 @@ class Window : public gcn::Window,
/**
* Gets the layout handler for this window.
*/
- Layout &getLayout();
+ Layout &getLayout() A_WARN_UNUSED;
/**
* Clears the window's layout (useful for redesigning the window). Does
@@ -375,7 +375,7 @@ class Window : public gcn::Window,
/**
* Returns a proxy for adding widgets in an inner table of the layout.
*/
- ContainerPlacer getPlacer(const int x, const int y);
+ ContainerPlacer getPlacer(const int x, const int y) A_WARN_UNUSED;
/**
* Positions the window in the center of it's parent.
@@ -402,11 +402,11 @@ class Window : public gcn::Window,
/**
* Gets the alpha value used by the window, in a GUIChan usable format.
*/
- int getGuiAlpha();
+ int getGuiAlpha() A_WARN_UNUSED;
- gcn::Rectangle getWindowArea() const;
+ gcn::Rectangle getWindowArea() const A_WARN_UNUSED;
- bool isResizeAllowed(const gcn::MouseEvent &event) const;
+ bool isResizeAllowed(const gcn::MouseEvent &event) const A_WARN_UNUSED;
void setCaptionFont(gcn::Font *font)
{ mCaptionFont = font; }
@@ -415,16 +415,17 @@ class Window : public gcn::Window,
{ mPlayVisibleSound = b; }
protected:
- bool canMove() const;
+ bool canMove() const A_WARN_UNUSED;
- int getOption(const std::string &name, const int def = 0) const;
+ int getOption(const std::string &name,
+ const int def = 0) const A_WARN_UNUSED;
- bool getOptionBool(std::string name);
+ bool getOptionBool(std::string name) A_WARN_UNUSED;
void setTitlePadding(int p)
{ mTitlePadding = p; }
- int getTitlePadding() const
+ int getTitlePadding() const A_WARN_UNUSED
{ return mTitlePadding; }
Skin *mSkin; /**< Skin in use by this window */
@@ -457,7 +458,7 @@ class Window : public gcn::Window,
*
* @see ResizeHandles
*/
- int getResizeHandles(const gcn::MouseEvent &event);
+ int getResizeHandles(const gcn::MouseEvent &event) A_WARN_UNUSED;
Image *mGrip; /**< Resize grip */
Window *mParent; /**< The parent window */