|
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
|
2 /* This Source Code Form is subject to the terms of the Mozilla Public |
|
3 * License, v. 2.0. If a copy of the MPL was not distributed with this |
|
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
|
5 |
|
6 #ifndef __NS_SVGINNERSVGFRAME_H__ |
|
7 #define __NS_SVGINNERSVGFRAME_H__ |
|
8 |
|
9 #include "mozilla/Attributes.h" |
|
10 #include "nsSVGContainerFrame.h" |
|
11 #include "nsISVGSVGFrame.h" |
|
12 |
|
13 class nsRenderingContext; |
|
14 |
|
15 typedef nsSVGDisplayContainerFrame nsSVGInnerSVGFrameBase; |
|
16 |
|
17 class nsSVGInnerSVGFrame : public nsSVGInnerSVGFrameBase, |
|
18 public nsISVGSVGFrame |
|
19 { |
|
20 friend nsIFrame* |
|
21 NS_NewSVGInnerSVGFrame(nsIPresShell* aPresShell, nsStyleContext* aContext); |
|
22 protected: |
|
23 nsSVGInnerSVGFrame(nsStyleContext* aContext) : |
|
24 nsSVGInnerSVGFrameBase(aContext) {} |
|
25 |
|
26 public: |
|
27 NS_DECL_QUERYFRAME_TARGET(nsSVGInnerSVGFrame) |
|
28 NS_DECL_QUERYFRAME |
|
29 NS_DECL_FRAMEARENA_HELPERS |
|
30 |
|
31 #ifdef DEBUG |
|
32 virtual void Init(nsIContent* aContent, |
|
33 nsIFrame* aParent, |
|
34 nsIFrame* aPrevInFlow) MOZ_OVERRIDE; |
|
35 #endif |
|
36 |
|
37 /** |
|
38 * Get the "type" of the frame |
|
39 * |
|
40 * @see nsGkAtoms::svgInnerSVGFrame |
|
41 */ |
|
42 virtual nsIAtom* GetType() const MOZ_OVERRIDE; |
|
43 |
|
44 #ifdef DEBUG_FRAME_DUMP |
|
45 virtual nsresult GetFrameName(nsAString& aResult) const MOZ_OVERRIDE |
|
46 { |
|
47 return MakeFrameName(NS_LITERAL_STRING("SVGInnerSVG"), aResult); |
|
48 } |
|
49 #endif |
|
50 |
|
51 virtual nsresult AttributeChanged(int32_t aNameSpaceID, |
|
52 nsIAtom* aAttribute, |
|
53 int32_t aModType) MOZ_OVERRIDE; |
|
54 |
|
55 // nsISVGChildFrame interface: |
|
56 virtual nsresult PaintSVG(nsRenderingContext *aContext, |
|
57 const nsIntRect *aDirtyRect, |
|
58 nsIFrame* aTransformRoot = nullptr) MOZ_OVERRIDE; |
|
59 virtual void ReflowSVG() MOZ_OVERRIDE; |
|
60 virtual void NotifySVGChanged(uint32_t aFlags) MOZ_OVERRIDE; |
|
61 virtual nsIFrame* GetFrameForPoint(const nsPoint &aPoint) MOZ_OVERRIDE; |
|
62 |
|
63 // nsSVGContainerFrame methods: |
|
64 virtual gfxMatrix GetCanvasTM(uint32_t aFor, |
|
65 nsIFrame* aTransformRoot = nullptr) MOZ_OVERRIDE; |
|
66 |
|
67 virtual bool HasChildrenOnlyTransform(Matrix *aTransform) const MOZ_OVERRIDE; |
|
68 |
|
69 // nsISVGSVGFrame interface: |
|
70 virtual void NotifyViewportOrTransformChanged(uint32_t aFlags) MOZ_OVERRIDE; |
|
71 |
|
72 protected: |
|
73 |
|
74 nsAutoPtr<gfxMatrix> mCanvasTM; |
|
75 }; |
|
76 |
|
77 #endif |
|
78 |