]> git.saurik.com Git - iphone-api.git/blob - WebCore/RenderSVGImage.h
Add support for new WinterBoard Settings features.
[iphone-api.git] / WebCore / RenderSVGImage.h
1 /*
2 Copyright (C) 2006 Alexander Kellett <lypanov@kde.org>
3 Copyright (C) 2006 Apple Computer, Inc.
4 Copyright (C) 2007 Rob Buis <buis@kde.org>
5
6 This file is part of the WebKit project.
7
8 This library is free software; you can redistribute it and/or
9 modify it under the terms of the GNU Library General Public
10 License as published by the Free Software Foundation; either
11 version 2 of the License, or (at your option) any later version.
12
13 This library is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 Library General Public License for more details.
17
18 You should have received a copy of the GNU Library General Public License
19 along with this library; see the file COPYING.LIB. If not, write to
20 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21 Boston, MA 02110-1301, USA.
22 */
23
24 #ifndef RenderSVGImage_h
25 #define RenderSVGImage_h
26
27 #if ENABLE(SVG)
28
29 #include "TransformationMatrix.h"
30 #include "FloatRect.h"
31 #include "RenderImage.h"
32
33 namespace WebCore {
34
35 class SVGImageElement;
36 class SVGPreserveAspectRatio;
37
38 class RenderSVGImage : public RenderImage {
39 public:
40 RenderSVGImage(SVGImageElement*);
41 virtual ~RenderSVGImage();
42
43 virtual TransformationMatrix localTransform() const { return m_localTransform; }
44
45 virtual FloatRect relativeBBox(bool includeStroke = true) const;
46 virtual IntRect clippedOverflowRectForRepaint(RenderBox* repaintContainer);
47 virtual void absoluteRects(Vector<IntRect>&, int tx, int ty, bool topLevel = true);
48 virtual void absoluteQuads(Vector<FloatQuad>&, bool topLevel = true);
49 virtual void addFocusRingRects(GraphicsContext*, int tx, int ty);
50
51 virtual void imageChanged(WrappedImagePtr, const IntRect* = 0);
52 void adjustRectsForAspectRatio(FloatRect& destRect, FloatRect& srcRect, SVGPreserveAspectRatio*);
53
54 virtual void layout();
55 virtual void paint(PaintInfo&, int parentX, int parentY);
56
57 bool requiresLayer() const { return false; }
58
59 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, int _x, int _y, int _tx, int _ty, HitTestAction);
60
61 bool calculateLocalTransform();
62
63 private:
64 void calculateAbsoluteBounds();
65 TransformationMatrix m_localTransform;
66 FloatRect m_localBounds;
67 IntRect m_absoluteBounds;
68 };
69
70 } // namespace WebCore
71
72 #endif // ENABLE(SVG)
73 #endif // RenderSVGImage_h
74
75 // vim:ts=4:noet