/work/obj-fuzz/dist/include/mozilla/dom/SVGComponentTransferFunctionElement.h
Line | Count | Source (jump to first uncovered line) |
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/. */ |
6 | | |
7 | | #ifndef mozilla_dom_SVGComponentTransferFunctionElement_h |
8 | | #define mozilla_dom_SVGComponentTransferFunctionElement_h |
9 | | |
10 | | #include "nsSVGEnum.h" |
11 | | #include "nsSVGFilters.h" |
12 | | #include "nsSVGNumber2.h" |
13 | | #include "SVGAnimatedNumberList.h" |
14 | | |
15 | | |
16 | | #define NS_SVG_FE_COMPONENT_TRANSFER_FUNCTION_ELEMENT_CID \ |
17 | | { 0xafab106d, 0xbc18, 0x4f7f, \ |
18 | | { 0x9e, 0x29, 0xfe, 0xb4, 0xb0, 0x16, 0x5f, 0xf4 } } |
19 | | |
20 | | namespace mozilla { |
21 | | |
22 | | class DOMSVGAnimatedNumberList; |
23 | | |
24 | | namespace dom { |
25 | | |
26 | | typedef SVGFEUnstyledElement SVGComponentTransferFunctionElementBase; |
27 | | |
28 | | class SVGComponentTransferFunctionElement : public SVGComponentTransferFunctionElementBase |
29 | | { |
30 | | protected: |
31 | | explicit SVGComponentTransferFunctionElement(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo) |
32 | | : SVGComponentTransferFunctionElementBase(std::move(aNodeInfo)) |
33 | 0 | { |
34 | 0 | } |
35 | | |
36 | 0 | virtual ~SVGComponentTransferFunctionElement() {} |
37 | | |
38 | | public: |
39 | | typedef gfx::ComponentTransferAttributes ComponentTransferAttributes; |
40 | | |
41 | | // interfaces: |
42 | | NS_DECLARE_STATIC_IID_ACCESSOR(NS_SVG_FE_COMPONENT_TRANSFER_FUNCTION_ELEMENT_CID) |
43 | | |
44 | | NS_DECL_ISUPPORTS_INHERITED |
45 | | |
46 | | virtual bool AttributeAffectsRendering( |
47 | | int32_t aNameSpaceID, nsAtom* aAttribute) const override; |
48 | | |
49 | | virtual int32_t GetChannel() = 0; |
50 | | |
51 | | void ComputeAttributes(int32_t aChannel, ComponentTransferAttributes& aAttributes); |
52 | | |
53 | | // WebIDL |
54 | | virtual JSObject* WrapNode(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override = 0; |
55 | | already_AddRefed<SVGAnimatedEnumeration> Type(); |
56 | | already_AddRefed<DOMSVGAnimatedNumberList> TableValues(); |
57 | | already_AddRefed<SVGAnimatedNumber> Slope(); |
58 | | already_AddRefed<SVGAnimatedNumber> Intercept(); |
59 | | already_AddRefed<SVGAnimatedNumber> Amplitude(); |
60 | | already_AddRefed<SVGAnimatedNumber> Exponent(); |
61 | | already_AddRefed<SVGAnimatedNumber> Offset(); |
62 | | |
63 | | protected: |
64 | | virtual NumberAttributesInfo GetNumberInfo() override; |
65 | | virtual EnumAttributesInfo GetEnumInfo() override; |
66 | | virtual NumberListAttributesInfo GetNumberListInfo() override; |
67 | | |
68 | | enum { TABLEVALUES }; |
69 | | SVGAnimatedNumberList mNumberListAttributes[1]; |
70 | | static NumberListInfo sNumberListInfo[1]; |
71 | | |
72 | | enum { SLOPE, INTERCEPT, AMPLITUDE, EXPONENT, OFFSET }; |
73 | | nsSVGNumber2 mNumberAttributes[5]; |
74 | | static NumberInfo sNumberInfo[5]; |
75 | | |
76 | | enum { TYPE }; |
77 | | nsSVGEnum mEnumAttributes[1]; |
78 | | static nsSVGEnumMapping sTypeMap[]; |
79 | | static EnumInfo sEnumInfo[1]; |
80 | | }; |
81 | | |
82 | | NS_DEFINE_STATIC_IID_ACCESSOR(SVGComponentTransferFunctionElement, NS_SVG_FE_COMPONENT_TRANSFER_FUNCTION_ELEMENT_CID) |
83 | | |
84 | | } // namespace dom |
85 | | } // namespace mozilla |
86 | | |
87 | | nsresult NS_NewSVGFEFuncRElement( |
88 | | nsIContent** aResult, already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo); |
89 | | |
90 | | namespace mozilla { |
91 | | namespace dom { |
92 | | |
93 | | class SVGFEFuncRElement : public SVGComponentTransferFunctionElement |
94 | | { |
95 | | friend nsresult (::NS_NewSVGFEFuncRElement( |
96 | | nsIContent** aResult, already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo)); |
97 | | protected: |
98 | | explicit SVGFEFuncRElement(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo) |
99 | 0 | : SVGComponentTransferFunctionElement(std::move(aNodeInfo)) {} |
100 | | |
101 | | public: |
102 | 0 | virtual int32_t GetChannel() override { return 0; } |
103 | | |
104 | | virtual nsresult Clone(dom::NodeInfo*, nsINode** aResult) const override; |
105 | | |
106 | | virtual JSObject* WrapNode(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override; |
107 | | }; |
108 | | |
109 | | } // namespace dom |
110 | | } // namespace mozilla |
111 | | |
112 | | nsresult NS_NewSVGFEFuncGElement( |
113 | | nsIContent** aResult, already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo); |
114 | | |
115 | | namespace mozilla { |
116 | | namespace dom { |
117 | | |
118 | | class SVGFEFuncGElement : public SVGComponentTransferFunctionElement |
119 | | { |
120 | | friend nsresult (::NS_NewSVGFEFuncGElement( |
121 | | nsIContent** aResult, already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo)); |
122 | | protected: |
123 | | explicit SVGFEFuncGElement(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo) |
124 | 0 | : SVGComponentTransferFunctionElement(std::move(aNodeInfo)) {} |
125 | | |
126 | | public: |
127 | 0 | virtual int32_t GetChannel() override { return 1; } |
128 | | |
129 | | virtual nsresult Clone(dom::NodeInfo*, nsINode** aResult) const override; |
130 | | |
131 | | virtual JSObject* WrapNode(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override; |
132 | | }; |
133 | | |
134 | | } // namespace dom |
135 | | } // namespace mozilla |
136 | | |
137 | | nsresult NS_NewSVGFEFuncBElement( |
138 | | nsIContent** aResult, already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo); |
139 | | |
140 | | namespace mozilla { |
141 | | namespace dom { |
142 | | |
143 | | class SVGFEFuncBElement : public SVGComponentTransferFunctionElement |
144 | | { |
145 | | friend nsresult (::NS_NewSVGFEFuncBElement( |
146 | | nsIContent** aResult, already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo)); |
147 | | protected: |
148 | | explicit SVGFEFuncBElement(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo) |
149 | 0 | : SVGComponentTransferFunctionElement(std::move(aNodeInfo)) {} |
150 | | |
151 | | public: |
152 | 0 | virtual int32_t GetChannel() override { return 2; } |
153 | | |
154 | | virtual nsresult Clone(dom::NodeInfo*, nsINode** aResult) const override; |
155 | | |
156 | | virtual JSObject* WrapNode(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override; |
157 | | }; |
158 | | |
159 | | } // namespace dom |
160 | | } // namespace mozilla |
161 | | |
162 | | nsresult NS_NewSVGFEFuncAElement( |
163 | | nsIContent** aResult, already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo); |
164 | | |
165 | | namespace mozilla { |
166 | | namespace dom { |
167 | | |
168 | | class SVGFEFuncAElement : public SVGComponentTransferFunctionElement |
169 | | { |
170 | | friend nsresult (::NS_NewSVGFEFuncAElement( |
171 | | nsIContent** aResult, already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo)); |
172 | | protected: |
173 | | explicit SVGFEFuncAElement(already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo) |
174 | 0 | : SVGComponentTransferFunctionElement(std::move(aNodeInfo)) {} |
175 | | |
176 | | public: |
177 | 0 | virtual int32_t GetChannel() override { return 3; } |
178 | | |
179 | | virtual nsresult Clone(dom::NodeInfo*, nsINode** aResult) const override; |
180 | | |
181 | | virtual JSObject* WrapNode(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override; |
182 | | }; |
183 | | |
184 | | } // namespace dom |
185 | | } // namespace mozilla |
186 | | |
187 | | #endif // mozilla_dom_SVGComponentTransferFunctionElement_h |