[]Struct wayland_protocols::xdg_shell::server::xdg_positioner::ConstraintAdjustment

pub struct ConstraintAdjustment { /* fields omitted */ }

constraint adjustments

The constraint adjustment value define ways the compositor will adjust the position of the surface, if the unadjusted position would result in the surface being partly constrained.

Whether a surface is considered 'constrained' is left to the compositor to determine. For example, the surface may be partly outside the compositor's defined 'work area', thus necessitating the child surface's position be adjusted until it is entirely inside the work area.

The adjustments can be combined, according to a defined precedence: 1) Flip, 2) Slide, 3) Resize.

Methods

impl ConstraintAdjustment

pub const None: ConstraintAdjustment

don't move the child surface when constrained

Don't alter the surface position even if it is constrained on some axis, for example partially outside the edge of an output.

pub const SlideX: ConstraintAdjustment

move along the x axis until unconstrained

Slide the surface along the x axis until it is no longer constrained.

First try to slide towards the direction of the gravity on the x axis until either the edge in the opposite direction of the gravity is unconstrained or the edge in the direction of the gravity is constrained.

Then try to slide towards the opposite direction of the gravity on the x axis until either the edge in the direction of the gravity is unconstrained or the edge in the opposite direction of the gravity is constrained.

pub const SlideY: ConstraintAdjustment

move along the y axis until unconstrained

Slide the surface along the y axis until it is no longer constrained.

First try to slide towards the direction of the gravity on the y axis until either the edge in the opposite direction of the gravity is unconstrained or the edge in the direction of the gravity is constrained.

Then try to slide towards the opposite direction of the gravity on the y axis until either the edge in the direction of the gravity is unconstrained or the edge in the opposite direction of the gravity is constrained.

pub const FlipX: ConstraintAdjustment

invert the anchor and gravity on the x axis

Invert the anchor and gravity on the x axis if the surface is constrained on the x axis. For example, if the left edge of the surface is constrained, the gravity is 'left' and the anchor is 'left', change the gravity to 'right' and the anchor to 'right'.

If the adjusted position also ends up being constrained, the resulting position of the flip_x adjustment will be the one before the adjustment.

pub const FlipY: ConstraintAdjustment

invert the anchor and gravity on the y axis

Invert the anchor and gravity on the y axis if the surface is constrained on the y axis. For example, if the bottom edge of the surface is constrained, the gravity is 'bottom' and the anchor is 'bottom', change the gravity to 'top' and the anchor to 'top'.

The adjusted position is calculated given the original anchor rectangle and offset, but with the new flipped anchor and gravity values.

If the adjusted position also ends up being constrained, the resulting position of the flip_y adjustment will be the one before the adjustment.

pub const ResizeX: ConstraintAdjustment

horizontally resize the surface

Resize the surface horizontally so that it is completely unconstrained.

pub const ResizeY: ConstraintAdjustment

vertically resize the surface

Resize the surface vertically so that it is completely unconstrained.

pub const fn empty() -> ConstraintAdjustment

Returns an empty set of flags

pub const fn all() -> ConstraintAdjustment

Returns the set containing all flags.

pub const fn bits(&self) -> u32

Returns the raw value of the flags currently stored.

pub fn from_bits(bits: u32) -> Option<ConstraintAdjustment>

Convert from underlying bit representation, unless that representation contains bits that do not correspond to a flag.

pub const fn from_bits_truncate(bits: u32) -> ConstraintAdjustment

Convert from underlying bit representation, dropping any bits that do not correspond to flags.

pub const fn is_empty(&self) -> bool

Returns true if no flags are currently stored.

pub const fn is_all(&self) -> bool

Returns true if all flags are currently set.

pub const fn intersects(&self, other: ConstraintAdjustment) -> bool

Returns true if there are flags common to both self and other.

pub const fn contains(&self, other: ConstraintAdjustment) -> bool

Returns true all of the flags in other are contained within self.

pub fn insert(&mut self, other: ConstraintAdjustment)

Inserts the specified flags in-place.

pub fn remove(&mut self, other: ConstraintAdjustment)

Removes the specified flags in-place.

pub fn toggle(&mut self, other: ConstraintAdjustment)

Toggles the specified flags in-place.

pub fn set(&mut self, other: ConstraintAdjustment, value: bool)

Inserts or removes the specified flags depending on the passed value.

impl ConstraintAdjustment[src]

Trait Implementations

impl Eq for ConstraintAdjustment

impl Extend<ConstraintAdjustment> for ConstraintAdjustment

impl Ord for ConstraintAdjustment

fn max(self, other: Self) -> Self1.21.0[src]

Compares and returns the maximum of two values. Read more

fn min(self, other: Self) -> Self1.21.0[src]

Compares and returns the minimum of two values. Read more

fn clamp(self, min: Self, max: Self) -> Self[src]

🔬 This is a nightly-only experimental API. (clamp)

Restrict a value to a certain interval. Read more

impl PartialEq<ConstraintAdjustment> for ConstraintAdjustment

impl Clone for ConstraintAdjustment

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl PartialOrd<ConstraintAdjustment> for ConstraintAdjustment

impl Copy for ConstraintAdjustment

impl Debug for ConstraintAdjustment

impl Sub<ConstraintAdjustment> for ConstraintAdjustment

type Output = ConstraintAdjustment

The resulting type after applying the - operator.

fn sub(self, other: ConstraintAdjustment) -> ConstraintAdjustment

Returns the set difference of the two sets of flags.

impl SubAssign<ConstraintAdjustment> for ConstraintAdjustment

fn sub_assign(&mut self, other: ConstraintAdjustment)

Disables all flags enabled in the set.

impl Not for ConstraintAdjustment

type Output = ConstraintAdjustment

The resulting type after applying the ! operator.

fn not(self) -> ConstraintAdjustment

Returns the complement of this set of flags.

impl BitAnd<ConstraintAdjustment> for ConstraintAdjustment

type Output = ConstraintAdjustment

The resulting type after applying the & operator.

fn bitand(self, other: ConstraintAdjustment) -> ConstraintAdjustment

Returns the intersection between the two sets of flags.

impl BitOr<ConstraintAdjustment> for ConstraintAdjustment

type Output = ConstraintAdjustment

The resulting type after applying the | operator.

fn bitor(self, other: ConstraintAdjustment) -> ConstraintAdjustment

Returns the union of the two sets of flags.

impl BitXor<ConstraintAdjustment> for ConstraintAdjustment

type Output = ConstraintAdjustment

The resulting type after applying the ^ operator.

fn bitxor(self, other: ConstraintAdjustment) -> ConstraintAdjustment

Returns the left flags, but with all the right flags toggled.

impl BitAndAssign<ConstraintAdjustment> for ConstraintAdjustment

fn bitand_assign(&mut self, other: ConstraintAdjustment)

Disables all flags disabled in the set.

impl BitOrAssign<ConstraintAdjustment> for ConstraintAdjustment

fn bitor_assign(&mut self, other: ConstraintAdjustment)

Adds the set of flags.

impl BitXorAssign<ConstraintAdjustment> for ConstraintAdjustment

fn bitxor_assign(&mut self, other: ConstraintAdjustment)

Toggles the set of flags.

impl Hash for ConstraintAdjustment

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

Feeds a slice of this type into the given [Hasher]. Read more

impl FromIterator<ConstraintAdjustment> for ConstraintAdjustment

impl Octal for ConstraintAdjustment

impl Binary for ConstraintAdjustment

impl LowerHex for ConstraintAdjustment

impl UpperHex for ConstraintAdjustment

Auto Trait Implementations

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]