2013-03-15 07:01:37 +00:00
|
|
|
/* 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"
|
2013-03-15 07:01:38 +00:00
|
|
|
#include "mozilla/dom/SVGFEDistantLightElementBinding.h"
|
2013-11-27 11:25:29 +00:00
|
|
|
#include "nsSVGFilterInstance.h"
|
2013-03-15 07:01:37 +00:00
|
|
|
|
2013-03-15 07:01:38 +00:00
|
|
|
NS_IMPL_NS_NEW_NAMESPACED_SVG_ELEMENT(FEDistantLight)
|
2013-03-15 07:01:37 +00:00
|
|
|
|
2013-11-27 11:25:29 +00:00
|
|
|
using namespace mozilla::gfx;
|
|
|
|
|
2013-03-15 07:01:38 +00:00
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
|
|
|
|
|
|
|
JSObject*
|
2014-04-08 22:27:17 +00:00
|
|
|
SVGFEDistantLightElement::WrapNode(JSContext* aCx)
|
2013-03-15 07:01:38 +00:00
|
|
|
{
|
Bug 991742 part 6. Remove the "aScope" argument of binding Wrap() methods. r=bholley
This patch was mostly generated with this command:
find . -name "*.h" -o -name "*.cpp" | xargs sed -e 's/Binding::Wrap(aCx, aScope, this/Binding::Wrap(aCx, this/' -e 's/Binding_workers::Wrap(aCx, aScope, this/Binding_workers::Wrap(aCx, this/' -e 's/Binding::Wrap(cx, scope, this/Binding::Wrap(cx, this/' -i ""
plus a few manual fixes to dom/bindings/Codegen.py, js/xpconnect/src/event_impl_gen.py, and a few C++ files that were not caught in the search-and-replace above.
2014-04-08 22:27:17 +00:00
|
|
|
return SVGFEDistantLightElementBinding::Wrap(aCx, this);
|
2013-03-15 07:01:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
nsSVGElement::NumberInfo SVGFEDistantLightElement::sNumberInfo[2] =
|
2013-03-15 07:01:37 +00:00
|
|
|
{
|
|
|
|
{ &nsGkAtoms::azimuth, 0, false },
|
|
|
|
{ &nsGkAtoms::elevation, 0, false }
|
|
|
|
};
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
// nsIDOMNode methods
|
|
|
|
|
2013-03-15 07:01:38 +00:00
|
|
|
NS_IMPL_ELEMENT_CLONE_WITH_INIT(SVGFEDistantLightElement)
|
2013-03-15 07:01:37 +00:00
|
|
|
|
|
|
|
// nsFEUnstyledElement methods
|
|
|
|
|
|
|
|
bool
|
2013-03-15 07:01:38 +00:00
|
|
|
SVGFEDistantLightElement::AttributeAffectsRendering(int32_t aNameSpaceID,
|
|
|
|
nsIAtom* aAttribute) const
|
2013-03-15 07:01:37 +00:00
|
|
|
{
|
|
|
|
return aNameSpaceID == kNameSpaceID_None &&
|
|
|
|
(aAttribute == nsGkAtoms::azimuth ||
|
|
|
|
aAttribute == nsGkAtoms::elevation);
|
|
|
|
}
|
|
|
|
|
2013-11-27 11:25:29 +00:00
|
|
|
AttributeMap
|
|
|
|
SVGFEDistantLightElement::ComputeLightAttributes(nsSVGFilterInstance* aInstance)
|
|
|
|
{
|
|
|
|
float azimuth, elevation;
|
|
|
|
GetAnimatedNumberValues(&azimuth, &elevation, nullptr);
|
|
|
|
|
|
|
|
AttributeMap map;
|
|
|
|
map.Set(eLightType, (uint32_t)eLightTypeDistant);
|
|
|
|
map.Set(eDistantLightAzimuth, azimuth);
|
|
|
|
map.Set(eDistantLightElevation, elevation);
|
|
|
|
return map;
|
|
|
|
}
|
|
|
|
|
2013-07-01 07:03:04 +00:00
|
|
|
already_AddRefed<SVGAnimatedNumber>
|
2013-03-15 07:01:38 +00:00
|
|
|
SVGFEDistantLightElement::Azimuth()
|
|
|
|
{
|
|
|
|
return mNumberAttributes[AZIMUTH].ToDOMAnimatedNumber(this);
|
|
|
|
}
|
2013-03-15 07:01:37 +00:00
|
|
|
|
2013-07-01 07:03:04 +00:00
|
|
|
already_AddRefed<SVGAnimatedNumber>
|
2013-03-15 07:01:38 +00:00
|
|
|
SVGFEDistantLightElement::Elevation()
|
2013-03-15 07:01:37 +00:00
|
|
|
{
|
2013-03-15 07:01:38 +00:00
|
|
|
return mNumberAttributes[ELEVATION].ToDOMAnimatedNumber(this);
|
2013-03-15 07:01:37 +00:00
|
|
|
}
|
|
|
|
|
2013-03-15 07:01:38 +00:00
|
|
|
//----------------------------------------------------------------------
|
|
|
|
// nsSVGElement methods
|
|
|
|
|
|
|
|
nsSVGElement::NumberAttributesInfo
|
|
|
|
SVGFEDistantLightElement::GetNumberInfo()
|
2013-03-15 07:01:37 +00:00
|
|
|
{
|
2013-03-15 07:01:38 +00:00
|
|
|
return NumberAttributesInfo(mNumberAttributes, sNumberInfo,
|
|
|
|
ArrayLength(sNumberInfo));
|
2013-03-15 07:01:37 +00:00
|
|
|
}
|
2013-03-15 07:01:38 +00:00
|
|
|
|
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|