Struct smithay_client_toolkit::output::OutputInfo
source · #[non_exhaustive]pub struct OutputInfo {Show 13 fields
pub id: u32,
pub model: String,
pub make: String,
pub location: (i32, i32),
pub physical_size: (i32, i32),
pub subpixel: Subpixel,
pub transform: Transform,
pub scale_factor: i32,
pub modes: Vec<Mode>,
pub logical_position: Option<(i32, i32)>,
pub logical_size: Option<(i32, i32)>,
pub name: Option<String>,
pub description: Option<String>,
}
Expand description
Information about an output.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.id: u32
The id of the output.
This corresponds to the global name
of the wl_output.
model: String
The model name of this output as advertised by the server.
make: String
The make name of this output as advertised by the server.
location: (i32, i32)
Location of the top-left corner of this output in compositor space.
Note that the compositor may decide to always report (0,0) if it decides clients are not allowed to know this information.
physical_size: (i32, i32)
Physical dimensions of this output, in millimeters.
This value may be set to (0, 0) if a physical size does not make sense for the output (e.g. projectors and virtual outputs).
subpixel: Subpixel
The subpixel layout for this output.
transform: Transform
The current transformation applied to this output
You can pre-render your buffers taking this information into account and advertising it via
wl_buffer.set_transform
for better performance.
scale_factor: i32
The scaling factor of this output
Any buffer whose scaling factor does not match the one of the output it is displayed on will be rescaled accordingly.
For example, a buffer of scaling factor 1 will be doubled in size if the output scaling factor is 2.
You can pre-render your buffers taking this information into account and advertising it via
wl_surface.set_buffer_scale
so you may advertise a higher detail image.
modes: Vec<Mode>
Possible modes for an output.
logical_position: Option<(i32, i32)>
Logical position in global compositor space
logical_size: Option<(i32, i32)>
Logical size in global compositor space
name: Option<String>
The name of the this output as advertised by the surface.
Examples of names include ‘HDMI-A-1’, ‘WL-1’, ‘X11-1’, etc. However, do not assume that the name is a reflection of an underlying DRM connector, X11 connection, etc.
Compositors are not required to provide a name for the output and the value may be None
.
The name will be None
if the compositor does not support version 4 of the wl-output protocol or
version 2 of the zxdg-output-v1 protocol.
description: Option<String>
The description of this output as advertised by the server
The description is a UTF-8 string with no convention defined for its contents. The description is not guaranteed to be unique among all wl_output globals. Examples might include ‘Foocorp 11“ Display’ or ‘Virtual X11 output via :1’.
Compositors are not required to provide a description of the output and the value may be None
.
The value will be None
if the compositor does not support version 4 of the wl-output
protocol, version 2 of the zxdg-output-v1 protocol.
Implementations§
source§impl OutputInfo
impl OutputInfo
fn new(id: u32) -> OutputInfo
Trait Implementations§
source§impl Clone for OutputInfo
impl Clone for OutputInfo
source§fn clone(&self) -> OutputInfo
fn clone(&self) -> OutputInfo
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl Freeze for OutputInfo
impl RefUnwindSafe for OutputInfo
impl Send for OutputInfo
impl Sync for OutputInfo
impl Unpin for OutputInfo
impl UnwindSafe for OutputInfo
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.