Enum wayland_client::protocol::wl_output::Event

source ·
#[non_exhaustive]
pub enum Event { Geometry { x: i32, y: i32, physical_width: i32, physical_height: i32, subpixel: WEnum<Subpixel>, make: String, model: String, transform: WEnum<Transform>, }, Mode { flags: WEnum<Mode>, width: i32, height: i32, refresh: i32, }, Done, Scale { factor: i32, }, Name { name: String, }, Description { description: String, }, }

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Geometry

properties of the output

The geometry event describes geometric properties of the output. The event is sent when binding to the output object and whenever any of the properties change.

The physical size can be set to zero if it doesn’t make sense for this output (e.g. for projectors or virtual outputs).

The geometry event will be followed by a done event (starting from version 2).

Clients should use wl_surface.preferred_buffer_transform instead of the transform advertised by this event to find the preferred buffer transform to use for a surface.

Note: wl_output only advertises partial information about the output position and identification. Some compositors, for instance those not implementing a desktop-style output layout or those exposing virtual outputs, might fake this information. Instead of using x and y, clients should use xdg_output.logical_position. Instead of using make and model, clients should use name and description.

Fields

§x: i32

x position within the global compositor space

§y: i32

y position within the global compositor space

§physical_width: i32

width in millimeters of the output

§physical_height: i32

height in millimeters of the output

§subpixel: WEnum<Subpixel>

subpixel orientation of the output

§make: String

textual description of the manufacturer

§model: String

textual description of the model

§transform: WEnum<Transform>

additional transformation applied to buffer contents during presentation

§

Mode

advertise available modes for the output

The mode event describes an available mode for the output.

The event is sent when binding to the output object and there will always be one mode, the current mode. The event is sent again if an output changes mode, for the mode that is now current. In other words, the current mode is always the last mode that was received with the current flag set.

Non-current modes are deprecated. A compositor can decide to only advertise the current mode and never send other modes. Clients should not rely on non-current modes.

The size of a mode is given in physical hardware units of the output device. This is not necessarily the same as the output size in the global compositor space. For instance, the output may be scaled, as described in wl_output.scale, or transformed, as described in wl_output.transform. Clients willing to retrieve the output size in the global compositor space should use xdg_output.logical_size instead.

The vertical refresh rate can be set to zero if it doesn’t make sense for this output (e.g. for virtual outputs).

The mode event will be followed by a done event (starting from version 2).

Clients should not use the refresh rate to schedule frames. Instead, they should use the wl_surface.frame event or the presentation-time protocol.

Note: this information is not always meaningful for all outputs. Some compositors, such as those exposing virtual outputs, might fake the refresh rate or the size.

Fields

§flags: WEnum<Mode>

bitfield of mode flags

§width: i32

width of the mode in hardware units

§height: i32

height of the mode in hardware units

§refresh: i32

vertical refresh rate in mHz

§

Done

sent all information about output

This event is sent after all other properties have been sent after binding to the output object and after any other property changes done after that. This allows changes to the output properties to be seen as atomic, even if they happen via multiple events.

Only available since version 2 of the interface

§

Scale

output scaling properties

This event contains scaling geometry information that is not in the geometry event. It may be sent after binding the output object or if the output scale changes later. The compositor will emit a non-zero, positive value for scale. If it is not sent, the client should assume a scale of 1.

A scale larger than 1 means that the compositor will automatically scale surface buffers by this amount when rendering. This is used for very high resolution displays where applications rendering at the native resolution would be too small to be legible.

Clients should use wl_surface.preferred_buffer_scale instead of this event to find the preferred buffer scale to use for a surface.

The scale event will be followed by a done event.

Only available since version 2 of the interface

Fields

§factor: i32

scaling factor of output

§

Name

name of this output

Many compositors will assign user-friendly names to their outputs, show them to the user, allow the user to refer to an output, etc. The client may wish to know this name as well to offer the user similar behaviors.

The name is a UTF-8 string with no convention defined for its contents. Each name is unique among all wl_output globals. The name is only guaranteed to be unique for the compositor instance.

The same output name is used for all clients for a given wl_output global. Thus, the name can be shared across processes to refer to a specific wl_output global.

The name is not guaranteed to be persistent across sessions, thus cannot be used to reliably identify an output in e.g. configuration files.

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.

The name event is sent after binding the output object. This event is only sent once per output object, and the name does not change over the lifetime of the wl_output global.

Compositors may re-use the same output name if the wl_output global is destroyed and re-created later. Compositors should avoid re-using the same name if possible.

The name event will be followed by a done event.

Only available since version 4 of the interface

Fields

§name: String

output name

§

Description

human-readable description of this output

Many compositors can produce human-readable descriptions of their outputs. The client may wish to know this description as well, e.g. for output selection purposes.

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’.

The description event is sent after binding the output object and whenever the description changes. The description is optional, and may not be sent at all.

The description event will be followed by a done event.

Only available since version 4 of the interface

Fields

§description: String

output description

Implementations§

source§

impl Event

source

pub fn opcode(&self) -> u16

Get the opcode number of this message

Trait Implementations§

source§

impl Debug for Event

source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for Event

§

impl RefUnwindSafe for Event

§

impl Send for Event

§

impl Sync for Event

§

impl Unpin for Event

§

impl UnwindSafe for Event

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> 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, 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, U> TryFrom<U> for T
where U: Into<T>,

source§

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

source§

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.