pub struct ZwlrOutputHeadV1 { /* private fields */ }
Available on crate feature server only.
Expand description

output device

A head is an output device. The difference between a wl_output object and a head is that heads are advertised even if they are turned off. A head object only advertises properties and cannot be used directly to change them.

A head has some read-only properties: modes, name, description and physical_size. These cannot be changed by clients.

Other properties can be updated via a wlr_output_configuration object.

Properties sent via this interface are applied atomically via the wlr_output_manager.done event. No guarantees are made regarding the order in which properties are sent.

See also the Request enum for this interface.

Implementations§

source§

impl ZwlrOutputHeadV1

source

pub fn name(&self, name: String)

head name

This event describes the head name.

The naming convention is compositor defined, but limited to alphanumeric characters and dashes (-). Each name is unique among all wlr_output_head objects, but if a wlr_output_head object is destroyed the same name may be reused later. The names will also remain consistent across sessions with the same hardware and software configuration.

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.

If the compositor implements the xdg-output protocol and this head is enabled, the xdg_output.name event must report the same name.

The name event is sent after a wlr_output_head object is created. This event is only sent once per object, and the name does not change over the lifetime of the wlr_output_head object.

source

pub fn description(&self, description: String)

head description

This event describes a human-readable description of the head.

The description is a UTF-8 string with no convention defined for its contents. Examples might include ‘Foocorp 11“ Display’ or ‘Virtual X11 output via :1’. However, do not assume that the name is a reflection of the make, model, serial of the underlying DRM connector or the display name of the underlying X11 connection, etc.

If the compositor implements xdg-output and this head is enabled, the xdg_output.description must report the same description.

The description event is sent after a wlr_output_head object is created. This event is only sent once per object, and the description does not change over the lifetime of the wlr_output_head object.

source

pub fn physical_size(&self, width: i32, height: i32)

head physical size

This event describes the physical size of the head. This event is only sent if the head has a physical size (e.g. is not a projector or a virtual device).

source

pub fn mode(&self, mode: &ZwlrOutputModeV1)

introduce a mode

This event introduces a mode for this head. It is sent once per supported mode.

source

pub fn enabled(&self, enabled: i32)

head is enabled or disabled

This event describes whether the head is enabled. A disabled head is not mapped to a region of the global compositor space.

When a head is disabled, some properties (current_mode, position, transform and scale) are irrelevant.

source

pub fn current_mode(&self, mode: &ZwlrOutputModeV1)

current mode

This event describes the mode currently in use for this head. It is only sent if the output is enabled.

source

pub fn position(&self, x: i32, y: i32)

current position

This events describes the position of the head in the global compositor space. It is only sent if the output is enabled.

source

pub fn transform(&self, transform: Transform)

current transformation

This event describes the transformation currently applied to the head. It is only sent if the output is enabled.

source

pub fn scale(&self, scale: f64)

current scale

This events describes the scale of the head in the global compositor space. It is only sent if the output is enabled.

source

pub fn finished(&self)

the head has disappeared

This event indicates that the head is no longer available. The head object becomes inert. Clients should send a destroy request and release any resources associated with it.

source

pub fn make(&self, make: String)

head manufacturer

This event describes the manufacturer of the head.

This must report the same make as the wl_output interface does in its geometry event.

Together with the model and serial_number events the purpose is to allow clients to recognize heads from previous sessions and for example load head-specific configurations back.

It is not guaranteed this event will be ever sent. A reason for that can be that the compositor does not have information about the make of the head or the definition of a make is not sensible in the current setup, for example in a virtual session. Clients can still try to identify the head by available information from other events but should be aware that there is an increased risk of false positives.

It is not recommended to display the make string in UI to users. For that the string provided by the description event should be preferred.

source

pub fn model(&self, model: String)

head model

This event describes the model of the head.

This must report the same model as the wl_output interface does in its geometry event.

