Struct ActorBox

Source
pub struct ActorBox(/* private fields */);

Implementations§

Source§

impl ActorBox

Source

pub fn new(x_1: f32, y_1: f32, x_2: f32, y_2: f32) -> ActorBox

Allocates a new ActorBox using the passed coordinates for the top left and bottom right points.

This function is the logical equivalent of:

  clutter_actor_box_init (clutter_actor_box_alloc (),
                          x_1, y_1,
                          x_2, y_2);
§x_1

X coordinate of the top left point

§y_1

Y coordinate of the top left point

§x_2

X coordinate of the bottom right point

§y_2

Y coordinate of the bottom right point

§Returns

the newly allocated ActorBox. Use ActorBox::free to free the resources

Source

pub fn contains(&self, x: f32, y: f32) -> bool

Checks whether a point with x, y coordinates is contained withing self

§x

X coordinate of the point

§y

Y coordinate of the point

§Returns

true if the point is contained by the ActorBox

Source

pub fn get_area(&self) -> f32

Retrieves the area of self

§Returns

the area of a ActorBox, in pixels

Source

pub fn get_height(&self) -> f32

Retrieves the height of the self

§Returns

the height of the box

Source

pub fn get_origin(&self) -> (f32, f32)

Retrieves the origin of self

§x

return location for the X coordinate, or None

§y

return location for the Y coordinate, or None

Source

pub fn get_size(&self) -> (f32, f32)

Retrieves the size of self

§width

return location for the width, or None

§height

return location for the height, or None

Source

pub fn get_width(&self) -> f32

Retrieves the width of the self

§Returns

the width of the box

Source

pub fn get_x(&self) -> f32

Retrieves the X coordinate of the origin of self

§Returns

the X coordinate of the origin

Source

pub fn get_y(&self) -> f32

Retrieves the Y coordinate of the origin of self

§Returns

the Y coordinate of the origin

Source

pub fn init( &mut self, x_1: f32, y_1: f32, x_2: f32, y_2: f32, ) -> Option<ActorBox>

Initializes self with the given coordinates.

§x_1

X coordinate of the top left point

§y_1

Y coordinate of the top left point

§x_2

X coordinate of the bottom right point

§y_2

Y coordinate of the bottom right point

§Returns

the initialized ActorBox

Source

pub fn init_rect(&mut self, x: f32, y: f32, width: f32, height: f32)

Initializes self with the given origin and size.

§x

X coordinate of the origin

§y

Y coordinate of the origin

§width

width of the box

§height

height of the box

Source

pub fn interpolate(&self, final_: &ActorBox, progress: f64) -> ActorBox

Interpolates between self and final_ ActorBoxes using progress

§final_

the final ActorBox

§progress

the interpolation progress

§result

return location for the interpolation

Source

pub fn set_origin(&mut self, x: f32, y: f32)

Changes the origin of self, maintaining the size of the ActorBox.

§x

the X coordinate of the new origin

§y

the Y coordinate of the new origin

Source

pub fn set_size(&mut self, width: f32, height: f32)

Sets the size of self, maintaining the origin of the ActorBox.

§width

the new width

§height

the new height

Source

pub fn union(&self, b: &ActorBox) -> ActorBox

Unions the two boxes self and b and stores the result in result.

§b

the second ActorBox

§result

the ActorBox representing a union of self and b

Source

pub fn alloc() -> Option<ActorBox>

Allocates a new ActorBox.

§Returns

the newly allocated ActorBox. Use ActorBox::free to free its resources

Trait Implementations§

Source§

impl Clone for ActorBox

Source§

fn clone(&self) -> ActorBox

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ActorBox

Source§

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

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

impl Ord for ActorBox

Source§

fn cmp(&self, other: &ActorBox) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl PartialEq for ActorBox

Source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialOrd for ActorBox

Source§

fn partial_cmp(&self, other: &ActorBox) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl StaticType for ActorBox

Source§

fn static_type() -> Type

Returns the type identifier of Self.
Source§

impl Eq for ActorBox

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GList> for T

Source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GPtrArray> for T

Source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GSList> for T

Source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GList> for T

Source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GPtrArray> for T

Source§

impl<T> FromGlibContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GSList> for T

Source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GList> for T

Source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GPtrArray> for T

Source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *const GSList> for T

Source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GList> for T

Source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GPtrArray> for T

Source§

impl<T> FromGlibPtrArrayContainerAsVec<<T as GlibPtrDefault>::GlibType, *mut GSList> for T

Source§

impl<T, U> Into<U> for T
where U: From<T>,

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<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToValue for T
where T: SetValue + ?Sized,

Source§

fn to_value(&self) -> Value

Returns a Value clone of self.
Source§

fn to_value_type(&self) -> Type

Returns the type identifer of self. Read more
Source§

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

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

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

Source§

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

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.