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