2013-02-12 02:01:17 -08: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 02:10:24 -08:00
|
|
|
#include "nsSVGNumber2.h"
|
|
|
|
#include "SVGAnimatedNumberList.h"
|
|
|
|
|
2013-02-12 02:01:17 -08: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 02:10:24 -08:00
|
|
|
|
|
|
|
class DOMSVGAnimatedNumberList;
|
|
|
|
|
2013-02-12 02:01:17 -08:00
|
|
|
namespace dom {
|
|
|
|
|
|
|
|
typedef SVGFEUnstyledElement SVGComponentTransferFunctionElementBase;
|
|
|
|
|
|
|
|
class SVGComponentTransferFunctionElement : public SVGComponentTransferFunctionElementBase
|
|
|
|
{
|
|
|
|
protected:
|
2014-08-31 18:08:04 -07:00
|
|
|
explicit SVGComponentTransferFunctionElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
|
2013-02-12 02:10:24 -08:00
|
|
|
: SVGComponentTransferFunctionElementBase(aNodeInfo)
|
|
|
|
{
|
|
|
|
}
|
2013-02-12 02:01:17 -08:00
|
|
|
|
2014-07-08 14:23:16 -07:00
|
|
|
virtual ~SVGComponentTransferFunctionElement() {}
|
|
|
|
|
2013-02-12 02:01:17 -08:00
|
|
|
public:
|
2013-11-27 03:25:29 -08:00
|
|
|
typedef gfx::AttributeMap AttributeMap;
|
|
|
|
|
2013-02-12 02:01:17 -08:00
|
|
|
// interfaces:
|
|
|
|
NS_DECLARE_STATIC_IID_ACCESSOR(NS_SVG_FE_COMPONENT_TRANSFER_FUNCTION_ELEMENT_CID)
|
|
|
|
|
|
|
|
NS_DECL_ISUPPORTS_INHERITED
|
|
|
|
|
|
|
|
virtual bool AttributeAffectsRendering(
|
2013-05-07 22:11:24 -07:00
|
|
|
int32_t aNameSpaceID, nsIAtom* aAttribute) const MOZ_OVERRIDE;
|
2013-02-12 02:01:17 -08:00
|
|
|
|
|
|
|
virtual int32_t GetChannel() = 0;
|
2013-11-27 03:25:29 -08:00
|
|
|
|
|
|
|
AttributeMap ComputeAttributes();
|
2013-02-12 02:01:17 -08:00
|
|
|
|
2013-02-12 02:10:24 -08:00
|
|
|
// WebIDL
|
2014-04-08 15:27:17 -07:00
|
|
|
virtual JSObject* WrapNode(JSContext* aCx) MOZ_OVERRIDE = 0;
|
2013-07-01 00:02:46 -07:00
|
|
|
already_AddRefed<SVGAnimatedEnumeration> Type();
|
2013-02-12 02:10:24 -08:00
|
|
|
already_AddRefed<DOMSVGAnimatedNumberList> TableValues();
|
2013-07-01 00:03:04 -07:00
|
|
|
already_AddRefed<SVGAnimatedNumber> Slope();
|
|
|
|
already_AddRefed<SVGAnimatedNumber> Intercept();
|
|
|
|
already_AddRefed<SVGAnimatedNumber> Amplitude();
|
|
|
|
already_AddRefed<SVGAnimatedNumber> Exponent();
|
|
|
|
already_AddRefed<SVGAnimatedNumber> Offset();
|
2013-02-12 02:10:24 -08:00
|
|
|
|
2013-02-12 02:01:17 -08:00
|
|
|
protected:
|
2013-05-07 22:11:24 -07:00
|
|
|
virtual NumberAttributesInfo GetNumberInfo() MOZ_OVERRIDE;
|
|
|
|
virtual EnumAttributesInfo GetEnumInfo() MOZ_OVERRIDE;
|
|
|
|
virtual NumberListAttributesInfo GetNumberListInfo() MOZ_OVERRIDE;
|
2013-02-12 02:01:17 -08: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 01:45:02 -07:00
|
|
|
NS_DEFINE_STATIC_IID_ACCESSOR(SVGComponentTransferFunctionElement, NS_SVG_FE_COMPONENT_TRANSFER_FUNCTION_ELEMENT_CID)
|
|
|
|
|
2013-02-12 02:01:17 -08:00
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
nsresult NS_NewSVGFEFuncRElement(
|
2014-06-19 19:01:40 -07:00
|
|
|
nsIContent** aResult, already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo);
|
2013-02-12 02:01:17 -08:00
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
|
|
|
|
2013-03-27 18:23:09 -07:00
|
|
|
class SVGFEFuncRElement : public SVGComponentTransferFunctionElement
|
2013-02-12 02:01:17 -08:00
|
|
|
{
|
|
|
|
friend nsresult (::NS_NewSVGFEFuncRElement(
|
2014-06-19 19:01:40 -07:00
|
|
|
nsIContent** aResult, already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo));
|
2013-02-12 02:01:17 -08:00
|
|
|
protected:
|
2014-08-31 18:08:04 -07:00
|
|
|
explicit SVGFEFuncRElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
|
2013-02-12 02:01:17 -08:00
|
|
|
: SVGComponentTransferFunctionElement(aNodeInfo) {}
|
|
|
|
|
|
|
|
public:
|
2013-05-07 22:11:24 -07:00
|
|
|
virtual int32_t GetChannel() MOZ_OVERRIDE { return 0; }
|
2013-03-18 10:54:04 -07:00
|
|
|
|
2014-06-19 19:01:40 -07:00
|
|
|
virtual nsresult Clone(mozilla::dom::NodeInfo *aNodeInfo, nsINode **aResult) const MOZ_OVERRIDE;
|
2013-02-12 02:01:17 -08:00
|
|
|
|
2014-04-08 15:27:17 -07:00
|
|
|
virtual JSObject* WrapNode(JSContext* aCx) MOZ_OVERRIDE;
|
2013-02-12 02:01:17 -08:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
nsresult NS_NewSVGFEFuncGElement(
|
2014-06-19 19:01:40 -07:00
|
|
|
nsIContent** aResult, already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo);
|
2013-02-12 02:01:17 -08:00
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
|
|
|
|
2013-03-27 18:23:09 -07:00
|
|
|
class SVGFEFuncGElement : public SVGComponentTransferFunctionElement
|
2013-02-12 02:01:17 -08:00
|
|
|
{
|
|
|
|
friend nsresult (::NS_NewSVGFEFuncGElement(
|
2014-06-19 19:01:40 -07:00
|
|
|
nsIContent** aResult, already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo));
|
2013-02-12 02:01:17 -08:00
|
|
|
protected:
|
2014-08-31 18:08:04 -07:00
|
|
|
explicit SVGFEFuncGElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
|
2013-02-12 02:01:17 -08:00
|
|
|
: SVGComponentTransferFunctionElement(aNodeInfo) {}
|
|
|
|
|
|
|
|
public:
|
2013-05-07 22:11:24 -07:00
|
|
|
virtual int32_t GetChannel() MOZ_OVERRIDE { return 1; }
|
2013-02-12 02:01:17 -08:00
|
|
|
|
2014-06-19 19:01:40 -07:00
|
|
|
virtual nsresult Clone(mozilla::dom::NodeInfo *aNodeInfo, nsINode **aResult) const MOZ_OVERRIDE;
|
2013-02-12 02:01:17 -08:00
|
|
|
|
2014-04-08 15:27:17 -07:00
|
|
|
virtual JSObject* WrapNode(JSContext* aCx) MOZ_OVERRIDE;
|
2013-02-12 02:01:17 -08:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
nsresult NS_NewSVGFEFuncBElement(
|
2014-06-19 19:01:40 -07:00
|
|
|
nsIContent** aResult, already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo);
|
2013-02-12 02:01:17 -08:00
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
|
|
|
|
2013-03-27 18:23:09 -07:00
|
|
|
class SVGFEFuncBElement : public SVGComponentTransferFunctionElement
|
2013-02-12 02:01:17 -08:00
|
|
|
{
|
|
|
|
friend nsresult (::NS_NewSVGFEFuncBElement(
|
2014-06-19 19:01:40 -07:00
|
|
|
nsIContent** aResult, already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo));
|
2013-02-12 02:01:17 -08:00
|
|
|
protected:
|
2014-08-31 18:08:04 -07:00
|
|
|
explicit SVGFEFuncBElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
|
2013-02-12 02:01:17 -08:00
|
|
|
: SVGComponentTransferFunctionElement(aNodeInfo) {}
|
|
|
|
|
|
|
|
public:
|
2013-05-07 22:11:24 -07:00
|
|
|
virtual int32_t GetChannel() MOZ_OVERRIDE { return 2; }
|
2013-02-12 02:01:17 -08:00
|
|
|
|
2014-06-19 19:01:40 -07:00
|
|
|
virtual nsresult Clone(mozilla::dom::NodeInfo *aNodeInfo, nsINode **aResult) const MOZ_OVERRIDE;
|
2013-02-12 02:01:17 -08:00
|
|
|
|
2014-04-08 15:27:17 -07:00
|
|
|
virtual JSObject* WrapNode(JSContext* aCx) MOZ_OVERRIDE;
|
2013-02-12 02:01:17 -08:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
nsresult NS_NewSVGFEFuncAElement(
|
2014-06-19 19:01:40 -07:00
|
|
|
nsIContent** aResult, already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo);
|
2013-02-12 02:01:17 -08:00
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
|
|
|
|
2013-03-27 18:23:09 -07:00
|
|
|
class SVGFEFuncAElement : public SVGComponentTransferFunctionElement
|
2013-02-12 02:01:17 -08:00
|
|
|
{
|
|
|
|
friend nsresult (::NS_NewSVGFEFuncAElement(
|
2014-06-19 19:01:40 -07:00
|
|
|
nsIContent** aResult, already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo));
|
2013-02-12 02:01:17 -08:00
|
|
|
protected:
|
2014-08-31 18:08:04 -07:00
|
|
|
explicit SVGFEFuncAElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
|
2013-02-12 02:01:17 -08:00
|
|
|
: SVGComponentTransferFunctionElement(aNodeInfo) {}
|
|
|
|
|
|
|
|
public:
|
2013-05-07 22:11:24 -07:00
|
|
|
virtual int32_t GetChannel() MOZ_OVERRIDE { return 3; }
|
2013-02-12 02:01:17 -08:00
|
|
|
|
2014-06-19 19:01:40 -07:00
|
|
|
virtual nsresult Clone(mozilla::dom::NodeInfo *aNodeInfo, nsINode **aResult) const MOZ_OVERRIDE;
|
2013-02-12 02:01:17 -08:00
|
|
|
|
2014-04-08 15:27:17 -07:00
|
|
|
virtual JSObject* WrapNode(JSContext* aCx) MOZ_OVERRIDE;
|
2013-02-12 02:01:17 -08:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
#endif // mozilla_dom_SVGComponentTransferFunctionElement_h
|