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

Output

An output is a screen, where the rendered result in displayed.

Implementations§

source§

impl Output

source

pub fn overlaps(&self, other: &Rectangle<i32, ScreenNormalized>) -> bool

Checks whether an output overlaps a given rectangle.

Note

This check uses a special coordinate system, coords::ScreenNormalized, see the documentation there for the justification. If this is not what is the most suitable for your compositor, you are free implement other overlap checks. This is not used internally by this crate.

source

pub async fn notify_change(self: &Rc<Self>, change: OutputChange)

Notify that the output has changed

source

pub fn new( physical_size: Extent<u32, Physical>, make: &str, model: &str, name: &str, global_id: u32 ) -> Self

Create a new output

source

pub fn global_id(&self) -> u32

The global ID in the compositor’s global store.

source

pub fn scale(&self) -> Scale<u32>

Scale of the output

source

pub fn scale_f32(&self) -> Scale<f32>

Scale of the output as a f32

source

pub fn set_scale(&self, scale: u32)

Set the scale of the output

source

pub fn name(&self) -> &str

Name of the output

source

pub fn logical_geometry(&self) -> Rectangle<i32, ScreenNormalized>

Scale invariant logical geometry of the output. This is used to determine where a window is placed, so that it is not dependent on the scale of the window. To avoid a dependency circle: window scale -> window placement -> window scale.

Currently this is calculated as the size of the output divided by its scale.

source

pub fn geometry(&self) -> Rectangle<i32, Screen>

Geometry of the output in screen space.

source

pub fn size(&self) -> Extent<u32, Screen>

Size of the output in screen space.

source

pub fn position(&self) -> Point<i32, Screen>

Position of the output in screen space.

source

pub fn logical_position(&self) -> Point<i32, ScreenNormalized>

Scale invariant logical position of the output.

See logical_geometry.

source

pub fn set_size(&self, geometry: Extent<u32, Screen>)

Set the screen space size of the output

source

pub fn set_position(&self, position: Point<i32, Screen>)

Set the screen space position of the output

source

pub fn set_logical_position( &self, logical_position: Point<i32, ScreenNormalized> )

Set the scale invariant logical position of the output.

See logical_geometry.

source

pub fn model(&self) -> &str

Model name of the output

source

pub fn make(&self) -> &str

Make of the output

source

pub fn transform(&self) -> Transform

Output transformation

source

pub fn set_transform(&self, transform: Transform)

Set the output transformation

source

pub fn physical_size(&self) -> Extent<u32, Physical>

Physical size in millimeters

Trait Implementations§

source§

impl Debug for Output

source§

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

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

impl EventSource<OutputChangeEvent> for Output

§

type Source = <Broadcast<OutputChangeEvent> as EventSource<OutputChangeEvent>>::Source

Type of event stream you get from this event source.
source§

fn subscribe(&self) -> Self::Source

Get a stream of events from the event source.
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

Auto Trait Implementations§

§

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 Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Az for T

source§

fn az<Dst>(self) -> Dstwhere T: Cast<Dst>,

Casts the value.
source§

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

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

const: unstable · source§

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

Mutably borrows from an owned value. Read more
source§

impl<Src, Dst> CastFrom<Src> for Dstwhere Src: Cast<Dst>,

source§

fn cast_from(src: Src) -> Dst

Casts the value.
source§

impl<T> CheckedAs for T

source§

fn checked_as<Dst>(self) -> Option<Dst>where T: CheckedCast<Dst>,

Casts the value.
source§

impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere Src: CheckedCast<Dst>,

source§

fn checked_cast_from(src: Src) -> Option<Dst>

Casts the value.
source§

impl<T> From<T> for T

const: unstable · 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 Twhere U: From<T>,

const: unstable · 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<Src, Dst> LosslessTryInto<Dst> for Srcwhere Dst: LosslessTryFrom<Src>,

source§

fn lossless_try_into(self) -> Option<Dst>

Performs the conversion.
source§

impl<Src, Dst> LossyInto<Dst> for Srcwhere Dst: LossyFrom<Src>,

source§

fn lossy_into(self) -> Dst

Performs the conversion.
source§

impl<T> OverflowingAs for T

source§

fn overflowing_as<Dst>(self) -> (Dst, bool)where T: OverflowingCast<Dst>,

Casts the value.
source§

impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere Src: OverflowingCast<Dst>,

source§

fn overflowing_cast_from(src: Src) -> (Dst, bool)

Casts the value.
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> SaturatingAs for T

source§

fn saturating_as<Dst>(self) -> Dstwhere T: SaturatingCast<Dst>,

Casts the value.
source§

impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere Src: SaturatingCast<Dst>,

source§

fn saturating_cast_from(src: Src) -> Dst

Casts the value.
source§

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

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.
source§

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

§

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

The type returned in the event of a conversion error.
const: unstable · source§

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

Performs the conversion.
source§

impl<T> UnwrappedAs for T

source§

fn unwrapped_as<Dst>(self) -> Dstwhere T: UnwrappedCast<Dst>,

Casts the value.
source§

impl<Src, Dst> UnwrappedCastFrom<Src> for Dstwhere Src: UnwrappedCast<Dst>,

source§

fn unwrapped_cast_from(src: Src) -> Dst

Casts the value.
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
source§

impl<T> WrappingAs for T

source§

fn wrapping_as<Dst>(self) -> Dstwhere T: WrappingCast<Dst>,

Casts the value.
source§

impl<Src, Dst> WrappingCastFrom<Src> for Dstwhere Src: WrappingCast<Dst>,

source§

fn wrapping_cast_from(src: Src) -> Dst

Casts the value.