diff libgui/src/octave-adapter/octave-link.h @ 16377:8430ea8c1594

open editor tab and insert marker for debugging with gui * file-editor-interface.h (file_editor_interface::request_open_file): New public slot. (file_editor_interface::handle_dbstop_request): New virtual function. * file-editor-tab.h, file-editor-tab.cc (file_editor_tab::goto_line): New arg, line, with default value. Don't prompt if line is greater than zero. (file_editor_tab::set_debugger_position): New arg, widget id. (file_editor_tab::add_filename_to_list): New arg, widget id. * file-editor.h, file-editor.cc (file_eidtor::editor_tab_map): New data member. (file_editor::fetFileNames) Delete. (file_editor::~file_editor, file_editor::check_conflict_save, file_editor::handle_add_filename_to_list): Use editor_tab_map instead of fetFileNames. (file_editor::request_open_file): New args, line and set_marker. Optionally position cursor at line and with debug marker. If file is already open in tab, switch to it instead of giving error. (file_editor::construct): Connect fetab_set_debugger_position signal to set_debugger_position slot. * main-window.h, main-window.cc (main_window::dbstop_signal): New signal. (main_window::handle_dbstop_request): New function. * octave-event-listener.h (octave_event_listener::dbstop): New virtual function. * octave-qt-event-listener.h, octave-qt-event-listener.cc (octave_qt_event_listener::dbstop): New function. (octave_qt_event_listener::dbstop_signal): New signal. * octave-link.h, octave-link.cc (octave_link::dbstop, octave_link::do_dbstop, octave_link::dbstop_event_hook_fcn, octave_link::do_dbstop_event_hook_fcn): New functions * octave-main-thread.h, octave-main-thread.cc (dbstop_event_hook_fcn): New function. (octave_main_thread::run): Add it to the list of dbstop event hook functions.
author John W. Eaton <jwe@octave.org>
date Wed, 27 Mar 2013 12:59:12 -0400
parents d4b6ad43bc87
children 3cacd597464d
line wrap: on
line diff
--- a/libgui/src/octave-adapter/octave-link.h
+++ b/libgui/src/octave-adapter/octave-link.h
@@ -28,6 +28,8 @@
 
 class octave_mutex;
 
+#include "oct-obj.h"
+
 #include "event-queue.h"
 
 #include "octave-main-thread.h"
@@ -132,6 +134,12 @@
       instance->do_update_history ();
   }
 
+  static void dbstop (const octave_value_list& args)
+  {
+    if (instance_ok ())
+      instance->do_dbstop (args);
+  }
+
   static void pre_input_event_hook_fcn (void)
   {
     if (instance_ok ())
@@ -144,6 +152,12 @@
       instance->do_post_input_event_hook_fcn ();
   }
 
+  static void dbstop_event_hook_fcn (const octave_value_list& args)
+  {
+    if (instance_ok ())
+      instance->do_dbstop_event_hook_fcn (args);
+  }
+
 private:
 
   static octave_link *instance;
@@ -206,9 +220,11 @@
   std::string do_last_working_directory (void);
   void do_update_workspace (void);
   void do_update_history (void);
+  void do_dbstop (const octave_value_list& args);
 
   void do_pre_input_event_hook_fcn (void);
   void do_post_input_event_hook_fcn (void);
+  void do_dbstop_event_hook_fcn (const octave_value_list& args);
 };
 
 #endif // OCTAVELINK_H