annotate libgui/src/octave-adapter/octave-main-thread.h @ 16386:4902484f9181

callbacks to set markers in editor using command line dbstop function * debug.h, debug.cc (location_info): New function. * input.cc (get_debug_input): Use it to pass location info to hook functions. * debug.cc (bp_table::do_add_breakpoint): Likewise. (bp_table::do_remove_all_breakpoints_in_file): Likewise. (bp_table::do_remove_breakpoint): Likewise. (Fadd_dbstop_hook, Fremove_dbstop_hook, Fadd_dbclear_hook, Fremove_dbclear_hook): New functions. (dbstop_hook_functions, dbclear_hook_functions): New static variables. * file-editor-interface.h (file_editor_interface::handle_update_dbstop_marker_request): New pure virtual function. (file_editor_interface::request_open_file): New args, dbstop_marker and insert. * file-editor.h, file-editor.cc (file_editor::request_open_file): Likewise. Emit signal to set or remove dbstop marker. (file_editor::handle_update_dbstop_marker_request): New function. (file_editor::fetab_do_dbstop_marker): New signal. (file_editor::add_file_editor_tab): Connect fetab_do_dbstop_marker signal to do_dbstop_marker. * file-editor-tab.h, file-editor-tab.cc (file_editor_tab::do_dbstop_marker): New function. * file-editor-tab.cc (file_editor::goto_line): Eliminate shadowing variable declaration. * main-window.h, main-window.cc (main_window::handle_update_dbstop_marker_request): New function. (main_window::construct): Connect update_dbstop_marker_signal signal to handle_update_dbstop_marker_request. * octave-event-listener.h (event_listener::update_dbstop_marker): New pure virtual function. * octave-link.h, octave-link.cc (octave_link::update_breakpoint_hook_fcn, octave_link::do_update_breakpoint_hook_fcn): New functions. (octave_link::do_update_debug_pointer): Improve error messages. * octave-main-thread.cc (dbstop_hook_fcn, dbclear_hook_fcn): New functions. (octave_main_thread::octave_main_thread): Install hook functions for for dbstop and dbclear hooks. * octave-qt-event-listener.h, octave-qt-event-listener.cc (octave_qt_event_listener::update_dbstop_marker): New fucntion. (octave_qt_event_listener::update_dbstop_marker_signal): New signal.
author John W. Eaton <jwe@octave.org>
date Thu, 28 Mar 2013 03:20:25 -0400
parents 359098ad343e
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
15204
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
1 /*
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
2
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
3 Copyright (C) 2011-2012 Jacob Dawid
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
4
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
5 This file is part of Octave.
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
6
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
7 Octave is free software; you can redistribute it and/or modify it
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
8 under the terms of the GNU General Public License as published by the
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
9 Free Software Foundation; either version 3 of the License, or (at your
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
10 option) any later version.
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
11
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
12 Octave is distributed in the hope that it will be useful, but WITHOUT
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
15 for more details.
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
16
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
17 You should have received a copy of the GNU General Public License
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
18 along with Octave; see the file COPYING. If not, see
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
19 <http://www.gnu.org/licenses/>.
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
20
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
21 */
13543
8d529f8103dc Separated backend files to folder.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 13541
diff changeset
22
13540
0dbf8681cd08 Seperated classes into own files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
23 #ifndef OCTAVEMAINTHREAD_H
0dbf8681cd08 Seperated classes into own files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
24 #define OCTAVEMAINTHREAD_H
0dbf8681cd08 Seperated classes into own files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
25
0dbf8681cd08 Seperated classes into own files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
26 #include <QThread>
14713
565ddd85565e Added comments for the octave-adapter module.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
27
565ddd85565e Added comments for the octave-adapter module.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
28 /**
565ddd85565e Added comments for the octave-adapter module.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
29 * \class octave_main
565ddd85565e Added comments for the octave-adapter module.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
30 * \brief This class represents a thread just running octave_main.
565ddd85565e Added comments for the octave-adapter module.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
31 * \author Jacob Dawid
565ddd85565e Added comments for the octave-adapter module.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
32 */
565ddd85565e Added comments for the octave-adapter module.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
33 class octave_main_thread : public QThread
13540
0dbf8681cd08 Seperated classes into own files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
34 {
0dbf8681cd08 Seperated classes into own files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
35 Q_OBJECT
0dbf8681cd08 Seperated classes into own files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
36 public:
14713
565ddd85565e Added comments for the octave-adapter module.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
37 /** Creates a new thread running octave_main. */
14719
89c64340e9ab Extended event based communication model.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14713
diff changeset
38 octave_main_thread ();
13540
0dbf8681cd08 Seperated classes into own files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
39
0dbf8681cd08 Seperated classes into own files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
40 signals:
15045
1ffaad442161 Source code formatting (80-column lines, mostly whitespace changes)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 14719
diff changeset
41 /** This signal will be emitted when the thread is about to actually
1ffaad442161 Source code formatting (80-column lines, mostly whitespace changes)
Jordi Gutiérrez Hermoso <jordigh@octave.org>
parents: 14719
diff changeset
42 * run octave_main. */
13540
0dbf8681cd08 Seperated classes into own files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
43 void ready();
0dbf8681cd08 Seperated classes into own files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
44
0dbf8681cd08 Seperated classes into own files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
45 protected:
14713
565ddd85565e Added comments for the octave-adapter module.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14709
diff changeset
46 /** Runs octave_main. */
13540
0dbf8681cd08 Seperated classes into own files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
47 void run ();
0dbf8681cd08 Seperated classes into own files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
48 };
0dbf8681cd08 Seperated classes into own files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
49
0dbf8681cd08 Seperated classes into own files.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
50 #endif // OCTAVEMAINTHREAD_H