Mercurial > octave
annotate libgui/src/m-editor/file-editor-interface.h @ 31701:286306a9a393
eliminate base_qobject from octave_dock_widget and other classes
* octave-dock-widget.h, octave-dock-widget.cc
(octave_dock_widget::m_octave_qobj): Delete data member.
(octave_dock_widget::octave_dock_widget): Delete base_qobject
construtor argument. Change all uses.
* documentation-dock-widget.h, documentation-dock-widget.cc
(documentation_dock_widget::documentation_dock_widget):
Delete base_qobject construtor argument. Change all uses.
* files-dock-widget.h, files-dock-widget.cc
(files_dock_widget::files_dock_widget):
Delete base_qobject construtor argument. Change all uses.
* history-dock-widget.h, history-dock-widget.cc
(history_dock_widget::history_dock_widget):
Delete base_qobject construtor argument. Change all uses.
* file-editor-interface.h
(file_editor_interface::file_editor_interface):
Delete base_qobject construtor argument. Change all uses.
* file-editor-tab.h, file-editor-tab.cc
(file_editor_tab::file_editor_tab):
Delete base_qobject construtor argument. Change all uses.
* file-editor.h, file-editor.cc (file_editor::file_editor):
Delete base_qobject construtor argument. Change all uses.
* octave-qscintilla.h, octave-qscintilla.cc
(octave_qscintilla::octave_qscintilla):
Delete base_qobject construtor argument. Change all uses.
* terminal-dock-widget.h, terminal-dock-widget.cc
(terminal_dock_widget::terminal_dock_widget): Pass bool to control use
of experimental terminal widget instead of base_qobject. Change all uses.
* variable-editor.h, variable-editor.cc
(variable_editor::variable_editor):
Delete base_qobject construtor argument. Change all uses.
* workspace-view.h, workspace-view.cc
(workspace_view::workspace_view):
Delete base_qobject construtor argument. Change all uses.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Mon, 02 Jan 2023 12:38:44 -0500 |
parents | deb553ac2c54 |
children | 5f11de0e7440 |
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:
30398
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 //////////////////////////////////////////////////////////////////////// |
14676
35512b788af2
Editor can now handle multiple files in tabs.
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:
21158
diff
changeset
|
26 #if ! defined (octave_file_editor_interface_h) |
710e700cdd7f
maint: Clean up naming and indentation of #ifdef blocks in libgui
Rik <rik@octave.org>
parents:
21158
diff
changeset
|
27 #define octave_file_editor_interface_h 1 |
14676
35512b788af2
Editor can now handle multiple files in tabs.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff
changeset
|
28 |
14795
e3ae0850b105
Fixed integrating debug menu in the editor window.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14778
diff
changeset
|
29 #include <QMenu> |
29613
9367cba2a6d5
allow most dock widgets to be used from command line
John W. Eaton <jwe@octave.org>
parents:
29359
diff
changeset
|
30 #include <QMenuBar> |
15106
59175df7dcf6
Created and added debug action icons.
Jacob Dawid <jacob.dawid@gmail.com>
parents:
15045
diff
changeset
|
31 #include <QToolBar> |
27412
da1f59fe04b3
try to use consitent ordering for include files in libgui sources
John W. Eaton <jwe@octave.org>
parents:
27089
diff
changeset
|
32 |
16057
c3057d80cf91
Created common octave_dock_widget class
Richard Crozier <richard.crozier@yahoo.co.uk>
parents:
15993
diff
changeset
|
33 #include "octave-dock-widget.h" |
14676
35512b788af2
Editor can now handle multiple files in tabs.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff
changeset
|
34 |
31646
c6d54dd31a7e
maint: Use macros to begin/end C++ namespaces.
John W. Eaton <jwe@octave.org>
parents:
31181
diff
changeset
|
35 OCTAVE_BEGIN_NAMESPACE(octave) |
c6d54dd31a7e
maint: Use macros to begin/end C++ namespaces.
John W. Eaton <jwe@octave.org>
parents:
31181
diff
changeset
|
36 |
24716
2b3e0b570e77
move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
37 class file_editor_interface : public octave_dock_widget |
2b3e0b570e77
move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
38 { |
2b3e0b570e77
move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
39 Q_OBJECT |
24020
387be1a6c3dc
style fixes for GUI editor
John W. Eaton <jwe@octave.org>
parents:
23488
diff
changeset
|
40 |
24716
2b3e0b570e77
move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
41 public: |
14676
35512b788af2
Editor can now handle multiple files in tabs.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff
changeset
|
42 |
31701
286306a9a393
eliminate base_qobject from octave_dock_widget and other classes
John W. Eaton <jwe@octave.org>
parents:
31649
diff
changeset
|
43 file_editor_interface (QWidget *p) |
286306a9a393
eliminate base_qobject from octave_dock_widget and other classes
John W. Eaton <jwe@octave.org>
parents:
31649
diff
changeset
|
44 : octave_dock_widget ("FileEditor", p) |
27620
45bb5bbaf291
don't use singleton pattern for resource manager in GUI
John W. Eaton <jwe@octave.org>
parents:
27611
diff
changeset
|
45 { } |
14795
e3ae0850b105
Fixed integrating debug menu in the editor window.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14778
diff
changeset
|
46 |
24716
2b3e0b570e77
move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
47 virtual ~file_editor_interface (void) = default; |
14795
e3ae0850b105
Fixed integrating debug menu in the editor window.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
14778
diff
changeset
|
48 |
24716
2b3e0b570e77
move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
49 virtual QMenu * get_mru_menu (void) = 0; |
2b3e0b570e77
move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
50 virtual QMenu * debug_menu (void) = 0; |
2b3e0b570e77
move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
51 virtual QToolBar * toolbar (void) = 0; |
29085
3b29d72645a9
fix alt-key stealing focus from current dock widget in gui
Torsten Lilge <ttl-octave@mailbox.org>
parents:
27923
diff
changeset
|
52 virtual QMenuBar * menubar (void) = 0; |
16395
fc491da603f6
also provide a hook for exiting debugger
John W. Eaton <jwe@octave.org>
parents:
16386
diff
changeset
|
53 |
30398
d4d83344d653
maint: style check C++ files in src/ and libgui/ ahead of 7.1 release.
Rik <rik@octave.org>
parents:
29783
diff
changeset
|
54 virtual void insert_global_actions (QList<QAction *>) = 0; |
24716
2b3e0b570e77
move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
55 virtual void handle_enter_debug_mode (void) = 0; |
2b3e0b570e77
move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
56 virtual void handle_exit_debug_mode (void) = 0; |
2b3e0b570e77
move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
57 |
2b3e0b570e77
move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
58 virtual void |
2b3e0b570e77
move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
59 handle_insert_debugger_pointer_request (const QString& file, int line) = 0; |
16395
fc491da603f6
also provide a hook for exiting debugger
John W. Eaton <jwe@octave.org>
parents:
16386
diff
changeset
|
60 |
24716
2b3e0b570e77
move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
61 virtual void |
2b3e0b570e77
move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
62 handle_delete_debugger_pointer_request (const QString& file, int line) = 0; |
16386
4902484f9181
callbacks to set markers in editor using command line dbstop function
John W. Eaton <jwe@octave.org>
parents:
16383
diff
changeset
|
63 |
24716
2b3e0b570e77
move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
64 virtual void |
2b3e0b570e77
move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
65 handle_update_breakpoint_marker_request (bool insert, const QString& file, |
2b3e0b570e77
move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
66 int line, const QString& cond) = 0; |
16399
f9a737fd8829
allow command-line edit function to use GUI editor
John W. Eaton <jwe@octave.org>
parents:
16395
diff
changeset
|
67 |
24716
2b3e0b570e77
move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
68 virtual void handle_edit_file_request (const QString& file) = 0; |
16399
f9a737fd8829
allow command-line edit function to use GUI editor
John W. Eaton <jwe@octave.org>
parents:
16395
diff
changeset
|
69 |
24716
2b3e0b570e77
move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
70 virtual bool check_closing (void) = 0; |
19411
ed0df431631b
allow to cancel exiting if editor tabs are modified and exit is requested in gui
Torsten <ttl@justmail.de>
parents:
18944
diff
changeset
|
71 |
24716
2b3e0b570e77
move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
72 virtual void empty_script (bool, bool) = 0; |
18399
2ea741d22554
create empty script when editor becomes visible without open files (bug #41347)
Torsten <ttl@justmail.de>
parents:
17901
diff
changeset
|
73 |
31619
ad014fc78bd6
use individual local gui_settings objects
John W. Eaton <jwe@octave.org>
parents:
31181
diff
changeset
|
74 virtual void restore_session (void) = 0; |
23488
52a74f14345c
restore last editor session not before octave is ready
Torsten <mttl@mailbox.org>
parents:
23446
diff
changeset
|
75 |
24716
2b3e0b570e77
move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
76 virtual void enable_menu_shortcuts (bool enable) = 0; |
18944
b2c4d6d461f0
fix conflict between main and editor menus when using alt keys (bug #42659)
Torsten <ttl@justmail.de>
parents:
18665
diff
changeset
|
77 |
29783
5154c91e0d98
eliminate some connections to parent objects in octave_dock_widget classes
John W. Eaton <jwe@octave.org>
parents:
29613
diff
changeset
|
78 signals: |
5154c91e0d98
eliminate some connections to parent objects in octave_dock_widget classes
John W. Eaton <jwe@octave.org>
parents:
29613
diff
changeset
|
79 |
5154c91e0d98
eliminate some connections to parent objects in octave_dock_widget classes
John W. Eaton <jwe@octave.org>
parents:
29613
diff
changeset
|
80 void interpreter_event (const fcn_callback& fcn); |
5154c91e0d98
eliminate some connections to parent objects in octave_dock_widget classes
John W. Eaton <jwe@octave.org>
parents:
29613
diff
changeset
|
81 void interpreter_event (const meth_callback& meth); |
5154c91e0d98
eliminate some connections to parent objects in octave_dock_widget classes
John W. Eaton <jwe@octave.org>
parents:
29613
diff
changeset
|
82 |
24716
2b3e0b570e77
move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
83 public slots: |
24020
387be1a6c3dc
style fixes for GUI editor
John W. Eaton <jwe@octave.org>
parents:
23488
diff
changeset
|
84 |
27089
9326c2258e60
fix visibility of find dialog when editor is docked/undocked (bug #5)
Torsten Lilge <ttl-octave@mailbox.org>
parents:
26376
diff
changeset
|
85 virtual void toplevel_change (bool) = 0; |
9326c2258e60
fix visibility of find dialog when editor is docked/undocked (bug #5)
Torsten Lilge <ttl-octave@mailbox.org>
parents:
26376
diff
changeset
|
86 |
25742
d3c6de326bae
close/reload editor tab when file is (re)moved in gui terminal (bug #43922)
Torsten <mttl@mailbox.org>
parents:
25355
diff
changeset
|
87 virtual void handle_file_remove (const QString& o, const QString& n) = 0; |
d3c6de326bae
close/reload editor tab when file is (re)moved in gui terminal (bug #43922)
Torsten <mttl@mailbox.org>
parents:
25355
diff
changeset
|
88 |
24716
2b3e0b570e77
move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
89 virtual void request_new_file (const QString& command = QString ()) = 0; |
24020
387be1a6c3dc
style fixes for GUI editor
John W. Eaton <jwe@octave.org>
parents:
23488
diff
changeset
|
90 |
24716
2b3e0b570e77
move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
91 virtual void request_open_file (const QString& openFileName, |
2b3e0b570e77
move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
92 const QString& encoding = QString (), |
2b3e0b570e77
move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
93 int line = -1, |
2b3e0b570e77
move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
94 bool debug_pointer = false, |
2b3e0b570e77
move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
95 bool breakpoint_marker = false, |
2b3e0b570e77
move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
96 bool insert = true, |
25743
c2a703df0215
preserve tab position and line when reloading renamed editor file (bug #49322)
Torsten <mttl@mailbox.org>
parents:
25742
diff
changeset
|
97 const QString& cond = "", |
31181
c6c4c6f04170
also restore bookmarks when restoring an editor session at startup
Torsten Lilge <ttl-octave@mailbox.org>
parents:
30564
diff
changeset
|
98 int index = -1, |
c6c4c6f04170
also restore bookmarks when restoring an editor session at startup
Torsten Lilge <ttl-octave@mailbox.org>
parents:
30564
diff
changeset
|
99 const QString& bookmarks = QString ()) = 0; |
24716
2b3e0b570e77
move GUI file editor classes inside octave namespace
John W. Eaton <jwe@octave.org>
parents:
24534
diff
changeset
|
100 }; |
31646
c6d54dd31a7e
maint: Use macros to begin/end C++ namespaces.
John W. Eaton <jwe@octave.org>
parents:
31181
diff
changeset
|
101 |
c6d54dd31a7e
maint: Use macros to begin/end C++ namespaces.
John W. Eaton <jwe@octave.org>
parents:
31181
diff
changeset
|
102 OCTAVE_END_NAMESPACE(octave) |
14676
35512b788af2
Editor can now handle multiple files in tabs.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff
changeset
|
103 |
20945
9d9270e2f98f
eliminate comments after preprocessor conditionals
John W. Eaton <jwe@octave.org>
parents:
20796
diff
changeset
|
104 #endif |