2 Copyright (C) 2004, 2005 Nikolas Zimmermann <wildfox@kde.org>
3 2004, 2005 Rob Buis <buis@kde.org>
4 2005 Eric Seidel <eric.seidel@kdemail.net>
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., 59 Temple Place - Suite 330,
22 Boston, MA 02111-1307, USA.
29 #include "DeprecatedValueList.h"
30 #include "FloatRect.h"
32 #include "RenderObject.h"
37 class SVGStyledElement;
40 class RenderSVGContainer;
42 class RenderPath : public RenderObject
45 RenderPath(RenderStyle *style, SVGStyledElement *node);
46 virtual ~RenderPath();
48 // Hit-detection seperated for the fill and the stroke
49 virtual bool fillContains(const FloatPoint &p) const;
50 virtual bool strokeContains(const FloatPoint &p) const;
52 // Returns an unscaled bounding box (not even including localTransform()) for this vector path
53 virtual FloatRect relativeBBox(bool includeStroke = true) const;
55 void setPath(KCanvasPath* newPath);
56 KCanvasPath* path() const;
58 virtual bool isRenderPath() const { return true; }
59 virtual const char *renderName() const { return "KCanvasItem"; }
61 virtual AffineTransform localTransform() const;
62 virtual void setLocalTransform(const AffineTransform &matrix);
64 virtual void layout();
65 virtual IntRect getAbsoluteRepaintRect();
66 virtual bool requiresLayer();
67 virtual short lineHeight(bool b, bool isRootLineBox = false) const;
68 virtual short baselinePosition(bool b, bool isRootLineBox = false) const;
69 virtual void paint(PaintInfo&, int parentX, int parentY);
71 virtual void absoluteRects(DeprecatedValueList<IntRect>& rects, int tx, int ty);
73 virtual bool nodeAtPoint(NodeInfo&, int x, int y, int tx, int ty, HitTestAction);
75 // FIXME: When the other SVG classes get pointer-events support this should be moved elsewhere
76 struct PointerEventsHitRules {
77 PointerEventsHitRules()
78 : requireVisible(false)
80 , requireStroke(false)
93 virtual void drawMarkersIfNeeded(GraphicsContext*, const FloatRect&, const KCanvasPath*) const = 0;
96 FloatRect strokeBBox() const;
97 FloatPoint mapAbsolutePointToLocal(const FloatPoint&) const;
99 PointerEventsHitRules pointerEventsHitRules();
105 // Helper data structure
106 typedef DeprecatedValueList<const RenderPath *> KCanvasItemList;
110 #endif // SVG_SUPPORT