Purpose
The goal of the window system is to manipulate native windows and provide abstracted messages from the underlying events. The platform-specific events are translated into generalized signals.
Classes
- fe::WindowI is used to represent every window, each with their own instance providing the fe::WindowI interface.
- fe::EventContextI is a singleton that can be obtained through any fe::WindowI and needs to be bound to any fe::SignalerI. The fe::Layout used to bind the fe::EventContextI to the signaler is also the signal that will provoke the fe::EventContextI to generate window-related signals. These generated signals are sent back to the same fe::SignalerI.
- Any fe::HandlerI can be bound to the context's fe::SignalerI to receive the window-related signals. As an alternative to binding with the main fe::SignalerI to receive all window signals, it may be possible to bind to a fe::WindowI for the subset of the signals associated with that window, if that particular fe::WindowI implementation supports it (such as fe::NativeWindow). This is done by casting the object providing fe::WindowI to a fe::SignalerI and binding to that signaler.
- fe::WindowEvent is provided as a convenience to interpret window-related signals. It is essentially a collection of accessors that can be bound to any fe::Record and again rebound as needed. The fe::WindowEvent methods provide safe access to the various signal attributes.
Signals
Instead of the typical massive enumeration of all possible event combinations, the events are interpreted in a source-item-state form. This makes them much easier to use in mask-style operations.
- Source determines the origin of the event, such as keyboard or mouse.
- Item is the aspect of the source that was affected such as the particular key or mouse button.
- State describes what happened to the item, such as press or release.
In addition, the current mouse position and mouse button state is attached to every event, if available.
For details, see fe::WindowEvent.