Struct Output

Source
pub struct Output { /* private fields */ }
Expand description

An abstract output.

This handle is stored in the event loop, and allows you to notify clients about any change in the properties of this output.

Implementations§

Source§

impl Output

Source

pub fn new(name: String, physical: PhysicalProperties) -> Output

Create a new output with given name and physical properties.

Source

pub fn set_preferred(&self, mode: Mode)

Sets the preferred mode of this output

If the provided mode was not previously known to this output, it is added to its internal list.

Source

pub fn add_mode(&self, mode: Mode)

Adds a mode to the list of known modes to this output

Source

pub fn current_mode(&self) -> Option<Mode>

Returns the currently advertised mode of the output

Source

pub fn preferred_mode(&self) -> Option<Mode>

Returns the preferred mode of the output

Source

pub fn current_transform(&self) -> Transform

Returns the currently advertised transformation of the output

Source

pub fn current_scale(&self) -> Scale

Returns the currenly set scale of the output

Source

pub fn current_location(&self) -> Point<i32, Logical>

Returns the currenly advertised location of the output

Source

pub fn name(&self) -> String

Returns the name of the output

Source

pub fn description(&self) -> String

Returns the description of the output, if xdg-output is initialized

Source

pub fn physical_properties(&self) -> PhysicalProperties

Returns the physical properties of the output

Source

pub fn modes(&self) -> Vec<Mode>

Returns the currently advertised modes of the output

Source

pub fn delete_mode(&self, mode: Mode)

Removes a mode from the list of known modes

It will not de-advertise it from existing clients (the protocol does not allow it), but it won’t be advertised to now clients from now on.

Source

pub fn change_current_state( &self, new_mode: Option<Mode>, new_transform: Option<Transform>, new_scale: Option<Scale>, new_location: Option<Point<i32, Logical>>, )

Change the current state of this output

You can changed the current mode, transform status, location or scale of this output. Providing None to any of these field means that the value does not change.

If the provided mode was not previously known to this output, it is added to its internal list.

By default, transform status is Normal, and scale is 1.

Source

pub fn user_data(&self) -> &UserDataMap

Returns the user data of this output

Source

pub fn downgrade(&self) -> WeakOutput

Create a weak reference to this output

Source

pub fn cleanup(&self)

Cleanup some internal resource.

Needs to be called periodically, at best before every wayland socket flush.

Note: Space::refresh already calls this function internally. So in case you already use the desktop module you can skip calling this function explicitly.

Source§

impl Output

Source

pub fn create_global<D>(&self, display: &DisplayHandle) -> GlobalId
where D: GlobalDispatch<WlOutput, WlOutputData> + 'static,

Available on crate feature wayland_frontend only.

Create a new output global.

The global is directly registered into the event loop, and this function returns the global handle in case you wish to remove this global in the future.

Calling this function multiple times without destroying the global in between, will result in multiple globals, meaning the output will be advertised to clients multiple times.

Source

pub fn from_resource(output: &WlOutput) -> Option<Output>

Available on crate feature wayland_frontend only.

Attempt to retrieve a Output from an existing resource

Source

pub fn owns(&self, output: &WlOutput) -> bool

Available on crate feature wayland_frontend only.

Check is given wl_output instance is managed by this Output.

Source

pub fn client_outputs<'a>( &'a self, client: &Client, ) -> impl Iterator<Item = WlOutput> + 'a

Available on crate feature wayland_frontend only.

This function returns all managed WlOutput matching the provided Client

Source

pub fn enter(&self, surface: &WlSurface)

Available on crate feature wayland_frontend only.

Sends wl_surface.enter for the provided surface with the matching client output

Source

pub fn leave(&self, surface: &WlSurface)

Available on crate feature wayland_frontend only.

Sends wl_surface.leave for the provided surface with the matching client output

Trait Implementations§

Source§

impl Clone for Output

Source§

fn clone(&self) -> Output

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for Output

Source§

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

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

impl From<&Output> for OutputModeSource

Source§

fn from(output: &Output) -> Self

Converts to this type from the input type.
Source§

impl Hash for Output

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<Output> for WeakOutput

Source§

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

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

const 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<WeakOutput> for Output

Source§

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

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

const 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 Output

Source§

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

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

const 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 Eq for Output

Auto Trait Implementations§

§

impl Freeze for Output

§

impl RefUnwindSafe for Output

§

impl Send for Output

§

impl Sync for Output

§

impl Unpin for Output

§

impl UnwindSafe for Output

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, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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 + Send + Sync>

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<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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> Same for T

Source§

type Output = T

Should always be Self
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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

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