pub struct EditorContext<'a> { /* private fields */ }Expand description
The Editor, as a panel’s command, a tool or a panel told of an edit
sees it: the program and what it built, and the few ways they change
that the editor keeps track of — so that undo, the marker and the step
being edited stay right whatever the extension does.
Implementations§
Source§impl<'a> EditorContext<'a>
impl<'a> EditorContext<'a>
Sourcepub fn drawn(&self) -> Option<Visible<'_>>
pub fn drawn(&self) -> Option<Visible<'_>>
The part as last drawn, but what the viewer was told not to draw: what a tool picks in.
Sourcepub fn runs(&self) -> u64
pub fn runs(&self) -> u64
How many times the editor has run the program: what the part is built as changes only when this does.
Sourcepub fn idle(&self) -> GeopResult<()>
pub fn idle(&self) -> GeopResult<()>
Refuses while a step is edited.
Sourcepub fn run_all(&mut self)
pub fn run_all(&mut self)
Runs the whole of the program run now: the step edited’s, or the file’s.
Sourcepub fn rerun(&mut self) -> Rerun<'_>
pub fn rerun(&mut self) -> Rerun<'_>
The program run now — the step edited’s, or the file’s — with the part as it last ran, to run again.
Sourcepub fn move_state(&mut self, moved: StateValues)
pub fn move_state(&mut self, moved: StateValues)
Moves the file’s state to moved, where it says.
Sourcepub fn edit_program(
&mut self,
edit: impl Fn(&mut Program) -> GeopResult<()>,
) -> GeopResult<()>
pub fn edit_program( &mut self, edit: impl Fn(&mut Program) -> GeopResult<()>, ) -> GeopResult<()>
Edits the file — and the program of the step being edited, which
then sees the edit too — by edit. The marker and the step edited
stay at their steps, found again by id: an edit may move steps.
Sourcepub fn undoable(&mut self, before: Program)
pub fn undoable(&mut self, before: Program)
Makes the file going back to before one edit to undo — what a
drag of many events is — if it changed since.
Sourcepub fn inspect(
&mut self,
kind: &str,
picked: &[PickedElement],
) -> GeopResult<Inspection>
pub fn inspect( &mut self, kind: &str, picked: &[PickedElement], ) -> GeopResult<Inspection>
The answer of the inspector kind about the elements picked of
the part as far as it runs.