GNU Octave  9.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-2024 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 
42 class octave_value;
43 class string_vector;
44 
46 
47 typedef std::function<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 () = default;
83 
85 
87 
88  virtual ~interpreter_events () = 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 () { }
100 
101  // Dialogs.
102 
103  virtual bool have_dialogs () 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 () { }
148 
149  virtual void show_preferences () { }
150 
151  virtual void apply_preferences () { }
152 
153  virtual void show_terminal_window () { }
154 
155  virtual bool show_documentation (const std::string& /*file*/)
156  {
157  return false;
158  }
159 
160  virtual void show_file_browser () { }
161 
162  virtual void show_command_history () { }
163 
164  virtual void show_workspace () { }
165 
166  virtual void show_community_news (int /*serial*/) { }
167  virtual void show_release_notes () { }
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 () { 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 () { }
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 () { }
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 () { }
262 
263  virtual void pre_input_event () { }
264 
265  virtual void post_input_event () { }
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 () { }
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 () { }
284 };
285 
286 //! Provides threadsafe access to octave.
287 //!
288 //! This class provides thread-safe communication between the
289 //! interpreter and a GUI.
290 
291 class
292 OCTINTERP_API
294 {
295 public:
296 
297  OCTINTERP_API event_manager (interpreter& interp);
298 
299  OCTAVE_DISABLE_CONSTRUCT_COPY_MOVE (event_manager)
300 
301  virtual ~event_manager ();
302 
303  // OBJ should be an object of a class that is derived from the base
304  // class interpreter_events, or nullptr to disconnect and delete the
305  // previous link.
306 
307  OCTINTERP_API void
308  connect_link (const std::shared_ptr<interpreter_events>& obj);
309 
310  OCTINTERP_API bool enable ();
311 
312  bool disable ()
313  {
314  bool retval = m_link_enabled;
315  m_link_enabled = false;
316  return retval;
317  }
318 
319  bool enabled () const
320  {
321  return m_link_enabled;
322  }
323 
324  // Make the Qt actions available for others. This is a temporary
325  // solution to allow Qt actions like opening the documentation
326  // browser when the primary interpreter_events object is not the one
327  // defined for the Qt GUI.
328  void
329  install_qt_event_handlers (const std::shared_ptr<interpreter_events>& obj)
330  {
331  m_qt_event_handlers = obj;
332  }
333 
334  std::shared_ptr<interpreter_events>
335  qt_event_handlers () const { return m_qt_event_handlers; }
336 
337  // If disable is TRUE, then no additional events will be processed
338  // other than exit.
339 
340  OCTINTERP_API void process_events (bool disable = false);
341 
342  OCTINTERP_API void discard_events ();
343 
344  // The post_event and post_exception functions provide a thread-safe
345  // way for the GUI to queue interpreter functions for execution.
346  // The queued functions are executed when the interpreter is
347  // otherwise idle.
348 
349  void push_event_queue ();
350  void pop_event_queue ();
351 
352  OCTINTERP_API void post_event (const fcn_callback& fcn);
353  OCTINTERP_API void post_event (const meth_callback& meth);
354 
355  // The following functions correspond to the virtual fuunctions in
356  // the interpreter_events class. They provide a way for the
357  // interpreter to notify the GUI that some event has occurred
358  // (directory or workspace changed, for example) or to request the
359  // GUI to perform some action (display a dialog, for example).
360 
361  // Please keep this list of declarations in the same order as the
362  // ones above in the interpreter_events class.
363 
364 
365  // Note: START_GUI and CLOSE_GUI currently only work with the new
366  // experimental terminal object.
367 
368  void start_gui (bool gui_app = false)
369  {
370  if (enabled ())
371  m_instance->start_gui (gui_app);
372  }
373 
374  void close_gui ()
375  {
376  if (enabled ())
377  m_instance->close_gui ();
378  }
379 
380  // Dialogs
381 
382  bool have_dialogs () const
383  {
384  return m_qt_event_handlers && m_qt_event_handlers->have_dialogs ();
385  }
386 
387  typedef std::list<std::pair<std::string, std::string>> filter_list;
388 
389  std::list<std::string>
390  file_dialog (const filter_list& filter, const std::string& title,
391  const std::string& filename, const std::string& dirname,
392  const std::string& multimode)
393  {
394  return (enabled () && have_dialogs ()
395  ? m_instance->file_dialog (filter, title, filename, dirname,
396  multimode)
397  : std::list<std::string> ());
398  }
399 
400  std::list<std::string>
401  input_dialog (const std::list<std::string>& prompt,
402  const std::string& title,
403  const std::list<float>& nr,
404  const std::list<float>& nc,
405  const std::list<std::string>& defaults)
406  {
407  return (enabled () && have_dialogs ()
408  ? m_instance->input_dialog (prompt, title, nr, nc, defaults)
409  : std::list<std::string> ());
410  }
411 
412  std::pair<std::list<int>, int>
413  list_dialog (const std::list<std::string>& list,
414  const std::string& mode,
415  int width, int height,
416  const std::list<int>& initial_value,
417  const std::string& name,
418  const std::list<std::string>& prompt,
419  const std::string& ok_string,
420  const std::string& cancel_string)
421  {
422  return (enabled () && have_dialogs ()
423  ? m_instance->list_dialog (list, mode, width, height,
424  initial_value, name, prompt,
425  ok_string, cancel_string)
426  : std::pair<std::list<int>, int> ());
427  }
428 
429  std::string
430  question_dialog (const std::string& msg, const std::string& title,
431  const std::string& btn1, const std::string& btn2,
432  const std::string& btn3, const std::string& btndef)
433  {
434  return (enabled () && have_dialogs ()
435  ? m_instance->question_dialog (msg, title, btn1,
436  btn2, btn3, btndef)
437  : "");
438  }
439 
441  {
442  if (application::is_gui_running () && enabled ())
443  m_instance->update_path_dialog ();
444  }
445 
447  {
448  if (enabled ())
449  {
450  m_instance->show_preferences ();
451  return true;
452  }
453  else
454  return false;
455  }
456 
458  {
459  if (enabled ())
460  {
461  m_instance->apply_preferences ();
462  return true;
463  }
464  else
465  return false;
466  }
467 
469  {
470  if (enabled ())
471  m_instance->show_terminal_window ();
472  }
473 
474  bool show_documentation (const std::string& file)
475  {
476  return enabled () ? m_instance->show_documentation (file) : false;
477  }
478 
480  {
481  if (enabled ())
482  m_instance->show_file_browser ();
483  }
484 
486  {
487  if (enabled ())
488  m_instance->show_command_history ();
489  }
490 
492  {
493  if (enabled ())
494  m_instance->show_workspace ();
495  }
496 
497  void show_community_news (int serial = -1)
498  {
499  if (enabled ())
500  m_instance->show_community_news (serial);
501  }
502 
504  {
505  if (enabled ())
506  m_instance->show_release_notes ();
507  }
508 
509  bool edit_file (const std::string& file)
510  {
511  return enabled () ? m_instance->edit_file (file) : false;
512  }
513 
514  bool edit_variable (const std::string& name, const octave_value& val)
515  {
516  if (enabled ())
517  {
518  m_instance->edit_variable (name, val);
519  return true;
520  }
521  else
522  return false;
523  }
524 
526  {
527  bool retval = true;
528 
529  if (enabled ())
530  retval = m_instance->confirm_shutdown ();
531 
532  return retval;
533  }
534 
535  bool prompt_new_edit_file (const std::string& file)
536  {
537  return enabled () ? m_instance->prompt_new_edit_file (file) : false;
538  }
539 
540  int debug_cd_or_addpath_error (const std::string& file,
541  const std::string& dir, bool addpath_option)
542  {
543  return (enabled ()
544  ? m_instance->debug_cd_or_addpath_error (file, dir,
545  addpath_option)
546  : 0);
547  }
548 
549  uint8NDArray get_named_icon (const std::string& icon_name)
550  {
551  return (enabled ()
552  ? m_instance->get_named_icon (icon_name) : uint8NDArray ());
553  }
554 
555  std::string gui_preference (const std::string& key,
556  const std::string& value)
557  {
558  return enabled () ? m_instance->gui_preference (key, value) : "";
559  }
560 
561  bool copy_image_to_clipboard (const std::string& file)
562  {
563  return enabled () ? m_instance->copy_image_to_clipboard (file) : false;
564  }
565 
566  virtual void focus_window (const std::string win_name)
567  {
568  if (enabled ())
569  m_instance->focus_window (win_name);
570  }
571 
572  // Preserves pending input.
573  void execute_command_in_terminal (const std::string& command)
574  {
575  if (enabled ())
576  m_instance->execute_command_in_terminal (command);
577  }
578 
579  bool register_documentation (const std::string& file)
580  {
581  if (enabled ())
582  {
583  m_instance->register_documentation (file);
584  return true;
585  }
586  else
587  return false;
588  }
589 
590  bool unregister_documentation (const std::string& file)
591  {
592  if (enabled ())
593  {
594  m_instance->unregister_documentation (file);
595  return true;
596  }
597  else
598  return false;
599  }
600 
601  bool interpreter_output (const std::string& msg)
602  {
603  if (enabled ())
604  {
605  m_instance->interpreter_output (msg);
606  return true;
607  }
608  else
609  return false;
610  }
611 
612  bool display_exception (const execution_exception& ee, bool beep = false)
613  {
614  if (enabled ())
615  {
616  m_instance->display_exception (ee, beep);
617  return true;
618  }
619  else
620  return false;
621  }
622 
623  bool gui_status_update (const std::string& feature,
624  const std::string& status)
625  {
626  if (enabled ())
627  {
628  m_instance->gui_status_update (feature, status);
629  return true;
630  }
631  else
632  return false;
633  }
634 
636  {
637  if (enabled ())
638  {
639  m_instance->update_gui_lexer ();
640  return true;
641  }
642  else
643  return false;
644  }
645 
646  void directory_changed (const std::string& dir)
647  {
648  if (enabled ())
649  m_instance->directory_changed (dir);
650  }
651 
652  // Methods for removing/renaming files which might be open in editor
653  void file_remove (const std::string& old_name, const std::string& new_name)
654  {
655  if (application::is_gui_running () && enabled ())
656  m_instance->file_remove (old_name, new_name);
657  }
658 
659  void file_renamed (bool load_new)
660  {
661  if (application::is_gui_running () && enabled ())
662  m_instance->file_renamed (load_new);
663  }
664 
665  OCTINTERP_API void set_workspace ();
666 
667  void set_workspace (bool top_level, const symbol_info_list& syminfo,
668  bool update_variable_editor = true)
669  {
670  if (enabled ())
671  m_instance->set_workspace (top_level, m_debugging, syminfo,
672  update_variable_editor);
673  }
674 
676  {
677  if (enabled ())
678  m_instance->clear_workspace ();
679  }
680 
681  void update_prompt (const std::string& prompt)
682  {
683  if (enabled ())
684  m_instance->update_prompt (prompt);
685  }
686 
687  OCTINTERP_API void set_history ();
688 
689  void set_history (const string_vector& hist)
690  {
691  if (enabled ())
692  m_instance->set_history (hist);
693  }
694 
695  void append_history (const std::string& hist_entry)
696  {
697  if (enabled ())
698  m_instance->append_history (hist_entry);
699  }
700 
702  {
703  if (enabled ())
704  m_instance->clear_history ();
705  }
706 
708  {
709  if (enabled ())
710  m_instance->pre_input_event ();
711  }
712 
714  {
715  if (enabled ())
716  m_instance->post_input_event ();
717  }
718 
719  void enter_debugger_event (const std::string& fcn_name,
720  const std::string& fcn_file_name, int line)
721  {
722  if (enabled ())
723  {
724  m_debugging = true;
725 
726  m_instance->enter_debugger_event (fcn_name, fcn_file_name, line);
727  }
728  }
729 
730  void execute_in_debugger_event (const std::string& file, int line)
731  {
732  if (enabled ())
733  m_instance->execute_in_debugger_event (file, line);
734  }
735 
737  {
738  if (enabled () && m_debugging)
739  {
740  m_debugging = false;
741 
742  m_instance->exit_debugger_event ();
743  }
744  }
745 
746  void update_breakpoint (bool insert, const std::string& file,
747  int line, const std::string& cond = "")
748  {
749  if (enabled ())
750  m_instance->update_breakpoint (insert, file, line, cond);
751  }
752 
754  {
755  if (enabled ())
756  m_instance->interpreter_interrupted ();
757  }
758 
759 protected:
760 
761  // Semaphore to lock access to the event queue.
763 
764  // Event Queue. We use a stack so that we can handle evaluation in
765  // the debugger when we are executing in server mode. In server
766  // mode, code is evaluated from inside the event queue. So when the
767  // evaluator reaches a breakpoint, the queue is already locked and
768  // executing an event function. We can't just add a new command to the
769  // existing queue, so we need another one that can process new
770  // events generated at the debug prompt. When execution continues
771  // (dbcont or dbstep, for example) we pop the queue and return to
772  // the previous point of execution.
773 
774  std::stack<std::shared_ptr <event_queue>> m_gui_event_queue;
775 
778 
779 private:
780 
781  interpreter& m_interpreter;
782 
783  // Using a shared_ptr to manage the link_events object ensures that it
784  // will be valid until it is no longer needed.
785 
786  std::shared_ptr<interpreter_events> m_instance;
787 
788  std::shared_ptr<interpreter_events> m_qt_event_handlers;
789 
790 };
791 
792 OCTAVE_END_NAMESPACE(octave)
793 
794 #endif
static bool is_gui_running()
Definition: octave.h:318
Provides threadsafe access to octave.
void append_history(const std::string &hist_entry)
void clear_history()
bool show_documentation(const std::string &file)
void show_terminal_window()
bool show_preferences()
bool apply_preferences()
bool edit_variable(const std::string &name, const octave_value &val)
void file_renamed(bool load_new)
virtual void focus_window(const std::string win_name)
bool update_gui_lexer()
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 register_documentation(const std::string &file)
void show_command_history()
void show_release_notes()
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 confirm_shutdown()
bool unregister_documentation(const std::string &file)
void install_qt_event_handlers(const std::shared_ptr< interpreter_events > &obj)
void execute_command_in_terminal(const std::string &command)
uint8NDArray get_named_icon(const std::string &icon_name)
void post_input_event()
std::list< std::pair< std::string, std::string > > filter_list
void file_remove(const std::string &old_name, const std::string &new_name)
void update_path_dialog()
void set_history(const string_vector &hist)
bool copy_image_to_clipboard(const std::string &file)
bool prompt_new_edit_file(const std::string &file)
std::shared_ptr< interpreter_events > qt_event_handlers() const
void interpreter_interrupted()
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)
void exit_debugger_event()
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 start_gui(bool gui_app=false)
bool interpreter_output(const std::string &msg)
bool gui_status_update(const std::string &feature, const std::string &status)
bool display_exception(const execution_exception &ee, bool beep=false)
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)
void pre_input_event()
std::string gui_preference(const std::string &key, const std::string &value)
std::stack< std::shared_ptr< event_queue > > m_gui_event_queue
bool have_dialogs() const
void clear_workspace()
void show_community_news(int serial=-1)
bool enabled() const
void show_file_browser()
int debug_cd_or_addpath_error(const std::string &file, const std::string &dir, bool addpath_option)
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)
void show_workspace()
virtual void show_preferences()
interpreter_events()=default
virtual void register_documentation(const std::string &)
virtual void show_command_history()
std::list< std::pair< std::string, std::string > > filter_list
virtual void close_gui()
Definition: event-manager.h:99
virtual void enter_debugger_event(const std::string &, const std::string &, int)
virtual void show_file_browser()
virtual void set_workspace(bool, bool, const symbol_info_list &, bool)
virtual void interpreter_output(const std::string &)
virtual std::list< std::string > file_dialog(const filter_list &, const std::string &, const std::string &, const std::string &, const std::string &)
virtual std::string gui_preference(const std::string &, const std::string &)
virtual void update_gui_lexer()
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 bool edit_file(const std::string &)
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 &)
interpreter_events(const interpreter_events &)=default
virtual bool prompt_new_edit_file(const std::string &)
virtual int debug_cd_or_addpath_error(const std::string &, const std::string &, bool)
virtual ~interpreter_events()=default
virtual void update_breakpoint(bool, const std::string &, int, const std::string &)
virtual void clear_workspace()
virtual void update_path_dialog()
virtual void apply_preferences()
virtual void clear_history()
virtual void execute_command_in_terminal(const std::string &)
virtual uint8NDArray get_named_icon(const std::string &)
virtual void interpreter_interrupted()
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_workspace()
virtual void start_gui(bool=false)
Definition: event-manager.h:98
virtual void edit_variable(const std::string &, const octave_value &)
virtual void execute_in_debugger_event(const std::string &, int)
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 show_terminal_window()
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 bool show_documentation(const std::string &)
virtual void post_input_event()
virtual void exit_debugger_event()
virtual void show_release_notes()
virtual bool confirm_shutdown()
virtual void pre_input_event()
virtual void gui_status_update(const std::string &, const std::string &)
virtual bool have_dialogs() const
virtual void focus_window(const std::string)
virtual void set_history(const string_vector &)
virtual void unregister_documentation(const std::string &)
string_vector & operator=(const string_vector &)=default
OCTAVE_BEGIN_NAMESPACE(octave) static octave_value daspk_fcn
std::function< void(interpreter &)> meth_callback
Definition: event-manager.h:48
std::function< void()> fcn_callback
Definition: event-manager.h:43
std::string dirname(const std::string &path)
MArray< T > filter(MArray< T > &b, MArray< T > &a, MArray< T > &x, MArray< T > &si, int dim=0)
Definition: filter.cc:48
intNDArray< octave_uint8 > uint8NDArray
Definition: uint8NDArray.h:36