/usr/include/Wt/WPolygonArea is in libwt-dev 3.3.6+dfsg-1.1.
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 | // 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 WPOLYGON_AREA_H_
#define WPOLYGON_AREA_H_
#include <Wt/WAbstractArea>
#include <Wt/WPoint>
#include <Wt/WPointF>
namespace Wt {
/*! \class WPolygonArea Wt/WPolygonArea Wt/WPolygonArea
* \brief An interactive area in a widget, specified by a polygon.
*
* The area may be added to a WImage or WPaintedWidget to provide
* interactivity on a polygon area of the image. The polygon is
* specified in pixel coordinates, and uses an even-odd winding rule
* (overlaps create holes).
*
* \if cpp
* \code
* Wt::WImage *image = new Wt::WImage("images/family.jpg");
* Wt::WPolygonArea *face = new Wt::WPolygonArea();
* face->addPoint(100, 120);
* face->addPoint(300, 120);
* face->addPoint (200, 250);
* face->setToolTip("Uncle Frank");
* image->addArea(face);
* \endcode
* \endif
*
* The polygon area corresponds to the HTML <tt><area shape="poly"></tt>
* tag.
*
* \sa WImage::addArea(), WPaintedWidget::addArea()
* \sa WCircleArea, WRectArea
*/
class WT_API WPolygonArea : public WAbstractArea
{
public:
/*! \brief Creates an empty polygon.
*
* Defines an empty polygon.
*/
WPolygonArea();
/*! \brief Creates a polygon area with given vertices.
*
* The polygon is defined with vertices corresponding to
* \p points. The polygon is closed by connecting the last point
* with the first point.
*/
WPolygonArea(const std::vector<WPoint>& points);
#ifndef WT_TARGET_JAVA
/*! \brief Creates a polygon area with given vertices.
*
* The polygon is defined with vertices corresponding to
* \p points. The polygon is closed by connecting the last point
* with the first point.
*/
WPolygonArea(const std::vector<WPointF>& points);
#endif // WT_TARGET_JAVA
/*! \brief Adds a point.
*/
void addPoint(int x, int y);
/*! \brief Adds a point.
*/
void addPoint(double x, double y);
/*! \brief Adds a point.
*/
void addPoint(const WPoint& point);
/*! \brief Adds a point.
*/
void addPoint(const WPointF& point);
/*! \brief Sets the polygon vertices.
*
* The polygon is defined with vertices corresponding to
* \p points. The polygon is closed by connecting the last point
* with the first point.
*/
void setPoints(const std::vector<WPoint>& points);
#ifndef WT_TARGET_JAVA
/*! \brief Sets the polygon vertices.
*
* The polygon is defined with vertices corresponding to
* \p points. The polygon is closed by connecting the last point
* with the first point.
*/
void setPoints(const std::vector<WPointF>& points);
#endif // WT_TARGET_JAVA
/*! \brief Returns the polygon vertices.
*
* \sa setPoints(), points()
*/
const std::vector<WPointF>& pointFs() const { return points_; }
/*! \brief Returns the polygon vertices.
*
* \sa setPoints(), pointFs()
*/
const std::vector<WPoint>& points() const;
private:
std::vector<WPointF> points_;
mutable std::vector<WPoint> pointsIntCompatibility_;
protected:
virtual bool updateDom(DomElement& element, bool all) WT_CXX11ONLY(override);
virtual std::string updateAreaCoordsJS() WT_CXX11ONLY(override);
};
}
#endif // WPOLYGON_AREA_H_
|