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>
6 This file is part of the WebKit project.
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.
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.
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.
24 #ifndef RenderSVGImage_h
25 #define RenderSVGImage_h
29 #include "TransformationMatrix.h"
30 #include "FloatRect.h"
31 #include "RenderImage.h"
35 class SVGImageElement
;
36 class SVGPreserveAspectRatio
;
38 class RenderSVGImage
: public RenderImage
{
40 RenderSVGImage(SVGImageElement
*);
41 virtual ~RenderSVGImage();
43 virtual TransformationMatrix
localTransform() const { return m_localTransform
; }
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
);
51 virtual void imageChanged(WrappedImagePtr
, const IntRect
* = 0);
52 void adjustRectsForAspectRatio(FloatRect
& destRect
, FloatRect
& srcRect
, SVGPreserveAspectRatio
*);
54 virtual void layout();
55 virtual void paint(PaintInfo
&, int parentX
, int parentY
);
57 bool requiresLayer() const { return false; }
59 virtual bool nodeAtPoint(const HitTestRequest
&, HitTestResult
&, int _x
, int _y
, int _tx
, int _ty
, HitTestAction
);
61 bool calculateLocalTransform();
64 void calculateAbsoluteBounds();
65 TransformationMatrix m_localTransform
;
66 FloatRect m_localBounds
;
67 IntRect m_absoluteBounds
;
70 } // namespace WebCore
73 #endif // RenderSVGImage_h