SVGMatrixTearOff.h [plain text]
#ifndef SVGMatrixTearOff_h
#define SVGMatrixTearOff_h
#include "SVGPropertyTearOff.h"
#include "SVGTransform.h"
namespace WebCore {
class SVGMatrixTearOff : public SVGPropertyTearOff<SVGMatrix> {
public:
static Ref<SVGMatrixTearOff> create(SVGPropertyTearOff<SVGTransform>& parent, SVGMatrix& value)
{
ASSERT_UNUSED(value, &parent.propertyReference().svgMatrix() == &value);
Ref<SVGMatrixTearOff> result = adoptRef(*new SVGMatrixTearOff(&parent));
parent.addChild(result->m_weakFactory.createWeakPtr());
return result;
}
virtual SVGMatrix& propertyReference() override { return m_parent->propertyReference().svgMatrix(); }
virtual void setValue(SVGMatrix& value) override { m_parent->propertyReference().setMatrix(value); }
virtual void commitChange() override
{
m_parent->propertyReference().updateSVGMatrix();
m_parent->commitChange();
}
private:
SVGMatrixTearOff(SVGPropertyTearOff<SVGTransform>* parent)
: SVGPropertyTearOff<SVGMatrix>(nullptr)
, m_parent(parent)
, m_weakFactory(this)
{
}
RefPtr<SVGPropertyTearOff<SVGTransform>> m_parent;
WeakPtrFactory<SVGPropertyTearOffBase> m_weakFactory;
};
}
#endif // SVGMatrixTearOff_h