Skip to main content

EditorTool

Trait EditorTool 

Source
pub trait EditorTool: Send + Sync {
    // Required methods
    fn new() -> Self
       where Self: Sized;
    fn id(&self) -> TheId;
    fn info(&self) -> String;
    fn icon_name(&self) -> String;

    // Provided methods
    fn rgba_view_mode(&self) -> Option<TheRGBAViewMode> { ... }
    fn accel(&self) -> Option<char> { ... }
    fn help_url(&self) -> Option<String> { ... }
    fn activate(&mut self) { ... }
    fn deactivate(&mut self) { ... }
    fn handle_event(
        &mut self,
        event: &TheEvent,
        ui: &mut TheUI,
        ctx: &mut TheContext,
        project: &mut Project,
        server_ctx: &mut ServerContext,
    ) -> bool { ... }
    fn get_undo_atom(&mut self, project: &Project) -> Option<Box<dyn Any>> { ... }
}
Expand description

Tool trait for dock editors (like tile editor, tilemap editor, etc.)

Required Methods§

Source

fn new() -> Self
where Self: Sized,

Source

fn id(&self) -> TheId

Source

fn info(&self) -> String

Source

fn icon_name(&self) -> String

Provided Methods§

Source

fn rgba_view_mode(&self) -> Option<TheRGBAViewMode>

Source

fn accel(&self) -> Option<char>

Source

fn help_url(&self) -> Option<String>

Source

fn activate(&mut self)

Source

fn deactivate(&mut self)

Source

fn handle_event( &mut self, event: &TheEvent, ui: &mut TheUI, ctx: &mut TheContext, project: &mut Project, server_ctx: &mut ServerContext, ) -> bool

Source

fn get_undo_atom(&mut self, project: &Project) -> Option<Box<dyn Any>>

Get the current undo atom if the tool has pending changes This is called when a tool operation completes (e.g., on mouse up)

Implementors§