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
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional 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.

Trait Implementations§

source§

impl Clone for OutputInfo

source§

fn clone(&self) -> OutputInfo

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for OutputInfo

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> Downcast for T
where T: Any,

source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert 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>

Convert 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)

Convert &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)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
source§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more