2023-04-18 18:51:00 +01:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2023, MacDue <macdue@dueutil.tech>
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <LibWeb/Bindings/Intrinsics.h>
|
|
|
|
#include <LibWeb/SVG/SVGAnimatedNumber.h>
|
|
|
|
|
|
|
|
namespace Web::SVG {
|
|
|
|
|
2023-08-13 13:05:26 +02:00
|
|
|
JS::NonnullGCPtr<SVGAnimatedNumber> SVGAnimatedNumber::create(JS::Realm& realm, float base_val, float anim_val)
|
2023-04-18 18:51:00 +01:00
|
|
|
{
|
2023-08-13 13:05:26 +02:00
|
|
|
return realm.heap().allocate<SVGAnimatedNumber>(realm, realm, base_val, anim_val);
|
2023-04-18 18:51:00 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
SVGAnimatedNumber::SVGAnimatedNumber(JS::Realm& realm, float base_val, float anim_val)
|
|
|
|
: PlatformObject(realm)
|
|
|
|
, m_base_val(base_val)
|
|
|
|
, m_anim_val(anim_val)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
SVGAnimatedNumber::~SVGAnimatedNumber() = default;
|
|
|
|
|
2023-08-07 08:41:28 +02:00
|
|
|
void SVGAnimatedNumber::initialize(JS::Realm& realm)
|
2023-04-18 18:51:00 +01:00
|
|
|
{
|
2023-08-07 08:41:28 +02:00
|
|
|
Base::initialize(realm);
|
2023-04-18 18:51:00 +01:00
|
|
|
set_prototype(&Bindings::ensure_web_prototype<Bindings::SVGAnimatedNumberPrototype>(realm, "SVGAnimatedNumber"));
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|