Mercurial > octave
annotate libgui/src/terminal-dock-widget.h @ 31222:1a0756f7c90a
disable experimental terminal widget when building without qscintilla
* command-widget.cc: inlcude into #if defined (HAVE_QSCINTILLA)
* main-window.cc: include command-widget.h only if HAVE_QSCINTILLA
* module.mk: only build moc-command-widget.cc if HAVE_QSCINTILLA
* octave-qobject.cc: include command-widget.h only if HAVE_QSCINTILLA,
(base_qobject::terminal_widget): use conditional compilation where
referring to new terminal widget
* terminal-dock-widget.cc: include command-widget.h only if HAVE_QSCINTILLA,
(terminal_dock_widget, init_command_prompt): use conditional compilation
where referring to new terminal widget
* terminal-dock-widget.h: use conditional compilation where referring to
new terminal widget Thu Sep 01 02:34:37 2022 +0200
* octave.cc (cmdline_options): only return true on experimental terminal
widget option if built with scintilla
author | Torsten Lilge <ttl-octave@mailbox.org> |
---|---|
date | Sat, 03 Sep 2022 00:18:49 +0200 |
parents | 9c0099048264 |
children | ad014fc78bd6 c6d54dd31a7e |
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 // |
30564
796f54d4ddbf
update Octave Project Developers copyright for the new year
John W. Eaton <jwe@octave.org>
parents:
29783
diff
changeset
|
3 // Copyright (C) 2011-2022 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 |
24733
e15d53d2de1e
move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
35 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
|
36 { |
29783
5154c91e0d98
eliminate some connections to parent objects in octave_dock_widget classes
John W. Eaton <jwe@octave.org>
parents:
29611
diff
changeset
|
37 class command_widget; |
27629
8b6e928e0705
in GUI objects, store reference to base_qobject instead of resource_manager
John W. Eaton <jwe@octave.org>
parents:
27620
diff
changeset
|
38 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
|
39 |
24733
e15d53d2de1e
move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
40 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
|
41 { |
e15d53d2de1e
move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
42 Q_OBJECT |
16446
4b3a4bf8569b
improve encapsulation of command window object
John W. Eaton <jwe@octave.org>
parents:
16057
diff
changeset
|
43 |
24733
e15d53d2de1e
move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
44 public: |
e15d53d2de1e
move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
45 |
27629
8b6e928e0705
in GUI objects, store reference to base_qobject instead of resource_manager
John W. Eaton <jwe@octave.org>
parents:
27620
diff
changeset
|
46 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
|
47 |
29550
8dd0fca2a3d9
where possible, use default destructors in GUI classes
John W. Eaton <jwe@octave.org>
parents:
29503
diff
changeset
|
48 ~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
|
49 |
24733
e15d53d2de1e
move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
50 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
|
51 |
31067
5261a81765b0
merge input and output of exp. terminal widget into one widget
Torsten Lilge <ttl-octave@mailbox.org>
parents:
30564
diff
changeset
|
52 void init_command_prompt (); |
5261a81765b0
merge input and output of exp. terminal widget into one widget
Torsten Lilge <ttl-octave@mailbox.org>
parents:
30564
diff
changeset
|
53 |
29783
5154c91e0d98
eliminate some connections to parent objects in octave_dock_widget classes
John W. Eaton <jwe@octave.org>
parents:
29611
diff
changeset
|
54 // FIXME: The next two functions could be eliminated (or combined) |
5154c91e0d98
eliminate some connections to parent objects in octave_dock_widget classes
John W. Eaton <jwe@octave.org>
parents:
29611
diff
changeset
|
55 // if we had a common interface for the old and new terminal |
5154c91e0d98
eliminate some connections to parent objects in octave_dock_widget classes
John W. Eaton <jwe@octave.org>
parents:
29611
diff
changeset
|
56 // widgets. |
5154c91e0d98
eliminate some connections to parent objects in octave_dock_widget classes
John W. Eaton <jwe@octave.org>
parents:
29611
diff
changeset
|
57 |
5154c91e0d98
eliminate some connections to parent objects in octave_dock_widget classes
John W. Eaton <jwe@octave.org>
parents:
29611
diff
changeset
|
58 // Only valid if using the old terminal widget. |
5154c91e0d98
eliminate some connections to parent objects in octave_dock_widget classes
John W. Eaton <jwe@octave.org>
parents:
29611
diff
changeset
|
59 QTerminal * get_qterminal (void); |
5154c91e0d98
eliminate some connections to parent objects in octave_dock_widget classes
John W. Eaton <jwe@octave.org>
parents:
29611
diff
changeset
|
60 |
31222
1a0756f7c90a
disable experimental terminal widget when building without qscintilla
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31087
diff
changeset
|
61 #if defined (HAVE_QSCINTILLA) |
29783
5154c91e0d98
eliminate some connections to parent objects in octave_dock_widget classes
John W. Eaton <jwe@octave.org>
parents:
29611
diff
changeset
|
62 // Only valid if using the new terminal widget. |
5154c91e0d98
eliminate some connections to parent objects in octave_dock_widget classes
John W. Eaton <jwe@octave.org>
parents:
29611
diff
changeset
|
63 command_widget * get_command_widget (void); |
31222
1a0756f7c90a
disable experimental terminal widget when building without qscintilla
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31087
diff
changeset
|
64 #endif |
29783
5154c91e0d98
eliminate some connections to parent objects in octave_dock_widget classes
John W. Eaton <jwe@octave.org>
parents:
29611
diff
changeset
|
65 |
29503
3bfec185c9e2
experimental command window widget with server loop
John W. Eaton <jwe@octave.org>
parents:
29359
diff
changeset
|
66 signals: |
3bfec185c9e2
experimental command window widget with server loop
John W. Eaton <jwe@octave.org>
parents:
29359
diff
changeset
|
67 |
29611
d64ad3b93372
eliminate direct parent to child connection in terminal dock widget
John W. Eaton <jwe@octave.org>
parents:
29550
diff
changeset
|
68 void settings_changed (const gui_settings *settings); |
d64ad3b93372
eliminate direct parent to child connection in terminal dock widget
John W. Eaton <jwe@octave.org>
parents:
29550
diff
changeset
|
69 |
31087
9c0099048264
exp cmd widget: fix missing promt after error
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31068
diff
changeset
|
70 // Note: the following four signals are |
29503
3bfec185c9e2
experimental command window widget with server loop
John W. Eaton <jwe@octave.org>
parents:
29359
diff
changeset
|
71 // 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
|
72 |
3bfec185c9e2
experimental command window widget with server loop
John W. Eaton <jwe@octave.org>
parents:
29359
diff
changeset
|
73 void update_prompt_signal (const QString&); |
3bfec185c9e2
experimental command window widget with server loop
John W. Eaton <jwe@octave.org>
parents:
29359
diff
changeset
|
74 |
3bfec185c9e2
experimental command window widget with server loop
John W. Eaton <jwe@octave.org>
parents:
29359
diff
changeset
|
75 void interpreter_output_signal (const QString&); |
3bfec185c9e2
experimental command window widget with server loop
John W. Eaton <jwe@octave.org>
parents:
29359
diff
changeset
|
76 |
31087
9c0099048264
exp cmd widget: fix missing promt after error
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31068
diff
changeset
|
77 void new_command_line_signal (const QString& = QString ()); |
9c0099048264
exp cmd widget: fix missing promt after error
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31068
diff
changeset
|
78 |
31068
0b402f523f09
allow executing a command in the new terminal widget
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31067
diff
changeset
|
79 void execute_command_signal (const QString&); |
0b402f523f09
allow executing a command in the new terminal widget
Torsten Lilge <ttl-octave@mailbox.org>
parents:
31067
diff
changeset
|
80 |
29503
3bfec185c9e2
experimental command window widget with server loop
John W. Eaton <jwe@octave.org>
parents:
29359
diff
changeset
|
81 public slots: |
3bfec185c9e2
experimental command window widget with server loop
John W. Eaton <jwe@octave.org>
parents:
29359
diff
changeset
|
82 |
29611
d64ad3b93372
eliminate direct parent to child connection in terminal dock widget
John W. Eaton <jwe@octave.org>
parents:
29550
diff
changeset
|
83 void notice_settings (const gui_settings *settings); |
d64ad3b93372
eliminate direct parent to child connection in terminal dock widget
John W. Eaton <jwe@octave.org>
parents:
29550
diff
changeset
|
84 |
24733
e15d53d2de1e
move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
85 private: |
17920
5c3f22dd0bbb
raise SIGINT in octave_interpreter instead of in QTerminal
John W. Eaton <jwe@octave.org>
parents:
17744
diff
changeset
|
86 |
29503
3bfec185c9e2
experimental command window widget with server loop
John W. Eaton <jwe@octave.org>
parents:
29359
diff
changeset
|
87 bool m_experimental_terminal_widget; |
3bfec185c9e2
experimental command window widget with server loop
John W. Eaton <jwe@octave.org>
parents:
29359
diff
changeset
|
88 |
3bfec185c9e2
experimental command window widget with server loop
John W. Eaton <jwe@octave.org>
parents:
29359
diff
changeset
|
89 // 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
|
90 QWidget *m_terminal; |
24733
e15d53d2de1e
move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
91 }; |
e15d53d2de1e
move more GUI classse inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
92 } |
14692
d6d250812c01
Made the terminal window dockable, too. Now the whole interface is fully dockable.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff
changeset
|
93 |
20945
9d9270e2f98f
eliminate comments after preprocessor conditionals
John W. Eaton <jwe@octave.org>
parents:
19697
diff
changeset
|
94 #endif |