|
guillaume 2026.6.1
A C++ UI framework designed for modern desktop and extended reality (XR) applications.
|
Interface of an event source: something that reads platform input and reports it as utility::event::Event objects through a callback. More...
#include <headers/guillaume/event_handler.hpp>


Public Types | |
| using | Handler |
| The callback type: a function called with each event read from the platform. | |
Public Member Functions | |
| EventHandler (void) | |
| Create an event source with no callback. | |
| virtual | ~EventHandler (void)=default |
| Virtual destructor. | |
| void | setEventCallback (const Handler &callback) |
| Choose the function that receives the events. | |
| virtual void | pollEvents (void)=0 |
| Read the events the platform has pending and report each one through the callback. | |
Protected Member Functions | |
| Handler & | getEventCallback (void) |
| Get the callback, for pollEvents() to call. | |
Interface of an event source: something that reads platform input and reports it as utility::event::Event objects through a callback.
An implementation overrides pollEvents() to read what the platform has pending, convert it and call the callback once per event. The owner sets the callback, typically to forward to event::EventBus::publish.
Definition at line 65 of file event_handler.hpp.
The callback type: a function called with each event read from the platform.
It receives the shared pointer by reference and may move from it.
Definition at line 76 of file event_handler.hpp.
|
protected |
Get the callback, for pollEvents() to call.
|
pure virtual |
Read the events the platform has pending and report each one through the callback.
Implemented by each event source. It is meant to be called once per frame and to return without waiting when nothing is pending.
| void guillaume::EventHandler::setEventCallback | ( | const Handler & | callback | ) |
Choose the function that receives the events.
| callback | The function pollEvents() calls once per event. It replaces the previous one; an empty function removes it. |