Skip to main content

ferroui_base/platform/
i_platform_render_interface_region.rs

1use super::{LtrbPixelRect, LtrbRect};
2use crate::Point;
3
4/// A platform region: a set of pixel rectangles.
5pub trait IPlatformRenderInterfaceRegion {
6    fn add_rect(&self, rect: LtrbPixelRect);
7    fn reset(&self);
8    fn is_empty(&self) -> bool;
9    fn bounds(&self) -> LtrbPixelRect;
10    fn rects(&self) -> Vec<LtrbPixelRect>;
11    fn intersects(&self, rect: LtrbRect) -> bool;
12    fn contains(&self, pt: Point) -> bool;
13    fn dispose(&self);
14    /// Lets the backend recover its concrete type.
15    fn as_any(&self) -> &dyn std::any::Any;
16}