Merge mozilla-central to autoland on a CLOSED TREE
[gecko.git] / dom / svg / SVGFETurbulenceElement.h
blob2b7ab2c042ff1319a4e3054112e035f661f30b50
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef DOM_SVG_SVGFETURBULENCEELEMENT_H_
8 #define DOM_SVG_SVGFETURBULENCEELEMENT_H_
10 #include "SVGAnimatedEnumeration.h"
11 #include "SVGAnimatedInteger.h"
12 #include "SVGAnimatedNumber.h"
13 #include "SVGAnimatedString.h"
14 #include "mozilla/dom/SVGFilters.h"
16 nsresult NS_NewSVGFETurbulenceElement(
17 nsIContent** aResult, already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo);
19 namespace mozilla::dom {
21 using SVGFETurbulenceElementBase = SVGFE;
23 class SVGFETurbulenceElement final : public SVGFETurbulenceElementBase {
24 friend nsresult(::NS_NewSVGFETurbulenceElement(
25 nsIContent** aResult,
26 already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo));
28 protected:
29 explicit SVGFETurbulenceElement(
30 already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo)
31 : SVGFETurbulenceElementBase(std::move(aNodeInfo)) {}
32 JSObject* WrapNode(JSContext* aCx,
33 JS::Handle<JSObject*> aGivenProto) override;
35 public:
36 bool SubregionIsUnionOfRegions() override { return false; }
38 FilterPrimitiveDescription GetPrimitiveDescription(
39 SVGFilterInstance* aInstance, const IntRect& aFilterSubregion,
40 const nsTArray<bool>& aInputsAreTainted,
41 nsTArray<RefPtr<SourceSurface>>& aInputImages) override;
42 bool AttributeAffectsRendering(int32_t aNameSpaceID,
43 nsAtom* aAttribute) const override;
44 SVGAnimatedString& GetResultImageName() override {
45 return mStringAttributes[RESULT];
48 nsresult Clone(dom::NodeInfo*, nsINode** aResult) const override;
50 nsresult BindToTree(BindContext&, nsINode& aParent) override;
52 // WebIDL
53 already_AddRefed<DOMSVGAnimatedNumber> BaseFrequencyX();
54 already_AddRefed<DOMSVGAnimatedNumber> BaseFrequencyY();
55 already_AddRefed<DOMSVGAnimatedInteger> NumOctaves();
56 already_AddRefed<DOMSVGAnimatedNumber> Seed();
57 already_AddRefed<DOMSVGAnimatedEnumeration> StitchTiles();
58 already_AddRefed<DOMSVGAnimatedEnumeration> Type();
60 protected:
61 NumberAttributesInfo GetNumberInfo() override;
62 NumberPairAttributesInfo GetNumberPairInfo() override;
63 IntegerAttributesInfo GetIntegerInfo() override;
64 EnumAttributesInfo GetEnumInfo() override;
65 StringAttributesInfo GetStringInfo() override;
67 enum { SEED }; // floating point seed?!
68 SVGAnimatedNumber mNumberAttributes[1];
69 static NumberInfo sNumberInfo[1];
71 enum { BASE_FREQ };
72 SVGAnimatedNumberPair mNumberPairAttributes[1];
73 static NumberPairInfo sNumberPairInfo[1];
75 enum { OCTAVES };
76 SVGAnimatedInteger mIntegerAttributes[1];
77 static IntegerInfo sIntegerInfo[1];
79 enum { TYPE, STITCHTILES };
80 SVGAnimatedEnumeration mEnumAttributes[2];
81 static SVGEnumMapping sTypeMap[];
82 static SVGEnumMapping sStitchTilesMap[];
83 static EnumInfo sEnumInfo[2];
85 enum { RESULT };
86 SVGAnimatedString mStringAttributes[1];
87 static StringInfo sStringInfo[1];
90 } // namespace mozilla::dom
92 #endif // DOM_SVG_SVGFETURBULENCEELEMENT_H_