84 virtual void set_progress(
const std::string& msg,
int cur_step,
int total_steps);
93 std::pair<DTree::iterator, size_t>
find_string(DTree::iterator start_it,
size_t start_pos,
const std::string& f,
bool case_ins)
const;
107 using ColorMap = std::map<std::string, std::string>;
108 Prefs(
bool use_defaults =
false);
129 void set_user_details(
const std::string& name,
const std::string& email,
const std::string& affiliation);
171 help_t& help_type, std::string& help_topic)
const;
Add a cell to the notebook.
Definition Actions.hh:59
All actions derive from the ActionBase object, which defines the interface they need to implement.
Definition Actions.hh:32
Complete text at a point in a GUI cell with one or more alternative.
Definition Actions.hh:217
Remove a text string starting at the indicated position, and with the indicated length,...
Definition Actions.hh:244
Add a text string (can be just a single character) at the point of the cursor.
Definition Actions.hh:195
Position the cursor relative to the indicated cell.
Definition Actions.hh:95
Remove a cell and all its child cells from the document.
Definition Actions.hh:134
Update the running status of the indicated cell.
Definition Actions.hh:115
Split a cell into two separate cells, at the point of the cursor.
Definition Actions.hh:173
Base class which talks to the server and sends Action objects back to the DocumentThread.
Definition ComputeThread.hh:36
Definition DocumentThread.hh:105
bool tab_completion
Definition DocumentThread.hh:118
std::map< std::string, ColorMap > colours
Definition DocumentThread.hh:114
Prefs(bool use_defaults=false)
Definition DocumentThread.cc:235
std::map< std::string, std::string > ColorMap
Definition DocumentThread.hh:107
std::string git_path
Definition DocumentThread.hh:115
bool microtex
Definition DocumentThread.hh:119
nlohmann::json data
Definition DocumentThread.hh:121
std::string python_path
Definition DocumentThread.hh:116
bool is_anonymous
Definition DocumentThread.hh:113
std::string config_path
Definition DocumentThread.hh:122
void save()
Definition DocumentThread.cc:323
bool move_into_new_cell
Definition DocumentThread.hh:117
bool highlight
Definition DocumentThread.hh:111
bool is_registered
Definition DocumentThread.hh:112
int font_step
Definition DocumentThread.hh:110
help_t
Help system.
Definition DocumentThread.hh:169
@ property
Definition DocumentThread.hh:169
@ latex
Definition DocumentThread.hh:169
@ none
Definition DocumentThread.hh:169
@ algorithm
Definition DocumentThread.hh:169
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:187
virtual void on_interactive_output(const nlohmann::json &msg)
Definition DocumentThread.cc:37
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:133
void undo()
One undo step.
Definition DocumentThread.cc:85
ActionStack undo_stack
Definition DocumentThread.hh:155
void load_from_string(const std::string &)
Load a new notebook from a JSON string.
Definition DocumentThread.cc:75
virtual bool on_unhandled_error(const std::exception &err)
Definition DocumentThread.cc:230
virtual void set_compute_thread(ComputeThread *)
Let the notebook know about the ComputeThread so that it can send cells for evaluation.
Definition DocumentThread.cc:47
friend ActionSetRunStatus
Definition DocumentThread.hh:100
void redo()
One redo step.
Definition DocumentThread.cc:107
friend ActionPositionCursor
Definition DocumentThread.hh:97
friend ActionEraseText
Definition DocumentThread.hh:103
DTree doc
The actual document tree.
Definition DocumentThread.hh:145
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:346
friend ActionRemoveCell
Definition DocumentThread.hh:98
std::queue< std::shared_ptr< ActionBase > > pending_actions
Definition DocumentThread.hh:156
std::stack< std::shared_ptr< ActionBase > > ActionStack
Definition DocumentThread.hh:154
GUIBase * gui
Definition DocumentThread.hh:136
virtual void set_progress(const std::string &msg, int cur_step, int total_steps)
Definition DocumentThread.cc:42
std::mutex stack_mutex
The action undo/redo/todo stacks and logic to execute them.
Definition DocumentThread.hh:153
DocumentThread(GUIBase *)
Definition DocumentThread.cc:24
friend ActionCompleteText
Definition DocumentThread.hh:102
ActionStack redo_stack
Definition DocumentThread.hh:155
void build_visual_representation()
Ensure that the gui has an up-to-date representation of the dtree.
Definition DocumentThread.cc:128
friend ActionBase
Definition DocumentThread.hh:95
void new_document()
Setup an empty new document with a single Python input cell.
Definition DocumentThread.cc:52
friend ActionAddCell
Definition DocumentThread.hh:96
friend ActionSplitCell
Definition DocumentThread.hh:99
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:164
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:355
friend ActionInsertText
Definition DocumentThread.hh:101
ComputeThread * compute
Definition DocumentThread.hh:137
void process_action_queue()
Process the action queue.
Definition DocumentThread.cc:194
Prefs prefs
Definition DocumentThread.hh:124
bool disable_stacks
Definition DocumentThread.hh:157
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
tree< DataCell > DTree
Definition DataCell.hh:109