#include "config.h"
#include "Path.h"
#include "AffineTransform.h"
#include "FloatPoint.h"
#include "FloatRect.h"
#include "NotImplemented.h"
#include <stdio.h>
#include <wx/defs.h>
#include <wx/graphics.h>
namespace WebCore {
int getWxWindRuleForWindRule(WindRule rule)
{
if (rule == RULE_EVENODD)
return wxODDEVEN_RULE;
return wxWINDING_RULE;
}
Path::Path()
{
m_path = 0;
#if USE(WXGC)
wxGraphicsRenderer* renderer = wxGraphicsRenderer::GetDefaultRenderer();
if (renderer) {
wxGraphicsPath path = renderer->CreatePath();
m_path = new wxGraphicsPath(path);
}
#endif
}
Path::~Path()
{
}
Path::Path(const Path& path)
{
m_path = (PlatformPath*)&path.m_path;
}
bool Path::contains(const FloatPoint& point, const WindRule rule) const
{
return false;
}
void Path::translate(const FloatSize&)
{
notImplemented();
}
FloatRect Path::boundingRect() const
{
#if USE(WXGC)
if (m_path) {
return m_path->GetBox();
}
#endif
return FloatRect();
}
Path& Path::operator=(const Path&)
{
notImplemented();
return*this;
}
void Path::clear()
{
if (m_path)
delete m_path;
#if USE(WXGC)
wxGraphicsRenderer* renderer = wxGraphicsRenderer::GetDefaultRenderer();
if (renderer) {
wxGraphicsPath path = renderer->CreatePath();
m_path = new wxGraphicsPath(path);
}
#endif
}
void Path::moveTo(const FloatPoint& point)
{
#if USE(WXGC)
if (m_path)
m_path->MoveToPoint(point.x(), point.y());
#endif
}
void Path::addLineTo(const FloatPoint&)
{
notImplemented();
}
void Path::addQuadCurveTo(const FloatPoint&, const FloatPoint&)
{
notImplemented();
}
void Path::addBezierCurveTo(const FloatPoint&, const FloatPoint&, const FloatPoint&)
{
notImplemented();
}
void Path::addArcTo(const FloatPoint&, const FloatPoint&, float)
{
notImplemented();
}
void Path::closeSubpath()
{
notImplemented();
}
void Path::addArc(const FloatPoint&, float, float, float, bool)
{
notImplemented();
}
void Path::addRect(const FloatRect&)
{
notImplemented();
}
void Path::addEllipse(const FloatRect&)
{
notImplemented();
}
void Path::transform(const AffineTransform&)
{
notImplemented();
}
void Path::apply(void* info, PathApplierFunction function) const
{
notImplemented();
}
}