neoGFX
Cross-platform C++ app/game engine
i_event.hpp
Go to the documentation of this file.
1
// event.hpp
2
/*
3
Transplanted from neogfx C++ GUI Library
4
Copyright (c) 2015-2018 Leigh Johnston. All Rights Reserved.
5
6
This program is free software: you can redistribute it and / or modify
7
it under the terms of the GNU General Public License as published by
8
the Free Software Foundation, either version 3 of the License, or
9
(at your option) any later version.
10
11
This program 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.
15
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/>.
18
*/
19
20
#pragma once
21
22
#include <
neolib/neolib.hpp
>
23
#include <
neolib/jar.hpp
>
24
#include <
neolib/i_map.hpp
>
25
26
namespace
neolib
27
{
28
struct
event_destroyed
: std::logic_error {
event_destroyed
() : std::logic_error{
"neolib::event_destroyed"
} {} };
29
struct
event_queue_destroyed
: std::logic_error {
event_queue_destroyed
() : std::logic_error{
"neolib::event_queue_destroyed"
} {} };
30
31
class
i_event
:
public
i_cookie_consumer
32
{
33
public
:
34
virtual
~
i_event
() =
default
;
35
public
:
36
virtual
void
release_control() = 0;
37
virtual
void
handle_in_same_thread_as_emitter(
cookie
aHandleId) = 0;
38
public
:
39
virtual
void
pre_trigger()
const
= 0;
40
public
:
41
virtual
void
push_context()
const
= 0;
42
virtual
void
pop_context()
const
= 0;
43
public
:
44
virtual
bool
accepted()
const
= 0;
45
virtual
void
accept()
const
= 0;
46
virtual
void
ignore()
const
= 0;
47
public
:
48
virtual
bool
filtered()
const
= 0;
49
virtual
void
filter_added()
const
= 0;
50
virtual
void
filter_removed()
const
= 0;
51
virtual
void
filters_removed()
const
= 0;
52
};
53
54
class
i_event_control
55
{
56
public
:
57
virtual
~
i_event_control
() =
default
;
58
public
:
59
virtual
void
add_ref() = 0;
60
virtual
void
release() = 0;
61
virtual
bool
valid()
const
= 0;
62
virtual
i_event
&
get
()
const
= 0;
63
public
:
64
virtual
void
reset() = 0;
65
};
66
67
class
i_event_callback
68
{
69
public
:
70
virtual
~
i_event_callback
() =
default
;
71
public
:
72
virtual
const
i_event
&
event
()
const
= 0;
73
virtual
void
call()
const
= 0;
74
};
75
76
class
i_event_filter
77
{
78
public
:
79
virtual
~
i_event_filter
() =
default
;
80
public
:
81
virtual
void
pre_filter_event(
const
i_event
& aEvent) = 0;
82
virtual
void
filter_event(
const
i_event
& aEvent) = 0;
83
};
84
85
class
i_event_filter_registry
86
{
87
public
:
88
virtual
void
install_event_filter(
i_event_filter
& aFilter,
const
i_event
& aEvent) = 0;
89
virtual
void
uninstall_event_filter(
i_event_filter
& aFilter,
const
i_event
& aEvent) = 0;
90
virtual
void
uninstall_event_filter(
const
i_event
& aEvent) = 0;
91
public
:
92
virtual
void
pre_filter_event(
const
i_event
& aEvent)
const
= 0;
93
virtual
void
filter_event(
const
i_event
& aEvent)
const
= 0;
94
};
95
}
neolib::i_event
Definition:
i_event.hpp:31
neolib::i_event_control
Definition:
i_event.hpp:54
neolib::i_event_callback
Definition:
i_event.hpp:67
neolib::event
Definition:
event.hpp:252
neolib
Definition:
allocator.hpp:45
neolib::event_queue_destroyed::event_queue_destroyed
event_queue_destroyed()
Definition:
i_event.hpp:29
jar.hpp
neolib::i_event_filter_registry
Definition:
i_event.hpp:85
neolib::event_destroyed
Definition:
i_event.hpp:28
neolib.hpp
i_map.hpp
neolib::cookie
uint32_t cookie
Definition:
jar.hpp:49
neolib::event_queue_destroyed
Definition:
i_event.hpp:29
neolib::event_destroyed::event_destroyed
event_destroyed()
Definition:
i_event.hpp:28
neolib::i_event_filter
Definition:
i_event.hpp:76
neolib::i_basic_cookie_consumer
Definition:
jar.hpp:53
neolib
include
neolib
i_event.hpp
Generated by
1.8.13