2 Copyright (C) 2004, 2005, 2007 Nikolas Zimmermann <zimmermann@kde.org>
3 2004, 2005 Rob Buis <buis@kde.org>
4 2005 Eric Seidel <eric@webkit.org>
5 2006 Apple Computer, Inc
7 This file is part of the KDE project
9 This library is free software; you can redistribute it and/or
10 modify it under the terms of the GNU Library General Public
11 License as published by the Free Software Foundation; either
12 version 2 of the License, or (at your option) any later version.
14 This library is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 Library General Public License for more details.
19 You should have received a copy of the GNU Library General Public License
20 aint with this library; see the file COPYING.LIB. If not, write to
21 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
22 Boston, MA 02110-1301, USA.
30 #include "TransformationMatrix.h"
31 #include "FloatRect.h"
33 #include "RenderObject.h"
38 class RenderSVGContainer
;
39 class SVGStyledTransformableElement
;
41 class RenderPath
: public RenderObject
{
43 RenderPath(SVGStyledTransformableElement
*);
45 // Hit-detection seperated for the fill and the stroke
46 bool fillContains(const FloatPoint
&, bool requiresFill
= true) const;
47 bool strokeContains(const FloatPoint
&, bool requiresStroke
= true) const;
49 // Returns an unscaled bounding box (not even including localTransform()) for this vector path
50 virtual FloatRect
relativeBBox(bool includeStroke
= true) const;
52 const Path
& path() const;
53 void setPath(const Path
& newPath
);
55 virtual bool isRenderPath() const { return true; }
56 virtual const char* renderName() const { return "RenderPath"; }
58 bool calculateLocalTransform();
59 virtual TransformationMatrix
localTransform() const;
61 virtual void layout();
62 virtual IntRect
clippedOverflowRectForRepaint(RenderBox
* repaintContainer
);
63 virtual bool requiresLayer() const { return false; }
64 virtual int lineHeight(bool b
, bool isRootLineBox
= false) const;
65 virtual int baselinePosition(bool b
, bool isRootLineBox
= false) const;
66 virtual void paint(PaintInfo
&, int parentX
, int parentY
);
68 virtual void absoluteRects(Vector
<IntRect
>&, int tx
, int ty
, bool topLevel
= true);
69 virtual void absoluteQuads(Vector
<FloatQuad
>&, bool topLevel
= true);
70 virtual void addFocusRingRects(GraphicsContext
*, int tx
, int ty
);
72 virtual bool nodeAtPoint(const HitTestRequest
&, HitTestResult
&, int x
, int y
, int tx
, int ty
, HitTestAction
);
74 FloatRect
drawMarkersIfNeeded(GraphicsContext
*, const FloatRect
&, const Path
&) const;
77 FloatPoint
mapAbsolutePointToLocal(const FloatPoint
&) const;
78 virtual IntRect
outlineBoundsForRepaint(RenderBox
* repaintContainer
) const;
81 mutable FloatRect m_fillBBox
;
82 mutable FloatRect m_strokeBbox
;
83 FloatRect m_markerBounds
;
84 TransformationMatrix m_localTransform
;
85 IntRect m_absoluteBounds
;