#include <rect.h>
Inheritance diagram for Wt::Rect:
Public Member Functions | |
Rect () | |
Create an empty rectangle at (0, 0). | |
Rect (int x_, int y_, int w_, int h_) | |
Create a rectangle. | |
Rect (const Point &p, const Size &size) | |
Rect (const SDLRect &sdlrect) | |
Create a rectangle from a SDLRect. | |
Rect & | operator= (const SDLRect &r) |
set's a rect from a SDLRect | |
~Rect () | |
bool | isEmpty () const |
Returns true if the rectangle is empty. | |
bool | isValid () const |
Returns true if the rectangle is valid (dimensions non-negative). | |
bool | contains (const Point &p) const |
Returns true if the rectangle contains p. | |
void | moveTopLeft (const Point &p) |
move the rectangle, specifying new upperleft corner | |
Rect | unite (const Rect &r) const |
Return the smallest rectangle which contains both *this and r. | |
Rect | intersect (const Rect &r) const |
Returns an invalid rectangle if *this and r don't intersect. | |
Point | topLeft () const |
Return the topleft corner of the rectangle. | |
Size | size () const |
Return the width of the rectangle. | |
void | setSize (const Size &size) |
set's the size of the rect. | |
void | setCoords (int x1, int y1, int x2, int y2) |
set's the rect's. | |
Rect | operator>> (int margin) const |
add a margin (smaller rectangle) | |
Rect & | operator>> (int margin) |
add a margin (smaller rectangle) | |
Rect | operator<< (int margin) const |
subtract a margin (bigger rectangle) | |
Rect & | operator<< (int margin) |
subtract a margin (bigger rectangle) | |
void | setLeft (int x1) |
void | setTop (int y1) |
void | setRight (int x2) |
void | setBottom (int y2) |
bool | clipLine (int &x1, int &y1, int &x2, int &y2) const |
bool | clipLine (Point &p1, Point &p2) const |
Rect | operator & (const Rect &other) const |
Rect & | operator &= (const Rect &other) |
void | setRect (int x, int y, int w, int h) |
set's the rect's. | |
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 | 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 * () | |
Static Public Member Functions | |
static Rect | align (const Rect &container, const Size &size, int alignment) |
Static Public Attributes | |
static Rect | invalid = Rect(0, 0, -1, -1) |
An invalid rectangle. | |
static Rect | empty = Rect(0, 0, 0, 0) |
An empty (w == h == 0) rectangle. | |
Protected Types | |
Left = 1 << 0 | |
Right = 1 << 1 | |
Top = 1 << 2 | |
Bottom = 1 << 3 | |
enum | BorderCross { Left = 1 << 0, Right = 1 << 1, Top = 1 << 2, Bottom = 1 << 3 } |
Protected Member Functions | |
int | borderCross (int x, int y) const |
Definition at line 33 of file rect.h.
enum Wt::Rect::BorderCross [protected] |
Wt::Rect::Rect | ( | ) | [inline] |
Create an empty rectangle at (0, 0).
Definition at line 36 of file rect.h.
Referenced by align(), intersect(), operator<<(), operator=(), operator>>(), and unite().
Wt::Rect::Rect | ( | const SDLRect & | sdlrect | ) | [inline] |
Definition at line 131 of file rect.cpp.
References Wt::AlignAuto, Wt::AlignBottom, Wt::AlignCenter, Wt::AlignHCenter, Wt::AlignHorizontal_Mask, Wt::AlignJustify, Wt::AlignLeft, Wt::AlignRight, Wt::AlignTop, Wt::AlignVCenter, Wt::AlignVertical_Mask, Wt::Size::height(), Wt::SDLRect::height(), invalid, Rect(), size(), Wt::Size::width(), Wt::SDLRect::width(), Wt::SDLRect::x(), and Wt::SDLRect::y().
Referenced by Wt::PushButton::drawButtonLabel(), Wt::Label::drawContents(), Wt::Widget::erase(), Wt::BoxLayout::setGeometry(), Wt::GridLayout::setGeometry(), and Wt::CascadeLayout::setGeometry().
00131 { 00132 int xc = 0, yc = 0; 00133 00134 if (alignment == AlignAuto) 00135 alignment = AlignCenter; 00136 else if (! (alignment & AlignHorizontal_Mask) ) 00137 alignment |= AlignHCenter; 00138 else if (! (alignment & AlignVertical_Mask) ) 00139 alignment |= AlignVCenter; 00140 00141 switch (alignment & AlignHorizontal_Mask) { 00142 case AlignLeft: 00143 xc = container.x(); 00144 break; 00145 case AlignRight: 00146 xc = container.x() + container.width() - size.width(); 00147 break; 00148 case AlignHCenter: 00149 xc = container.x() + ((container.width() - size.width()) >> 1); 00150 break; 00151 case AlignJustify: 00152 default: 00153 //Error("Unimplemented Alignment flag %d\n", alignment); 00154 return invalid; 00155 break; 00156 } 00157 00158 switch (alignment & AlignVertical_Mask) { 00159 case AlignTop: 00160 yc = container.y(); 00161 break; 00162 case AlignBottom: 00163 yc = container.y() + container.height() - size.height(); 00164 break; 00165 case AlignVCenter: 00166 yc = container.y() + ((container.height() - size.height()) >> 1); 00167 break; 00168 default: 00169 //Error("Unimplemented Alignment flag %d\n", alignment); 00170 return invalid; 00171 break; 00172 } 00173 00174 return Rect(xc, yc, size.width(), size.height()); 00175 }
Here is the call graph for this function:
Definition at line 63 of file rect.cpp.
References Bottom, Wt::SDLRect::bottom(), Left, Wt::SDLRect::left(), Right, Wt::SDLRect::right(), Top, Wt::SDLRect::top(), Wt::SDLRect::x(), and Wt::SDLRect::y().
Referenced by clipLine().
00063 { 00064 int border_cross = 0; 00065 00066 border_cross |= (x < left()) ? Left : 0; 00067 border_cross |= (x > right()) ? Right : 0; 00068 border_cross |= (y < top()) ? Top : 0; 00069 border_cross |= (y > bottom()) ? Bottom : 0; 00070 00071 return border_cross; 00072 }
Here is the call graph for this function:
int Wt::SDLRect::bottom | ( | ) | const [inline, inherited] |
Definition at line 98 of file sdlrect.h.
References Wt::SDLRect::sdl_rect.
Referenced by borderCross(), Wt::Region::calc_extents(), clipLine(), Wt::SDLRect::contains(), Wt::Region::contains(), Wt::Painter::drawTiledPixmap(), intersect(), Wt::SDLRect::intersects(), Wt::CascadeLayout::setGeometry(), Wt::Region::unite(), and unite().
Definition at line 118 of file rect.cpp.
References clipLine(), Wt::Point::setX(), Wt::Point::setY(), Wt::Point::x(), and Wt::Point::y().
00118 { 00119 int x1 = p1.x(); 00120 int y1 = p1.y(); 00121 int x2 = p2.x(); 00122 int y2 = p2.y(); 00123 bool clip = clipLine(x1, y1, x2, y2); 00124 p1.setX(x1); 00125 p1.setY(y1); 00126 p2.setX(x2); 00127 p2.setY(y2); 00128 return clip; 00129 }
Here is the call graph for this function:
Definition at line 74 of file rect.cpp.
References borderCross(), Wt::SDLRect::bottom(), Wt::SDLRect::left(), Left, Wt::SDLRect::right(), Right, Wt::SDLRect::top(), Top, Wt::SDLRect::x(), and Wt::SDLRect::y().
Referenced by clipLine(), and Wt::Painter::drawLine().
00074 { 00075 00076 int b1 = borderCross(x1, y1); 00077 int b2 = borderCross(x2, y2); 00078 00079 while (b1 || b2) { 00080 int b; 00081 int x, y; 00082 00083 if (b1 & b2) { 00084 // trivially reject 00085 return false; 00086 } else { 00087 b = (b1) ? b1 : b2; 00088 } 00089 00090 if (b & Left) { 00091 x = left(); 00092 y = y1 + (y2 - y1) * (x - x1) / (x2 - x1); 00093 } else if (b & Right) { 00094 x = right(); 00095 y = y1 + (y2 - y1) * (x - x1) / (x2 - x1); 00096 } else if (b & Top) { 00097 y = top(); 00098 x = x1 + (x2 - x1) * (y - y1) / (y2 - y1); 00099 } else { // if (b & Bottom) { 00100 y = bottom(); 00101 x = x1 + (x2 - x1) * (y - y1) / (y2 - y1); 00102 } 00103 00104 if (b == b1) { 00105 x1 = x; 00106 y1 = y; 00107 b1 = borderCross(x1, y1); 00108 } else { 00109 x2 = x; 00110 y2 = y; 00111 b2 = borderCross(x2, y2); 00112 } 00113 }; 00114 00115 return true; 00116 }
Here is the call graph for this function:
bool Wt::SDLRect::contains | ( | const SDLRect & | r | ) | const [inline, inherited] |
Returns true if the rectangle contains r.
Definition at line 164 of file sdlrect.h.
References Wt::SDLRect::bottom(), Wt::SDLRect::left(), Wt::SDLRect::right(), and Wt::SDLRect::top().
00164 { 00165 return left() <= r.left() && right() >= r.right() && 00166 top() <= r.top() && bottom() >= r.bottom(); 00167 }
Here is the call graph for this function:
Returns true if the rectangle contains point (x, y).
Definition at line 158 of file sdlrect.h.
References Wt::SDLRect::sdl_rect, Wt::SDLRect::x(), and Wt::SDLRect::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:
bool Wt::Rect::contains | ( | const Point & | p | ) | const [inline] |
Returns true if the rectangle contains p.
Definition at line 76 of file rect.h.
References Wt::Point::x(), and Wt::Point::y().
Referenced by Wt::Widget::childAt(), Wt::Region::contains(), Wt::Painter::isClipped(), Wt::Window::Frame::mousePressEvent(), and Wt::Region::unite().
00076 { 00077 return contains(p.x(), p.y()); 00078 }
Here is the call graph for this function:
int Wt::SDLRect::height | ( | ) | const [inline, inherited] |
Return the height of the rectangle.
Definition at line 77 of file sdlrect.h.
References Wt::SDLRect::sdl_rect.
Referenced by 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(), isEmpty(), isValid(), operator<<(), Wt::operator<<(), operator>>(), Wt::Widget::setGeometry(), Wt::GridLayout::setGeometry(), Wt::CascadeLayout::setGeometry(), Wt::SDLRect::setHeight(), setLeft(), setRight(), setTop(), size(), and Wt::SDLDisplay::update().
00077 { 00078 return sdl_rect.h; 00079 }
Returns an invalid rectangle if *this and r don't intersect.
Definition at line 48 of file rect.cpp.
References Wt::SDLRect::bottom(), invalid, isValid(), Wt::SDLRect::left(), Rect(), Wt::SDLRect::right(), and Wt::SDLRect::top().
Referenced by Wt::PixmapOf< Wt::SDLSurface >::blend(), Wt::PixmapOf< Wt::SDLSurface >::blitAlphaBlend(), operator &(), and operator &=().
00048 { 00049 if(!isValid() || !r.isValid()) 00050 return invalid; 00051 00052 int min_x = std::max(left(), r.left()); 00053 int min_y = std::max(top(), r.top()); 00054 int max_x = std::min(right(), r.right()) + 1; 00055 int max_y = std::min(bottom(), r.bottom()) + 1; 00056 00057 if(min_x > max_x || min_y > max_y) 00058 return invalid; 00059 00060 return Rect(min_x, min_y, max_x - min_x, max_y - min_y); 00061 }
Here is the call graph for this function:
bool Wt::SDLRect::intersects | ( | const SDLRect & | r | ) | const [inline, inherited] |
Returns true if the rectangle overlaps with r.
Definition at line 170 of file sdlrect.h.
References Wt::SDLRect::bottom(), Wt::SDLRect::left(), Wt::SDLRect::right(), and Wt::SDLRect::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:
bool Wt::Rect::isEmpty | ( | ) | const [inline] |
Returns true if the rectangle is empty.
Definition at line 66 of file rect.h.
References Wt::SDLRect::height(), and Wt::SDLRect::width().
Referenced by Wt::PixmapOf< Wt::SDLSurface >::blend().
Here is the call graph for this function:
bool Wt::Rect::isValid | ( | ) | const [inline] |
Returns true if the rectangle is valid (dimensions non-negative).
Definition at line 70 of file rect.h.
References Wt::SDLRect::height(), and Wt::SDLRect::width().
Referenced by Wt::Region::calc_extents(), intersect(), and unite().
Here is the call graph for this function:
int Wt::SDLRect::left | ( | ) | const [inline, inherited] |
Definition at line 89 of file sdlrect.h.
References Wt::SDLRect::sdl_rect.
Referenced by borderCross(), Wt::Region::calc_extents(), clipLine(), Wt::SDLRect::contains(), Wt::Region::contains(), Wt::Painter::drawRect(), Wt::Painter::drawTiledPixmap(), Wt::Widget::erase(), intersect(), Wt::SDLRect::intersects(), Wt::Widget::setGeometry(), Wt::CascadeLayout::setGeometry(), Wt::Region::unite(), and unite().
00089 { 00090 return sdl_rect.x; 00091 }
move the rectangle by (dx, dy)
Definition at line 133 of file sdlrect.h.
References Wt::SDLRect::sdl_rect.
Referenced by Wt::Region::translate().
move the rectangle, specifying new upperleft corner
Definition at line 127 of file sdlrect.h.
References Wt::SDLRect::sdl_rect, Wt::SDLRect::x(), and Wt::SDLRect::y().
Here is the call graph for this function:
void Wt::Rect::moveTopLeft | ( | const Point & | p | ) | [inline] |
move the rectangle, specifying new upperleft corner
Definition at line 82 of file rect.h.
References Wt::Point::x(), and Wt::Point::y().
Referenced by Wt::Widget::move().
00082 { 00083 moveTopLeft(p.x(), p.y()); 00084 }
Here is the call graph for this function:
Definition at line 151 of file rect.h.
References intersect().
00151 { 00152 return intersect(other); 00153 };
Here is the call graph for this function:
Definition at line 155 of file rect.h.
References intersect().
00155 { 00156 *this = intersect(other); 00157 return *this; 00158 };
Here is the call graph for this function:
Wt::SDLRect::operator const SDL_Rect & | ( | ) | const [inline, inherited] |
Definition at line 177 of file sdlrect.h.
References Wt::SDLRect::sdl_rect.
00177 { 00178 return sdl_rect; 00179 }
Wt::SDLRect::operator const SDL_Rect * | ( | ) | const [inline, inherited] |
Definition at line 185 of file sdlrect.h.
References Wt::SDLRect::sdl_rect.
00185 { 00186 return &sdl_rect; 00187 }
Wt::SDLRect::operator SDL_Rect & | ( | ) | [inline, inherited] |
Definition at line 181 of file sdlrect.h.
References Wt::SDLRect::sdl_rect.
00181 { 00182 return sdl_rect; 00183 }
Wt::SDLRect::operator SDL_Rect * | ( | ) | [inline, inherited] |
Definition at line 189 of file sdlrect.h.
References Wt::SDLRect::sdl_rect.
00189 { 00190 return &sdl_rect; 00191 }
bool Wt::SDLRect::operator!= | ( | const SDLRect & | other | ) | const [inline, inherited] |
subtract a margin (bigger rectangle)
Definition at line 129 of file rect.h.
References Wt::SDLRect::height(), Wt::SDLRect::setRect(), Wt::SDLRect::width(), Wt::SDLRect::x(), and Wt::SDLRect::y().
00129 { 00130 setRect(x() - margin, y() - margin, 00131 width() + 2 * margin, height() + 2 * margin); 00132 return *this; 00133 }
Here is the call graph for this function:
subtract a margin (bigger rectangle)
Definition at line 123 of file rect.h.
References Wt::SDLRect::height(), Rect(), Wt::SDLRect::width(), Wt::SDLRect::x(), and Wt::SDLRect::y().
00123 { 00124 return Rect(x() - margin, y() - margin, 00125 width() + 2 * margin, height() + 2 * margin); 00126 }
Here is the call graph for this function:
bool Wt::SDLRect::operator== | ( | const SDLRect & | other | ) | const [inline, inherited] |
add a margin (smaller rectangle)
Definition at line 116 of file rect.h.
References Wt::SDLRect::height(), Wt::SDLRect::setRect(), Wt::SDLRect::width(), Wt::SDLRect::x(), and Wt::SDLRect::y().
00116 { 00117 setRect(x() + margin, y() + margin, 00118 width() - 2 * margin, height() - 2 * margin); 00119 return *this; 00120 }
Here is the call graph for this function:
add a margin (smaller rectangle)
Definition at line 110 of file rect.h.
References Wt::SDLRect::height(), Rect(), Wt::SDLRect::width(), Wt::SDLRect::x(), and Wt::SDLRect::y().
00110 { 00111 return Rect(x() + margin, y() + margin, 00112 width() - 2 * margin, height() - 2 * margin); 00113 }
Here is the call graph for this function:
int Wt::SDLRect::right | ( | ) | const [inline, inherited] |
Definition at line 95 of file sdlrect.h.
References Wt::SDLRect::sdl_rect.
Referenced by borderCross(), Wt::Region::calc_extents(), clipLine(), Wt::SDLRect::contains(), Wt::Region::contains(), Wt::Painter::drawTiledPixmap(), intersect(), Wt::SDLRect::intersects(), Wt::CascadeLayout::setGeometry(), Wt::Region::unite(), and unite().
void Wt::Rect::setBottom | ( | int | y2 | ) | [inline] |
Definition at line 144 of file rect.h.
References Wt::SDLRect::setRect(), Wt::SDLRect::width(), Wt::SDLRect::x(), and Wt::SDLRect::y().
Here is the call graph for this function:
set's the rect's.
Definition at line 105 of file rect.h.
References Wt::SDLRect::setRect().
Referenced by Wt::Region::calc_extents(), and Wt::Region::unite().
00105 { 00106 setRect(x1, y1, x2 - x1 + 1, y2 - y1 + 1); 00107 }
Here is the call graph for this function:
void Wt::SDLRect::setHeight | ( | int | height | ) | [inline, inherited] |
Definition at line 122 of file sdlrect.h.
References Wt::SDLRect::height(), and Wt::SDLRect::sdl_rect.
Referenced by Wt::Label::drawContents(), and Wt::Painter::drawTiledPixmap().
Here is the call graph for this function:
void Wt::Rect::setLeft | ( | int | x1 | ) | [inline] |
Reimplemented from Wt::SDLRect.
Definition at line 135 of file rect.h.
References Wt::SDLRect::height(), Wt::SDLRect::setRect(), Wt::SDLRect::width(), Wt::SDLRect::x(), and Wt::SDLRect::y().
Here is the call graph for this function:
set's the rect's.
Definition at line 59 of file sdlrect.h.
References Wt::SDLRect::sdl_rect, Wt::SDLRect::x(), and Wt::SDLRect::y().
Referenced by Wt::Region::calc_extents(), operator<<(), operator>>(), Wt::SDLRect::SDLRect(), setBottom(), setCoords(), setLeft(), setRight(), and 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::Rect::setRight | ( | int | x2 | ) | [inline] |
Definition at line 141 of file rect.h.
References Wt::SDLRect::height(), Wt::SDLRect::setRect(), Wt::SDLRect::x(), and Wt::SDLRect::y().
Here is the call graph for this function:
void Wt::Rect::setSize | ( | const Size & | size | ) | [inline] |
set's the size of the rect.
Definition at line 101 of file rect.h.
References Wt::Size::height(), Wt::SDLRect::resize(), size(), and Wt::Size::width().
Referenced by Wt::Widget::resize(), and Wt::Layout::setGeometry().
Here is the call graph for this function:
void Wt::Rect::setTop | ( | int | y1 | ) | [inline] |
Reimplemented from Wt::SDLRect.
Definition at line 138 of file rect.h.
References Wt::SDLRect::height(), Wt::SDLRect::setRect(), Wt::SDLRect::width(), Wt::SDLRect::x(), and Wt::SDLRect::y().
Here is the call graph for this function:
void Wt::SDLRect::setWidth | ( | int | width | ) | [inline, inherited] |
Definition at line 118 of file sdlrect.h.
References Wt::SDLRect::sdl_rect, and Wt::SDLRect::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, inherited] |
Definition at line 102 of file sdlrect.h.
References Wt::SDLRect::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, inherited] |
Definition at line 106 of file sdlrect.h.
References Wt::SDLRect::sdl_rect.
Referenced by Wt::Label::drawContents(), and Wt::Painter::drawTiledPixmap().
00106 { 00107 sdl_rect.y = pos; 00108 }
Size Wt::Rect::size | ( | ) | const [inline] |
Return the width of the rectangle.
Definition at line 97 of file rect.h.
References Wt::SDLRect::height(), and Wt::SDLRect::width().
Referenced by align(), Wt::Painter::drawPixmap(), Wt::Window::frameSize(), Wt::Layout::setGeometry(), setSize(), and Wt::Widget::size().
Here is the call graph for this function:
int Wt::SDLRect::top | ( | ) | const [inline, inherited] |
Definition at line 92 of file sdlrect.h.
References Wt::SDLRect::sdl_rect.
Referenced by borderCross(), Wt::Region::calc_extents(), clipLine(), Wt::SDLRect::contains(), Wt::Painter::drawRect(), Wt::Painter::drawTiledPixmap(), Wt::Widget::erase(), intersect(), Wt::SDLRect::intersects(), Wt::Region::regionOp(), Wt::Widget::setGeometry(), Wt::CascadeLayout::setGeometry(), Wt::Region::unite(), and unite().
00092 { 00093 return sdl_rect.y; 00094 }
Point Wt::Rect::topLeft | ( | ) | const [inline] |
Return the topleft corner of the rectangle.
Definition at line 92 of file rect.h.
References Wt::SDLRect::x(), and Wt::SDLRect::y().
Referenced by Wt::Label::drawContents(), Wt::Painter::drawPixmap(), Wt::Painter::drawTiledPixmap(), Wt::Widget::mapFromGlobal(), Wt::Widget::mapFromParent(), Wt::Widget::mapToGlobal(), Wt::Widget::mapToParent(), Wt::Window::Frame::mousePressEvent(), and Wt::Window::pos().
Here is the call graph for this function:
Return the smallest rectangle which contains both *this and r.
Definition at line 30 of file rect.cpp.
References Wt::SDLRect::bottom(), invalid, isValid(), Wt::SDLRect::left(), Rect(), Wt::SDLRect::right(), and Wt::SDLRect::top().
00030 { 00031 if(!isValid() || !r.isValid()) 00032 return invalid; 00033 00034 int min_x = std::min(left(), r.left()); 00035 int min_y = std::min(top(), r.top()); 00036 int max_x = std::max(right(), r.right()) + 1; 00037 int max_y = std::max(bottom(), r.bottom()) + 1; 00038 00039 assert(min_x <= max_x); 00040 assert(min_y <= max_y); 00041 00042 return Rect(min_x, min_y, max_x - min_x, max_y - min_y); 00043 }
Here is the call graph for this function:
int Wt::SDLRect::width | ( | ) | const [inline, inherited] |
Definition at line 72 of file sdlrect.h.
References Wt::SDLRect::sdl_rect.
Referenced by align(), Wt::PixmapOf< Wt::SDLSurface >::blend(), Wt::PixmapOf< Wt::SDLSurface >::blitAlphaBlend(), Wt::PixmapOf< Wt::SDLSurface >::copy(), Wt::Painter::drawRect(), Wt::Painter::drawTiledPixmap(), isEmpty(), isValid(), operator<<(), Wt::operator<<(), operator>>(), setBottom(), Wt::Widget::setGeometry(), Wt::GridLayout::setGeometry(), Wt::CascadeLayout::setGeometry(), setLeft(), setTop(), Wt::SDLRect::setWidth(), size(), Wt::SDLDisplay::update(), and Wt::Widget::width().
00072 { 00073 return sdl_rect.w; 00074 }
int Wt::SDLRect::x | ( | ) | const [inline, inherited] |
Definition at line 81 of file sdlrect.h.
References Wt::SDLRect::sdl_rect.
Referenced by align(), Wt::PixmapOf< Wt::SDLSurface >::blend(), Wt::PixmapOf< Wt::SDLSurface >::blitAlphaBlend(), borderCross(), clipLine(), Wt::SDLRect::contains(), Wt::Region::contains(), Wt::PushButton::drawButtonLabel(), Wt::SDLRect::moveTopLeft(), operator<<(), Wt::operator<<(), operator>>(), Wt::SDLRect::SDLRect(), setBottom(), Wt::GridLayout::setGeometry(), setLeft(), Wt::SDLRect::setRect(), setRight(), setTop(), topLeft(), Wt::SDLDisplay::update(), and Wt::Window::x().
00081 { 00082 return sdl_rect.x; 00083 }
int Wt::SDLRect::y | ( | ) | const [inline, inherited] |
Definition at line 85 of file sdlrect.h.
References Wt::SDLRect::sdl_rect.
Referenced by align(), Wt::PixmapOf< Wt::SDLSurface >::blend(), Wt::PixmapOf< Wt::SDLSurface >::blitAlphaBlend(), borderCross(), clipLine(), Wt::SDLRect::contains(), Wt::Region::contains(), Wt::PushButton::drawButtonLabel(), Wt::SDLRect::moveTopLeft(), operator<<(), Wt::operator<<(), operator>>(), Wt::SDLRect::SDLRect(), setBottom(), Wt::GridLayout::setGeometry(), setLeft(), Wt::SDLRect::setRect(), setRight(), setTop(), topLeft(), Wt::SDLDisplay::update(), and Wt::Window::y().
00085 { 00086 return sdl_rect.y; 00087 }
Rect Wt::Rect::empty = Rect(0, 0, 0, 0) [static] |
Rect Wt::Rect::invalid = Rect(0, 0, -1, -1) [static] |
An invalid rectangle.
Definition at line 62 of file rect.h.
Referenced by align(), intersect(), and unite().
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.