repose_core/indication.rs
1use crate::{InteractionSource, Rect, Scene};
2
3/// Marker trait for indication implementations.
4pub trait Indication: std::fmt::Debug {}
5
6/// Factory that creates a drawable indication node bound to an interaction source.
7pub trait IndicationNodeFactory: Indication {
8 fn create(&self, interaction_source: &InteractionSource) -> Box<dyn IndicationDrawNode>;
9}
10
11/// A drawable indication node. The layout engine calls `draw()` during the paint
12/// pass to emit scene nodes for visual feedback (ripple, overlay, focus ring).
13pub trait IndicationDrawNode {
14 /// Draw the indication into `scene` at the given `rect` (in physical pixels).
15 /// `radius` is the component's corner radii (px) for shape-matched overlays.
16 /// `alpha` is the accumulated compositing alpha from ancestor modifiers.
17 fn draw(&self, scene: &mut Scene, rect: Rect, radius: [f32; 4], alpha: f32);
18}