use super::*;
#[derive(Clone, Debug, PartialEq, PartialOrd)]
#[repr(transparent)]
pub struct SVGGraphicsElement {
inner: SVGElement,
}
impl FromVal for SVGGraphicsElement {
fn from_val(v: &Any) -> Self {
SVGGraphicsElement {
inner: SVGElement::from_val(v),
}
}
fn take_ownership(v: AnyHandle) -> Self {
Self::from_val(&Any::take_ownership(v))
}
fn as_handle(&self) -> AnyHandle {
self.inner.as_handle()
}
}
impl core::ops::Deref for SVGGraphicsElement {
type Target = SVGElement;
fn deref(&self) -> &Self::Target {
&self.inner
}
}
impl core::ops::DerefMut for SVGGraphicsElement {
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.inner
}
}
impl AsRef<Any> for SVGGraphicsElement {
fn as_ref(&self) -> &Any {
&self.inner
}
}
impl AsMut<Any> for SVGGraphicsElement {
fn as_mut(&mut self) -> &mut Any {
&mut self.inner
}
}
impl From<SVGGraphicsElement> for Any {
fn from(s: SVGGraphicsElement) -> Any {
let handle = s.inner.as_handle();
core::mem::forget(s);
Any::take_ownership(handle)
}
}
impl From<&SVGGraphicsElement> for Any {
fn from(s: &SVGGraphicsElement) -> Any {
s.inner.clone().into()
}
}
jsbind::utils::impl_dyn_cast!(SVGGraphicsElement);
impl SVGGraphicsElement {
pub fn transform(&self) -> SVGAnimatedTransformList {
self.inner
.get("transform")
.as_::<SVGAnimatedTransformList>()
}
}
impl SVGGraphicsElement {
pub fn required_extensions(&self) -> SVGStringList {
self.inner.get("requiredExtensions").as_::<SVGStringList>()
}
}
impl SVGGraphicsElement {
pub fn system_language(&self) -> SVGStringList {
self.inner.get("systemLanguage").as_::<SVGStringList>()
}
}
impl SVGGraphicsElement {
pub fn get_b_box(&self) -> DOMRect {
self.inner.call("getBBox", &[]).as_::<DOMRect>()
}
}
impl SVGGraphicsElement {
pub fn get_b_box_with_options(&self, options: &SVGBoundingBoxOptions) -> DOMRect {
self.inner
.call("getBBox", &[options.into()])
.as_::<DOMRect>()
}
}
impl SVGGraphicsElement {
pub fn get_ctm(&self) -> DOMMatrix {
self.inner.call("getCTM", &[]).as_::<DOMMatrix>()
}
}
impl SVGGraphicsElement {
pub fn get_screen_ctm(&self) -> DOMMatrix {
self.inner.call("getScreenCTM", &[]).as_::<DOMMatrix>()
}
}