SVGFEMorphologyElement.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. /* -*- Mode: C++; tab-width: 8; 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. #ifndef mozilla_dom_SVGFEMorphologyElement_h
  6. #define mozilla_dom_SVGFEMorphologyElement_h
  7. #include "nsSVGEnum.h"
  8. #include "nsSVGFilters.h"
  9. #include "nsSVGNumberPair.h"
  10. #include "nsSVGString.h"
  11. nsresult NS_NewSVGFEMorphologyElement(nsIContent **aResult,
  12. already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo);
  13. namespace mozilla {
  14. namespace dom {
  15. typedef nsSVGFE SVGFEMorphologyElementBase;
  16. class SVGFEMorphologyElement : public SVGFEMorphologyElementBase
  17. {
  18. friend nsresult (::NS_NewSVGFEMorphologyElement(nsIContent **aResult,
  19. already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo));
  20. protected:
  21. explicit SVGFEMorphologyElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
  22. : SVGFEMorphologyElementBase(aNodeInfo)
  23. {
  24. }
  25. virtual JSObject* WrapNode(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
  26. public:
  27. virtual FilterPrimitiveDescription
  28. GetPrimitiveDescription(nsSVGFilterInstance* aInstance,
  29. const IntRect& aFilterSubregion,
  30. const nsTArray<bool>& aInputsAreTainted,
  31. nsTArray<RefPtr<SourceSurface>>& aInputImages) override;
  32. virtual bool AttributeAffectsRendering(
  33. int32_t aNameSpaceID, nsIAtom* aAttribute) const override;
  34. virtual nsSVGString& GetResultImageName() override { return mStringAttributes[RESULT]; }
  35. virtual void GetSourceImageNames(nsTArray<nsSVGStringInfo>& aSources) override;
  36. virtual nsresult Clone(mozilla::dom::NodeInfo *aNodeInfo, nsINode **aResult) const override;
  37. // WebIDL
  38. already_AddRefed<SVGAnimatedString> In1();
  39. already_AddRefed<SVGAnimatedEnumeration> Operator();
  40. already_AddRefed<SVGAnimatedNumber> RadiusX();
  41. already_AddRefed<SVGAnimatedNumber> RadiusY();
  42. void SetRadius(float rx, float ry);
  43. protected:
  44. void GetRXY(int32_t *aRX, int32_t *aRY, const nsSVGFilterInstance& aInstance);
  45. virtual NumberPairAttributesInfo GetNumberPairInfo() override;
  46. virtual EnumAttributesInfo GetEnumInfo() override;
  47. virtual StringAttributesInfo GetStringInfo() override;
  48. enum { RADIUS };
  49. nsSVGNumberPair mNumberPairAttributes[1];
  50. static NumberPairInfo sNumberPairInfo[1];
  51. enum { OPERATOR };
  52. nsSVGEnum mEnumAttributes[1];
  53. static nsSVGEnumMapping sOperatorMap[];
  54. static EnumInfo sEnumInfo[1];
  55. enum { RESULT, IN1 };
  56. nsSVGString mStringAttributes[2];
  57. static StringInfo sStringInfo[2];
  58. };
  59. } // namespace dom
  60. } // namespace mozilla
  61. #endif // mozilla_dom_SVGFEMorphologyElement_h