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>
24 #include "../common/TeXEngine.hh"
46 virtual void add_cell(
const DTree&, DTree::iterator,
bool)
override;
89 void load_file(
const std::string& notebook_contents);
102 void on_outbox_copy(Glib::RefPtr<Gtk::Clipboard> refClipboard, DTree::iterator it);
196 std::string
save(
const std::string& fn)
const;
245 #if GTKMM_MINOR_VERSION>=10
246 std::vector<Gtk::Revealer *> to_reveal;
bool handle_outbox_select(GdkEventButton *, DTree::iterator it)
Definition: NotebookWindow.cc:1597
DTree::iterator selected_cell
Definition: NotebookWindow.hh:100
void dim_output_cells(DTree::iterator it)
Definition: NotebookWindow.cc:934
NotebookWindow(Cadabra *, bool read_only=false)
Definition: NotebookWindow.cc:27
bool on_scroll(GdkEventScroll *)
Definition: NotebookWindow.cc:833
std::string clipboard_txt
Definition: NotebookWindow.hh:193
TeXEngine engine
Definition: NotebookWindow.hh:61
void on_file_open()
Definition: NotebookWindow.cc:1047
bool cell_content_erase(int, int, DTree::iterator, int)
Definition: NotebookWindow.cc:921
Cadabra * cdbapp
Definition: NotebookWindow.hh:105
virtual size_t get_cursor_position(const DTree &, DTree::iterator) override
Retrieve the position of the cursor in the current cell.
Definition: NotebookWindow.cc:771
A base class with all the logic to manipulate a Cadabra notebook document.
Definition: DocumentThread.hh:38
void on_edit_paste()
Definition: NotebookWindow.cc:1314
bool modified
Definition: NotebookWindow.hh:149
Glib::Dispatcher dispatcher
Definition: NotebookWindow.hh:111
virtual void on_disconnect(const std::string &) override
Definition: NotebookWindow.cc:409
void unselect_output_cell()
Definition: NotebookWindow.cc:1583
void on_view_split()
Definition: NotebookWindow.cc:1385
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:396
void on_file_quit()
Definition: NotebookWindow.cc:1290
int last_configure_width
Definition: NotebookWindow.hh:230
std::vector< NotebookCanvas * > canvasses
Definition: NotebookWindow.hh:126
bool cell_content_execute(DTree::iterator, int, bool shift_enter_pressed)
Definition: NotebookWindow.cc:961
bool quit_safeguard(bool quit)
Definition: NotebookWindow.cc:1252
Gtk::Spinner kernel_spinner
Definition: NotebookWindow.hh:134
Prefs()
Definition: NotebookWindow.cc:22
void on_file_save_as()
Definition: NotebookWindow.cc:1113
virtual void on_kernel_runstatus(bool) override
Definition: NotebookWindow.cc:423
bool on_tex_error(const std::string &, DTree::iterator)
Definition: NotebookWindow.cc:1000
void on_run_stop()
Definition: NotebookWindow.cc:1435
void on_file_export_python()
Definition: NotebookWindow.cc:1184
Glib::RefPtr< Gtk::ActionGroup > actiongroup
Definition: NotebookWindow.hh:115
Prefs prefs
Definition: NotebookWindow.hh:240
std::mutex status_mutex
Definition: NotebookWindow.hh:142
void on_clipboard_clear()
Definition: NotebookWindow.cc:1657
~NotebookWindow()
Definition: NotebookWindow.cc:329
Gtk::Label kernel_label
Definition: NotebookWindow.hh:136
Gtk::ProgressBar progressbar
Definition: NotebookWindow.hh:133
void on_scroll_size_allocate(Gtk::Allocation &)
Definition: NotebookWindow.cc:842
void on_crash_window_closed(int)
Definition: NotebookWindow.cc:473
void on_file_export_latex()
Definition: NotebookWindow.cc:1164
bool cell_toggle_visibility(DTree::iterator it, int)
Definition: NotebookWindow.cc:859
void on_file_close()
Definition: NotebookWindow.cc:1041
double scale
Definition: NotebookWindow.hh:62
virtual bool on_key_press_event(GdkEventKey *) override
Definition: NotebookWindow.cc:478
int quit(void *)
Definition: Server.cc:246
void on_edit_insert_above()
Definition: NotebookWindow.cc:1318
bool read_only
Definition: NotebookWindow.hh:149
void load_file(const std::string ¬ebook_contents)
Definition: NotebookWindow.cc:1084
void on_file_new()
Definition: NotebookWindow.cc:1028
virtual bool on_configure_event(GdkEventConfigure *cfg) override
Definition: NotebookWindow.cc:342
virtual void remove_cell(const DTree &, DTree::iterator) override
Remove a single cell.
Definition: NotebookWindow.cc:678
bool cell_content_changed(const std::string &content, DTree::iterator it, int canvas_number)
Definition: NotebookWindow.cc:887
DTree::iterator follow_cell
Definition: NotebookWindow.hh:231
int font_step
Definition: NotebookWindow.hh:237
std::string kernel_string
Definition: NotebookWindow.hh:143
The Cadabra notebook application.
Definition: Cadabra.hh:11
Abstract base class with methods that need to be implemented by any GUI.
Definition: GUIBase.hh:16
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:746
Definition: NotebookWindow.hh:233
Each notebook has one main window which controls it.
Definition: NotebookWindow.hh:39
void setup_css_provider()
void set_name(const std::string &)
Definition: NotebookWindow.cc:1078
void on_kernel_restart()
Definition: NotebookWindow.cc:1440
bool kernel_spinner_status
Definition: NotebookWindow.hh:135
Glib::RefPtr< Gtk::Action > action_paste
Definition: NotebookWindow.hh:166
DTree::iterator current_cell
Definition: NotebookWindow.hh:97
TeXEngine is used to convert LaTeX strings into PNG images.
Definition: TeXEngine.hh:26
bool on_vscroll_changed(Gtk::ScrollType, double)
Definition: NotebookWindow.cc:818
Gtk::Label status_label
Definition: NotebookWindow.hh:136
void on_edit_delete()
Definition: NotebookWindow.cc:1340
std::string clipboard_cdb
Definition: NotebookWindow.hh:193
Gtk::VBox mainbox
Definition: NotebookWindow.hh:120
void on_edit_cell_is_python()
Definition: NotebookWindow.cc:1365
Glib::RefPtr< Gtk::CssProvider > css_provider
Definition: NotebookWindow.hh:226
void set_title_prefix(const std::string &)
Definition: NotebookWindow.cc:367
void on_file_save()
Definition: NotebookWindow.cc:1093
bool is_configured
Definition: NotebookWindow.hh:241
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:732
void on_view_close()
Definition: NotebookWindow.cc:1395
Glib::RefPtr< Gtk::Action > action_copy
Definition: NotebookWindow.hh:166
virtual bool on_delete_event(GdkEventAny *) override
Definition: NotebookWindow.cc:333
void process_todo_queue()
Definition: NotebookWindow.cc:430
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:722
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:502
const char info[]
Definition: Snoop.hh:154
int current_canvas
Definition: NotebookWindow.hh:127
bool crash_window_hidden
Definition: NotebookWindow.hh:204
bool cell_got_focus(DTree::iterator, int)
Definition: NotebookWindow.cc:951
tree< DataCell > DTree
Definition: DataCell.hh:106
void on_edit_copy()
Definition: NotebookWindow.cc:1303
bool cell_content_insert(const std::string &, int, DTree::iterator, int)
Definition: NotebookWindow.cc:908
void scroll_current_cell_into_view()
Definition: NotebookWindow.cc:784
Glib::RefPtr< Gtk::UIManager > uimanager
Definition: NotebookWindow.hh:116
void on_clipboard_get(Gtk::SelectionData &, guint info)
Clipboard handling.
Definition: NotebookWindow.cc:1646
Gtk::HBox supermainbox
Definition: NotebookWindow.hh:119
std::string save(const std::string &fn) const
Definition: NotebookWindow.cc:1227
void on_run_cell()
Definition: NotebookWindow.cc:1406
void on_file_export_html_segment()
Definition: NotebookWindow.cc:1204
void set_stop_sensitive(bool)
Definition: NotebookWindow.cc:388
void on_edit_undo()
Definition: NotebookWindow.cc:1298
virtual void on_network_error() override
Definition: NotebookWindow.cc:416
void on_prefs_font_size(int num)
Definition: NotebookWindow.cc:1524
void on_file_export_html()
Definition: NotebookWindow.cc:1144
Gtk::HBox statusbarbox
Definition: NotebookWindow.hh:122
void on_help_about()
Definition: NotebookWindow.cc:1480
void on_edit_cell_is_latex()
Definition: NotebookWindow.cc:1375
void on_outbox_copy(Glib::RefPtr< Gtk::Clipboard > refClipboard, DTree::iterator it)
Definition: NotebookWindow.cc:1619
std::string title_prefix
Definition: NotebookWindow.hh:148
void on_text_scaling_factor_changed(const std::string &key)
Definition: NotebookWindow.cc:1507
void on_run_runtocursor()
Definition: NotebookWindow.cc:1431
void on_run_runall()
Definition: NotebookWindow.cc:1419
void on_edit_split()
Definition: NotebookWindow.cc:1358
virtual void on_connect() override
Network status is propagated from the ComputeThread to the.
Definition: NotebookWindow.cc:402
void on_help() const
Definition: NotebookWindow.cc:1447
std::string name
Definition: NotebookWindow.hh:148
std::string status_string
Definition: NotebookWindow.hh:143
Glib::RefPtr< Gio::Settings > settings
Definition: NotebookWindow.hh:227
Gtk::VBox topbox
Definition: NotebookWindow.hh:118
void on_edit_insert_below()
Definition: NotebookWindow.cc:1329
void update_title()
Definition: NotebookWindow.cc:372
bool idle_handler()
Definition: NotebookWindow.cc:1572