Bug 832155: Move SVGFEDistantLightElement to its own file r=Ms2ger

--HG--
rename : content/svg/content/src/nsSVGFilters.cpp => content/svg/content/src/SVGFEDistantLightElement.cpp
rename : content/svg/content/src/nsSVGFilters.cpp => content/svg/content/src/SVGFEDistantLightElement.h
This commit is contained in:
David Zbarsky 2013-03-15 03:01:37 -04:00
parent 2eda513e4c
commit ee4f45a3aa
4 changed files with 112 additions and 105 deletions

View File

@ -79,6 +79,7 @@ CPPSRCS = \
SVGElementFactory.cpp \
SVGEllipseElement.cpp \
SVGFEBlendElement.cpp \
SVGFEDistantLightElement.cpp \
SVGFEFloodElement.cpp \
SVGFEImageElement.cpp \
SVGFEMergeElement.cpp \
@ -177,6 +178,7 @@ EXPORTS_mozilla/dom = \
SVGDescElement.h \
SVGEllipseElement.h \
SVGFEBlendElement.h \
SVGFEDistantLightElement.h \
SVGFEFloodElement.h \
SVGFEImageElement.h \
SVGFEMergeElement.h \

View File

@ -0,0 +1,63 @@
/* a*- 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/. */
#include "mozilla/dom/SVGFEDistantLightElement.h"
NS_IMPL_NS_NEW_SVG_ELEMENT(FEDistantLight)
nsSVGElement::NumberInfo nsSVGFEDistantLightElement::sNumberInfo[2] =
{
{ &nsGkAtoms::azimuth, 0, false },
{ &nsGkAtoms::elevation, 0, false }
};
//----------------------------------------------------------------------
// nsISupports methods
NS_IMPL_ADDREF_INHERITED(nsSVGFEDistantLightElement,nsSVGFEDistantLightElementBase)
NS_IMPL_RELEASE_INHERITED(nsSVGFEDistantLightElement,nsSVGFEDistantLightElementBase)
DOMCI_NODE_DATA(SVGFEDistantLightElement, nsSVGFEDistantLightElement)
NS_INTERFACE_TABLE_HEAD(nsSVGFEDistantLightElement)
NS_NODE_INTERFACE_TABLE4(nsSVGFEDistantLightElement, nsIDOMNode,
nsIDOMElement, nsIDOMSVGElement,
nsIDOMSVGFEDistantLightElement)
NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(SVGFEDistantLightElement)
NS_INTERFACE_MAP_END_INHERITING(nsSVGFEDistantLightElementBase)
//----------------------------------------------------------------------
// nsIDOMNode methods
NS_IMPL_ELEMENT_CLONE_WITH_INIT(nsSVGFEDistantLightElement)
//----------------------------------------------------------------------
// nsFEUnstyledElement methods
bool
nsSVGFEDistantLightElement::AttributeAffectsRendering(int32_t aNameSpaceID,
nsIAtom* aAttribute) const
{
return aNameSpaceID == kNameSpaceID_None &&
(aAttribute == nsGkAtoms::azimuth ||
aAttribute == nsGkAtoms::elevation);
}
//----------------------------------------------------------------------
// nsIDOMSVGFEDistantLightElement methods
NS_IMETHODIMP
nsSVGFEDistantLightElement::GetAzimuth(nsIDOMSVGAnimatedNumber **aAzimuth)
{
return mNumberAttributes[AZIMUTH].ToDOMAnimatedNumber(aAzimuth,
this);
}
NS_IMETHODIMP
nsSVGFEDistantLightElement::GetElevation(nsIDOMSVGAnimatedNumber **aElevation)
{
return mNumberAttributes[ELEVATION].ToDOMAnimatedNumber(aElevation,
this);
}

View File

