ScummVM API documentation
events.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 LURE_EVENTS_H
23 #define LURE_EVENTS_H
24 
25 
26 #include "common/events.h"
27 #include "common/str.h"
28 #include "lure/luredefs.h"
29 #include "lure/disk.h"
30 
31 namespace Lure {
32 
33 class Mouse {
34 private:
35  CursorType _cursorNum;
36  int16 _x, _y;
37  bool _lButton, _rButton, _mButton;
38 public:
39  Mouse();
40  ~Mouse();
41  static Mouse &getReference();
42  void handleEvent(Common::Event event);
43 
44  void cursorOn();
45  void cursorOff();
46  void setCursorNum(CursorType cursorNum);
47  void setCursorNum(CursorType cursorNum, int hotspotX, int hotspotY);
48  CursorType getCursorNum() { return _cursorNum; }
49  void setPosition(int x, int y);
50  int16 x() { return _x; }
51  int16 y() { return _y; }
52  bool lButton() { return _lButton; }
53  bool rButton() { return _rButton; }
54  bool mButton() { return _mButton; }
55  void waitForRelease();
56  void pushCursorNum(CursorType cursorNum);
57  void pushCursorNum(CursorType cursorNum, int hotspotX, int hotspotY);
58  void popCursor();
59 };
60 
61 class Events {
62 private:
63  Common::Event _event;
64 public:
65  Events();
66  static Events &getReference();
67 
68  bool pollEvent();
69  void waitForPress();
70  bool interruptableDelay(uint32 milliseconds);
71 
72  Common::Event event() { return _event; }
73  Common::EventType type() { return _event.type; }
74  Common::CustomEventType customType() { return _event.customType; };
75 };
76 
77 } // End of namespace Lure
78 
79 #endif
Definition: events.h:33
CustomEventType customType
Definition: events.h:226
EventType
Definition: events.h:49
uint32 CustomEventType
Definition: events.h:193
Definition: events.h:199
EventType type
Definition: events.h:202
Definition: animseq.h:27
Definition: events.h:61