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
impl Output
Sourcepub fn new(name: String, physical: PhysicalProperties) -> Output
pub fn new(name: String, physical: PhysicalProperties) -> Output
Create a new output with given name and physical properties.
Sourcepub fn set_preferred(&self, mode: Mode)
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.
Sourcepub fn current_mode(&self) -> Option<Mode>
pub fn current_mode(&self) -> Option<Mode>
Returns the currently advertised mode of the output
Sourcepub fn preferred_mode(&self) -> Option<Mode>
pub fn preferred_mode(&self) -> Option<Mode>
Returns the preferred mode of the output
Sourcepub fn current_transform(&self) -> Transform
pub fn current_transform(&self) -> Transform
Returns the currently advertised transformation of the output
Sourcepub fn current_scale(&self) -> Scale
pub fn current_scale(&self) -> Scale
Returns the currenly set scale of the output
Sourcepub fn current_location(&self) -> Point<i32, Logical>
pub fn current_location(&self) -> Point<i32, Logical>
Returns the currenly advertised location of the output
Sourcepub fn description(&self) -> String
pub fn description(&self) -> String
Returns the description of the output, if xdg-output is initialized
Sourcepub fn physical_properties(&self) -> PhysicalProperties
pub fn physical_properties(&self) -> PhysicalProperties
Returns the physical properties of the output
Sourcepub fn delete_mode(&self, mode: Mode)
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.
Sourcepub fn change_current_state(
&self,
new_mode: Option<Mode>,
new_transform: Option<Transform>,
new_scale: Option<Scale>,
new_location: Option<Point<i32, Logical>>,
)
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.
Sourcepub fn user_data(&self) -> &UserDataMap
pub fn user_data(&self) -> &UserDataMap
Returns the user data of this output
Sourcepub fn downgrade(&self) -> WeakOutput
pub fn downgrade(&self) -> WeakOutput
Create a weak reference to this output
Sourcepub fn cleanup(&self)
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
impl Output
Sourcepub fn create_global<D>(&self, display: &DisplayHandle) -> GlobalId
Available on crate feature wayland_frontend only.
pub fn create_global<D>(&self, display: &DisplayHandle) -> GlobalId
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.
Sourcepub fn from_resource(output: &WlOutput) -> Option<Output>
Available on crate feature wayland_frontend only.
pub fn from_resource(output: &WlOutput) -> Option<Output>
wayland_frontend only.Attempt to retrieve a Output from an existing resource
Sourcepub fn owns(&self, output: &WlOutput) -> bool
Available on crate feature wayland_frontend only.
pub fn owns(&self, output: &WlOutput) -> bool
wayland_frontend only.Sourcepub fn client_outputs<'a>(
&'a self,
client: &Client,
) -> impl Iterator<Item = WlOutput> + 'a
Available on crate feature wayland_frontend only.
pub fn client_outputs<'a>( &'a self, client: &Client, ) -> impl Iterator<Item = WlOutput> + 'a
wayland_frontend only.Trait Implementations§
Source§impl From<&Output> for OutputModeSource
impl From<&Output> for OutputModeSource
Source§impl PartialEq<Output> for WeakOutput
impl PartialEq<Output> for WeakOutput
Source§impl PartialEq<WeakOutput> for Output
impl PartialEq<WeakOutput> for Output
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> 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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.