pub struct Output {Show 14 fields
pub id: u32,
pub name: String,
pub description: String,
pub make: String,
pub model: String,
pub x: i32,
pub y: i32,
pub physical_width_mm: u32,
pub physical_height_mm: u32,
pub subpixel: SubpixelLayout,
pub transform: OutputTransform,
pub scale: u32,
pub modes: Vec<OutputMode>,
pub enabled: bool,
}Expand description
A display output (physical monitor or virtual display).
Fields§
§id: u32Unique output ID
name: StringHuman-readable output name (e.g., “HDMI-A-1”, “eDP-1”)
description: StringDescription of the output (e.g., “Dell U2720Q”)
make: StringManufacturer name
model: StringModel name
x: i32Position in global compositor coordinate space
y: i32§physical_width_mm: u32Physical width in millimeters (0 = unknown)
physical_height_mm: u32Physical height in millimeters (0 = unknown)
subpixel: SubpixelLayoutSubpixel layout
transform: OutputTransformApplied transform (rotation/flip)
scale: u32Integer scale factor (1 = normal, 2 = HiDPI)
modes: Vec<OutputMode>Supported display modes
enabled: boolWhether this output is enabled
Implementations§
Source§impl Output
impl Output
Sourcepub fn new_virtual(id: u32, name: &str, width: u32, height: u32) -> Self
pub fn new_virtual(id: u32, name: &str, width: u32, height: u32) -> Self
Create a virtual output with a single mode.
Sourcepub fn current_mode(&self) -> Option<&OutputMode>
pub fn current_mode(&self) -> Option<&OutputMode>
Get the current mode (if any).
Sourcepub fn logical_width(&self) -> u32
pub fn logical_width(&self) -> u32
Get the logical width (after transform and scale).
Sourcepub fn logical_height(&self) -> u32
pub fn logical_height(&self) -> u32
Get the logical height (after transform and scale).
Sourcepub fn pixel_width(&self) -> u32
pub fn pixel_width(&self) -> u32
Get the physical pixel width (current mode, no scaling).
Sourcepub fn pixel_height(&self) -> u32
pub fn pixel_height(&self) -> u32
Get the physical pixel height (current mode, no scaling).
Sourcepub fn dpi(&self) -> (u32, u32)
pub fn dpi(&self) -> (u32, u32)
Calculate DPI from physical dimensions and pixel resolution.
Returns (dpi_x, dpi_y) or (0, 0) if physical dimensions are unknown.
Sourcepub fn contains_point(&self, px: i32, py: i32) -> bool
pub fn contains_point(&self, px: i32, py: i32) -> bool
Check if a point (in global compositor coordinates) falls within this output’s logical area.
Sourcepub fn bounds(&self) -> (i32, i32, u32, u32)
pub fn bounds(&self) -> (i32, i32, u32, u32)
Get the bounding rectangle (x, y, width, height) in global coords.
Sourcepub fn set_current_mode(&mut self, index: usize) -> Result<(), KernelError>
pub fn set_current_mode(&mut self, index: usize) -> Result<(), KernelError>
Set the active mode by index. Marks all other modes as non-current.