Commit 2a468589 authored by hyatt's avatar hyatt

Convert QPointF to FloatPoint and move it to the platform

        directory.

        * WebCore.xcodeproj/project.pbxproj:
        * kcanvas/KCanvasContainer.cpp:
        (KCanvasContainer::fillContains):
        (KCanvasContainer::strokeContains):
        * kcanvas/KCanvasContainer.h:
        * kcanvas/KCanvasFilters.h:
        (KCanvasFEConvolveMatrix::kernelUnitLength):
        (KCanvasFEConvolveMatrix::setKernelUnitLength):
        * kcanvas/KCanvasItem.cpp:
        (RenderPath::fillContains):
        (RenderPath::strokeContains):
        * kcanvas/KCanvasItem.h:
        * kcanvas/KCanvasTreeDebug.cpp:
        (operator<<):
        * kcanvas/KCanvasTreeDebug.h:
        * kcanvas/device/KRenderingPaintServerGradient.cpp:
        (KRenderingPaintServerLinearGradient::gradientStart):
        (KRenderingPaintServerLinearGradient::setGradientStart):
        (KRenderingPaintServerLinearGradient::gradientEnd):
        (KRenderingPaintServerLinearGradient::setGradientEnd):
        (KRenderingPaintServerRadialGradient::gradientCenter):
        (KRenderingPaintServerRadialGradient::setGradientCenter):
        (KRenderingPaintServerRadialGradient::gradientFocal):
        (KRenderingPaintServerRadialGradient::setGradientFocal):
        * kcanvas/device/KRenderingPaintServerGradient.h:
        * kcanvas/device/quartz/KCanvasFilterQuartz.mm:
        (ciVector):
        * kcanvas/device/quartz/KCanvasItemQuartz.h:
        * kcanvas/device/quartz/KCanvasItemQuartz.mm:
        (KCanvasItemQuartz::nodeAtPoint):
        (KCanvasItemQuartz::hitsPath):
        * ksvg2/svg/SVGLinearGradientElementImpl.cpp:
        (SVGLinearGradientElementImpl::buildGradient):
        * ksvg2/svg/SVGRadialGradientElementImpl.cpp:
        (SVGRadialGradientElementImpl::buildGradient):
        * kwq/KWQPointF.h: Removed.
        * kwq/KWQPointF.mm: Removed.
        * kwq/KWQRectF.h:
        (QRectF::contains):
        * kwq/KWQRectF.mm:
        (QRectF::QRectF):
        (QRectF::topLeft):
        (QRectF::topRight):
        (QRectF::bottomRight):
        (QRectF::bottomLeft):
        * platform/FloatPoint.cpp: Added.
        (WebCore::FloatPoint::FloatPoint):
        (WebCore::yCoord):
        (WebCore::operator+):
        (WebCore::operator-):
        (WebCore::operator*):
        * platform/FloatPoint.h: Added.
        (WebCore::FloatPoint::operator -=):
        * platform/mac/FloatPoint.mm: Added.
        (WebCore::FloatPoint::FloatPoint):
        (WebCore::FloatPoint::operator NSPoint):
        (WebCore::FloatPoint::operator CGPoint):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@12084 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 85fa3d50
