opynsim
Unofficial C++ Documentation
Loading...
Searching...
No Matches
event.h
Go to the documentation of this file.
1#pragma once
2
4
5namespace osc
6{
7 // Represents an event, either spontaneous (i.e. from the operating system
8 // as a result of actual user/hardware interaction), or synthesized.
9 //
10 // Events may or may not "propagate", which indicates to parts of the
11 // application that if a particular `Widget` does not handle the event
12 // it should bubble it up to its parent `Widget` (if applicable).
13 class Event {
14 protected:
15 Event() = default;
16 explicit Event(EventType type) : type_{type} {}
17 Event(const Event&) = default;
21
22 public:
24
25 EventType type() const { return type_; }
26 bool propagates() const { return propagates_; }
27 void enable_propagation() { propagates_ = true; }
28 void disable_propagation() { propagates_ = false; }
29
30 private:
32 bool propagates_ = false;
33 };
34}
Definition event.h:13
Event(const Event &)=default
Event()=default
bool propagates() const
Definition event.h:26
Event(Event &&) noexcept=default
Event(EventType type)
Definition event.h:16
EventType type() const
Definition event.h:25
void enable_propagation()
Definition event.h:27
void disable_propagation()
Definition event.h:28
Definition custom_decoration_generator.h:5
EventType
Definition event_type.h:7
constexpr U to(T &&value)
Definition conversion.h:56