Skip to main content

ferroui_linuxframebuffer/output/
i_output_backend.rs

1//! The output a top-level is drawn onto (the port of `IOutputBackend.cs`).
2
3use super::IGlOutputBackend;
4use ferroui_base::platform::surfaces::IPlatformRenderSurface;
5use ferroui_base::platform::ISurfaceOrientation;
6use ferroui_base::PixelSize;
7use std::sync::Arc;
8
9pub trait IOutputBackend: IPlatformRenderSurface {
10    fn pixel_size(&self) -> PixelSize;
11
12    fn scaling(&self) -> f64;
13
14    fn set_scaling(&self, value: f64);
15
16    /// The output as the render surface of the top-level.
17    fn as_render_surface(self: Arc<Self>) -> Arc<dyn IPlatformRenderSurface>;
18
19    /// The output as one that renders with OpenGL (the reference tests
20    /// the type).
21    fn as_gl_output_backend(&self) -> Option<&dyn IGlOutputBackend> {
22        None
23    }
24
25    /// The output as one that has an orientation (the reference tests the
26    /// type).
27    fn as_surface_orientation(&self) -> Option<&dyn ISurfaceOrientation> {
28        None
29    }
30}