diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-06-02 22:15:12 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-06-02 22:15:12 +0300 |
commit | 82644cd319e46e35a7b4e3b4a61fac2465a2ea66 (patch) | |
tree | d737e04b71ea583abe1e835ece785b147a6abfb9 | |
parent | 37343e2b49466bb6cab33f8d1ca362a25f77a660 (diff) | |
download | manaplus-82644cd319e46e35a7b4e3b4a61fac2465a2ea66.tar.gz manaplus-82644cd319e46e35a7b4e3b4a61fac2465a2ea66.tar.bz2 manaplus-82644cd319e46e35a7b4e3b4a61fac2465a2ea66.tar.xz manaplus-82644cd319e46e35a7b4e3b4a61fac2465a2ea66.zip |
Add missing final/notfinal to classes.
80 files changed, 171 insertions, 115 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 7d03d60d0..82bce78e8 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -990,6 +990,7 @@ SET(SRCS listeners/selectionlistener.h listeners/statlistener.cpp listeners/statlistener.h + listeners/tablemodellistener.h listeners/updatestatuslistener.cpp listeners/updatestatuslistener.h utils/sdlpixel.h diff --git a/src/Makefile.am b/src/Makefile.am index 412df5d47..20ebedd9e 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -208,6 +208,7 @@ manaplus_SOURCES += events/actionevent.h \ listeners/selectionlistener.h \ listeners/statlistener.cpp \ listeners/statlistener.h \ + listeners/tablemodellistener.h \ listeners/updatestatuslistener.cpp \ listeners/updatestatuslistener.h \ utils/sdlpixel.h \ diff --git a/src/avatar.h b/src/avatar.h index 482e75873..477f6dc8c 100644 --- a/src/avatar.h +++ b/src/avatar.h @@ -34,7 +34,7 @@ enum AvatarType AVATAR_PLAYER = 0 }; -class Avatar +class Avatar notfinal { public: explicit Avatar(const std::string &name = ""); diff --git a/src/being/actor.h b/src/being/actor.h index c29986bee..6907ef9e5 100644 --- a/src/being/actor.h +++ b/src/being/actor.h @@ -35,7 +35,7 @@ class Map; typedef std::list<Actor*> Actors; typedef Actors::const_iterator ActorsCIter; -class Actor +class Actor notfinal { public: A_DELETE_COPY(Actor) diff --git a/src/being/being.h b/src/being/being.h index 40c9af4ba..c4b1b693c 100644 --- a/src/being/being.h +++ b/src/being/being.h @@ -65,7 +65,7 @@ struct ParticleInfo; extern volatile int cur_time; -struct NextSoundInfo +struct NextSoundInfo final { NextSoundInfo() : sound(nullptr), diff --git a/src/being/playerignorestrategy.h b/src/being/playerignorestrategy.h index 4f3648897..e2993baae 100644 --- a/src/being/playerignorestrategy.h +++ b/src/being/playerignorestrategy.h @@ -32,7 +32,7 @@ class Being; /** * Ignore strategy: describes how we should handle ignores. */ -class PlayerIgnoreStrategy +class PlayerIgnoreStrategy notfinal { public: std::string mDescription; diff --git a/src/being/playerinfo.h b/src/being/playerinfo.h index 262db1a7d..926173e21 100644 --- a/src/being/playerinfo.h +++ b/src/being/playerinfo.h @@ -30,7 +30,7 @@ /** * Stat information storage structure. */ -struct Stat +struct Stat final { int base; int mod; diff --git a/src/commands.h b/src/commands.h index 1c7816cee..f4bbf84d3 100644 --- a/src/commands.h +++ b/src/commands.h @@ -41,7 +41,7 @@ extern ChatTab *localChatTab; typedef void (*CommandFuncPtr) (const std::string &args, ChatTab *const tab); -struct CommandInfo +struct CommandInfo final { const char *name; CommandFuncPtr func; diff --git a/src/configuration.h b/src/configuration.h index b1875247b..f84282224 100644 --- a/src/configuration.h +++ b/src/configuration.h @@ -44,7 +44,7 @@ class ConfigurationObject; * \param CONT Type of the container we (de)serialise */ template <class T, class CONT> -class ConfigurationListManager +class ConfigurationListManager notfinal { public: /** @@ -78,7 +78,7 @@ class ConfigurationListManager * * \ingroup CORE */ -class ConfigurationObject +class ConfigurationObject notfinal { friend class Configuration; diff --git a/src/equipment.h b/src/equipment.h index f831a3c51..047f2a79e 100644 --- a/src/equipment.h +++ b/src/equipment.h @@ -64,7 +64,7 @@ class Equipment final EQUIP_VECTOREND }; - class Backend + class Backend notfinal { public: virtual Item *getEquipment(const int index) diff --git a/src/events/event.h b/src/events/event.h index 63ccb207d..5222ba9b0 100644 --- a/src/events/event.h +++ b/src/events/event.h @@ -75,7 +75,7 @@ class Widget; * @author Olof Naessén * @since 0.6.0 */ -class Event +class Event notfinal { public: /** diff --git a/src/gui/colorpair.h b/src/gui/colorpair.h index c0c699777..2685a372d 100644 --- a/src/gui/colorpair.h +++ b/src/gui/colorpair.h @@ -25,7 +25,7 @@ class Color; -struct ColorPair +struct ColorPair final { ColorPair(const Color* c1, const Color* c2) : color1(c1), diff --git a/src/gui/fonts/textchunksmall.h b/src/gui/fonts/textchunksmall.h index 0b3741b4c..aed31b4fa 100644 --- a/src/gui/fonts/textchunksmall.h +++ b/src/gui/fonts/textchunksmall.h @@ -27,7 +27,7 @@ #include "localconsts.h" -class TextChunkSmall +class TextChunkSmall final { public: TextChunkSmall(const std::string &text0, diff --git a/src/gui/models/listmodel.h b/src/gui/models/listmodel.h index dfce6d4d5..3f7b964c6 100644 --- a/src/gui/models/listmodel.h +++ b/src/gui/models/listmodel.h @@ -75,7 +75,7 @@ * like ListBox, make a derived class from this class that * represents your list. */ -class ListModel +class ListModel notfinal { public: /** diff --git a/src/gui/models/tablemodel.cpp b/src/gui/models/tablemodel.cpp index aad66a6ad..d9498bbd7 100644 --- a/src/gui/models/tablemodel.cpp +++ b/src/gui/models/tablemodel.cpp @@ -26,6 +26,8 @@ #include "gui/widgets/widget.h" +#include "listeners/tablemodellistener.h" + #include "debug.h" void TableModel::installListener(TableModelListener *const listener) diff --git a/src/gui/models/tablemodel.h b/src/gui/models/tablemodel.h index 032facadd..1f3f86af7 100644 --- a/src/gui/models/tablemodel.h +++ b/src/gui/models/tablemodel.h @@ -30,28 +30,12 @@ class Widget; -class TableModelListener -{ -public: - /** - * Must be invoked by the TableModel whenever a global change is about to - * occur or has occurred (e.g., when a row or column is being removed or - * added). - * - * This method is triggered twice, once before and once after the update. - * - * \param completed whether we are signalling the end of the update - */ - virtual void modelUpdated(const bool completed) = 0; - - virtual ~TableModelListener() - { } -}; +class TableModelListener; /** * A model for a regular table of widgets. */ -class TableModel +class TableModel notfinal { public: virtual ~TableModel() diff --git a/src/gui/palette.h b/src/gui/palette.h index bd974a94b..89267c238 100644 --- a/src/gui/palette.h +++ b/src/gui/palette.h @@ -45,7 +45,7 @@ /** * Class controlling the game's color palette. */ -class Palette +class Palette notfinal { public: /** Black Color Constant */ @@ -164,7 +164,7 @@ class Palette void advanceGradient(); - struct ColorElem + struct ColorElem final { ColorElem() : type(0), diff --git a/src/gui/rect.h b/src/gui/rect.h index 8aee82c9f..da9dabcae 100644 --- a/src/gui/rect.h +++ b/src/gui/rect.h @@ -71,7 +71,7 @@ * * @since 0.1.0 */ -class Rect +class Rect notfinal { public: /** diff --git a/src/gui/widgets/browserbox.cpp b/src/gui/widgets/browserbox.cpp index f0a10c77c..f6f86a42d 100644 --- a/src/gui/widgets/browserbox.cpp +++ b/src/gui/widgets/browserbox.cpp @@ -47,6 +47,23 @@ #include "debug.h" +namespace +{ + struct MouseOverLink final + { + MouseOverLink(const int x, const int y) : + mX(x), mY(y) + { } + + bool operator() (const BrowserLink &link) const + { + return (mX >= link.x1 && mX < link.x2 && + mY >= link.y1 && mY < link.y2); + } + int mX, mY; + }; +} // namespace + ImageSet *BrowserBox::mEmotes = nullptr; int BrowserBox::mInstances = 0; @@ -409,20 +426,6 @@ void BrowserBox::clearRows() updateHeight(); } -struct MouseOverLink -{ - MouseOverLink(const int x, const int y) : - mX(x), mY(y) - { } - - bool operator() (const BrowserLink &link) const - { - return (mX >= link.x1 && mX < link.x2 && - mY >= link.y1 && mY < link.y2); - } - int mX, mY; -}; - void BrowserBox::mousePressed(MouseEvent &event) { if (!mLinkHandler) diff --git a/src/gui/widgets/extendedlistboxitem.h b/src/gui/widgets/extendedlistboxitem.h index 4fdc59633..81fd35a50 100644 --- a/src/gui/widgets/extendedlistboxitem.h +++ b/src/gui/widgets/extendedlistboxitem.h @@ -23,7 +23,9 @@ #include <string> -struct ExtendedListBoxItem +#include "localconsts.h" + +struct ExtendedListBoxItem final { ExtendedListBoxItem(const int row0, const std::string &text0, diff --git a/src/gui/widgets/guitable.h b/src/gui/widgets/guitable.h index 64e0adae4..bea678706 100644 --- a/src/gui/widgets/guitable.h +++ b/src/gui/widgets/guitable.h @@ -29,6 +29,7 @@ #include "listeners/keylistener.h" #include "listeners/mouselistener.h" +#include "listeners/tablemodellistener.h" #include "gui/widgets/widget.h" diff --git a/src/gui/widgets/layoutcell.h b/src/gui/widgets/layoutcell.h index 7761e021c..ffc1f13a8 100644 --- a/src/gui/widgets/layoutcell.h +++ b/src/gui/widgets/layoutcell.h @@ -35,7 +35,7 @@ class Widget; * right, or centered in the cell. The process is similar for the vertical * alignment, except that top is represented by LEFT and bottom by RIGHT. */ -class LayoutCell +class LayoutCell notfinal { friend class Layout; friend class LayoutArray; diff --git a/src/gui/widgets/linkhandler.h b/src/gui/widgets/linkhandler.h index b373162a3..95fac1845 100644 --- a/src/gui/widgets/linkhandler.h +++ b/src/gui/widgets/linkhandler.h @@ -31,7 +31,7 @@ * A simple interface to windows that need to handle links from BrowserBox * widget. */ -class LinkHandler +class LinkHandler notfinal { public: virtual ~LinkHandler() diff --git a/src/gui/widgets/widget2.h b/src/gui/widgets/widget2.h index 7890fd648..c29376239 100644 --- a/src/gui/widgets/widget2.h +++ b/src/gui/widgets/widget2.h @@ -25,7 +25,7 @@ #include "render/renderers.h" -class Widget2 +class Widget2 notfinal { public: virtual ~Widget2() diff --git a/src/input/multitouchmanager.h b/src/input/multitouchmanager.h index 707f93e82..d3cfdc81c 100644 --- a/src/input/multitouchmanager.h +++ b/src/input/multitouchmanager.h @@ -29,7 +29,7 @@ union SDL_Event; #endif -struct MultiTouchEvent +struct MultiTouchEvent final { bool active; float x; diff --git a/src/item.h b/src/item.h index dc4600d8b..0e8b47aef 100644 --- a/src/item.h +++ b/src/item.h @@ -34,7 +34,7 @@ class Image; /** * Represents one or more instances of a certain item type. */ -class Item +class Item notfinal { public: /** diff --git a/src/listeners/actionlistener.h b/src/listeners/actionlistener.h index 895cc985d..f23030d4b 100644 --- a/src/listeners/actionlistener.h +++ b/src/listeners/actionlistener.h @@ -76,7 +76,7 @@ * @author Olof Naessén * @author Per Larsson */ -class ActionListener +class ActionListener notfinal { public: /** diff --git a/src/listeners/actorspritelistener.h b/src/listeners/actorspritelistener.h index 7b4d89b44..0b898d2f4 100644 --- a/src/listeners/actorspritelistener.h +++ b/src/listeners/actorspritelistener.h @@ -24,7 +24,7 @@ class ActorSprite; -class ActorSpriteListener +class ActorSpriteListener notfinal { public: /** diff --git a/src/listeners/arrowslistener.h b/src/listeners/arrowslistener.h index 92811331b..a34d1e690 100644 --- a/src/listeners/arrowslistener.h +++ b/src/listeners/arrowslistener.h @@ -25,7 +25,7 @@ #include "localconsts.h" -class ArrowsListener +class ArrowsListener notfinal { public: virtual void arrowsChanged() = 0; diff --git a/src/listeners/attributelistener.h b/src/listeners/attributelistener.h index f30dfa26f..609c3de32 100644 --- a/src/listeners/attributelistener.h +++ b/src/listeners/attributelistener.h @@ -25,7 +25,7 @@ #include "localconsts.h" -class AttributeListener +class AttributeListener notfinal { public: virtual void attributeChanged(const int id, diff --git a/src/listeners/configlistener.h b/src/listeners/configlistener.h index 757d24bfc..fc56cf37a 100644 --- a/src/listeners/configlistener.h +++ b/src/listeners/configlistener.h @@ -25,13 +25,15 @@ #include <string> +#include "localconsts.h" + /** * The listener interface for receiving notifications about changes to * configuration options. * * \ingroup CORE */ -class ConfigListener +class ConfigListener notfinal { public: /** diff --git a/src/listeners/deathlistener.h b/src/listeners/deathlistener.h index ddd7db910..940a623b1 100644 --- a/src/listeners/deathlistener.h +++ b/src/listeners/deathlistener.h @@ -75,7 +75,7 @@ * @author Olof Naessén * @since 0.6.0 */ -class DeathListener +class DeathListener notfinal { public: /** diff --git a/src/listeners/focuslistener.h b/src/listeners/focuslistener.h index 10e4a2af0..d1acc0460 100644 --- a/src/listeners/focuslistener.h +++ b/src/listeners/focuslistener.h @@ -77,7 +77,7 @@ * @author Olof Naessén * @since 0.7.0 */ -class FocusListener +class FocusListener notfinal { public: /** diff --git a/src/listeners/inventorylistener.h b/src/listeners/inventorylistener.h index c064c0aca..49119df9f 100644 --- a/src/listeners/inventorylistener.h +++ b/src/listeners/inventorylistener.h @@ -27,7 +27,7 @@ class Inventory; -class InventoryListener +class InventoryListener notfinal { public: virtual ~InventoryListener() diff --git a/src/listeners/keylistener.h b/src/listeners/keylistener.h index 7a2bdd2c9..d3aa4323b 100644 --- a/src/listeners/keylistener.h +++ b/src/listeners/keylistener.h @@ -75,7 +75,7 @@ class Key; * * @see Widget::addKeyListener, Widget::removeKeyListener */ -class KeyListener +class KeyListener notfinal { public: /** diff --git a/src/listeners/mouselistener.h b/src/listeners/mouselistener.h index e3c7c7ccb..ba7fce38c 100644 --- a/src/listeners/mouselistener.h +++ b/src/listeners/mouselistener.h @@ -74,7 +74,7 @@ * @see Widget::addMouseListener, Widget::removeMouseListener * @since 0.1.0 */ -class MouseListener +class MouseListener notfinal { public: /** diff --git a/src/listeners/playerrelationslistener.h b/src/listeners/playerrelationslistener.h index 6a8bf3b20..a58cc5b04 100644 --- a/src/listeners/playerrelationslistener.h +++ b/src/listeners/playerrelationslistener.h @@ -25,7 +25,7 @@ #include <string> -class PlayerRelationsListener +class PlayerRelationsListener notfinal { public: virtual ~PlayerRelationsListener() diff --git a/src/listeners/selectionlistener.h b/src/listeners/selectionlistener.h index 2efe0a67e..3c1a62c32 100644 --- a/src/listeners/selectionlistener.h +++ b/src/listeners/selectionlistener.h @@ -80,7 +80,7 @@ * @author Olof Naessén * @since 0.8.0 */ -class SelectionListener +class SelectionListener notfinal { public: /** diff --git a/src/listeners/statlistener.h b/src/listeners/statlistener.h index 157dd9346..4cb858661 100644 --- a/src/listeners/statlistener.h +++ b/src/listeners/statlistener.h @@ -25,7 +25,7 @@ #include "localconsts.h" -class StatListener +class StatListener notfinal { public: virtual void statChanged(const int id, diff --git a/src/listeners/tablemodellistener.h b/src/listeners/tablemodellistener.h new file mode 100644 index 000000000..c908261a0 --- /dev/null +++ b/src/listeners/tablemodellistener.h @@ -0,0 +1,52 @@ +/* + * The ManaPlus Client + * Copyright (C) 2008-2009 The Mana World Development Team + * Copyright (C) 2009-2010 The Mana Developers + * Copyright (C) 2011-2014 The ManaPlus Developers + * + * This file is part of The ManaPlus Client. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + */ + +#ifndef GUI_LISTENERS_TABLEMODELLISTENER_H +#define GUI_LISTENERS_TABLEMODELLISTENER_H + +#include <set> +#include <vector> + +#include "localconsts.h" + +class Widget; + +class TableModelListener notfinal +{ + public: + /** + * Must be invoked by the TableModel whenever a global change is about + * to occur or has occurred (e.g., when a row or column is being + * removed or added). + * + * This method is triggered twice, once before and once after + * the update. + * + * \param completed whether we are signalling the end of the update + */ + virtual void modelUpdated(const bool completed) = 0; + + virtual ~TableModelListener() + { } +}; + +#endif // GUI_LISTENERS_TABLEMODELLISTENER_H diff --git a/src/listeners/updatestatuslistener.h b/src/listeners/updatestatuslistener.h index 8671687c6..a09542cca 100644 --- a/src/listeners/updatestatuslistener.h +++ b/src/listeners/updatestatuslistener.h @@ -25,7 +25,7 @@ #include "localconsts.h" -class UpdateStatusListener +class UpdateStatusListener notfinal { public: virtual void updateStatus() = 0; diff --git a/src/listeners/widgetlistener.h b/src/listeners/widgetlistener.h index 48641cbaa..3d178ad25 100644 --- a/src/listeners/widgetlistener.h +++ b/src/listeners/widgetlistener.h @@ -79,7 +79,7 @@ * @author Olof Naessén * @since 0.8.0 */ -class WidgetListener +class WidgetListener notfinal { public: /** diff --git a/src/mumblemanager.h b/src/mumblemanager.h index 4d76f0f54..49848cdf0 100644 --- a/src/mumblemanager.h +++ b/src/mumblemanager.h @@ -21,7 +21,7 @@ #include "localconsts.h" -struct LinkedMem +struct LinkedMem final { uint32_t uiVersion; uint32_t uiTick; diff --git a/src/navigationmanager.cpp b/src/navigationmanager.cpp index cd28b048d..9b164a478 100644 --- a/src/navigationmanager.cpp +++ b/src/navigationmanager.cpp @@ -31,7 +31,7 @@ static const int walkMask = (BlockMask::WALL | BlockMask::AIR namespace { - struct Cell + struct Cell final { Cell(const int x0, const int y0) : x(x0), diff --git a/src/net/adminhandler.h b/src/net/adminhandler.h index 5d5ec271e..65c04c8b7 100644 --- a/src/net/adminhandler.h +++ b/src/net/adminhandler.h @@ -26,10 +26,12 @@ #include <iosfwd> #include <string> +#include "localconsts.h" + namespace Net { -class AdminHandler +class AdminHandler notfinal { public: virtual ~AdminHandler() diff --git a/src/net/beinghandler.h b/src/net/beinghandler.h index 57f5cda72..b2b3b96b0 100644 --- a/src/net/beinghandler.h +++ b/src/net/beinghandler.h @@ -29,7 +29,7 @@ namespace Net { -class BeingHandler +class BeingHandler notfinal { public: virtual ~BeingHandler() diff --git a/src/net/buysellhandler.h b/src/net/buysellhandler.h index fd7c7b355..fde6cf835 100644 --- a/src/net/buysellhandler.h +++ b/src/net/buysellhandler.h @@ -30,7 +30,7 @@ namespace Net { -class BuySellHandler +class BuySellHandler notfinal { public: virtual ~BuySellHandler() diff --git a/src/net/charserverhandler.h b/src/net/charserverhandler.h index f552f6ba7..8f78905c6 100644 --- a/src/net/charserverhandler.h +++ b/src/net/charserverhandler.h @@ -38,7 +38,7 @@ struct Character; typedef std::list<Character*> Characters; -class CharServerHandler +class CharServerHandler notfinal { public: A_DELETE_COPY(CharServerHandler) diff --git a/src/net/chathandler.h b/src/net/chathandler.h index bcea62cfe..b3acf6384 100644 --- a/src/net/chathandler.h +++ b/src/net/chathandler.h @@ -30,7 +30,7 @@ namespace Net { -class ChatHandler +class ChatHandler notfinal { public: virtual ~ChatHandler() diff --git a/src/net/ea/inventoryitem.h b/src/net/ea/inventoryitem.h index 6b15a3fa2..2b8ac502a 100644 --- a/src/net/ea/inventoryitem.h +++ b/src/net/ea/inventoryitem.h @@ -29,7 +29,7 @@ namespace Ea /** * Used to cache storage data until we get size data for it. */ -class InventoryItem +class InventoryItem final { public: int slot; diff --git a/src/net/ea/itemhandler.h b/src/net/ea/itemhandler.h index 80c0a4dbf..ff57d5c9f 100644 --- a/src/net/ea/itemhandler.h +++ b/src/net/ea/itemhandler.h @@ -35,7 +35,7 @@ namespace Net namespace Ea { -class ItemHandler +class ItemHandler notfinal { public: ItemHandler(); diff --git a/src/net/ea/network.h b/src/net/ea/network.h index 57102d7e3..84a4b0635 100644 --- a/src/net/ea/network.h +++ b/src/net/ea/network.h @@ -33,7 +33,7 @@ namespace Ea { -class Network +class Network notfinal { public: Network(); diff --git a/src/net/gamehandler.h b/src/net/gamehandler.h index 6cbd43af6..1752f7eea 100644 --- a/src/net/gamehandler.h +++ b/src/net/gamehandler.h @@ -30,7 +30,7 @@ namespace Net { -class GameHandler +class GameHandler notfinal { public: virtual ~GameHandler() diff --git a/src/net/generalhandler.h b/src/net/generalhandler.h index 016ae4c28..5467c06e6 100644 --- a/src/net/generalhandler.h +++ b/src/net/generalhandler.h @@ -23,10 +23,12 @@ #ifndef NET_GENERALHANDLER_H #define NET_GENERALHANDLER_H +#include "localconsts.h" + namespace Net { -class GeneralHandler +class GeneralHandler notfinal { public: virtual ~GeneralHandler() diff --git a/src/net/guildhandler.h b/src/net/guildhandler.h index fc07ba07a..d67e930b2 100644 --- a/src/net/guildhandler.h +++ b/src/net/guildhandler.h @@ -34,7 +34,7 @@ class Being; namespace Net { -class GuildHandler +class GuildHandler notfinal { public: virtual ~GuildHandler() diff --git a/src/net/inventoryhandler.h b/src/net/inventoryhandler.h index 42649bae6..c40cb5b54 100644 --- a/src/net/inventoryhandler.h +++ b/src/net/inventoryhandler.h @@ -32,7 +32,7 @@ namespace Net { -class InventoryHandler +class InventoryHandler notfinal { public: virtual ~InventoryHandler() diff --git a/src/net/loginhandler.h b/src/net/loginhandler.h index 8992d7ba3..172dde361 100644 --- a/src/net/loginhandler.h +++ b/src/net/loginhandler.h @@ -33,7 +33,7 @@ namespace Net { -class LoginHandler +class LoginHandler notfinal { public: void setServer(const ServerInfo &server) diff --git a/src/net/messagehandler.h b/src/net/messagehandler.h index 726fbbe64..bc74dfdc7 100644 --- a/src/net/messagehandler.h +++ b/src/net/messagehandler.h @@ -35,7 +35,7 @@ namespace Net /** * \ingroup Network */ -class MessageHandler +class MessageHandler notfinal { public: const uint16_t *handledMessages; diff --git a/src/net/messageout.h b/src/net/messageout.h index b48cb2244..9d878db35 100644 --- a/src/net/messageout.h +++ b/src/net/messageout.h @@ -35,7 +35,7 @@ namespace Net * * \ingroup Network */ -class MessageOut +class MessageOut notfinal { public: A_DELETE_COPY(MessageOut) diff --git a/src/net/npchandler.h b/src/net/npchandler.h index 5cf2970e5..dbca9ab38 100644 --- a/src/net/npchandler.h +++ b/src/net/npchandler.h @@ -25,10 +25,12 @@ #include <iosfwd> +#include "localconsts.h" + namespace Net { -class NpcHandler +class NpcHandler notfinal { public: virtual ~NpcHandler() diff --git a/src/net/partyhandler.h b/src/net/partyhandler.h index ef17f7ebd..d604f5eed 100644 --- a/src/net/partyhandler.h +++ b/src/net/partyhandler.h @@ -36,7 +36,7 @@ class Being; namespace Net { -class PartyHandler +class PartyHandler notfinal { public: virtual ~PartyHandler() diff --git a/src/net/pethandler.h b/src/net/pethandler.h index 688eb3034..ac9a6f980 100644 --- a/src/net/pethandler.h +++ b/src/net/pethandler.h @@ -26,7 +26,7 @@ namespace Net { -class PetHandler +class PetHandler notfinal { public: virtual ~PetHandler() diff --git a/src/net/playerhandler.h b/src/net/playerhandler.h index de1314ddb..83a0c4e8d 100644 --- a/src/net/playerhandler.h +++ b/src/net/playerhandler.h @@ -31,7 +31,7 @@ namespace Net { -class PlayerHandler +class PlayerHandler notfinal { public: virtual ~PlayerHandler() diff --git a/src/net/sdltcpnet.cpp b/src/net/sdltcpnet.cpp index 103620a5b..d42b533c4 100644 --- a/src/net/sdltcpnet.cpp +++ b/src/net/sdltcpnet.cpp @@ -45,7 +45,7 @@ #include "debug.h" // because actual struct is hidden in SDL_net we reinroducing it here -struct TCPsocketHack +struct TCPsocketHack final { int ready; int channel; diff --git a/src/net/skillhandler.h b/src/net/skillhandler.h index 9f827a11d..aec1a77e6 100644 --- a/src/net/skillhandler.h +++ b/src/net/skillhandler.h @@ -25,9 +25,11 @@ #include <iosfwd> +#include "localconsts.h" + namespace Net { -class SkillHandler +class SkillHandler notfinal { public: virtual ~SkillHandler() diff --git a/src/net/tradehandler.h b/src/net/tradehandler.h index 21ca65e97..040d68179 100644 --- a/src/net/tradehandler.h +++ b/src/net/tradehandler.h @@ -33,7 +33,7 @@ class Item; namespace Net { -class TradeHandler +class TradeHandler notfinal { public: virtual ~TradeHandler() diff --git a/src/options.h b/src/options.h index d5accaa60..c5bb171cf 100644 --- a/src/options.h +++ b/src/options.h @@ -35,7 +35,7 @@ * A structure holding the values of various options that can be passed * from the command line. */ -struct Options +struct Options final { Options() : username(), diff --git a/src/particle/particlecontainer.h b/src/particle/particlecontainer.h index 6128688b6..1cfe911d8 100644 --- a/src/particle/particlecontainer.h +++ b/src/particle/particlecontainer.h @@ -30,7 +30,7 @@ * operations herein affect such stacked containers, unless the operations end * in `Locally'. */ -class ParticleContainer +class ParticleContainer notfinal { public: /** diff --git a/src/render/graphics.h b/src/render/graphics.h index 90029717e..d716226df 100644 --- a/src/render/graphics.h +++ b/src/render/graphics.h @@ -106,7 +106,7 @@ static const int defaultScreenHeight = 600; /** * A central point of control for graphics. */ -class Graphics +class Graphics notfinal { public: A_DELETE_COPY(Graphics) diff --git a/src/resources/cursor.h b/src/resources/cursor.h index 021fbf048..e4bfdc025 100644 --- a/src/resources/cursor.h +++ b/src/resources/cursor.h @@ -50,7 +50,7 @@ namespace Cursor CURSOR_TOTAL }; - struct StrToCursor + struct StrToCursor final { std::string str; Cursor cursor; diff --git a/src/resources/db/itemdb.cpp b/src/resources/db/itemdb.cpp index eeac1c73f..c41fc07a5 100644 --- a/src/resources/db/itemdb.cpp +++ b/src/resources/db/itemdb.cpp @@ -71,7 +71,7 @@ static int parseDirectionName(const std::string &name); namespace { - struct FieldType + struct FieldType final { #ifdef ADVGCC FieldType(const char *const name0, diff --git a/src/resources/dyecolor.h b/src/resources/dyecolor.h index 75037468d..b6e79edf8 100644 --- a/src/resources/dyecolor.h +++ b/src/resources/dyecolor.h @@ -25,7 +25,7 @@ #include "localconsts.h" -struct DyeColor +struct DyeColor final { DyeColor() { diff --git a/src/resources/imagehelper.h b/src/resources/imagehelper.h index f87c17ef2..b91d9aaee 100644 --- a/src/resources/imagehelper.h +++ b/src/resources/imagehelper.h @@ -37,7 +37,7 @@ class Image; /** * Defines a class for loading and storing images. */ -class ImageHelper +class ImageHelper notfinal { friend class CompoundSprite; friend class Image; diff --git a/src/resources/map/map.h b/src/resources/map/map.h index 82783e4bc..e8be23ca4 100644 --- a/src/resources/map/map.h +++ b/src/resources/map/map.h @@ -393,7 +393,7 @@ class Map final : public Properties, public ConfigListener float mLastAScrollY; // Particle effect data - struct ParticleEffectData + struct ParticleEffectData final { ParticleEffectData() : file(), diff --git a/src/resources/map/properties.h b/src/resources/map/properties.h index 7d3ff6ebf..3593aa218 100644 --- a/src/resources/map/properties.h +++ b/src/resources/map/properties.h @@ -32,7 +32,7 @@ /** * A class holding a set of properties. */ -class Properties +class Properties notfinal { public: Properties() : diff --git a/src/resources/resource.h b/src/resources/resource.h index bc3d54f51..b82eb802e 100644 --- a/src/resources/resource.h +++ b/src/resources/resource.h @@ -33,7 +33,7 @@ /** * A generic reference counted resource object. */ -class Resource +class Resource notfinal { friend class ResourceManager; diff --git a/src/resources/resourcemanager.cpp b/src/resources/resourcemanager.cpp index ea4698862..bf7b09897 100644 --- a/src/resources/resourcemanager.cpp +++ b/src/resources/resourcemanager.cpp @@ -498,7 +498,7 @@ Resource *ResourceManager::get(const std::string &idPath, const generator fun, return resource; } -struct ResourceLoader +struct ResourceLoader final { ResourceManager *manager; std::string path; @@ -534,7 +534,7 @@ SoundEffect *ResourceManager::getSoundEffect(const std::string &idPath) return static_cast<SoundEffect*>(load(idPath, &SoundEffect::load)); } -struct DyedImageLoader +struct DyedImageLoader final { ResourceManager *manager; std::string path; @@ -575,7 +575,7 @@ Image *ResourceManager::getImage(const std::string &idPath) return static_cast<Image*>(get(idPath, &DyedImageLoader::load, &rl)); } -struct ImageSetLoader +struct ImageSetLoader final { ResourceManager *manager; std::string path; @@ -609,7 +609,7 @@ ImageSet *ResourceManager::getImageSet(const std::string &imagePath, } -struct SubImageSetLoader +struct SubImageSetLoader final { ResourceManager *manager; Image *parent; @@ -644,7 +644,7 @@ ImageSet *ResourceManager::getSubImageSet(Image *const parent, &SubImageSetLoader::load, &rl)); } -struct SubImageLoader +struct SubImageLoader final { ResourceManager *manager; Image *parent; @@ -682,7 +682,7 @@ Image *ResourceManager::getSubImage(Image *const parent, } #ifdef USE_OPENGL -struct AtlasLoader +struct AtlasLoader final { const std::string name; const StringVect *files; @@ -708,7 +708,7 @@ Resource *ResourceManager::getAtlas(const std::string &name, } #endif -struct WalkLayerLoader +struct WalkLayerLoader final { const std::string name; Map *map; @@ -733,7 +733,7 @@ WalkLayer *ResourceManager::getWalkLayer(const std::string &name, &WalkLayerLoader::load, &rl)); } -struct SpriteDefLoader +struct SpriteDefLoader final { std::string path; int variant; @@ -936,7 +936,7 @@ void ResourceManager::clearScheduled() BLOCK_END("ResourceManager::clearScheduled") } -struct RescaledLoader +struct RescaledLoader final { ResourceManager *manager; const Image *image; diff --git a/src/sprite.h b/src/sprite.h index a9dde8e2b..a7cb1c6f3 100644 --- a/src/sprite.h +++ b/src/sprite.h @@ -29,7 +29,7 @@ class Graphics; class Image; -class Sprite +class Sprite notfinal { public: virtual ~Sprite() diff --git a/src/text.h b/src/text.h index 6d59f3b55..4b456ccb0 100644 --- a/src/text.h +++ b/src/text.h @@ -32,7 +32,7 @@ class Font; -class Text +class Text notfinal { friend class TextManager; diff --git a/src/variabledata.h b/src/variabledata.h index 9230299e3..a3afa0855 100644 --- a/src/variabledata.h +++ b/src/variabledata.h @@ -26,7 +26,7 @@ #include "localconsts.h" -class VariableData +class VariableData notfinal { public: enum DataType |