Public Member Functions | Public Attributes | List of all members
BSize Class Reference

A two-dimensional size. More...

Public Member Functions

 BSize ()
 Initializes a BSize object with both dimensions set to B_SIZE_UNSET. More...
 
 BSize (const BSize &other)
 Initializes a BSize object from another BSize. More...
 
 BSize (float width, float height)
 Initializes a BSize object with the specified width and height values. More...
 
float Height () const
 Gets the height of the BSize object. More...
 
int32 IntegerHeight () const
 Returns the height value of a BSize object as an int32. More...
 
int32 IntegerWidth () const
 Returns the width value of a BSize object as an int32. More...
 
bool IsHeightSet () const
 Checks if the BSize::height is not B_SIZE_UNSET. More...
 
bool IsWidthSet () const
 Checks if the BSize::width is not B_SIZE_UNSET. More...
 
void Set (float width, float height)
 Sets the width and height values of a BSize object. More...
 
void SetHeight (float height)
 Sets the height value of a BSize object. More...
 
void SetWidth (float width)
 Sets the width value of a BSize object. More...
 
float Width () const
 Gets the width of the BSize object. More...
 
Operators
bool operator== (const BSize &other) const
 Returns whether or not the width and height values of the BSize objects are equal. More...
 
bool operator!= (const BSize &other) const
 Returns whether or not the width and height values of the BSize objects differ. More...
 
BSizeoperator= (const BSize &other)
 Initializes a BSize object from another BSize by overloading the = operator. More...
 

Public Attributes

float height
 The vertical dimension. More...
 
float width
 The horizontal dimension. More...
 

Detailed Description

A two-dimensional size.

Since
Haiku R1

Constructor & Destructor Documentation

◆ BSize() [1/3]

BSize::BSize ( )
inline

Initializes a BSize object with both dimensions set to B_SIZE_UNSET.

See also
BSize::Set()
Since
Haiku R1

◆ BSize() [2/3]

BSize::BSize ( const BSize other)
inline

Initializes a BSize object from another BSize.

Parameters
otherThe BSize object to copy from.
Since
Haiku R1

◆ BSize() [3/3]

BSize::BSize ( float  width,
float  height 
)
inline

Initializes a BSize object with the specified width and height values.

Parameters
widthThe width value to set.
heightThe height value to set.
Since
Haiku R1

Member Function Documentation

◆ Height()

float BSize::Height ( ) const
inline

Gets the height of the BSize object.

Returns
BSize::height
Since
Haiku R1

References height.

◆ IntegerHeight()

int32 BSize::IntegerHeight ( ) const
inline

Returns the height value of a BSize object as an int32.

Returns
BSize::height, cast to an int32.
Warning
This may lose precision!
Since
Haiku R1

References height.

◆ IntegerWidth()

int32 BSize::IntegerWidth ( ) const
inline

Returns the width value of a BSize object as an int32.

Returns
BSize::width, cast to an int32.
Warning
This may lose precision!
Since
Haiku R1

References width.

◆ IsHeightSet()

bool BSize::IsHeightSet ( ) const
inline

Checks if the BSize::height is not B_SIZE_UNSET.

Returns
true if the height is set, false otherwise.
Since
Haiku R1

References B_SIZE_UNSET, and height.

◆ IsWidthSet()

bool BSize::IsWidthSet ( ) const
inline

Checks if the BSize::width is not B_SIZE_UNSET.

Returns
true if the width is set, false otherwise.
Since
Haiku R1

References B_SIZE_UNSET, and width.

◆ operator!=()

bool BSize::operator!= ( const BSize other) const
inline

Returns whether or not the width and height values of the BSize objects differ.

Returns
true if the width or height values differ, false otherwise.
Since
Haiku R1

◆ operator=()

BSize & BSize::operator= ( const BSize other)
inline

Initializes a BSize object from another BSize by overloading the = operator.

Parameters
otherThe BSize object to copy from.
Since
Haiku R1

References height, and width.

◆ operator==()

bool BSize::operator== ( const BSize other) const
inline

Returns whether or not the width and height values of the BSize objects are equal.

Returns
true if the width and height values are equal, false otherwise.
Since
Haiku R1

References height, and width.

◆ Set()

void BSize::Set ( float  width,
float  height 
)
inline

Sets the width and height values of a BSize object.

Parameters
widthThe width value to set.
heightThe height value to set.
Since
Haiku R1

References height, and width.

◆ SetHeight()

void BSize::SetHeight ( float  height)
inline

Sets the height value of a BSize object.

Parameters
heightThe height value to set.
Since
Haiku R1

References height.

◆ SetWidth()

void BSize::SetWidth ( float  width)
inline

Sets the width value of a BSize object.

Parameters
widthThe width value to set.
Since
Haiku R1

References width.

◆ Width()

float BSize::Width ( ) const
inline

Gets the width of the BSize object.

Returns
BSize::width
Since
Haiku R1

References width.

Member Data Documentation

◆ height

BSize::height

The vertical dimension.

Since
Haiku R1

Referenced by Height(), IntegerHeight(), IsHeightSet(), operator=(), operator==(), Set(), and SetHeight().

◆ width

BSize::width

The horizontal dimension.

Since
Haiku R1

Referenced by IntegerWidth(), IsWidthSet(), operator=(), operator==(), Set(), SetWidth(), and Width().