Together with the make and serial_number events the purpose is to allow clients to recognize heads from previous sessions and for example load head-specific configurations back.

It is not guaranteed this event will be ever sent. A reason for that can be that the compositor does not have information about the model of the head or the definition of a model is not sensible in the current setup, for example in a virtual session. Clients can still try to identify the head by available information from other events but should be aware that there is an increased risk of false positives.

It is not recommended to display the model string in UI to users. For that the string provided by the description event should be preferred.

source

pub fn serial_number(&self, serial_number: String)

head serial number

This event describes the serial number of the head.

Together with the make and model events the purpose is to allow clients to recognize heads from previous sessions and for example load head- specific configurations back.

It is not guaranteed this event will be ever sent. A reason for that can be that the compositor does not have information about the serial number of the head or the definition of a serial number is not sensible in the current setup. Clients can still try to identify the head by available information from other events but should be aware that there is an increased risk of false positives.

It is not recommended to display the serial_number string in UI to users. For that the string provided by the description event should be preferred.

source

pub fn adaptive_sync(&self, state: AdaptiveSyncState)

current adaptive sync state

This event describes whether adaptive sync is currently enabled for the head or not. Adaptive sync is also known as Variable Refresh Rate or VRR.

Trait Implementations§

source§

impl Borrow<ObjectId> for ZwlrOutputHeadV1

source§

fn borrow(&self) -> &ObjectId

Immutably borrows from an owned value. Read more
source§

impl Clone for ZwlrOutputHeadV1

source§

fn clone(&self) -> ZwlrOutputHeadV1

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 ZwlrOutputHeadV1

source§

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

Formats the value using the given formatter. Read more
source§

impl Hash for ZwlrOutputHeadV1

source§

fn hash<H: Hasher>(&self, state: &mut H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl PartialEq<Weak<ZwlrOutputHeadV1>> for ZwlrOutputHeadV1

source§

fn eq(&self, other: &Weak<ZwlrOutputHeadV1>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq for ZwlrOutputHeadV1

source§

fn eq(&self, other: &ZwlrOutputHeadV1) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Resource for ZwlrOutputHeadV1

source§

type Request = Request

The request enum for this interface
source§

type Event<'event> = Event<'event>

The event enum for this interface
source§

fn interface() -> &'static Interface

The interface description
source§

fn id(&self) -> ObjectId

The ID of this object
source§

fn version(&self) -> u32

The version of this object
source§

fn data<U: 'static>(&self) -> Option<&U>

Access the user-data associated with this object
source§

fn object_data(&self) -> Option<&Arc<dyn Any + Send + Sync>>

Access the raw data associated with this object. Read more
source§

fn handle(&self) -> &WeakHandle

Access the backend handle associated with this object
source§

fn from_id(conn: &DisplayHandle, id: ObjectId) -> Result<Self, InvalidId>

Create an object resource from its ID Read more
source§

fn send_event(&self, evt: Self::Event<'_>) -> Result<(), InvalidId>

Send an event to this object
source§

fn parse_request( conn: &DisplayHandle, msg: Message<ObjectId, OwnedFd>, ) -> Result<(Self, Self::Request), DispatchError>

Parse a event for this object Read more
source§

fn write_event<'a>( &self, conn: &DisplayHandle, msg: Self::Event<'a>, ) -> Result<Message<ObjectId, BorrowedFd<'a>>, InvalidId>

Serialize an event for this object Read more
source§

fn client(&self) -> Option<Client>

The client owning this object Read more
source§

fn is_alive(&self) -> bool

Checks if the Wayland object associated with this proxy is still alive
source§

fn post_error(&self, code: impl Into<u32>, error: impl Into<String>)

Trigger a protocol error on this object Read more
source§

fn downgrade(&self) -> Weak<Self>

Creates a weak handle to this object Read more
source§

impl Eq for ZwlrOutputHeadV1

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§

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

source§

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

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.