/usr/include/Wt/WRectF is in libwt-dev 3.1.10-1ubuntu2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 | // This may look like C code, but it's really -*- C++ -*-
/*
* Copyright (C) 2008 Emweb bvba, Kessel-Lo, Belgium.
*
* See the LICENSE file for terms of use.
*/
#ifndef WRECTF_H_
#define WRECTF_H_
#include <Wt/WDllDefs.h>
namespace Wt {
class WPointF;
/*! \class WRectF Wt/WRectF Wt/WRectF
* \brief Utility class that defines a rectangle.
*
* The rectangle is defined by a top-left point and a width and height.
*
* \ingroup painting
*/
class WT_API WRectF
{
public:
/*! \brief Default constructor.
*
* \if cpp
* Constructs a \p null rectangle.
*
* \sa isNull()
* \elseif java
* Constructs a rectangle from top left point (<i>x=0</i>, \p y=0)
* and size <i>width=0</i> x \p height=0.
* \endif
*/
WRectF();
/*! \brief Creates a rectangle.
*
* Constructs a rectangle with top left point (<i>x</i>, \p y)
* and size <i>width</i> x \p height.
*/
WRectF(double x, double y, double width, double height);
/*! \brief Creates a rectangle.
*
* Constructs a rectangle from the two points \p topLeft and
* \p bottomRight.
*
* If you want to create a rectangle from two arbitrary corner points,
* you can use this constructor too, but should call normalized()
* afterwords.
*/
WRectF(const WPointF& topLeft, const WPointF& bottomRight);
#ifdef WT_TARGET_JAVA
/*! \brief Internal assign method.
*/
WRectF& operator= (const WRectF& rhs);
#endif // WT_TARGET_JAVA
/*! \brief Comparison operator.
*/
bool operator== (const WRectF& rhs) const;
bool operator!= (const WRectF& rhs) const;
/*! \brief Checks for a <i>null</i> rectangle.
*
* \sa WRectF()
*/
bool isNull() const;
/*! \brief Determines whether or not this rectangle is empty.
*
* A rectangle is empty if its width or its height is less than
* or equal to zero.
*/
bool isEmpty() const;
/*! \brief Sets the X-position of the left side.
*
* The right side of the rectangle does not move, and as a result,
* the rectangle may be resized.
*/
void setX(double x);
/*! \brief Sets the Y-position of the top side.
*
* The bottom side of the rectangle does not move, and as a result,
* the rectangle may be resized.
*/
void setY(double y);
/*! \brief Sets the width.
*
* The right side of the rectangle may move, but does not change the X
* position of the left side.
*/
void setWidth(double width) { width_ = width; }
/*! \brief Sets the Y-position of the top side.
*
* The bottom side of the rectangle may move, but does not change
* the Y position of the top side.
*/
void setHeight(double height) { height_ = height; }
/*! \brief Returns the X-position of the left side.
*
* This is equivalent to left().
*
* \sa y(), left()
*/
double x() const { return x_; }
/*! \brief Returns the Y-position of the top side.
*
* This is equivalent to top().
*
* \sa x(), top()
*/
double y() const { return y_; }
/*! \brief Returns the width.
*
* \sa height()
*/
double width() const { return width_; }
/*! \brief Returns the height.
*
* \sa width()
*/
double height() const { return height_; }
/*! \brief Returns the X position of the left side.
*
* \sa x(), right()
*/
double left() const { return x_; }
/*! \brief Returns the Y position of the top side.
*
* \sa y(), bottom()
*/
double top() const { return y_; }
/*! \brief Returns the X position of the right side.
*
* \sa left()
*/
double right() const { return x_ + width_; }
/*! \brief Returns the Y position of the bottom side.
*
* \sa top()
*/
double bottom() const { return y_ + height_; }
/*! \brief Returns the top left point.
*
* \sa left(), top()
*/
WPointF topLeft() const;
/*! \brief Returns the top right point.
*
* \sa right(), top()
*/
WPointF topRight() const;
/*! \brief Returns the center point.
*/
WPointF center() const;
/*! \brief Returns the bottom left point.
*
* \sa left(), bottom()
*/
WPointF bottomLeft() const;
/*! \brief Returns the bottom right point.
*
* \sa right(), bottom()
*/
WPointF bottomRight() const;
/*! \brief Tests if a rectangle contains a point.
*/
bool contains(const WPointF& p) const;
/*! \brief Tests if a rectangle contains a point.
*/
bool contains(double x, double y) const;
/*! \brief Tests if two rectangles intersect.
*/
bool intersects(const WRectF& other) const;
/*! \brief Makes the union of to rectangles.
*/
WRectF united(const WRectF& other) const;
/*! \brief Returns a normalized rectangle.
*
* A normalized rectangle has a positive width and height.
*/
WRectF normalized() const;
private:
double x_, y_, width_, height_;
};
}
#endif // WRECTF_H_
|