Mercurial > octave
annotate libgui/src/interpreter-qobject.cc @ 29163:8f67ad8b3103
maint: Updating naming conventions for exceptions and use const where possible.
* GLCanvas.cc, interpreter-qobject.cc, file-editor-tab.cc,
octave-qscintilla.cc, octave-qobject.cc, Cell.cc, __eigs__.cc,
__magick_read__.cc, __qp__.cc, daspk.cc, dasrt.cc, dassl.cc, data.cc,
file-io.cc, graphics.cc, graphics.in.h, input.cc, interpreter.cc,
ls-mat-ascii.cc, lsode.cc, oct-handle.h, oct-map.cc, quad.cc, rand.cc,
sparse.cc, sub2ind.cc, toplev.cc, utils.cc, __init_gnuplot__.cc, __ode15__.cc,
cdef-object.cc, ov-base-diag.cc, ov-base-mat.cc, ov-base-sparse.cc,
ov-base.cc, ov-fcn-handle.cc, ov-java.cc, ov-perm.cc, ov-range.cc,
ov-re-diag.cc, ov-str-mat.cc, ov.cc, pt-assign.cc, pt-eval.cc, pt-idx.cc,
pt-jit.cc, pt.cc, Array-util.cc, randmtzig.cc:
Update naming conventions for exceptions to use initial letter of exception
type. For example, "execution_exception" is named "ee", "index_exception" is
"ie". Catch "const" exceptions where possible.
* gzip.cc: Add block to catch and throw interrupt_exceptions before having
a catch block "(...)" for everything else.
author | Rik <rik@octave.org> |
---|---|
date | Tue, 08 Dec 2020 13:25:03 -0800 |
parents | 00a9a49c7670 |
children | c2f3a0832cf0 |
rev | line source |
---|---|
27923
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
1 //////////////////////////////////////////////////////////////////////// |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
2 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
3 // Copyright (C) 2011-2020 The Octave Project Developers |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
4 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
5 // See the file COPYRIGHT.md in the top-level directory of this |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
6 // distribution or <https://octave.org/copyright/>. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
7 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
8 // This file is part of Octave. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
9 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
10 // Octave is free software: you can redistribute it and/or modify it |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
11 // under the terms of the GNU General Public License as published by |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
12 // the Free Software Foundation, either version 3 of the License, or |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
13 // (at your option) any later version. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
14 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
15 // Octave is distributed in the hope that it will be useful, but |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
16 // WITHOUT ANY WARRANTY; without even the implied warranty of |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
18 // GNU General Public License for more details. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
19 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
20 // You should have received a copy of the GNU General Public License |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
21 // along with Octave; see the file COPYING. If not, see |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
22 // <https://www.gnu.org/licenses/>. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
23 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
24 //////////////////////////////////////////////////////////////////////// |
27196
d993642352d0
rename octave_interpreter object in GUI
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
25 |
d993642352d0
rename octave_interpreter object in GUI
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
26 #if defined (HAVE_CONFIG_H) |
d993642352d0
rename octave_interpreter object in GUI
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
27 # include "config.h" |
d993642352d0
rename octave_interpreter object in GUI
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
28 #endif |
d993642352d0
rename octave_interpreter object in GUI
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
29 |
d993642352d0
rename octave_interpreter object in GUI
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
30 #include "interpreter-qobject.h" |
27218
a044202208af
more refactoring of GUI classes that manage the interpreter
John W. Eaton <jwe@octave.org>
parents:
27197
diff
changeset
|
31 #include "octave-qobject.h" |
27412
da1f59fe04b3
try to use consitent ordering for include files in libgui sources
John W. Eaton <jwe@octave.org>
parents:
27302
diff
changeset
|
32 #include "qt-application.h" |
27263
99aa1bcb8848
rename octave_link and octave_link_events classes, move inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
27262
diff
changeset
|
33 #include "qt-interpreter-events.h" |
27196
d993642352d0
rename octave_interpreter object in GUI
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
34 |
27697
5e8891dceec7
backout changesets cdb681adc85a and b3401292e101 (bug #56952)
John W. Eaton <jwe@octave.org>
parents:
27695
diff
changeset
|
35 #include "graphics-init.h" |
27196
d993642352d0
rename octave_interpreter object in GUI
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
36 #include "input.h" |
d993642352d0
rename octave_interpreter object in GUI
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
37 #include "interpreter.h" |
d993642352d0
rename octave_interpreter object in GUI
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
38 |
d993642352d0
rename octave_interpreter object in GUI
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
39 namespace octave |
d993642352d0
rename octave_interpreter object in GUI
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
40 { |
27588
f0e3f3e28a8e
move qt_interpreter_events object from interpreter_qobject to octave_qobject
John W. Eaton <jwe@octave.org>
parents:
27412
diff
changeset
|
41 interpreter_qobject::interpreter_qobject (base_qobject& oct_qobj) |
27697
5e8891dceec7
backout changesets cdb681adc85a and b3401292e101 (bug #56952)
John W. Eaton <jwe@octave.org>
parents:
27695
diff
changeset
|
42 : QObject (), m_octave_qobj (oct_qobj), m_interpreter (nullptr) |
27261
dccdc3b001a2
eliminate static functions from octave_link class
John W. Eaton <jwe@octave.org>
parents:
27260
diff
changeset
|
43 { } |
dccdc3b001a2
eliminate static functions from octave_link class
John W. Eaton <jwe@octave.org>
parents:
27260
diff
changeset
|
44 |
dccdc3b001a2
eliminate static functions from octave_link class
John W. Eaton <jwe@octave.org>
parents:
27260
diff
changeset
|
45 void interpreter_qobject::execute (void) |
27218
a044202208af
more refactoring of GUI classes that manage the interpreter
John W. Eaton <jwe@octave.org>
parents:
27197
diff
changeset
|
46 { |
27261
dccdc3b001a2
eliminate static functions from octave_link class
John W. Eaton <jwe@octave.org>
parents:
27260
diff
changeset
|
47 // The Octave application context owns the interpreter. |
dccdc3b001a2
eliminate static functions from octave_link class
John W. Eaton <jwe@octave.org>
parents:
27260
diff
changeset
|
48 |
27588
f0e3f3e28a8e
move qt_interpreter_events object from interpreter_qobject to octave_qobject
John W. Eaton <jwe@octave.org>
parents:
27412
diff
changeset
|
49 qt_application& app_context = m_octave_qobj.app_context (); |
27261
dccdc3b001a2
eliminate static functions from octave_link class
John W. Eaton <jwe@octave.org>
parents:
27260
diff
changeset
|
50 |
dccdc3b001a2
eliminate static functions from octave_link class
John W. Eaton <jwe@octave.org>
parents:
27260
diff
changeset
|
51 interpreter& interp = app_context.create_interpreter (); |
dccdc3b001a2
eliminate static functions from octave_link class
John W. Eaton <jwe@octave.org>
parents:
27260
diff
changeset
|
52 |
27263
99aa1bcb8848
rename octave_link and octave_link_events classes, move inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
27262
diff
changeset
|
53 event_manager& evmgr = interp.get_event_manager (); |
27261
dccdc3b001a2
eliminate static functions from octave_link class
John W. Eaton <jwe@octave.org>
parents:
27260
diff
changeset
|
54 |
27588
f0e3f3e28a8e
move qt_interpreter_events object from interpreter_qobject to octave_qobject
John W. Eaton <jwe@octave.org>
parents:
27412
diff
changeset
|
55 evmgr.connect_link (m_octave_qobj.get_qt_interpreter_events ()); |
27263
99aa1bcb8848
rename octave_link and octave_link_events classes, move inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
27262
diff
changeset
|
56 evmgr.enable (); |
27218
a044202208af
more refactoring of GUI classes that manage the interpreter
John W. Eaton <jwe@octave.org>
parents:
27197
diff
changeset
|
57 |
27196
d993642352d0
rename octave_interpreter object in GUI
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
58 int exit_status = 0; |
d993642352d0
rename octave_interpreter object in GUI
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
59 |
d993642352d0
rename octave_interpreter object in GUI
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
60 try |
d993642352d0
rename octave_interpreter object in GUI
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
61 { |
d993642352d0
rename octave_interpreter object in GUI
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
62 // Final initialization. |
d993642352d0
rename octave_interpreter object in GUI
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
63 |
d993642352d0
rename octave_interpreter object in GUI
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
64 interp.initialize (); |
d993642352d0
rename octave_interpreter object in GUI
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
65 |
27218
a044202208af
more refactoring of GUI classes that manage the interpreter
John W. Eaton <jwe@octave.org>
parents:
27197
diff
changeset
|
66 if (app_context.start_gui_p ()) |
27196
d993642352d0
rename octave_interpreter object in GUI
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
67 { |
d993642352d0
rename octave_interpreter object in GUI
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
68 input_system& input_sys = interp.get_input_system (); |
d993642352d0
rename octave_interpreter object in GUI
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
69 |
d993642352d0
rename octave_interpreter object in GUI
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
70 input_sys.PS1 (">> "); |
d993642352d0
rename octave_interpreter object in GUI
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
71 input_sys.PS2 (""); |
d993642352d0
rename octave_interpreter object in GUI
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
72 } |
d993642352d0
rename octave_interpreter object in GUI
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
73 |
d993642352d0
rename octave_interpreter object in GUI
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
74 if (interp.initialized ()) |
d993642352d0
rename octave_interpreter object in GUI
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
75 { |
27697
5e8891dceec7
backout changesets cdb681adc85a and b3401292e101 (bug #56952)
John W. Eaton <jwe@octave.org>
parents:
27695
diff
changeset
|
76 // The interpreter should be completely ready at this point so let |
5e8891dceec7
backout changesets cdb681adc85a and b3401292e101 (bug #56952)
John W. Eaton <jwe@octave.org>
parents:
27695
diff
changeset
|
77 // the GUI know. |
27196
d993642352d0
rename octave_interpreter object in GUI
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
78 |
27302
5f170ea12fa1
use Qt signals to pass interpreter callbacks to octave-qobject
John W. Eaton <jwe@octave.org>
parents:
27263
diff
changeset
|
79 m_interpreter = &interp; |
5f170ea12fa1
use Qt signals to pass interpreter callbacks to octave-qobject
John W. Eaton <jwe@octave.org>
parents:
27263
diff
changeset
|
80 |
28347
00a9a49c7670
improve interpreter shutdown process (bug #56952)
John W. Eaton <jwe@octave.org>
parents:
27923
diff
changeset
|
81 emit ready (); |
27196
d993642352d0
rename octave_interpreter object in GUI
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
82 |
27697
5e8891dceec7
backout changesets cdb681adc85a and b3401292e101 (bug #56952)
John W. Eaton <jwe@octave.org>
parents:
27695
diff
changeset
|
83 graphics_init (interp, m_octave_qobj); |
27695
cdb681adc85a
improve exit behavior with qt graphics toolkit (bug #56952)
John W. Eaton <jwe@octave.org>
parents:
27694
diff
changeset
|
84 |
27196
d993642352d0
rename octave_interpreter object in GUI
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
85 // Start executing commands in the command window. |
d993642352d0
rename octave_interpreter object in GUI
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
86 |
d993642352d0
rename octave_interpreter object in GUI
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
87 exit_status = interp.execute (); |
d993642352d0
rename octave_interpreter object in GUI
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
88 } |
d993642352d0
rename octave_interpreter object in GUI
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
89 } |
29163
8f67ad8b3103
maint: Updating naming conventions for exceptions and use const where possible.
Rik <rik@octave.org>
parents:
28347
diff
changeset
|
90 catch (const exit_exception& xe) |
27196
d993642352d0
rename octave_interpreter object in GUI
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
91 { |
29163
8f67ad8b3103
maint: Updating naming conventions for exceptions and use const where possible.
Rik <rik@octave.org>
parents:
28347
diff
changeset
|
92 exit_status = xe.exit_status (); |
27196
d993642352d0
rename octave_interpreter object in GUI
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
93 } |
d993642352d0
rename octave_interpreter object in GUI
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
94 |
28347
00a9a49c7670
improve interpreter shutdown process (bug #56952)
John W. Eaton <jwe@octave.org>
parents:
27923
diff
changeset
|
95 // Signal that the interpreter is done executing code in the main |
00a9a49c7670
improve interpreter shutdown process (bug #56952)
John W. Eaton <jwe@octave.org>
parents:
27923
diff
changeset
|
96 // REPL, from script files, or command line eval arguments. By |
00a9a49c7670
improve interpreter shutdown process (bug #56952)
John W. Eaton <jwe@octave.org>
parents:
27923
diff
changeset
|
97 // using a signal here, we give the GUI a chance to process any |
00a9a49c7670
improve interpreter shutdown process (bug #56952)
John W. Eaton <jwe@octave.org>
parents:
27923
diff
changeset
|
98 // pending events, then signal that it is safe to shutdown the |
00a9a49c7670
improve interpreter shutdown process (bug #56952)
John W. Eaton <jwe@octave.org>
parents:
27923
diff
changeset
|
99 // interpreter. Our notification here allows the GUI to insert the |
00a9a49c7670
improve interpreter shutdown process (bug #56952)
John W. Eaton <jwe@octave.org>
parents:
27923
diff
changeset
|
100 // request to shutdown the interpreter in the event queue after any |
00a9a49c7670
improve interpreter shutdown process (bug #56952)
John W. Eaton <jwe@octave.org>
parents:
27923
diff
changeset
|
101 // other pending signals. The application context owns the |
00a9a49c7670
improve interpreter shutdown process (bug #56952)
John W. Eaton <jwe@octave.org>
parents:
27923
diff
changeset
|
102 // interpreter and will be responsible for deleting it later, when |
00a9a49c7670
improve interpreter shutdown process (bug #56952)
John W. Eaton <jwe@octave.org>
parents:
27923
diff
changeset
|
103 // the application object destructor is executed. |
27302
5f170ea12fa1
use Qt signals to pass interpreter callbacks to octave-qobject
John W. Eaton <jwe@octave.org>
parents:
27263
diff
changeset
|
104 |
28347
00a9a49c7670
improve interpreter shutdown process (bug #56952)
John W. Eaton <jwe@octave.org>
parents:
27923
diff
changeset
|
105 emit execution_finished (exit_status); |
00a9a49c7670
improve interpreter shutdown process (bug #56952)
John W. Eaton <jwe@octave.org>
parents:
27923
diff
changeset
|
106 } |
27302
5f170ea12fa1
use Qt signals to pass interpreter callbacks to octave-qobject
John W. Eaton <jwe@octave.org>
parents:
27263
diff
changeset
|
107 |
28347
00a9a49c7670
improve interpreter shutdown process (bug #56952)
John W. Eaton <jwe@octave.org>
parents:
27923
diff
changeset
|
108 // This function is expected to be executed when the GUI signals that |
00a9a49c7670
improve interpreter shutdown process (bug #56952)
John W. Eaton <jwe@octave.org>
parents:
27923
diff
changeset
|
109 // it is finished processing events and ready for the interpreter to |
00a9a49c7670
improve interpreter shutdown process (bug #56952)
John W. Eaton <jwe@octave.org>
parents:
27923
diff
changeset
|
110 // perform shutdown actions. |
27694
b3401292e101
store Qt graphics toolkit object in interpreter_qobject
John W. Eaton <jwe@octave.org>
parents:
27646
diff
changeset
|
111 |
28347
00a9a49c7670
improve interpreter shutdown process (bug #56952)
John W. Eaton <jwe@octave.org>
parents:
27923
diff
changeset
|
112 void interpreter_qobject::shutdown (int exit_status) |
00a9a49c7670
improve interpreter shutdown process (bug #56952)
John W. Eaton <jwe@octave.org>
parents:
27923
diff
changeset
|
113 { |
00a9a49c7670
improve interpreter shutdown process (bug #56952)
John W. Eaton <jwe@octave.org>
parents:
27923
diff
changeset
|
114 if (m_interpreter) |
00a9a49c7670
improve interpreter shutdown process (bug #56952)
John W. Eaton <jwe@octave.org>
parents:
27923
diff
changeset
|
115 m_interpreter->shutdown (); |
27695
cdb681adc85a
improve exit behavior with qt graphics toolkit (bug #56952)
John W. Eaton <jwe@octave.org>
parents:
27694
diff
changeset
|
116 |
28347
00a9a49c7670
improve interpreter shutdown process (bug #56952)
John W. Eaton <jwe@octave.org>
parents:
27923
diff
changeset
|
117 // Signal that the interpreter has executed shutdown actions. |
00a9a49c7670
improve interpreter shutdown process (bug #56952)
John W. Eaton <jwe@octave.org>
parents:
27923
diff
changeset
|
118 |
00a9a49c7670
improve interpreter shutdown process (bug #56952)
John W. Eaton <jwe@octave.org>
parents:
27923
diff
changeset
|
119 emit shutdown_finished (exit_status); |
27695
cdb681adc85a
improve exit behavior with qt graphics toolkit (bug #56952)
John W. Eaton <jwe@octave.org>
parents:
27694
diff
changeset
|
120 } |
cdb681adc85a
improve exit behavior with qt graphics toolkit (bug #56952)
John W. Eaton <jwe@octave.org>
parents:
27694
diff
changeset
|
121 |
27302
5f170ea12fa1
use Qt signals to pass interpreter callbacks to octave-qobject
John W. Eaton <jwe@octave.org>
parents:
27263
diff
changeset
|
122 void interpreter_qobject::interpreter_event (const fcn_callback& fcn) |
5f170ea12fa1
use Qt signals to pass interpreter callbacks to octave-qobject
John W. Eaton <jwe@octave.org>
parents:
27263
diff
changeset
|
123 { |
5f170ea12fa1
use Qt signals to pass interpreter callbacks to octave-qobject
John W. Eaton <jwe@octave.org>
parents:
27263
diff
changeset
|
124 if (! m_interpreter) |
5f170ea12fa1
use Qt signals to pass interpreter callbacks to octave-qobject
John W. Eaton <jwe@octave.org>
parents:
27263
diff
changeset
|
125 return; |
5f170ea12fa1
use Qt signals to pass interpreter callbacks to octave-qobject
John W. Eaton <jwe@octave.org>
parents:
27263
diff
changeset
|
126 |
5f170ea12fa1
use Qt signals to pass interpreter callbacks to octave-qobject
John W. Eaton <jwe@octave.org>
parents:
27263
diff
changeset
|
127 event_manager& evmgr = m_interpreter->get_event_manager (); |
5f170ea12fa1
use Qt signals to pass interpreter callbacks to octave-qobject
John W. Eaton <jwe@octave.org>
parents:
27263
diff
changeset
|
128 |
5f170ea12fa1
use Qt signals to pass interpreter callbacks to octave-qobject
John W. Eaton <jwe@octave.org>
parents:
27263
diff
changeset
|
129 evmgr.post_event (fcn); |
5f170ea12fa1
use Qt signals to pass interpreter callbacks to octave-qobject
John W. Eaton <jwe@octave.org>
parents:
27263
diff
changeset
|
130 } |
5f170ea12fa1
use Qt signals to pass interpreter callbacks to octave-qobject
John W. Eaton <jwe@octave.org>
parents:
27263
diff
changeset
|
131 |
5f170ea12fa1
use Qt signals to pass interpreter callbacks to octave-qobject
John W. Eaton <jwe@octave.org>
parents:
27263
diff
changeset
|
132 void interpreter_qobject::interpreter_event (const meth_callback& meth) |
5f170ea12fa1
use Qt signals to pass interpreter callbacks to octave-qobject
John W. Eaton <jwe@octave.org>
parents:
27263
diff
changeset
|
133 { |
5f170ea12fa1
use Qt signals to pass interpreter callbacks to octave-qobject
John W. Eaton <jwe@octave.org>
parents:
27263
diff
changeset
|
134 if (! m_interpreter) |
5f170ea12fa1
use Qt signals to pass interpreter callbacks to octave-qobject
John W. Eaton <jwe@octave.org>
parents:
27263
diff
changeset
|
135 return; |
5f170ea12fa1
use Qt signals to pass interpreter callbacks to octave-qobject
John W. Eaton <jwe@octave.org>
parents:
27263
diff
changeset
|
136 |
5f170ea12fa1
use Qt signals to pass interpreter callbacks to octave-qobject
John W. Eaton <jwe@octave.org>
parents:
27263
diff
changeset
|
137 event_manager& evmgr = m_interpreter->get_event_manager (); |
5f170ea12fa1
use Qt signals to pass interpreter callbacks to octave-qobject
John W. Eaton <jwe@octave.org>
parents:
27263
diff
changeset
|
138 |
5f170ea12fa1
use Qt signals to pass interpreter callbacks to octave-qobject
John W. Eaton <jwe@octave.org>
parents:
27263
diff
changeset
|
139 evmgr.post_event (meth); |
5f170ea12fa1
use Qt signals to pass interpreter callbacks to octave-qobject
John W. Eaton <jwe@octave.org>
parents:
27263
diff
changeset
|
140 } |
5f170ea12fa1
use Qt signals to pass interpreter callbacks to octave-qobject
John W. Eaton <jwe@octave.org>
parents:
27263
diff
changeset
|
141 |
27588
f0e3f3e28a8e
move qt_interpreter_events object from interpreter_qobject to octave_qobject
John W. Eaton <jwe@octave.org>
parents:
27412
diff
changeset
|
142 qt_interpreter_events * interpreter_qobject::qt_link (void) |
27218
a044202208af
more refactoring of GUI classes that manage the interpreter
John W. Eaton <jwe@octave.org>
parents:
27197
diff
changeset
|
143 { |
27588
f0e3f3e28a8e
move qt_interpreter_events object from interpreter_qobject to octave_qobject
John W. Eaton <jwe@octave.org>
parents:
27412
diff
changeset
|
144 return m_octave_qobj.qt_link (); |
27218
a044202208af
more refactoring of GUI classes that manage the interpreter
John W. Eaton <jwe@octave.org>
parents:
27197
diff
changeset
|
145 } |
27196
d993642352d0
rename octave_interpreter object in GUI
John W. Eaton <jwe@octave.org>
parents:
diff
changeset
|
146 } |