#ifndef KCanvasPath_H
#define KCanvasPath_H
#if SVG_SUPPORT
#include "DeprecatedValueList.h"
#include <wtf/Assertions.h>
#include "Shared.h"
#include "FloatRect.h"
namespace WebCore {
class KRenderingStrokePainter;
class RenderStyle;
class TextStream;
enum KCWindRule {
RULE_NONZERO = 0,
RULE_EVENODD = 1
};
typedef enum
{
CMD_MOVE = 0,
CMD_LINE = 1,
CMD_CURVE = 2,
CMD_CLOSE_SUBPATH = 3
} KCPathCommand;
class KCanvasPath : public Shared<KCanvasPath>
{
public:
virtual ~KCanvasPath() { }
virtual bool isEmpty() const = 0;
virtual void moveTo(float x, float y) = 0;
virtual void lineTo(float x, float y) = 0;
virtual void curveTo(float x1, float y1, float x2, float y2, float x3, float y3) = 0;
virtual void closeSubpath() = 0;
virtual FloatRect boundingBox() = 0;
virtual FloatRect strokeBoundingBox(const KRenderingStrokePainter&) = 0;
virtual bool strokeContainsPoint(const FloatPoint&) = 0;
virtual bool containsPoint(const FloatPoint&, KCWindRule) = 0;
};
struct KCClipData
{
KCWindRule windRule() const { return static_cast<KCWindRule>(m_windRule); }
unsigned m_windRule : 1; bool bboxUnits : 1;
RefPtr<KCanvasPath> path;
};
class KCClipDataList : public DeprecatedValueList<KCClipData>
{
public:
KCClipDataList() { }
inline void addPath(KCanvasPath *pathData, KCWindRule windRule, bool bboxUnits)
{
ASSERT(pathData);
KCClipData clipData;
clipData.m_windRule = windRule;
clipData.bboxUnits = bboxUnits;
clipData.path = pathData;
append(clipData);
}
};
TextStream &operator<<(TextStream &ts, KCWindRule rule);
TextStream &operator<<(TextStream &ts, const KCClipData &d);
}
#endif // SVG_SUPPORT
#endif