Mercurial > octave
annotate libinterp/corefcn/octave-link.h @ 26117:a6df420457ac
use symbol_info_list instead of symbol_scope to pass workspace info to gui
* syminfo.h (symbol_info_list::varval): New function.
* octave-link.h, octave-link.cc (octave_link::set_workspace,
octave_link::do_set_workspace): Pass symbol_info object instead of
symbol_scope.
* octave-qt-link.h, octave-qt-link.cc (octave_link::do_set_workspace):
Likewise. Change all uses. Register symbol_info_list instead of
symbol_scope as a Qt meta type.
* workspace-model.h, workspace-model.cc: Store symbol_info_list object
instead of symbol_scope.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Fri, 16 Nov 2018 19:35:39 -0500 |
parents | 700b3f415ebe |
children | 00f796120a6d |
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 |
25054
6652d3823428
maint: Update copyright dates in all source files.
John W. Eaton <jwe@octave.org>
parents:
24672
diff
changeset
|
3 Copyright (C) 2013-2018 John W. Eaton |
6652d3823428
maint: Update copyright dates in all source files.
John W. Eaton <jwe@octave.org>
parents:
24672
diff
changeset
|
4 Copyright (C) 2011-2018 Jacob Dawid |
6652d3823428
maint: Update copyright dates in all source files.
John W. Eaton <jwe@octave.org>
parents:
24672
diff
changeset
|
5 Copyright (C) 2011-2018 John P. Swensen |
15204
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 |
24534
194eb4bd202b
maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents:
24397
diff
changeset
|
9 Octave is free software: you can redistribute it and/or modify it |
22755
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22407
diff
changeset
|
10 under the terms of the GNU General Public License as published by |
24534
194eb4bd202b
maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents:
24397
diff
changeset
|
11 the Free Software Foundation, either version 3 of the License, or |
22755
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22407
diff
changeset
|
12 (at your option) any later version. |
15204
359098ad343e
update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents:
15196
diff
changeset
|
13 |
22755
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22407
diff
changeset
|
14 Octave is distributed in the hope that it will be useful, but |
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22407
diff
changeset
|
15 WITHOUT ANY WARRANTY; without even the implied warranty of |
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22407
diff
changeset
|
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
3a2b891d0b33
maint: Standardize Copyright formatting.
Rik <rik@octave.org>
parents:
22407
diff
changeset
|
17 GNU General Public License for more details. |
15204
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 |
24534
194eb4bd202b
maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents:
24397
diff
changeset
|
21 <https://www.gnu.org/licenses/>. |
15204
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 |
20791
f7084eae3318
maint: Use Octave coding conventions for #if statements.
Rik <rik@octave.org>
parents:
20113
diff
changeset
|
25 #if ! defined (octave_octave_link_h) |
17822
ebb3ef964372
maint: Use common #define syntax "octave_filename_h" in h_files.
Rik <rik@octave.org>
parents:
17787
diff
changeset
|
26 #define octave_octave_link_h 1 |
13501 | 27 |
21244
1473547f50f5
include octave-config.h in public header files
John W. Eaton <jwe@octave.org>
parents:
21158
diff
changeset
|
28 #include "octave-config.h" |
1473547f50f5
include octave-config.h in public header files
John W. Eaton <jwe@octave.org>
parents:
21158
diff
changeset
|
29 |
23442
53f5f8231c37
allow most header files to be compiled separately
John W. Eaton <jwe@octave.org>
parents:
23433
diff
changeset
|
30 #include <list> |
15155
9e62d5a3a45e
partial cleanup of include files in gui sources
John W. Eaton <jwe@octave.org>
parents:
15080
diff
changeset
|
31 #include <string> |
13501 | 32 |
23057
bb7513d73673
move mutex classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
22869
diff
changeset
|
33 #include "oct-mutex.h" |
25742
d3c6de326bae
close/reload editor tab when file is (re)moved in gui terminal (bug #43922)
Torsten <mttl@mailbox.org>
parents:
25653
diff
changeset
|
34 #include "octave.h" |
16420
81ec95768520
use octave-link instead of hook for edit function
John W. Eaton <jwe@octave.org>
parents:
16419
diff
changeset
|
35 #include "event-queue.h" |
25921
9c47eedc44e2
msgbox.m: use graphics objects to build dialog (bug #42490)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
25742
diff
changeset
|
36 #include "uint8NDArray.h" |
16377
8430ea8c1594
open editor tab and insert marker for debugging with gui
John W. Eaton <jwe@octave.org>
parents:
16350
diff
changeset
|
37 |
24641
7d177be54c37
pass variable value to variable editor in addition to variable name
John W. Eaton <jwe@octave.org>
parents:
24631
diff
changeset
|
38 class octave_value; |
16431
5982d469f79b
use signal for setting, appending to, and clearing history widget
John W. Eaton <jwe@octave.org>
parents:
16426
diff
changeset
|
39 class string_vector; |
24645
f61502510d08
restore ability to select variables for editing from workspace widget
John W. Eaton <jwe@octave.org>
parents:
24641
diff
changeset
|
40 |
f61502510d08
restore ability to select variables for editing from workspace widget
John W. Eaton <jwe@octave.org>
parents:
24641
diff
changeset
|
41 namespace octave |
f61502510d08
restore ability to select variables for editing from workspace widget
John W. Eaton <jwe@octave.org>
parents:
24641
diff
changeset
|
42 { |
26117
a6df420457ac
use symbol_info_list instead of symbol_scope to pass workspace info to gui
John W. Eaton <jwe@octave.org>
parents:
25948
diff
changeset
|
43 class symbol_info_list; |
24645
f61502510d08
restore ability to select variables for editing from workspace widget
John W. Eaton <jwe@octave.org>
parents:
24641
diff
changeset
|
44 } |
13541
b48ac9ad8de0
Highly improved separation of model and view classes.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
13522
diff
changeset
|
45 |
24624
ce2eb28e0a6d
doc: make all Doxygen comment blocks more consistent
Mike Miller <mtmiller@octave.org>
parents:
24534
diff
changeset
|
46 //! Provides threadsafe access to octave. |
ce2eb28e0a6d
doc: make all Doxygen comment blocks more consistent
Mike Miller <mtmiller@octave.org>
parents:
24534
diff
changeset
|
47 //! @author Jacob Dawid |
ce2eb28e0a6d
doc: make all Doxygen comment blocks more consistent
Mike Miller <mtmiller@octave.org>
parents:
24534
diff
changeset
|
48 //! |
ce2eb28e0a6d
doc: make all Doxygen comment blocks more consistent
Mike Miller <mtmiller@octave.org>
parents:
24534
diff
changeset
|
49 //! This class is a wrapper around octave and provides thread safety by |
ce2eb28e0a6d
doc: make all Doxygen comment blocks more consistent
Mike Miller <mtmiller@octave.org>
parents:
24534
diff
changeset
|
50 //! buffering access operations to octave and executing them in the |
ce2eb28e0a6d
doc: make all Doxygen comment blocks more consistent
Mike Miller <mtmiller@octave.org>
parents:
24534
diff
changeset
|
51 //! readline event hook, which lives in the octave thread. |
15371
eec0d1fcba4f
use Octave singleton style for octave_link class
John W. Eaton <jwe@octave.org>
parents:
15204
diff
changeset
|
52 |
16625
a86a14e6e65e
Decorate symbols with OCTINTERP_API.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16581
diff
changeset
|
53 class |
a86a14e6e65e
Decorate symbols with OCTINTERP_API.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16581
diff
changeset
|
54 OCTINTERP_API |
a86a14e6e65e
Decorate symbols with OCTINTERP_API.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
16581
diff
changeset
|
55 octave_link |
13501 | 56 { |
15371
eec0d1fcba4f
use Octave singleton style for octave_link class
John W. Eaton <jwe@octave.org>
parents:
15204
diff
changeset
|
57 protected: |
eec0d1fcba4f
use Octave singleton style for octave_link class
John W. Eaton <jwe@octave.org>
parents:
15204
diff
changeset
|
58 |
eec0d1fcba4f
use Octave singleton style for octave_link class
John W. Eaton <jwe@octave.org>
parents:
15204
diff
changeset
|
59 octave_link (void); |
eec0d1fcba4f
use Octave singleton style for octave_link class
John W. Eaton <jwe@octave.org>
parents:
15204
diff
changeset
|
60 |
13501 | 61 public: |
15371
eec0d1fcba4f
use Octave singleton style for octave_link class
John W. Eaton <jwe@octave.org>
parents:
15204
diff
changeset
|
62 |
22869
f75d289645ec
make deleted functions public
John W. Eaton <jwe@octave.org>
parents:
22865
diff
changeset
|
63 // No copying! |
f75d289645ec
make deleted functions public
John W. Eaton <jwe@octave.org>
parents:
22865
diff
changeset
|
64 |
f75d289645ec
make deleted functions public
John W. Eaton <jwe@octave.org>
parents:
22865
diff
changeset
|
65 octave_link (const octave_link&) = delete; |
f75d289645ec
make deleted functions public
John W. Eaton <jwe@octave.org>
parents:
22865
diff
changeset
|
66 |
f75d289645ec
make deleted functions public
John W. Eaton <jwe@octave.org>
parents:
22865
diff
changeset
|
67 octave_link& operator = (const octave_link&) = delete; |
f75d289645ec
make deleted functions public
John W. Eaton <jwe@octave.org>
parents:
22865
diff
changeset
|
68 |
21440
062c65569ad7
avoid some address-sanitizer leak warnings (bug #47372)
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
69 virtual ~octave_link (void); |
15371
eec0d1fcba4f
use Octave singleton style for octave_link class
John W. Eaton <jwe@octave.org>
parents:
15204
diff
changeset
|
70 |
eec0d1fcba4f
use Octave singleton style for octave_link class
John W. Eaton <jwe@octave.org>
parents:
15204
diff
changeset
|
71 static void generate_events (void) |
eec0d1fcba4f
use Octave singleton style for octave_link class
John W. Eaton <jwe@octave.org>
parents:
15204
diff
changeset
|
72 { |
16485
8b783661e03f
improve exit sequence for GUI
John W. Eaton <jwe@octave.org>
parents:
16479
diff
changeset
|
73 if (enabled ()) |
15371
eec0d1fcba4f
use Octave singleton style for octave_link class
John W. Eaton <jwe@octave.org>
parents:
15204
diff
changeset
|
74 instance->do_generate_events (); |
eec0d1fcba4f
use Octave singleton style for octave_link class
John W. Eaton <jwe@octave.org>
parents:
15204
diff
changeset
|
75 } |
eec0d1fcba4f
use Octave singleton style for octave_link class
John W. Eaton <jwe@octave.org>
parents:
15204
diff
changeset
|
76 |
16485
8b783661e03f
improve exit sequence for GUI
John W. Eaton <jwe@octave.org>
parents:
16479
diff
changeset
|
77 // If disable is TRUE, then no additional events will be processed |
8b783661e03f
improve exit sequence for GUI
John W. Eaton <jwe@octave.org>
parents:
16479
diff
changeset
|
78 // other than exit. |
8b783661e03f
improve exit sequence for GUI
John W. Eaton <jwe@octave.org>
parents:
16479
diff
changeset
|
79 |
8b783661e03f
improve exit sequence for GUI
John W. Eaton <jwe@octave.org>
parents:
16479
diff
changeset
|
80 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
|
81 { |
16485
8b783661e03f
improve exit sequence for GUI
John W. Eaton <jwe@octave.org>
parents:
16479
diff
changeset
|
82 if (enabled ()) |
8b783661e03f
improve exit sequence for GUI
John W. Eaton <jwe@octave.org>
parents:
16479
diff
changeset
|
83 { |
8b783661e03f
improve exit sequence for GUI
John W. Eaton <jwe@octave.org>
parents:
16479
diff
changeset
|
84 if (disable) |
23092
0fed4c678795
additional restructuring of startup and shutdown
John W. Eaton <jwe@octave.org>
parents:
23087
diff
changeset
|
85 instance->do_disable (); |
16485
8b783661e03f
improve exit sequence for GUI
John W. Eaton <jwe@octave.org>
parents:
16479
diff
changeset
|
86 |
8b783661e03f
improve exit sequence for GUI
John W. Eaton <jwe@octave.org>
parents:
16479
diff
changeset
|
87 instance->do_process_events (); |
8b783661e03f
improve exit sequence for GUI
John W. Eaton <jwe@octave.org>
parents:
16479
diff
changeset
|
88 } |
15371
eec0d1fcba4f
use Octave singleton style for octave_link class
John W. Eaton <jwe@octave.org>
parents:
15204
diff
changeset
|
89 } |
eec0d1fcba4f
use Octave singleton style for octave_link class
John W. Eaton <jwe@octave.org>
parents:
15204
diff
changeset
|
90 |
16479
7a71ea0b7ae9
eliminate event listener class
John W. Eaton <jwe@octave.org>
parents:
16468
diff
changeset
|
91 static void discard_events (void) |
7a71ea0b7ae9
eliminate event listener class
John W. Eaton <jwe@octave.org>
parents:
16468
diff
changeset
|
92 { |
16485
8b783661e03f
improve exit sequence for GUI
John W. Eaton <jwe@octave.org>
parents:
16479
diff
changeset
|
93 if (enabled ()) |
16479
7a71ea0b7ae9
eliminate event listener class
John W. Eaton <jwe@octave.org>
parents:
16468
diff
changeset
|
94 instance->do_discard_events (); |
7a71ea0b7ae9
eliminate event listener class
John W. Eaton <jwe@octave.org>
parents:
16468
diff
changeset
|
95 } |
7a71ea0b7ae9
eliminate event listener class
John W. Eaton <jwe@octave.org>
parents:
16468
diff
changeset
|
96 |
19714
21015ca26566
Restructure shutdown flow and behavior for improved robustness
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
19697
diff
changeset
|
97 static bool confirm_shutdown (void) |
21015ca26566
Restructure shutdown flow and behavior for improved robustness
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
19697
diff
changeset
|
98 { |
21015ca26566
Restructure shutdown flow and behavior for improved robustness
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
19697
diff
changeset
|
99 bool retval = true; |
21015ca26566
Restructure shutdown flow and behavior for improved robustness
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
19697
diff
changeset
|
100 |
23092
0fed4c678795
additional restructuring of startup and shutdown
John W. Eaton <jwe@octave.org>
parents:
23087
diff
changeset
|
101 if (enabled ()) |
19714
21015ca26566
Restructure shutdown flow and behavior for improved robustness
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
19697
diff
changeset
|
102 retval = instance->do_confirm_shutdown (); |
21015ca26566
Restructure shutdown flow and behavior for improved robustness
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
19697
diff
changeset
|
103 |
21015ca26566
Restructure shutdown flow and behavior for improved robustness
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
19697
diff
changeset
|
104 return retval; |
21015ca26566
Restructure shutdown flow and behavior for improved robustness
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
19697
diff
changeset
|
105 } |
21015ca26566
Restructure shutdown flow and behavior for improved robustness
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
19697
diff
changeset
|
106 |
25653
b3d357990b52
better use of templates for action_container and derived classes
John W. Eaton <jwe@octave.org>
parents:
25639
diff
changeset
|
107 template <typename T, typename... Params, typename... Args> |
b3d357990b52
better use of templates for action_container and derived classes
John W. Eaton <jwe@octave.org>
parents:
25639
diff
changeset
|
108 static void |
b3d357990b52
better use of templates for action_container and derived classes
John W. Eaton <jwe@octave.org>
parents:
25639
diff
changeset
|
109 post_event (T *obj, void (T::*method) (Params...), Args&&... args) |
15402
7f423c6111c6
refactor GUI event handling to use new event_queue class
John W. Eaton <jwe@octave.org>
parents:
15388
diff
changeset
|
110 { |
16485
8b783661e03f
improve exit sequence for GUI
John W. Eaton <jwe@octave.org>
parents:
16479
diff
changeset
|
111 if (enabled ()) |
25653
b3d357990b52
better use of templates for action_container and derived classes
John W. Eaton <jwe@octave.org>
parents:
25639
diff
changeset
|
112 instance->do_post_event (obj, method, std::forward<Args> (args)...); |
23927
e3a36f84d01d
provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
23795
diff
changeset
|
113 } |
e3a36f84d01d
provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
23795
diff
changeset
|
114 |
24672
13c207835e79
Rethrow gl2ps_print exceptions from GUI to interpreter thread (bug #50198)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
24645
diff
changeset
|
115 static void |
13c207835e79
Rethrow gl2ps_print exceptions from GUI to interpreter thread (bug #50198)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
24645
diff
changeset
|
116 post_exception (const std::exception_ptr &p) |
13c207835e79
Rethrow gl2ps_print exceptions from GUI to interpreter thread (bug #50198)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
24645
diff
changeset
|
117 { |
13c207835e79
Rethrow gl2ps_print exceptions from GUI to interpreter thread (bug #50198)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
24645
diff
changeset
|
118 if (enabled ()) |
13c207835e79
Rethrow gl2ps_print exceptions from GUI to interpreter thread (bug #50198)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
24645
diff
changeset
|
119 instance->do_post_exception (p); |
13c207835e79
Rethrow gl2ps_print exceptions from GUI to interpreter thread (bug #50198)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
24645
diff
changeset
|
120 } |
13c207835e79
Rethrow gl2ps_print exceptions from GUI to interpreter thread (bug #50198)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
24645
diff
changeset
|
121 |
15371
eec0d1fcba4f
use Octave singleton style for octave_link class
John W. Eaton <jwe@octave.org>
parents:
15204
diff
changeset
|
122 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
|
123 { |
16485
8b783661e03f
improve exit sequence for GUI
John W. Eaton <jwe@octave.org>
parents:
16479
diff
changeset
|
124 if (enabled ()) |
15371
eec0d1fcba4f
use Octave singleton style for octave_link class
John W. Eaton <jwe@octave.org>
parents:
15204
diff
changeset
|
125 instance->do_entered_readline_hook (); |
eec0d1fcba4f
use Octave singleton style for octave_link class
John W. Eaton <jwe@octave.org>
parents:
15204
diff
changeset
|
126 } |
14713
565ddd85565e
Added comments for the octave-adapter module.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14712
diff
changeset
|
127 |
15371
eec0d1fcba4f
use Octave singleton style for octave_link class
John W. Eaton <jwe@octave.org>
parents:
15204
diff
changeset
|
128 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
|
129 { |
16485
8b783661e03f
improve exit sequence for GUI
John W. Eaton <jwe@octave.org>
parents:
16479
diff
changeset
|
130 if (enabled ()) |
15371
eec0d1fcba4f
use Octave singleton style for octave_link class
John W. Eaton <jwe@octave.org>
parents:
15204
diff
changeset
|
131 instance->do_finished_readline_hook (); |
eec0d1fcba4f
use Octave singleton style for octave_link class
John W. Eaton <jwe@octave.org>
parents:
15204
diff
changeset
|
132 } |
eec0d1fcba4f
use Octave singleton style for octave_link class
John W. Eaton <jwe@octave.org>
parents:
15204
diff
changeset
|
133 |
16443
7a2ee6ea7800
rename dbstop -> breakpoint in GUI interface functions
John W. Eaton <jwe@octave.org>
parents:
16438
diff
changeset
|
134 static bool |
20113
c36f2b083613
make copying figures to clipboard work (bug #44866)
John W. Eaton <jwe@octave.org>
parents:
19970
diff
changeset
|
135 copy_image_to_clipboard (const std::string& file) |
c36f2b083613
make copying figures to clipboard work (bug #44866)
John W. Eaton <jwe@octave.org>
parents:
19970
diff
changeset
|
136 { |
c36f2b083613
make copying figures to clipboard work (bug #44866)
John W. Eaton <jwe@octave.org>
parents:
19970
diff
changeset
|
137 return enabled () ? instance->do_copy_image_to_clipboard (file) : false; |
c36f2b083613
make copying figures to clipboard work (bug #44866)
John W. Eaton <jwe@octave.org>
parents:
19970
diff
changeset
|
138 } |
c36f2b083613
make copying figures to clipboard work (bug #44866)
John W. Eaton <jwe@octave.org>
parents:
19970
diff
changeset
|
139 |
c36f2b083613
make copying figures to clipboard work (bug #44866)
John W. Eaton <jwe@octave.org>
parents:
19970
diff
changeset
|
140 static bool |
16443
7a2ee6ea7800
rename dbstop -> breakpoint in GUI interface functions
John W. Eaton <jwe@octave.org>
parents:
16438
diff
changeset
|
141 edit_file (const std::string& file) |
7a2ee6ea7800
rename dbstop -> breakpoint in GUI interface functions
John W. Eaton <jwe@octave.org>
parents:
16438
diff
changeset
|
142 { |
16485
8b783661e03f
improve exit sequence for GUI
John W. Eaton <jwe@octave.org>
parents:
16479
diff
changeset
|
143 return enabled () ? instance->do_edit_file (file) : false; |
16443
7a2ee6ea7800
rename dbstop -> breakpoint in GUI interface functions
John W. Eaton <jwe@octave.org>
parents:
16438
diff
changeset
|
144 } |
7a2ee6ea7800
rename dbstop -> breakpoint in GUI interface functions
John W. Eaton <jwe@octave.org>
parents:
16438
diff
changeset
|
145 |
17884
766ad9be2966
Prompt for non-existent new file when using edit.m from GUI (bug #40450)
Torsten <ttl@justmail.de>
parents:
17822
diff
changeset
|
146 static bool |
766ad9be2966
Prompt for non-existent new file when using edit.m from GUI (bug #40450)
Torsten <ttl@justmail.de>
parents:
17822
diff
changeset
|
147 prompt_new_edit_file (const std::string& file) |
766ad9be2966
Prompt for non-existent new file when using edit.m from GUI (bug #40450)
Torsten <ttl@justmail.de>
parents:
17822
diff
changeset
|
148 { |
766ad9be2966
Prompt for non-existent new file when using edit.m from GUI (bug #40450)
Torsten <ttl@justmail.de>
parents:
17822
diff
changeset
|
149 return enabled () ? instance->do_prompt_new_edit_file (file) : false; |
766ad9be2966
Prompt for non-existent new file when using edit.m from GUI (bug #40450)
Torsten <ttl@justmail.de>
parents:
17822
diff
changeset
|
150 } |
766ad9be2966
Prompt for non-existent new file when using edit.m from GUI (bug #40450)
Torsten <ttl@justmail.de>
parents:
17822
diff
changeset
|
151 |
16551
6ae555fc8c43
Add questdlg dialog function and fix variety of dialog bugs.
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
16547
diff
changeset
|
152 static std::string |
6ae555fc8c43
Add questdlg dialog function and fix variety of dialog bugs.
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
16547
diff
changeset
|
153 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:
16547
diff
changeset
|
154 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:
16547
diff
changeset
|
155 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:
16547
diff
changeset
|
156 { |
6ae555fc8c43
Add questdlg dialog function and fix variety of dialog bugs.
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
16547
diff
changeset
|
157 return enabled () ? instance->do_question_dialog (msg, title, btn1, |
23795
980f39c3ab90
Use C++11 nullptr rather than 0 in code (bug #51565).
Rik <rik@octave.org>
parents:
23747
diff
changeset
|
158 btn2, btn3, btndef) : ""; |
16551
6ae555fc8c43
Add questdlg dialog function and fix variety of dialog bugs.
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
16547
diff
changeset
|
159 } |
6ae555fc8c43
Add questdlg dialog function and fix variety of dialog bugs.
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
16547
diff
changeset
|
160 |
16512
7f2395651a1c
dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
16502
diff
changeset
|
161 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:
16502
diff
changeset
|
162 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:
16502
diff
changeset
|
163 const std::string& mode, |
7f2395651a1c
dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
16502
diff
changeset
|
164 int width, int height, |
7f2395651a1c
dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
16502
diff
changeset
|
165 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:
16502
diff
changeset
|
166 const std::string& name, |
16551
6ae555fc8c43
Add questdlg dialog function and fix variety of dialog bugs.
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
16547
diff
changeset
|
167 const std::list<std::string>& prompt, |
16512
7f2395651a1c
dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
16502
diff
changeset
|
168 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:
16502
diff
changeset
|
169 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:
16502
diff
changeset
|
170 { |
7f2395651a1c
dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
16502
diff
changeset
|
171 return enabled () |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
172 ? instance->do_list_dialog (list, mode, width, height, |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
173 initial_value, name, prompt, |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
174 ok_string, cancel_string) |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
175 : std::pair<std::list<int>, int> (); |
16512
7f2395651a1c
dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
16502
diff
changeset
|
176 } |
7f2395651a1c
dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
16502
diff
changeset
|
177 |
7f2395651a1c
dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
16502
diff
changeset
|
178 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:
16502
diff
changeset
|
179 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:
16502
diff
changeset
|
180 const std::string& title, |
16551
6ae555fc8c43
Add questdlg dialog function and fix variety of dialog bugs.
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
16547
diff
changeset
|
181 const std::list<float>& nr, |
6ae555fc8c43
Add questdlg dialog function and fix variety of dialog bugs.
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
16547
diff
changeset
|
182 const std::list<float>& nc, |
16512
7f2395651a1c
dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
16502
diff
changeset
|
183 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:
16502
diff
changeset
|
184 { |
7f2395651a1c
dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
16502
diff
changeset
|
185 return enabled () |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
186 ? instance->do_input_dialog (prompt, title, nr, nc, defaults) |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
187 : std::list<std::string> (); |
16512
7f2395651a1c
dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
16502
diff
changeset
|
188 } |
7f2395651a1c
dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
16502
diff
changeset
|
189 |
23534
b6498c088fca
maint: Don't write '> >' for declaration of templates that use templates.
Rik <rik@octave.org>
parents:
23446
diff
changeset
|
190 typedef std::list<std::pair<std::string, std::string>> filter_list; |
16580
adc150db1809
style fixes for uigetfile changes
John W. Eaton <jwe@octave.org>
parents:
16579
diff
changeset
|
191 |
16579
7f8db1942dc0
Add Qt link uigetfile dialog implementation.
John Donoghue <john.donoghue@ieee.org>
parents:
16570
diff
changeset
|
192 static std::list<std::string> |
16580
adc150db1809
style fixes for uigetfile changes
John W. Eaton <jwe@octave.org>
parents:
16579
diff
changeset
|
193 file_dialog (const filter_list& filter, const std::string& title, |
adc150db1809
style fixes for uigetfile changes
John W. Eaton <jwe@octave.org>
parents:
16579
diff
changeset
|
194 const std::string& filename, const std::string& dirname, |
16581
fa4a035e0cf4
Add octave_link uiputfile implementation
John Donoghue <john.donoghue@ieee.org>
parents:
16580
diff
changeset
|
195 const std::string& multimode) |
16579
7f8db1942dc0
Add Qt link uigetfile dialog implementation.
John Donoghue <john.donoghue@ieee.org>
parents:
16570
diff
changeset
|
196 { |
7f8db1942dc0
Add Qt link uigetfile dialog implementation.
John Donoghue <john.donoghue@ieee.org>
parents:
16570
diff
changeset
|
197 return enabled () |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
198 ? instance->do_file_dialog (filter, title, filename, dirname, |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
199 multimode) |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
200 : std::list<std::string> (); |
16579
7f8db1942dc0
Add Qt link uigetfile dialog implementation.
John Donoghue <john.donoghue@ieee.org>
parents:
16570
diff
changeset
|
201 } |
7f8db1942dc0
Add Qt link uigetfile dialog implementation.
John Donoghue <john.donoghue@ieee.org>
parents:
16570
diff
changeset
|
202 |
16547
3cd80afc3509
improve debugging with the GUI
John W. Eaton <jwe@octave.org>
parents:
16528
diff
changeset
|
203 static int debug_cd_or_addpath_error (const std::string& file, |
3cd80afc3509
improve debugging with the GUI
John W. Eaton <jwe@octave.org>
parents:
16528
diff
changeset
|
204 const std::string& dir, |
3cd80afc3509
improve debugging with the GUI
John W. Eaton <jwe@octave.org>
parents:
16528
diff
changeset
|
205 bool addpath_option) |
3cd80afc3509
improve debugging with the GUI
John W. Eaton <jwe@octave.org>
parents:
16528
diff
changeset
|
206 { |
3cd80afc3509
improve debugging with the GUI
John W. Eaton <jwe@octave.org>
parents:
16528
diff
changeset
|
207 return enabled () |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
208 ? instance->do_debug_cd_or_addpath_error (file, dir, addpath_option) |
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
209 : 0; |
16547
3cd80afc3509
improve debugging with the GUI
John W. Eaton <jwe@octave.org>
parents:
16528
diff
changeset
|
210 } |
3cd80afc3509
improve debugging with the GUI
John W. Eaton <jwe@octave.org>
parents:
16528
diff
changeset
|
211 |
16437
919796a440c6
use signal for changing directory
John W. Eaton <jwe@octave.org>
parents:
16431
diff
changeset
|
212 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
|
213 { |
16485
8b783661e03f
improve exit sequence for GUI
John W. Eaton <jwe@octave.org>
parents:
16479
diff
changeset
|
214 if (enabled ()) |
16437
919796a440c6
use signal for changing directory
John W. Eaton <jwe@octave.org>
parents:
16431
diff
changeset
|
215 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
|
216 } |
eec0d1fcba4f
use Octave singleton style for octave_link class
John W. Eaton <jwe@octave.org>
parents:
15204
diff
changeset
|
217 |
25742
d3c6de326bae
close/reload editor tab when file is (re)moved in gui terminal (bug #43922)
Torsten <mttl@mailbox.org>
parents:
25653
diff
changeset
|
218 // Methods for removing/renaming files which might be open in editor |
d3c6de326bae
close/reload editor tab when file is (re)moved in gui terminal (bug #43922)
Torsten <mttl@mailbox.org>
parents:
25653
diff
changeset
|
219 static void file_remove (const std::string& old_name, |
d3c6de326bae
close/reload editor tab when file is (re)moved in gui terminal (bug #43922)
Torsten <mttl@mailbox.org>
parents:
25653
diff
changeset
|
220 const std::string& new_name) |
d3c6de326bae
close/reload editor tab when file is (re)moved in gui terminal (bug #43922)
Torsten <mttl@mailbox.org>
parents:
25653
diff
changeset
|
221 { |
d3c6de326bae
close/reload editor tab when file is (re)moved in gui terminal (bug #43922)
Torsten <mttl@mailbox.org>
parents:
25653
diff
changeset
|
222 if (octave::application::is_gui_running () && enabled ()) |
d3c6de326bae
close/reload editor tab when file is (re)moved in gui terminal (bug #43922)
Torsten <mttl@mailbox.org>
parents:
25653
diff
changeset
|
223 instance->do_file_remove (old_name, new_name); |
d3c6de326bae
close/reload editor tab when file is (re)moved in gui terminal (bug #43922)
Torsten <mttl@mailbox.org>
parents:
25653
diff
changeset
|
224 } |
d3c6de326bae
close/reload editor tab when file is (re)moved in gui terminal (bug #43922)
Torsten <mttl@mailbox.org>
parents:
25653
diff
changeset
|
225 |
d3c6de326bae
close/reload editor tab when file is (re)moved in gui terminal (bug #43922)
Torsten <mttl@mailbox.org>
parents:
25653
diff
changeset
|
226 static void file_renamed (bool load_new) |
d3c6de326bae
close/reload editor tab when file is (re)moved in gui terminal (bug #43922)
Torsten <mttl@mailbox.org>
parents:
25653
diff
changeset
|
227 { |
d3c6de326bae
close/reload editor tab when file is (re)moved in gui terminal (bug #43922)
Torsten <mttl@mailbox.org>
parents:
25653
diff
changeset
|
228 if (octave::application::is_gui_running () && enabled ()) |
d3c6de326bae
close/reload editor tab when file is (re)moved in gui terminal (bug #43922)
Torsten <mttl@mailbox.org>
parents:
25653
diff
changeset
|
229 instance->do_file_renamed (load_new); |
d3c6de326bae
close/reload editor tab when file is (re)moved in gui terminal (bug #43922)
Torsten <mttl@mailbox.org>
parents:
25653
diff
changeset
|
230 } |
d3c6de326bae
close/reload editor tab when file is (re)moved in gui terminal (bug #43922)
Torsten <mttl@mailbox.org>
parents:
25653
diff
changeset
|
231 |
16570
d5ae5aa80d42
preserve pending command line input when running commands from GUI actions
John W. Eaton <jwe@octave.org>
parents:
16552
diff
changeset
|
232 // Preserves pending input. |
d5ae5aa80d42
preserve pending command line input when running commands from GUI actions
John W. Eaton <jwe@octave.org>
parents:
16552
diff
changeset
|
233 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:
16552
diff
changeset
|
234 { |
d5ae5aa80d42
preserve pending command line input when running commands from GUI actions
John W. Eaton <jwe@octave.org>
parents:
16552
diff
changeset
|
235 if (enabled ()) |
d5ae5aa80d42
preserve pending command line input when running commands from GUI actions
John W. Eaton <jwe@octave.org>
parents:
16552
diff
changeset
|
236 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:
16552
diff
changeset
|
237 } |
25948
700b3f415ebe
maint: Strip trailing whitespace from source files.
John W. Eaton <jwe@octave.org>
parents:
25921
diff
changeset
|
238 |
25921
9c47eedc44e2
msgbox.m: use graphics objects to build dialog (bug #42490)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
25742
diff
changeset
|
239 static uint8NDArray |
9c47eedc44e2
msgbox.m: use graphics objects to build dialog (bug #42490)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
25742
diff
changeset
|
240 get_named_icon (const std::string& icon_name) |
9c47eedc44e2
msgbox.m: use graphics objects to build dialog (bug #42490)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
25742
diff
changeset
|
241 { |
9c47eedc44e2
msgbox.m: use graphics objects to build dialog (bug #42490)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
25742
diff
changeset
|
242 return (enabled () ? |
9c47eedc44e2
msgbox.m: use graphics objects to build dialog (bug #42490)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
25742
diff
changeset
|
243 instance->do_get_named_icon (icon_name) : uint8NDArray ()); |
9c47eedc44e2
msgbox.m: use graphics objects to build dialog (bug #42490)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
25742
diff
changeset
|
244 } |
16570
d5ae5aa80d42
preserve pending command line input when running commands from GUI actions
John W. Eaton <jwe@octave.org>
parents:
16552
diff
changeset
|
245 |
16524
6a8e63dadfad
provide octave_link::set_workspace function with default values
John W. Eaton <jwe@octave.org>
parents:
16512
diff
changeset
|
246 static void set_workspace (void); |
6a8e63dadfad
provide octave_link::set_workspace function with default values
John W. Eaton <jwe@octave.org>
parents:
16512
diff
changeset
|
247 |
16502
45ae1038ee89
allow renaming of variables in workspace viewer
John W. Eaton <jwe@octave.org>
parents:
16485
diff
changeset
|
248 static void set_workspace (bool top_level, |
26117
a6df420457ac
use symbol_info_list instead of symbol_scope to pass workspace info to gui
John W. Eaton <jwe@octave.org>
parents:
25948
diff
changeset
|
249 const octave::symbol_info_list& syminfo, |
24631
6de74d95a7a1
don't use "const bool&" unnecessarily
John W. Eaton <jwe@octave.org>
parents:
24624
diff
changeset
|
250 bool update_variable_editor = true) |
16350
d4b6ad43bc87
use direct callbacks instead to handle history and workspace list updates
John W. Eaton <jwe@octave.org>
parents:
15402
diff
changeset
|
251 { |
16485
8b783661e03f
improve exit sequence for GUI
John W. Eaton <jwe@octave.org>
parents:
16479
diff
changeset
|
252 if (enabled ()) |
26117
a6df420457ac
use symbol_info_list instead of symbol_scope to pass workspace info to gui
John W. Eaton <jwe@octave.org>
parents:
25948
diff
changeset
|
253 instance->do_set_workspace (top_level, instance->debugging, syminfo, |
24631
6de74d95a7a1
don't use "const bool&" unnecessarily
John W. Eaton <jwe@octave.org>
parents:
24624
diff
changeset
|
254 update_variable_editor); |
16468
0f143f68078d
use signal/slot for updating workspace instead of using event listener
John W. Eaton <jwe@octave.org>
parents:
16443
diff
changeset
|
255 } |
0f143f68078d
use signal/slot for updating workspace instead of using event listener
John W. Eaton <jwe@octave.org>
parents:
16443
diff
changeset
|
256 |
0f143f68078d
use signal/slot for updating workspace instead of using event listener
John W. Eaton <jwe@octave.org>
parents:
16443
diff
changeset
|
257 static void clear_workspace (void) |
0f143f68078d
use signal/slot for updating workspace instead of using event listener
John W. Eaton <jwe@octave.org>
parents:
16443
diff
changeset
|
258 { |
16485
8b783661e03f
improve exit sequence for GUI
John W. Eaton <jwe@octave.org>
parents:
16479
diff
changeset
|
259 if (enabled ()) |
16468
0f143f68078d
use signal/slot for updating workspace instead of using event listener
John W. Eaton <jwe@octave.org>
parents:
16443
diff
changeset
|
260 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
|
261 } |
d4b6ad43bc87
use direct callbacks instead to handle history and workspace list updates
John W. Eaton <jwe@octave.org>
parents:
15402
diff
changeset
|
262 |
16431
5982d469f79b
use signal for setting, appending to, and clearing history widget
John W. Eaton <jwe@octave.org>
parents:
16426
diff
changeset
|
263 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
|
264 { |
16485
8b783661e03f
improve exit sequence for GUI
John W. Eaton <jwe@octave.org>
parents:
16479
diff
changeset
|
265 if (enabled ()) |
16431
5982d469f79b
use signal for setting, appending to, and clearing history widget
John W. Eaton <jwe@octave.org>
parents:
16426
diff
changeset
|
266 instance->do_set_history (hist); |
5982d469f79b
use signal for setting, appending to, and clearing history widget
John W. Eaton <jwe@octave.org>
parents:
16426
diff
changeset
|
267 } |
5982d469f79b
use signal for setting, appending to, and clearing history widget
John W. Eaton <jwe@octave.org>
parents:
16426
diff
changeset
|
268 |
5982d469f79b
use signal for setting, appending to, and clearing history widget
John W. Eaton <jwe@octave.org>
parents:
16426
diff
changeset
|
269 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:
16426
diff
changeset
|
270 { |
16485
8b783661e03f
improve exit sequence for GUI
John W. Eaton <jwe@octave.org>
parents:
16479
diff
changeset
|
271 if (enabled ()) |
16431
5982d469f79b
use signal for setting, appending to, and clearing history widget
John W. Eaton <jwe@octave.org>
parents:
16426
diff
changeset
|
272 instance->do_append_history (hist_entry); |
5982d469f79b
use signal for setting, appending to, and clearing history widget
John W. Eaton <jwe@octave.org>
parents:
16426
diff
changeset
|
273 } |
5982d469f79b
use signal for setting, appending to, and clearing history widget
John W. Eaton <jwe@octave.org>
parents:
16426
diff
changeset
|
274 |
5982d469f79b
use signal for setting, appending to, and clearing history widget
John W. Eaton <jwe@octave.org>
parents:
16426
diff
changeset
|
275 static void clear_history (void) |
5982d469f79b
use signal for setting, appending to, and clearing history widget
John W. Eaton <jwe@octave.org>
parents:
16426
diff
changeset
|
276 { |
16485
8b783661e03f
improve exit sequence for GUI
John W. Eaton <jwe@octave.org>
parents:
16479
diff
changeset
|
277 if (enabled ()) |
16431
5982d469f79b
use signal for setting, appending to, and clearing history widget
John W. Eaton <jwe@octave.org>
parents:
16426
diff
changeset
|
278 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
|
279 } |
d4b6ad43bc87
use direct callbacks instead to handle history and workspace list updates
John W. Eaton <jwe@octave.org>
parents:
15402
diff
changeset
|
280 |
16415
70032fc70bee
move octave-link and octave-event-listener classes to libinterp
John W. Eaton <jwe@octave.org>
parents:
16399
diff
changeset
|
281 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
|
282 { |
16485
8b783661e03f
improve exit sequence for GUI
John W. Eaton <jwe@octave.org>
parents:
16479
diff
changeset
|
283 if (enabled ()) |
16415
70032fc70bee
move octave-link and octave-event-listener classes to libinterp
John W. Eaton <jwe@octave.org>
parents:
16399
diff
changeset
|
284 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
|
285 } |
d4b6ad43bc87
use direct callbacks instead to handle history and workspace list updates
John W. Eaton <jwe@octave.org>
parents:
15402
diff
changeset
|
286 |
16415
70032fc70bee
move octave-link and octave-event-listener classes to libinterp
John W. Eaton <jwe@octave.org>
parents:
16399
diff
changeset
|
287 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
|
288 { |
16485
8b783661e03f
improve exit sequence for GUI
John W. Eaton <jwe@octave.org>
parents:
16479
diff
changeset
|
289 if (enabled ()) |
16415
70032fc70bee
move octave-link and octave-event-listener classes to libinterp
John W. Eaton <jwe@octave.org>
parents:
16399
diff
changeset
|
290 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
|
291 } |
d4b6ad43bc87
use direct callbacks instead to handle history and workspace list updates
John W. Eaton <jwe@octave.org>
parents:
15402
diff
changeset
|
292 |
16419
16bfbf9136d3
avoid creating unnecessary octave_value objects for octave_link calls
John W. Eaton <jwe@octave.org>
parents:
16415
diff
changeset
|
293 static void enter_debugger_event (const std::string& file, int line) |
16377
8430ea8c1594
open editor tab and insert marker for debugging with gui
John W. Eaton <jwe@octave.org>
parents:
16350
diff
changeset
|
294 { |
16485
8b783661e03f
improve exit sequence for GUI
John W. Eaton <jwe@octave.org>
parents:
16479
diff
changeset
|
295 if (enabled ()) |
16438
a971d8bdaadc
use signals instead of event queue for entering/leaving debug mode
John W. Eaton <jwe@octave.org>
parents:
16437
diff
changeset
|
296 { |
a971d8bdaadc
use signals instead of event queue for entering/leaving debug mode
John W. Eaton <jwe@octave.org>
parents:
16437
diff
changeset
|
297 instance->debugging = true; |
a971d8bdaadc
use signals instead of event queue for entering/leaving debug mode
John W. Eaton <jwe@octave.org>
parents:
16437
diff
changeset
|
298 |
a971d8bdaadc
use signals instead of event queue for entering/leaving debug mode
John W. Eaton <jwe@octave.org>
parents:
16437
diff
changeset
|
299 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:
16437
diff
changeset
|
300 } |
16395
fc491da603f6
also provide a hook for exiting debugger
John W. Eaton <jwe@octave.org>
parents:
16386
diff
changeset
|
301 } |
fc491da603f6
also provide a hook for exiting debugger
John W. Eaton <jwe@octave.org>
parents:
16386
diff
changeset
|
302 |
16438
a971d8bdaadc
use signals instead of event queue for entering/leaving debug mode
John W. Eaton <jwe@octave.org>
parents:
16437
diff
changeset
|
303 static void execute_in_debugger_event (const std::string& file, int line) |
16395
fc491da603f6
also provide a hook for exiting debugger
John W. Eaton <jwe@octave.org>
parents:
16386
diff
changeset
|
304 { |
16485
8b783661e03f
improve exit sequence for GUI
John W. Eaton <jwe@octave.org>
parents:
16479
diff
changeset
|
305 if (enabled ()) |
16438
a971d8bdaadc
use signals instead of event queue for entering/leaving debug mode
John W. Eaton <jwe@octave.org>
parents:
16437
diff
changeset
|
306 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:
16437
diff
changeset
|
307 } |
a971d8bdaadc
use signals instead of event queue for entering/leaving debug mode
John W. Eaton <jwe@octave.org>
parents:
16437
diff
changeset
|
308 |
a971d8bdaadc
use signals instead of event queue for entering/leaving debug mode
John W. Eaton <jwe@octave.org>
parents:
16437
diff
changeset
|
309 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:
16437
diff
changeset
|
310 { |
16485
8b783661e03f
improve exit sequence for GUI
John W. Eaton <jwe@octave.org>
parents:
16479
diff
changeset
|
311 if (enabled () && instance->debugging) |
16438
a971d8bdaadc
use signals instead of event queue for entering/leaving debug mode
John W. Eaton <jwe@octave.org>
parents:
16437
diff
changeset
|
312 { |
a971d8bdaadc
use signals instead of event queue for entering/leaving debug mode
John W. Eaton <jwe@octave.org>
parents:
16437
diff
changeset
|
313 instance->debugging = false; |
a971d8bdaadc
use signals instead of event queue for entering/leaving debug mode
John W. Eaton <jwe@octave.org>
parents:
16437
diff
changeset
|
314 |
a971d8bdaadc
use signals instead of event queue for entering/leaving debug mode
John W. Eaton <jwe@octave.org>
parents:
16437
diff
changeset
|
315 instance->do_exit_debugger_event (); |
a971d8bdaadc
use signals instead of event queue for entering/leaving debug mode
John W. Eaton <jwe@octave.org>
parents:
16437
diff
changeset
|
316 } |
16377
8430ea8c1594
open editor tab and insert marker for debugging with gui
John W. Eaton <jwe@octave.org>
parents:
16350
diff
changeset
|
317 } |
8430ea8c1594
open editor tab and insert marker for debugging with gui
John W. Eaton <jwe@octave.org>
parents:
16350
diff
changeset
|
318 |
16386
4902484f9181
callbacks to set markers in editor using command line dbstop function
John W. Eaton <jwe@octave.org>
parents:
16383
diff
changeset
|
319 static void |
21157
94fc5f13d51b
dbstop: conditional breakpoint, dbstop if caught error etc. (bug #46795)
Lachlan Andrew <lachlanbis@gmail.com>
parents:
21139
diff
changeset
|
320 update_breakpoint (bool insert, const std::string& file, int line, |
94fc5f13d51b
dbstop: conditional breakpoint, dbstop if caught error etc. (bug #46795)
Lachlan Andrew <lachlanbis@gmail.com>
parents:
21139
diff
changeset
|
321 const std::string& cond = "") |
16386
4902484f9181
callbacks to set markers in editor using command line dbstop function
John W. Eaton <jwe@octave.org>
parents:
16383
diff
changeset
|
322 { |
16485
8b783661e03f
improve exit sequence for GUI
John W. Eaton <jwe@octave.org>
parents:
16479
diff
changeset
|
323 if (enabled ()) |
21158
65827e9cccb8
Gui support for enhancement of dbstop.
Lachlan Andrew <lachlanbis@gmail.com>
parents:
21157
diff
changeset
|
324 instance->do_update_breakpoint (insert, file, line, cond); |
16386
4902484f9181
callbacks to set markers in editor using command line dbstop function
John W. Eaton <jwe@octave.org>
parents:
16383
diff
changeset
|
325 } |
4902484f9181
callbacks to set markers in editor using command line dbstop function
John W. Eaton <jwe@octave.org>
parents:
16383
diff
changeset
|
326 |
16421
40d1ddca4db5
improve use of octave_link
John W. Eaton <jwe@octave.org>
parents:
16420
diff
changeset
|
327 static void connect_link (octave_link *); |
16415
70032fc70bee
move octave-link and octave-event-listener classes to libinterp
John W. Eaton <jwe@octave.org>
parents:
16399
diff
changeset
|
328 |
23446
cd4e1ee28716
maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents:
23442
diff
changeset
|
329 static octave_link * disconnect_link (bool delete_instance = true) |
23092
0fed4c678795
additional restructuring of startup and shutdown
John W. Eaton <jwe@octave.org>
parents:
23087
diff
changeset
|
330 { |
0fed4c678795
additional restructuring of startup and shutdown
John W. Eaton <jwe@octave.org>
parents:
23087
diff
changeset
|
331 if (delete_instance) |
0fed4c678795
additional restructuring of startup and shutdown
John W. Eaton <jwe@octave.org>
parents:
23087
diff
changeset
|
332 { |
0fed4c678795
additional restructuring of startup and shutdown
John W. Eaton <jwe@octave.org>
parents:
23087
diff
changeset
|
333 delete instance; |
23795
980f39c3ab90
Use C++11 nullptr rather than 0 in code (bug #51565).
Rik <rik@octave.org>
parents:
23747
diff
changeset
|
334 instance = nullptr; |
980f39c3ab90
Use C++11 nullptr rather than 0 in code (bug #51565).
Rik <rik@octave.org>
parents:
23747
diff
changeset
|
335 return nullptr; |
23092
0fed4c678795
additional restructuring of startup and shutdown
John W. Eaton <jwe@octave.org>
parents:
23087
diff
changeset
|
336 } |
0fed4c678795
additional restructuring of startup and shutdown
John W. Eaton <jwe@octave.org>
parents:
23087
diff
changeset
|
337 else |
0fed4c678795
additional restructuring of startup and shutdown
John W. Eaton <jwe@octave.org>
parents:
23087
diff
changeset
|
338 { |
0fed4c678795
additional restructuring of startup and shutdown
John W. Eaton <jwe@octave.org>
parents:
23087
diff
changeset
|
339 octave_link *retval = instance; |
23795
980f39c3ab90
Use C++11 nullptr rather than 0 in code (bug #51565).
Rik <rik@octave.org>
parents:
23747
diff
changeset
|
340 instance = nullptr; |
23092
0fed4c678795
additional restructuring of startup and shutdown
John W. Eaton <jwe@octave.org>
parents:
23087
diff
changeset
|
341 return retval; |
0fed4c678795
additional restructuring of startup and shutdown
John W. Eaton <jwe@octave.org>
parents:
23087
diff
changeset
|
342 } |
0fed4c678795
additional restructuring of startup and shutdown
John W. Eaton <jwe@octave.org>
parents:
23087
diff
changeset
|
343 } |
0fed4c678795
additional restructuring of startup and shutdown
John W. Eaton <jwe@octave.org>
parents:
23087
diff
changeset
|
344 |
0fed4c678795
additional restructuring of startup and shutdown
John W. Eaton <jwe@octave.org>
parents:
23087
diff
changeset
|
345 static bool enable (void) |
0fed4c678795
additional restructuring of startup and shutdown
John W. Eaton <jwe@octave.org>
parents:
23087
diff
changeset
|
346 { |
0fed4c678795
additional restructuring of startup and shutdown
John W. Eaton <jwe@octave.org>
parents:
23087
diff
changeset
|
347 return instance_ok () ? instance->do_enable () : false; |
0fed4c678795
additional restructuring of startup and shutdown
John W. Eaton <jwe@octave.org>
parents:
23087
diff
changeset
|
348 } |
0fed4c678795
additional restructuring of startup and shutdown
John W. Eaton <jwe@octave.org>
parents:
23087
diff
changeset
|
349 |
0fed4c678795
additional restructuring of startup and shutdown
John W. Eaton <jwe@octave.org>
parents:
23087
diff
changeset
|
350 static bool disable (void) |
0fed4c678795
additional restructuring of startup and shutdown
John W. Eaton <jwe@octave.org>
parents:
23087
diff
changeset
|
351 { |
0fed4c678795
additional restructuring of startup and shutdown
John W. Eaton <jwe@octave.org>
parents:
23087
diff
changeset
|
352 return instance_ok () ? instance->do_disable () : false; |
0fed4c678795
additional restructuring of startup and shutdown
John W. Eaton <jwe@octave.org>
parents:
23087
diff
changeset
|
353 } |
0fed4c678795
additional restructuring of startup and shutdown
John W. Eaton <jwe@octave.org>
parents:
23087
diff
changeset
|
354 |
0fed4c678795
additional restructuring of startup and shutdown
John W. Eaton <jwe@octave.org>
parents:
23087
diff
changeset
|
355 bool do_enable (void) |
0fed4c678795
additional restructuring of startup and shutdown
John W. Eaton <jwe@octave.org>
parents:
23087
diff
changeset
|
356 { |
0fed4c678795
additional restructuring of startup and shutdown
John W. Eaton <jwe@octave.org>
parents:
23087
diff
changeset
|
357 bool retval = link_enabled; |
0fed4c678795
additional restructuring of startup and shutdown
John W. Eaton <jwe@octave.org>
parents:
23087
diff
changeset
|
358 link_enabled = true; |
0fed4c678795
additional restructuring of startup and shutdown
John W. Eaton <jwe@octave.org>
parents:
23087
diff
changeset
|
359 return retval; |
0fed4c678795
additional restructuring of startup and shutdown
John W. Eaton <jwe@octave.org>
parents:
23087
diff
changeset
|
360 } |
0fed4c678795
additional restructuring of startup and shutdown
John W. Eaton <jwe@octave.org>
parents:
23087
diff
changeset
|
361 |
0fed4c678795
additional restructuring of startup and shutdown
John W. Eaton <jwe@octave.org>
parents:
23087
diff
changeset
|
362 bool do_disable (void) |
0fed4c678795
additional restructuring of startup and shutdown
John W. Eaton <jwe@octave.org>
parents:
23087
diff
changeset
|
363 { |
0fed4c678795
additional restructuring of startup and shutdown
John W. Eaton <jwe@octave.org>
parents:
23087
diff
changeset
|
364 bool retval = link_enabled; |
0fed4c678795
additional restructuring of startup and shutdown
John W. Eaton <jwe@octave.org>
parents:
23087
diff
changeset
|
365 link_enabled = false; |
0fed4c678795
additional restructuring of startup and shutdown
John W. Eaton <jwe@octave.org>
parents:
23087
diff
changeset
|
366 return retval; |
0fed4c678795
additional restructuring of startup and shutdown
John W. Eaton <jwe@octave.org>
parents:
23087
diff
changeset
|
367 } |
0fed4c678795
additional restructuring of startup and shutdown
John W. Eaton <jwe@octave.org>
parents:
23087
diff
changeset
|
368 |
16552
8fc1f6535380
new function, __octave_link_enabled__
John W. Eaton <jwe@octave.org>
parents:
16551
diff
changeset
|
369 static bool enabled (void) |
8fc1f6535380
new function, __octave_link_enabled__
John W. Eaton <jwe@octave.org>
parents:
16551
diff
changeset
|
370 { |
8fc1f6535380
new function, __octave_link_enabled__
John W. Eaton <jwe@octave.org>
parents:
16551
diff
changeset
|
371 return instance_ok () ? instance->link_enabled : false; |
8fc1f6535380
new function, __octave_link_enabled__
John W. Eaton <jwe@octave.org>
parents:
16551
diff
changeset
|
372 } |
8fc1f6535380
new function, __octave_link_enabled__
John W. Eaton <jwe@octave.org>
parents:
16551
diff
changeset
|
373 |
17010
c50ee84842a9
Add preferences and prefdir functions
John Donoghue <john.donoghue@ieee.org>
parents:
16892
diff
changeset
|
374 static bool |
c50ee84842a9
Add preferences and prefdir functions
John Donoghue <john.donoghue@ieee.org>
parents:
16892
diff
changeset
|
375 show_preferences () |
c50ee84842a9
Add preferences and prefdir functions
John Donoghue <john.donoghue@ieee.org>
parents:
16892
diff
changeset
|
376 { |
c50ee84842a9
Add preferences and prefdir functions
John Donoghue <john.donoghue@ieee.org>
parents:
16892
diff
changeset
|
377 if (enabled ()) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
378 { |
17010
c50ee84842a9
Add preferences and prefdir functions
John Donoghue <john.donoghue@ieee.org>
parents:
16892
diff
changeset
|
379 instance->do_show_preferences (); |
c50ee84842a9
Add preferences and prefdir functions
John Donoghue <john.donoghue@ieee.org>
parents:
16892
diff
changeset
|
380 return true; |
c50ee84842a9
Add preferences and prefdir functions
John Donoghue <john.donoghue@ieee.org>
parents:
16892
diff
changeset
|
381 } |
c50ee84842a9
Add preferences and prefdir functions
John Donoghue <john.donoghue@ieee.org>
parents:
16892
diff
changeset
|
382 else |
c50ee84842a9
Add preferences and prefdir functions
John Donoghue <john.donoghue@ieee.org>
parents:
16892
diff
changeset
|
383 return false; |
c50ee84842a9
Add preferences and prefdir functions
John Donoghue <john.donoghue@ieee.org>
parents:
16892
diff
changeset
|
384 } |
c50ee84842a9
Add preferences and prefdir functions
John Donoghue <john.donoghue@ieee.org>
parents:
16892
diff
changeset
|
385 |
25639
7644e7f1721f
change gui preferences from within the worker thread (bug #49119)
Torsten <mttl@mailbox.org>
parents:
25407
diff
changeset
|
386 static std::string |
7644e7f1721f
change gui preferences from within the worker thread (bug #49119)
Torsten <mttl@mailbox.org>
parents:
25407
diff
changeset
|
387 gui_preference (const std::string& key, |
7644e7f1721f
change gui preferences from within the worker thread (bug #49119)
Torsten <mttl@mailbox.org>
parents:
25407
diff
changeset
|
388 const std::string& value) |
7644e7f1721f
change gui preferences from within the worker thread (bug #49119)
Torsten <mttl@mailbox.org>
parents:
25407
diff
changeset
|
389 { |
7644e7f1721f
change gui preferences from within the worker thread (bug #49119)
Torsten <mttl@mailbox.org>
parents:
25407
diff
changeset
|
390 if (enabled ()) |
7644e7f1721f
change gui preferences from within the worker thread (bug #49119)
Torsten <mttl@mailbox.org>
parents:
25407
diff
changeset
|
391 { |
7644e7f1721f
change gui preferences from within the worker thread (bug #49119)
Torsten <mttl@mailbox.org>
parents:
25407
diff
changeset
|
392 return instance->do_gui_preference (key, value); |
7644e7f1721f
change gui preferences from within the worker thread (bug #49119)
Torsten <mttl@mailbox.org>
parents:
25407
diff
changeset
|
393 } |
7644e7f1721f
change gui preferences from within the worker thread (bug #49119)
Torsten <mttl@mailbox.org>
parents:
25407
diff
changeset
|
394 else |
7644e7f1721f
change gui preferences from within the worker thread (bug #49119)
Torsten <mttl@mailbox.org>
parents:
25407
diff
changeset
|
395 return ""; |
7644e7f1721f
change gui preferences from within the worker thread (bug #49119)
Torsten <mttl@mailbox.org>
parents:
25407
diff
changeset
|
396 } |
7644e7f1721f
change gui preferences from within the worker thread (bug #49119)
Torsten <mttl@mailbox.org>
parents:
25407
diff
changeset
|
397 |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
398 static bool |
17029
359c5ca795cd
Display doc info pages using documentation browser when in GUI mode (Bug #39451)
John Donoghue <john.donoghue@ieee.org>
parents:
17010
diff
changeset
|
399 show_doc (const std::string & file) |
359c5ca795cd
Display doc info pages using documentation browser when in GUI mode (Bug #39451)
John Donoghue <john.donoghue@ieee.org>
parents:
17010
diff
changeset
|
400 { |
359c5ca795cd
Display doc info pages using documentation browser when in GUI mode (Bug #39451)
John Donoghue <john.donoghue@ieee.org>
parents:
17010
diff
changeset
|
401 if (enabled ()) |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
402 { |
17029
359c5ca795cd
Display doc info pages using documentation browser when in GUI mode (Bug #39451)
John Donoghue <john.donoghue@ieee.org>
parents:
17010
diff
changeset
|
403 instance->do_show_doc (file); |
359c5ca795cd
Display doc info pages using documentation browser when in GUI mode (Bug #39451)
John Donoghue <john.donoghue@ieee.org>
parents:
17010
diff
changeset
|
404 return true; |
359c5ca795cd
Display doc info pages using documentation browser when in GUI mode (Bug #39451)
John Donoghue <john.donoghue@ieee.org>
parents:
17010
diff
changeset
|
405 } |
359c5ca795cd
Display doc info pages using documentation browser when in GUI mode (Bug #39451)
John Donoghue <john.donoghue@ieee.org>
parents:
17010
diff
changeset
|
406 else |
359c5ca795cd
Display doc info pages using documentation browser when in GUI mode (Bug #39451)
John Donoghue <john.donoghue@ieee.org>
parents:
17010
diff
changeset
|
407 return false; |
25060
1cd3aeda7598
Allow registering compressed help at run time (bug #53006).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
25054
diff
changeset
|
408 } |
1cd3aeda7598
Allow registering compressed help at run time (bug #53006).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
25054
diff
changeset
|
409 |
1cd3aeda7598
Allow registering compressed help at run time (bug #53006).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
25054
diff
changeset
|
410 static bool |
1cd3aeda7598
Allow registering compressed help at run time (bug #53006).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
25054
diff
changeset
|
411 register_doc (const std::string & file) |
1cd3aeda7598
Allow registering compressed help at run time (bug #53006).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
25054
diff
changeset
|
412 { |
1cd3aeda7598
Allow registering compressed help at run time (bug #53006).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
25054
diff
changeset
|
413 if (enabled ()) |
1cd3aeda7598
Allow registering compressed help at run time (bug #53006).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
25054
diff
changeset
|
414 { |
1cd3aeda7598
Allow registering compressed help at run time (bug #53006).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
25054
diff
changeset
|
415 instance->do_register_doc (file); |
1cd3aeda7598
Allow registering compressed help at run time (bug #53006).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
25054
diff
changeset
|
416 return true; |
1cd3aeda7598
Allow registering compressed help at run time (bug #53006).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
25054
diff
changeset
|
417 } |
1cd3aeda7598
Allow registering compressed help at run time (bug #53006).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
25054
diff
changeset
|
418 else |
1cd3aeda7598
Allow registering compressed help at run time (bug #53006).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
25054
diff
changeset
|
419 return false; |
1cd3aeda7598
Allow registering compressed help at run time (bug #53006).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
25054
diff
changeset
|
420 } |
1cd3aeda7598
Allow registering compressed help at run time (bug #53006).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
25054
diff
changeset
|
421 |
1cd3aeda7598
Allow registering compressed help at run time (bug #53006).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
25054
diff
changeset
|
422 static bool |
1cd3aeda7598
Allow registering compressed help at run time (bug #53006).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
25054
diff
changeset
|
423 unregister_doc (const std::string & file) |
1cd3aeda7598
Allow registering compressed help at run time (bug #53006).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
25054
diff
changeset
|
424 { |
1cd3aeda7598
Allow registering compressed help at run time (bug #53006).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
25054
diff
changeset
|
425 if (enabled ()) |
1cd3aeda7598
Allow registering compressed help at run time (bug #53006).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
25054
diff
changeset
|
426 { |
1cd3aeda7598
Allow registering compressed help at run time (bug #53006).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
25054
diff
changeset
|
427 instance->do_unregister_doc (file); |
1cd3aeda7598
Allow registering compressed help at run time (bug #53006).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
25054
diff
changeset
|
428 return true; |
1cd3aeda7598
Allow registering compressed help at run time (bug #53006).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
25054
diff
changeset
|
429 } |
1cd3aeda7598
Allow registering compressed help at run time (bug #53006).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
25054
diff
changeset
|
430 else |
1cd3aeda7598
Allow registering compressed help at run time (bug #53006).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
25054
diff
changeset
|
431 return false; |
17787
175b392e91fe
Use GNU style coding conventions for code in libinterp/
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
432 |
17029
359c5ca795cd
Display doc info pages using documentation browser when in GUI mode (Bug #39451)
John Donoghue <john.donoghue@ieee.org>
parents:
17010
diff
changeset
|
433 } |
359c5ca795cd
Display doc info pages using documentation browser when in GUI mode (Bug #39451)
John Donoghue <john.donoghue@ieee.org>
parents:
17010
diff
changeset
|
434 |
23927
e3a36f84d01d
provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
23795
diff
changeset
|
435 static bool |
24641
7d177be54c37
pass variable value to variable editor in addition to variable name
John W. Eaton <jwe@octave.org>
parents:
24631
diff
changeset
|
436 edit_variable (const std::string &name, const octave_value& val) |
23927
e3a36f84d01d
provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
23795
diff
changeset
|
437 { |
e3a36f84d01d
provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
23795
diff
changeset
|
438 if (enabled ()) |
e3a36f84d01d
provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
23795
diff
changeset
|
439 { |
24641
7d177be54c37
pass variable value to variable editor in addition to variable name
John W. Eaton <jwe@octave.org>
parents:
24631
diff
changeset
|
440 instance->do_edit_variable (name, val); |
23927
e3a36f84d01d
provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
23795
diff
changeset
|
441 return true; |
e3a36f84d01d
provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
23795
diff
changeset
|
442 } |
e3a36f84d01d
provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
23795
diff
changeset
|
443 else |
e3a36f84d01d
provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
23795
diff
changeset
|
444 return false; |
e3a36f84d01d
provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
23795
diff
changeset
|
445 } |
e3a36f84d01d
provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
23795
diff
changeset
|
446 |
15371
eec0d1fcba4f
use Octave singleton style for octave_link class
John W. Eaton <jwe@octave.org>
parents:
15204
diff
changeset
|
447 private: |
eec0d1fcba4f
use Octave singleton style for octave_link class
John W. Eaton <jwe@octave.org>
parents:
15204
diff
changeset
|
448 |
eec0d1fcba4f
use Octave singleton style for octave_link class
John W. Eaton <jwe@octave.org>
parents:
15204
diff
changeset
|
449 static octave_link *instance; |
eec0d1fcba4f
use Octave singleton style for octave_link class
John W. Eaton <jwe@octave.org>
parents:
15204
diff
changeset
|
450 |
23795
980f39c3ab90
Use C++11 nullptr rather than 0 in code (bug #51565).
Rik <rik@octave.org>
parents:
23747
diff
changeset
|
451 static bool instance_ok (void) { return instance != nullptr; } |
16485
8b783661e03f
improve exit sequence for GUI
John W. Eaton <jwe@octave.org>
parents:
16479
diff
changeset
|
452 |
16415
70032fc70bee
move octave-link and octave-event-listener classes to libinterp
John W. Eaton <jwe@octave.org>
parents:
16399
diff
changeset
|
453 protected: |
14719
89c64340e9ab
Extended event based communication model.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14718
diff
changeset
|
454 |
15371
eec0d1fcba4f
use Octave singleton style for octave_link class
John W. Eaton <jwe@octave.org>
parents:
15204
diff
changeset
|
455 // Semaphore to lock access to the event queue. |
23057
bb7513d73673
move mutex classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
22869
diff
changeset
|
456 octave::mutex *event_queue_mutex; |
15371
eec0d1fcba4f
use Octave singleton style for octave_link class
John W. Eaton <jwe@octave.org>
parents:
15204
diff
changeset
|
457 |
15402
7f423c6111c6
refactor GUI event handling to use new event_queue class
John W. Eaton <jwe@octave.org>
parents:
15388
diff
changeset
|
458 // Event Queue. |
23747
0b4d1575a2e2
move action_container and event_queue classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
23534
diff
changeset
|
459 octave::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
|
460 |
eec0d1fcba4f
use Octave singleton style for octave_link class
John W. Eaton <jwe@octave.org>
parents:
15204
diff
changeset
|
461 bool debugging; |
16485
8b783661e03f
improve exit sequence for GUI
John W. Eaton <jwe@octave.org>
parents:
16479
diff
changeset
|
462 bool link_enabled; |
15371
eec0d1fcba4f
use Octave singleton style for octave_link class
John W. Eaton <jwe@octave.org>
parents:
15204
diff
changeset
|
463 |
eec0d1fcba4f
use Octave singleton style for octave_link class
John W. Eaton <jwe@octave.org>
parents:
15204
diff
changeset
|
464 void do_generate_events (void); |
eec0d1fcba4f
use Octave singleton style for octave_link class
John W. Eaton <jwe@octave.org>
parents:
15204
diff
changeset
|
465 void do_process_events (void); |
16479
7a71ea0b7ae9
eliminate event listener class
John W. Eaton <jwe@octave.org>
parents:
16468
diff
changeset
|
466 void do_discard_events (void); |
7a71ea0b7ae9
eliminate event listener class
John W. Eaton <jwe@octave.org>
parents:
16468
diff
changeset
|
467 |
25653
b3d357990b52
better use of templates for action_container and derived classes
John W. Eaton <jwe@octave.org>
parents:
25639
diff
changeset
|
468 template <typename T, typename... Params, typename... Args> |
b3d357990b52
better use of templates for action_container and derived classes
John W. Eaton <jwe@octave.org>
parents:
25639
diff
changeset
|
469 void do_post_event (T *obj, void (T::*method) (Params...), Args&&... args) |
23927
e3a36f84d01d
provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
23795
diff
changeset
|
470 { |
25653
b3d357990b52
better use of templates for action_container and derived classes
John W. Eaton <jwe@octave.org>
parents:
25639
diff
changeset
|
471 gui_event_queue.add_method (obj, method, std::forward<Args> (args)...); |
23927
e3a36f84d01d
provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
23795
diff
changeset
|
472 } |
e3a36f84d01d
provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
23795
diff
changeset
|
473 |
24672
13c207835e79
Rethrow gl2ps_print exceptions from GUI to interpreter thread (bug #50198)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
24645
diff
changeset
|
474 void |
13c207835e79
Rethrow gl2ps_print exceptions from GUI to interpreter thread (bug #50198)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
24645
diff
changeset
|
475 rethrow_exception_callback (const std::exception_ptr &p) |
13c207835e79
Rethrow gl2ps_print exceptions from GUI to interpreter thread (bug #50198)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
24645
diff
changeset
|
476 { |
13c207835e79
Rethrow gl2ps_print exceptions from GUI to interpreter thread (bug #50198)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
24645
diff
changeset
|
477 std::rethrow_exception (p); |
13c207835e79
Rethrow gl2ps_print exceptions from GUI to interpreter thread (bug #50198)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
24645
diff
changeset
|
478 } |
13c207835e79
Rethrow gl2ps_print exceptions from GUI to interpreter thread (bug #50198)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
24645
diff
changeset
|
479 |
13c207835e79
Rethrow gl2ps_print exceptions from GUI to interpreter thread (bug #50198)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
24645
diff
changeset
|
480 void |
13c207835e79
Rethrow gl2ps_print exceptions from GUI to interpreter thread (bug #50198)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
24645
diff
changeset
|
481 do_post_exception (const std::exception_ptr &p) |
13c207835e79
Rethrow gl2ps_print exceptions from GUI to interpreter thread (bug #50198)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
24645
diff
changeset
|
482 { |
13c207835e79
Rethrow gl2ps_print exceptions from GUI to interpreter thread (bug #50198)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
24645
diff
changeset
|
483 do_post_event (this, &octave_link::rethrow_exception_callback, p); |
13c207835e79
Rethrow gl2ps_print exceptions from GUI to interpreter thread (bug #50198)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
24645
diff
changeset
|
484 } |
13c207835e79
Rethrow gl2ps_print exceptions from GUI to interpreter thread (bug #50198)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
24645
diff
changeset
|
485 |
15371
eec0d1fcba4f
use Octave singleton style for octave_link class
John W. Eaton <jwe@octave.org>
parents:
15204
diff
changeset
|
486 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
|
487 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
|
488 |
19714
21015ca26566
Restructure shutdown flow and behavior for improved robustness
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
19697
diff
changeset
|
489 virtual bool do_confirm_shutdown (void) = 0; |
16485
8b783661e03f
improve exit sequence for GUI
John W. Eaton <jwe@octave.org>
parents:
16479
diff
changeset
|
490 |
20113
c36f2b083613
make copying figures to clipboard work (bug #44866)
John W. Eaton <jwe@octave.org>
parents:
19970
diff
changeset
|
491 virtual bool do_copy_image_to_clipboard (const std::string& file) = 0; |
c36f2b083613
make copying figures to clipboard work (bug #44866)
John W. Eaton <jwe@octave.org>
parents:
19970
diff
changeset
|
492 |
16443
7a2ee6ea7800
rename dbstop -> breakpoint in GUI interface functions
John W. Eaton <jwe@octave.org>
parents:
16438
diff
changeset
|
493 virtual bool do_edit_file (const std::string& file) = 0; |
17884
766ad9be2966
Prompt for non-existent new file when using edit.m from GUI (bug #40450)
Torsten <ttl@justmail.de>
parents:
17822
diff
changeset
|
494 virtual bool do_prompt_new_edit_file (const std::string& file) = 0; |
16551
6ae555fc8c43
Add questdlg dialog function and fix variety of dialog bugs.
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
16547
diff
changeset
|
495 virtual std::string |
6ae555fc8c43
Add questdlg dialog function and fix variety of dialog bugs.
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
16547
diff
changeset
|
496 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:
16547
diff
changeset
|
497 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:
16547
diff
changeset
|
498 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:
16547
diff
changeset
|
499 |
16512
7f2395651a1c
dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
16502
diff
changeset
|
500 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:
16502
diff
changeset
|
501 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:
16502
diff
changeset
|
502 const std::string& mode, |
7f2395651a1c
dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
16502
diff
changeset
|
503 int width, int height, |
7f2395651a1c
dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
16502
diff
changeset
|
504 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:
16502
diff
changeset
|
505 const std::string& name, |
16551
6ae555fc8c43
Add questdlg dialog function and fix variety of dialog bugs.
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
16547
diff
changeset
|
506 const std::list<std::string>& prompt, |
16512
7f2395651a1c
dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
16502
diff
changeset
|
507 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:
16502
diff
changeset
|
508 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:
16502
diff
changeset
|
509 |
7f2395651a1c
dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
16502
diff
changeset
|
510 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:
16502
diff
changeset
|
511 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:
16502
diff
changeset
|
512 const std::string& title, |
16551
6ae555fc8c43
Add questdlg dialog function and fix variety of dialog bugs.
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
16547
diff
changeset
|
513 const std::list<float>& nr, |
6ae555fc8c43
Add questdlg dialog function and fix variety of dialog bugs.
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
16547
diff
changeset
|
514 const std::list<float>& nc, |
16512
7f2395651a1c
dialog boxes with Qt widgets
Daniel J Sebald <daniel.sebald@ieee.org>, John W. Eaton <jwe@octave.org>
parents:
16502
diff
changeset
|
515 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:
16502
diff
changeset
|
516 |
16579
7f8db1942dc0
Add Qt link uigetfile dialog implementation.
John Donoghue <john.donoghue@ieee.org>
parents:
16570
diff
changeset
|
517 virtual std::list<std::string> |
16580
adc150db1809
style fixes for uigetfile changes
John W. Eaton <jwe@octave.org>
parents:
16579
diff
changeset
|
518 do_file_dialog (const filter_list& filter, const std::string& title, |
adc150db1809
style fixes for uigetfile changes
John W. Eaton <jwe@octave.org>
parents:
16579
diff
changeset
|
519 const std::string& filename, const std::string& dirname, |
16581
fa4a035e0cf4
Add octave_link uiputfile implementation
John Donoghue <john.donoghue@ieee.org>
parents:
16580
diff
changeset
|
520 const std::string& multimode) = 0; |
16579
7f8db1942dc0
Add Qt link uigetfile dialog implementation.
John Donoghue <john.donoghue@ieee.org>
parents:
16570
diff
changeset
|
521 |
16547
3cd80afc3509
improve debugging with the GUI
John W. Eaton <jwe@octave.org>
parents:
16528
diff
changeset
|
522 virtual int |
3cd80afc3509
improve debugging with the GUI
John W. Eaton <jwe@octave.org>
parents:
16528
diff
changeset
|
523 do_debug_cd_or_addpath_error (const std::string& file, |
3cd80afc3509
improve debugging with the GUI
John W. Eaton <jwe@octave.org>
parents:
16528
diff
changeset
|
524 const std::string& dir, |
3cd80afc3509
improve debugging with the GUI
John W. Eaton <jwe@octave.org>
parents:
16528
diff
changeset
|
525 bool addpath_option) = 0; |
3cd80afc3509
improve debugging with the GUI
John W. Eaton <jwe@octave.org>
parents:
16528
diff
changeset
|
526 |
16437
919796a440c6
use signal for changing directory
John W. Eaton <jwe@octave.org>
parents:
16431
diff
changeset
|
527 virtual void do_change_directory (const std::string& dir) = 0; |
16415
70032fc70bee
move octave-link and octave-event-listener classes to libinterp
John W. Eaton <jwe@octave.org>
parents:
16399
diff
changeset
|
528 |
25742
d3c6de326bae
close/reload editor tab when file is (re)moved in gui terminal (bug #43922)
Torsten <mttl@mailbox.org>
parents:
25653
diff
changeset
|
529 virtual void do_file_remove (const std::string& old_name, |
d3c6de326bae
close/reload editor tab when file is (re)moved in gui terminal (bug #43922)
Torsten <mttl@mailbox.org>
parents:
25653
diff
changeset
|
530 const std::string& new_name) = 0; |
d3c6de326bae
close/reload editor tab when file is (re)moved in gui terminal (bug #43922)
Torsten <mttl@mailbox.org>
parents:
25653
diff
changeset
|
531 virtual void do_file_renamed (bool) = 0; |
d3c6de326bae
close/reload editor tab when file is (re)moved in gui terminal (bug #43922)
Torsten <mttl@mailbox.org>
parents:
25653
diff
changeset
|
532 |
16570
d5ae5aa80d42
preserve pending command line input when running commands from GUI actions
John W. Eaton <jwe@octave.org>
parents:
16552
diff
changeset
|
533 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:
16552
diff
changeset
|
534 |
25921
9c47eedc44e2
msgbox.m: use graphics objects to build dialog (bug #42490)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
25742
diff
changeset
|
535 virtual uint8NDArray |
9c47eedc44e2
msgbox.m: use graphics objects to build dialog (bug #42490)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
25742
diff
changeset
|
536 do_get_named_icon (const std::string& icon_name) = 0; |
9c47eedc44e2
msgbox.m: use graphics objects to build dialog (bug #42490)
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
25742
diff
changeset
|
537 |
16468
0f143f68078d
use signal/slot for updating workspace instead of using event listener
John W. Eaton <jwe@octave.org>
parents:
16443
diff
changeset
|
538 virtual void |
19970
f7846f0ea6db
GUI: enable workspace update when debugging (Bug #44455)
John Donoghue
parents:
19714
diff
changeset
|
539 do_set_workspace (bool top_level, bool debug, |
26117
a6df420457ac
use symbol_info_list instead of symbol_scope to pass workspace info to gui
John W. Eaton <jwe@octave.org>
parents:
25948
diff
changeset
|
540 const octave::symbol_info_list& syminfo, |
24631
6de74d95a7a1
don't use "const bool&" unnecessarily
John W. Eaton <jwe@octave.org>
parents:
24624
diff
changeset
|
541 bool update_variable_editor) = 0; |
16468
0f143f68078d
use signal/slot for updating workspace instead of using event listener
John W. Eaton <jwe@octave.org>
parents:
16443
diff
changeset
|
542 |
0f143f68078d
use signal/slot for updating workspace instead of using event listener
John W. Eaton <jwe@octave.org>
parents:
16443
diff
changeset
|
543 virtual void do_clear_workspace (void) = 0; |
16415
70032fc70bee
move octave-link and octave-event-listener classes to libinterp
John W. Eaton <jwe@octave.org>
parents:
16399
diff
changeset
|
544 |
16431
5982d469f79b
use signal for setting, appending to, and clearing history widget
John W. Eaton <jwe@octave.org>
parents:
16426
diff
changeset
|
545 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:
16426
diff
changeset
|
546 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:
16426
diff
changeset
|
547 virtual void do_clear_history (void) = 0; |
16415
70032fc70bee
move octave-link and octave-event-listener classes to libinterp
John W. Eaton <jwe@octave.org>
parents:
16399
diff
changeset
|
548 |
70032fc70bee
move octave-link and octave-event-listener classes to libinterp
John W. Eaton <jwe@octave.org>
parents:
16399
diff
changeset
|
549 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:
16399
diff
changeset
|
550 virtual void do_post_input_event (void) = 0; |
16399
f9a737fd8829
allow command-line edit function to use GUI editor
John W. Eaton <jwe@octave.org>
parents:
16395
diff
changeset
|
551 |
16468
0f143f68078d
use signal/slot for updating workspace instead of using event listener
John W. Eaton <jwe@octave.org>
parents:
16443
diff
changeset
|
552 virtual void |
0f143f68078d
use signal/slot for updating workspace instead of using event listener
John W. Eaton <jwe@octave.org>
parents:
16443
diff
changeset
|
553 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:
16443
diff
changeset
|
554 |
0f143f68078d
use signal/slot for updating workspace instead of using event listener
John W. Eaton <jwe@octave.org>
parents:
16443
diff
changeset
|
555 virtual void |
0f143f68078d
use signal/slot for updating workspace instead of using event listener
John W. Eaton <jwe@octave.org>
parents:
16443
diff
changeset
|
556 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:
16443
diff
changeset
|
557 |
16438
a971d8bdaadc
use signals instead of event queue for entering/leaving debug mode
John W. Eaton <jwe@octave.org>
parents:
16437
diff
changeset
|
558 virtual void do_exit_debugger_event (void) = 0; |
16415
70032fc70bee
move octave-link and octave-event-listener classes to libinterp
John W. Eaton <jwe@octave.org>
parents:
16399
diff
changeset
|
559 |
70032fc70bee
move octave-link and octave-event-listener classes to libinterp
John W. Eaton <jwe@octave.org>
parents:
16399
diff
changeset
|
560 virtual void do_update_breakpoint (bool insert, |
21158
65827e9cccb8
Gui support for enhancement of dbstop.
Lachlan Andrew <lachlanbis@gmail.com>
parents:
21157
diff
changeset
|
561 const std::string& file, int line, |
65827e9cccb8
Gui support for enhancement of dbstop.
Lachlan Andrew <lachlanbis@gmail.com>
parents:
21157
diff
changeset
|
562 const std::string& cond) = 0; |
16528
9bc1f8278966
allow GUI to customize prompts at startup
John W. Eaton <jwe@octave.org>
parents:
16524
diff
changeset
|
563 |
17010
c50ee84842a9
Add preferences and prefdir functions
John Donoghue <john.donoghue@ieee.org>
parents:
16892
diff
changeset
|
564 virtual void do_show_preferences (void) = 0; |
17029
359c5ca795cd
Display doc info pages using documentation browser when in GUI mode (Bug #39451)
John Donoghue <john.donoghue@ieee.org>
parents:
17010
diff
changeset
|
565 |
25639
7644e7f1721f
change gui preferences from within the worker thread (bug #49119)
Torsten <mttl@mailbox.org>
parents:
25407
diff
changeset
|
566 virtual std::string do_gui_preference (const std::string& key, |
7644e7f1721f
change gui preferences from within the worker thread (bug #49119)
Torsten <mttl@mailbox.org>
parents:
25407
diff
changeset
|
567 const std::string& value) = 0; |
7644e7f1721f
change gui preferences from within the worker thread (bug #49119)
Torsten <mttl@mailbox.org>
parents:
25407
diff
changeset
|
568 |
23433
c9fab0bc983e
maint: Use convention 'int& x' for naming references.
Rik <rik@octave.org>
parents:
23220
diff
changeset
|
569 virtual void do_show_doc (const std::string& file) = 0; |
23927
e3a36f84d01d
provide variable-editor widget for the GUI
Michael Barnes <mjbcode@runbox.com>
parents:
23795
diff
changeset
|
570 |
25060
1cd3aeda7598
Allow registering compressed help at run time (bug #53006).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
25054
diff
changeset
|
571 virtual void do_register_doc (const std::string& file) = 0; |
1cd3aeda7598
Allow registering compressed help at run time (bug #53006).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
25054
diff
changeset
|
572 |
1cd3aeda7598
Allow registering compressed help at run time (bug #53006).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
25054
diff
changeset
|
573 virtual void do_unregister_doc (const std::string& file) = 0; |
1cd3aeda7598
Allow registering compressed help at run time (bug #53006).
Pantxo Diribarne <pantxo.diribarne@gmail.com>
parents:
25054
diff
changeset
|
574 |
24641
7d177be54c37
pass variable value to variable editor in addition to variable name
John W. Eaton <jwe@octave.org>
parents:
24631
diff
changeset
|
575 virtual void |
7d177be54c37
pass variable value to variable editor in addition to variable name
John W. Eaton <jwe@octave.org>
parents:
24631
diff
changeset
|
576 do_edit_variable (const std::string& name, const octave_value& val) = 0; |
15371
eec0d1fcba4f
use Octave singleton style for octave_link class
John W. Eaton <jwe@octave.org>
parents:
15204
diff
changeset
|
577 }; |
14713
565ddd85565e
Added comments for the octave-adapter module.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14712
diff
changeset
|
578 |
20945
9d9270e2f98f
eliminate comments after preprocessor conditionals
John W. Eaton <jwe@octave.org>
parents:
20791
diff
changeset
|
579 #endif |