Dillo
Public Member Functions | Public Attributes | List of all members
dw::core::Rectangle Class Reference

dw::core::Shape implemtation for simple rectangles. More...

#include <types.hh>

Public Member Functions

 Rectangle ()
 
 Rectangle (int x, int y, int width, int height)
 
void draw (core::View *view, core::style::Style *style, int x, int y)
 
bool intersectsWith (Rectangle *otherRect, Rectangle *dest)
 
bool isSubsetOf (Rectangle *otherRect)
 
bool isPointWithin (int x, int y)
 
bool isEmpty ()
 
- Public Member Functions inherited from lout::object::Object
virtual ~Object ()
 The destructor is defined as virtual (but not abstract), so that destruction of Object's works properly. More...
 
virtual bool equals (Object *other)
 Returns, whether two objects are equal. More...
 
virtual int hashValue ()
 Return a hash value for the object. More...
 
virtual Objectclone ()
 Return an exact copy of the object. More...
 
virtual void intoStringBuffer (misc::StringBuffer *sb)
 Store a textual representation of the object in a misc::StringBuffer. More...
 
const char * toString ()
 Use object::Object::intoStringBuffer to return a textual representation of the object. More...
 
virtual size_t sizeOf ()
 Return the number of bytes, this object totally uses. More...
 

Public Attributes

int x
 
int y
 
int width
 
int height
 

Detailed Description

dw::core::Shape implemtation for simple rectangles.

Constructor & Destructor Documentation

dw::core::Rectangle::Rectangle ( )
inline
dw::core::Rectangle::Rectangle ( int  x,
int  y,
int  width,
int  height 
)

Member Function Documentation

void dw::core::Rectangle::draw ( core::View view,
core::style::Style style,
int  x,
int  y 
)
virtual
bool dw::core::Rectangle::intersectsWith ( Rectangle otherRect,
Rectangle dest 
)

Return whether this rectangle and otherRect intersect. If yes, return the intersection rectangle in dest.

References height, lout::misc::max(), lout::misc::min(), width, x, and y.

Referenced by dw::Image::draw(), dw::core::Layout::draw(), dw::core::style::drawBackground(), and dw::core::Widget::intersects().

bool dw::core::Rectangle::isEmpty ( )
inline
bool dw::core::Rectangle::isPointWithin ( int  x,
int  y 
)
virtual

Implements dw::core::Shape.

bool dw::core::Rectangle::isSubsetOf ( Rectangle otherRect)

References height, width, x, and y.

Member Data Documentation

int dw::core::Rectangle::height
int dw::core::Rectangle::width
int dw::core::Rectangle::x
int dw::core::Rectangle::y

The documentation for this class was generated from the following files: