summaryrefslogtreecommitdiffstats
path: root/WebCore/platform/graphics/wx/PathWx.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/platform/graphics/wx/PathWx.cpp')
-rw-r--r--WebCore/platform/graphics/wx/PathWx.cpp113
1 files changed, 81 insertions, 32 deletions
diff --git a/WebCore/platform/graphics/wx/PathWx.cpp b/WebCore/platform/graphics/wx/PathWx.cpp
index 5ff9914..60c71d5 100644
--- a/WebCore/platform/graphics/wx/PathWx.cpp
+++ b/WebCore/platform/graphics/wx/PathWx.cpp
@@ -26,10 +26,11 @@
#include "config.h"
#include "Path.h"
-#include "AffineTransform.h"
+#include "TransformationMatrix.h"
#include "FloatPoint.h"
#include "FloatRect.h"
#include "NotImplemented.h"
+#include "StrokeStyleApplier.h"
#include <stdio.h>
@@ -64,7 +65,7 @@ Path::Path()
}
Path::~Path()
-{
+{
}
Path::Path(const Path& path)
@@ -73,7 +74,16 @@ Path::Path(const Path& path)
}
bool Path::contains(const FloatPoint& point, const WindRule rule) const
-{
+{
+#if USE(WXGC)
+ if (m_path) {
+#if wxCHECK_VERSION(2,9,0)
+ return m_path->Contains(point.x(), point.y(), static_cast<wxPolygonFillMode>(getWxWindRuleForWindRule(rule)));
+#else
+ return m_path->Contains(point.x(), point.y(), getWxWindRuleForWindRule(rule));
+#endif
+ }
+#endif
return false;
}
@@ -93,6 +103,12 @@ FloatRect Path::boundingRect() const
return FloatRect();
}
+FloatRect Path::strokeBoundingRect(StrokeStyleApplier* applier)
+{
+ notImplemented();
+ return FloatRect();
+}
+
Path& Path::operator=(const Path&)
{
notImplemented();
@@ -121,60 +137,93 @@ void Path::moveTo(const FloatPoint& point)
#endif
}
-void Path::addLineTo(const FloatPoint&)
-{
- notImplemented();
+void Path::addLineTo(const FloatPoint& point)
+{
+#if USE(WXGC)
+ if (m_path)
+ m_path->AddLineToPoint(point.x(), point.y());
+#endif
}
-void Path::addQuadCurveTo(const FloatPoint&, const FloatPoint&)
-{
- notImplemented();
+void Path::addQuadCurveTo(const FloatPoint& control, const FloatPoint& end)
+{
+#if USE(WXGC)
+ if (m_path)
+ m_path->AddQuadCurveToPoint(control.x(), control.y(), end.x(), end.y());
+#endif
}
-void Path::addBezierCurveTo(const FloatPoint&, const FloatPoint&, const FloatPoint&)
-{
- notImplemented();
+void Path::addBezierCurveTo(const FloatPoint& control1, const FloatPoint& control2, const FloatPoint& end)
+{
+#if USE(WXGC)
+ if (m_path)
+ m_path->AddCurveToPoint(control1.x(), control1.y(), control2.x(), control2.y(), end.x(), end.y());
+#endif
}
-void Path::addArcTo(const FloatPoint&, const FloatPoint&, float)
-{
- notImplemented();
+void Path::addArcTo(const FloatPoint& point1, const FloatPoint& point2, float radius)
+{
+#if USE(WXGC)
+ if (m_path)
+ m_path->AddArcToPoint(point1.x(), point1.y(), point2.x(), point2.y(), radius);
+#endif
}
void Path::closeSubpath()
-{
- notImplemented();
+{
+#if USE(WXGC)
+ if (m_path)
+ m_path->CloseSubpath();
+#endif
}
-void Path::addArc(const FloatPoint&, float, float, float, bool)
-{
- notImplemented();
+void Path::addArc(const FloatPoint& point, float radius, float startAngle, float endAngle, bool clockwise)
+{
+#if USE(WXGC)
+ if (m_path)
+ m_path->AddArc(point.x(), point.y(), radius, startAngle, endAngle, clockwise);
+#endif
}
-void Path::addRect(const FloatRect&)
-{
- notImplemented();
+void Path::addRect(const FloatRect& rect)
+{
+#if USE(WXGC)
+ if (m_path)
+ m_path->AddRectangle(rect.x(), rect.y(), rect.width(), rect.height());
+#endif
}
-void Path::addEllipse(const FloatRect&)
-{
- notImplemented();
+void Path::addEllipse(const FloatRect& rect)
+{
+#if USE(WXGC)
+ if (m_path)
+ m_path->AddEllipse(rect.x(), rect.y(), rect.width(), rect.height());
+#endif
}
-void Path::transform(const AffineTransform&)
-{
- notImplemented();
+void Path::transform(const TransformationMatrix& transform)
+{
+#if USE(WXGC)
+ if (m_path)
+ m_path->Transform(transform);
+#endif
}
void Path::apply(void* info, PathApplierFunction function) const
-{
+{
notImplemented();
}
bool Path::isEmpty() const
{
- notImplemented();
- return false;
+#if USE(WXGC)
+ if (m_path) {
+ wxDouble width, height;
+ m_path->GetBox(NULL, NULL, &width, &height);
+ return (width == 0 && height == 0);
+ }
+#endif
+ return true;
}
}