2015-05-03 22:32:37 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
2013-02-12 14:01:17 +04:00
|
|
|
/* 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 14:10:24 +04:00
|
|
|
#include "nsSVGNumber2.h"
|
|
|
|
#include "SVGAnimatedNumberList.h"
|
|
|
|
|
2013-02-12 14:01:17 +04: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 14:10:24 +04:00
|
|
|
|
|
|
|
class DOMSVGAnimatedNumberList;
|
|
|
|
|
2013-02-12 14:01:17 +04:00
|
|
|
namespace dom {
|
|
|
|
|
|
|
|
typedef SVGFEUnstyledElement SVGComponentTransferFunctionElementBase;
|
|
|
|
|
|
|
|
class SVGComponentTransferFunctionElement : public SVGComponentTransferFunctionElementBase
|
|
|
|
{
|
|
|
|
protected:
|
2014-09-01 05:08:04 +04:00
|
|
|
explicit SVGComponentTransferFunctionElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
|
2013-02-12 14:10:24 +04:00
|
|
|
: SVGComponentTransferFunctionElementBase(aNodeInfo)
|
|
|
|
{
|
|
|
|
}
|
2013-02-12 14:01:17 +04:00
|
|
|
|
2014-07-09 01:23:16 +04:00
|
|
|
virtual ~SVGComponentTransferFunctionElement() {}
|
|
|
|
|
2013-02-12 14:01:17 +04:00
|
|
|
public:
|
2013-11-27 15:25:29 +04:00
|
|
|
typedef gfx::AttributeMap AttributeMap;
|
|
|
|
|
2013-02-12 14:01:17 +04:00
|
|
|
// interfaces:
|
|
|
|
NS_DECLARE_STATIC_IID_ACCESSOR(NS_SVG_FE_COMPONENT_TRANSFER_FUNCTION_ELEMENT_CID)
|
|
|
|
|
|
|
|
NS_DECL_ISUPPORTS_INHERITED
|
|
|
|
|
|
|
|
virtual bool AttributeAffectsRendering(
|
2015-03-21 19:28:04 +03:00
|
|
|
int32_t aNameSpaceID, nsIAtom* aAttribute) const override;
|
2013-02-12 14:01:17 +04:00
|
|
|
|
|
|
|
virtual int32_t GetChannel() = 0;
|
2013-11-27 15:25:29 +04:00
|
|
|
|
|
|
|
AttributeMap ComputeAttributes();
|
2013-02-12 14:01:17 +04:00
|
|
|
|
2013-02-12 14:10:24 +04:00
|
|
|
// WebIDL
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual JSObject* WrapNode(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override = 0;
|
2013-07-01 11:02:46 +04:00
|
|
|
already_AddRefed<SVGAnimatedEnumeration> Type();
|
2013-02-12 14:10:24 +04:00
|
|
|
already_AddRefed<DOMSVGAnimatedNumberList> TableValues();
|
2013-07-01 11:03:04 +04:00
|
|
|
already_AddRefed<SVGAnimatedNumber> Slope();
|
|
|
|
already_AddRefed<SVGAnimatedNumber> Intercept();
|
|
|
|
already_AddRefed<SVGAnimatedNumber> Amplitude();
|
|
|
|
already_AddRefed<SVGAnimatedNumber> Exponent();
|
|
|
|
already_AddRefed<SVGAnimatedNumber> Offset();
|
2013-02-12 14:10:24 +04:00
|
|
|
|
2013-02-12 14:01:17 +04:00
|
|
|
protected:
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual NumberAttributesInfo GetNumberInfo() override;
|
|
|
|
virtual EnumAttributesInfo GetEnumInfo() override;
|
|
|
|
virtual NumberListAttributesInfo GetNumberListInfo() override;
|
2013-02-12 14:01:17 +04: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 12:45:02 +04:00
|
|
|
NS_DEFINE_STATIC_IID_ACCESSOR(SVGComponentTransferFunctionElement, NS_SVG_FE_COMPONENT_TRANSFER_FUNCTION_ELEMENT_CID)
|
|
|
|
|
2013-02-12 14:01:17 +04:00
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
nsresult NS_NewSVGFEFuncRElement(
|
2014-06-20 06:01:40 +04:00
|
|
|
nsIContent** aResult, already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo);
|
2013-02-12 14:01:17 +04:00
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
|
|
|
|
2013-03-28 05:23:09 +04:00
|
|
|
class SVGFEFuncRElement : public SVGComponentTransferFunctionElement
|
2013-02-12 14:01:17 +04:00
|
|
|
{
|
|
|
|
friend nsresult (::NS_NewSVGFEFuncRElement(
|
2014-06-20 06:01:40 +04:00
|
|
|
nsIContent** aResult, already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo));
|
2013-02-12 14:01:17 +04:00
|
|
|
protected:
|
2014-09-01 05:08:04 +04:00
|
|
|
explicit SVGFEFuncRElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
|
2013-02-12 14:01:17 +04:00
|
|
|
: SVGComponentTransferFunctionElement(aNodeInfo) {}
|
|
|
|
|
|
|
|
public:
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual int32_t GetChannel() override { return 0; }
|
2013-03-18 21:54:04 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual nsresult Clone(mozilla::dom::NodeInfo *aNodeInfo, nsINode **aResult) const override;
|
2013-02-12 14:01:17 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual JSObject* WrapNode(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
|
2013-02-12 14:01:17 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
nsresult NS_NewSVGFEFuncGElement(
|
2014-06-20 06:01:40 +04:00
|
|
|
nsIContent** aResult, already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo);
|
2013-02-12 14:01:17 +04:00
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
|
|
|
|
2013-03-28 05:23:09 +04:00
|
|
|
class SVGFEFuncGElement : public SVGComponentTransferFunctionElement
|
2013-02-12 14:01:17 +04:00
|
|
|
{
|
|
|
|
friend nsresult (::NS_NewSVGFEFuncGElement(
|
2014-06-20 06:01:40 +04:00
|
|
|
nsIContent** aResult, already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo));
|
2013-02-12 14:01:17 +04:00
|
|
|
protected:
|
2014-09-01 05:08:04 +04:00
|
|
|
explicit SVGFEFuncGElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
|
2013-02-12 14:01:17 +04:00
|
|
|
: SVGComponentTransferFunctionElement(aNodeInfo) {}
|
|
|
|
|
|
|
|
public:
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual int32_t GetChannel() override { return 1; }
|
2013-02-12 14:01:17 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual nsresult Clone(mozilla::dom::NodeInfo *aNodeInfo, nsINode **aResult) const override;
|
2013-02-12 14:01:17 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual JSObject* WrapNode(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
|
2013-02-12 14:01:17 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
nsresult NS_NewSVGFEFuncBElement(
|
2014-06-20 06:01:40 +04:00
|
|
|
nsIContent** aResult, already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo);
|
2013-02-12 14:01:17 +04:00
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
|
|
|
|
2013-03-28 05:23:09 +04:00
|
|
|
class SVGFEFuncBElement : public SVGComponentTransferFunctionElement
|
2013-02-12 14:01:17 +04:00
|
|
|
{
|
|
|
|
friend nsresult (::NS_NewSVGFEFuncBElement(
|
2014-06-20 06:01:40 +04:00
|
|
|
nsIContent** aResult, already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo));
|
2013-02-12 14:01:17 +04:00
|
|
|
protected:
|
2014-09-01 05:08:04 +04:00
|
|
|
explicit SVGFEFuncBElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
|
2013-02-12 14:01:17 +04:00
|
|
|
: SVGComponentTransferFunctionElement(aNodeInfo) {}
|
|
|
|
|
|
|
|
public:
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual int32_t GetChannel() override { return 2; }
|
2013-02-12 14:01:17 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual nsresult Clone(mozilla::dom::NodeInfo *aNodeInfo, nsINode **aResult) const override;
|
2013-02-12 14:01:17 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual JSObject* WrapNode(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
|
2013-02-12 14:01:17 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
nsresult NS_NewSVGFEFuncAElement(
|
2014-06-20 06:01:40 +04:00
|
|
|
nsIContent** aResult, already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo);
|
2013-02-12 14:01:17 +04:00
|
|
|
|
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
|
|
|
|
2013-03-28 05:23:09 +04:00
|
|
|
class SVGFEFuncAElement : public SVGComponentTransferFunctionElement
|
2013-02-12 14:01:17 +04:00
|
|
|
{
|
|
|
|
friend nsresult (::NS_NewSVGFEFuncAElement(
|
2014-06-20 06:01:40 +04:00
|
|
|
nsIContent** aResult, already_AddRefed<mozilla::dom::NodeInfo>&& aNodeInfo));
|
2013-02-12 14:01:17 +04:00
|
|
|
protected:
|
2014-09-01 05:08:04 +04:00
|
|
|
explicit SVGFEFuncAElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
|
2013-02-12 14:01:17 +04:00
|
|
|
: SVGComponentTransferFunctionElement(aNodeInfo) {}
|
|
|
|
|
|
|
|
public:
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual int32_t GetChannel() override { return 3; }
|
2013-02-12 14:01:17 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual nsresult Clone(mozilla::dom::NodeInfo *aNodeInfo, nsINode **aResult) const override;
|
2013-02-12 14:01:17 +04:00
|
|
|
|
2015-03-21 19:28:04 +03:00
|
|
|
virtual JSObject* WrapNode(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
|
2013-02-12 14:01:17 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
|
|
|
|
|
|
|
#endif // mozilla_dom_SVGComponentTransferFunctionElement_h
|