[−][src]Struct wlroots::area::Area
Generic geometry-like struct. Container an origin (x, y) point and bounds (width, height).
Fields
origin: Origin
size: Size
Methods
impl Area[src]
impl Areapub fn new(origin: Origin, size: Size) -> Self[src]
pub fn new(origin: Origin, size: Size) -> Selfpub fn from_box(wlr_box: wlr_box) -> Self[src]
pub fn from_box(wlr_box: wlr_box) -> SelfConstruct an Area from a wlr_box.
pub fn with_size(self, size: Size) -> Self[src]
pub fn with_size(self, size: Size) -> SelfMakes a new Area with width and height set to the values in the given
Size.
pub fn with_origin(self, origin: Origin) -> Self[src]
pub fn with_origin(self, origin: Origin) -> SelfMakes a new Area with x and y set to the value in the given Origin.
pub fn closest_point(self, x: c_double, y: c_double) -> (c_double, c_double)[src]
pub fn closest_point(self, x: c_double, y: c_double) -> (c_double, c_double)Finds the closest point within the box to the given point. If the (x, y) point lies outside of the box, then it finds the closest corner and returns that.
Returned value is in form of (x, y).
pub fn intersection(self, other_box: Area) -> IntersectionResult[src]
pub fn intersection(self, other_box: Area) -> IntersectionResultGets the intersection of the two areas.
pub fn contains_point(self, x: c_double, y: c_double) -> bool[src]
pub fn contains_point(self, x: c_double, y: c_double) -> boolDetermines if the box contains the given point.
pub fn is_empty(self) -> bool[src]
pub fn is_empty(self) -> boolDetermines if the box is empty (e.g if the bounds give it an area of 0).
pub fn transform(
self,
transform: wl_output_transform,
width: c_int,
height: c_int
) -> Area[src]
pub fn transform(
self,
transform: wl_output_transform,
width: c_int,
height: c_int
) -> AreaTransforms the box coordinates and bounds according to the output transformation.
e.g: If it's WL_OUTPUT_TRANSFORM_90 then it will flip the Area 90° clockwise.
pub fn rotated_bounds(self, rotation: c_float) -> Area[src]
pub fn rotated_bounds(self, rotation: c_float) -> AreaCreates the smallest box that contains the box rotated about its center.
Trait Implementations
impl Clone for Area[src]
impl Clone for Areafn clone(&self) -> Area[src]
fn clone(&self) -> AreaReturns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
fn clone_from(&mut self, source: &Self)Performs copy-assignment from source. Read more
impl Copy for Area[src]
impl Copy for Areaimpl Into<Area> for Origin[src]
impl Into<Area> for Originimpl Into<Area> for Size[src]
impl Into<Area> for Sizeimpl Into<wlr_box> for Area[src]
impl Into<wlr_box> for Areaimpl Eq for Area[src]
impl Eq for Areaimpl Default for Area[src]
impl Default for Areaimpl PartialEq<Area> for Area[src]
impl PartialEq<Area> for Areafn eq(&self, other: &Area) -> bool[src]
fn eq(&self, other: &Area) -> boolThis method tests for self and other values to be equal, and is used by ==. Read more
fn ne(&self, other: &Area) -> bool[src]
fn ne(&self, other: &Area) -> boolThis method tests for !=.
impl Debug for Area[src]
impl Debug for AreaAuto Trait Implementations
Blanket Implementations
impl<T> From for T[src]
impl<T> From for Timpl<T, U> Into for T where
U: From<T>, [src]
impl<T, U> Into for T where
U: From<T>, impl<T> ToOwned for T where
T: Clone, [src]
impl<T> ToOwned for T where
T: Clone, type Owned = T
fn to_owned(&self) -> T[src]
fn to_owned(&self) -> TCreates owned data from borrowed data, usually by cloning. Read more
fn clone_into(&self, target: &mut T)[src]
fn clone_into(&self, target: &mut T)🔬 This is a nightly-only experimental API. (toowned_clone_into)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
impl<T, U> TryFrom for T where
T: From<U>, [src]
impl<T, U> TryFrom for T where
T: From<U>, type Error = !
try_from)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>try_from)Performs the conversion.
impl<T> Borrow for T where
T: ?Sized, [src]
impl<T> Borrow for T where
T: ?Sized, impl<T> BorrowMut for T where
T: ?Sized, [src]
impl<T> BorrowMut for T where
T: ?Sized, fn borrow_mut(&mut self) -> &mut T[src]
fn borrow_mut(&mut self) -> &mut TMutably borrows from an owned value. Read more
impl<T, U> TryInto for T where
U: TryFrom<T>, [src]
impl<T, U> TryInto for T where
U: TryFrom<T>, type Error = <U as TryFrom<T>>::Error
try_from)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>try_from)Performs the conversion.
impl<T> Any for T where
T: 'static + ?Sized, [src]
impl<T> Any for T where
T: 'static + ?Sized, fn get_type_id(&self) -> TypeId[src]
fn get_type_id(&self) -> TypeId🔬 This is a nightly-only experimental API. (get_type_id)
this method will likely be replaced by an associated static
Gets the TypeId of self. Read more