2013-02-12 10:01:17 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
|
|
|
#ifndef mozilla_dom_SVGComponentTransferFunctionElement_h
|
|
|
|
#define mozilla_dom_SVGComponentTransferFunctionElement_h
|
|
|
|
|
|
|
|
#include "nsSVGEnum.h"
|
|
|
|
#include "nsSVGFilters.h"
|
2013-02-12 10:10:24 +00:00
|
|
|
#include "nsSVGNumber2.h"
|
|
|
|
#include "SVGAnimatedNumberList.h"
|
|
|
|
|
2013-02-12 10:01:17 +00:00
|
|
|
|
|
|
|
#define NS_SVG_FE_COMPONENT_TRANSFER_FUNCTION_ELEMENT_CID \
|
|
|
|
{ 0xafab106d, 0xbc18, 0x4f7f, \
|
|
|
|
{ 0x9e, 0x29, 0xfe, 0xb4, 0xb0, 0x16, 0x5f, 0xf4 } }
|
|
|
|
|
|
|
|
namespace mozilla {
|
2013-02-12 10:10:24 +00:00
|
|
|
|
|
|
|
class DOMSVGAnimatedNumberList;
|
|
|
|
|
2013-02-12 10:01:17 +00:00
|
|
|
namespace dom {
|
|
|
|
|
|
|
|
typedef SVGFEUnstyledElement SVGComponentTransferFunctionElementBase;
|
|
|
|
|
|
|
|
class SVGComponentTransferFunctionElement : public SVGComponentTransferFunctionElementBase
|
|
|
|
{
|
|
|
|
protected:
|
2014-09-01 01:08:04 +00:00
|
|
|
explicit SVGComponentTransferFunctionElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
|
2013-02-12 10:10:24 +00:00
|
|
|
: SVGComponentTransferFunctionElementBase(aNodeInfo)
|
|
|
|
{
|
|
|
|
}
|
2013-02-12 10:01:17 +00:00
|
|
|
|
2014-07-08 21:23:16 +00:00
|
|
|
virtual ~SVGComponentTransferFunctionElement() {}
|
|
|
|
|
2013-02-12 10:01:17 +00:00
|
|
|
public:
|
2013-11-27 11:25:29 +00:00
|
|
|
typedef gfx::AttributeMap AttributeMap;
|
|
|
|
|
2013-02-12 10:01:17 +00:00
|
|
|
// interfaces:
|
|
|
|
NS_DECLARE_STATIC_IID_ACCESSOR(NS_SVG_FE_COMPONENT_TRANSFER_FUNCTION_ELEMENT_CID)
|
|
|
|
|
|
|
|
NS_DECL_ISUPPORTS_INHERITED
|
|
|
|
|
|
|
|
virtual bool AttributeAffectsRendering(
|
2013-05-08 05:11:24 +00:00
|
|
|
int32_t aNameSpaceID, nsIAtom* aAttribute) const MOZ_OVERRIDE;
|
2013-02-12 10:01:17 +00:00
|
|
|
|
|
|
|
virtual int32_t GetChannel() = 0;
|
2013-11-27 11:25:29 +00:00
|
|
|
|
|
|
|
AttributeMap ComputeAttributes();
|
2013-02-12 10:01:17 +00:00
|
|
|
|
2013-02-12 10:10:24 +00:00
|
|
|
// WebIDL
|
2014-04-08 22:27:17 +00:00
|
|
|
virtual JSObject* WrapNode(JSContext* aCx) MOZ_OVERRIDE = 0;
|
2013-07-01 07:02:46 +00:00
|
|
|
already_AddRefed<SVGAnimatedEnumeration> Type();
|
2013-02-12 10:10:24 +00:00
|
|
|
already_AddRefed<DOMSVGAnimatedNumberList> TableValues();
|
2013-07-01 07:03:04 +00:00
|
|
|
already_AddRefed<SVGAnimatedNumber> Slope();
|
|
|
|
already_AddRefed<SVGAnimatedNumber> Intercept();
|
|
|
|
already_AddRefed<SVGAnimatedNumber> Amplitude();
|
|
|
|
already_AddRefed<SVGAnimatedNumber> Exponent();
|
|
|
|
already_AddRefed<SVGAnimatedNumber> Offset();
|
2013-02-12 10:10:24 +00:00
|
|
|
|
2013-02-12 10:01:17 +00:00
|
|
|
protected:
|
2013-05-08 05:11:24 +00:00
|
|
|
virtual NumberAttributesInfo GetNumberInfo() MOZ_OVERRIDE;
|
|
|
|
virtual EnumAttributesInfo GetEnumInfo() MOZ_OVERRIDE;
|
|
|
|
virtual NumberListAttributesInfo GetNumberListInfo() MOZ_OVERRIDE;
|
2013-02-12 10:01:17 +00:00
|
|
|
|
|
|
|
enum { TABLEVALUES };
|
|
|
|
SVGAnimatedNumberList mNumberListAttributes[1];
|
|
|
|
static NumberListInfo sNumberListInfo[1];
|
|
|
|
|
|
|
|
enum { SLOPE, INTERCEPT, AMPLITUDE, EXPONENT, OFFSET };
|
|
|
|
nsSVGNumber2 mNumberAttributes[5];
|
|
|
|
static NumberInfo sNumberInfo[5];
|
|
|
|
|
|
|
|
enum { TYPE };
|
|
|
|
nsSVGEnum mEnumAttributes[1];
|
|
|
|
static nsSVGEnumMapping sTypeMap[];
|
|
|
|
static EnumInfo sEnumInfo[1];
|
|
|
|
};
|
|
|
|
|
2014-03-28 08:45:02 +00:00
|
|
|
NS_DEFINE_STATIC_IID_ACCESSOR(SVGComponentTransferFunctionElement, NS_SVG_FE_COMPONENT_TRANSFER_FUNCTION_ELEMENT_CID)
|
|
|
|
|
2013-02-12 10:01:17 +00:00
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
nsresult NS_NewSVGFEFuncRElement(
|
2014-06-20 02:01:40 +00:00
|
|
|
nsIContent** aResult, already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo);
|
2013-02-12 10:01:17 +00:00
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
|
|
|
|
2013-03-28 01:23:09 +00:00
|
|
|
class SVGFEFuncRElement : public SVGComponentTransferFunctionElement
|
2013-02-12 10:01:17 +00:00
|
|
|
{
|
|
|
|
friend nsresult (::NS_NewSVGFEFuncRElement(
|
2014-06-20 02:01:40 +00:00
|
|
|
nsIContent** aResult, already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo));
|
2013-02-12 10:01:17 +00:00
|
|
|
protected:
|
2014-09-01 01:08:04 +00:00
|
|
|
explicit SVGFEFuncRElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
|
2013-02-12 10:01:17 +00:00
|
|
|
: SVGComponentTransferFunctionElement(aNodeInfo) {}
|
|
|
|
|
|
|
|
public:
|
2013-05-08 05:11:24 +00:00
|
|
|
virtual int32_t GetChannel() MOZ_OVERRIDE { return 0; }
|
2013-03-18 17:54:04 +00:00
|
|
|
|
2014-06-20 02:01:40 +00:00
|
|
|
virtual nsresult Clone(mozilla::dom::NodeInfo *aNodeInfo, nsINode **aResult) const MOZ_OVERRIDE;
|
2013-02-12 10:01:17 +00:00
|
|
|
|
2014-04-08 22:27:17 +00:00
|
|
|
virtual JSObject* WrapNode(JSContext* aCx) MOZ_OVERRIDE;
|
2013-02-12 10:01:17 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
nsresult NS_NewSVGFEFuncGElement(
|
2014-06-20 02:01:40 +00:00
|
|
|
nsIContent** aResult, already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo);
|
2013-02-12 10:01:17 +00:00
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
|
|
|
|
2013-03-28 01:23:09 +00:00
|
|
|
class SVGFEFuncGElement : public SVGComponentTransferFunctionElement
|
2013-02-12 10:01:17 +00:00
|
|
|
{
|
|
|
|
friend nsresult (::NS_NewSVGFEFuncGElement(
|
2014-06-20 02:01:40 +00:00
|
|
|
nsIContent** aResult, already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo));
|
2013-02-12 10:01:17 +00:00
|
|
|
protected:
|
2014-09-01 01:08:04 +00:00
|
|
|
explicit SVGFEFuncGElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
|
2013-02-12 10:01:17 +00:00
|
|
|
: SVGComponentTransferFunctionElement(aNodeInfo) {}
|
|
|
|
|
|
|
|
public:
|
2013-05-08 05:11:24 +00:00
|
|
|
virtual int32_t GetChannel() MOZ_OVERRIDE { return 1; }
|
2013-02-12 10:01:17 +00:00
|
|
|
|
2014-06-20 02:01:40 +00:00
|
|
|
virtual nsresult Clone(mozilla::dom::NodeInfo *aNodeInfo, nsINode **aResult) const MOZ_OVERRIDE;
|
2013-02-12 10:01:17 +00:00
|
|
|
|
2014-04-08 22:27:17 +00:00
|
|
|
virtual JSObject* WrapNode(JSContext* aCx) MOZ_OVERRIDE;
|
2013-02-12 10:01:17 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
nsresult NS_NewSVGFEFuncBElement(
|
2014-06-20 02:01:40 +00:00
|
|
|
nsIContent** aResult, already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo);
|
2013-02-12 10:01:17 +00:00
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
|
|
|
|
2013-03-28 01:23:09 +00:00
|
|
|
class SVGFEFuncBElement : public SVGComponentTransferFunctionElement
|
2013-02-12 10:01:17 +00:00
|
|
|
{
|
|
|
|
friend nsresult (::NS_NewSVGFEFuncBElement(
|
2014-06-20 02:01:40 +00:00
|
|
|
nsIContent** aResult, already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo));
|
2013-02-12 10:01:17 +00:00
|
|
|
protected:
|
2014-09-01 01:08:04 +00:00
|
|
|
explicit SVGFEFuncBElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
|
2013-02-12 10:01:17 +00:00
|
|
|
: SVGComponentTransferFunctionElement(aNodeInfo) {}
|
|
|
|
|
|
|
|
public:
|
2013-05-08 05:11:24 +00:00
|
|
|
virtual int32_t GetChannel() MOZ_OVERRIDE { return 2; }
|
2013-02-12 10:01:17 +00:00
|
|
|
|
2014-06-20 02:01:40 +00:00
|
|
|
virtual nsresult Clone(mozilla::dom::NodeInfo *aNodeInfo, nsINode **aResult) const MOZ_OVERRIDE;
|
2013-02-12 10:01:17 +00:00
|
|
|
|
2014-04-08 22:27:17 +00:00
|
|
|
virtual JSObject* WrapNode(JSContext* aCx) MOZ_OVERRIDE;
|
2013-02-12 10:01:17 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
nsresult NS_NewSVGFEFuncAElement(
|
2014-06-20 02:01:40 +00:00
|
|
|
nsIContent** aResult, already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo);
|
2013-02-12 10:01:17 +00:00
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
|
|
|
|
2013-03-28 01:23:09 +00:00
|
|
|
class SVGFEFuncAElement : public SVGComponentTransferFunctionElement
|
2013-02-12 10:01:17 +00:00
|
|
|
{
|
|
|
|
friend nsresult (::NS_NewSVGFEFuncAElement(
|
2014-06-20 02:01:40 +00:00
|
|
|
nsIContent** aResult, already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo));
|
2013-02-12 10:01:17 +00:00
|
|
|
protected:
|
2014-09-01 01:08:04 +00:00
|
|
|
explicit SVGFEFuncAElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
|
2013-02-12 10:01:17 +00:00
|
|
|
: SVGComponentTransferFunctionElement(aNodeInfo) {}
|
|
|
|
|
|
|
|
public:
|
2013-05-08 05:11:24 +00:00
|
|
|
virtual int32_t GetChannel() MOZ_OVERRIDE { return 3; }
|
2013-02-12 10:01:17 +00:00
|
|
|
|
2014-06-20 02:01:40 +00:00
|
|
|
virtual nsresult Clone(mozilla::dom::NodeInfo *aNodeInfo, nsINode **aResult) const MOZ_OVERRIDE;
|
2013-02-12 10:01:17 +00:00
|
|
|
|
2014-04-08 22:27:17 +00:00
|
|
|
virtual JSObject* WrapNode(JSContext* aCx) MOZ_OVERRIDE;
|
2013-02-12 10:01:17 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
#endif // mozilla_dom_SVGComponentTransferFunctionElement_h
|