|
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 "AffineTransform.h" |
|
30 #include "RenderImage.h" |
|
31 |
|
32 namespace WebCore { |
|
33 |
|
34 class SVGImageElement; |
|
35 class SVGPreserveAspectRatio; |
|
36 |
|
37 class RenderSVGImage : public RenderImage { |
|
38 public: |
|
39 RenderSVGImage(SVGImageElement*); |
|
40 virtual ~RenderSVGImage(); |
|
41 |
|
42 virtual AffineTransform localTransform() const { return m_transform; } |
|
43 virtual void setLocalTransform(const AffineTransform& transform) { m_transform = transform; } |
|
44 |
|
45 virtual FloatRect relativeBBox(bool includeStroke = true) const; |
|
46 virtual IntRect absoluteClippedOverflowRect(); |
|
47 |
|
48 virtual void absoluteRects(Vector<IntRect>&, int tx, int ty, bool topLevel = true); |
|
49 |
|
50 virtual void imageChanged(CachedImage*); |
|
51 void adjustRectsForAspectRatio(FloatRect& destRect, FloatRect& srcRect, SVGPreserveAspectRatio*); |
|
52 virtual void paint(PaintInfo&, int parentX, int parentY); |
|
53 |
|
54 bool requiresLayer(); |
|
55 |
|
56 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, int _x, int _y, int _tx, int _ty, HitTestAction); |
|
57 |
|
58 private: |
|
59 AffineTransform translationForAttributes(); |
|
60 AffineTransform m_transform; |
|
61 IntRect m_absoluteBounds; |
|
62 }; |
|
63 |
|
64 } // namespace WebCore |
|
65 |
|
66 #endif // ENABLE(SVG) |
|
67 #endif // RenderSVGImage_h |
|
68 |
|
69 // vim:ts=4:noet |