Added GPLv3 headers all over the place.
[fail.git] / src / gui / game / EventHandler.h
blobf59ce4dbb68895ba29dfa4e0c3b2e5a9dc198f47
1 /*
2 Fail game engine
3 Copyright 2007 Antoine Chavasse <a.chavasse@gmail.com>
5 This file is part of Fail.
7 Fail is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License version 3
9 as published by the Free Software Foundation.
11 Fail is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>.
19 #ifndef FAIL_GUI_GAME_EVENTHANDLER_H_
20 #define FAIL_GUI_GAME_EVENTHANDLER_H_
22 #include "core/core.h"
23 #include "gui/game/guigame_export.h"
24 #include "math/Vector2f.h"
26 namespace fail { namespace gui { namespace game
28 class FLGUIGAME_EXPORT EventHandler : virtual public RefCounted
30 public:
31 EventHandler() : m_bWantMouseMotion( false ) {}
33 enum e_MouseButton
35 mb_Left,
36 mb_Right,
37 mb_Middle
40 virtual void mouseEnter( const math::Vector2f& pos ) {}
41 virtual void mouseExit() {}
42 virtual bool mouseMotionEvent( const math::Vector2f& pos, const math::Vector2f& rel ) { return true; }
43 virtual bool mouseButtonEvent( const math::Vector2f& pos, e_MouseButton Button, bool bPressed )
44 { return true; }
46 const bool& getWantMouseMotion() const { return m_bWantMouseMotion; }
47 void setWantMouseMotion( const bool& x ) { m_bWantMouseMotion = x; }
49 private:
50 bool m_bWantMouseMotion;
52 }}}
54 #endif