pub( crate ) mod private
{
use crate::*;
#[ allow( dead_code ) ]
#[ derive( Debug, Clone ) ]
pub struct ContextChanger
{
pub( crate ) id : Id,
pub( crate ) stroke : Option< Id >,
pub( crate ) drawing : Option< Id >,
pub changes : Vec< Box< dyn ChangeInterface > >,
}
impl ContextChanger
{
#[ inline ]
pub fn stroke( self ) -> StrokeBrushChanger
{
let changer = StrokeBrushChanger::_new( self );
changer
}
#[ inline ]
pub fn draw( self ) -> DrawChanger
{
let changer = DrawChanger::_new( self );
changer
}
}
impl ChangerInterface for ContextChanger
{
type Parent = ContextChanger;
type Root = ContextChanger;
#[ inline ]
fn root( &mut self ) -> &mut Self::Root
{
self
}
#[ inline ]
fn context( self ) -> Self::Root
{
self
}
#[ inline ]
fn parent( &mut self ) -> &mut Self::Parent
{
self
}
#[ inline ]
fn end( self ) -> Self::Parent
{
self
}
#[ inline ]
fn change_add< Change >( &mut self, change : Change ) -> &mut Self
where
Change : ChangeInterface + 'static,
{
self.changes.push( Box::new( change ) );
self
}
}
impl HasIdInterface for ContextChanger
{
#[ inline ]
fn id( &self ) -> Id
{
self.id
}
}
}
pub mod protected
{
pub use super::
{
orphan::*,
};
}
pub use protected::*;
pub mod orphan
{
pub use super::exposed::*;
}
pub mod exposed
{
pub use super::
{
prelude::*,
private::ContextChanger,
};
}
pub use exposed::*;
pub mod prelude
{
pub use super::private::
{
};
}