pub struct MultiOutputManager { /* private fields */ }Expand description
Multi-output display manager
Implementations§
Source§impl MultiOutputManager
impl MultiOutputManager
Sourcepub fn add_output(
&mut self,
connector_id: u32,
crtc_id: u32,
width: u32,
height: u32,
refresh_hz: u32,
) -> Result<u32, KernelError>
pub fn add_output( &mut self, connector_id: u32, crtc_id: u32, width: u32, height: u32, refresh_hz: u32, ) -> Result<u32, KernelError>
Add a new display output
The output is placed to the right of all existing outputs by default.
Sourcepub fn remove_output(&mut self, output_id: u32) -> Result<(), KernelError>
pub fn remove_output(&mut self, output_id: u32) -> Result<(), KernelError>
Remove a display output by ID
Sourcepub fn set_position(
&mut self,
output_id: u32,
x: i32,
y: i32,
) -> Result<(), KernelError>
pub fn set_position( &mut self, output_id: u32, x: i32, y: i32, ) -> Result<(), KernelError>
Set the position of an output in virtual desktop coordinates
Sourcepub fn set_primary(&mut self, output_id: u32) -> Result<(), KernelError>
pub fn set_primary(&mut self, output_id: u32) -> Result<(), KernelError>
Set the primary output
Sourcepub fn get_outputs(&self) -> &[DisplayOutput]
pub fn get_outputs(&self) -> &[DisplayOutput]
Get list of active outputs
Sourcepub fn get_total_size(&self) -> (u32, u32)
pub fn get_total_size(&self) -> (u32, u32)
Get total virtual desktop size
Sourcepub fn point_to_output(&self, x: i32, y: i32) -> Option<(u32, i32, i32)>
pub fn point_to_output(&self, x: i32, y: i32) -> Option<(u32, i32, i32)>
Map a point in virtual desktop coordinates to a specific output
Returns (output_id, local_x, local_y) or None if the point is outside all outputs.
Sourcepub fn primary_output(&self) -> Option<&DisplayOutput>
pub fn primary_output(&self) -> Option<&DisplayOutput>
Get the primary output
Sourcepub fn get_output(&self, output_id: u32) -> Option<&DisplayOutput>
pub fn get_output(&self, output_id: u32) -> Option<&DisplayOutput>
Get a specific output by ID
Sourcepub fn get_output_mut(&mut self, output_id: u32) -> Option<&mut DisplayOutput>
pub fn get_output_mut(&mut self, output_id: u32) -> Option<&mut DisplayOutput>
Get a mutable reference to a specific output by ID
Sourcepub fn flip(&self, output_id: u32, _buffer_id: u32) -> Result<(), KernelError>
pub fn flip(&self, output_id: u32, _buffer_id: u32) -> Result<(), KernelError>
Schedule a page flip on a specific output
In a real implementation this would issue a DRM page flip ioctl.
Sourcepub fn handle_hotplug(
&mut self,
connector_id: u32,
connected: bool,
width: u32,
height: u32,
refresh_hz: u32,
) -> Result<(), KernelError>
pub fn handle_hotplug( &mut self, connector_id: u32, connected: bool, width: u32, height: u32, refresh_hz: u32, ) -> Result<(), KernelError>
Handle a DRM connector hotplug event
If connected=true and the connector is new, adds an output. If connected=false, removes the associated output.
Sourcepub fn auto_layout(&mut self)
pub fn auto_layout(&mut self)
Arrange outputs left-to-right based on their current order
Sourcepub fn num_outputs(&self) -> usize
pub fn num_outputs(&self) -> usize
Get the number of active outputs
Sourcepub fn is_initialized(&self) -> bool
pub fn is_initialized(&self) -> bool
Check if the manager is initialized