Mercurial > fife-parpg
changeset 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 | e37469251b22 |
children | f3457443c95f |
files | engine/core/eventchannel/base/ec_event.h engine/core/eventchannel/base/ec_inputevent.h engine/core/eventchannel/command/ec_command.h engine/core/eventchannel/eventchannel.i engine/core/eventchannel/key/ec_keyevent.h engine/core/eventchannel/mouse/ec_mouseevent.h |
diffstat | 6 files changed, 45 insertions(+), 70 deletions(-) [+] |
line wrap: on
line diff
--- a/engine/core/eventchannel/base/ec_event.h Mon Oct 04 20:52:06 2010 +0000 +++ b/engine/core/eventchannel/base/ec_event.h Mon Oct 04 21:29:12 2010 +0000 @@ -43,10 +43,6 @@ // #include "eventchannel/source/ec_ieventsource.h" -namespace gcn { - class Widget; -} - namespace FIFE { /** Base class for all events */ @@ -54,8 +50,8 @@ public: /** Constructor. */ - Event(): - m_isconsumed(false), + Event(): + m_isconsumed(false), m_eventsource(NULL), m_timestamp(SDL_GetTicks()) {} @@ -66,34 +62,24 @@ /** Marks the event as consumed. */ virtual void consume() { m_isconsumed = true; } - + /** Checks if the event is consumed. * @return true if the event is consumed, false otherwise. */ virtual bool isConsumed() const { return m_isconsumed; } - + /** Gets the source of the event. */ virtual IEventSource* getSource() const { return m_eventsource; } - + /** Sets the source of the event. */ virtual void setSource(IEventSource* source) { m_eventsource = source; } - - /** Get the source of the (widget) event. Null for non-widget. - * FIXME: This is a bit of a hack, using forward declared guichan pointer - * Should use something non-guichan specific - */ - virtual gcn::Widget* getSourceWidget() const { return m_sourcewidget; } - - /** Set the source of the (widget) event. @see getSourceWidget - */ - virtual void setSourceWidget(gcn::Widget* widget) { m_sourcewidget = widget; } - + /** Gets the timestamp of the event */ virtual int getTimeStamp() const { return m_timestamp; } - + /** Sets the timestamp of the event */ virtual void setTimeStamp(int timestamp ) { m_timestamp = timestamp; } @@ -117,7 +103,7 @@ /** Gets the debugstring of the event */ - virtual std::string getDebugString() const { + virtual std::string getDebugString() const { std::stringstream ss; ss << getName() << std::endl; ss << getAttrStr() << std::endl; @@ -127,7 +113,6 @@ private: bool m_isconsumed; IEventSource* m_eventsource; - gcn::Widget* m_sourcewidget; int m_timestamp; };
--- a/engine/core/eventchannel/base/ec_inputevent.h Mon Oct 04 20:52:06 2010 +0000 +++ b/engine/core/eventchannel/base/ec_inputevent.h Mon Oct 04 21:29:12 2010 +0000 @@ -43,39 +43,39 @@ public: /** Constructor. */ - InputEvent(): - Event(), - m_consumedbywidgets(false), - m_isshiftpressed(false), - m_iscontrolpressed(false), - m_isaltpressed(false), + InputEvent(): + Event(), + m_consumedbywidgets(false), + m_isshiftpressed(false), + m_iscontrolpressed(false), + m_isaltpressed(false), m_ismetapressed(false) {} /** Destructor. */ ~InputEvent() {} - /** Checks whether alt is pressed. + /** Checks whether alt is pressed. */ virtual bool isAltPressed() const { return m_isaltpressed; } virtual void setAltPressed(bool pressed) { m_isaltpressed = pressed; } - - /** Checks whether control is pressed. + + /** Checks whether control is pressed. */ virtual bool isControlPressed() const { return m_iscontrolpressed; } virtual void setControlPressed(bool pressed) { m_iscontrolpressed = pressed; } - - /** Checks whether meta is pressed. + + /** Checks whether meta is pressed. */ virtual bool isMetaPressed() const { return m_ismetapressed; } virtual void setMetaPressed(bool pressed) { m_ismetapressed = pressed; } - - /** Checks whether shift is pressed. + + /** Checks whether shift is pressed. */ virtual bool isShiftPressed() const { return m_isshiftpressed; } virtual void setShiftPressed(bool pressed) { m_isshiftpressed = pressed; } - - /** Marks events as consumed by widget library. + + /** Marks events as consumed by widget library. */ virtual void consumedByWidgets() { m_consumedbywidgets = true; } virtual bool isConsumedByWidgets() const { return m_consumedbywidgets; } @@ -84,8 +84,6 @@ virtual bool isConsumed() const { return Event::isConsumed(); } virtual IEventSource* getSource() { return Event::getSource(); } virtual void setSource(IEventSource* source) { Event::setSource(source); } - virtual gcn::Widget* getSourceWidget() { return Event::getSourceWidget(); } - virtual void setSourceWidget(gcn::Widget* widget) { Event::setSourceWidget(widget); } virtual int getTimeStamp() const { return Event::getTimeStamp(); } virtual void setTimeStamp(int timestamp ) { Event::setTimeStamp(timestamp); }
--- a/engine/core/eventchannel/command/ec_command.h Mon Oct 04 20:52:06 2010 +0000 +++ b/engine/core/eventchannel/command/ec_command.h Mon Oct 04 21:29:12 2010 +0000 @@ -45,9 +45,9 @@ public: /** Constructor. */ - Command(): + Command(): Event(), - m_commandtype(CMD_UNKNOWN), + m_commandtype(CMD_UNKNOWN), m_code(0) {} /** Destructor. @@ -70,8 +70,6 @@ virtual bool isConsumed() const { return Event::isConsumed(); } virtual IEventSource* getSource() { return Event::getSource(); } virtual void setSource(IEventSource* source) { Event::setSource(source); } - virtual gcn::Widget* getSourceWidget() { return Event::getSourceWidget(); } - virtual void setSourceWidget(gcn::Widget* widget) { Event::setSourceWidget(widget); } virtual int getTimeStamp() const { return Event::getTimeStamp(); } virtual void setTimeStamp(int timestamp ) { Event::setTimeStamp(timestamp); }
--- a/engine/core/eventchannel/eventchannel.i Mon Oct 04 20:52:06 2010 +0000 +++ b/engine/core/eventchannel/eventchannel.i Mon Oct 04 21:29:12 2010 +0000 @@ -54,7 +54,6 @@ virtual void consume(); virtual bool isConsumed() const; virtual IEventSource* getSource(); - virtual gcn::Widget* getSourceWidget(); virtual int getTimeStamp() const; virtual std::string getDebugString() const; virtual const std::string& getName() const; @@ -87,7 +86,6 @@ void setCode(int code); virtual void setSource(IEventSource* source); - virtual void setSourceWidget(gcn::Widget* widget); virtual void setTimeStamp(int timestamp); };
--- a/engine/core/eventchannel/key/ec_keyevent.h Mon Oct 04 20:52:06 2010 +0000 +++ b/engine/core/eventchannel/key/ec_keyevent.h Mon Oct 04 21:29:12 2010 +0000 @@ -49,12 +49,12 @@ PRESSED = 0, RELEASED }; - + /** Constructor */ - KeyEvent(): - InputEvent(), - m_eventtype(UNKNOWN), + KeyEvent(): + InputEvent(), + m_eventtype(UNKNOWN), m_isnumericpad(false), m_key(Key()) {} @@ -64,10 +64,10 @@ KeyEventType getType() const { return m_eventtype; } void setType(KeyEventType type) { m_eventtype = type; } - + bool isNumericPad() const { return m_isnumericpad; } void setNumericPad(bool ispad) { m_isnumericpad = ispad; } - + const Key& getKey() const { return m_key; } void setKey(const Key& key) { m_key = key; } @@ -86,8 +86,6 @@ virtual bool isConsumedByWidgets() const { return InputEvent::isConsumedByWidgets(); } virtual IEventSource* getSource() { return InputEvent::getSource(); } virtual void setSource(IEventSource* source) { InputEvent::setSource(source); } - virtual gcn::Widget* getSourceWidget() { return InputEvent::getSourceWidget(); } - virtual void setSourceWidget(gcn::Widget* widget) { InputEvent::setSourceWidget(widget); } virtual int getTimeStamp() const { return InputEvent::getTimeStamp(); } virtual void setTimeStamp(int timestamp ) { InputEvent::setTimeStamp(timestamp); }
--- a/engine/core/eventchannel/mouse/ec_mouseevent.h Mon Oct 04 20:52:06 2010 +0000 +++ b/engine/core/eventchannel/mouse/ec_mouseevent.h Mon Oct 04 21:29:12 2010 +0000 @@ -36,7 +36,7 @@ #include "eventchannel/base/ec_inputevent.h" namespace FIFE { - + /** Class for mouse events */ class MouseEvent: public InputEvent { @@ -69,12 +69,12 @@ MIDDLE = 4, UNKNOWN_BUTTON = 8 }; - - + + /** Constructor. */ - MouseEvent(): - InputEvent(), + MouseEvent(): + InputEvent(), m_eventtype(UNKNOWN_EVENT), m_buttontype(UNKNOWN_BUTTON), m_x(-1), @@ -90,25 +90,25 @@ */ MouseButtonType getButton() const { return m_buttontype; } void setButton(MouseButtonType type) { m_buttontype = type; } - + /** * Gets the type of the event. * @return the type of the event. */ MouseEventType getType() const { return m_eventtype; } void setType(MouseEventType type) { m_eventtype = type; } - + /** * Gets the x coordinate of the mouse event. The coordinate is relative to - * the source event source. + * the source event source. * @return the x coordinate of the mouse event. */ int getX() const { return m_x; } void setX(int x) { m_x = x; } - + /** * Gets the y coordinate of the mouse event. The coordinate is relative to - * the source event source. + * the source event source. * @return the y coordinate of the mouse event. */ int getY() const { return m_y; } @@ -129,8 +129,6 @@ virtual bool isConsumedByWidgets() const { return InputEvent::isConsumedByWidgets(); } virtual IEventSource* getSource() { return InputEvent::getSource(); } virtual void setSource(IEventSource* source) { InputEvent::setSource(source); } - virtual gcn::Widget* getSourceWidget() { return InputEvent::getSourceWidget(); } - virtual void setSourceWidget(gcn::Widget* widget) { InputEvent::setSourceWidget(widget); } virtual int getTimeStamp() const { return InputEvent::getTimeStamp(); } virtual void setTimeStamp(int timestamp ) { InputEvent::setTimeStamp(timestamp); } @@ -186,7 +184,7 @@ } return s; } - + /** Returns string representation of given button type */ inline static std::string mouseButtonType2str(MouseButtonType t) { @@ -209,7 +207,7 @@ } return s; } - + private: @@ -217,9 +215,9 @@ MouseButtonType m_buttontype; int m_x; int m_y; - + }; - + } //FIFE #endif