use super::*;
#[derive(Clone, Debug, PartialEq, PartialOrd)]
#[repr(transparent)]
pub struct GroupEffect {
inner: Any,
}
impl FromVal for GroupEffect {
fn from_val(v: &Any) -> Self {
GroupEffect {
inner: Any::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 GroupEffect {
type Target = Any;
fn deref(&self) -> &Self::Target {
&self.inner
}
}
impl core::ops::DerefMut for GroupEffect {
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.inner
}
}
impl AsRef<Any> for GroupEffect {
fn as_ref(&self) -> &Any {
&self.inner
}
}
impl AsMut<Any> for GroupEffect {
fn as_mut(&mut self) -> &mut Any {
&mut self.inner
}
}
impl From<GroupEffect> for Any {
fn from(s: GroupEffect) -> Any {
let handle = s.inner.as_handle();
core::mem::forget(s);
Any::take_ownership(handle)
}
}
impl From<&GroupEffect> for Any {
fn from(s: &GroupEffect) -> Any {
s.inner.clone().into()
}
}
jsbind::utils::impl_dyn_cast!(GroupEffect);
impl GroupEffect {
pub fn children(&self) -> AnimationNodeList {
self.inner.get("children").as_::<AnimationNodeList>()
}
}
impl GroupEffect {
pub fn first_child(&self) -> AnimationEffect {
self.inner.get("firstChild").as_::<AnimationEffect>()
}
}
impl GroupEffect {
pub fn last_child(&self) -> AnimationEffect {
self.inner.get("lastChild").as_::<AnimationEffect>()
}
}
impl GroupEffect {
pub fn new(children: &TypedArray<AnimationEffect>) -> GroupEffect {
Self {
inner: Any::global("GroupEffect")
.new(&[children.into()])
.as_::<Any>(),
}
}
}
impl GroupEffect {
pub fn new_with_timing(children: &TypedArray<AnimationEffect>, timing: &Any) -> GroupEffect {
Self {
inner: Any::global("GroupEffect")
.new(&[children.into(), timing.into()])
.as_::<Any>(),
}
}
}
impl GroupEffect {
pub fn clone_(&self) -> GroupEffect {
self.inner.call("clone", &[]).as_::<GroupEffect>()
}
}
impl GroupEffect {
pub fn prepend(&self, effects: &AnimationEffect) -> Undefined {
self.inner
.call("prepend", &[effects.into()])
.as_::<Undefined>()
}
}
impl GroupEffect {
pub fn append(&self, effects: &AnimationEffect) -> Undefined {
self.inner
.call("append", &[effects.into()])
.as_::<Undefined>()
}
}