#[non_exhaustive]pub enum EngineEvent {
Show 13 variants
WidgetAdded {
id: WidgetId,
parent: WidgetId,
},
EventMaskChanged {
scope: MaskScope,
old: EventMask,
new: EventMask,
},
EventBroadcast {
kind: EventKind,
recipients: usize,
},
CustomEventDropped {
target: EventTarget,
},
FontLoaded {
font_name: String,
font_size: u16,
},
GlyphAtlasPageAdded {
pages: usize,
},
FocusChanged {
old: Option<WidgetId>,
new: Option<WidgetId>,
},
ActionTriggered {
id: WidgetId,
cancel: bool,
},
TimerFired {
id: TimerId,
repeat: bool,
},
TimerCancelled {
id: TimerId,
},
IdleRan {
callbacks: usize,
},
AnimationTicked {
recipients: usize,
elapsed: Duration,
},
Error {
error: Error,
},
}Expand description
An action Pushrod performs internally, carried by Event::Engine.
Engine events are broadcast after the action has completed, to Widgets whose mask includes
EventMask::ENGINE, then to Engine::on_engine_event callbacks and Engine::on_event
callbacks. They never cause further internal actions by themselves, so they cannot loop.
Rule for contributors: any change that adds an internal action must add a variant here and emit it. More variants are added as the engine gains the actions.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
WidgetAdded
A Widget was added to the window. Not emitted for the root Widget.
EventMaskChanged
An event mask changed.
Fields
EventBroadcast
An event was broadcast to every interested Widget.
Fields
CustomEventDropped
A custom event was discarded because the per-frame limit on custom events was reached, which stops callbacks that re-post forever.
Fields
target: EventTargetThe target of the discarded event.
FontLoaded
A font was loaded from disk, the first time text was drawn with it. Each
(font_name, font_size, style) loads once per process run.
GlyphAtlasPageAdded
A glyph atlas texture was created because the existing ones were full (or none existed).
FocusChanged
The keyboard focus moved, by a click, Tab, an arrow key, or set_focus.
Fields
ActionTriggered
Return or Escape activated a form’s default or cancel Widget.
Fields
TimerFired
A timer registered with Engine::on_timer fired and its callback ran.
Fields
TimerCancelled
A timer was cancelled before it fired again, by Ui::cancel_timer or
Engine::cancel_timer. Not sent when a one-shot timer simply finishes.
IdleRan
The idle callbacks ran because no events were pending.
AnimationTicked
Event::Tick was delivered to the Widgets that requested animation.
Fields
Error
An operation failed while the run loop was running (a font that would not load, a texture the driver could not create). The loop keeps running; the failed drawing is skipped.
Implementations§
Source§impl EngineEvent
impl EngineEvent
Sourcepub fn kind(&self) -> EngineEventKind
pub fn kind(&self) -> EngineEventKind
Returns the kind of this engine event, for filtering.
§Returns
The EngineEventKind matching the variant.