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: */
|
2012-05-21 15:12:37 +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/. */
|
2001-12-12 10:59:31 +03:00
|
|
|
|
2013-03-26 19:52:41 +04:00
|
|
|
#include "mozilla/dom/SVGRect.h"
|
2013-05-09 21:42:12 +04:00
|
|
|
#include "nsSVGElement.h"
|
2001-12-12 10:59:31 +03:00
|
|
|
|
2014-03-18 06:41:33 +04:00
|
|
|
using namespace mozilla::gfx;
|
|
|
|
|
2013-03-26 19:52:41 +04:00
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
|
|
|
|
2001-12-12 10:59:31 +03:00
|
|
|
//----------------------------------------------------------------------
|
|
|
|
// implementation:
|
|
|
|
|
2013-05-09 21:42:12 +04:00
|
|
|
SVGRect::SVGRect(nsIContent* aParent, float x, float y, float w, float h)
|
2013-05-16 22:06:21 +04:00
|
|
|
: SVGIRect(), mParent(aParent), mX(x), mY(y), mWidth(w), mHeight(h)
|
2001-12-12 10:59:31 +03:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
// nsISupports methods:
|
|
|
|
|
2014-04-29 12:57:00 +04:00
|
|
|
NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(SVGRect, mParent)
|
2001-12-12 10:59:31 +03:00
|
|
|
|
2013-05-16 22:06:21 +04:00
|
|
|
NS_IMPL_CYCLE_COLLECTING_ADDREF(SVGRect)
|
|
|
|
NS_IMPL_CYCLE_COLLECTING_RELEASE(SVGRect)
|
|
|
|
|
|
|
|
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(SVGRect)
|
|
|
|
NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
|
2009-02-03 17:42:24 +03:00
|
|
|
NS_INTERFACE_MAP_ENTRY(nsISupports)
|
2001-12-12 10:59:31 +03:00
|
|
|
NS_INTERFACE_MAP_END
|
|
|
|
|
2013-03-26 19:52:41 +04:00
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
2005-08-26 01:31:09 +04:00
|
|
|
|
2001-12-12 10:59:31 +03:00
|
|
|
////////////////////////////////////////////////////////////////////////
|
|
|
|
// Exported creation functions:
|
|
|
|
|
2013-04-18 15:40:09 +04:00
|
|
|
already_AddRefed<mozilla::dom::SVGRect>
|
2013-05-09 21:42:12 +04:00
|
|
|
NS_NewSVGRect(nsIContent* aParent, float aX, float aY, float aWidth,
|
|
|
|
float aHeight)
|
2001-12-12 10:59:31 +03:00
|
|
|
{
|
2013-04-18 15:40:09 +04:00
|
|
|
nsRefPtr<mozilla::dom::SVGRect> rect =
|
2013-05-09 21:42:12 +04:00
|
|
|
new mozilla::dom::SVGRect(aParent, aX, aY, aWidth, aHeight);
|
2013-04-18 15:40:09 +04:00
|
|
|
|
|
|
|
return rect.forget();
|
2001-12-12 10:59:31 +03:00
|
|
|
}
|
|
|
|
|
2013-04-18 15:40:09 +04:00
|
|
|
already_AddRefed<mozilla::dom::SVGRect>
|
2014-03-18 06:41:33 +04:00
|
|
|
NS_NewSVGRect(nsIContent* aParent, const Rect& aRect)
|
2007-01-31 19:05:42 +03:00
|
|
|
{
|
2014-03-18 06:41:33 +04:00
|
|
|
return NS_NewSVGRect(aParent, aRect.x, aRect.y,
|
|
|
|
aRect.width, aRect.height);
|
2007-01-31 19:05:42 +03:00
|
|
|
}
|
|
|
|
|