pub trait ImageEditorPlugin {
// Required methods
fn setup(&mut self, emitter: Sender<&Event>);
fn id(&self) -> String;
fn activate(&mut self, canvas: &VirtualCanvas<'_>);
fn draw(&self, canvas: &mut VirtualCanvas<'_>);
fn act(&mut self, ev: &Event, canvas: &mut VirtualCanvas<'_>) -> bool;
fn deactivate(&mut self);
}
Required Methods§
Sourcefn activate(&mut self, canvas: &VirtualCanvas<'_>)
fn activate(&mut self, canvas: &VirtualCanvas<'_>)
Plugin is starting to be used. Called by user, not other plugins.
Sourcefn draw(&self, canvas: &mut VirtualCanvas<'_>)
fn draw(&self, canvas: &mut VirtualCanvas<'_>)
Plugin may draw some additional overlay there.
Sourcefn act(&mut self, ev: &Event, canvas: &mut VirtualCanvas<'_>) -> bool
fn act(&mut self, ev: &Event, canvas: &mut VirtualCanvas<'_>) -> bool
Return value: whether this plugin consumes the event.
Sourcefn deactivate(&mut self)
fn deactivate(&mut self)
Plugin is deactivated. It may be activated again later. Called by user, not other plugins.