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§
fn new() -> Selfwhere
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
Sourcefn import(
&mut self,
content: String,
ui: &mut TheUI,
ctx: &mut TheContext,
project: &mut Project,
server_ctx: &mut ServerContext,
)
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.
fn handle_event( &mut self, event: &TheEvent, ui: &mut TheUI, ctx: &mut TheContext, project: &mut Project, server_ctx: &mut ServerContext, ) -> bool
Sourcefn supports_undo(&self) -> bool
fn supports_undo(&self) -> bool
Returns true if this dock supports internal undo / redo.
Sourcefn has_changes(&self) -> bool
fn has_changes(&self) -> bool
Returns true if this dock has unsaved changes in its undo stack.
Sourcefn mark_saved(&mut self)
fn mark_saved(&mut self)
Mark dock-local undo state as saved.
Sourcefn set_undo_state_to_ui(&self, ctx: &mut TheContext)
fn set_undo_state_to_ui(&self, ctx: &mut TheContext)
If the dock supports undo, set its current state to the UI.
Sourcefn undo(
&mut self,
ui: &mut TheUI,
ctx: &mut TheContext,
project: &mut Project,
server_ctx: &mut ServerContext,
)
fn undo( &mut self, ui: &mut TheUI, ctx: &mut TheContext, project: &mut Project, server_ctx: &mut ServerContext, )
Undo an action in the current dock
Sourcefn redo(
&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, )
Redo an action in the current dock
Sourcefn editor_tools(&self) -> Option<Vec<Box<dyn EditorTool>>>
fn editor_tools(&self) -> Option<Vec<Box<dyn EditorTool>>>
Returns the custom editor tools for this dock. If None, no custom tools are available.
Sourcefn draw_minimap(
&self,
buffer: &mut TheRGBABuffer,
project: &Project,
ctx: &mut TheContext,
server_ctx: &ServerContext,
) -> bool
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.
Sourcefn supports_minimap_animation(&self) -> bool
fn supports_minimap_animation(&self) -> bool
Returns true if this dock animates minimap content (requires soft updates each tick).
Sourcefn apply_debug_data(
&mut self,
ui: &mut TheUI,
ctx: &mut TheContext,
project: &Project,
server_ctx: &ServerContext,
debug: &DebugModule,
)
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.