ScummVM API documentation
default-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#if !defined(BACKEND_EVENTS_DEFAULT_H) && !defined(DISABLE_DEFAULT_EVENTMANAGER)
23#define BACKEND_EVENTS_DEFAULT_H
24
25#include "common/events.h"
26#include "common/queue.h"
27
28namespace Common {
29class Keymapper;
30#ifdef ENABLE_VKEYBD
31class VirtualKeyboard;
32#endif
33class VirtualMouse;
34}
35
36
38#ifdef ENABLE_VKEYBD
39 Common::VirtualKeyboard *_vk;
40#endif
41
42 Common::VirtualMouse *_virtualMouse;
43
44 Common::Keymapper *_keymapper;
45
46 Common::ArtificialEventSource _artificialEventSource;
47
49 bool notifyEvent(const Common::Event &ev) override {
50 _eventQueue.push(ev);
51 return true;
52 }
53
54 Common::Point _mousePos;
55 int _buttonState;
56 int _modifierState;
57 bool _shouldQuit;
58 bool _shouldReturnToLauncher;
59 bool _confirmExitDialogActive;
60
61public:
64
65 void init() override;
66 bool pollEvent(Common::Event &event) override;
67 void pushEvent(const Common::Event &event) override;
68 void purgeMouseEvents() override;
69 void purgeKeyboardEvents() override;
70
71 Common::Point getMousePos() const override { return _mousePos; }
72 int getButtonState() const override { return _buttonState; }
73 int getModifierState() const override { return _modifierState; }
74 int shouldQuit() const override { return _shouldQuit; }
75 int shouldReturnToLauncher() const override { return _shouldReturnToLauncher; }
76 void resetReturnToLauncher() override { _shouldReturnToLauncher = false; }
77 void resetQuit() override { _shouldQuit = false; }
78
79 Common::Keymapper *getKeymapper() override { return _keymapper; }
81};
82
83#endif
Definition: events.h:307
Definition: events.h:491
Definition: events.h:337
Definition: events.h:278
Definition: keymap.h:66
Definition: keymapper.h:44
Definition: virtual-mouse.h:44
Definition: default-events.h:37
void resetReturnToLauncher() override
Definition: default-events.h:76
void pushEvent(const Common::Event &event) override
Common::Keymap * getGlobalKeymap() override
Common::Point getMousePos() const override
Definition: default-events.h:71
int shouldReturnToLauncher() const override
Definition: default-events.h:75
void purgeMouseEvents() override
void purgeKeyboardEvents() override
void init() override
Common::Keymapper * getKeymapper() override
Definition: default-events.h:79
bool pollEvent(Common::Event &event) override
int shouldQuit() const override
Definition: default-events.h:74
int getModifierState() const override
Definition: default-events.h:73
int getButtonState() const override
Definition: default-events.h:72
Definition: algorithm.h:29
Definition: events.h:218
Definition: rect.h:144