@ -0,0 +1,47 @@
/* a*- 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_SVGFEDistantLightElement_h
#define mozilla_dom_SVGFEDistantLightElement_h
#include "nsSVGFilters.h"
typedef SVGFEUnstyledElement nsSVGFEDistantLightElementBase;
class nsSVGFEDistantLightElement : public nsSVGFEDistantLightElementBase,
public nsIDOMSVGFEDistantLightElement
{
friend nsresult NS_NewSVGFEDistantLightElement(nsIContent **aResult,
already_AddRefed<nsINodeInfo> aNodeInfo);
protected:
nsSVGFEDistantLightElement(already_AddRefed<nsINodeInfo> aNodeInfo)
: nsSVGFEDistantLightElementBase(aNodeInfo) {}
public:
// interfaces:
NS_DECL_ISUPPORTS_INHERITED
NS_DECL_NSIDOMSVGFEDISTANTLIGHTELEMENT
NS_FORWARD_NSIDOMSVGELEMENT(nsSVGFEDistantLightElementBase::)
NS_FORWARD_NSIDOMNODE_TO_NSINODE
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
virtual bool AttributeAffectsRendering(
int32_t aNameSpaceID, nsIAtom* aAttribute) const;
virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
virtual nsXPCClassInfo* GetClassInfo();
virtual nsIDOMNode* AsDOMNode() { return this; }
protected:
virtual NumberAttributesInfo GetNumberInfo();
enum { AZIMUTH, ELEVATION };
nsSVGNumber2 mNumberAttributes[2];
static NumberInfo sNumberInfo[2];
};
#endif // mozilla_dom_SVGFEDistantLightElement_h

View File

@ -3565,111 +3565,6 @@ nsSVGFEConvolveMatrixElement::GetNumberListInfo()
ArrayLength(sNumberListInfo));
}
//---------------------DistantLight------------------------
typedef SVGFEUnstyledElement nsSVGFEDistantLightElementBase;
class nsSVGFEDistantLightElement : public nsSVGFEDistantLightElementBase,
public nsIDOMSVGFEDistantLightElement
{
friend nsresult NS_NewSVGFEDistantLightElement(nsIContent **aResult,
already_AddRefed<nsINodeInfo> aNodeInfo);
protected:
nsSVGFEDistantLightElement(already_AddRefed<nsINodeInfo> aNodeInfo)
: nsSVGFEDistantLightElementBase(aNodeInfo) {}
public:
// interfaces:
NS_DECL_ISUPPORTS_INHERITED
NS_DECL_NSIDOMSVGFEDISTANTLIGHTELEMENT
NS_FORWARD_NSIDOMSVGELEMENT(nsSVGFEDistantLightElementBase::)
NS_FORWARD_NSIDOMNODE_TO_NSINODE
NS_FORWARD_NSIDOMELEMENT_TO_GENERIC
virtual bool AttributeAffectsRendering(
int32_t aNameSpaceID, nsIAtom* aAttribute) const;
virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
virtual nsXPCClassInfo* GetClassInfo();
virtual nsIDOMNode* AsDOMNode() { return this; }
protected:
virtual NumberAttributesInfo GetNumberInfo();
enum { AZIMUTH, ELEVATION };
nsSVGNumber2 mNumberAttributes[2];
static NumberInfo sNumberInfo[2];
};
NS_IMPL_NS_NEW_SVG_ELEMENT(FEDistantLight)
nsSVGElement::NumberInfo nsSVGFEDistantLightElement::sNumberInfo[2] =
{
{ &nsGkAtoms::azimuth, 0, false },
{ &nsGkAtoms::elevation, 0, false }
};
//----------------------------------------------------------------------
// nsISupports methods
NS_IMPL_ADDREF_INHERITED(nsSVGFEDistantLightElement,nsSVGFEDistantLightElementBase)
NS_IMPL_RELEASE_INHERITED(nsSVGFEDistantLightElement,nsSVGFEDistantLightElementBase)
DOMCI_NODE_DATA(SVGFEDistantLightElement, nsSVGFEDistantLightElement)
NS_INTERFACE_TABLE_HEAD(nsSVGFEDistantLightElement)
NS_NODE_INTERFACE_TABLE4(nsSVGFEDistantLightElement, nsIDOMNode,
nsIDOMElement, nsIDOMSVGElement,
nsIDOMSVGFEDistantLightElement)
NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(SVGFEDistantLightElement)
NS_INTERFACE_MAP_END_INHERITING(nsSVGFEDistantLightElementBase)
//----------------------------------------------------------------------
// nsIDOMNode methods
NS_IMPL_ELEMENT_CLONE_WITH_INIT(nsSVGFEDistantLightElement)
//----------------------------------------------------------------------
// nsFEUnstyledElement methods
bool
nsSVGFEDistantLightElement::AttributeAffectsRendering(int32_t aNameSpaceID,
nsIAtom* aAttribute) const
{
return aNameSpaceID == kNameSpaceID_None &&
(aAttribute == nsGkAtoms::azimuth ||
aAttribute == nsGkAtoms::elevation);
}
//----------------------------------------------------------------------
// nsIDOMSVGFEDistantLightElement methods
NS_IMETHODIMP
nsSVGFEDistantLightElement::GetAzimuth(nsIDOMSVGAnimatedNumber **aAzimuth)
{
return mNumberAttributes[AZIMUTH].ToDOMAnimatedNumber(aAzimuth,
this);
}
NS_IMETHODIMP
nsSVGFEDistantLightElement::GetElevation(nsIDOMSVGAnimatedNumber **aElevation)
{
return mNumberAttributes[ELEVATION].ToDOMAnimatedNumber(aElevation,
this);
}
//----------------------------------------------------------------------
// nsSVGElement methods
nsSVGElement::NumberAttributesInfo
nsSVGFEDistantLightElement::GetNumberInfo()
{
return NumberAttributesInfo(mNumberAttributes, sNumberInfo,
ArrayLength(sNumberInfo));
}
//---------------------SpotLight------------------------
typedef SVGFEUnstyledElement nsSVGFESpotLightElementBase;