2006-01-13 David Hyatt <hyatt@apple.com>
Convert QPointF to FloatPoint and move it to the platform
directory.
* WebCore.xcodeproj/project.pbxproj:
* kcanvas/KCanvasContainer.cpp:
(KCanvasContainer::fillContains):
(KCanvasContainer::strokeContains):
* kcanvas/KCanvasContainer.h:
* kcanvas/KCanvasFilters.h:
(KCanvasFEConvolveMatrix::kernelUnitLength):
(KCanvasFEConvolveMatrix::setKernelUnitLength):
* kcanvas/KCanvasItem.cpp:
(RenderPath::fillContains):
(RenderPath::strokeContains):
* kcanvas/KCanvasItem.h:
* kcanvas/KCanvasTreeDebug.cpp:
(operator<<):
* kcanvas/KCanvasTreeDebug.h:
* kcanvas/device/KRenderingPaintServerGradient.cpp:
(KRenderingPaintServerLinearGradient::gradientStart):
(KRenderingPaintServerLinearGradient::setGradientStart):
(KRenderingPaintServerLinearGradient::gradientEnd):
(KRenderingPaintServerLinearGradient::setGradientEnd):
(KRenderingPaintServerRadialGradient::gradientCenter):
(KRenderingPaintServerRadialGradient::setGradientCenter):
(KRenderingPaintServerRadialGradient::gradientFocal):
(KRenderingPaintServerRadialGradient::setGradientFocal):
* kcanvas/device/KRenderingPaintServerGradient.h:
* kcanvas/device/quartz/KCanvasFilterQuartz.mm:
(ciVector):
* kcanvas/device/quartz/KCanvasItemQuartz.h:
* kcanvas/device/quartz/KCanvasItemQuartz.mm:
(KCanvasItemQuartz::nodeAtPoint):
(KCanvasItemQuartz::hitsPath):
* ksvg2/svg/SVGLinearGradientElementImpl.cpp:
(SVGLinearGradientElementImpl::buildGradient):
* ksvg2/svg/SVGRadialGradientElementImpl.cpp:
(SVGRadialGradientElementImpl::buildGradient):
* kwq/KWQPointF.h: Removed.
* kwq/KWQPointF.mm: Removed.
* kwq/KWQRectF.h:
(QRectF::contains):
* kwq/KWQRectF.mm:
(QRectF::QRectF):
(QRectF::topLeft):
(QRectF::topRight):
(QRectF::bottomRight):
(QRectF::bottomLeft):
* platform/FloatPoint.cpp: Added.
(WebCore::FloatPoint::FloatPoint):
(WebCore::yCoord):
(WebCore::operator+):
(WebCore::operator-):
(WebCore::operator*):
* platform/FloatPoint.h: Added.
(WebCore::FloatPoint::operator -=):
* platform/mac/FloatPoint.mm: Added.
(WebCore::FloatPoint::FloatPoint):
(WebCore::FloatPoint::operator NSPoint):
(WebCore::FloatPoint::operator CGPoint):
2006-01-13 David Hyatt <hyatt@apple.com>
Convert QPoint and QPointArray to IntPoint and IntPointArray.
......
......@@ -10,8 +10,6 @@
1A3D8557097647B5002C85D1 /* ObjectContents.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A3D8556097647B4002C85D1 /* ObjectContents.h */; };
1A69D381085627410009880D /* domparser.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A69D37F085627410009880D /* domparser.h */; };
1A69D382085627410009880D /* domparser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A69D380085627410009880D /* domparser.cpp */; };
4756536509652C5D00BD9F29 /* KWQPointF.h in Headers */ = {isa = PBXBuildFile; fileRef = 4756535F09652C5D00BD9F29 /* KWQPointF.h */; };
4756536609652C5D00BD9F29 /* KWQPointF.mm in Sources */ = {isa = PBXBuildFile; fileRef = 4756536009652C5D00BD9F29 /* KWQPointF.mm */; };
4756536709652C5D00BD9F29 /* KWQRectF.h in Headers */ = {isa = PBXBuildFile; fileRef = 4756536109652C5D00BD9F29 /* KWQRectF.h */; };
4756536809652C5D00BD9F29 /* KWQRectF.mm in Sources */ = {isa = PBXBuildFile; fileRef = 4756536209652C5D00BD9F29 /* KWQRectF.mm */; };
550A0BC9085F6039007353D6 /* dom_qname.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 550A0BC7085F6039007353D6 /* dom_qname.cpp */; };
......@@ -1615,6 +1613,12 @@
BC73E3060978AFB200EDFF8A /* IntPoint.mm in Sources */ = {isa = PBXBuildFile; fileRef = BC73E3040978AFB200EDFF8A /* IntPoint.mm */; };
BC73E3190978AFFC00EDFF8A /* IntPoint.h in Headers */ = {isa = PBXBuildFile; fileRef = BC73E3180978AFFB00EDFF8A /* IntPoint.h */; };
BC73E31A0978AFFC00EDFF8A /* IntPoint.h in Headers */ = {isa = PBXBuildFile; fileRef = BC73E3180978AFFB00EDFF8A /* IntPoint.h */; };
BC73E38E0978CEB300EDFF8A /* FloatPoint.mm in Sources */ = {isa = PBXBuildFile; fileRef = BC73E38D0978CEB300EDFF8A /* FloatPoint.mm */; };
BC73E38F0978CEB300EDFF8A /* FloatPoint.mm in Sources */ = {isa = PBXBuildFile; fileRef = BC73E38D0978CEB300EDFF8A /* FloatPoint.mm */; };
BC73E3920978CED700EDFF8A /* FloatPoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC73E3900978CED700EDFF8A /* FloatPoint.cpp */; };
BC73E3930978CED700EDFF8A /* FloatPoint.h in Headers */ = {isa = PBXBuildFile; fileRef = BC73E3910978CED700EDFF8A /* FloatPoint.h */; };
BC73E3940978CED700EDFF8A /* FloatPoint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BC73E3900978CED700EDFF8A /* FloatPoint.cpp */; };
BC73E3950978CED700EDFF8A /* FloatPoint.h in Headers */ = {isa = PBXBuildFile; fileRef = BC73E3910978CED700EDFF8A /* FloatPoint.h */; };
BCEF3434087B563E00BBF833 /* htmlfactory.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCEF3432087B563E00BBF833 /* htmlfactory.cpp */; };
BCEF3435087B563E00BBF833 /* htmlfactory.h in Headers */ = {isa = PBXBuildFile; fileRef = BCEF3433087B563E00BBF833 /* htmlfactory.h */; };
BCF1A5F1097839600061A123 /* IntSize.h in Headers */ = {isa = PBXBuildFile; fileRef = BCF1A5EF097839600061A123 /* IntSize.h */; };
......@@ -1707,8 +1711,6 @@
1A69D380085627410009880D /* domparser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = domparser.cpp; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
2D90660B0665D937006B6F1A /* KWQClipboard.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = KWQClipboard.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
2D90660C0665D937006B6F1A /* KWQClipboard.mm */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = KWQClipboard.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
4756535F09652C5D00BD9F29 /* KWQPointF.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = KWQPointF.h; sourceTree = "<group>"; };
4756536009652C5D00BD9F29 /* KWQPointF.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = KWQPointF.mm; sourceTree = "<group>"; };
4756536109652C5D00BD9F29 /* KWQRectF.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = KWQRectF.h; sourceTree = "<group>"; };
4756536209652C5D00BD9F29 /* KWQRectF.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = KWQRectF.mm; sourceTree = "<group>"; };
4758C44308C5F217009BAF05 /* KCanvasPath.cpp */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = KCanvasPath.cpp; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
......@@ -2459,6 +2461,9 @@
BC73E2FD0978AF9C00EDFF8A /* IntPointArray.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = IntPointArray.h; path = platform/IntPointArray.h; sourceTree = "<group>"; };
BC73E3040978AFB200EDFF8A /* IntPoint.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; name = IntPoint.mm; path = platform/mac/IntPoint.mm; sourceTree = "<group>"; };
BC73E3180978AFFB00EDFF8A /* IntPoint.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = IntPoint.h; path = platform/IntPoint.h; sourceTree = "<group>"; };
BC73E38D0978CEB300EDFF8A /* FloatPoint.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; name = FloatPoint.mm; path = platform/mac/FloatPoint.mm; sourceTree = "<group>"; };
BC73E3900978CED700EDFF8A /* FloatPoint.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = FloatPoint.cpp; path = platform/FloatPoint.cpp; sourceTree = "<group>"; };
BC73E3910978CED700EDFF8A /* FloatPoint.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = FloatPoint.h; path = platform/FloatPoint.h; sourceTree = "<group>"; };
BC74596205954CC80058C893 /* xbl_protobinding.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; name = xbl_protobinding.cpp; path = xbl/xbl_protobinding.cpp; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
BC74596305954CC80058C893 /* xbl_protobinding.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; name = xbl_protobinding.h; path = xbl/xbl_protobinding.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
BC745A1A05955F380058C893 /* xbl_protohandler.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; name = xbl_protohandler.cpp; path = xbl/xbl_protohandler.cpp; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
......@@ -3642,6 +3647,9 @@
BCF1A5BA097832090061A123 /* platform */ = {
isa = PBXGroup;
children = (
BC73E38D0978CEB300EDFF8A /* FloatPoint.mm */,
BC73E3900978CED700EDFF8A /* FloatPoint.cpp */,
BC73E3910978CED700EDFF8A /* FloatPoint.h */,
BC73E3180978AFFB00EDFF8A /* IntPoint.h */,
BC73E3040978AFB200EDFF8A /* IntPoint.mm */,
BC73E2FB0978AF9C00EDFF8A /* IntPoint.cpp */,
......@@ -4370,8 +4378,6 @@
F58786BA02DE3B8601EA4122 /* KWQStringList.h */,
F587853202DE375901EA4122 /* KWQStringList.mm */,
F58786BB02DE3B8601EA4122 /* KWQStyle.h */,
4756535F09652C5D00BD9F29 /* KWQPointF.h */,
4756536009652C5D00BD9F29 /* KWQPointF.mm */,
4756536109652C5D00BD9F29 /* KWQRectF.h */,
4756536209652C5D00BD9F29 /* KWQRectF.mm */,
F57B0EE002EBC78B018635CA /* KWQStyle.cpp */,
......@@ -4873,7 +4879,6 @@
A88AD5190952499F001DD196 /* KDOMHeaders.h in Headers */,
A88AD51A0952499F001DD196 /* KDOMSettings.h in Headers */,
6552E7AA096AA11B0006F248 /* WebCoreFrameNamespaces.h in Headers */,
4756536509652C5D00BD9F29 /* KWQPointF.h in Headers */,
4756536709652C5D00BD9F29 /* KWQRectF.h in Headers */,
A81655D4096BBEAC00601058 /* KCanvasMaskerQuartz.h in Headers */,
A81655E5096BC13900601058 /* SVGMaskElementImpl.h in Headers */,
......@@ -4926,6 +4931,7 @@
BC73E25E0978682700EDFF8A /* FloatSize.h in Headers */,
BC73E3000978AF9C00EDFF8A /* IntPointArray.h in Headers */,
BC73E3190978AFFC00EDFF8A /* IntPoint.h in Headers */,
BC73E3930978CED700EDFF8A /* FloatPoint.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......@@ -5263,6 +5269,7 @@
BC73E2600978682700EDFF8A /* FloatSize.h in Headers */,
BC73E3030978AF9C00EDFF8A /* IntPointArray.h in Headers */,
BC73E31A0978AFFC00EDFF8A /* IntPoint.h in Headers */,
BC73E3950978CED700EDFF8A /* FloatPoint.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......@@ -6746,7 +6753,6 @@
A88AD51E0952499F001DD196 /* SVGNamesWrapper.cpp in Sources */,
A88AD5AA09525131001DD196 /* SVGCSSStyleSelector.cpp in Sources */,
6552E7AB096AA11B0006F248 /* WebCoreFrameNamespaces.m in Sources */,
4756536609652C5D00BD9F29 /* KWQPointF.mm in Sources */,
4756536809652C5D00BD9F29 /* KWQRectF.mm in Sources */,
A81655D5096BBEAC00601058 /* KCanvasMaskerQuartz.mm in Sources */,
A81655E4096BC13900601058 /* SVGMaskElementImpl.cpp in Sources */,
......@@ -6798,6 +6804,8 @@
BC73E2FE0978AF9C00EDFF8A /* IntPoint.cpp in Sources */,
BC73E2FF0978AF9C00EDFF8A /* IntPointArray.cpp in Sources */,
BC73E3050978AFB200EDFF8A /* IntPoint.mm in Sources */,
BC73E38E0978CEB300EDFF8A /* FloatPoint.mm in Sources */,
BC73E3920978CED700EDFF8A /* FloatPoint.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......@@ -7082,6 +7090,8 @@
BC73E3010978AF9C00EDFF8A /* IntPoint.cpp in Sources */,
BC73E3020978AF9C00EDFF8A /* IntPointArray.cpp in Sources */,
BC73E3060978AFB200EDFF8A /* IntPoint.mm in Sources */,
BC73E38F0978CEB300EDFF8A /* FloatPoint.mm in Sources */,
BC73E3940978CED700EDFF8A /* FloatPoint.cpp in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......
......@@ -68,7 +68,7 @@ void KCanvasContainer::setLocalTransform(const QMatrix &matrix)
d->matrix = matrix;
}
bool KCanvasContainer::fillContains(const QPointF &p) const
bool KCanvasContainer::fillContains(const FloatPoint &p) const
{
khtml::RenderObject *current = firstChild();
for(; current != 0; current = current->nextSibling())
......@@ -80,7 +80,7 @@ bool KCanvasContainer::fillContains(const QPointF &p) const
return false;
}
bool KCanvasContainer::strokeContains(const QPointF &p) const
bool KCanvasContainer::strokeContains(const FloatPoint &p) const
{
khtml::RenderObject *current = firstChild();
for(; current != 0; current = current->nextSibling())
......
......@@ -59,8 +59,8 @@ public:
virtual bool isKCanvasContainer() const { return true; }
virtual const char *renderName() const { return "KCanvasContainer"; }
virtual bool fillContains(const QPointF &p) const;
virtual bool strokeContains(const QPointF &p) const;
virtual bool fillContains(const FloatPoint &p) const;
virtual bool strokeContains(const FloatPoint &p) const;
virtual QRectF relativeBBox(bool includeStroke = true) const;
virtual QMatrix localTransform() const;
......
......@@ -307,8 +307,8 @@ public:
KCEdgeModeType edgeMode() const { return m_edgeMode; }
void setEdgeMode(KCEdgeModeType edgeMode) { m_edgeMode = edgeMode; }
QPointF kernelUnitLength() const {return m_kernelUnitLength; }
void setKernelUnitLength(QPointF kernelUnitLength) { m_kernelUnitLength = kernelUnitLength; }
FloatPoint kernelUnitLength() const {return m_kernelUnitLength; }
void setKernelUnitLength(FloatPoint kernelUnitLength) { m_kernelUnitLength = kernelUnitLength; }
bool preserveAlpha() const { return m_preserveAlpha; }
void setPreserveAlpha(bool preserveAlpha) { m_preserveAlpha = preserveAlpha; }
......@@ -322,7 +322,7 @@ private:
float m_bias;
FloatSize m_targetOffset;
KCEdgeModeType m_edgeMode;
QPointF m_kernelUnitLength;
FloatPoint m_kernelUnitLength;
bool m_preserveAlpha;
};
......
......@@ -85,7 +85,7 @@ void RenderPath::setLocalTransform(const QMatrix &matrix)
d->matrix = matrix;
}
bool RenderPath::fillContains(const QPointF &p) const
bool RenderPath::fillContains(const FloatPoint &p) const
{
if(d->path && d->style)
return hitsPath(p, true);
......@@ -93,7 +93,7 @@ bool RenderPath::fillContains(const QPointF &p) const
return false;
}
bool RenderPath::strokeContains(const QPointF &p) const
bool RenderPath::strokeContains(const FloatPoint &p) const
{
if(d->path && d->style)
return hitsPath(p, false);
......
......@@ -33,7 +33,10 @@
#include <kcanvas/KCanvasTypes.h>
#include "khtml/rendering/render_object.h"
class QPointF;
namespace WebCore {
class FloatPoint;
}
namespace KSVG {
class SVGStyledElementImpl;
};
......@@ -50,8 +53,8 @@ public:
virtual ~RenderPath();
// Hit-detection seperated for the fill and the stroke
virtual bool fillContains(const QPointF &p) const;
virtual bool strokeContains(const QPointF &p) const;
virtual bool fillContains(const WebCore::FloatPoint &p) const;
virtual bool strokeContains(const WebCore::FloatPoint &p) const;
// Returns an unscaled bounding box (not even including localTransform()) for this vector path
virtual QRectF relativeBBox(bool includeStroke = true) const;
......@@ -72,7 +75,7 @@ public:
protected:
// restricted set of args for passing to paint servers, etc.
const KCanvasCommonArgs commonArgs() const;
virtual bool hitsPath(const QPointF &hitPoint, bool fill) const = 0;
virtual bool hitsPath(const WebCore::FloatPoint &hitPoint, bool fill) const = 0;
virtual QRectF bboxForPath(bool includeStroke) const = 0;
private:
......
......@@ -129,7 +129,7 @@ QTextStream &operator<<(QTextStream &ts, const QRectF &r)
return ts;
}
QTextStream &operator<<(QTextStream &ts, const QPointF &p)
QTextStream &operator<<(QTextStream &ts, const FloatPoint &p)
{
ts << "(";
if (hasFractions(p.x()))
......
......@@ -31,7 +31,6 @@ class QMatrix;
class QRect;
class QColor;
class QRectF;
class QPointF;
class QStringList;
class KCClipData;
class KCPathData;
......@@ -41,6 +40,7 @@ class KCanvasContainer;
namespace WebCore {
class FloatSize;
class FloatPoint;
class IntPoint;
}
......@@ -60,7 +60,7 @@ QTextStream &operator<<(QTextStream &ts, const QColor &);
QTextStream &operator<<(QTextStream &ts, const WebCore::IntPoint &);
QTextStream &operator<<(QTextStream &ts, const WebCore::FloatSize &);
QTextStream &operator<<(QTextStream &ts, const QRectF &);
QTextStream &operator<<(QTextStream &ts, const QPointF &);
QTextStream &operator<<(QTextStream &ts, const WebCore::FloatPoint &);
// helper operators specific to dumping the render tree. these are used in various classes to dump the render tree
// these could be defined in separate namespace to avoid matching these generic signatures unintentionally.
......
......@@ -172,7 +172,7 @@ public:
Private() { }
~Private() { }
QPointF start, end;
FloatPoint start, end;
};
KRenderingPaintServerLinearGradient::KRenderingPaintServerLinearGradient() : KRenderingPaintServerGradient(), d(new Private())
......@@ -184,22 +184,22 @@ KRenderingPaintServerLinearGradient::~KRenderingPaintServerLinearGradient()
delete d;
}
QPointF KRenderingPaintServerLinearGradient::gradientStart() const
FloatPoint KRenderingPaintServerLinearGradient::gradientStart() const
{
return d->start;
}
void KRenderingPaintServerLinearGradient::setGradientStart(const QPointF &start)
void KRenderingPaintServerLinearGradient::setGradientStart(const FloatPoint &start)
{
d->start = start;
}
QPointF KRenderingPaintServerLinearGradient::gradientEnd() const
FloatPoint KRenderingPaintServerLinearGradient::gradientEnd() const
{
return d->end;
}
void KRenderingPaintServerLinearGradient::setGradientEnd(const QPointF &end)
void KRenderingPaintServerLinearGradient::setGradientEnd(const FloatPoint &end)
{
d->end = end;
}
......@@ -226,7 +226,7 @@ public:
~Private() { }
float radius;
QPointF center, focal;
FloatPoint center, focal;
};
KRenderingPaintServerRadialGradient::KRenderingPaintServerRadialGradient() : KRenderingPaintServerGradient(), d(new Private())
......@@ -238,22 +238,22 @@ KRenderingPaintServerRadialGradient::~KRenderingPaintServerRadialGradient()
delete d;
}
QPointF KRenderingPaintServerRadialGradient::gradientCenter() const
FloatPoint KRenderingPaintServerRadialGradient::gradientCenter() const
{
return d->center;
}
void KRenderingPaintServerRadialGradient::setGradientCenter(const QPointF &center)
void KRenderingPaintServerRadialGradient::setGradientCenter(const FloatPoint &center)
{
d->center = center;
}
QPointF KRenderingPaintServerRadialGradient::gradientFocal() const
FloatPoint KRenderingPaintServerRadialGradient::gradientFocal() const
{
return d->focal;
}
void KRenderingPaintServerRadialGradient::setGradientFocal(const QPointF &focal)
void KRenderingPaintServerRadialGradient::setGradientFocal(const FloatPoint &focal)
{
d->focal = focal;
}
......
......@@ -102,11 +102,11 @@ public:
virtual KCPaintServerType type() const;
// 'Linear Gradient' interface
QPointF gradientStart() const;
void setGradientStart(const QPointF &start);
FloatPoint gradientStart() const;
void setGradientStart(const FloatPoint &start);
QPointF gradientEnd() const;
void setGradientEnd(const QPointF &end);
FloatPoint gradientEnd() const;
void setGradientEnd(const FloatPoint &end);
QTextStream &externalRepresentation(QTextStream &) const;
private:
......@@ -123,11 +123,11 @@ public:
virtual KCPaintServerType type() const;
// 'Radial Gradient' interface
QPointF gradientCenter() const;
void setGradientCenter(const QPointF &center);
FloatPoint gradientCenter() const;
void setGradientCenter(const FloatPoint &center);
QPointF gradientFocal() const;
void setGradientFocal(const QPointF &focal);
FloatPoint gradientFocal() const;
void setGradientFocal(const FloatPoint &focal);
float gradientRadius() const;
void setGradientRadius(float radius);
......
......@@ -60,7 +60,7 @@ static inline CIVector *ciVector(KCanvasPoint3F point)
return [CIVector vectorWithX:point.x() Y:point.y() Z:point.z()];
}
static inline CIVector *ciVector(QPointF point)
static inline CIVector *ciVector(FloatPoint point)
{
return [CIVector vectorWithX:point.x() Y:point.y()];
}
......
......@@ -32,7 +32,7 @@ public:
virtual ~KCanvasItemQuartz() { }
virtual QRectF bboxForPath(bool includeStroke) const;
virtual bool hitsPath(const QPointF &p, bool fill /* false means stroke */) const;
virtual bool hitsPath(const FloatPoint &p, bool fill /* false means stroke */) const;
virtual QRect getAbsoluteRepaintRect() { return enclosingQRect(absoluteTransform().mapRect(relativeBBox(true))); }
......
......@@ -258,7 +258,7 @@ bool KCanvasItemQuartz::nodeAtPoint(NodeInfo& info, int _x, int _y, int _tx, int
if (hitTestAction != HitTestForeground)
return false;
if (hitsPath(QPointF(_x, _y), true)) {
if (hitsPath(FloatPoint(_x, _y), true)) {
setInnerNode(info);
return true;
}
......@@ -310,7 +310,7 @@ QRectF KCanvasItemQuartz::bboxForPath(bool includeStroke) const
return QRectF(bbox);
}
bool KCanvasItemQuartz::hitsPath(const QPointF &hitPoint, bool fill) const
bool KCanvasItemQuartz::hitsPath(const FloatPoint &hitPoint, bool fill) const
{
CGPathRef cgPath = static_cast<KCanvasPathQuartz*>(path())->cgPath();
ASSERT(cgPath != 0);
......
......@@ -190,8 +190,8 @@ void SVGLinearGradientElementImpl::buildGradient(KRenderingPaintServerGradient *
grad->setGradientTransform(mat);
grad->setBoundingBoxMode(bbox);
grad->setGradientStart(QPointF(_x1, _y1));
grad->setGradientEnd(QPointF(_x2, _y2));
grad->setGradientStart(FloatPoint(_x1, _y1));
grad->setGradientEnd(FloatPoint(_x2, _y2));
}
// vim:ts=4:noet
......@@ -215,8 +215,8 @@ void SVGRadialGradientElementImpl::buildGradient(KRenderingPaintServerGradient *
grad->setGradientTransform(mat);
grad->setBoundingBoxMode(bbox);
grad->setGradientCenter(QPointF(_cx, _cy));
grad->setGradientFocal(QPointF(_fx, _fy));
grad->setGradientCenter(FloatPoint(_cx, _cy));
grad->setGradientFocal(FloatPoint(_fx, _fy));
grad->setGradientRadius(_r);
}
......
......@@ -29,7 +29,7 @@
#include <math.h>
#include "FloatSize.h"
#include "KWQPointF.h"
#include "FloatPoint.h"
#include "KWQRect.h"
#ifdef NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
......@@ -43,9 +43,9 @@ class QRect;
class QRectF {
public:
QRectF();
QRectF(QPointF p, FloatSize s);
QRectF(FloatPoint p, FloatSize s);
QRectF(float, float, float, float);
QRectF(const QPointF&, const QPointF&);
QRectF(const FloatPoint&, const FloatPoint&);
QRectF(const QRect&);
#ifndef NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
explicit QRectF(const NSRect&);
......@@ -65,10 +65,10 @@ public:
float width() const { return w; }
float height() const { return h; }
QPointF topLeft() const;
QPointF topRight() const;
QPointF bottomRight() const;
QPointF bottomLeft() const;
FloatPoint topLeft() const;
FloatPoint topRight() const;
FloatPoint bottomRight() const;
FloatPoint bottomLeft() const;
FloatSize size() const;
void setX(float x) { xp = x; }
......@@ -81,7 +81,7 @@ public:
QRectF unite(const QRectF&) const;
QRectF normalize() const;
bool contains(const QPointF& point) const { return contains(point.x(), point.y()); }
bool contains(const FloatPoint& point) const { return contains(point.x(), point.y()); }
bool contains(float x, float y, bool proper = false) const
{
......
......@@ -40,11 +40,11 @@ QRectF::QRectF(float x, float y, float width, float height) : xp(x), yp(y), w(wi
{
}
QRectF::QRectF(QPointF p, FloatSize s) : xp(p.x()), yp(p.y()), w(s.width()), h(s.height())
QRectF::QRectF(FloatPoint p, FloatSize s) : xp(p.x()), yp(p.y()), w(s.width()), h(s.height())
{
}
QRectF::QRectF(const QPointF &topLeft, const QPointF &bottomRight)
QRectF::QRectF(const FloatPoint &topLeft, const FloatPoint &bottomRight)
: xp(topLeft.x()), yp(topLeft.y()),
w(bottomRight.x() - topLeft.x() + 1.0f), h(bottomRight.y() - topLeft.y() + 1.0f)
{
......@@ -89,24 +89,24 @@ float QRectF::bottom() const
return yp + h - 1.0f;
}
QPointF QRectF::topLeft() const
FloatPoint QRectF::topLeft() const
{
return QPointF(xp,yp);
return FloatPoint(xp,yp);
}
QPointF QRectF::topRight() const
FloatPoint QRectF::topRight() const
{
return QPointF(right(),top());
return FloatPoint(right(),top());
}
QPointF QRectF::bottomRight() const
FloatPoint QRectF::bottomRight() const
{
return QPointF(right(),bottom());
return FloatPoint(right(),bottom());
}
QPointF QRectF::bottomLeft() const
FloatPoint QRectF::bottomLeft() const
{
return QPointF(left(),bottom());
return FloatPoint(left(),bottom());
}
FloatSize QRectF::size() const
......
/*
* Copyright (C) 2004, 2006 Apple Computer, Inc. All rights reserved.
* Copyright (C) 2005 Nokia. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "config.h"
#include "IntPoint.h"
#include "FloatPoint.h"
namespace WebCore {
FloatPoint::FloatPoint() : xCoord(0), yCoord(0)
{
}
FloatPoint::FloatPoint(float xIn, float yIn) : xCoord(xIn), yCoord(yIn)
{
}
FloatPoint::FloatPoint(const IntPoint& p) :xCoord(p.x()), yCoord(p.y())
{
}
FloatPoint operator+(const FloatPoint& a, const FloatPoint& b)
{
return FloatPoint(a.xCoord + b.xCoord, a.yCoord + b.yCoord);
}
FloatPoint operator-(const FloatPoint& a, const FloatPoint& b)
{
return FloatPoint(a.xCoord - b.xCoord, a.yCoord - b.yCoord);
}
const FloatPoint operator*(const FloatPoint& p, double s)
{
return FloatPoint(p.xCoord * s, p.yCoord * s);
}
}
......@@ -24,11 +24,10 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef QPOINTF_H_
#define QPOINTF_H_
#include "KWQDef.h"