use super::*;
pub trait Queue<I,O> { fn push(&mut self, v: I, order: O, prio: i64);
fn send(&self, v: I, order: O, prio: i64);
}
pub enum StdEnqueueable<E> where E: Env {
Render{force: bool},
Event{event: EEvent<E>, ts: u64},
MutateWidget{path: E::WidgetPath, f: fn(WidgetRefMut<E>,&mut E::Context,E::WidgetPath)},
MutateWidgetClosure{path: E::WidgetPath, f: Box<dyn FnOnce(WidgetRefMut<E>,&mut E::Context,E::WidgetPath)+'static>},
MutateRoot{f: fn(&mut E::Storage,&mut E::Context)},
MutateRootClosure{f: Box<dyn FnOnce(&mut E::Storage,&mut E::Context)+'static>},
AccessWidget{path: E::WidgetPath, f: fn(WidgetRef<E>,&mut E::Context)},
AccessWidgetClosure{path: E::WidgetPath, f: Box<dyn FnOnce(WidgetRef<E>,&mut E::Context)+'static>},
AccessRoot{f: fn(&E::Storage,&mut E::Context)},
AccessRootClosure{f: Box<dyn FnOnce(&E::Storage,&mut E::Context)+'static>},
MutMessage{path: E::WidgetPath, msg: E::Message},
InvalidateWidget{path: E::WidgetPath},
ValidateWidgetRender{path: E::WidgetPath},
ValidateWidgetSize{path: E::WidgetPath, size: ESize<E>},
}
#[derive(Copy,Clone,Hash,Eq,PartialEq)]
pub enum StdOrder {
PreEvents,
PreEvent,
PostEvent,
PostEvents,
PreRender,
RenderValidation,
PostRender,
PostCurrent,
}
#[deprecated]
pub fn invalidate<E: Env>(stor: &mut E::Storage, i: E::WidgetPath) -> Result<(),GuionError<E>> {
stor.widget_mut(i)
.map(#[inline] |mut w| w._set_invalid(true) )
}
#[deprecated]
pub fn validate<E: Env>(stor: &mut E::Storage, i: E::WidgetPath) -> Result<(),GuionError<E>> {
stor.widget_mut(i)
.map(#[inline] |mut w| w._set_invalid(false) )
}