Engine-level event management infrastructure. More...
Classes | |
| class | ml::EventDispatcher |
| Base class for all per-event dispatchers in the Malena event system. More... | |
| class | ml::EventManager |
| Centralized event bus for the Malena trait-based event system. More... | |
| class | ml::EventReceiver |
| Base class for all event-receiving traits. More... | |
| class | ml::FrameDispatcher |
| Base class for per-frame dispatchers in the Malena event system. More... | |
Typedefs | |
| using | ml::Callback = std::function<void()> |
| Callback type for no-argument event handlers. | |
| using | ml::EventCallback = std::function<void(const std::optional<sf::Event>&)> |
| Callback type for event handlers that receive the raw SFML event. | |
Enumerations | |
| enum class | ml::Event { ml::Event::CLICK , ml::Event::HOVER , ml::Event::UNHOVER , ml::Event::MOUSE_PRESSED , ml::Event::MOUSE_RELEASED , ml::Event::MOUSE_MOVED , ml::Event::DRAG , ml::Event::SCROLL , ml::Event::FOCUS , ml::Event::BLUR , ml::Event::KEYPRESS , ml::Event::KEY_RELEASE , ml::Event::TEXT_ENTERED , ml::Event::UPDATE , ml::Event::WINDOW_RESIZED , ml::Event::WINDOW_FOCUS_GAINED , ml::Event::WINDOW_FOCUS_LOST } |
| Framework-level enum for all built-in Malena events. More... | |
Engine-level event management infrastructure.
| using ml::Callback = std::function<void()> |
Callback type for no-argument event handlers.
Convenience alias accepted by all trait subscribe overloads that do not need the raw SFML event.
Definition at line 45 of file Callback.h.
| using ml::EventCallback = std::function<void(const std::optional<sf::Event>&)> |
Callback type for event handlers that receive the raw SFML event.
Used as the parameter type when subscribing via subscribe(event, EventCallback). The std::optional<sf::Event> is non-empty for input events and std::nullopt for frame (UPDATE) events.
Definition at line 31 of file Callback.h.
|
strong |
Framework-level enum for all built-in Malena events.
All built-in traits use this enum internally. User code can also use these values directly with subscribe, unsubscribe, and publish instead of relying on trait convenience methods.
| Enumerator | |
|---|---|
| CLICK | Mouse button released over component. |
| HOVER | Mouse entered component bounds. |
| UNHOVER | Mouse left component bounds. |
| MOUSE_PRESSED | Raw mouse button pressed over component. |
| MOUSE_RELEASED | Raw mouse button released over component. |
| MOUSE_MOVED | Mouse moved anywhere in window. |
| DRAG | Component is being dragged. |
| SCROLL | Mouse wheel scrolled over component. |
| FOCUS | Component gained keyboard focus. |
| BLUR | Component lost keyboard focus. |
| KEYPRESS | Key pressed while component has focus. |
| KEY_RELEASE | Key released while component has focus. |
| TEXT_ENTERED | Unicode character entered while component has focus. |
| UPDATE | Every frame, before drawing. |
| WINDOW_RESIZED | Application window was resized. |
| WINDOW_FOCUS_GAINED | Application window gained OS focus. |
| WINDOW_FOCUS_LOST | Application window lost OS focus. |