4 #include <gtkmm/window.h> 6 #include <gtkmm/progressbar.h> 7 #include <gtkmm/spinner.h> 8 #include <gtkmm/label.h> 9 #include <gtkmm/stock.h> 10 #include <gtkmm/button.h> 11 #include <gtkmm/uimanager.h> 12 #include <gtkmm/cssprovider.h> 13 #include <glibmm/dispatcher.h> 14 #include <giomm/settings.h> 15 #include <gtkmm/action.h> 20 #include "nlohmann/json.hpp" 27 #include "../common/TeXEngine.hh" 46 virtual void add_cell(
const DTree&, DTree::iterator,
bool)
override;
95 void load_file(
const std::string& notebook_contents);
122 void on_outbox_copy(Glib::RefPtr<Gtk::Clipboard> refClipboard, DTree::iterator it);
241 std::string
save(
const std::string& fn)
const;
289 #if GTKMM_MINOR_VERSION>=10 290 std::vector<Gtk::Revealer *> to_reveal;
Gtk::CheckButton search_case_insensitive
Definition: NotebookWindow.hh:147
void dim_output_cells(DTree::iterator it)
Definition: NotebookWindow.cc:1268
void on_run_cell()
Definition: NotebookWindow.cc:1880
void on_file_new()
Definition: NotebookWindow.cc:1387
bool kernel_spinner_status
Definition: NotebookWindow.hh:167
Abstract base class with methods that need to be implemented by any GUI.
Definition: GUIBase.hh:16
void on_edit_paste()
Definition: NotebookWindow.cc:1722
bool on_scroll(GdkEventScroll *)
Definition: NotebookWindow.cc:1177
ComputeThread * compute
Definition: DocumentThread.hh:126
Gtk::Label status_label
Definition: NotebookWindow.hh:168
bool cell_got_focus(DTree::iterator, int)
Definition: NotebookWindow.cc:1285
void on_crash_window_closed(int)
Definition: NotebookWindow.cc:706
virtual void on_interactive_output(const nlohmann::json &msg) override
Definition: NotebookWindow.cc:937
bool cell_complete_request(DTree::iterator it, int pos, int i)
Definition: NotebookWindow.cc:1300
void on_file_open()
Definition: NotebookWindow.cc:1414
void refresh_highlighting()
Definition: NotebookWindow.cc:2498
std::string save(const std::string &fn) const
Definition: NotebookWindow.cc:1635
void on_file_export_html()
Definition: NotebookWindow.cc:1549
void on_search_text_changed()
Search handling.
Definition: NotebookWindow.cc:1784
void on_file_save_as()
Definition: NotebookWindow.cc:1482
std::vector< NotebookCanvas * > canvasses
Definition: NotebookWindow.hh:158
void on_edit_copy()
Definition: NotebookWindow.cc:1711
void set_stop_sensitive(bool)
Definition: NotebookWindow.cc:609
std::mutex status_mutex
Definition: NotebookWindow.hh:174
Console console
Definition: NotebookWindow.hh:151
void on_file_export_latex()
Definition: NotebookWindow.cc:1569
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:767
Definition: Console.hh:27
Glib::RefPtr< Gtk::Action > action_paste
Definition: NotebookWindow.hh:199
A base class with all the logic to manipulate a Cadabra notebook document.
Definition: DocumentThread.hh:40
void on_clipboard_clear()
Definition: NotebookWindow.cc:2593
void on_file_export_python()
Definition: NotebookWindow.cc:1592
std::vector< Glib::RefPtr< Gtk::Action > > default_actions
Definition: NotebookWindow.hh:127
virtual bool on_key_press_event(GdkEventKey *) override
Definition: NotebookWindow.cc:711
bool cell_content_changed(DTree::iterator it, int i)
Definition: NotebookWindow.cc:1231
virtual size_t get_cursor_position(const DTree &, DTree::iterator) override
Retrieve the position of the cursor in the current cell.
Definition: NotebookWindow.cc:1094
Glib::RefPtr< Gtk::CssProvider > css_provider
Definition: NotebookWindow.hh:274
void on_edit_find()
Definition: NotebookWindow.cc:1776
bool on_vscroll_changed(Gtk::ScrollType, double)
Definition: NotebookWindow.cc:1162
virtual void on_kernel_runstatus(bool) override
Definition: NotebookWindow.cc:651
int quit(void *)
Definition: Server.cc:241
The Cadabra notebook application.
Definition: Cadabra.hh:11
void on_edit_undo()
Definition: NotebookWindow.cc:1706
Gtk::SearchEntry searchentry
Definition: NotebookWindow.hh:146
void on_tools_clear_cache()
Definition: NotebookWindow.cc:2480
Cadabra * cdbapp
Definition: NotebookWindow.hh:125
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:617
void on_edit_cell_is_python()
Definition: NotebookWindow.cc:1828
void unselect_output_cell()
Definition: NotebookWindow.cc:2517
void on_file_quit()
Definition: NotebookWindow.cc:1698
void compare_git_choose()
Definition: NotebookWindow.cc:2201
Gtk::HBox search_hbox
Definition: NotebookWindow.hh:145
Glib::RefPtr< Gtk::Action > action_copy
Definition: NotebookWindow.hh:199
Glib::RefPtr< Gio::Settings > settings
Definition: NotebookWindow.hh:275
void on_run_runall()
Definition: NotebookWindow.cc:1893
void on_file_close()
Definition: NotebookWindow.cc:1400
void on_ignore_cell_on_import()
Definition: NotebookWindow.cc:1839
bool quit_safeguard(bool quit)
Definition: NotebookWindow.cc:1660
void select_git_path()
Functionality for the diff viewer.
Definition: NotebookWindow.cc:2087
virtual void remove_cell(const DTree &, DTree::iterator) override
Remove a single cell together with all its child cells.
Definition: NotebookWindow.cc:942
void select_range(const DTree &, DTree::iterator, int start, int len)
Definition: NotebookWindow.cc:1072
void scroll_cell_into_view(DTree::iterator cell)
Definition: NotebookWindow.cc:1113
Gtk::ProgressBar progressbar
Definition: NotebookWindow.hh:165
NotebookWindow(Cadabra *, bool read_only=false)
Definition: NotebookWindow.cc:34
std::string title_prefix
Definition: NotebookWindow.hh:180
void on_scroll_size_allocate(Gtk::Allocation &)
Definition: NotebookWindow.cc:1186
Glib::RefPtr< Gtk::ActionGroup > actiongroup
Definition: NotebookWindow.hh:137
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:1961
virtual void on_network_error() override
Definition: NotebookWindow.cc:644
std::string clipboard_txt
Definition: NotebookWindow.hh:238
bool cell_content_execute(DTree::iterator, int, bool shift_enter_pressed)
Definition: NotebookWindow.cc:1319
void on_prefs_font_size(int num)
Definition: NotebookWindow.cc:2290
int current_canvas
Definition: NotebookWindow.hh:159
void on_help() const
Definition: NotebookWindow.cc:1929
void load_css()
Definition: NotebookWindow.cc:454
void on_prefs_highlight_syntax(bool on)
Definition: NotebookWindow.cc:2338
void on_prefs_use_defaults()
Definition: NotebookWindow.cc:2376
double scale
Definition: NotebookWindow.hh:64
Glib::RefPtr< Gtk::UIManager > uimanager
Definition: NotebookWindow.hh:138
void on_file_save()
Definition: NotebookWindow.cc:1462
void on_outbox_copy(Glib::RefPtr< Gtk::Clipboard > refClipboard, DTree::iterator it)
Definition: NotebookWindow.cc:2555
virtual bool on_delete_event(GdkEventAny *) override
Definition: NotebookWindow.cc:517
TeXEngine is used to convert LaTeX strings into PNG images.
Definition: TeXEngine.hh:23
bool handle_outbox_select(GdkEventButton *, DTree::iterator it)
Definition: NotebookWindow.cc:2531
~NotebookWindow()
Definition: NotebookWindow.cc:450
Gtk::HBox statusbarbox
Definition: NotebookWindow.hh:149
int last_configure_width
Definition: NotebookWindow.hh:278
Gtk::Label search_result
Definition: NotebookWindow.hh:148
Functions to handle the exchange properties of two or more symbols in a product.
Definition: Adjform.cc:83
void compare_git_latest()
Definition: NotebookWindow.cc:2169
void on_run_stop()
Definition: NotebookWindow.cc:1917
bool read_only
Definition: NotebookWindow.hh:181
void on_edit_delete()
Definition: NotebookWindow.cc:1758
void on_prefs_choose_colours()
Definition: NotebookWindow.cc:2369
void on_tools_options()
Definition: NotebookWindow.cc:2392
void on_clipboard_get(Gtk::SelectionData &, guint info)
Clipboard handling.
Definition: NotebookWindow.cc:2582
void compare_git_specific()
Definition: NotebookWindow.cc:2263
Gtk::SearchBar searchbar
Definition: NotebookWindow.hh:144
void set_title_prefix(const std::string &)
Definition: NotebookWindow.cc:588
DTree::iterator follow_cell
Definition: NotebookWindow.hh:279
std::string kernel_string
Definition: NotebookWindow.hh:175
Gtk::Label kernel_label
Definition: NotebookWindow.hh:168
Gtk::VBox mainbox
Definition: NotebookWindow.hh:142
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:1031
Glib::RefPtr< Gtk::Action > menu_help_register
Definition: NotebookWindow.hh:286
void on_run_runtocursor()
Definition: NotebookWindow.cc:1905
void on_help_about()
Definition: NotebookWindow.cc:1967
std::string run_git_command(const std::string &args)
Definition: NotebookWindow.cc:2124
std::pair< DTree::iterator, size_t > last_find_location
Definition: NotebookWindow.hh:281
bool on_tex_error(const std::string &, DTree::iterator)
Definition: NotebookWindow.cc:1359
void on_kernel_restart()
Definition: NotebookWindow.cc:1922
void load_file(const std::string ¬ebook_contents)
Definition: NotebookWindow.cc:1453
std::unique_ptr< DiffViewer > diffviewer
Definition: NotebookWindow.hh:154
double display_scale
Definition: NotebookWindow.hh:65
void on_help_register()
Definition: NotebookWindow.cc:1997
const char info[]
Definition: Snoop.hh:336
void on_text_scaling_factor_changed(const std::string &key)
Definition: NotebookWindow.cc:2065
void process_todo_queue()
Todo deque processing logic.
Definition: NotebookWindow.cc:658
tree< DataCell > DTree
Definition: DataCell.hh:108
Gtk::VBox topbox
Definition: NotebookWindow.hh:140
virtual void on_connect() override
Network status is propagated from the ComputeThread to the GUI using the following methods...
Definition: NotebookWindow.cc:623
void on_edit_cell_is_latex()
Definition: NotebookWindow.cc:1848
std::string last_find_string
Definition: NotebookWindow.hh:282
Gtk::Spinner kernel_spinner
Definition: NotebookWindow.hh:166
Base class which talks to the server and sends Action objects back to the DocumentThread.
Definition: ComputeThread.hh:35
virtual bool on_configure_event(GdkEventConfigure *cfg) override
Definition: NotebookWindow.cc:563
void on_view_close()
Definition: NotebookWindow.cc:1869
void compare_git(const std::string &commit_hash)
Definition: NotebookWindow.cc:2151
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:1047
DTree::iterator current_cell
Definition: NotebookWindow.hh:117
bool idle_handler()
Definition: NotebookWindow.cc:2506
void update_title()
Definition: NotebookWindow.cc:593
bool cell_content_insert(const std::string &, int, DTree::iterator, int)
Definition: NotebookWindow.cc:1242
bool modified
Definition: NotebookWindow.hh:181
void compare_to_file()
Definition: NotebookWindow.cc:2097
void on_file_save_as_jupyter()
Definition: NotebookWindow.cc:1516
std::string status_string
Definition: NotebookWindow.hh:175
void on_edit_insert_below()
Definition: NotebookWindow.cc:1742
std::string name
Definition: NotebookWindow.hh:180
Gtk::Dialog console_win
Definition: NotebookWindow.hh:152
TeXEngine engine
Definition: NotebookWindow.hh:63
void on_edit_insert_above()
Definition: NotebookWindow.cc:1726
void on_file_export_html_segment()
Definition: NotebookWindow.cc:1612
DTree::iterator selected_cell
Definition: NotebookWindow.hh:120
Glib::Dispatcher dispatcher
Definition: NotebookWindow.hh:133
virtual void on_disconnect(const std::string &) override
Definition: NotebookWindow.cc:637
void on_edit_split()
Definition: NotebookWindow.cc:1821
std::string clipboard_cdb
Definition: NotebookWindow.hh:238
void on_view_split()
Definition: NotebookWindow.cc:1859
void scroll_current_cell_into_view()
Definition: NotebookWindow.cc:1107
Each notebook has one main window which controls it.
Definition: NotebookWindow.hh:39
bool is_configured
Definition: NotebookWindow.hh:284
bool cell_toggle_visibility(DTree::iterator it, int)
Definition: NotebookWindow.cc:1203
bool crash_window_hidden
Definition: NotebookWindow.hh:249
void interactive_execute()
Definition: NotebookWindow.cc:1295
void on_prefs_set_cv(int vis)
Definition: NotebookWindow.cc:527
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:1021
bool cell_content_erase(int, int, DTree::iterator, int)
Definition: NotebookWindow.cc:1255
void set_name(const std::string &)
Definition: NotebookWindow.cc:1447
Gtk::HBox supermainbox
Definition: NotebookWindow.hh:141