diff options
author | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2011-04-09 00:25:41 +0200 |
---|---|---|
committer | Thorbjørn Lindeijer <thorbjorn@lindeijer.nl> | 2011-04-09 17:54:13 +0200 |
commit | 72d83cf5ae523f16fd5313c20f711f6030350d05 (patch) | |
tree | 11e737b42871df8c8be5c819dd29613dade27938 /src | |
parent | 404d3f7f2f9aa455bea423a6a00025df23cd6687 (diff) | |
download | mana-72d83cf5ae523f16fd5313c20f711f6030350d05.tar.gz mana-72d83cf5ae523f16fd5313c20f711f6030350d05.tar.bz2 mana-72d83cf5ae523f16fd5313c20f711f6030350d05.tar.xz mana-72d83cf5ae523f16fd5313c20f711f6030350d05.zip |
Renamed Listener to EventListener
Makes it clear what kind of listener it is, since there are other
listener classes as well.
Acked-by: Jared Adams
Diffstat (limited to 'src')
-rw-r--r-- | src/CMakeLists.txt | 4 | ||||
-rw-r--r-- | src/being.h | 4 | ||||
-rw-r--r-- | src/client.h | 4 | ||||
-rw-r--r-- | src/event.cpp | 8 | ||||
-rw-r--r-- | src/event.h | 12 | ||||
-rw-r--r-- | src/eventlistener.cpp (renamed from src/listener.cpp) | 8 | ||||
-rw-r--r-- | src/eventlistener.h (renamed from src/listener.h) | 10 | ||||
-rw-r--r-- | src/gui/chat.h | 4 | ||||
-rw-r--r-- | src/gui/gui.cpp | 4 | ||||
-rw-r--r-- | src/gui/inventorywindow.h | 4 | ||||
-rw-r--r-- | src/gui/ministatus.h | 4 | ||||
-rw-r--r-- | src/gui/npcdialog.cpp | 4 | ||||
-rw-r--r-- | src/gui/npcdialog.h | 4 | ||||
-rw-r--r-- | src/gui/skilldialog.cpp | 2 | ||||
-rw-r--r-- | src/gui/skilldialog.h | 4 | ||||
-rw-r--r-- | src/gui/statuswindow.h | 4 | ||||
-rw-r--r-- | src/gui/viewport.h | 4 | ||||
-rw-r--r-- | src/net/manaserv/generalhandler.h | 4 | ||||
-rw-r--r-- | src/net/manaserv/inventoryhandler.h | 4 | ||||
-rw-r--r-- | src/net/manaserv/npchandler.h | 2 | ||||
-rw-r--r-- | src/net/tmwa/gamehandler.h | 4 | ||||
-rw-r--r-- | src/net/tmwa/generalhandler.h | 4 | ||||
-rw-r--r-- | src/net/tmwa/inventoryhandler.h | 4 | ||||
-rw-r--r-- | src/net/tmwa/npchandler.h | 2 | ||||
-rw-r--r-- | src/playerinfo.cpp | 4 | ||||
-rw-r--r-- | src/resources/theme.h | 4 |
26 files changed, 60 insertions, 60 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 79dd72cc..f8ae39fd 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -453,6 +453,8 @@ SET(SRCS equipment.h event.cpp event.h + eventlistener.cpp + eventlistener.h flooritem.cpp flooritem.h game.cpp @@ -476,8 +478,6 @@ SET(SRCS joystick.h keyboardconfig.cpp keyboardconfig.h - listener.cpp - listener.h localplayer.cpp localplayer.h log.cpp diff --git a/src/being.h b/src/being.h index febe6668..7be216ca 100644 --- a/src/being.h +++ b/src/being.h @@ -23,7 +23,7 @@ #define BEING_H #include "actorsprite.h" -#include "listener.h" +#include "eventlistener.h" #include "map.h" #include "position.h" #include "vector.h" @@ -61,7 +61,7 @@ enum Gender GENDER_UNSPECIFIED = 2 }; -class Being : public ActorSprite, public Listener +class Being : public ActorSprite, public EventListener { public: /** diff --git a/src/client.h b/src/client.h index f9030dc0..85fb7d37 100644 --- a/src/client.h +++ b/src/client.h @@ -22,7 +22,7 @@ #ifndef CLIENT_H #define CLIENT_H -#include "listener.h" +#include "eventlistener.h" #include "net/serverinfo.h" @@ -119,7 +119,7 @@ enum State { * The core part of the client. This class initializes all subsystems, runs * the event loop, and shuts everything down again. */ -class Client : public Listener, public gcn::ActionListener +class Client : public EventListener, public gcn::ActionListener { public: /** diff --git a/src/event.cpp b/src/event.cpp index fc6fa570..18091643 100644 --- a/src/event.cpp +++ b/src/event.cpp @@ -20,7 +20,7 @@ #include "event.h" -#include "listener.h" +#include "eventlistener.h" #include "variabledata.h" Event::ListenMap Event::mBindings; @@ -229,17 +229,17 @@ void Event::trigger(Channel channel, const Event &event) } } -void Event::bind(Listener *listener, Channel channel) +void Event::bind(EventListener *listener, Channel channel) { mBindings[channel].insert(listener); } -void Event::unbind(Listener *listener, Channel channel) +void Event::unbind(EventListener *listener, Channel channel) { mBindings[channel].erase(listener); } -void Event::remove(Listener *listener) +void Event::remove(EventListener *listener) { ListenMap::iterator it = mBindings.begin(); while (it != mBindings.end()) diff --git a/src/event.h b/src/event.h index 4ee0c326..c4dcfc9b 100644 --- a/src/event.h +++ b/src/event.h @@ -35,9 +35,9 @@ enum BadEvent { KEY_ALREADY_EXISTS }; -class Listener; +class EventListener; -typedef std::set<Listener *> ListenerSet; +typedef std::set<EventListener *> ListenerSet; class VariableData; typedef std::map<std::string, VariableData *> VariableMap; @@ -297,24 +297,24 @@ public: { trigger(channel, Event(type)); } protected: - friend class Listener; + friend class EventListener; /** * Binds the given listener to the given channel. The listener will receive * all events triggered on the channel. */ - static void bind(Listener *listener, Channel channel); + static void bind(EventListener *listener, Channel channel); /** * Unbinds the given listener from the given channel. The listener will no * longer receive any events from the channel. */ - static void unbind(Listener *listener, Channel channel); + static void unbind(EventListener *listener, Channel channel); /** * Unbinds the given listener from all channels. */ - static void remove(Listener *listener); + static void remove(EventListener *listener); private: typedef std::map<Channel, ListenerSet > ListenMap; diff --git a/src/listener.cpp b/src/eventlistener.cpp index dda5e5ff..967ad3c1 100644 --- a/src/listener.cpp +++ b/src/eventlistener.cpp @@ -18,21 +18,21 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#include "listener.h" +#include "eventlistener.h" #include "event.h" -Listener::~Listener() +EventListener::~EventListener() { Event::remove(this); } -void Listener::listen(Event::Channel channel) +void EventListener::listen(Event::Channel channel) { Event::bind(this, channel); } -void Listener::ignore(Event::Channel channel) +void EventListener::ignore(Event::Channel channel) { Event::unbind(this, channel); } diff --git a/src/listener.h b/src/eventlistener.h index 21ff3faf..0d998829 100644 --- a/src/listener.h +++ b/src/eventlistener.h @@ -18,17 +18,17 @@ * along with this program. If not, see <http://www.gnu.org/licenses/>. */ -#ifndef LISTENER_H -#define LISTENER_H +#ifndef EVENTLISTENER_H +#define EVENTLISTENER_H #include "event.h" #include <string> -class Listener +class EventListener { public: - virtual ~Listener(); + virtual ~EventListener(); void listen(Event::Channel channel); @@ -37,4 +37,4 @@ public: virtual void event(Event::Channel channel, const Event &event) = 0; }; -#endif +#endif // EVENTLISTENER_H diff --git a/src/gui/chat.h b/src/gui/chat.h index bba3a477..b0d2bfa8 100644 --- a/src/gui/chat.h +++ b/src/gui/chat.h @@ -22,7 +22,7 @@ #ifndef CHAT_H #define CHAT_H -#include "listener.h" +#include "eventlistener.h" #include "gui/widgets/window.h" #include "gui/widgets/textfield.h" @@ -77,7 +77,7 @@ struct CHATLOG */ class ChatWindow : public Window, public gcn::ActionListener, - public Listener + public EventListener { public: /** diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index 2aca60bf..d1c18ab2 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -30,7 +30,7 @@ #include "gui/widgets/windowcontainer.h" #include "configuration.h" -#include "listener.h" +#include "eventlistener.h" #include "graphics.h" #include "log.h" @@ -50,7 +50,7 @@ SDLInput *guiInput = 0; // Bolded font gcn::Font *boldFont = 0; -class GuiConfigListener : public Listener +class GuiConfigListener : public EventListener { public: GuiConfigListener(Gui *g): diff --git a/src/gui/inventorywindow.h b/src/gui/inventorywindow.h index d192fafa..0cdb1dbd 100644 --- a/src/gui/inventorywindow.h +++ b/src/gui/inventorywindow.h @@ -23,7 +23,7 @@ #define INVENTORYWINDOW_H #include "inventory.h" -#include "listener.h" +#include "eventlistener.h" #include "gui/widgets/window.h" #include "gui/widgets/textfield.h" @@ -49,7 +49,7 @@ class InventoryWindow : public Window, public gcn::KeyListener, public gcn::SelectionListener, public InventoryListener, - public Listener + public EventListener { public: /** diff --git a/src/gui/ministatus.h b/src/gui/ministatus.h index 7fbb8597..38025202 100644 --- a/src/gui/ministatus.h +++ b/src/gui/ministatus.h @@ -22,7 +22,7 @@ #ifndef MINISTATUS_H #define MINISTATUS_H -#include "listener.h" +#include "eventlistener.h" #include "gui/widgets/popup.h" @@ -38,7 +38,7 @@ class TextPopup; * * \ingroup Interface */ -class MiniStatusWindow : public Popup, public Listener +class MiniStatusWindow : public Popup, public EventListener { public: MiniStatusWindow(); diff --git a/src/gui/npcdialog.cpp b/src/gui/npcdialog.cpp index a8f61a1a..bb508184 100644 --- a/src/gui/npcdialog.cpp +++ b/src/gui/npcdialog.cpp @@ -23,7 +23,7 @@ #include "configuration.h" #include "event.h" -#include "listener.h" +#include "eventlistener.h" #include "playerinfo.h" #include "gui/npcpostdialog.h" @@ -52,7 +52,7 @@ typedef std::map<int, NpcDialog*> NpcDialogs; -class NpcEventListener : public Listener +class NpcEventListener : public EventListener { public: void event(Event::Channel channel, const Event &event); diff --git a/src/gui/npcdialog.h b/src/gui/npcdialog.h index 9981e088..976e0d14 100644 --- a/src/gui/npcdialog.h +++ b/src/gui/npcdialog.h @@ -22,7 +22,7 @@ #ifndef NPCDIALOG_H #define NPCDIALOG_H -#include "listener.h" +#include "eventlistener.h" #include "gui/widgets/window.h" @@ -45,7 +45,7 @@ class Button; * \ingroup Interface */ class NpcDialog : public Window, public gcn::ActionListener, - public gcn::ListModel, public Listener + public gcn::ListModel, public EventListener { public: /** diff --git a/src/gui/skilldialog.cpp b/src/gui/skilldialog.cpp index 4c405254..c7976caa 100644 --- a/src/gui/skilldialog.cpp +++ b/src/gui/skilldialog.cpp @@ -24,7 +24,7 @@ #include "log.h" #include "playerinfo.h" #include "configuration.h" -#include "listener.h" +#include "eventlistener.h" #include "gui/setup.h" diff --git a/src/gui/skilldialog.h b/src/gui/skilldialog.h index d83210b5..a49c537b 100644 --- a/src/gui/skilldialog.h +++ b/src/gui/skilldialog.h @@ -23,7 +23,7 @@ #define SKILLDIALOG_H #include "gui/widgets/window.h" -#include "listener.h" +#include "eventlistener.h" #include <guichan/actionlistener.hpp> @@ -42,7 +42,7 @@ struct SkillInfo; * * \ingroup Interface */ -class SkillDialog : public Window, public gcn::ActionListener, public Listener +class SkillDialog : public Window, public gcn::ActionListener, public EventListener { public: SkillDialog(); diff --git a/src/gui/statuswindow.h b/src/gui/statuswindow.h index d52dbd72..53bc05cf 100644 --- a/src/gui/statuswindow.h +++ b/src/gui/statuswindow.h @@ -22,7 +22,7 @@ #ifndef STATUS_H #define STATUS_H -#include "listener.h" +#include "eventlistener.h" #include "gui/widgets/window.h" @@ -40,7 +40,7 @@ class VertContainer; * * \ingroup Interface */ -class StatusWindow : public Window, public Listener +class StatusWindow : public Window, public EventListener { public: /** diff --git a/src/gui/viewport.h b/src/gui/viewport.h index feb521d7..ce535a64 100644 --- a/src/gui/viewport.h +++ b/src/gui/viewport.h @@ -22,7 +22,7 @@ #ifndef VIEWPORT_H #define VIEWPORT_H -#include "listener.h" +#include "eventlistener.h" #include "position.h" #include "gui/widgets/windowcontainer.h" @@ -54,7 +54,7 @@ const int walkingMouseDelay = 500; * coordinates. */ class Viewport : public WindowContainer, public gcn::MouseListener, - public Listener + public EventListener { public: /** diff --git a/src/net/manaserv/generalhandler.h b/src/net/manaserv/generalhandler.h index a840f02f..45ded011 100644 --- a/src/net/manaserv/generalhandler.h +++ b/src/net/manaserv/generalhandler.h @@ -22,7 +22,7 @@ #ifndef NET_MANASERV_GENERALHANDLER_H #define NET_MANASERV_GENERALHANDLER_H -#include "listener.h" +#include "eventlistener.h" #include "net/generalhandler.h" #include "net/net.h" @@ -31,7 +31,7 @@ namespace ManaServ { -class GeneralHandler : public Net::GeneralHandler, public Listener +class GeneralHandler : public Net::GeneralHandler, public EventListener { public: GeneralHandler(); diff --git a/src/net/manaserv/inventoryhandler.h b/src/net/manaserv/inventoryhandler.h index efa318ad..2733f3da 100644 --- a/src/net/manaserv/inventoryhandler.h +++ b/src/net/manaserv/inventoryhandler.h @@ -23,7 +23,7 @@ #define NET_MANASERV_INVENTORYHANDLER_H #include "equipment.h" -#include "listener.h" +#include "eventlistener.h" #include "net/inventoryhandler.h" @@ -59,7 +59,7 @@ class EquipBackend : public Equipment::Backend }; class InventoryHandler : public MessageHandler, Net::InventoryHandler, - public Listener + public EventListener { public: InventoryHandler(); diff --git a/src/net/manaserv/npchandler.h b/src/net/manaserv/npchandler.h index cb8fd67d..bda4de31 100644 --- a/src/net/manaserv/npchandler.h +++ b/src/net/manaserv/npchandler.h @@ -22,7 +22,7 @@ #ifndef NET_MANASERV_NPCHANDLER_H #define NET_MANASERV_NPCHANDLER_H -#include "listener.h" +#include "eventlistener.h" #include "net/npchandler.h" diff --git a/src/net/tmwa/gamehandler.h b/src/net/tmwa/gamehandler.h index b24bd42b..a1a2e7ec 100644 --- a/src/net/tmwa/gamehandler.h +++ b/src/net/tmwa/gamehandler.h @@ -22,7 +22,7 @@ #ifndef NET_TA_MAPHANDLER_H #define NET_TA_MAPHANDLER_H -#include "listener.h" +#include "eventlistener.h" #include "net/gamehandler.h" #include "net/net.h" @@ -34,7 +34,7 @@ namespace TmwAthena { class GameHandler : public MessageHandler, public Net::GameHandler, - public Listener + public EventListener { public: GameHandler(); diff --git a/src/net/tmwa/generalhandler.h b/src/net/tmwa/generalhandler.h index a5f65e63..a4725b89 100644 --- a/src/net/tmwa/generalhandler.h +++ b/src/net/tmwa/generalhandler.h @@ -22,7 +22,7 @@ #ifndef NET_TMWA_GENERALHANDLER_H #define NET_TMWA_GENERALHANDLER_H -#include "listener.h" +#include "eventlistener.h" #include "net/generalhandler.h" #include "net/net.h" @@ -32,7 +32,7 @@ namespace TmwAthena { class GeneralHandler : public MessageHandler, public Net::GeneralHandler, - public Listener + public EventListener { public: GeneralHandler(); diff --git a/src/net/tmwa/inventoryhandler.h b/src/net/tmwa/inventoryhandler.h index afbdd7b4..783b225d 100644 --- a/src/net/tmwa/inventoryhandler.h +++ b/src/net/tmwa/inventoryhandler.h @@ -24,7 +24,7 @@ #include "equipment.h" #include "inventory.h" -#include "listener.h" +#include "eventlistener.h" #include "playerinfo.h" #include "gui/inventorywindow.h" @@ -119,7 +119,7 @@ class InventoryItem typedef std::list<InventoryItem> InventoryItems; class InventoryHandler : public MessageHandler, public Net::InventoryHandler, - public Listener + public EventListener { public: enum { diff --git a/src/net/tmwa/npchandler.h b/src/net/tmwa/npchandler.h index 1e933418..7829924b 100644 --- a/src/net/tmwa/npchandler.h +++ b/src/net/tmwa/npchandler.h @@ -22,7 +22,7 @@ #ifndef NET_TA_NPCHANDLER_H #define NET_TA_NPCHANDLER_H -#include "listener.h" +#include "eventlistener.h" #include "net/npchandler.h" diff --git a/src/playerinfo.cpp b/src/playerinfo.cpp index 4307ca56..feb39413 100644 --- a/src/playerinfo.cpp +++ b/src/playerinfo.cpp @@ -24,7 +24,7 @@ #include "equipment.h" #include "event.h" #include "inventory.h" -#include "listener.h" +#include "eventlistener.h" #include "log.h" #include "resources/iteminfo.h" @@ -348,7 +348,7 @@ void logic() mSpecialRechargeUpdateNeeded++; } -class PlayerLogic : Listener +class PlayerLogic : EventListener { public: PlayerLogic() diff --git a/src/resources/theme.h b/src/resources/theme.h index 179662bc..d6d660e2 100644 --- a/src/resources/theme.h +++ b/src/resources/theme.h @@ -25,7 +25,7 @@ #define SKIN_H #include "graphics.h" -#include "listener.h" +#include "eventlistener.h" #include "gui/palette.h" @@ -100,7 +100,7 @@ class Skin Image *mStickyImageDown; /**< Sticky Button Image */ }; -class Theme : public Palette, public Listener +class Theme : public Palette, public EventListener { public: static Theme *instance(); |