[−]Struct wayland_protocols::xdg_shell::client::xdg_positioner::ConstraintAdjustment
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 Clone for ConstraintAdjustment
fn clone(&self) -> ConstraintAdjustment
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl PartialOrd<ConstraintAdjustment> for ConstraintAdjustment
fn partial_cmp(&self, other: &ConstraintAdjustment) -> Option<Ordering>
fn lt(&self, other: &ConstraintAdjustment) -> bool
fn le(&self, other: &ConstraintAdjustment) -> bool
fn gt(&self, other: &ConstraintAdjustment) -> bool
fn ge(&self, other: &ConstraintAdjustment) -> bool
impl Extend<ConstraintAdjustment> for ConstraintAdjustment
fn extend<T: IntoIterator<Item = ConstraintAdjustment>>(&mut self, iterator: T)
impl PartialEq<ConstraintAdjustment> for ConstraintAdjustment
fn eq(&self, other: &ConstraintAdjustment) -> bool
fn ne(&self, other: &ConstraintAdjustment) -> bool
impl Ord for ConstraintAdjustment
fn cmp(&self, other: &ConstraintAdjustment) -> Ordering
fn max(self, other: Self) -> Self
1.21.0[src]
fn min(self, other: Self) -> Self
1.21.0[src]
fn clamp(self, min: Self, max: Self) -> Self
[src]
impl Copy for ConstraintAdjustment
impl Hash for ConstraintAdjustment
fn hash<__H: Hasher>(&self, state: &mut __H)
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
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 Debug for ConstraintAdjustment
impl FromIterator<ConstraintAdjustment> for ConstraintAdjustment
fn from_iter<T: IntoIterator<Item = ConstraintAdjustment>>(
iterator: T
) -> ConstraintAdjustment
iterator: T
) -> ConstraintAdjustment
impl Octal for ConstraintAdjustment
impl Binary for ConstraintAdjustment
impl LowerHex for ConstraintAdjustment
impl UpperHex for ConstraintAdjustment
Auto Trait Implementations
impl Send for ConstraintAdjustment
impl Unpin for ConstraintAdjustment
impl Sync for ConstraintAdjustment
impl UnwindSafe for ConstraintAdjustment
impl RefUnwindSafe for ConstraintAdjustment
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,