#include <sdlrect.h>
Inheritance diagram for Wt::SDLRect:
Public Member Functions | |
SDLRect () | |
Create an empty rectangle at (0, 0). | |
SDLRect (int x, int y, int w, int h) | |
Create a rectangle. | |
SDLRect (const SDL_Rect &sdl_rect) | |
Create a rectangle from a SDL_Rect. | |
void | setRect (int x, int y, int w, int h) |
set's the rect's. | |
SDLRect & | operator= (const SDL_Rect &r) |
assign operator | |
int | width () const |
int | height () const |
Return the height of the rectangle. | |
int | x () const |
int | y () const |
int | left () const |
int | top () const |
int | right () const |
int | bottom () const |
void | setX (int pos) |
void | setY (int pos) |
void | setLeft (int pos) |
void | setTop (int pos) |
void | setWidth (int width) |
void | setHeight (int height) |
void | moveTopLeft (int x, int y) |
move the rectangle, specifying new upperleft corner | |
void | moveBy (int dx, int dy) |
move the rectangle by (dx, dy) | |
void | resize (int w, int h) |
this keeps the upper left corner and moves the lower right one | |
bool | operator== (const SDLRect &other) const |
Compare two rectangles for equality. | |
bool | operator!= (const SDLRect &other) const |
Compare two rectangles. | |
bool | contains (int x, int y) const |
Returns true if the rectangle contains point (x, y). | |
bool | contains (const SDLRect &r) const |
Returns true if the rectangle contains r. | |
bool | intersects (const SDLRect &r) const |
Returns true if the rectangle overlaps with r. | |
operator const SDL_Rect & () const | |
operator SDL_Rect & () | |
operator const SDL_Rect * () const | |
operator SDL_Rect * () | |
Private Attributes | |
SDL_Rect | sdl_rect |
Definition at line 38 of file sdlrect.h.
Wt::SDLRect::SDLRect | ( | ) | [inline] |
Wt::SDLRect::SDLRect | ( | const SDL_Rect & | sdl_rect | ) | [inline] |
int Wt::SDLRect::bottom | ( | ) | const [inline] |
Definition at line 98 of file sdlrect.h.
References sdl_rect.
Referenced by Wt::Rect::borderCross(), Wt::Region::calc_extents(), Wt::Rect::clipLine(), contains(), Wt::Region::contains(), Wt::Painter::drawTiledPixmap(), Wt::Rect::intersect(), intersects(), Wt::CascadeLayout::setGeometry(), Wt::Region::unite(), and Wt::Rect::unite().
bool Wt::SDLRect::contains | ( | const SDLRect & | r | ) | const [inline] |
Returns true if the rectangle contains point (x, y).
Definition at line 158 of file sdlrect.h.
References sdl_rect, x(), and y().
00158 { 00159 return y >= sdl_rect.y && y < sdl_rect.y + sdl_rect.h 00160 && x >= sdl_rect.x && x < sdl_rect.x + sdl_rect.w; 00161 }
Here is the call graph for this function:
int Wt::SDLRect::height | ( | ) | const [inline] |
Return the height of the rectangle.
Definition at line 77 of file sdlrect.h.
References sdl_rect.
Referenced by Wt::Rect::align(), Wt::PixmapOf< Wt::SDLSurface >::blend(), Wt::PixmapOf< Wt::SDLSurface >::blitAlphaBlend(), Wt::PixmapOf< Wt::SDLSurface >::copy(), Wt::Painter::drawRect(), Wt::Painter::drawTiledPixmap(), Wt::Widget::height(), Wt::Rect::isEmpty(), Wt::Rect::isValid(), Wt::Rect::operator<<(), Wt::operator<<(), Wt::Rect::operator>>(), Wt::Widget::setGeometry(), Wt::GridLayout::setGeometry(), Wt::CascadeLayout::setGeometry(), setHeight(), Wt::Rect::setLeft(), Wt::Rect::setRight(), Wt::Rect::setTop(), Wt::Rect::size(), and Wt::SDLDisplay::update().
00077 { 00078 return sdl_rect.h; 00079 }
bool Wt::SDLRect::intersects | ( | const SDLRect & | r | ) | const [inline] |
Returns true if the rectangle overlaps with r.
Definition at line 170 of file sdlrect.h.
References bottom(), left(), right(), and top().
Referenced by Wt::Region::contains(), Wt::Region::intersect(), and Wt::Region::subtract().
00170 { 00171 return (right() >= r.left() && 00172 left() <= r.right() && 00173 bottom() >= r.top() && 00174 top() <= r.bottom()); 00175 }
Here is the call graph for this function:
int Wt::SDLRect::left | ( | ) | const [inline] |
Definition at line 89 of file sdlrect.h.
References sdl_rect.
Referenced by Wt::Rect::borderCross(), Wt::Region::calc_extents(), Wt::Rect::clipLine(), contains(), Wt::Region::contains(), Wt::Painter::drawRect(), Wt::Painter::drawTiledPixmap(), Wt::Widget::erase(), Wt::Rect::intersect(), intersects(), Wt::Widget::setGeometry(), Wt::CascadeLayout::setGeometry(), Wt::Region::unite(), and Wt::Rect::unite().
00089 { 00090 return sdl_rect.x; 00091 }
Wt::SDLRect::operator const SDL_Rect & | ( | ) | const [inline] |
Wt::SDLRect::operator const SDL_Rect * | ( | ) | const [inline] |
Wt::SDLRect::operator SDL_Rect & | ( | ) | [inline] |
Wt::SDLRect::operator SDL_Rect * | ( | ) | [inline] |
bool Wt::SDLRect::operator!= | ( | const SDLRect & | other | ) | const [inline] |
SDLRect& Wt::SDLRect::operator= | ( | const SDL_Rect & | r | ) | [inline] |
bool Wt::SDLRect::operator== | ( | const SDLRect & | other | ) | const [inline] |
int Wt::SDLRect::right | ( | ) | const [inline] |
Definition at line 95 of file sdlrect.h.
References sdl_rect.
Referenced by Wt::Rect::borderCross(), Wt::Region::calc_extents(), Wt::Rect::clipLine(), contains(), Wt::Region::contains(), Wt::Painter::drawTiledPixmap(), Wt::Rect::intersect(), intersects(), Wt::CascadeLayout::setGeometry(), Wt::Region::unite(), and Wt::Rect::unite().
void Wt::SDLRect::setHeight | ( | int | height | ) | [inline] |
Definition at line 122 of file sdlrect.h.
References height(), and sdl_rect.
Referenced by Wt::Label::drawContents(), and Wt::Painter::drawTiledPixmap().
Here is the call graph for this function:
void Wt::SDLRect::setLeft | ( | int | pos | ) | [inline] |
set's the rect's.
Definition at line 59 of file sdlrect.h.
References sdl_rect, x(), and y().
Referenced by Wt::Region::calc_extents(), Wt::Rect::operator<<(), Wt::Rect::operator>>(), SDLRect(), Wt::Rect::setBottom(), Wt::Rect::setCoords(), Wt::Rect::setLeft(), Wt::Rect::setRight(), and Wt::Rect::setTop().
00059 { 00060 sdl_rect.x = x; 00061 sdl_rect.y = y; 00062 sdl_rect.w = (w> 0) ? w: 0; 00063 sdl_rect.h = (h> 0) ? h: 0; 00064 }
Here is the call graph for this function:
void Wt::SDLRect::setTop | ( | int | pos | ) | [inline] |
void Wt::SDLRect::setWidth | ( | int | width | ) | [inline] |
Definition at line 118 of file sdlrect.h.
References sdl_rect, and width().
Referenced by Wt::Label::drawContents(), and Wt::Painter::drawTiledPixmap().
Here is the call graph for this function:
void Wt::SDLRect::setX | ( | int | pos | ) | [inline] |
Definition at line 102 of file sdlrect.h.
References sdl_rect.
Referenced by Wt::Label::drawContents(), and Wt::Painter::drawTiledPixmap().
00102 { 00103 sdl_rect.x = pos; 00104 }
void Wt::SDLRect::setY | ( | int | pos | ) | [inline] |
Definition at line 106 of file sdlrect.h.
References sdl_rect.
Referenced by Wt::Label::drawContents(), and Wt::Painter::drawTiledPixmap().
00106 { 00107 sdl_rect.y = pos; 00108 }
int Wt::SDLRect::top | ( | ) | const [inline] |
Definition at line 92 of file sdlrect.h.
References sdl_rect.
Referenced by Wt::Rect::borderCross(), Wt::Region::calc_extents(), Wt::Rect::clipLine(), contains(), Wt::Painter::drawRect(), Wt::Painter::drawTiledPixmap(), Wt::Widget::erase(), Wt::Rect::intersect(), intersects(), Wt::Region::regionOp(), Wt::Widget::setGeometry(), Wt::CascadeLayout::setGeometry(), Wt::Region::unite(), and Wt::Rect::unite().
00092 { 00093 return sdl_rect.y; 00094 }
int Wt::SDLRect::width | ( | ) | const [inline] |
Definition at line 72 of file sdlrect.h.
References sdl_rect.
Referenced by Wt::Rect::align(), Wt::PixmapOf< Wt::SDLSurface >::blend(), Wt::PixmapOf< Wt::SDLSurface >::blitAlphaBlend(), Wt::PixmapOf< Wt::SDLSurface >::copy(), Wt::Painter::drawRect(), Wt::Painter::drawTiledPixmap(), Wt::Rect::isEmpty(), Wt::Rect::isValid(), Wt::Rect::operator<<(), Wt::operator<<(), Wt::Rect::operator>>(), Wt::Rect::setBottom(), Wt::Widget::setGeometry(), Wt::GridLayout::setGeometry(), Wt::CascadeLayout::setGeometry(), Wt::Rect::setLeft(), Wt::Rect::setTop(), setWidth(), Wt::Rect::size(), Wt::SDLDisplay::update(), and Wt::Widget::width().
00072 { 00073 return sdl_rect.w; 00074 }
int Wt::SDLRect::x | ( | ) | const [inline] |
Definition at line 81 of file sdlrect.h.
References sdl_rect.
Referenced by Wt::Rect::align(), Wt::PixmapOf< Wt::SDLSurface >::blend(), Wt::PixmapOf< Wt::SDLSurface >::blitAlphaBlend(), Wt::Rect::borderCross(), Wt::Rect::clipLine(), contains(), Wt::Region::contains(), Wt::PushButton::drawButtonLabel(), moveTopLeft(), Wt::Rect::operator<<(), Wt::operator<<(), Wt::Rect::operator>>(), SDLRect(), Wt::Rect::setBottom(), Wt::GridLayout::setGeometry(), Wt::Rect::setLeft(), setRect(), Wt::Rect::setRight(), Wt::Rect::setTop(), Wt::Rect::topLeft(), Wt::SDLDisplay::update(), and Wt::Window::x().
00081 { 00082 return sdl_rect.x; 00083 }
int Wt::SDLRect::y | ( | ) | const [inline] |
Definition at line 85 of file sdlrect.h.
References sdl_rect.
Referenced by Wt::Rect::align(), Wt::PixmapOf< Wt::SDLSurface >::blend(), Wt::PixmapOf< Wt::SDLSurface >::blitAlphaBlend(), Wt::Rect::borderCross(), Wt::Rect::clipLine(), contains(), Wt::Region::contains(), Wt::PushButton::drawButtonLabel(), moveTopLeft(), Wt::Rect::operator<<(), Wt::operator<<(), Wt::Rect::operator>>(), SDLRect(), Wt::Rect::setBottom(), Wt::GridLayout::setGeometry(), Wt::Rect::setLeft(), setRect(), Wt::Rect::setRight(), Wt::Rect::setTop(), Wt::Rect::topLeft(), Wt::SDLDisplay::update(), and Wt::Window::y().
00085 { 00086 return sdl_rect.y; 00087 }
SDL_Rect Wt::SDLRect::sdl_rect [private] |
Definition at line 194 of file sdlrect.h.
Referenced by bottom(), contains(), height(), left(), moveBy(), moveTopLeft(), operator const SDL_Rect &(), operator const SDL_Rect *(), operator SDL_Rect &(), operator SDL_Rect *(), operator=(), operator==(), resize(), right(), setHeight(), setLeft(), setRect(), setTop(), setWidth(), setX(), setY(), top(), width(), x(), and y().
This document is licensed under the terms of the GNU Free Documentation License and may be freely distributed under the conditions given by this license.