GNU Octave 7.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
event-manager.h
Go to the documentation of this file.
1////////////////////////////////////////////////////////////////////////
2//
3// Copyright (C) 2011-2022 The Octave Project Developers
4//
5// See the file COPYRIGHT.md in the top-level directory of this
6// distribution or <https://octave.org/copyright/>.
7//
8// This file is part of Octave.
9//
10// Octave is free software: you can redistribute it and/or modify it
11// under the terms of the GNU General Public License as published by
12// the Free Software Foundation, either version 3 of the License, or
13// (at your option) any later version.
14//
15// Octave is distributed in the hope that it will be useful, but
16// WITHOUT ANY WARRANTY; without even the implied warranty of
17// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18// GNU General Public License for more details.
19//
20// You should have received a copy of the GNU General Public License
21// along with Octave; see the file COPYING. If not, see
22// <https://www.gnu.org/licenses/>.
23//
24////////////////////////////////////////////////////////////////////////
25
26#if ! defined (octave_event_manager_h)
27#define octave_event_manager_h 1
28
29#include "octave-config.h"
30
31#include <functional>
32#include <list>
33#include <memory>
34#include <stack>
35#include <string>
36
37#include "oct-mutex.h"
38#include "octave.h"
39#include "event-queue.h"
40#include "uint8NDArray.h"
41
42class octave_value;
43class string_vector;
44
45OCTAVE_NAMESPACE_BEGIN
46
47 typedef std::function<void (void)> fcn_callback;
48 typedef std::function<void (interpreter&)> meth_callback;
49
51 class symbol_info_list;
52
53 // The methods in this class provide a way to pass signals to the GUI
54 // thread. A GUI that wishes to act on these events should derive
55 // from this class and perform actions in a thread-safe way. In
56 // Octave's Qt-based GUI, for example, these functions are all
57 // implemented as wrappers around Qt signals that trigger actions in
58 // the GUI. The Qt signal/slot mechanism ensures that the actions are
59 // properly queued for execution when the objects corresponding to the
60 // signal and slot belong to different threads.
61 //
62 // These functions should not be called directly. Instead all
63 // requests from the interpreter for GUI actions should be done
64 // through the event_manager class. That class checks to ensure that
65 // the GUI is connected and enabled before calling these virtual
66 // functions.
67
68 // FIXME: it would be nice if instead of requiring the GUI to derive
69 // from this class, it could subscribe to individual events, possibly
70 // multiple times. In that way, it would be more flexible and
71 // decentralized, similar to the Qt signal/slot connection mechanism
72 // and would allow the GUI to connect multiple signals to a single
73 // action or multiple actions to a single signal.
74
75 // FIXME: audit this list of functions and determine whether they are
76 // all necessary and whether there might be better names for them.
77
78 class OCTINTERP_API interpreter_events
79 {
80 public:
81
82 interpreter_events (void) = default;
83
85
86 interpreter_events& operator = (const interpreter_events&) = default;
87
88 virtual ~interpreter_events (void) = default;
89
90 // Note: START_GUI and CLOSE_GUI currently only work with the new
91 // experimental terminal widget.
92
93 // Set GUI_APP to true when starting Octave as a gui application
94 // (invoked with the --gui option) and false when starting the GUI
95 // from the Octave prompt when Octave is already running as a
96 // command line application.
97
98 virtual void start_gui (bool /*gui_app*/ = false) { }
99 virtual void close_gui (void) { }
100
101 // Dialogs.
102
103 virtual bool have_dialogs (void) const { return false; }
104
105 typedef std::list<std::pair<std::string, std::string>> filter_list;
106
107 virtual std::list<std::string>
108 file_dialog (const filter_list& /*filter*/,
109 const std::string& /*title*/,
110 const std::string& /*filename*/,
111 const std::string& /*dirname*/,
112 const std::string& /*multimode*/)
113 {
114 return std::list<std::string> ();
115 }
116
117 virtual std::list<std::string>
118 input_dialog (const std::list<std::string>& /*prompt*/,
119 const std::string& /*title*/,
120 const std::list<float>& /*nr*/,
121 const std::list<float>& /*nc*/,
122 const std::list<std::string>& /*defaults*/)
123 {
124 return std::list<std::string> ();
125 }
126
127 virtual std::pair<std::list<int>, int>
128 list_dialog (const std::list<std::string>& /*list*/,
129 const std::string& /*mode*/, int /*width*/, int /*height*/,
130 const std::list<int>& /*initial_value*/,
131 const std::string& /*name*/,
132 const std::list<std::string>& /*prompt*/,
133 const std::string& /*ok_string*/,
134 const std::string& /*cancel_string*/)
135 {
136 return std::pair<std::list<int>, int> ();
137 }
138
139 virtual std::string
140 question_dialog (const std::string& /*msg*/, const std::string& /*title*/,
141 const std::string& /*btn1*/, const std::string& /*btn2*/,
142 const std::string& /*btn3*/, const std::string& /*btndef*/)
143 {
144 return "";
145 }
146
147 virtual void update_path_dialog (void) { }
148
149 virtual void show_preferences (void) { }
150
151 virtual void apply_preferences (void) { }
152
153 virtual void show_terminal_window (void) { }
154
155 virtual bool show_documentation (const std::string& /*file*/)
156 {
157 return false;
158 }
159
160 virtual void show_file_browser (void) { }
161
162 virtual void show_command_history (void) { }
163
164 virtual void show_workspace (void) { }
165
166 virtual void show_community_news (int /*serial*/) { }
167 virtual void show_release_notes (void) { }
168
169 virtual bool edit_file (const std::string& /*file*/) { return false; }
170
171 virtual void
172 edit_variable (const std::string& /*name*/, const octave_value& /*val*/)
173 { }
174
175 // Other requests for user interaction, usually some kind of
176 // confirmation before another action. Could these be reformulated
177 // using the question_dialog action?
178
179 virtual bool confirm_shutdown (void) { return true; }
180
181 virtual bool prompt_new_edit_file (const std::string& /*file*/)
182 {
183 return false;
184 }
185
186 virtual int
187 debug_cd_or_addpath_error (const std::string& /*file*/,
188 const std::string& /*dir*/,
189 bool /*addpath_option*/)
190 {
191 return -1;
192 }
193
194 // Requests for information normally stored in the GUI.
195
196 virtual uint8NDArray get_named_icon (const std::string& /*icon_name*/)
197 {
198 return uint8NDArray ();
199 }
200
201 virtual std::string gui_preference (const std::string& /*key*/,
202 const std::string& /*value*/)
203 {
204 return "";
205 }
206
207 // Requests for GUI action that do not require user interaction.
208 // These are different from other notifications in that they are not
209 // associated with changes in the interpreter state (like a change
210 // in the current working directory or command history).
211
212 virtual bool copy_image_to_clipboard (const std::string& /*file*/)
213 {
214 return false;
215 }
216
217 virtual void focus_window (const std::string /*win_name*/)
218 { }
219
220 virtual void
221 execute_command_in_terminal (const std::string& /*command*/) { }
222
223 virtual void register_documentation (const std::string& /*file*/) { }
224
225 virtual void unregister_documentation (const std::string& /*file*/) { }
226
227 virtual void interpreter_output (const std::string& /*msg*/) { }
228
229 virtual void display_exception (const execution_exception& ee, bool beep);
230
231 virtual void gui_status_update (const std::string& /*feature*/,
232 const std::string& /*status*/) { }
233
234 virtual void update_gui_lexer (void) { }
235
236 // Notifications of events in the interpreter that a GUI will
237 // normally wish to respond to.
238
239 virtual void directory_changed (const std::string& /*dir*/) { }
240
241 virtual void
242 file_remove (const std::string& /*old_nm*/, const std::string& /*new_nm*/)
243 { }
244
245 virtual void file_renamed (bool) { }
246
247 virtual void
248 set_workspace (bool /*top_level*/, bool /*debug*/,
249 const symbol_info_list& /*syminfo*/,
250 bool /*update_variable_editor*/)
251 { }
252
253 virtual void clear_workspace (void) { }
254
255 virtual void update_prompt (const std::string& /*prompt*/) { }
256
257 virtual void set_history (const string_vector& /*hist*/) { }
258
259 virtual void append_history (const std::string& /*hist_entry*/) { }
260
261 virtual void clear_history (void) { }
262
263 virtual void pre_input_event (void) { }
264
265 virtual void post_input_event (void) { }
266
267 virtual void
268 enter_debugger_event (const std::string& /*fcn_name*/,
269 const std::string& /*fcn_file_name*/,
270 int /*line*/)
271 { }
272
273 virtual void
274 execute_in_debugger_event (const std::string& /*file*/, int /*line*/) { }
275
276 virtual void exit_debugger_event (void) { }
277
278 virtual void
279 update_breakpoint (bool /*insert*/, const std::string& /*file*/,
280 int /*line*/, const std::string& /*cond*/)
281 { }
282
283 virtual void interpreter_interrupted (void) { }
284 };
285
286 //! Provides threadsafe access to octave.
287 //!
288 //! This class provides thread-safe communication between the
289 //! interpreter and a GUI.
290
292 {
293 public:
294
295 OCTINTERP_API event_manager (interpreter& interp);
296
297 // No copying!
298
299 event_manager (const event_manager&) = delete;
300
302 operator = (const event_manager&) = delete;
303
304 virtual ~event_manager (void);
305
306 // OBJ should be an object of a class that is derived from the base
307 // class interpreter_events, or nullptr to disconnect and delete the
308 // previous link.
309
310 OCTINTERP_API void
311 connect_link (const std::shared_ptr<interpreter_events>& obj);
312
313 OCTINTERP_API bool enable (void);
314
315 bool disable (void)
316 {
317 bool retval = m_link_enabled;
318 m_link_enabled = false;
319 return retval;
320 }
321
322 bool enabled (void) const
323 {
324 return m_link_enabled;
325 }
326
327 // Make the Qt actions available for others. This is a temporary
328 // solution to allow Qt actions like opening the documentation
329 // browser when the primary interpreter_events object is not the one
330 // defined for the Qt GUI.
331 void
332 install_qt_event_handlers (const std::shared_ptr<interpreter_events>& obj)
333 {
335 }
336
337 std::shared_ptr<interpreter_events>
338 qt_event_handlers (void) const { return m_qt_event_handlers; }
339
340 // If disable is TRUE, then no additional events will be processed
341 // other than exit.
342
343 OCTINTERP_API void process_events (bool disable = false);
344
345 OCTINTERP_API void discard_events (void);
346
347 // The post_event and post_exception functions provide a thread-safe
348 // way for the GUI to queue interpreter functions for execution.
349 // The queued functions are executed when the interpreter is
350 // otherwise idle.
351
352 void push_event_queue (void);
353 void pop_event_queue (void);
354
355 OCTINTERP_API void post_event (const fcn_callback& fcn);
356 OCTINTERP_API void post_event (const meth_callback& meth);
357
358 // The following functions correspond to the virtual fuunctions in
359 // the interpreter_events class. They provide a way for the
360 // interpreter to notify the GUI that some event has occurred
361 // (directory or workspace changed, for example) or to request the
362 // GUI to perform some action (display a dialog, for example).
363
364 // Please keep this list of declarations in the same order as the
365 // ones above in the interpreter_events class.
366
367
368 // Note: START_GUI and CLOSE_GUI currently only work with the new
369 // experimental terminal object.
370
371 void start_gui (bool gui_app = false)
372 {
373 if (enabled ())
374 m_instance->start_gui (gui_app);
375 }
376
377 void close_gui (void)
378 {
379 if (enabled ())
380 m_instance->close_gui ();
381 }
382
383 // Dialogs
384
385 bool have_dialogs (void) const
386 {
387 return m_qt_event_handlers && m_qt_event_handlers->have_dialogs ();
388 }
389
390 typedef std::list<std::pair<std::string, std::string>> filter_list;
391
392 std::list<std::string>
393 file_dialog (const filter_list& filter, const std::string& title,
394 const std::string& filename, const std::string& dirname,
395 const std::string& multimode)
396 {
397 return (enabled () && have_dialogs ()
398 ? m_instance->file_dialog (filter, title, filename, dirname,
399 multimode)
400 : std::list<std::string> ());
401 }
402
403 std::list<std::string>
404 input_dialog (const std::list<std::string>& prompt,
405 const std::string& title,
406 const std::list<float>& nr,
407 const std::list<float>& nc,
408 const std::list<std::string>& defaults)
409 {
410 return (enabled () && have_dialogs ()
411 ? m_instance->input_dialog (prompt, title, nr, nc, defaults)
412 : std::list<std::string> ());
413 }
414
415 std::pair<std::list<int>, int>
416 list_dialog (const std::list<std::string>& list,
417 const std::string& mode,
418 int width, int height,
419 const std::list<int>& initial_value,
420 const std::string& name,
421 const std::list<std::string>& prompt,
422 const std::string& ok_string,
423 const std::string& cancel_string)
424 {
425 return (enabled () && have_dialogs ()
426 ? m_instance->list_dialog (list, mode, width, height,
427 initial_value, name, prompt,
428 ok_string, cancel_string)
429 : std::pair<std::list<int>, int> ());
430 }
431
432 std::string
433 question_dialog (const std::string& msg, const std::string& title,
434 const std::string& btn1, const std::string& btn2,
435 const std::string& btn3, const std::string& btndef)
436 {
437 return (enabled () && have_dialogs ()
438 ? m_instance->question_dialog (msg, title, btn1,
439 btn2, btn3, btndef)
440 : "");
441 }
442
444 {
446 m_instance->update_path_dialog ();
447 }
448
450 {
451 if (enabled ())
452 {
453 m_instance->show_preferences ();
454 return true;
455 }
456 else
457 return false;
458 }
459
461 {
462 if (enabled ())
463 {
464 m_instance->apply_preferences ();
465 return true;
466 }
467 else
468 return false;
469 }
470
472 {
473 if (enabled ())
474 m_instance->show_terminal_window ();
475 }
476
477 bool show_documentation (const std::string& file)
478 {
479 return enabled () ? m_instance->show_documentation (file) : false;
480 }
481
483 {
484 if (enabled ())
485 m_instance->show_file_browser ();
486 }
487
489 {
490 if (enabled ())
491 m_instance->show_command_history ();
492 }
493
494 void show_workspace (void)
495 {
496 if (enabled ())
497 m_instance->show_workspace ();
498 }
499
500 void show_community_news (int serial = -1)
501 {
502 if (enabled ())
503 m_instance->show_community_news (serial);
504 }
505
507 {
508 if (enabled ())
509 m_instance->show_release_notes ();
510 }
511
512 bool edit_file (const std::string& file)
513 {
514 return enabled () ? m_instance->edit_file (file) : false;
515 }
516
517 bool edit_variable (const std::string& name, const octave_value& val)
518 {
519 if (enabled ())
520 {
521 m_instance->edit_variable (name, val);
522 return true;
523 }
524 else
525 return false;
526 }
527
529 {
530 bool retval = true;
531
532 if (enabled ())
533 retval = m_instance->confirm_shutdown ();
534
535 return retval;
536 }
537
538 bool prompt_new_edit_file (const std::string& file)
539 {
540 return enabled () ? m_instance->prompt_new_edit_file (file) : false;
541 }
542
543 int debug_cd_or_addpath_error (const std::string& file,
544 const std::string& dir, bool addpath_option)
545 {
546 return (enabled ()
547 ? m_instance->debug_cd_or_addpath_error (file, dir,
548 addpath_option)
549 : 0);
550 }
551
552 uint8NDArray get_named_icon (const std::string& icon_name)
553 {
554 return (enabled ()
555 ? m_instance->get_named_icon (icon_name) : uint8NDArray ());
556 }
557
558 std::string gui_preference (const std::string& key,
559 const std::string& value)
560 {
561 return enabled () ? m_instance->gui_preference (key, value) : "";
562 }
563
564 bool copy_image_to_clipboard (const std::string& file)
565 {
566 return enabled () ? m_instance->copy_image_to_clipboard (file) : false;
567 }
568
569 virtual void focus_window (const std::string win_name)
570 {
571 if (enabled ())
572 m_instance->focus_window (win_name);
573 }
574
575 // Preserves pending input.
576 void execute_command_in_terminal (const std::string& command)
577 {
578 if (enabled ())
579 m_instance->execute_command_in_terminal (command);
580 }
581
582 bool register_documentation (const std::string& file)
583 {
584 if (enabled ())
585 {
586 m_instance->register_documentation (file);
587 return true;
588 }
589 else
590 return false;
591 }
592
593 bool unregister_documentation (const std::string& file)
594 {
595 if (enabled ())
596 {
597 m_instance->unregister_documentation (file);
598 return true;
599 }
600 else
601 return false;
602 }
603
604 bool interpreter_output (const std::string& msg)
605 {
606 if (enabled ())
607 {
608 m_instance->interpreter_output (msg);
609 return true;
610 }
611 else
612 return false;
613 }
614
615 bool display_exception (const execution_exception& ee, bool beep = false)
616 {
617 if (enabled ())
618 {
619 m_instance->display_exception (ee, beep);
620 return true;
621 }
622 else
623 return false;
624 }
625
626 bool gui_status_update (const std::string& feature, const std::string& status)
627 {
628 if (enabled ())
629 {
630 m_instance->gui_status_update (feature, status);
631 return true;
632 }
633 else
634 return false;
635 }
636
638 {
639 if (enabled ())
640 {
641 m_instance->update_gui_lexer ();
642 return true;
643 }
644 else
645 return false;
646 }
647
648 void directory_changed (const std::string& dir)
649 {
650 if (enabled ())
651 m_instance->directory_changed (dir);
652 }
653
654 // Methods for removing/renaming files which might be open in editor
655 void file_remove (const std::string& old_name, const std::string& new_name)
656 {
658 m_instance->file_remove (old_name, new_name);
659 }
660
661 void file_renamed (bool load_new)
662 {
664 m_instance->file_renamed (load_new);
665 }
666
667 OCTINTERP_API void set_workspace (void);
668
669 void set_workspace (bool top_level, const symbol_info_list& syminfo,
670 bool update_variable_editor = true)
671 {
672 if (enabled ())
673 m_instance->set_workspace (top_level, m_debugging, syminfo,
674 update_variable_editor);
675 }
676
677 void clear_workspace (void)
678 {
679 if (enabled ())
680 m_instance->clear_workspace ();
681 }
682
683 void update_prompt (const std::string& prompt)
684 {
685 if (enabled ())
686 m_instance->update_prompt (prompt);
687 }
688
689 OCTINTERP_API void set_history (void);
690
691 void set_history (const string_vector& hist)
692 {
693 if (enabled ())
694 m_instance->set_history (hist);
695 }
696
697 void append_history (const std::string& hist_entry)
698 {
699 if (enabled ())
700 m_instance->append_history (hist_entry);
701 }
702
703 void clear_history (void)
704 {
705 if (enabled ())
706 m_instance->clear_history ();
707 }
708
709 void pre_input_event (void)
710 {
711 if (enabled ())
712 m_instance->pre_input_event ();
713 }
714
716 {
717 if (enabled ())
718 m_instance->post_input_event ();
719 }
720
721 void enter_debugger_event (const std::string& fcn_name,
722 const std::string& fcn_file_name, int line)
723 {
724 if (enabled ())
725 {
726 m_debugging = true;
727
728 m_instance->enter_debugger_event (fcn_name, fcn_file_name, line);
729 }
730 }
731
732 void execute_in_debugger_event (const std::string& file, int line)
733 {
734 if (enabled ())
735 m_instance->execute_in_debugger_event (file, line);
736 }
737
739 {
740 if (enabled () && m_debugging)
741 {
742 m_debugging = false;
743
744 m_instance->exit_debugger_event ();
745 }
746 }
747
748 void update_breakpoint (bool insert, const std::string& file,
749 int line, const std::string& cond = "")
750 {
751 if (enabled ())
752 m_instance->update_breakpoint (insert, file, line, cond);
753 }
754
756 {
757 if (enabled ())
758 m_instance->interpreter_interrupted ();
759 }
760
761 protected:
762
763 // Semaphore to lock access to the event queue.
765
766 // Event Queue. We use a stack so that we can handle evaluation in
767 // the debugger when we are executing in server mode. In server
768 // mode, code is evaluated from inside the event queue. So when the
769 // evaluator reaches a breakpoint, the queue is already locked and
770 // executing an event function. We can't just add a new command to the
771 // existing queue, so we need another one that can process new
772 // events generated at the debug prompt. When execution continues
773 // (dbcont or dbstep, for example) we pop the queue and return to
774 // the previous point of execution.
775
776 std::stack<std::shared_ptr <event_queue>> m_gui_event_queue;
777
780
781 private:
782
784
785 // Using a shared_ptr to manage the link_events object ensures that it
786 // will be valid until it is no longer needed.
787
788 std::shared_ptr<interpreter_events> m_instance;
789
790 std::shared_ptr<interpreter_events> m_qt_event_handlers;
791
792 };
793
794OCTAVE_NAMESPACE_END
795
796#endif
static bool is_gui_running(void)
Definition: octave.h:312
Provides threadsafe access to octave.
void append_history(const std::string &hist_entry)
void show_workspace(void)
void clear_history(void)
bool show_documentation(const std::string &file)
void update_path_dialog(void)
OCTINTERP_API void connect_link(const std::shared_ptr< interpreter_events > &obj)
bool edit_variable(const std::string &name, const octave_value &val)
void push_event_queue(void)
void file_renamed(bool load_new)
virtual void focus_window(const std::string win_name)
OCTINTERP_API void set_workspace(void)
bool show_preferences(void)
bool register_documentation(const std::string &file)
bool confirm_shutdown(void)
bool have_dialogs(void) const
OCTINTERP_API event_manager(interpreter &interp)
std::string question_dialog(const std::string &msg, const std::string &title, const std::string &btn1, const std::string &btn2, const std::string &btn3, const std::string &btndef)
void enter_debugger_event(const std::string &fcn_name, const std::string &fcn_file_name, int line)
bool unregister_documentation(const std::string &file)
std::shared_ptr< interpreter_events > m_instance
void install_qt_event_handlers(const std::shared_ptr< interpreter_events > &obj)
void execute_command_in_terminal(const std::string &command)
bool update_gui_lexer(void)
uint8NDArray get_named_icon(const std::string &icon_name)
void clear_workspace(void)
void pop_event_queue(void)
std::list< std::pair< std::string, std::string > > filter_list
OCTINTERP_API void set_history(void)
void file_remove(const std::string &old_name, const std::string &new_name)
OCTINTERP_API void process_events(bool disable=false)
void post_input_event(void)
void set_history(const string_vector &hist)
std::list< std::string > input_dialog(const std::list< std::string > &prompt, const std::string &title, const std::list< float > &nr, const std::list< float > &nc, const std::list< std::string > &defaults)
bool copy_image_to_clipboard(const std::string &file)
std::shared_ptr< interpreter_events > qt_event_handlers(void) const
bool prompt_new_edit_file(const std::string &file)
OCTINTERP_API void discard_events(void)
event_manager(const event_manager &)=delete
OCTINTERP_API bool enable(void)
void close_gui(void)
void directory_changed(const std::string &dir)
mutex * m_event_queue_mutex
void set_workspace(bool top_level, const symbol_info_list &syminfo, bool update_variable_editor=true)
void show_command_history(void)
void start_gui(bool gui_app=false)
bool interpreter_output(const std::string &msg)
void exit_debugger_event(void)
bool gui_status_update(const std::string &feature, const std::string &status)
bool display_exception(const execution_exception &ee, bool beep=false)
bool enabled(void) const
OCTINTERP_API void post_event(const fcn_callback &fcn)
void interpreter_interrupted(void)
std::string gui_preference(const std::string &key, const std::string &value)
void show_release_notes(void)
interpreter & m_interpreter
std::pair< std::list< int >, int > list_dialog(const std::list< std::string > &list, const std::string &mode, int width, int height, const std::list< int > &initial_value, const std::string &name, const std::list< std::string > &prompt, const std::string &ok_string, const std::string &cancel_string)
std::stack< std::shared_ptr< event_queue > > m_gui_event_queue
void show_community_news(int serial=-1)
std::shared_ptr< interpreter_events > m_qt_event_handlers
int debug_cd_or_addpath_error(const std::string &file, const std::string &dir, bool addpath_option)
void show_terminal_window(void)
bool apply_preferences(void)
virtual ~event_manager(void)
bool disable(void)
bool edit_file(const std::string &file)
void update_breakpoint(bool insert, const std::string &file, int line, const std::string &cond="")
void update_prompt(const std::string &prompt)
void execute_in_debugger_event(const std::string &file, int line)
std::list< std::string > file_dialog(const filter_list &filter, const std::string &title, const std::string &filename, const std::string &dirname, const std::string &multimode)
event_manager & operator=(const event_manager &)=delete
void pre_input_event(void)
void show_file_browser(void)
virtual void register_documentation(const std::string &)
virtual void clear_history(void)
virtual std::list< std::string > file_dialog(const filter_list &, const std::string &, const std::string &, const std::string &, const std::string &)
virtual bool have_dialogs(void) const
virtual void apply_preferences(void)
std::list< std::pair< std::string, std::string > > filter_list
virtual void enter_debugger_event(const std::string &, const std::string &, int)
virtual void set_workspace(bool, bool, const symbol_info_list &, bool)
virtual void interpreter_output(const std::string &)
virtual std::string gui_preference(const std::string &, const std::string &)
virtual void show_community_news(int)
virtual bool copy_image_to_clipboard(const std::string &)
virtual void append_history(const std::string &)
virtual void directory_changed(const std::string &)
virtual void show_workspace(void)
virtual bool edit_file(const std::string &)
virtual ~interpreter_events(void)=default
virtual void update_path_dialog(void)
interpreter_events(const interpreter_events &)=default
virtual bool confirm_shutdown(void)
virtual void interpreter_interrupted(void)
virtual void update_gui_lexer(void)
virtual bool prompt_new_edit_file(const std::string &)
virtual int debug_cd_or_addpath_error(const std::string &, const std::string &, bool)
interpreter_events(void)=default
virtual std::pair< std::list< int >, int > list_dialog(const std::list< std::string > &, const std::string &, int, int, const std::list< int > &, const std::string &, const std::list< std::string > &, const std::string &, const std::string &)
virtual void show_command_history(void)
virtual void update_breakpoint(bool, const std::string &, int, const std::string &)
virtual void execute_command_in_terminal(const std::string &)
virtual void close_gui(void)
Definition: event-manager.h:99
virtual uint8NDArray get_named_icon(const std::string &)
virtual void show_release_notes(void)
virtual void file_remove(const std::string &, const std::string &)
virtual void file_renamed(bool)
virtual void update_prompt(const std::string &)
virtual void show_preferences(void)
virtual void start_gui(bool=false)
Definition: event-manager.h:98
virtual void show_terminal_window(void)
virtual void edit_variable(const std::string &, const octave_value &)
virtual void show_file_browser(void)
virtual void execute_in_debugger_event(const std::string &, int)
virtual void exit_debugger_event(void)
virtual std::string question_dialog(const std::string &, const std::string &, const std::string &, const std::string &, const std::string &, const std::string &)
virtual void clear_workspace(void)
virtual bool show_documentation(const std::string &)
virtual void post_input_event(void)
virtual std::list< std::string > input_dialog(const std::list< std::string > &, const std::string &, const std::list< float > &, const std::list< float > &, const std::list< std::string > &)
virtual void gui_status_update(const std::string &, const std::string &)
virtual void focus_window(const std::string)
virtual void set_history(const string_vector &)
virtual void unregister_documentation(const std::string &)
virtual void pre_input_event(void)
OCTAVE_NAMESPACE_BEGIN typedef std::function< void(void)> fcn_callback
Definition: event-manager.h:47
std::function< void(interpreter &)> meth_callback
Definition: event-manager.h:48
OCTAVE_NAMESPACE_BEGIN MArray< T > filter(MArray< T > &b, MArray< T > &a, MArray< T > &x, MArray< T > &si, int dim=0)
Definition: filter.cc:48
QString name
std::string dirname(const std::string &path)
Definition: file-ops.cc:358
intNDArray< octave_uint8 > uint8NDArray
Definition: uint8NDArray.h:36