17 class ActionPositionCursor;
18 class ActionRemoveCell;
19 class ActionSetRunStatus;
20 class ActionSplitCell;
21 class ActionInsertText;
22 class ActionCompleteText;
23 class ActionEraseText;
129 using ColorMap = std::map<std::string, std::string>;
Base class which talks to the server and sends Action objects back to the DocumentThread.
Definition ComputeThread.hh:29
Definition DataCell.hh:116
Definition DocumentThread.hh:127
bool tab_completion
Definition DocumentThread.hh:140
std::map< std::string, ColorMap > colours
Definition DocumentThread.hh:136
std::map< std::string, std::string > ColorMap
Definition DocumentThread.hh:129
std::string git_path
Definition DocumentThread.hh:137
bool microtex
Definition DocumentThread.hh:141
nlohmann::json data
Definition DocumentThread.hh:144
std::string python_path
Definition DocumentThread.hh:138
bool auto_close_latex
Definition DocumentThread.hh:142
bool is_anonymous
Definition DocumentThread.hh:135
std::string config_path
Definition DocumentThread.hh:145
void save()
Definition DocumentThread.cc:424
bool move_into_new_cell
Definition DocumentThread.hh:139
bool highlight
Definition DocumentThread.hh:133
bool is_registered
Definition DocumentThread.hh:134
int font_step
Definition DocumentThread.hh:132
A base class with all the logic to manipulate a Cadabra notebook document.
Definition DocumentThread.hh:41
help_t
Help system.
Definition DocumentThread.hh:203
void queue_action(std::shared_ptr< ActionBase >)
All changes to the document should be made by submitting ActionBase derived objects to the 'queue_act...
Definition DocumentThread.cc:195
virtual void on_interactive_output(const nlohmann::json &msg)
Definition DocumentThread.cc:45
std::thread::id main_thread_id
For debugging purposes we store the main thread idea here (the main Cadabra class sets it).
Definition DocumentThread.hh:156
void undo()
One undo step.
Definition DocumentThread.cc:93
ActionStack undo_stack
Definition DocumentThread.hh:189
virtual void load_from_string(const std::string &)
Load a new notebook from a JSON string.
Definition DocumentThread.cc:83
virtual bool on_unhandled_error(const std::exception &err)
Definition DocumentThread.cc:330
virtual void set_compute_thread(ComputeThread *)
Let the notebook know about the ComputeThread so that it can send cells for evaluation.
Definition DocumentThread.cc:55
friend ActionSetRunStatus
Definition DocumentThread.hh:122
void redo()
One redo step.
Definition DocumentThread.cc:115
friend ActionPositionCursor
Definition DocumentThread.hh:119
friend ActionEraseText
Definition DocumentThread.hh:125
DTree::iterator follow_last_cell
Definition DocumentThread.hh:179
DTree doc
The actual document tree.
Definition DocumentThread.hh:168
void set_user_details(const std::string &name, const std::string &email, const std::string &affiliation)
Set user details which will be sent to the Cadabra log server.
Definition DocumentThread.cc:448
void run_cells_referencing_variable(std::string variable, double value)
Run all cells containing references to a given variable.
Definition DocumentThread.cc:260
friend ActionRemoveCell
Definition DocumentThread.hh:120
std::queue< std::shared_ptr< ActionBase > > pending_actions
Definition DocumentThread.hh:190
std::stack< std::shared_ptr< ActionBase > > ActionStack
Definition DocumentThread.hh:188
void run_all_cells()
Run all cells in the document.
Definition DocumentThread.cc:201
GUIBase * gui
Definition DocumentThread.hh:159
virtual void set_progress(const std::string &msg, int cur_step, int total_steps)
Definition DocumentThread.cc:50
std::mutex stack_mutex
The action undo/redo/todo stacks and logic to execute them.
Definition DocumentThread.hh:187
bool follow_mode
If follow_mode is true, the follow_cell can be set, and this will make the canvas view follow the ind...
Definition DocumentThread.hh:178
friend ActionCompleteText
Definition DocumentThread.hh:124
ActionStack redo_stack
Definition DocumentThread.hh:189
void build_visual_representation()
Ensure that the gui has an up-to-date representation of the dtree.
Definition DocumentThread.cc:136
DTree::iterator current_cell
Iterator to the currently active cell in the notebook, or doc.end() if nothing active.
Definition DocumentThread.hh:173
friend ActionBase
All actions are considered pieces of code which are part of DocumentThread, so they should be able to...
Definition DocumentThread.hh:117
void new_document()
Setup an empty new document with a single Python input cell.
Definition DocumentThread.cc:60
friend ActionAddCell
Definition DocumentThread.hh:118
friend ActionSplitCell
Definition DocumentThread.hh:121
std::pair< DTree::iterator, size_t > find_string(DTree::iterator start_it, size_t start_pos, const std::string &f, bool case_ins) const
Find string, return match, or a (doc.end(), std::string::npos).
Definition DocumentThread.cc:172
DocumentThread(const DocumentThread &)=delete
It is not possible to copy-construct a DocumentThread as it holds on to resources which are not easil...
bool help_type_and_topic(const std::string &before, const std::string &after, help_t &help_type, std::string &help_topic) const
Definition DocumentThread.cc:457
friend ActionInsertText
Definition DocumentThread.hh:123
ComputeThread * compute
Definition DocumentThread.hh:160
DTree::iterator follow_cell
Definition DocumentThread.hh:179
void process_action_queue()
Process the action queue.
Definition DocumentThread.cc:291
Prefs prefs
Definition DocumentThread.hh:147
bool disable_stacks
Definition DocumentThread.hh:191
void run_cell(DTree::iterator, bool shift_pressed)
Run a single cell in the document.
Definition DocumentThread.cc:214
Abstract base class with methods that need to be implemented by any GUI.
Definition GUIBase.hh:16
Functions to handle the exchange properties of two or more symbols in a product.
Definition Adjform.cc:83
void set(rset_t::iterator &num, multiplier_t fac)
Definition Storage.cc:1179