Mercurial > octave
annotate libgui/src/terminal-dock-widget.h @ 29550:8dd0fca2a3d9
where possible, use default destructors in GUI classes
In most cases, don't explicitly delete objects that have parents in
the QObject class hierarchy as they will be deleted automatically when
the parent object is deleted. Explicitly declare more destructors as
"default".
Files affected: dialog.cc, dialog.h, documentation-bookmarks.cc,
documentation-bookmarks.h, documentation-dock-widget.cc,
documentation-dock-widget.h, documentation.cc, documentation.h,
m-editor/file-editor.cc, m-editor/file-editor.h, main-window.cc,
main-window.h, set-path-dialog.cc, set-path-dialog.h, tab-bar.cc,
tab-bar.h, terminal-dock-widget.cc, and terminal-dock-widget.h.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Thu, 22 Apr 2021 12:52:14 -0400 |
parents | 3bfec185c9e2 |
children | d64ad3b93372 |
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 // |
29358
0a5b15007766
update Octave Project Developers copyright for the new year
John W. Eaton <jwe@octave.org>
parents:
27923
diff
changeset
|
3 // Copyright (C) 2011-2021 The Octave Project Developers |
27923
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 //////////////////////////////////////////////////////////////////////// |
14692
d6d250812c01
Made the terminal window dockable, too. Now the whole interface is fully dockable.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff
changeset
|
25 |
21203
710e700cdd7f
maint: Clean up naming and indentation of #ifdef blocks in libgui
Rik <rik@octave.org>
parents:
20945
diff
changeset
|
26 #if ! defined (octave_terminal_dock_widget_h) |
710e700cdd7f
maint: Clean up naming and indentation of #ifdef blocks in libgui
Rik <rik@octave.org>
parents:
20945
diff
changeset
|
27 #define octave_terminal_dock_widget_h 1 |
14692
d6d250812c01
Made the terminal window dockable, too. Now the whole interface is fully dockable.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff
changeset
|
28 |
16446
4b3a4bf8569b
improve encapsulation of command window object
John W. Eaton <jwe@octave.org>
parents:
16057
diff
changeset
|
29 #include <QString> |
4b3a4bf8569b
improve encapsulation of command window object
John W. Eaton <jwe@octave.org>
parents:
16057
diff
changeset
|
30 |
16057
c3057d80cf91
Created common octave_dock_widget class
Richard Crozier <richard.crozier@yahoo.co.uk>
parents:
15585
diff
changeset
|
31 #include "octave-dock-widget.h" |
14692
d6d250812c01
Made the terminal window dockable, too. Now the whole interface is fully dockable.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff
changeset
|
32 |
24733
e15d53d2de1e
move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
33 namespace octave |
14692
d6d250812c01
Made the terminal window dockable, too. Now the whole interface is fully dockable.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff
changeset
|
34 { |
27629
8b6e928e0705
in GUI objects, store reference to base_qobject instead of resource_manager
John W. Eaton <jwe@octave.org>
parents:
27620
diff
changeset
|
35 class base_qobject; |
27620
45bb5bbaf291
don't use singleton pattern for resource manager in GUI
John W. Eaton <jwe@octave.org>
parents:
27412
diff
changeset
|
36 |
24733
e15d53d2de1e
move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
37 class terminal_dock_widget : public octave_dock_widget |
e15d53d2de1e
move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
38 { |
e15d53d2de1e
move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
39 Q_OBJECT |
16446
4b3a4bf8569b
improve encapsulation of command window object
John W. Eaton <jwe@octave.org>
parents:
16057
diff
changeset
|
40 |
24733
e15d53d2de1e
move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
41 public: |
e15d53d2de1e
move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
42 |
27629
8b6e928e0705
in GUI objects, store reference to base_qobject instead of resource_manager
John W. Eaton <jwe@octave.org>
parents:
27620
diff
changeset
|
43 terminal_dock_widget (QWidget *parent, base_qobject& oct_qobj); |
16446
4b3a4bf8569b
improve encapsulation of command window object
John W. Eaton <jwe@octave.org>
parents:
16057
diff
changeset
|
44 |
29550
8dd0fca2a3d9
where possible, use default destructors in GUI classes
John W. Eaton <jwe@octave.org>
parents:
29503
diff
changeset
|
45 ~terminal_dock_widget (void) = default; |
22177
6e9f5408c0db
Save settings in Qt convention, delete all children in destructors (bug #45366)
Daniel J Sebald <daniel.sebald@ieee.org>
parents:
21203
diff
changeset
|
46 |
24733
e15d53d2de1e
move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
47 bool has_focus (void) const; |
16576
2754c5fd6ae0
keep focus in the command window after dbstop, dbstep, etc.
John W. Eaton <jwe@octave.org>
parents:
16570
diff
changeset
|
48 |
29503
3bfec185c9e2
experimental command window widget with server loop
John W. Eaton <jwe@octave.org>
parents:
29359
diff
changeset
|
49 signals: |
3bfec185c9e2
experimental command window widget with server loop
John W. Eaton <jwe@octave.org>
parents:
29359
diff
changeset
|
50 |
3bfec185c9e2
experimental command window widget with server loop
John W. Eaton <jwe@octave.org>
parents:
29359
diff
changeset
|
51 // Note: UPDATE_PROMPT_SIGNAL and INTERPRETER_OUTPUT_SIGNAL are |
3bfec185c9e2
experimental command window widget with server loop
John W. Eaton <jwe@octave.org>
parents:
29359
diff
changeset
|
52 // currently only used by the new experimental terminal widget. |
3bfec185c9e2
experimental command window widget with server loop
John W. Eaton <jwe@octave.org>
parents:
29359
diff
changeset
|
53 |
3bfec185c9e2
experimental command window widget with server loop
John W. Eaton <jwe@octave.org>
parents:
29359
diff
changeset
|
54 void update_prompt_signal (const QString&); |
3bfec185c9e2
experimental command window widget with server loop
John W. Eaton <jwe@octave.org>
parents:
29359
diff
changeset
|
55 |
3bfec185c9e2
experimental command window widget with server loop
John W. Eaton <jwe@octave.org>
parents:
29359
diff
changeset
|
56 void interpreter_output_signal (const QString&); |
3bfec185c9e2
experimental command window widget with server loop
John W. Eaton <jwe@octave.org>
parents:
29359
diff
changeset
|
57 |
3bfec185c9e2
experimental command window widget with server loop
John W. Eaton <jwe@octave.org>
parents:
29359
diff
changeset
|
58 public slots: |
3bfec185c9e2
experimental command window widget with server loop
John W. Eaton <jwe@octave.org>
parents:
29359
diff
changeset
|
59 |
3bfec185c9e2
experimental command window widget with server loop
John W. Eaton <jwe@octave.org>
parents:
29359
diff
changeset
|
60 // Note: INTERPRETER_OUTPUT and UPDATE_PROMPT are currently only |
3bfec185c9e2
experimental command window widget with server loop
John W. Eaton <jwe@octave.org>
parents:
29359
diff
changeset
|
61 // used by the new experimental terminal widget. |
3bfec185c9e2
experimental command window widget with server loop
John W. Eaton <jwe@octave.org>
parents:
29359
diff
changeset
|
62 |
3bfec185c9e2
experimental command window widget with server loop
John W. Eaton <jwe@octave.org>
parents:
29359
diff
changeset
|
63 void interpreter_output (const QString&); |
3bfec185c9e2
experimental command window widget with server loop
John W. Eaton <jwe@octave.org>
parents:
29359
diff
changeset
|
64 |
3bfec185c9e2
experimental command window widget with server loop
John W. Eaton <jwe@octave.org>
parents:
29359
diff
changeset
|
65 void update_prompt (const QString&); |
3bfec185c9e2
experimental command window widget with server loop
John W. Eaton <jwe@octave.org>
parents:
29359
diff
changeset
|
66 |
24733
e15d53d2de1e
move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
67 private: |
17920
5c3f22dd0bbb
raise SIGINT in octave_interpreter instead of in QTerminal
John W. Eaton <jwe@octave.org>
parents:
17744
diff
changeset
|
68 |
29503
3bfec185c9e2
experimental command window widget with server loop
John W. Eaton <jwe@octave.org>
parents:
29359
diff
changeset
|
69 bool m_experimental_terminal_widget; |
3bfec185c9e2
experimental command window widget with server loop
John W. Eaton <jwe@octave.org>
parents:
29359
diff
changeset
|
70 |
3bfec185c9e2
experimental command window widget with server loop
John W. Eaton <jwe@octave.org>
parents:
29359
diff
changeset
|
71 // FIXME!!! Maybe my_term should just be derived from QTerminal? |
3bfec185c9e2
experimental command window widget with server loop
John W. Eaton <jwe@octave.org>
parents:
29359
diff
changeset
|
72 QWidget *m_terminal; |
24733
e15d53d2de1e
move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
73 }; |
e15d53d2de1e
move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
74 } |
14692
d6d250812c01
Made the terminal window dockable, too. Now the whole interface is fully dockable.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff
changeset
|
75 |
20945
9d9270e2f98f
eliminate comments after preprocessor conditionals
John W. Eaton <jwe@octave.org>
parents:
19697
diff
changeset
|
76 #endif |