]> git.saurik.com Git - iphone-api.git/blob - WebCore/RenderPath.h
Add support for new WinterBoard Settings features.
[iphone-api.git] / WebCore / RenderPath.h
1 /*
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
6
7 This file is part of the KDE project
8
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.
13
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.
18
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.
23 */
24
25 #ifndef RenderPath_h
26 #define RenderPath_h
27
28 #if ENABLE(SVG)
29
30 #include "TransformationMatrix.h"
31 #include "FloatRect.h"
32
33 #include "RenderObject.h"
34
35 namespace WebCore {
36
37 class FloatPoint;
38 class RenderSVGContainer;
39 class SVGStyledTransformableElement;
40
41 class RenderPath : public RenderObject {
42 public:
43 RenderPath(SVGStyledTransformableElement*);
44
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;
48
49 // Returns an unscaled bounding box (not even including localTransform()) for this vector path
50 virtual FloatRect relativeBBox(bool includeStroke = true) const;
51
52 const Path& path() const;
53 void setPath(const Path& newPath);
54
55 virtual bool isRenderPath() const { return true; }
56 virtual const char* renderName() const { return "RenderPath"; }
57
58 bool calculateLocalTransform();
59 virtual TransformationMatrix localTransform() const;
60
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);
67
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);
71
72 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, int x, int y, int tx, int ty, HitTestAction);
73
74 FloatRect drawMarkersIfNeeded(GraphicsContext*, const FloatRect&, const Path&) const;
75
76 private:
77 FloatPoint mapAbsolutePointToLocal(const FloatPoint&) const;
78 virtual IntRect outlineBoundsForRepaint(RenderBox* repaintContainer) const;
79
80 mutable Path m_path;
81 mutable FloatRect m_fillBBox;
82 mutable FloatRect m_strokeBbox;
83 FloatRect m_markerBounds;
84 TransformationMatrix m_localTransform;
85 IntRect m_absoluteBounds;
86 };
87
88 }
89
90 #endif // ENABLE(SVG)
91 #endif
92
93 // vim:ts=4:noet