Skip to main content

Dock

Trait Dock 

Source
pub trait Dock: Send + Sync {
Show 20 methods // Required methods fn new() -> Self where Self: Sized; fn setup(&mut self, ctx: &mut TheContext) -> TheCanvas; // Provided methods fn activate( &mut self, ui: &mut TheUI, ctx: &mut TheContext, project: &Project, server_ctx: &mut ServerContext, ) { ... } fn minimized(&mut self, ui: &mut TheUI, ctx: &mut TheContext) { ... } fn supports_actions(&self) -> bool { ... } fn default_state(&self) -> DockDefaultState { ... } fn maximized_state(&self) -> DockMaximizedState { ... } fn import( &mut self, content: String, ui: &mut TheUI, ctx: &mut TheContext, project: &mut Project, server_ctx: &mut ServerContext, ) { ... } fn export(&self) -> Option<String> { ... } fn handle_event( &mut self, event: &TheEvent, ui: &mut TheUI, ctx: &mut TheContext, project: &mut Project, server_ctx: &mut ServerContext, ) -> bool { ... } fn supports_undo(&self) -> bool { ... } fn has_changes(&self) -> bool { ... } fn mark_saved(&mut self) { ... } fn set_undo_state_to_ui(&self, ctx: &mut TheContext) { ... } fn undo( &mut self, ui: &mut TheUI, ctx: &mut TheContext, project: &mut Project, server_ctx: &mut ServerContext, ) { ... } fn redo( &mut self, ui: &mut TheUI, ctx: &mut TheContext, project: &mut Project, server_ctx: &mut ServerContext, ) { ... } fn editor_tools(&self) -> Option<Vec<Box<dyn EditorTool>>> { ... } fn draw_minimap( &self, buffer: &mut TheRGBABuffer, project: &Project, ctx: &mut TheContext, server_ctx: &ServerContext, ) -> bool { ... } fn supports_minimap_animation(&self) -> bool { ... } fn apply_debug_data( &mut self, ui: &mut TheUI, ctx: &mut TheContext, project: &Project, server_ctx: &ServerContext, debug: &DebugModule, ) { ... }
}

Required Methods§

Source

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

Source

fn setup(&mut self, ctx: &mut TheContext) -> TheCanvas

Provided Methods§

Source

fn activate( &mut self, ui: &mut TheUI, ctx: &mut TheContext, project: &Project, server_ctx: &mut ServerContext, )

Source

fn minimized(&mut self, ui: &mut TheUI, ctx: &mut TheContext)

Source

fn supports_actions(&self) -> bool

Source

fn default_state(&self) -> DockDefaultState

Source

fn maximized_state(&self) -> DockMaximizedState

Source

fn import( &mut self, content: String, ui: &mut TheUI, ctx: &mut TheContext, project: &mut Project, server_ctx: &mut ServerContext, )

Dock supports an import operation from JSON.

Source

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

Dock supports an export operation to JSON.

Source

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

Source

fn supports_undo(&self) -> bool

Returns true if this dock supports internal undo / redo.

Source

fn has_changes(&self) -> bool

Returns true if this dock has unsaved changes in its undo stack.

Source

fn mark_saved(&mut self)

Mark dock-local undo state as saved.

Source

fn set_undo_state_to_ui(&self, ctx: &mut TheContext)

If the dock supports undo, set its current state to the UI.

Source

fn undo( &mut self, ui: &mut TheUI, ctx: &mut TheContext, project: &mut Project, server_ctx: &mut ServerContext, )

Undo an action in the current dock

Source

fn redo( &mut self, ui: &mut TheUI, ctx: &mut TheContext, project: &mut Project, server_ctx: &mut ServerContext, )

Redo an action in the current dock

Source

fn editor_tools(&self) -> Option<Vec<Box<dyn EditorTool>>>

Returns the custom editor tools for this dock. If None, no custom tools are available.

Source

fn draw_minimap( &self, buffer: &mut TheRGBABuffer, project: &Project, ctx: &mut TheContext, server_ctx: &ServerContext, ) -> bool

Draw custom minimap content when this dock is active. Returns true if the dock drew custom content (minimap should not draw default content). Returns false to let the default minimap drawing proceed.

Source

fn supports_minimap_animation(&self) -> bool

Returns true if this dock animates minimap content (requires soft updates each tick).

Source

fn apply_debug_data( &mut self, ui: &mut TheUI, ctx: &mut TheContext, project: &Project, server_ctx: &ServerContext, debug: &DebugModule, )

Apply a live debug overlay to the visible dock, if supported.

Implementors§