Trait ImageEditorPlugin

Source
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§

Source

fn setup(&mut self, emitter: Sender<&Event>)

Store emitter to be able to send events later.

Source

fn id(&self) -> String

Plugin-unique identifier. May be used in EventData.target_id.

Source

fn activate(&mut self, canvas: &VirtualCanvas<'_>)

Plugin is starting to be used. Called by user, not other plugins.

Source

fn draw(&self, canvas: &mut VirtualCanvas<'_>)

Plugin may draw some additional overlay there.

Source

fn act(&mut self, ev: &Event, canvas: &mut VirtualCanvas<'_>) -> bool

Return value: whether this plugin consumes the event.

Source

fn deactivate(&mut self)

Plugin is deactivated. It may be activated again later. Called by user, not other plugins.

Implementors§