Cadabra
Computer algebra system for field theory problems
Loading...
Searching...
No Matches
NotebookWindow.hh
Go to the documentation of this file.
1
2#pragma once
3
4#include <gtkmm/window.h>
5#include <gtkmm/applicationwindow.h>
6#include <gtkmm/box.h>
7#include <gtkmm/progressbar.h>
8#include <gtkmm/spinner.h>
9#include <gtkmm/label.h>
10// #include <gtkmm/stock.h>
11#include <gtkmm/button.h>
12#include <gtkmm/builder.h>
13#include <gtkmm/cssprovider.h>
14// #include <gtkmm/toolbar.h>
15#include <glibmm/dispatcher.h>
16#include <giomm/settings.h>
17#include <giomm/actiongroup.h>
18
19#include <thread>
20#include <mutex>
21
22#include "nlohmann/json.hpp"
23
24#include "DocumentThread.hh"
25#include "ComputeThread.hh"
26#include "Console.hh"
27#include "GUIBase.hh"
28#include "NotebookCanvas.hh"
29#include "../common/TeXEngine.hh"
30#include "DiffViewer.hh"
31
32class Cadabra;
33
34namespace cadabra {
35
40
41 class NotebookWindow : public Gtk::ApplicationWindow, public DocumentThread, public GUIBase {
42 public:
43 NotebookWindow(Cadabra *, bool read_only=false, std::string geometry="", std::string title="");
45
46 // Virtual functions from GUIBase.
47
48 virtual void add_cell(const DTree&, DTree::iterator, bool) override;
49 virtual void remove_cell(const DTree&, DTree::iterator) override;
50 virtual void remove_all_cells() override;
51 virtual void update_cell(const DTree&, DTree::iterator) override;
52 virtual void position_cursor(const DTree&, DTree::iterator, int pos) override;
53 virtual size_t get_cursor_position(const DTree&, DTree::iterator) override;
54 virtual void hide_visual_cells(DTree::iterator it) override;
55 virtual void dim_output_cells(DTree::iterator it) override;
56
57 void select_range(const DTree&, DTree::iterator, int start, int len);
58
59 // Implementations of the functions which the compute thread will
60 // call directly. If these need to modify the GUI, they need to do
61 // so by calling one of the dispatchers.
62 virtual void on_connect() override;
63 virtual void on_disconnect(const std::string&) override;
64 virtual void on_network_error() override;
65 virtual void on_kernel_runstatus(bool) override;
66 virtual void process_data() override;
67
68 // TeX stuff
70 double scale; // total scale factor (hdpi and textscale)
71 double display_scale; // hdpi scale only
72
73 // General setup.
74 void on_realize() override;
75
76 // Handler for vertical scrollbar changes. This gets connected to
77 // all the `NotebookCanvas::scroll_event` signals.
78 bool on_scroll_changed();
79
80 // Handler for SliderView change events.
81 void on_slider_changed(std::string variable, double value);
82
83 // When something inside the large notebook canvas changes, we need
84 // to make sure that the current cell stays into view (if we are
85 // editing that cell). We can only do that once all size info is
86 // known, which is when the scrolledwindow gets its size_allocate
87 // signal. Here's the handler for it.
88 void on_scroll_size_allocate(Gtk::Allocation&);
89
90 // Ensure that the current cell is visible. This will assume
91 // that all size allocations of widgets inside the scrolled window
92 // have been made; it only does scrolling, based on the current
93 // allocations. Calls `scroll_cell_into_view`.
95
96 // Ensure that the indicated cell is visible.
97 void scroll_cell_into_view(DTree::iterator cell);
98
99 void set_name(const std::string&);
100 void set_title_prefix(const std::string&);
101
103 void on_help_register();
104
105 void set_statusbar_message(const std::string& message = "", int line = -1, int col = -1);
106
108 void select_git_path();
109 void compare_to_file();
110 void compare_git_latest();
111 void compare_git_choose();
113 void compare_git(const std::string& commit_hash);
114 std::string run_git_command(const std::string& args);
115
116 virtual void load_from_string(const std::string& notebook_contents) override;
117 virtual void set_compute_thread(ComputeThread* compute) override;
118
119 virtual void on_interactive_output(const nlohmann::json& msg) override;
120 virtual void set_progress(const std::string& msg, int cur_step, int total_steps) override;
121 protected:
122 virtual bool on_key_press_event(GdkEventKey*) override;
123 virtual bool on_delete_event(GdkEventAny*) override;
124 virtual bool on_configure_event(GdkEventConfigure *cfg) override;
125 virtual bool on_unhandled_error(const std::exception& err) override;
126
127 bool handle_outbox_select(GdkEventButton *, DTree::iterator it);
128 DTree::iterator selected_cell;
130 void on_outbox_copy(Glib::RefPtr<Gtk::Clipboard> refClipboard, DTree::iterator it);
131
132 private:
133 Glib::RefPtr<Cadabra> cdbapp;
134
135 std::vector<Glib::RefPtr<Gio::SimpleAction>> default_actions;
136
137 // Main handler which fires whenever the Client object signals
138 // that the document is changing or the network status is modified.
139 // Runs on the GUI thread.
140
141 Glib::Dispatcher dispatcher;
142
143 // GUI elements.
144
145 Glib::RefPtr<Gio::SimpleActionGroup> actiongroup;
146 Glib::RefPtr<Gtk::Builder> uimanager;
147
148 Gtk::Box topbox;
149 Gtk::Box toolbar;
152 Gtk::Box supermainbox;
153 Gtk::Paned dragbox;
154 Gtk::Box mainbox;
155 Gtk::SearchBar searchbar;
156 Gtk::Box search_hbox;
157 Gtk::SearchEntry searchentry;
158 Gtk::CheckButton search_case_insensitive;
159 Gtk::Label search_result;
160 Gtk::Box statusbarbox;
161
163 Gtk::Dialog console_win;
164
165 std::unique_ptr<DiffViewer> diffviewer;
166
167 // All canvasses which are stored in the ...
168 // These pointers are managed by gtkmm.
169 std::vector<NotebookCanvas *> canvasses;
171
172 // Buttons
173 // Gtk::Button b_kill, b_run, b_run_to, b_run_from, b_help, b_stop, b_undo, b_redo;
174
175 // Status bar
176 Gtk::ProgressBar progressbar;
177 Gtk::Spinner kernel_spinner;
180
181 // GUI data which is the autoritative source for things displayed in
182 // the status bars declared above. These strings are filled on the
183 // compute thread and then updated into the gui on the gui thread.
184
185 std::mutex status_mutex;
189
190 // Functions which get called on the compute thread can signal to
191 // the GUI thread that elements need to be updated, by sending
192 // signals using the following dispatchers.
194
195 // Update the status line and progress bar. This should only
196 // be called on the GUI thread, so typically gets called
197 // indirectly by calling `dispatch_update_status.emmit()`
198 // from the compute thread, which calls this function.
199 void update_status();
200
201 // Run the TeX engine on a separate thread, then call
202 // `dispatch_refresh` to update the display.
203 void tex_run_async();
204
205 // Name and modification data.
206 void update_title();
207 void set_stop_sensitive(bool);
210
211 // Menu and button callbacks.
212 void on_file_new();
213 void on_file_open();
214 void on_file_close();
215 void on_file_save();
216 void on_file_save_as();
218 void on_file_export_html();
222 void on_file_quit();
223 bool quit_safeguard(bool quit);
224 bool on_first_redraw();
225
226 void on_edit_undo(const Glib::VariantBase&);
227 void on_edit_redo(const Glib::VariantBase&);
228 void on_edit_copy(const Glib::VariantBase&);
229 void on_edit_paste();
232 void on_edit_delete();
233 void on_edit_split();
237 void on_edit_find();
238
239 void on_view_split();
240 void on_view_close(const Glib::VariantBase&);
241
242 void on_run_cell();
243 void on_run_runtocursor();
244 void on_run_stop();
245
246 void on_prefs_set_cv(int vis);
247 void on_prefs_auto_close_latex(const Glib::VariantBase& vb);
248 void on_prefs_hide_input_cells(const Glib::VariantBase& vb);
249 void on_prefs_font_size(int num);
250 void on_prefs_highlight_syntax(bool on);
251 void on_prefs_microtex(bool on);
254
255 void on_tools_options();
257
258 void on_help_about();
259 void on_help() const;
260
261 void on_kernel_restart();
263
266
268 void on_clipboard_get(Gtk::SelectionData&, guint info);
269 void on_clipboard_clear();
271
272 // FIXME: move to DocumentThread
273 std::string save(const std::string& fn) const;
274
280 void process_todo_queue();
281
287
291
292 void on_crash_window_closed(int);
294
295 // The following are handlers that get called when the cell
296 // gets focus, the content of a cell is changed, the user
297 // requests to run it (shift-enter). The last two parameters are
298 // always the cell in the DTree and the canvas number.
299
300 bool cell_got_focus(DTree::iterator, int);
301 bool cell_toggle_visibility(DTree::iterator it, int);
302 bool cell_content_insert(const std::string&, int, DTree::iterator, int);
303 bool cell_content_erase(int, int, DTree::iterator, int);
304 bool cell_content_execute(DTree::iterator, bool shift_enter_pressed);
305 bool cell_content_changed(DTree::iterator it, int i);
306 bool cell_complete_request(DTree::iterator it, int pos, int i);
307
308 void interactive_execute();
309
310 void resize_codeinput_texview_all(int width);
311 void resize_codeinput_texview(DTree::iterator, int width);
312
313 // Handler for callbacks from TeXView cells.
314
315 bool on_tex_error(const std::string&, DTree::iterator);
316 bool on_copy_as_latex(const DTree::iterator it);
317
319
320 // Styling through CSS
321 void load_css();
322 Glib::RefPtr<Gtk::CssProvider> css_provider;
323 Glib::RefPtr<Gio::Settings> settings;
324 void on_text_scaling_factor_changed(const std::string& key);
325
327
328 // Mutex to protect the variables below.
329 std::recursive_mutex tex_need_width_mutex;
330 std::unique_ptr<std::thread> tex_thread;
333 std::string tex_error_string;
334
335 std::pair<DTree::iterator, size_t> last_find_location;
336 std::string last_find_string;
337
338 bool is_configured; // have received and handled a configure event
339 bool run_all_after_restart; // queue notebook running when kernel comes back
340
341 // We keep references to a few menu actions so we can
342 // enable/disable them at runtime.
343 Glib::RefPtr<Gio::SimpleAction> action_copy, action_undo, action_redo,
347
348 // Transition animations.
349#if GTKMM_MINOR_VERSION>=10
350 std::vector<Gtk::Revealer *> to_reveal;
351#endif
352 bool idle_handler();
353 };
354
355 };
int quit(void *)
Definition Server.cc:328
The Cadabra notebook application.
Definition Cadabra.hh:12
Base class which talks to the server and sends Action objects back to the DocumentThread.
Definition ComputeThread.hh:29
Definition Console.hh:15
Definition DataCell.hh:116
A base class with all the logic to manipulate a Cadabra notebook document.
Definition DocumentThread.hh:41
ComputeThread * compute
Definition DocumentThread.hh:160
Abstract base class with methods that need to be implemented by any GUI.
Definition GUIBase.hh:16
Each notebook has one main window which controls it.
Definition NotebookWindow.hh:41
void on_file_quit()
Definition NotebookWindow.cc:2596
virtual void load_from_string(const std::string &notebook_contents) override
Load a new notebook from a JSON string.
Definition NotebookWindow.cc:2308
void on_view_split()
Definition NotebookWindow.cc:2804
bool kernel_spinner_status
Definition NotebookWindow.hh:178
virtual void process_data() override
When the ComputeThread needs to modify the document, it stores an ActionBase object on the stack (see...
Definition NotebookWindow.cc:1161
virtual void set_compute_thread(ComputeThread *compute) override
Let the notebook know about the ComputeThread so that it can send cells for evaluation.
Definition NotebookWindow.cc:2919
bool cell_content_erase(int, int, DTree::iterator, int)
Definition NotebookWindow.cc:2075
Gtk::Box mainbox
Definition NotebookWindow.hh:154
void tex_run_async()
Definition NotebookWindow.cc:1224
std::unique_ptr< DiffViewer > diffviewer
Definition NotebookWindow.hh:165
bool on_copy_as_latex(const DTree::iterator it)
Definition NotebookWindow.cc:2182
Gtk::Label kernel_label
Definition NotebookWindow.hh:179
Glib::RefPtr< Gio::SimpleAction > action_fontsize
Definition NotebookWindow.hh:344
virtual void set_progress(const std::string &msg, int cur_step, int total_steps) override
Definition NotebookWindow.cc:1644
std::string progress_string
Definition NotebookWindow.hh:186
void on_tools_options()
Definition NotebookWindow.cc:3422
void on_file_export_html()
Definition NotebookWindow.cc:2433
virtual void on_connect() override
Network status is propagated from the ComputeThread to the GUI using the following methods.
Definition NotebookWindow.cc:1168
std::recursive_mutex tex_need_width_mutex
Definition NotebookWindow.hh:329
bool on_scroll_changed()
Definition NotebookWindow.cc:1965
void propagate_global_hide_flag()
Definition NotebookWindow.cc:3274
bool tex_running
Definition NotebookWindow.hh:331
double display_scale
Definition NotebookWindow.hh:71
Glib::RefPtr< Gtk::CssProvider > css_provider
Definition NotebookWindow.hh:322
void on_edit_copy(const Glib::VariantBase &)
Definition NotebookWindow.cc:2614
void compare_to_file()
Definition NotebookWindow.cc:3059
void on_scroll_size_allocate(Gtk::Allocation &)
Definition NotebookWindow.cc:1978
Glib::Dispatcher dispatch_update_status
Definition NotebookWindow.hh:193
virtual bool on_configure_event(GdkEventConfigure *cfg) override
Definition NotebookWindow.cc:1061
void on_crash_window_closed(int)
Definition NotebookWindow.cc:1329
void on_prefs_choose_colours()
Definition NotebookWindow.cc:3399
int status_col
Definition NotebookWindow.hh:188
void on_run_cell()
Definition NotebookWindow.cc:2825
void on_search_text_changed()
Search handling.
Definition NotebookWindow.cc:2729
int tex_need_width
Definition NotebookWindow.hh:332
int last_configure_width
Definition NotebookWindow.hh:326
void select_range(const DTree &, DTree::iterator, int start, int len)
Definition NotebookWindow.cc:1857
void process_todo_queue()
Todo deque processing logic.
Definition NotebookWindow.cc:1277
void on_edit_undo(const Glib::VariantBase &)
Definition NotebookWindow.cc:2604
void on_prefs_hide_input_cells(const Glib::VariantBase &vb)
Definition NotebookWindow.cc:3257
virtual void remove_cell(const DTree &, DTree::iterator) override
Remove a single cell together with all its child cells.
Definition NotebookWindow.cc:1678
double progress_frac
Definition NotebookWindow.hh:187
virtual size_t get_cursor_position(const DTree &, DTree::iterator) override
Retrieve the position of the cursor in the current cell.
Definition NotebookWindow.cc:1879
Gtk::Button tool_restart
Definition NotebookWindow.hh:151
Glib::RefPtr< Gio::SimpleActionGroup > actiongroup
Definition NotebookWindow.hh:145
void compare_git_latest()
Definition NotebookWindow.cc:3131
Glib::Dispatcher dispatcher
Definition NotebookWindow.hh:141
virtual bool on_unhandled_error(const std::exception &err) override
Definition NotebookWindow.cc:1105
void interactive_execute()
Definition NotebookWindow.cc:2116
void on_edit_find()
Definition NotebookWindow.cc:2721
Gtk::Box toolbar
Definition NotebookWindow.hh:149
std::string kernel_string
Definition NotebookWindow.hh:186
Glib::RefPtr< Gio::SimpleAction > action_undo
Definition NotebookWindow.hh:343
void handle_thread_tex_error()
Handle a TeX error which occurred on a threaded TeX run (activated by tex_run_async) and is stored in...
Definition NotebookWindow.cc:1098
bool read_only
Definition NotebookWindow.hh:209
DTree::iterator selected_cell
Definition NotebookWindow.hh:128
Gtk::Button tool_run
Definition NotebookWindow.hh:151
Glib::RefPtr< Gio::SimpleAction > action_paste
Definition NotebookWindow.hh:344
Gtk::Label status_label
Definition NotebookWindow.hh:179
Glib::RefPtr< Gio::SimpleAction > action_hide_input_cells
Definition NotebookWindow.hh:345
void on_edit_paste()
Definition NotebookWindow.cc:2626
void on_realize() override
Definition NotebookWindow.cc:80
Glib::RefPtr< Cadabra > cdbapp
Definition NotebookWindow.hh:133
void on_file_export_python()
Definition NotebookWindow.cc:2482
std::mutex status_mutex
Definition NotebookWindow.hh:185
Gtk::Label top_label
Definition NotebookWindow.hh:179
Gtk::SearchBar searchbar
Definition NotebookWindow.hh:155
void refresh_highlighting()
Definition NotebookWindow.cc:3528
std::string last_find_string
Definition NotebookWindow.hh:336
Gtk::ProgressBar progressbar
Definition NotebookWindow.hh:176
Gtk::CheckButton search_case_insensitive
Definition NotebookWindow.hh:158
void on_help_about()
Definition NotebookWindow.cc:2924
virtual void dim_output_cells(DTree::iterator it) override
Dim all output cells of the visual cells corresponding to the given document cell.
Definition NotebookWindow.cc:2088
void resize_codeinput_texview_all(int width)
Definition NotebookWindow.cc:1003
Gtk::Label search_result
Definition NotebookWindow.hh:159
void on_edit_insert_below()
Definition NotebookWindow.cc:2683
void on_edit_insert_above()
Definition NotebookWindow.cc:2667
void on_prefs_use_defaults()
Definition NotebookWindow.cc:3406
std::string run_git_command(const std::string &args)
Definition NotebookWindow.cc:3086
void on_help() const
Definition NotebookWindow.cc:2886
Glib::Dispatcher dispatch_tex_error
Definition NotebookWindow.hh:193
void on_edit_split()
Definition NotebookWindow.cc:2766
virtual bool on_key_press_event(GdkEventKey *) override
Definition NotebookWindow.cc:1334
std::string clipboard_cdb
Definition NotebookWindow.hh:270
void on_help_register()
Definition NotebookWindow.cc:2955
Gtk::Button tool_restart_and_run_all
Definition NotebookWindow.hh:151
void update_title()
Definition NotebookWindow.cc:1117
Gtk::Button tool_stop
Definition NotebookWindow.hh:151
std::vector< Glib::RefPtr< Gio::SimpleAction > > default_actions
Definition NotebookWindow.hh:135
std::unique_ptr< std::thread > tex_thread
Definition NotebookWindow.hh:330
void on_edit_delete()
Definition NotebookWindow.cc:2701
bool is_configured
Definition NotebookWindow.hh:338
void on_edit_redo(const Glib::VariantBase &)
Definition NotebookWindow.cc:2609
void on_clipboard_get(Gtk::SelectionData &, guint info)
Clipboard handling.
Definition NotebookWindow.cc:3622
Gtk::Paned dragbox
Definition NotebookWindow.hh:153
std::string clipboard_txt
Definition NotebookWindow.hh:270
void on_prefs_microtex(bool on)
Definition NotebookWindow.cc:3367
void on_prefs_highlight_syntax(bool on)
Definition NotebookWindow.cc:3335
Gtk::Box supermainbox
Definition NotebookWindow.hh:152
void on_file_save_as_jupyter()
Definition NotebookWindow.cc:2400
virtual void position_cursor(const DTree &, DTree::iterator, int pos) override
Position the cursor in the current canvas in the widget corresponding to the indicated cell.
Definition NotebookWindow.cc:1812
Glib::RefPtr< Gio::SimpleAction > action_copy
Definition NotebookWindow.hh:343
bool on_first_redraw()
Definition NotebookWindow.cc:2329
void set_stop_sensitive(bool)
Definition NotebookWindow.cc:1153
void on_clipboard_clear()
Definition NotebookWindow.cc:3635
void unselect_output_cell()
Definition NotebookWindow.cc:3547
std::string tex_error_string
Definition NotebookWindow.hh:333
void scroll_cell_into_view(DTree::iterator cell)
Definition NotebookWindow.cc:1900
void on_file_export_latex()
Definition NotebookWindow.cc:2454
void on_run_stop()
Definition NotebookWindow.cc:2855
double scale
Definition NotebookWindow.hh:70
void on_prefs_font_size(int num)
Definition NotebookWindow.cc:3299
std::pair< DTree::iterator, size_t > last_find_location
Definition NotebookWindow.hh:335
void select_git_path()
Functionality for the diff viewer.
Definition NotebookWindow.cc:3049
void on_text_scaling_factor_changed(const std::string &key)
Definition NotebookWindow.cc:3026
bool crash_window_hidden
Definition NotebookWindow.hh:293
std::vector< NotebookCanvas * > canvasses
Definition NotebookWindow.hh:169
virtual void on_disconnect(const std::string &) override
Definition NotebookWindow.cc:1193
bool cell_complete_request(DTree::iterator it, int pos, int i)
Definition NotebookWindow.cc:2123
void on_ignore_cell_on_import()
Definition NotebookWindow.cc:2784
void on_prefs_auto_close_latex(const Glib::VariantBase &vb)
Definition NotebookWindow.cc:3245
virtual void on_interactive_output(const nlohmann::json &msg) override
Definition NotebookWindow.cc:1639
void on_file_new()
Definition NotebookWindow.cc:2242
void refresh_after_tex_engine_run()
Refresh the display after a TeX engine run has completed.
Definition NotebookWindow.cc:1092
Glib::RefPtr< Gio::SimpleAction > action_redo
Definition NotebookWindow.hh:343
bool quit_safeguard(bool quit)
Definition NotebookWindow.cc:2558
virtual void on_network_error() override
Definition NotebookWindow.cc:1201
void on_outbox_copy(Glib::RefPtr< Gtk::Clipboard > refClipboard, DTree::iterator it)
Definition NotebookWindow.cc:3587
virtual bool on_delete_event(GdkEventAny *) override
Definition NotebookWindow.cc:950
TeXEngine engine
Definition NotebookWindow.hh:69
void on_edit_cell_is_python()
Definition NotebookWindow.cc:2773
Glib::RefPtr< Gio::SimpleAction > action_console
Definition NotebookWindow.hh:346
std::string save(const std::string &fn) const
Definition NotebookWindow.cc:2533
void on_kernel_restart()
Definition NotebookWindow.cc:2861
bool run_all_after_restart
Definition NotebookWindow.hh:339
void on_prefs_set_cv(int vis)
Definition NotebookWindow.cc:960
Glib::RefPtr< Gtk::Builder > uimanager
Definition NotebookWindow.hh:146
void on_file_save()
Definition NotebookWindow.cc:2340
void scroll_current_cell_into_view()
Definition NotebookWindow.cc:1892
Gtk::Button tool_save_as
Definition NotebookWindow.hh:150
void on_run_runtocursor()
Definition NotebookWindow.cc:2838
Gtk::Button tool_run_to
Definition NotebookWindow.hh:151
void on_file_save_as()
Definition NotebookWindow.cc:2363
void on_kernel_restart_and_run_all()
Definition NotebookWindow.cc:2879
bool idle_handler()
Definition NotebookWindow.cc:3536
Gtk::Button tool_save
Definition NotebookWindow.hh:150
void compare_git_choose()
Definition NotebookWindow.cc:3163
void set_title_prefix(const std::string &)
Definition NotebookWindow.cc:1112
bool cell_got_focus(DTree::iterator, int)
Definition NotebookWindow.cc:2105
bool on_tex_error(const std::string &, DTree::iterator)
Definition NotebookWindow.cc:2189
Gtk::SearchEntry searchentry
Definition NotebookWindow.hh:157
bool modified
Definition NotebookWindow.hh:209
void update_status()
Definition NotebookWindow.cc:1660
Gtk::Dialog console_win
Definition NotebookWindow.hh:163
void on_edit_cell_is_latex()
Definition NotebookWindow.cc:2793
bool cell_toggle_visibility(DTree::iterator it, int)
Definition NotebookWindow.cc:1995
Glib::RefPtr< Gio::SimpleAction > action_highlight
Definition NotebookWindow.hh:344
void on_view_close(const Glib::VariantBase &)
Definition NotebookWindow.cc:2814
Console console
Definition NotebookWindow.hh:162
int status_line
Definition NotebookWindow.hh:188
Glib::RefPtr< Gio::SimpleAction > action_stop
Definition NotebookWindow.hh:346
void on_tools_clear_cache()
Definition NotebookWindow.cc:3510
Gtk::Box search_hbox
Definition NotebookWindow.hh:156
void compare_git_specific()
Definition NotebookWindow.cc:3218
bool handle_outbox_select(GdkEventButton *, DTree::iterator it)
Definition NotebookWindow.cc:3562
virtual void update_cell(const DTree &, DTree::iterator) override
The basic manipulations that a GUI needs to implement are adding, removing and updating (refreshing t...
Definition NotebookWindow.cc:1778
std::string name
Definition NotebookWindow.hh:208
void on_slider_changed(std::string variable, double value)
Definition NotebookWindow.cc:1972
void set_statusbar_message(const std::string &message="", int line=-1, int col=-1)
Definition NotebookWindow.cc:1142
bool cell_content_execute(DTree::iterator, bool shift_enter_pressed)
Definition NotebookWindow.cc:2142
virtual void add_cell(const DTree &, DTree::iterator, bool) override
Add a GUI cell corresponding to the document cell at the iterator.
Definition NotebookWindow.cc:1398
bool cell_content_changed(DTree::iterator it, int i)
Definition NotebookWindow.cc:2052
~NotebookWindow()
Definition NotebookWindow.cc:871
Glib::RefPtr< Gio::SimpleAction > action_microtex
Definition NotebookWindow.hh:346
Gtk::Button tool_open
Definition NotebookWindow.hh:150
std::string geometry_string
Definition NotebookWindow.hh:208
void compare_git(const std::string &commit_hash)
Definition NotebookWindow.cc:3113
void on_file_open()
Definition NotebookWindow.cc:2269
std::string status_string
Definition NotebookWindow.hh:186
virtual void on_kernel_runstatus(bool) override
Definition NotebookWindow.cc:1208
void on_file_export_html_segment()
Definition NotebookWindow.cc:2506
Glib::Dispatcher dispatch_refresh
Definition NotebookWindow.hh:193
Gtk::Spinner kernel_spinner
Definition NotebookWindow.hh:177
Glib::RefPtr< Gio::Settings > settings
Definition NotebookWindow.hh:323
virtual void hide_visual_cells(DTree::iterator it) override
Hide all visual cells (on all canvasses) corresponding to a given document cell.
Definition NotebookWindow.cc:2168
Gtk::Box statusbarbox
Definition NotebookWindow.hh:160
void on_file_close()
Definition NotebookWindow.cc:2255
Glib::RefPtr< Gio::SimpleAction > action_view_close
Definition NotebookWindow.hh:344
bool cell_content_insert(const std::string &, int, DTree::iterator, int)
Definition NotebookWindow.cc:2063
void load_css()
Definition NotebookWindow.cc:875
int current_canvas
Definition NotebookWindow.hh:170
Glib::RefPtr< Gio::SimpleAction > action_auto_close_latex
Definition NotebookWindow.hh:345
std::string title_prefix
Definition NotebookWindow.hh:208
void set_name(const std::string &)
Definition NotebookWindow.cc:2302
void resize_codeinput_texview(DTree::iterator, int width)
Definition NotebookWindow.cc:1016
Glib::RefPtr< Gio::SimpleAction > action_register
Definition NotebookWindow.hh:346
virtual void remove_all_cells() override
Remove all GUI cells from the display (used as a quick way to clear all before loading a new document...
Definition NotebookWindow.cc:1759
Gtk::Box topbox
Definition NotebookWindow.hh:148
TeXEngine is used to convert LaTeX strings into PNG images.
Definition TeXEngine.hh:23
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