ScummVM API documentation
input_handler.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef ULTIMA_SHARED_ENGINE_INPUT_HANDLER_H
23 #define ULTIMA_SHARED_ENGINE_INPUT_HANDLER_H
24 
25 #include "ultima/shared/engine/input_translator.h"
26 #include "ultima/shared/core/tree_item.h"
27 
28 namespace Ultima {
29 namespace Shared {
30 
31 class GameBase;
32 
33 class InputHandler {
34 private:
38  void processMessage(CMessage *msg);
39 
43  void dispatchMessage(CMessage *msg);
44 public:
45  GameBase *_game;
46  InputTranslator *_inputTranslator;
47  bool _dragging;
48  bool _buttonDown;
49  Point _mousePos;
50  Point _dragStartPos;
51  int _lockCount;
52  bool _abortMessage;
53 public:
54  InputHandler(GameBase *game);
55  ~InputHandler();
56 
57  void setTranslator(InputTranslator *translator);
58 
62  void incLockCount();
63 
67  void decLockCount();
68 
72  void handleMessage(CMessage &msg, bool respectLock = true);
73 };
74 
75 } // End of namespace Shared
76 } // End of namespace Ultima
77 
78 #endif
Definition: input_translator.h:33
Definition: messages.h:87
Definition: input_handler.h:33
Definition: detection.h:27
void handleMessage(CMessage &msg, bool respectLock=true)
Definition: game_base.h:53
Definition: rect.h:45