ScummVM API documentation
mouse.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 DRACI_MOUSE_H
23 #define DRACI_MOUSE_H
24 
25 #include "common/events.h"
26 
27 namespace Draci {
28 
29 enum CursorType {
30  kNormalCursor,
31  kArrowCursor1,
32  kArrowCursor2,
33  kArrowCursor3,
34  kArrowCursor4,
35  kDialogueCursor,
36  kHighlightedCursor,
37  kMainMenuCursor,
38  kUninitializedCursor = 100,
39  kItemCursor // + the index in the BArchive
40 };
41 
42 class DraciEngine;
43 class GameItem;
44 
45 class Mouse {
46 public:
47  Mouse(DraciEngine *vm);
48  ~Mouse() {}
49 
50  void handleEvent(Common::Event event);
51  void cursorOn();
52  void cursorOff();
53  bool isCursorOn() const;
54  void setPosition(uint16 x, uint16 y);
55  CursorType getCursorType() const { return _cursorType; }
56  void setCursorType(CursorType cur);
57  void loadItemCursor(const GameItem *item, bool highlighted);
58  bool lButtonPressed() const { return _lButton; }
59  bool rButtonPressed() const { return _rButton; }
60  void lButtonSet(bool state) { _lButton = state; }
61  void rButtonSet(bool state) { _rButton = state; }
62 
63  uint16 getPosX() const { return _x; }
64  uint16 getPosY() const { return _y; }
65 
66 private:
67  uint16 _x, _y;
68  bool _lButton, _rButton;
69  CursorType _cursorType;
70  DraciEngine *_vm;
71 };
72 
73 } // End of namespace Draci
74 
75 #endif // DRACI_MOUSE_H
Definition: game.h:129
Definition: mouse.h:45
Definition: draci.h:68
Definition: events.h:199
Definition: animation.h:30