Mercurial > hg > octave-avbm
annotate libinterp/interpfcn/octave-link.h @ 16627:a86a14e6e65e
Decorate symbols with OCTINTERP_API.
* libinterp/interfcn/load-save.h (is_octave_data_file): Add OCTINTERP_API.
* libinterp/interfcn/octave-link.h (class octave_link): Likewise.
author | Michael Goffioul <michael.goffioul@gmail.com> |
---|---|
date | Mon, 06 May 2013 20:02:01 -0400 |
parents | fa4a035e0cf4 |
children |
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 |
16417
70032fc70bee
move octave-link and octave-event-listener classes to libinterp
John W. Eaton <jwe@octave.org>
parents:
16401
diff
changeset
|
3 Copyright (C) 2013 John W. Eaton |
15204
359098ad343e
update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents:
15196
diff
changeset
|
4 Copyright (C) 2011-2012 Jacob Dawid |
359098ad343e
update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents:
15196
diff
changeset
|
5 Copyright (C) 2011-2012 John P. Swensen |
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 This file is part of Octave. |
359098ad343e
update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents:
15196
diff
changeset
|
8 |
359098ad343e
update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents:
15196
diff
changeset
|
9 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
|
10 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
|
11 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
|
12 option) any later version. |
359098ad343e
update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents:
15196
diff
changeset
|
13 |
359098ad343e
update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents:
15196
diff
changeset
|
14 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
|
15 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
|
16 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
|
17 for more details. |
359098ad343e
update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents:
15196
diff
changeset
|
18 |
359098ad343e
update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents:
15196
diff
changeset
|
19 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
|
20 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
|
21 <http://www.gnu.org/licenses/>. |
359098ad343e
update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents:
15196
diff
changeset
|
22 |
359098ad343e
update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents:
15196
diff
changeset
|
23 */ |
13501 | 24 |
16417
70032fc70bee
move octave-link and octave-event-listener classes to libinterp
John W. Eaton <jwe@octave.org>
parents:
16401
diff
changeset
|
25 #if !defined (octave_link_h) |
70032fc70bee
move octave-link and octave-event-listener classes to libinterp
John W. Eaton <jwe@octave.org>
parents:
16401
diff
changeset
|
26 #define octave_link_h 1 |
13501 | 27 |
15155
9e62d5a3a45e
partial cleanup of include files in gui sources
John W. Eaton <jwe@octave.org>
parents:
15080
diff
changeset
|
28 #include <string> |
13501 | 29 |
16422
81ec95768520
use octave-link instead of hook for edit function
John W. Eaton <jwe@octave.org>
parents:
16421
diff
changeset
|
30 #include "event-queue.h" |
16379
8430ea8c1594
open editor tab and insert marker for debugging with gui
John W. Eaton <jwe@octave.org>
parents:
16350
diff
changeset
|
31 |
16422
81ec95768520
use octave-link instead of hook for edit function
John W. Eaton <jwe@octave.org>
parents:
16421
diff
changeset
|
32 class octave_mutex; |
16433
5982d469f79b
use signal for setting, appending to, and clearing history widget
John W. Eaton <jwe@octave.org>
parents:
16428
diff
changeset
|
33 class string_vector; |
16470
0f143f68078d
use signal/slot for updating workspace instead of using event listener
John W. Eaton <jwe@octave.org>
parents:
16445
diff
changeset
|
34 class workspace_element; |
13541
b48ac9ad8de0
Highly improved separation of model and view classes.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13522
diff
changeset
|
35 |
15371
eec0d1fcba4f
use Octave singleton style for octave_link class
John W. Eaton <jwe@octave.org>
parents:
15204
diff
changeset
|
36 // \class OctaveLink |
eec0d1fcba4f
use Octave singleton style for octave_link class
John W. Eaton <jwe@octave.org>
parents:
15204
diff
changeset
|
37 // \brief Provides threadsafe access to octave. |
eec0d1fcba4f
use Octave singleton style for octave_link class
John W. Eaton <jwe@octave.org>
parents:
15204
diff
changeset
|
38 // \author Jacob Dawid |
eec0d1fcba4f
use Octave singleton style for octave_link class
John W. Eaton <jwe@octave.org>
parents:
15204
diff
changeset
|
39 // |
eec0d1fcba4f
use Octave singleton style for octave_link class
John W. Eaton <jwe@octave.org>
parents:
15204
diff
changeset
|
40 // This class is a wrapper around octave and provides thread safety by |
eec0d1fcba4f
use Octave singleton style for octave_link class
John W. Eaton <jwe@octave.org>
parents:
15204
diff
changeset
|
41 // buffering access operations to octave and executing them in the |
eec0d1fcba4f
use Octave singleton style for octave_link class
John W. Eaton <jwe@octave.org>
parents:
15204
diff
changeset
|
42 // readline event hook, which lives in the octave thread. |
eec0d1fcba4f
use Octave singleton style for octave_link class
John W. Eaton <jwe@octave.org>
parents:
15204
diff
changeset
|
43 |
16627
a86a14e6e65e
Decorate symbols with OCTINTERP_API.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16583
diff
changeset
|
44 class |
a86a14e6e65e
Decorate symbols with OCTINTERP_API.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16583
diff
changeset
|
45 OCTINTERP_API |
a86a14e6e65e
Decorate symbols with OCTINTERP_API.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16583
diff
changeset
|
46 octave_link |
13501 | 47 { |
15371
eec0d1fcba4f
use Octave singleton style for octave_link class
John W. Eaton <jwe@octave.org>
parents:
15204
diff
changeset
|
48 protected: |
eec0d1fcba4f
use Octave singleton style for octave_link class
John W. Eaton <jwe@octave.org>
parents:
15204
diff
changeset
|
49 |
eec0d1fcba4f
use Octave singleton style for octave_link class
John W. Eaton <jwe@octave.org>
parents:
15204
diff
changeset
|
50 octave_link (void); |
eec0d1fcba4f
use Octave singleton style for octave_link class
John W. Eaton <jwe@octave.org>
parents:
15204
diff
changeset
|
51 |
13501 | 52 public: |
15371
eec0d1fcba4f
use Octave singleton style for octave_link class
John W. Eaton <jwe@octave.org>
parents:
15204
diff
changeset
|
53 |
16417
70032fc70bee
move octave-link and octave-event-listener classes to libinterp
John W. Eaton <jwe@octave.org>
parents:
16401
diff
changeset
|
54 virtual ~octave_link (void) { } |
15371
eec0d1fcba4f
use Octave singleton style for octave_link class
John W. Eaton <jwe@octave.org>
parents:
15204
diff
changeset
|
55 |
eec0d1fcba4f
use Octave singleton style for octave_link class
John W. Eaton <jwe@octave.org>
parents:
15204
diff
changeset
|
56 static void generate_events (void) |
eec0d1fcba4f
use Octave singleton style for octave_link class
John W. Eaton <jwe@octave.org>
parents:
15204
diff
changeset
|
57 { |
16487
8b783661e03f
improve exit sequence for GUI
John W. Eaton <jwe@octave.org>
parents:
16481
diff
changeset
|
58 if (enabled ()) |
15371
eec0d1fcba4f
use Octave singleton style for octave_link class
John W. Eaton <jwe@octave.org>
parents:
15204
diff
changeset
|
59 instance->do_generate_events (); |
eec0d1fcba4f
use Octave singleton style for octave_link class
John W. Eaton <jwe@octave.org>
parents:
15204
diff
changeset
|
60 } |
eec0d1fcba4f
use Octave singleton style for octave_link class
John W. Eaton <jwe@octave.org>
parents:
15204
diff
changeset
|
61 |
16487
8b783661e03f
improve exit sequence for GUI
John W. Eaton <jwe@octave.org>
parents:
16481
diff
changeset
|
62 // If disable is TRUE, then no additional events will be processed |
8b783661e03f
improve exit sequence for GUI
John W. Eaton <jwe@octave.org>
parents:
16481
diff
changeset
|
63 // other than exit. |
8b783661e03f
improve exit sequence for GUI
John W. Eaton <jwe@octave.org>
parents:
16481
diff
changeset
|
64 |
8b783661e03f
improve exit sequence for GUI
John W. Eaton <jwe@octave.org>
parents:
16481
diff
changeset
|
65 static void process_events (bool disable = false) |
15371
eec0d1fcba4f
use Octave singleton style for octave_link class
John W. Eaton <jwe@octave.org>
parents:
15204
diff
changeset
|
66 { |
16487
8b783661e03f
improve exit sequence for GUI
John W. Eaton <jwe@octave.org>
parents:
16481
diff
changeset
|
67 if (enabled ()) |
8b783661e03f
improve exit sequence for GUI
John W. Eaton <jwe@octave.org>
parents:
16481
diff
changeset
|
68 { |
8b783661e03f
improve exit sequence for GUI
John W. Eaton <jwe@octave.org>
parents:
16481
diff
changeset
|
69 if (disable) |
8b783661e03f
improve exit sequence for GUI
John W. Eaton <jwe@octave.org>
parents:
16481
diff
changeset
|
70 instance->link_enabled = false; |
8b783661e03f
improve exit sequence for GUI
John W. Eaton <jwe@octave.org>
parents:
16481
diff
changeset
|
71 |
8b783661e03f
improve exit sequence for GUI
John W. Eaton <jwe@octave.org>
parents:
16481
diff
changeset
|
72 instance->do_process_events (); |
8b783661e03f
improve exit sequence for GUI
John W. Eaton <jwe@octave.org>
parents:
16481
diff
changeset
|
73 } |
15371
eec0d1fcba4f
use Octave singleton style for octave_link class
John W. Eaton <jwe@octave.org>
parents:
15204
diff
changeset
|
74 } |
eec0d1fcba4f
use Octave singleton style for octave_link class
John W. Eaton <jwe@octave.org>
parents:
15204
diff
changeset
|
75 |
16481
7a71ea0b7ae9
eliminate event listener class
John W. Eaton <jwe@octave.org>
parents:
16470
diff
changeset
|
76 static void discard_events (void) |
7a71ea0b7ae9
eliminate event listener class
John W. Eaton <jwe@octave.org>
parents:
16470
diff
changeset
|
77 { |
16487
8b783661e03f
improve exit sequence for GUI
John W. Eaton <jwe@octave.org>
parents:
16481
diff
changeset
|
78 if (enabled ()) |
16481
7a71ea0b7ae9
eliminate event listener class
John W. Eaton <jwe@octave.org>
parents:
16470
diff
changeset
|
79 instance->do_discard_events (); |
7a71ea0b7ae9
eliminate event listener class
John W. Eaton <jwe@octave.org>
parents:
16470
diff
changeset
|
80 } |
7a71ea0b7ae9
eliminate event listener class
John W. Eaton <jwe@octave.org>
parents:
16470
diff
changeset
|
81 |
16487
8b783661e03f
improve exit sequence for GUI
John W. Eaton <jwe@octave.org>
parents:
16481
diff
changeset
|
82 static bool exit (int status) |
16481
7a71ea0b7ae9
eliminate event listener class
John W. Eaton <jwe@octave.org>
parents:
16470
diff
changeset
|
83 { |
16487
8b783661e03f
improve exit sequence for GUI
John W. Eaton <jwe@octave.org>
parents:
16481
diff
changeset
|
84 bool retval = false; |
8b783661e03f
improve exit sequence for GUI
John W. Eaton <jwe@octave.org>
parents:
16481
diff
changeset
|
85 |
16481
7a71ea0b7ae9
eliminate event listener class
John W. Eaton <jwe@octave.org>
parents:
16470
diff
changeset
|
86 if (instance_ok ()) |
16487
8b783661e03f
improve exit sequence for GUI
John W. Eaton <jwe@octave.org>
parents:
16481
diff
changeset
|
87 retval = instance->do_exit (status); |
8b783661e03f
improve exit sequence for GUI
John W. Eaton <jwe@octave.org>
parents:
16481
diff
changeset
|
88 |
8b783661e03f
improve exit sequence for GUI
John W. Eaton <jwe@octave.org>
parents:
16481
diff
changeset
|
89 return retval; |
16481
7a71ea0b7ae9
eliminate event listener class
John W. Eaton <jwe@octave.org>
parents:
16470
diff
changeset
|
90 } |
7a71ea0b7ae9
eliminate event listener class
John W. Eaton <jwe@octave.org>
parents:
16470
diff
changeset
|
91 |
15402
7f423c6111c6
refactor GUI event handling to use new event_queue class
John W. Eaton <jwe@octave.org>
parents:
15388
diff
changeset
|
92 template <class T> |
7f423c6111c6
refactor GUI event handling to use new event_queue class
John W. Eaton <jwe@octave.org>
parents:
15388
diff
changeset
|
93 static void post_event (T *obj, void (T::*method) (void)) |
15371
eec0d1fcba4f
use Octave singleton style for octave_link class
John W. Eaton <jwe@octave.org>
parents:
15204
diff
changeset
|
94 { |
16487
8b783661e03f
improve exit sequence for GUI
John W. Eaton <jwe@octave.org>
parents:
16481
diff
changeset
|
95 if (enabled ()) |
15402
7f423c6111c6
refactor GUI event handling to use new event_queue class
John W. Eaton <jwe@octave.org>
parents:
15388
diff
changeset
|
96 instance->do_post_event (obj, method); |
7f423c6111c6
refactor GUI event handling to use new event_queue class
John W. Eaton <jwe@octave.org>
parents:
15388
diff
changeset
|
97 } |
7f423c6111c6
refactor GUI event handling to use new event_queue class
John W. Eaton <jwe@octave.org>
parents:
15388
diff
changeset
|
98 |
7f423c6111c6
refactor GUI event handling to use new event_queue class
John W. Eaton <jwe@octave.org>
parents:
15388
diff
changeset
|
99 template <class T, class A> |
7f423c6111c6
refactor GUI event handling to use new event_queue class
John W. Eaton <jwe@octave.org>
parents:
15388
diff
changeset
|
100 static void post_event (T *obj, void (T::*method) (A), A arg) |
7f423c6111c6
refactor GUI event handling to use new event_queue class
John W. Eaton <jwe@octave.org>
parents:
15388
diff
changeset
|
101 { |
16487
8b783661e03f
improve exit sequence for GUI
John W. Eaton <jwe@octave.org>
parents:
16481
diff
changeset
|
102 if (enabled ()) |
15402
7f423c6111c6
refactor GUI event handling to use new event_queue class
John W. Eaton <jwe@octave.org>
parents:
15388
diff
changeset
|
103 instance->do_post_event (obj, method, arg); |
7f423c6111c6
refactor GUI event handling to use new event_queue class
John W. Eaton <jwe@octave.org>
parents:
15388
diff
changeset
|
104 } |
7f423c6111c6
refactor GUI event handling to use new event_queue class
John W. Eaton <jwe@octave.org>
parents:
15388
diff
changeset
|
105 |
7f423c6111c6
refactor GUI event handling to use new event_queue class
John W. Eaton <jwe@octave.org>
parents:
15388
diff
changeset
|
106 template <class T, class A> |
7f423c6111c6
refactor GUI event handling to use new event_queue class
John W. Eaton <jwe@octave.org>
parents:
15388
diff
changeset
|
107 static void post_event (T *obj, void (T::*method) (const A&), const A& arg) |
7f423c6111c6
refactor GUI event handling to use new event_queue class
John W. Eaton <jwe@octave.org>
parents:
15388
diff
changeset
|
108 { |
16487
8b783661e03f
improve exit sequence for GUI
John W. Eaton <jwe@octave.org>
parents:
16481
diff
changeset
|
109 if (enabled ()) |
15402
7f423c6111c6
refactor GUI event handling to use new event_queue class
John W. Eaton <jwe@octave.org>
parents:
15388
diff
changeset
|
110 instance->do_post_event (obj, method, arg); |
15371
eec0d1fcba4f
use Octave singleton style for octave_link class
John W. Eaton <jwe@octave.org>
parents:
15204
diff
changeset
|
111 } |
eec0d1fcba4f
use Octave singleton style for octave_link class
John W. Eaton <jwe@octave.org>
parents:
15204
diff
changeset
|
112 |
16504
45ae1038ee89
allow renaming of variables in workspace viewer
John W. Eaton <jwe@octave.org>
parents:
16487
diff
changeset
|
113 template <class T, class A, class B> |
45ae1038ee89
allow renaming of variables in workspace viewer
John W. Eaton <jwe@octave.org>
parents:
16487
diff
changeset
|
114 static void post_event (T *obj, void (T::*method) (const A&, const B&), |
45ae1038ee89
allow renaming of variables in workspace viewer
John W. Eaton <jwe@octave.org>
parents:
16487
diff
changeset
|
115 const A& arg_a, const B& arg_b) |
45ae1038ee89
allow renaming of variables in workspace viewer
John W. Eaton <jwe@octave.org>
parents:
16487
diff
changeset
|
116 { |
45ae1038ee89
allow renaming of variables in workspace viewer
John W. Eaton <jwe@octave.org>
parents:
16487
diff
changeset
|
117 if (enabled ()) |
45ae1038ee89
allow renaming of variables in workspace viewer
John W. Eaton <jwe@octave.org>
parents:
16487
diff
changeset
|
118 instance->do_post_event (obj, method, arg_a, arg_b); |
45ae1038ee89
allow renaming of variables in workspace viewer
John W. Eaton <jwe@octave.org>
parents:
16487
diff
changeset
|
119 } |
45ae1038ee89
allow renaming of variables in workspace viewer
John W. Eaton <jwe@octave.org>
parents:
16487
diff
changeset
|
120 |
15371
eec0d1fcba4f
use Octave singleton style for octave_link class
John W. Eaton <jwe@octave.org>
parents:
15204
diff
changeset
|
121 static void entered_readline_hook (void) |
eec0d1fcba4f
use Octave singleton style for octave_link class
John W. Eaton <jwe@octave.org>
parents:
15204
diff
changeset
|
122 { |
16487
8b783661e03f
improve exit sequence for GUI
John W. Eaton <jwe@octave.org>
parents:
16481
diff
changeset
|
123 if (enabled ()) |
15371
eec0d1fcba4f
use Octave singleton style for octave_link class
John W. Eaton <jwe@octave.org>
parents:
15204
diff
changeset
|
124 instance->do_entered_readline_hook (); |
eec0d1fcba4f
use Octave singleton style for octave_link class
John W. Eaton <jwe@octave.org>
parents:
15204
diff
changeset
|
125 } |
14713
565ddd85565e
Added comments for the octave-adapter module.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14712
diff
changeset
|
126 |
15371
eec0d1fcba4f
use Octave singleton style for octave_link class
John W. Eaton <jwe@octave.org>
parents:
15204
diff
changeset
|
127 static void finished_readline_hook (void) |
eec0d1fcba4f
use Octave singleton style for octave_link class
John W. Eaton <jwe@octave.org>
parents:
15204
diff
changeset
|
128 { |
16487
8b783661e03f
improve exit sequence for GUI
John W. Eaton <jwe@octave.org>
parents:
16481
diff
changeset
|
129 if (enabled ()) |
15371
eec0d1fcba4f
use Octave singleton style for octave_link class
John W. Eaton <jwe@octave.org>
parents:
15204
diff
changeset
|
130 instance->do_finished_readline_hook (); |
eec0d1fcba4f
use Octave singleton style for octave_link class
John W. Eaton <jwe@octave.org>
parents:
15204
diff
changeset
|
131 } |
eec0d1fcba4f
use Octave singleton style for octave_link class
John W. Eaton <jwe@octave.org>
parents:
15204
diff
changeset
|
132 |
16445
7a2ee6ea7800
rename dbstop -> breakpoint in GUI interface functions
John W. Eaton <jwe@octave.org>
parents:
16440
diff
changeset
|
133 static bool |
7a2ee6ea7800
rename dbstop -> breakpoint in GUI interface functions
John W. Eaton <jwe@octave.org>
parents:
16440
diff
changeset
|
134 edit_file (const std::string& file) |
7a2ee6ea7800
rename dbstop -> breakpoint in GUI interface functions
John W. Eaton <jwe@octave.org>
parents:
16440
diff
changeset
|
135 { |
16487
8b783661e03f
improve exit sequence for GUI
John W. Eaton <jwe@octave.org>
parents:
16481
diff
changeset
|
136 return enabled () ? instance->do_edit_file (file) : false; |
16445
7a2ee6ea7800
rename dbstop -> breakpoint in GUI interface functions
John W. Eaton <jwe@octave.org>
parents:
16440
diff
changeset
|
137 } |
7a2ee6ea7800
rename dbstop -> breakpoint in GUI interface functions
John W. Eaton <jwe@octave.org>
parents:
16440
diff
changeset
|
138 |
16514
7f2395651a1c
dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
16504
diff
changeset
|
139 static int |
7f2395651a1c
dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
16504
diff
changeset
|
140 message_dialog (const std::string& dlg, const std::string& msg, |
7f2395651a1c
dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
16504
diff
changeset
|
141 const std::string& title) |
7f2395651a1c
dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
16504
diff
changeset
|
142 { |
7f2395651a1c
dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
16504
diff
changeset
|
143 return enabled () ? instance->do_message_dialog (dlg, msg, title) : 0; |
7f2395651a1c
dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
16504
diff
changeset
|
144 } |
7f2395651a1c
dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
16504
diff
changeset
|
145 |
16553
6ae555fc8c43
Add questdlg dialog function and fix variety of dialog bugs.
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
16549
diff
changeset
|
146 static std::string |
6ae555fc8c43
Add questdlg dialog function and fix variety of dialog bugs.
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
16549
diff
changeset
|
147 question_dialog (const std::string& msg, const std::string& title, |
6ae555fc8c43
Add questdlg dialog function and fix variety of dialog bugs.
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
16549
diff
changeset
|
148 const std::string& btn1, const std::string& btn2, |
6ae555fc8c43
Add questdlg dialog function and fix variety of dialog bugs.
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
16549
diff
changeset
|
149 const std::string& btn3, const std::string& btndef) |
6ae555fc8c43
Add questdlg dialog function and fix variety of dialog bugs.
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
16549
diff
changeset
|
150 { |
6ae555fc8c43
Add questdlg dialog function and fix variety of dialog bugs.
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
16549
diff
changeset
|
151 return enabled () ? instance->do_question_dialog (msg, title, btn1, |
6ae555fc8c43
Add questdlg dialog function and fix variety of dialog bugs.
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
16549
diff
changeset
|
152 btn2, btn3, btndef) : 0; |
6ae555fc8c43
Add questdlg dialog function and fix variety of dialog bugs.
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
16549
diff
changeset
|
153 } |
6ae555fc8c43
Add questdlg dialog function and fix variety of dialog bugs.
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
16549
diff
changeset
|
154 |
16514
7f2395651a1c
dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
16504
diff
changeset
|
155 static std::pair<std::list<int>, int> |
7f2395651a1c
dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
16504
diff
changeset
|
156 list_dialog (const std::list<std::string>& list, |
7f2395651a1c
dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
16504
diff
changeset
|
157 const std::string& mode, |
7f2395651a1c
dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
16504
diff
changeset
|
158 int width, int height, |
7f2395651a1c
dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
16504
diff
changeset
|
159 const std::list<int>& initial_value, |
7f2395651a1c
dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
16504
diff
changeset
|
160 const std::string& name, |
16553
6ae555fc8c43
Add questdlg dialog function and fix variety of dialog bugs.
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
16549
diff
changeset
|
161 const std::list<std::string>& prompt, |
16514
7f2395651a1c
dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
16504
diff
changeset
|
162 const std::string& ok_string, |
7f2395651a1c
dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
16504
diff
changeset
|
163 const std::string& cancel_string) |
7f2395651a1c
dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
16504
diff
changeset
|
164 { |
7f2395651a1c
dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
16504
diff
changeset
|
165 return enabled () |
7f2395651a1c
dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
16504
diff
changeset
|
166 ? instance->do_list_dialog (list, mode, width, height, |
16553
6ae555fc8c43
Add questdlg dialog function and fix variety of dialog bugs.
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
16549
diff
changeset
|
167 initial_value, name, prompt, |
16514
7f2395651a1c
dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
16504
diff
changeset
|
168 ok_string, cancel_string) |
7f2395651a1c
dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
16504
diff
changeset
|
169 : std::pair<std::list<int>, int> (); |
7f2395651a1c
dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
16504
diff
changeset
|
170 } |
7f2395651a1c
dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
16504
diff
changeset
|
171 |
7f2395651a1c
dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
16504
diff
changeset
|
172 static std::list<std::string> |
7f2395651a1c
dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
16504
diff
changeset
|
173 input_dialog (const std::list<std::string>& prompt, |
7f2395651a1c
dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
16504
diff
changeset
|
174 const std::string& title, |
16553
6ae555fc8c43
Add questdlg dialog function and fix variety of dialog bugs.
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
16549
diff
changeset
|
175 const std::list<float>& nr, |
6ae555fc8c43
Add questdlg dialog function and fix variety of dialog bugs.
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
16549
diff
changeset
|
176 const std::list<float>& nc, |
16514
7f2395651a1c
dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
16504
diff
changeset
|
177 const std::list<std::string>& defaults) |
7f2395651a1c
dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
16504
diff
changeset
|
178 { |
7f2395651a1c
dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
16504
diff
changeset
|
179 return enabled () |
7f2395651a1c
dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
16504
diff
changeset
|
180 ? instance->do_input_dialog (prompt, title, nr, nc, defaults) |
7f2395651a1c
dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
16504
diff
changeset
|
181 : std::list<std::string> (); |
7f2395651a1c
dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
16504
diff
changeset
|
182 } |
7f2395651a1c
dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
16504
diff
changeset
|
183 |
16582
adc150db1809
style fixes for uigetfile changes
John W. Eaton <jwe@octave.org>
parents:
16581
diff
changeset
|
184 typedef std::list<std::pair<std::string, std::string> > filter_list; |
adc150db1809
style fixes for uigetfile changes
John W. Eaton <jwe@octave.org>
parents:
16581
diff
changeset
|
185 |
16581
7f8db1942dc0
Add Qt link uigetfile dialog implementation.
John Donoghue <john.donoghue@ieee.org>
parents:
16572
diff
changeset
|
186 static std::list<std::string> |
16582
adc150db1809
style fixes for uigetfile changes
John W. Eaton <jwe@octave.org>
parents:
16581
diff
changeset
|
187 file_dialog (const filter_list& filter, const std::string& title, |
adc150db1809
style fixes for uigetfile changes
John W. Eaton <jwe@octave.org>
parents:
16581
diff
changeset
|
188 const std::string& filename, const std::string& dirname, |
16583
fa4a035e0cf4
Add octave_link uiputfile implementation
John Donoghue <john.donoghue@ieee.org>
parents:
16582
diff
changeset
|
189 const std::string& multimode) |
16581
7f8db1942dc0
Add Qt link uigetfile dialog implementation.
John Donoghue <john.donoghue@ieee.org>
parents:
16572
diff
changeset
|
190 { |
7f8db1942dc0
Add Qt link uigetfile dialog implementation.
John Donoghue <john.donoghue@ieee.org>
parents:
16572
diff
changeset
|
191 return enabled () |
16583
fa4a035e0cf4
Add octave_link uiputfile implementation
John Donoghue <john.donoghue@ieee.org>
parents:
16582
diff
changeset
|
192 ? instance->do_file_dialog (filter, title, filename, dirname, multimode) |
16581
7f8db1942dc0
Add Qt link uigetfile dialog implementation.
John Donoghue <john.donoghue@ieee.org>
parents:
16572
diff
changeset
|
193 : std::list<std::string> (); |
7f8db1942dc0
Add Qt link uigetfile dialog implementation.
John Donoghue <john.donoghue@ieee.org>
parents:
16572
diff
changeset
|
194 } |
7f8db1942dc0
Add Qt link uigetfile dialog implementation.
John Donoghue <john.donoghue@ieee.org>
parents:
16572
diff
changeset
|
195 |
7f8db1942dc0
Add Qt link uigetfile dialog implementation.
John Donoghue <john.donoghue@ieee.org>
parents:
16572
diff
changeset
|
196 |
16549
3cd80afc3509
improve debugging with the GUI
John W. Eaton <jwe@octave.org>
parents:
16530
diff
changeset
|
197 static int debug_cd_or_addpath_error (const std::string& file, |
3cd80afc3509
improve debugging with the GUI
John W. Eaton <jwe@octave.org>
parents:
16530
diff
changeset
|
198 const std::string& dir, |
3cd80afc3509
improve debugging with the GUI
John W. Eaton <jwe@octave.org>
parents:
16530
diff
changeset
|
199 bool addpath_option) |
3cd80afc3509
improve debugging with the GUI
John W. Eaton <jwe@octave.org>
parents:
16530
diff
changeset
|
200 { |
3cd80afc3509
improve debugging with the GUI
John W. Eaton <jwe@octave.org>
parents:
16530
diff
changeset
|
201 return enabled () |
3cd80afc3509
improve debugging with the GUI
John W. Eaton <jwe@octave.org>
parents:
16530
diff
changeset
|
202 ? instance->do_debug_cd_or_addpath_error (file, dir, addpath_option) : 0; |
3cd80afc3509
improve debugging with the GUI
John W. Eaton <jwe@octave.org>
parents:
16530
diff
changeset
|
203 } |
3cd80afc3509
improve debugging with the GUI
John W. Eaton <jwe@octave.org>
parents:
16530
diff
changeset
|
204 |
16439
919796a440c6
use signal for changing directory
John W. Eaton <jwe@octave.org>
parents:
16433
diff
changeset
|
205 static void change_directory (const std::string& dir) |
15371
eec0d1fcba4f
use Octave singleton style for octave_link class
John W. Eaton <jwe@octave.org>
parents:
15204
diff
changeset
|
206 { |
16487
8b783661e03f
improve exit sequence for GUI
John W. Eaton <jwe@octave.org>
parents:
16481
diff
changeset
|
207 if (enabled ()) |
16439
919796a440c6
use signal for changing directory
John W. Eaton <jwe@octave.org>
parents:
16433
diff
changeset
|
208 instance->do_change_directory (dir); |
15371
eec0d1fcba4f
use Octave singleton style for octave_link class
John W. Eaton <jwe@octave.org>
parents:
15204
diff
changeset
|
209 } |
eec0d1fcba4f
use Octave singleton style for octave_link class
John W. Eaton <jwe@octave.org>
parents:
15204
diff
changeset
|
210 |
16572
d5ae5aa80d42
preserve pending command line input when running commands from GUI actions
John W. Eaton <jwe@octave.org>
parents:
16554
diff
changeset
|
211 // Preserves pending input. |
d5ae5aa80d42
preserve pending command line input when running commands from GUI actions
John W. Eaton <jwe@octave.org>
parents:
16554
diff
changeset
|
212 static void execute_command_in_terminal (const std::string& command) |
d5ae5aa80d42
preserve pending command line input when running commands from GUI actions
John W. Eaton <jwe@octave.org>
parents:
16554
diff
changeset
|
213 { |
d5ae5aa80d42
preserve pending command line input when running commands from GUI actions
John W. Eaton <jwe@octave.org>
parents:
16554
diff
changeset
|
214 if (enabled ()) |
d5ae5aa80d42
preserve pending command line input when running commands from GUI actions
John W. Eaton <jwe@octave.org>
parents:
16554
diff
changeset
|
215 instance->do_execute_command_in_terminal (command); |
d5ae5aa80d42
preserve pending command line input when running commands from GUI actions
John W. Eaton <jwe@octave.org>
parents:
16554
diff
changeset
|
216 } |
d5ae5aa80d42
preserve pending command line input when running commands from GUI actions
John W. Eaton <jwe@octave.org>
parents:
16554
diff
changeset
|
217 |
16526
6a8e63dadfad
provide octave_link::set_workspace function with default values
John W. Eaton <jwe@octave.org>
parents:
16514
diff
changeset
|
218 static void set_workspace (void); |
6a8e63dadfad
provide octave_link::set_workspace function with default values
John W. Eaton <jwe@octave.org>
parents:
16514
diff
changeset
|
219 |
16504
45ae1038ee89
allow renaming of variables in workspace viewer
John W. Eaton <jwe@octave.org>
parents:
16487
diff
changeset
|
220 static void set_workspace (bool top_level, |
45ae1038ee89
allow renaming of variables in workspace viewer
John W. Eaton <jwe@octave.org>
parents:
16487
diff
changeset
|
221 const std::list<workspace_element>& ws) |
16350
d4b6ad43bc87
use direct callbacks instead to handle history and workspace list updates
John W. Eaton <jwe@octave.org>
parents:
15402
diff
changeset
|
222 { |
16487
8b783661e03f
improve exit sequence for GUI
John W. Eaton <jwe@octave.org>
parents:
16481
diff
changeset
|
223 if (enabled ()) |
16504
45ae1038ee89
allow renaming of variables in workspace viewer
John W. Eaton <jwe@octave.org>
parents:
16487
diff
changeset
|
224 instance->do_set_workspace (top_level, ws); |
16470
0f143f68078d
use signal/slot for updating workspace instead of using event listener
John W. Eaton <jwe@octave.org>
parents:
16445
diff
changeset
|
225 } |
0f143f68078d
use signal/slot for updating workspace instead of using event listener
John W. Eaton <jwe@octave.org>
parents:
16445
diff
changeset
|
226 |
0f143f68078d
use signal/slot for updating workspace instead of using event listener
John W. Eaton <jwe@octave.org>
parents:
16445
diff
changeset
|
227 static void clear_workspace (void) |
0f143f68078d
use signal/slot for updating workspace instead of using event listener
John W. Eaton <jwe@octave.org>
parents:
16445
diff
changeset
|
228 { |
16487
8b783661e03f
improve exit sequence for GUI
John W. Eaton <jwe@octave.org>
parents:
16481
diff
changeset
|
229 if (enabled ()) |
16470
0f143f68078d
use signal/slot for updating workspace instead of using event listener
John W. Eaton <jwe@octave.org>
parents:
16445
diff
changeset
|
230 instance->do_clear_workspace (); |
16350
d4b6ad43bc87
use direct callbacks instead to handle history and workspace list updates
John W. Eaton <jwe@octave.org>
parents:
15402
diff
changeset
|
231 } |
d4b6ad43bc87
use direct callbacks instead to handle history and workspace list updates
John W. Eaton <jwe@octave.org>
parents:
15402
diff
changeset
|
232 |
16433
5982d469f79b
use signal for setting, appending to, and clearing history widget
John W. Eaton <jwe@octave.org>
parents:
16428
diff
changeset
|
233 static void set_history (const string_vector& hist) |
16350
d4b6ad43bc87
use direct callbacks instead to handle history and workspace list updates
John W. Eaton <jwe@octave.org>
parents:
15402
diff
changeset
|
234 { |
16487
8b783661e03f
improve exit sequence for GUI
John W. Eaton <jwe@octave.org>
parents:
16481
diff
changeset
|
235 if (enabled ()) |
16433
5982d469f79b
use signal for setting, appending to, and clearing history widget
John W. Eaton <jwe@octave.org>
parents:
16428
diff
changeset
|
236 instance->do_set_history (hist); |
5982d469f79b
use signal for setting, appending to, and clearing history widget
John W. Eaton <jwe@octave.org>
parents:
16428
diff
changeset
|
237 } |
5982d469f79b
use signal for setting, appending to, and clearing history widget
John W. Eaton <jwe@octave.org>
parents:
16428
diff
changeset
|
238 |
5982d469f79b
use signal for setting, appending to, and clearing history widget
John W. Eaton <jwe@octave.org>
parents:
16428
diff
changeset
|
239 static void append_history (const std::string& hist_entry) |
5982d469f79b
use signal for setting, appending to, and clearing history widget
John W. Eaton <jwe@octave.org>
parents:
16428
diff
changeset
|
240 { |
16487
8b783661e03f
improve exit sequence for GUI
John W. Eaton <jwe@octave.org>
parents:
16481
diff
changeset
|
241 if (enabled ()) |
16433
5982d469f79b
use signal for setting, appending to, and clearing history widget
John W. Eaton <jwe@octave.org>
parents:
16428
diff
changeset
|
242 instance->do_append_history (hist_entry); |
5982d469f79b
use signal for setting, appending to, and clearing history widget
John W. Eaton <jwe@octave.org>
parents:
16428
diff
changeset
|
243 } |
5982d469f79b
use signal for setting, appending to, and clearing history widget
John W. Eaton <jwe@octave.org>
parents:
16428
diff
changeset
|
244 |
5982d469f79b
use signal for setting, appending to, and clearing history widget
John W. Eaton <jwe@octave.org>
parents:
16428
diff
changeset
|
245 static void clear_history (void) |
5982d469f79b
use signal for setting, appending to, and clearing history widget
John W. Eaton <jwe@octave.org>
parents:
16428
diff
changeset
|
246 { |
16487
8b783661e03f
improve exit sequence for GUI
John W. Eaton <jwe@octave.org>
parents:
16481
diff
changeset
|
247 if (enabled ()) |
16433
5982d469f79b
use signal for setting, appending to, and clearing history widget
John W. Eaton <jwe@octave.org>
parents:
16428
diff
changeset
|
248 instance->do_clear_history (); |
16350
d4b6ad43bc87
use direct callbacks instead to handle history and workspace list updates
John W. Eaton <jwe@octave.org>
parents:
15402
diff
changeset
|
249 } |
d4b6ad43bc87
use direct callbacks instead to handle history and workspace list updates
John W. Eaton <jwe@octave.org>
parents:
15402
diff
changeset
|
250 |
16417
70032fc70bee
move octave-link and octave-event-listener classes to libinterp
John W. Eaton <jwe@octave.org>
parents:
16401
diff
changeset
|
251 static void pre_input_event (void) |
16350
d4b6ad43bc87
use direct callbacks instead to handle history and workspace list updates
John W. Eaton <jwe@octave.org>
parents:
15402
diff
changeset
|
252 { |
16487
8b783661e03f
improve exit sequence for GUI
John W. Eaton <jwe@octave.org>
parents:
16481
diff
changeset
|
253 if (enabled ()) |
16417
70032fc70bee
move octave-link and octave-event-listener classes to libinterp
John W. Eaton <jwe@octave.org>
parents:
16401
diff
changeset
|
254 instance->do_pre_input_event (); |
16350
d4b6ad43bc87
use direct callbacks instead to handle history and workspace list updates
John W. Eaton <jwe@octave.org>
parents:
15402
diff
changeset
|
255 } |
d4b6ad43bc87
use direct callbacks instead to handle history and workspace list updates
John W. Eaton <jwe@octave.org>
parents:
15402
diff
changeset
|
256 |
16417
70032fc70bee
move octave-link and octave-event-listener classes to libinterp
John W. Eaton <jwe@octave.org>
parents:
16401
diff
changeset
|
257 static void post_input_event (void) |
16350
d4b6ad43bc87
use direct callbacks instead to handle history and workspace list updates
John W. Eaton <jwe@octave.org>
parents:
15402
diff
changeset
|
258 { |
16487
8b783661e03f
improve exit sequence for GUI
John W. Eaton <jwe@octave.org>
parents:
16481
diff
changeset
|
259 if (enabled ()) |
16417
70032fc70bee
move octave-link and octave-event-listener classes to libinterp
John W. Eaton <jwe@octave.org>
parents:
16401
diff
changeset
|
260 instance->do_post_input_event (); |
16350
d4b6ad43bc87
use direct callbacks instead to handle history and workspace list updates
John W. Eaton <jwe@octave.org>
parents:
15402
diff
changeset
|
261 } |
d4b6ad43bc87
use direct callbacks instead to handle history and workspace list updates
John W. Eaton <jwe@octave.org>
parents:
15402
diff
changeset
|
262 |
16421
16bfbf9136d3
avoid creating unnecessary octave_value objects for octave_link calls
John W. Eaton <jwe@octave.org>
parents:
16417
diff
changeset
|
263 static void enter_debugger_event (const std::string& file, int line) |
16379
8430ea8c1594
open editor tab and insert marker for debugging with gui
John W. Eaton <jwe@octave.org>
parents:
16350
diff
changeset
|
264 { |
16487
8b783661e03f
improve exit sequence for GUI
John W. Eaton <jwe@octave.org>
parents:
16481
diff
changeset
|
265 if (enabled ()) |
16440
a971d8bdaadc
use signals instead of event queue for entering/leaving debug mode
John W. Eaton <jwe@octave.org>
parents:
16439
diff
changeset
|
266 { |
a971d8bdaadc
use signals instead of event queue for entering/leaving debug mode
John W. Eaton <jwe@octave.org>
parents:
16439
diff
changeset
|
267 instance->debugging = true; |
a971d8bdaadc
use signals instead of event queue for entering/leaving debug mode
John W. Eaton <jwe@octave.org>
parents:
16439
diff
changeset
|
268 |
a971d8bdaadc
use signals instead of event queue for entering/leaving debug mode
John W. Eaton <jwe@octave.org>
parents:
16439
diff
changeset
|
269 instance->do_enter_debugger_event (file, line); |
a971d8bdaadc
use signals instead of event queue for entering/leaving debug mode
John W. Eaton <jwe@octave.org>
parents:
16439
diff
changeset
|
270 } |
16397
fc491da603f6
also provide a hook for exiting debugger
John W. Eaton <jwe@octave.org>
parents:
16388
diff
changeset
|
271 } |
fc491da603f6
also provide a hook for exiting debugger
John W. Eaton <jwe@octave.org>
parents:
16388
diff
changeset
|
272 |
16440
a971d8bdaadc
use signals instead of event queue for entering/leaving debug mode
John W. Eaton <jwe@octave.org>
parents:
16439
diff
changeset
|
273 static void execute_in_debugger_event (const std::string& file, int line) |
16397
fc491da603f6
also provide a hook for exiting debugger
John W. Eaton <jwe@octave.org>
parents:
16388
diff
changeset
|
274 { |
16487
8b783661e03f
improve exit sequence for GUI
John W. Eaton <jwe@octave.org>
parents:
16481
diff
changeset
|
275 if (enabled ()) |
16440
a971d8bdaadc
use signals instead of event queue for entering/leaving debug mode
John W. Eaton <jwe@octave.org>
parents:
16439
diff
changeset
|
276 instance->do_execute_in_debugger_event (file, line); |
a971d8bdaadc
use signals instead of event queue for entering/leaving debug mode
John W. Eaton <jwe@octave.org>
parents:
16439
diff
changeset
|
277 } |
a971d8bdaadc
use signals instead of event queue for entering/leaving debug mode
John W. Eaton <jwe@octave.org>
parents:
16439
diff
changeset
|
278 |
a971d8bdaadc
use signals instead of event queue for entering/leaving debug mode
John W. Eaton <jwe@octave.org>
parents:
16439
diff
changeset
|
279 static void exit_debugger_event (void) |
a971d8bdaadc
use signals instead of event queue for entering/leaving debug mode
John W. Eaton <jwe@octave.org>
parents:
16439
diff
changeset
|
280 { |
16487
8b783661e03f
improve exit sequence for GUI
John W. Eaton <jwe@octave.org>
parents:
16481
diff
changeset
|
281 if (enabled () && instance->debugging) |
16440
a971d8bdaadc
use signals instead of event queue for entering/leaving debug mode
John W. Eaton <jwe@octave.org>
parents:
16439
diff
changeset
|
282 { |
a971d8bdaadc
use signals instead of event queue for entering/leaving debug mode
John W. Eaton <jwe@octave.org>
parents:
16439
diff
changeset
|
283 instance->debugging = false; |
a971d8bdaadc
use signals instead of event queue for entering/leaving debug mode
John W. Eaton <jwe@octave.org>
parents:
16439
diff
changeset
|
284 |
a971d8bdaadc
use signals instead of event queue for entering/leaving debug mode
John W. Eaton <jwe@octave.org>
parents:
16439
diff
changeset
|
285 instance->do_exit_debugger_event (); |
a971d8bdaadc
use signals instead of event queue for entering/leaving debug mode
John W. Eaton <jwe@octave.org>
parents:
16439
diff
changeset
|
286 } |
16379
8430ea8c1594
open editor tab and insert marker for debugging with gui
John W. Eaton <jwe@octave.org>
parents:
16350
diff
changeset
|
287 } |
8430ea8c1594
open editor tab and insert marker for debugging with gui
John W. Eaton <jwe@octave.org>
parents:
16350
diff
changeset
|
288 |
16388
4902484f9181
callbacks to set markers in editor using command line dbstop function
John W. Eaton <jwe@octave.org>
parents:
16385
diff
changeset
|
289 static void |
16421
16bfbf9136d3
avoid creating unnecessary octave_value objects for octave_link calls
John W. Eaton <jwe@octave.org>
parents:
16417
diff
changeset
|
290 update_breakpoint (bool insert, const std::string& file, int line) |
16388
4902484f9181
callbacks to set markers in editor using command line dbstop function
John W. Eaton <jwe@octave.org>
parents:
16385
diff
changeset
|
291 { |
16487
8b783661e03f
improve exit sequence for GUI
John W. Eaton <jwe@octave.org>
parents:
16481
diff
changeset
|
292 if (enabled ()) |
16421
16bfbf9136d3
avoid creating unnecessary octave_value objects for octave_link calls
John W. Eaton <jwe@octave.org>
parents:
16417
diff
changeset
|
293 instance->do_update_breakpoint (insert, file, line); |
16388
4902484f9181
callbacks to set markers in editor using command line dbstop function
John W. Eaton <jwe@octave.org>
parents:
16385
diff
changeset
|
294 } |
4902484f9181
callbacks to set markers in editor using command line dbstop function
John W. Eaton <jwe@octave.org>
parents:
16385
diff
changeset
|
295 |
16423
40d1ddca4db5
improve use of octave_link
John W. Eaton <jwe@octave.org>
parents:
16422
diff
changeset
|
296 static void connect_link (octave_link *); |
16417
70032fc70bee
move octave-link and octave-event-listener classes to libinterp
John W. Eaton <jwe@octave.org>
parents:
16401
diff
changeset
|
297 |
16530
9bc1f8278966
allow GUI to customize prompts at startup
John W. Eaton <jwe@octave.org>
parents:
16526
diff
changeset
|
298 static void set_default_prompts (std::string& ps1, std::string& ps2, |
9bc1f8278966
allow GUI to customize prompts at startup
John W. Eaton <jwe@octave.org>
parents:
16526
diff
changeset
|
299 std::string& ps4) |
9bc1f8278966
allow GUI to customize prompts at startup
John W. Eaton <jwe@octave.org>
parents:
16526
diff
changeset
|
300 { |
9bc1f8278966
allow GUI to customize prompts at startup
John W. Eaton <jwe@octave.org>
parents:
16526
diff
changeset
|
301 if (enabled ()) |
9bc1f8278966
allow GUI to customize prompts at startup
John W. Eaton <jwe@octave.org>
parents:
16526
diff
changeset
|
302 instance->do_set_default_prompts (ps1, ps2, ps4); |
9bc1f8278966
allow GUI to customize prompts at startup
John W. Eaton <jwe@octave.org>
parents:
16526
diff
changeset
|
303 } |
9bc1f8278966
allow GUI to customize prompts at startup
John W. Eaton <jwe@octave.org>
parents:
16526
diff
changeset
|
304 |
16554
8fc1f6535380
new function, __octave_link_enabled__
John W. Eaton <jwe@octave.org>
parents:
16553
diff
changeset
|
305 static bool enabled (void) |
8fc1f6535380
new function, __octave_link_enabled__
John W. Eaton <jwe@octave.org>
parents:
16553
diff
changeset
|
306 { |
8fc1f6535380
new function, __octave_link_enabled__
John W. Eaton <jwe@octave.org>
parents:
16553
diff
changeset
|
307 return instance_ok () ? instance->link_enabled : false; |
8fc1f6535380
new function, __octave_link_enabled__
John W. Eaton <jwe@octave.org>
parents:
16553
diff
changeset
|
308 } |
8fc1f6535380
new function, __octave_link_enabled__
John W. Eaton <jwe@octave.org>
parents:
16553
diff
changeset
|
309 |
15371
eec0d1fcba4f
use Octave singleton style for octave_link class
John W. Eaton <jwe@octave.org>
parents:
15204
diff
changeset
|
310 private: |
eec0d1fcba4f
use Octave singleton style for octave_link class
John W. Eaton <jwe@octave.org>
parents:
15204
diff
changeset
|
311 |
eec0d1fcba4f
use Octave singleton style for octave_link class
John W. Eaton <jwe@octave.org>
parents:
15204
diff
changeset
|
312 static octave_link *instance; |
eec0d1fcba4f
use Octave singleton style for octave_link class
John W. Eaton <jwe@octave.org>
parents:
15204
diff
changeset
|
313 |
eec0d1fcba4f
use Octave singleton style for octave_link class
John W. Eaton <jwe@octave.org>
parents:
15204
diff
changeset
|
314 // No copying! |
eec0d1fcba4f
use Octave singleton style for octave_link class
John W. Eaton <jwe@octave.org>
parents:
15204
diff
changeset
|
315 |
eec0d1fcba4f
use Octave singleton style for octave_link class
John W. Eaton <jwe@octave.org>
parents:
15204
diff
changeset
|
316 octave_link (const octave_link&); |
eec0d1fcba4f
use Octave singleton style for octave_link class
John W. Eaton <jwe@octave.org>
parents:
15204
diff
changeset
|
317 |
eec0d1fcba4f
use Octave singleton style for octave_link class
John W. Eaton <jwe@octave.org>
parents:
15204
diff
changeset
|
318 octave_link& operator = (const octave_link&); |
eec0d1fcba4f
use Octave singleton style for octave_link class
John W. Eaton <jwe@octave.org>
parents:
15204
diff
changeset
|
319 |
16487
8b783661e03f
improve exit sequence for GUI
John W. Eaton <jwe@octave.org>
parents:
16481
diff
changeset
|
320 static bool instance_ok (void) { return instance != 0; } |
8b783661e03f
improve exit sequence for GUI
John W. Eaton <jwe@octave.org>
parents:
16481
diff
changeset
|
321 |
16417
70032fc70bee
move octave-link and octave-event-listener classes to libinterp
John W. Eaton <jwe@octave.org>
parents:
16401
diff
changeset
|
322 protected: |
14719
89c64340e9ab
Extended event based communication model.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14718
diff
changeset
|
323 |
15371
eec0d1fcba4f
use Octave singleton style for octave_link class
John W. Eaton <jwe@octave.org>
parents:
15204
diff
changeset
|
324 // Semaphore to lock access to the event queue. |
eec0d1fcba4f
use Octave singleton style for octave_link class
John W. Eaton <jwe@octave.org>
parents:
15204
diff
changeset
|
325 octave_mutex *event_queue_mutex; |
eec0d1fcba4f
use Octave singleton style for octave_link class
John W. Eaton <jwe@octave.org>
parents:
15204
diff
changeset
|
326 |
15402
7f423c6111c6
refactor GUI event handling to use new event_queue class
John W. Eaton <jwe@octave.org>
parents:
15388
diff
changeset
|
327 // Event Queue. |
7f423c6111c6
refactor GUI event handling to use new event_queue class
John W. Eaton <jwe@octave.org>
parents:
15388
diff
changeset
|
328 event_queue gui_event_queue; |
15371
eec0d1fcba4f
use Octave singleton style for octave_link class
John W. Eaton <jwe@octave.org>
parents:
15204
diff
changeset
|
329 |
eec0d1fcba4f
use Octave singleton style for octave_link class
John W. Eaton <jwe@octave.org>
parents:
15204
diff
changeset
|
330 bool debugging; |
16487
8b783661e03f
improve exit sequence for GUI
John W. Eaton <jwe@octave.org>
parents:
16481
diff
changeset
|
331 bool link_enabled; |
15371
eec0d1fcba4f
use Octave singleton style for octave_link class
John W. Eaton <jwe@octave.org>
parents:
15204
diff
changeset
|
332 |
eec0d1fcba4f
use Octave singleton style for octave_link class
John W. Eaton <jwe@octave.org>
parents:
15204
diff
changeset
|
333 void do_generate_events (void); |
eec0d1fcba4f
use Octave singleton style for octave_link class
John W. Eaton <jwe@octave.org>
parents:
15204
diff
changeset
|
334 void do_process_events (void); |
16481
7a71ea0b7ae9
eliminate event listener class
John W. Eaton <jwe@octave.org>
parents:
16470
diff
changeset
|
335 void do_discard_events (void); |
7a71ea0b7ae9
eliminate event listener class
John W. Eaton <jwe@octave.org>
parents:
16470
diff
changeset
|
336 |
15402
7f423c6111c6
refactor GUI event handling to use new event_queue class
John W. Eaton <jwe@octave.org>
parents:
15388
diff
changeset
|
337 template <class T> |
7f423c6111c6
refactor GUI event handling to use new event_queue class
John W. Eaton <jwe@octave.org>
parents:
15388
diff
changeset
|
338 void do_post_event (T *obj, void (T::*method) (void)) |
7f423c6111c6
refactor GUI event handling to use new event_queue class
John W. Eaton <jwe@octave.org>
parents:
15388
diff
changeset
|
339 { |
16487
8b783661e03f
improve exit sequence for GUI
John W. Eaton <jwe@octave.org>
parents:
16481
diff
changeset
|
340 gui_event_queue.add_method (obj, method); |
15402
7f423c6111c6
refactor GUI event handling to use new event_queue class
John W. Eaton <jwe@octave.org>
parents:
15388
diff
changeset
|
341 } |
7f423c6111c6
refactor GUI event handling to use new event_queue class
John W. Eaton <jwe@octave.org>
parents:
15388
diff
changeset
|
342 |
7f423c6111c6
refactor GUI event handling to use new event_queue class
John W. Eaton <jwe@octave.org>
parents:
15388
diff
changeset
|
343 template <class T, class A> |
7f423c6111c6
refactor GUI event handling to use new event_queue class
John W. Eaton <jwe@octave.org>
parents:
15388
diff
changeset
|
344 void do_post_event (T *obj, void (T::*method) (A), A arg) |
7f423c6111c6
refactor GUI event handling to use new event_queue class
John W. Eaton <jwe@octave.org>
parents:
15388
diff
changeset
|
345 { |
16487
8b783661e03f
improve exit sequence for GUI
John W. Eaton <jwe@octave.org>
parents:
16481
diff
changeset
|
346 gui_event_queue.add_method (obj, method, arg); |
15402
7f423c6111c6
refactor GUI event handling to use new event_queue class
John W. Eaton <jwe@octave.org>
parents:
15388
diff
changeset
|
347 } |
7f423c6111c6
refactor GUI event handling to use new event_queue class
John W. Eaton <jwe@octave.org>
parents:
15388
diff
changeset
|
348 |
7f423c6111c6
refactor GUI event handling to use new event_queue class
John W. Eaton <jwe@octave.org>
parents:
15388
diff
changeset
|
349 template <class T, class A> |
7f423c6111c6
refactor GUI event handling to use new event_queue class
John W. Eaton <jwe@octave.org>
parents:
15388
diff
changeset
|
350 void do_post_event (T *obj, void (T::*method) (const A&), const A& arg) |
7f423c6111c6
refactor GUI event handling to use new event_queue class
John W. Eaton <jwe@octave.org>
parents:
15388
diff
changeset
|
351 { |
16487
8b783661e03f
improve exit sequence for GUI
John W. Eaton <jwe@octave.org>
parents:
16481
diff
changeset
|
352 gui_event_queue.add_method (obj, method, arg); |
15402
7f423c6111c6
refactor GUI event handling to use new event_queue class
John W. Eaton <jwe@octave.org>
parents:
15388
diff
changeset
|
353 } |
15371
eec0d1fcba4f
use Octave singleton style for octave_link class
John W. Eaton <jwe@octave.org>
parents:
15204
diff
changeset
|
354 |
eec0d1fcba4f
use Octave singleton style for octave_link class
John W. Eaton <jwe@octave.org>
parents:
15204
diff
changeset
|
355 void do_entered_readline_hook (void) { } |
eec0d1fcba4f
use Octave singleton style for octave_link class
John W. Eaton <jwe@octave.org>
parents:
15204
diff
changeset
|
356 void do_finished_readline_hook (void) { } |
eec0d1fcba4f
use Octave singleton style for octave_link class
John W. Eaton <jwe@octave.org>
parents:
15204
diff
changeset
|
357 |
16487
8b783661e03f
improve exit sequence for GUI
John W. Eaton <jwe@octave.org>
parents:
16481
diff
changeset
|
358 virtual bool do_exit (int status) = 0; |
8b783661e03f
improve exit sequence for GUI
John W. Eaton <jwe@octave.org>
parents:
16481
diff
changeset
|
359 |
16445
7a2ee6ea7800
rename dbstop -> breakpoint in GUI interface functions
John W. Eaton <jwe@octave.org>
parents:
16440
diff
changeset
|
360 virtual bool do_edit_file (const std::string& file) = 0; |
7a2ee6ea7800
rename dbstop -> breakpoint in GUI interface functions
John W. Eaton <jwe@octave.org>
parents:
16440
diff
changeset
|
361 |
16514
7f2395651a1c
dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
16504
diff
changeset
|
362 virtual int |
7f2395651a1c
dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
16504
diff
changeset
|
363 do_message_dialog (const std::string& dlg, const std::string& msg, |
7f2395651a1c
dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
16504
diff
changeset
|
364 const std::string& title) = 0; |
7f2395651a1c
dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
16504
diff
changeset
|
365 |
16553
6ae555fc8c43
Add questdlg dialog function and fix variety of dialog bugs.
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
16549
diff
changeset
|
366 virtual std::string |
6ae555fc8c43
Add questdlg dialog function and fix variety of dialog bugs.
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
16549
diff
changeset
|
367 do_question_dialog (const std::string& msg, const std::string& title, |
6ae555fc8c43
Add questdlg dialog function and fix variety of dialog bugs.
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
16549
diff
changeset
|
368 const std::string& btn1, const std::string& btn2, |
6ae555fc8c43
Add questdlg dialog function and fix variety of dialog bugs.
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
16549
diff
changeset
|
369 const std::string& btn3, const std::string& btndef) = 0; |
6ae555fc8c43
Add questdlg dialog function and fix variety of dialog bugs.
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
16549
diff
changeset
|
370 |
16514
7f2395651a1c
dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
16504
diff
changeset
|
371 virtual std::pair<std::list<int>, int> |
7f2395651a1c
dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
16504
diff
changeset
|
372 do_list_dialog (const std::list<std::string>& list, |
7f2395651a1c
dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
16504
diff
changeset
|
373 const std::string& mode, |
7f2395651a1c
dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
16504
diff
changeset
|
374 int width, int height, |
7f2395651a1c
dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
16504
diff
changeset
|
375 const std::list<int>& initial_value, |
7f2395651a1c
dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
16504
diff
changeset
|
376 const std::string& name, |
16553
6ae555fc8c43
Add questdlg dialog function and fix variety of dialog bugs.
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
16549
diff
changeset
|
377 const std::list<std::string>& prompt, |
16514
7f2395651a1c
dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
16504
diff
changeset
|
378 const std::string& ok_string, |
7f2395651a1c
dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
16504
diff
changeset
|
379 const std::string& cancel_string) = 0; |
7f2395651a1c
dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
16504
diff
changeset
|
380 |
7f2395651a1c
dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
16504
diff
changeset
|
381 virtual std::list<std::string> |
7f2395651a1c
dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
16504
diff
changeset
|
382 do_input_dialog (const std::list<std::string>& prompt, |
7f2395651a1c
dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
16504
diff
changeset
|
383 const std::string& title, |
16553
6ae555fc8c43
Add questdlg dialog function and fix variety of dialog bugs.
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
16549
diff
changeset
|
384 const std::list<float>& nr, |
6ae555fc8c43
Add questdlg dialog function and fix variety of dialog bugs.
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
16549
diff
changeset
|
385 const std::list<float>& nc, |
16514
7f2395651a1c
dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
16504
diff
changeset
|
386 const std::list<std::string>& defaults) = 0; |
7f2395651a1c
dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
16504
diff
changeset
|
387 |
16581
7f8db1942dc0
Add Qt link uigetfile dialog implementation.
John Donoghue <john.donoghue@ieee.org>
parents:
16572
diff
changeset
|
388 virtual std::list<std::string> |
16582
adc150db1809
style fixes for uigetfile changes
John W. Eaton <jwe@octave.org>
parents:
16581
diff
changeset
|
389 do_file_dialog (const filter_list& filter, const std::string& title, |
adc150db1809
style fixes for uigetfile changes
John W. Eaton <jwe@octave.org>
parents:
16581
diff
changeset
|
390 const std::string& filename, const std::string& dirname, |
16583
fa4a035e0cf4
Add octave_link uiputfile implementation
John Donoghue <john.donoghue@ieee.org>
parents:
16582
diff
changeset
|
391 const std::string& multimode) = 0; |
16581
7f8db1942dc0
Add Qt link uigetfile dialog implementation.
John Donoghue <john.donoghue@ieee.org>
parents:
16572
diff
changeset
|
392 |
16549
3cd80afc3509
improve debugging with the GUI
John W. Eaton <jwe@octave.org>
parents:
16530
diff
changeset
|
393 virtual int |
3cd80afc3509
improve debugging with the GUI
John W. Eaton <jwe@octave.org>
parents:
16530
diff
changeset
|
394 do_debug_cd_or_addpath_error (const std::string& file, |
3cd80afc3509
improve debugging with the GUI
John W. Eaton <jwe@octave.org>
parents:
16530
diff
changeset
|
395 const std::string& dir, |
3cd80afc3509
improve debugging with the GUI
John W. Eaton <jwe@octave.org>
parents:
16530
diff
changeset
|
396 bool addpath_option) = 0; |
3cd80afc3509
improve debugging with the GUI
John W. Eaton <jwe@octave.org>
parents:
16530
diff
changeset
|
397 |
16439
919796a440c6
use signal for changing directory
John W. Eaton <jwe@octave.org>
parents:
16433
diff
changeset
|
398 virtual void do_change_directory (const std::string& dir) = 0; |
16417
70032fc70bee
move octave-link and octave-event-listener classes to libinterp
John W. Eaton <jwe@octave.org>
parents:
16401
diff
changeset
|
399 |
16572
d5ae5aa80d42
preserve pending command line input when running commands from GUI actions
John W. Eaton <jwe@octave.org>
parents:
16554
diff
changeset
|
400 virtual void do_execute_command_in_terminal (const std::string& command) = 0; |
d5ae5aa80d42
preserve pending command line input when running commands from GUI actions
John W. Eaton <jwe@octave.org>
parents:
16554
diff
changeset
|
401 |
16470
0f143f68078d
use signal/slot for updating workspace instead of using event listener
John W. Eaton <jwe@octave.org>
parents:
16445
diff
changeset
|
402 virtual void |
16504
45ae1038ee89
allow renaming of variables in workspace viewer
John W. Eaton <jwe@octave.org>
parents:
16487
diff
changeset
|
403 do_set_workspace (bool top_level, |
45ae1038ee89
allow renaming of variables in workspace viewer
John W. Eaton <jwe@octave.org>
parents:
16487
diff
changeset
|
404 const std::list<workspace_element>& ws) = 0; |
16470
0f143f68078d
use signal/slot for updating workspace instead of using event listener
John W. Eaton <jwe@octave.org>
parents:
16445
diff
changeset
|
405 |
0f143f68078d
use signal/slot for updating workspace instead of using event listener
John W. Eaton <jwe@octave.org>
parents:
16445
diff
changeset
|
406 virtual void do_clear_workspace (void) = 0; |
16417
70032fc70bee
move octave-link and octave-event-listener classes to libinterp
John W. Eaton <jwe@octave.org>
parents:
16401
diff
changeset
|
407 |
16433
5982d469f79b
use signal for setting, appending to, and clearing history widget
John W. Eaton <jwe@octave.org>
parents:
16428
diff
changeset
|
408 virtual void do_set_history (const string_vector& hist) = 0; |
5982d469f79b
use signal for setting, appending to, and clearing history widget
John W. Eaton <jwe@octave.org>
parents:
16428
diff
changeset
|
409 virtual void do_append_history (const std::string& hist_entry) = 0; |
5982d469f79b
use signal for setting, appending to, and clearing history widget
John W. Eaton <jwe@octave.org>
parents:
16428
diff
changeset
|
410 virtual void do_clear_history (void) = 0; |
16417
70032fc70bee
move octave-link and octave-event-listener classes to libinterp
John W. Eaton <jwe@octave.org>
parents:
16401
diff
changeset
|
411 |
70032fc70bee
move octave-link and octave-event-listener classes to libinterp
John W. Eaton <jwe@octave.org>
parents:
16401
diff
changeset
|
412 virtual void do_pre_input_event (void) = 0; |
70032fc70bee
move octave-link and octave-event-listener classes to libinterp
John W. Eaton <jwe@octave.org>
parents:
16401
diff
changeset
|
413 virtual void do_post_input_event (void) = 0; |
16401
f9a737fd8829
allow command-line edit function to use GUI editor
John W. Eaton <jwe@octave.org>
parents:
16397
diff
changeset
|
414 |
16470
0f143f68078d
use signal/slot for updating workspace instead of using event listener
John W. Eaton <jwe@octave.org>
parents:
16445
diff
changeset
|
415 virtual void |
0f143f68078d
use signal/slot for updating workspace instead of using event listener
John W. Eaton <jwe@octave.org>
parents:
16445
diff
changeset
|
416 do_enter_debugger_event (const std::string& file, int line) = 0; |
0f143f68078d
use signal/slot for updating workspace instead of using event listener
John W. Eaton <jwe@octave.org>
parents:
16445
diff
changeset
|
417 |
0f143f68078d
use signal/slot for updating workspace instead of using event listener
John W. Eaton <jwe@octave.org>
parents:
16445
diff
changeset
|
418 virtual void |
0f143f68078d
use signal/slot for updating workspace instead of using event listener
John W. Eaton <jwe@octave.org>
parents:
16445
diff
changeset
|
419 do_execute_in_debugger_event (const std::string& file, int line) = 0; |
0f143f68078d
use signal/slot for updating workspace instead of using event listener
John W. Eaton <jwe@octave.org>
parents:
16445
diff
changeset
|
420 |
16440
a971d8bdaadc
use signals instead of event queue for entering/leaving debug mode
John W. Eaton <jwe@octave.org>
parents:
16439
diff
changeset
|
421 virtual void do_exit_debugger_event (void) = 0; |
16417
70032fc70bee
move octave-link and octave-event-listener classes to libinterp
John W. Eaton <jwe@octave.org>
parents:
16401
diff
changeset
|
422 |
70032fc70bee
move octave-link and octave-event-listener classes to libinterp
John W. Eaton <jwe@octave.org>
parents:
16401
diff
changeset
|
423 virtual void do_update_breakpoint (bool insert, |
16421
16bfbf9136d3
avoid creating unnecessary octave_value objects for octave_link calls
John W. Eaton <jwe@octave.org>
parents:
16417
diff
changeset
|
424 const std::string& file, int line) = 0; |
16530
9bc1f8278966
allow GUI to customize prompts at startup
John W. Eaton <jwe@octave.org>
parents:
16526
diff
changeset
|
425 |
9bc1f8278966
allow GUI to customize prompts at startup
John W. Eaton <jwe@octave.org>
parents:
16526
diff
changeset
|
426 virtual void do_set_default_prompts (std::string& ps1, std::string& ps2, |
9bc1f8278966
allow GUI to customize prompts at startup
John W. Eaton <jwe@octave.org>
parents:
16526
diff
changeset
|
427 std::string& ps4) = 0; |
15371
eec0d1fcba4f
use Octave singleton style for octave_link class
John W. Eaton <jwe@octave.org>
parents:
15204
diff
changeset
|
428 }; |
14713
565ddd85565e
Added comments for the octave-adapter module.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14712
diff
changeset
|
429 |
13501 | 430 #endif // OCTAVELINK_H |