Mercurial > fife-parpg
comparison engine/core/eventchannel/base/ec_event.h @ 630:010da1d1ee1c
* Removed old and unused functions: set/getSourceWidget()
author | prock@33b003aa-7bff-0310-803a-e67f0ece8222 |
---|---|
date | Mon, 04 Oct 2010 21:29:12 +0000 |
parents | 64738befdf3b |
children |
comparison
equal
deleted
inserted
replaced
629:e37469251b22 | 630:010da1d1ee1c |
---|---|
41 // First block: files included from the FIFE root src directory | 41 // First block: files included from the FIFE root src directory |
42 // Second block: files included from the same folder | 42 // Second block: files included from the same folder |
43 // | 43 // |
44 #include "eventchannel/source/ec_ieventsource.h" | 44 #include "eventchannel/source/ec_ieventsource.h" |
45 | 45 |
46 namespace gcn { | |
47 class Widget; | |
48 } | |
49 | |
50 namespace FIFE { | 46 namespace FIFE { |
51 /** Base class for all events | 47 /** Base class for all events |
52 */ | 48 */ |
53 class Event { | 49 class Event { |
54 public: | 50 public: |
55 /** Constructor. | 51 /** Constructor. |
56 */ | 52 */ |
57 Event(): | 53 Event(): |
58 m_isconsumed(false), | 54 m_isconsumed(false), |
59 m_eventsource(NULL), | 55 m_eventsource(NULL), |
60 m_timestamp(SDL_GetTicks()) {} | 56 m_timestamp(SDL_GetTicks()) {} |
61 | 57 |
62 /** Destructor. | 58 /** Destructor. |
63 */ | 59 */ |
64 virtual ~Event() {} | 60 virtual ~Event() {} |
65 | 61 |
66 /** Marks the event as consumed. | 62 /** Marks the event as consumed. |
67 */ | 63 */ |
68 virtual void consume() { m_isconsumed = true; } | 64 virtual void consume() { m_isconsumed = true; } |
69 | 65 |
70 /** Checks if the event is consumed. | 66 /** Checks if the event is consumed. |
71 * @return true if the event is consumed, false otherwise. | 67 * @return true if the event is consumed, false otherwise. |
72 */ | 68 */ |
73 virtual bool isConsumed() const { return m_isconsumed; } | 69 virtual bool isConsumed() const { return m_isconsumed; } |
74 | 70 |
75 /** Gets the source of the event. | 71 /** Gets the source of the event. |
76 */ | 72 */ |
77 virtual IEventSource* getSource() const { return m_eventsource; } | 73 virtual IEventSource* getSource() const { return m_eventsource; } |
78 | 74 |
79 /** Sets the source of the event. | 75 /** Sets the source of the event. |
80 */ | 76 */ |
81 virtual void setSource(IEventSource* source) { m_eventsource = source; } | 77 virtual void setSource(IEventSource* source) { m_eventsource = source; } |
82 | 78 |
83 /** Get the source of the (widget) event. Null for non-widget. | |
84 * FIXME: This is a bit of a hack, using forward declared guichan pointer | |
85 * Should use something non-guichan specific | |
86 */ | |
87 virtual gcn::Widget* getSourceWidget() const { return m_sourcewidget; } | |
88 | |
89 /** Set the source of the (widget) event. @see getSourceWidget | |
90 */ | |
91 virtual void setSourceWidget(gcn::Widget* widget) { m_sourcewidget = widget; } | |
92 | |
93 /** Gets the timestamp of the event | 79 /** Gets the timestamp of the event |
94 */ | 80 */ |
95 virtual int getTimeStamp() const { return m_timestamp; } | 81 virtual int getTimeStamp() const { return m_timestamp; } |
96 | 82 |
97 /** Sets the timestamp of the event | 83 /** Sets the timestamp of the event |
98 */ | 84 */ |
99 virtual void setTimeStamp(int timestamp ) { m_timestamp = timestamp; } | 85 virtual void setTimeStamp(int timestamp ) { m_timestamp = timestamp; } |
100 | 86 |
101 /** Gets the name of the event | 87 /** Gets the name of the event |
115 return ss.str(); | 101 return ss.str(); |
116 } | 102 } |
117 | 103 |
118 /** Gets the debugstring of the event | 104 /** Gets the debugstring of the event |
119 */ | 105 */ |
120 virtual std::string getDebugString() const { | 106 virtual std::string getDebugString() const { |
121 std::stringstream ss; | 107 std::stringstream ss; |
122 ss << getName() << std::endl; | 108 ss << getName() << std::endl; |
123 ss << getAttrStr() << std::endl; | 109 ss << getAttrStr() << std::endl; |
124 return ss.str(); | 110 return ss.str(); |
125 } | 111 } |
126 | 112 |
127 private: | 113 private: |
128 bool m_isconsumed; | 114 bool m_isconsumed; |
129 IEventSource* m_eventsource; | 115 IEventSource* m_eventsource; |
130 gcn::Widget* m_sourcewidget; | |
131 int m_timestamp; | 116 int m_timestamp; |
132 }; | 117 }; |
133 | 118 |
134 } //FIFE | 119 } //FIFE |
135 | 120 |