annotate libgui/src/terminal-dock-widget.h @ 33623:4517f929c59d bytecode-interpreter tip

maint: Merge default to bytecode-interpreter
author Arun Giridhar <arungiridhar@gmail.com>
date Fri, 24 May 2024 16:22:41 -0400
parents 7f18c537e101
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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 //
32632
2e484f9f1f18 maint: update Octave Project Developers copyright for the new year
John W. Eaton <jwe@octave.org>
parents: 31808
diff changeset
3 // Copyright (C) 2011-2024 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
29783
5154c91e0d98 eliminate some connections to parent objects in octave_dock_widget classes
John W. Eaton <jwe@octave.org>
parents: 29611
diff changeset
33 class QTerminal;
5154c91e0d98 eliminate some connections to parent objects in octave_dock_widget classes
John W. Eaton <jwe@octave.org>
parents: 29611
diff changeset
34
31646
c6d54dd31a7e maint: Use macros to begin/end C++ namespaces.
John W. Eaton <jwe@octave.org>
parents: 31222
diff changeset
35 OCTAVE_BEGIN_NAMESPACE(octave)
c6d54dd31a7e maint: Use macros to begin/end C++ namespaces.
John W. Eaton <jwe@octave.org>
parents: 31222
diff changeset
36
31808
90621682cc03 maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents: 31771
diff changeset
37 class command_widget;
27620
45bb5bbaf291 don't use singleton pattern for resource manager in GUI
John W. Eaton <jwe@octave.org>
parents: 27412
diff changeset
38
31808
90621682cc03 maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents: 31771
diff changeset
39 class terminal_dock_widget : public octave_dock_widget
90621682cc03 maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents: 31771
diff changeset
40 {
90621682cc03 maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents: 31771
diff changeset
41 Q_OBJECT
27620
45bb5bbaf291 don't use singleton pattern for resource manager in GUI
John W. Eaton <jwe@octave.org>
parents: 27412
diff changeset
42
31808
90621682cc03 maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents: 31771
diff changeset
43 public:
16446
4b3a4bf8569b improve encapsulation of command window object
John W. Eaton <jwe@octave.org>
parents: 16057
diff changeset
44
31808
90621682cc03 maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents: 31771
diff changeset
45 terminal_dock_widget (QWidget *parent,
90621682cc03 maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents: 31771
diff changeset
46 bool experimental_terminal_widget = false);
24733
e15d53d2de1e move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents: 24534
diff changeset
47
31808
90621682cc03 maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents: 31771
diff changeset
48 ~terminal_dock_widget () = default;
16446
4b3a4bf8569b improve encapsulation of command window object
John W. Eaton <jwe@octave.org>
parents: 16057
diff changeset
49
31808
90621682cc03 maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents: 31771
diff changeset
50 bool has_focus () const;
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
51
31808
90621682cc03 maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents: 31771
diff changeset
52 void init_command_prompt ();
16576
2754c5fd6ae0 keep focus in the command window after dbstop, dbstep, etc.
John W. Eaton <jwe@octave.org>
parents: 16570
diff changeset
53
31808
90621682cc03 maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents: 31771
diff changeset
54 void init_control_d_shortcut_behavior ();
31067
5261a81765b0 merge input and output of exp. terminal widget into one widget
Torsten Lilge <ttl-octave@mailbox.org>
parents: 30564
diff changeset
55
31808
90621682cc03 maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents: 31771
diff changeset
56 // FIXME: The next two functions could be eliminated (or combined)
90621682cc03 maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents: 31771
diff changeset
57 // if we had a common interface for the old and new terminal
90621682cc03 maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents: 31771
diff changeset
58 // widgets.
29783
5154c91e0d98 eliminate some connections to parent objects in octave_dock_widget classes
John W. Eaton <jwe@octave.org>
parents: 29611
diff changeset
59
31808
90621682cc03 maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents: 31771
diff changeset
60 // Only valid if using the old terminal widget.
90621682cc03 maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents: 31771
diff changeset
61 QTerminal * get_qterminal ();
29783
5154c91e0d98 eliminate some connections to parent objects in octave_dock_widget classes
John W. Eaton <jwe@octave.org>
parents: 29611
diff changeset
62
31222
1a0756f7c90a disable experimental terminal widget when building without qscintilla
Torsten Lilge <ttl-octave@mailbox.org>
parents: 31087
diff changeset
63 #if defined (HAVE_QSCINTILLA)
31808
90621682cc03 maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents: 31771
diff changeset
64 // Only valid if using the new terminal widget.
90621682cc03 maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents: 31771
diff changeset
65 command_widget * get_command_widget ();
31222
1a0756f7c90a disable experimental terminal widget when building without qscintilla
Torsten Lilge <ttl-octave@mailbox.org>
parents: 31087
diff changeset
66 #endif
29783
5154c91e0d98 eliminate some connections to parent objects in octave_dock_widget classes
John W. Eaton <jwe@octave.org>
parents: 29611
diff changeset
67
33599
7f18c537e101 maint: Update Qt macros to avoid name collisions
Arun Giridhar <arungiridhar@gmail.com>
parents: 32632
diff changeset
68 Q_SIGNALS:
29503
3bfec185c9e2 experimental command window widget with server loop
John W. Eaton <jwe@octave.org>
parents: 29359
diff changeset
69
31808
90621682cc03 maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents: 31771
diff changeset
70 void settings_changed ();
29611
d64ad3b93372 eliminate direct parent to child connection in terminal dock widget
John W. Eaton <jwe@octave.org>
parents: 29550
diff changeset
71
31808
90621682cc03 maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents: 31771
diff changeset
72 // Note: the following four signals are
90621682cc03 maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents: 31771
diff changeset
73 // currently only used by the new experimental terminal widget.
29611
d64ad3b93372 eliminate direct parent to child connection in terminal dock widget
John W. Eaton <jwe@octave.org>
parents: 29550
diff changeset
74
31808
90621682cc03 maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents: 31771
diff changeset
75 void update_prompt_signal (const QString&);
29503
3bfec185c9e2 experimental command window widget with server loop
John W. Eaton <jwe@octave.org>
parents: 29359
diff changeset
76
31808
90621682cc03 maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents: 31771
diff changeset
77 void interpreter_output_signal (const QString&);
29503
3bfec185c9e2 experimental command window widget with server loop
John W. Eaton <jwe@octave.org>
parents: 29359
diff changeset
78
31808
90621682cc03 maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents: 31771
diff changeset
79 void new_command_line_signal (const QString& = QString ());
29503
3bfec185c9e2 experimental command window widget with server loop
John W. Eaton <jwe@octave.org>
parents: 29359
diff changeset
80
31808
90621682cc03 maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents: 31771
diff changeset
81 void execute_command_signal (const QString&);
31087
9c0099048264 exp cmd widget: fix missing promt after error
Torsten Lilge <ttl-octave@mailbox.org>
parents: 31068
diff changeset
82
31808
90621682cc03 maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents: 31771
diff changeset
83 void interpreter_event (const fcn_callback& fcn);
90621682cc03 maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents: 31771
diff changeset
84 void interpreter_event (const meth_callback& meth);
31068
0b402f523f09 allow executing a command in the new terminal widget
Torsten Lilge <ttl-octave@mailbox.org>
parents: 31067
diff changeset
85
33599
7f18c537e101 maint: Update Qt macros to avoid name collisions
Arun Giridhar <arungiridhar@gmail.com>
parents: 32632
diff changeset
86 public Q_SLOTS:
29503
3bfec185c9e2 experimental command window widget with server loop
John W. Eaton <jwe@octave.org>
parents: 29359
diff changeset
87
31808
90621682cc03 maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents: 31771
diff changeset
88 void notice_settings ();
29611
d64ad3b93372 eliminate direct parent to child connection in terminal dock widget
John W. Eaton <jwe@octave.org>
parents: 29550
diff changeset
89
31808
90621682cc03 maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents: 31771
diff changeset
90 private:
17920
5c3f22dd0bbb raise SIGINT in octave_interpreter instead of in QTerminal
John W. Eaton <jwe@octave.org>
parents: 17744
diff changeset
91
31808
90621682cc03 maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents: 31771
diff changeset
92 bool m_experimental_terminal_widget;
29503
3bfec185c9e2 experimental command window widget with server loop
John W. Eaton <jwe@octave.org>
parents: 29359
diff changeset
93
31808
90621682cc03 maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents: 31771
diff changeset
94 // FIXME!!! Maybe my_term should just be derived from QTerminal?
90621682cc03 maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents: 31771
diff changeset
95 QWidget *m_terminal;
90621682cc03 maint: Remove unnecessary indent after OCTAVE_BEGIN_NAMESPACE in libgui/
Rik <rik@octave.org>
parents: 31771
diff changeset
96 };
31646
c6d54dd31a7e maint: Use macros to begin/end C++ namespaces.
John W. Eaton <jwe@octave.org>
parents: 31222
diff changeset
97
c6d54dd31a7e maint: Use macros to begin/end C++ namespaces.
John W. Eaton <jwe@octave.org>
parents: 31222
diff changeset
98 OCTAVE_END_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
99
20945
9d9270e2f98f eliminate comments after preprocessor conditionals
John W. Eaton <jwe@octave.org>
parents: 19697
diff changeset
100 #endif