annotate libgui/src/m-editor/file-editor-tab.h @ 17822:ebb3ef964372

maint: Use common #define syntax "octave_filename_h" in h_files. * libgui/src/dialog.h, libgui/src/find-files-dialog.h, libgui/src/find-files-model.h, libgui/src/m-editor/file-editor-tab.h, libgui/src/m-editor/octave-qscintilla.h, libgui/src/main-window.h, libgui/src/octave-dock-widget.h, libgui/src/workspace-model.h, libgui/src/workspace-view.h, libinterp/corefcn/Cell.h, libinterp/corefcn/gl-render.h, libinterp/corefcn/gl2ps-renderer.h, libinterp/corefcn/graphics.in.h, libinterp/corefcn/oct-errno.h, libinterp/corefcn/oct-fstrm.h, libinterp/corefcn/oct-handle.h, libinterp/corefcn/oct-hdf5.h, libinterp/corefcn/oct-hist.h, libinterp/corefcn/oct-iostrm.h, libinterp/corefcn/oct-lvalue.h, libinterp/corefcn/oct-prcstrm.h, libinterp/corefcn/oct-procbuf.h, libinterp/corefcn/oct-stdstrm.h, libinterp/corefcn/oct-stream.h, libinterp/corefcn/oct-strstrm.h, libinterp/corefcn/octave-link.h, libinterp/corefcn/pt-jit.h, libinterp/octave-value/ov-base-diag.h, libinterp/octave-value/ov-base-int.h, libinterp/octave-value/ov-base-mat.h, libinterp/octave-value/ov-base-scalar.h, libinterp/octave-value/ov-base-sparse.h, libinterp/octave-value/ov-base.h, libinterp/octave-value/ov-bool-mat.h, libinterp/octave-value/ov-bool-sparse.h, libinterp/octave-value/ov-bool.h, libinterp/octave-value/ov-builtin.h, libinterp/octave-value/ov-cell.h, libinterp/octave-value/ov-ch-mat.h, libinterp/octave-value/ov-class.h, libinterp/octave-value/ov-colon.h, libinterp/octave-value/ov-complex.h, libinterp/octave-value/ov-cs-list.h, libinterp/octave-value/ov-cx-diag.h, libinterp/octave-value/ov-cx-mat.h, libinterp/octave-value/ov-cx-sparse.h, libinterp/octave-value/ov-dld-fcn.h, libinterp/octave-value/ov-fcn-handle.h, libinterp/octave-value/ov-fcn-inline.h, libinterp/octave-value/ov-fcn.h, libinterp/octave-value/ov-float.h, libinterp/octave-value/ov-flt-complex.h, libinterp/octave-value/ov-flt-cx-diag.h, libinterp/octave-value/ov-flt-cx-mat.h, libinterp/octave-value/ov-flt-re-diag.h, libinterp/octave-value/ov-flt-re-mat.h, libinterp/octave-value/ov-int-traits.h, libinterp/octave-value/ov-int16.h, libinterp/octave-value/ov-int32.h, libinterp/octave-value/ov-int64.h, libinterp/octave-value/ov-int8.h, libinterp/octave-value/ov-java.h, libinterp/octave-value/ov-lazy-idx.h, libinterp/octave-value/ov-mex-fcn.h, libinterp/octave-value/ov-null-mat.h, libinterp/octave-value/ov-perm.h, libinterp/octave-value/ov-range.h, libinterp/octave-value/ov-re-diag.h, libinterp/octave-value/ov-re-mat.h, libinterp/octave-value/ov-re-sparse.h, libinterp/octave-value/ov-scalar.h, libinterp/octave-value/ov-str-mat.h, libinterp/octave-value/ov-struct.h, libinterp/octave-value/ov-typeinfo.h, libinterp/octave-value/ov-uint16.h, libinterp/octave-value/ov-uint32.h, libinterp/octave-value/ov-uint64.h, libinterp/octave-value/ov-uint8.h, libinterp/octave-value/ov-usr-fcn.h, libinterp/octave-value/ov.h, libinterp/parse-tree/pt-all.h, libinterp/parse-tree/pt-arg-list.h, libinterp/parse-tree/pt-array-list.h, libinterp/parse-tree/pt-assign.h, libinterp/parse-tree/pt-binop.h, libinterp/parse-tree/pt-bp.h, libinterp/parse-tree/pt-cbinop.h, libinterp/parse-tree/pt-cell.h, libinterp/parse-tree/pt-check.h, libinterp/parse-tree/pt-cmd.h, libinterp/parse-tree/pt-colon.h, libinterp/parse-tree/pt-const.h, libinterp/parse-tree/pt-decl.h, libinterp/parse-tree/pt-eval.h, libinterp/parse-tree/pt-except.h, libinterp/parse-tree/pt-exp.h, libinterp/parse-tree/pt-fcn-handle.h, libinterp/parse-tree/pt-id.h, libinterp/parse-tree/pt-idx.h, libinterp/parse-tree/pt-jump.h, libinterp/parse-tree/pt-loop.h, libinterp/parse-tree/pt-mat.h, libinterp/parse-tree/pt-misc.h, libinterp/parse-tree/pt-pr-code.h, libinterp/parse-tree/pt-select.h, libinterp/parse-tree/pt-stmt.h, libinterp/parse-tree/pt-unop.h, libinterp/parse-tree/pt-walk.h, libinterp/parse-tree/pt.h, liboctave/array/CColVector.h, liboctave/array/CDiagMatrix.h, liboctave/array/CMatrix.h, liboctave/array/CNDArray.h, liboctave/array/CRowVector.h, liboctave/array/boolMatrix.h, liboctave/array/chMatrix.h, liboctave/array/chNDArray.h, liboctave/array/dColVector.h, liboctave/array/dDiagMatrix.h, liboctave/array/dMatrix.h, liboctave/array/dNDArray.h, liboctave/array/dRowVector.h, liboctave/array/fCColVector.h, liboctave/array/fCDiagMatrix.h, liboctave/array/fCMatrix.h, liboctave/array/fCNDArray.h, liboctave/array/fCRowVector.h, liboctave/array/fColVector.h, liboctave/array/fDiagMatrix.h, liboctave/array/fMatrix.h, liboctave/array/fNDArray.h, liboctave/array/fRowVector.h, liboctave/cruft/misc/lo-error.h, liboctave/numeric/CmplxAEPBAL.h, liboctave/numeric/CmplxCHOL.h, liboctave/numeric/CmplxGEPBAL.h, liboctave/numeric/CmplxHESS.h, liboctave/numeric/CmplxLU.h, liboctave/numeric/CmplxQR.h, liboctave/numeric/CmplxQRP.h, liboctave/numeric/CmplxSCHUR.h, liboctave/numeric/CmplxSVD.h, liboctave/numeric/Quad.h, liboctave/numeric/SparseCmplxCHOL.h, liboctave/numeric/SparseCmplxLU.h, liboctave/numeric/SparseCmplxQR.h, liboctave/numeric/SparseQR.h, liboctave/numeric/SparsedbleCHOL.h, liboctave/numeric/SparsedbleLU.h, liboctave/numeric/bsxfun.h, liboctave/numeric/dbleAEPBAL.h, liboctave/numeric/dbleCHOL.h, liboctave/numeric/dbleGEPBAL.h, liboctave/numeric/dbleHESS.h, liboctave/numeric/dbleLU.h, liboctave/numeric/dbleQR.h, liboctave/numeric/dbleQRP.h, liboctave/numeric/dbleSCHUR.h, liboctave/numeric/dbleSVD.h, liboctave/numeric/fCmplxAEPBAL.h, liboctave/numeric/fCmplxCHOL.h, liboctave/numeric/fCmplxGEPBAL.h, liboctave/numeric/fCmplxHESS.h, liboctave/numeric/fCmplxLU.h, liboctave/numeric/fCmplxQR.h, liboctave/numeric/fCmplxQRP.h, liboctave/numeric/fCmplxSCHUR.h, liboctave/numeric/fCmplxSVD.h, liboctave/numeric/fEIG.h, liboctave/numeric/floatAEPBAL.h, liboctave/numeric/floatCHOL.h, liboctave/numeric/floatGEPBAL.h, liboctave/numeric/floatHESS.h, liboctave/numeric/floatLU.h, liboctave/numeric/floatQR.h, liboctave/numeric/floatQRP.h, liboctave/numeric/floatSCHUR.h, liboctave/numeric/floatSVD.h, liboctave/numeric/lo-mappers.h, liboctave/numeric/lo-specfun.h, liboctave/numeric/oct-convn.h, liboctave/numeric/oct-norm.h, liboctave/numeric/oct-rand.h, liboctave/operators/Sparse-diag-op-defs.h, liboctave/operators/Sparse-op-defs.h, liboctave/operators/Sparse-perm-op-defs.h, liboctave/system/lo-sysdep.h, liboctave/system/oct-env.h, liboctave/system/oct-group.h, liboctave/system/oct-openmp.h, liboctave/system/oct-passwd.h, liboctave/system/oct-syscalls.h, liboctave/system/oct-time.h, liboctave/system/oct-uname.h, liboctave/util/lo-array-gripes.h, liboctave/util/lo-cutils.h, liboctave/util/lo-ieee.h, liboctave/util/lo-macros.h, liboctave/util/lo-math.h, liboctave/util/lo-regexp.h, liboctave/util/lo-traits.h, liboctave/util/lo-utils.h, liboctave/util/oct-base64.h, liboctave/util/oct-binmap.h, liboctave/util/oct-glob.h, liboctave/util/oct-inttypes.h, liboctave/util/oct-locbuf.h, liboctave/util/oct-mem.h, liboctave/util/oct-mutex.h, liboctave/util/oct-refcount.h, liboctave/util/oct-rl-edit.h, liboctave/util/oct-rl-hist.h, liboctave/util/oct-shlib.h, liboctave/util/oct-sort.h, liboctave/util/oct-sparse.h: Use common #define syntax "octave_filename_h" in h_files.
author Rik <rik@octave.org>
date Thu, 31 Oct 2013 22:19:07 -0700
parents 86c6ae5f969e
children 4a53bcc1a4ae
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
15204
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
1 /*
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
2
17744
d63878346099 maint: Update copyright notices for release.
John W. Eaton <jwe@octave.org>
parents: 17635
diff changeset
3 Copyright (C) 2011-2013 Jacob Dawid
15204
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
4
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
5 This file is part of Octave.
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
6
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
7 Octave is free software; you can redistribute it and/or modify it
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
8 under the terms of the GNU General Public License as published by the
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
9 Free Software Foundation; either version 3 of the License, or (at your
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
10 option) any later version.
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
11
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
12 Octave is distributed in the hope that it will be useful, but WITHOUT
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
15 for more details.
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
16
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
17 You should have received a copy of the GNU General Public License
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
18 along with Octave; see the file COPYING. If not, see
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
19 <http://www.gnu.org/licenses/>.
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
20
359098ad343e update copyright notices in libgui directory
John W. Eaton <jwe@octave.org>
parents: 15196
diff changeset
21 */
14676
35512b788af2 Editor can now handle multiple files in tabs.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
22
17822
ebb3ef964372 maint: Use common #define syntax "octave_filename_h" in h_files.
Rik <rik@octave.org>
parents: 17790
diff changeset
23 #if !defined (octave_file_editor_tab_h)
ebb3ef964372 maint: Use common #define syntax "octave_filename_h" in h_files.
Rik <rik@octave.org>
parents: 17790
diff changeset
24 #define octave_file_editor_tab_h 1
14676
35512b788af2 Editor can now handle multiple files in tabs.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
25
35512b788af2 Editor can now handle multiple files in tabs.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
26 #include <QWidget>
35512b788af2 Editor can now handle multiple files in tabs.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
27 #include <QCloseEvent>
14690
ca733a66be7a Fixed bug with not opening the editor when clicking a file from the file browser. Implemented watching the file on disk.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14680
diff changeset
28 #include <QFileSystemWatcher>
16413
28136851099a remove _terminal pointer from main_window, it is contained by other Qt object
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 16395
diff changeset
29 #include <QSettings>
16635
25e418d23a4b fix running files from file browser's context menu
Torsten <ttl@justmail.de>
parents: 16570
diff changeset
30 #include <QFileInfo>
16704
e38a0fa08368 fix restoring editor files from previous session and speedup lexer preparation
Torsten <ttl@justmail.de>
parents: 16638
diff changeset
31 #include <Qsci/qsciapis.h>
16558
5fc1ce2947bd style fixes
John W. Eaton <jwe@octave.org>
parents: 16547
diff changeset
32
15848
424edeca3c66 Redo portions of file editor to use more signals/slots rather than casting.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 15425
diff changeset
33 #include "find-dialog.h"
16731
01d523d5f796 add help for word at mouse or text cursor to the editors context menu
Torsten <ttl@justmail.de>
parents: 16719
diff changeset
34 #include "octave-qscintilla.h"
15848
424edeca3c66 Redo portions of file editor to use more signals/slots rather than casting.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 15425
diff changeset
35
14709
f50591409306 Started to rename class names and methods from camel case to underscore-
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14707
diff changeset
36 class file_editor;
16558
5fc1ce2947bd style fixes
John W. Eaton <jwe@octave.org>
parents: 16547
diff changeset
37
15402
7f423c6111c6 refactor GUI event handling to use new event_queue class
John W. Eaton <jwe@octave.org>
parents: 15388
diff changeset
38 class file_editor_tab : public QWidget
14676
35512b788af2 Editor can now handle multiple files in tabs.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
39 {
35512b788af2 Editor can now handle multiple files in tabs.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
40 Q_OBJECT
16558
5fc1ce2947bd style fixes
John W. Eaton <jwe@octave.org>
parents: 16547
diff changeset
41
5fc1ce2947bd style fixes
John W. Eaton <jwe@octave.org>
parents: 16547
diff changeset
42 public:
5fc1ce2947bd style fixes
John W. Eaton <jwe@octave.org>
parents: 16547
diff changeset
43
5fc1ce2947bd style fixes
John W. Eaton <jwe@octave.org>
parents: 16547
diff changeset
44 file_editor_tab (const QString& directory = "");
5fc1ce2947bd style fixes
John W. Eaton <jwe@octave.org>
parents: 16547
diff changeset
45
5fc1ce2947bd style fixes
John W. Eaton <jwe@octave.org>
parents: 16547
diff changeset
46 ~file_editor_tab (void);
14676
35512b788af2 Editor can now handle multiple files in tabs.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
47
35512b788af2 Editor can now handle multiple files in tabs.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
48 public slots:
15848
424edeca3c66 Redo portions of file editor to use more signals/slots rather than casting.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 15425
diff changeset
49
16558
5fc1ce2947bd style fixes
John W. Eaton <jwe@octave.org>
parents: 16547
diff changeset
50 void update_window_title (bool modified);
5fc1ce2947bd style fixes
John W. Eaton <jwe@octave.org>
parents: 16547
diff changeset
51 void handle_copy_available (bool enableCopy);
5fc1ce2947bd style fixes
John W. Eaton <jwe@octave.org>
parents: 16547
diff changeset
52 void handle_margin_clicked (int line, int margin,
5fc1ce2947bd style fixes
John W. Eaton <jwe@octave.org>
parents: 16547
diff changeset
53 Qt::KeyboardModifiers state);
5fc1ce2947bd style fixes
John W. Eaton <jwe@octave.org>
parents: 16547
diff changeset
54
5fc1ce2947bd style fixes
John W. Eaton <jwe@octave.org>
parents: 16547
diff changeset
55 // Tells the editor tab to react on changed settings.
16413
28136851099a remove _terminal pointer from main_window, it is contained by other Qt object
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 16395
diff changeset
56 void notice_settings (const QSettings *settings);
16558
5fc1ce2947bd style fixes
John W. Eaton <jwe@octave.org>
parents: 16547
diff changeset
57
5fc1ce2947bd style fixes
John W. Eaton <jwe@octave.org>
parents: 16547
diff changeset
58 // Will initiate close if associated with the identifier tag.
16638
3c2e457eeb72 ask for saving modified editor files if octave is closed (bug #38689)
Torsten <ttl@justmail.de>
parents: 16635
diff changeset
59 void conditional_close (const QWidget *ID, bool app_closing = false);
16558
5fc1ce2947bd style fixes
John W. Eaton <jwe@octave.org>
parents: 16547
diff changeset
60
5fc1ce2947bd style fixes
John W. Eaton <jwe@octave.org>
parents: 16547
diff changeset
61 // Change to a different editor tab by identifier tag.
5fc1ce2947bd style fixes
John W. Eaton <jwe@octave.org>
parents: 16547
diff changeset
62 void change_editor_state (const QWidget *ID);
5fc1ce2947bd style fixes
John W. Eaton <jwe@octave.org>
parents: 16547
diff changeset
63
5fc1ce2947bd style fixes
John W. Eaton <jwe@octave.org>
parents: 16547
diff changeset
64 // Simply transmit file name.
5fc1ce2947bd style fixes
John W. Eaton <jwe@octave.org>
parents: 16547
diff changeset
65 void file_name_query (const QWidget *ID);
15848
424edeca3c66 Redo portions of file editor to use more signals/slots rather than casting.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 15425
diff changeset
66
16558
5fc1ce2947bd style fixes
John W. Eaton <jwe@octave.org>
parents: 16547
diff changeset
67 void set_focus (const QWidget *ID);
5fc1ce2947bd style fixes
John W. Eaton <jwe@octave.org>
parents: 16547
diff changeset
68 void undo (const QWidget *ID);
5fc1ce2947bd style fixes
John W. Eaton <jwe@octave.org>
parents: 16547
diff changeset
69 void redo (const QWidget *ID);
5fc1ce2947bd style fixes
John W. Eaton <jwe@octave.org>
parents: 16547
diff changeset
70 void copy (const QWidget *ID);
5fc1ce2947bd style fixes
John W. Eaton <jwe@octave.org>
parents: 16547
diff changeset
71 void cut (const QWidget *ID);
5fc1ce2947bd style fixes
John W. Eaton <jwe@octave.org>
parents: 16547
diff changeset
72 void paste (const QWidget *ID);
17627
811019b9ef57 Add help and documentation on actual keyword to the editor menu
Torsten <ttl@justmail.de>
parents: 16731
diff changeset
73 void context_help (const QWidget *ID, bool);
17628
99ffa521ecec Add possibility to edit the function related to the actual keyword in editor
Torsten <ttl@justmail.de>
parents: 17627
diff changeset
74 void context_edit (const QWidget *ID);
16558
5fc1ce2947bd style fixes
John W. Eaton <jwe@octave.org>
parents: 16547
diff changeset
75 void save_file (const QWidget *ID);
5fc1ce2947bd style fixes
John W. Eaton <jwe@octave.org>
parents: 16547
diff changeset
76 void save_file (const QWidget *ID, const QString& fileName,
5fc1ce2947bd style fixes
John W. Eaton <jwe@octave.org>
parents: 16547
diff changeset
77 bool remove_on_success);
5fc1ce2947bd style fixes
John W. Eaton <jwe@octave.org>
parents: 16547
diff changeset
78 void save_file_as (const QWidget *ID);
5fc1ce2947bd style fixes
John W. Eaton <jwe@octave.org>
parents: 16547
diff changeset
79 void print_file (const QWidget *ID);
5fc1ce2947bd style fixes
John W. Eaton <jwe@octave.org>
parents: 16547
diff changeset
80 void run_file (const QWidget *ID);
17635
7945344506ae Add possibility to run selected text of the editor in the terminal
Torsten <ttl@justmail.de>
parents: 17628
diff changeset
81 void context_run (const QWidget *ID);
16558
5fc1ce2947bd style fixes
John W. Eaton <jwe@octave.org>
parents: 16547
diff changeset
82 void toggle_bookmark (const QWidget *ID);
5fc1ce2947bd style fixes
John W. Eaton <jwe@octave.org>
parents: 16547
diff changeset
83 void next_bookmark (const QWidget *ID);
5fc1ce2947bd style fixes
John W. Eaton <jwe@octave.org>
parents: 16547
diff changeset
84 void previous_bookmark (const QWidget *ID);
5fc1ce2947bd style fixes
John W. Eaton <jwe@octave.org>
parents: 16547
diff changeset
85 void remove_bookmark (const QWidget *ID);
15848
424edeca3c66 Redo portions of file editor to use more signals/slots rather than casting.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 15425
diff changeset
86
16558
5fc1ce2947bd style fixes
John W. Eaton <jwe@octave.org>
parents: 16547
diff changeset
87 void toggle_breakpoint (const QWidget *ID);
5fc1ce2947bd style fixes
John W. Eaton <jwe@octave.org>
parents: 16547
diff changeset
88 void next_breakpoint (const QWidget *ID);
5fc1ce2947bd style fixes
John W. Eaton <jwe@octave.org>
parents: 16547
diff changeset
89 void previous_breakpoint (const QWidget *ID);
5fc1ce2947bd style fixes
John W. Eaton <jwe@octave.org>
parents: 16547
diff changeset
90 void remove_all_breakpoints (const QWidget *ID);
15848
424edeca3c66 Redo portions of file editor to use more signals/slots rather than casting.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 15425
diff changeset
91
16558
5fc1ce2947bd style fixes
John W. Eaton <jwe@octave.org>
parents: 16547
diff changeset
92 void comment_selected_text (const QWidget *ID);
5fc1ce2947bd style fixes
John W. Eaton <jwe@octave.org>
parents: 16547
diff changeset
93 void uncomment_selected_text (const QWidget *ID);
5fc1ce2947bd style fixes
John W. Eaton <jwe@octave.org>
parents: 16547
diff changeset
94 void find (const QWidget *ID);
5fc1ce2947bd style fixes
John W. Eaton <jwe@octave.org>
parents: 16547
diff changeset
95 void goto_line (const QWidget *ID, int line = -1);
15848
424edeca3c66 Redo portions of file editor to use more signals/slots rather than casting.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 15425
diff changeset
96
16395
fc491da603f6 also provide a hook for exiting debugger
John W. Eaton <jwe@octave.org>
parents: 16389
diff changeset
97 void insert_debugger_pointer (const QWidget *ID, int line = -1);
fc491da603f6 also provide a hook for exiting debugger
John W. Eaton <jwe@octave.org>
parents: 16389
diff changeset
98 void delete_debugger_pointer (const QWidget *ID, int line = -1);
fc491da603f6 also provide a hook for exiting debugger
John W. Eaton <jwe@octave.org>
parents: 16389
diff changeset
99
16443
7a2ee6ea7800 rename dbstop -> breakpoint in GUI interface functions
John W. Eaton <jwe@octave.org>
parents: 16440
diff changeset
100 void do_breakpoint_marker (bool insert, const QWidget *ID, int line = -1);
14676
35512b788af2 Editor can now handle multiple files in tabs.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
101
14709
f50591409306 Started to rename class names and methods from camel case to underscore-
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14707
diff changeset
102 void set_modified (bool modified = true);
14676
35512b788af2 Editor can now handle multiple files in tabs.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
103
15848
424edeca3c66 Redo portions of file editor to use more signals/slots rather than casting.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 15425
diff changeset
104 QString load_file (const QString& fileName);
16452
744ff2fe11ce add create script context menu to history window
John Donoghue <john.donoghue@ieee.org>
parents: 16443
diff changeset
105 void new_file (const QString& commands = QString ());
14676
35512b788af2 Editor can now handle multiple files in tabs.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
106
15300
fd27e10b9b05 pass QString by const reference instead of value
John W. Eaton <jwe@octave.org>
parents: 15204
diff changeset
107 void file_has_changed (const QString& fileName);
14690
ca733a66be7a Fixed bug with not opening the editor when clicking a file from the file browser. Implemented watching the file on disk.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14680
diff changeset
108
16731
01d523d5f796 add help for word at mouse or text cursor to the editors context menu
Torsten <ttl@justmail.de>
parents: 16719
diff changeset
109 void execute_command_in_terminal (const QString& command);
01d523d5f796 add help for word at mouse or text cursor to the editors context menu
Torsten <ttl@justmail.de>
parents: 16719
diff changeset
110
14676
35512b788af2 Editor can now handle multiple files in tabs.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
111 signals:
16558
5fc1ce2947bd style fixes
John W. Eaton <jwe@octave.org>
parents: 16547
diff changeset
112
15984
1eb3c67139f6 Add full-length-name tool tip to editor file tab when name is not full length.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 15980
diff changeset
113 void file_name_changed (const QString& fileName, const QString& toolTip);
15848
424edeca3c66 Redo portions of file editor to use more signals/slots rather than casting.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 15425
diff changeset
114 void editor_state_changed (bool copy_available, const QString& fileName);
424edeca3c66 Redo portions of file editor to use more signals/slots rather than casting.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 15425
diff changeset
115 void tab_remove_request ();
16377
8430ea8c1594 open editor tab and insert marker for debugging with gui
John W. Eaton <jwe@octave.org>
parents: 16375
diff changeset
116 void add_filename_to_list (const QString&, QWidget *);
15860
feba9ff6e6a8 editor: add list of recently used files to the file menu
Torsten <ttl@justmail.de>
parents: 15848
diff changeset
117 void mru_add_file (const QString& file_name);
16558
5fc1ce2947bd style fixes
John W. Eaton <jwe@octave.org>
parents: 16547
diff changeset
118 void editor_check_conflict_save (const QString& saveFileName,
5fc1ce2947bd style fixes
John W. Eaton <jwe@octave.org>
parents: 16547
diff changeset
119 bool remove_on_success);
16635
25e418d23a4b fix running files from file browser's context menu
Torsten <ttl@justmail.de>
parents: 16570
diff changeset
120 void run_file_signal (const QFileInfo& info);
16731
01d523d5f796 add help for word at mouse or text cursor to the editors context menu
Torsten <ttl@justmail.de>
parents: 16719
diff changeset
121 void execute_command_in_terminal_signal (const QString&);
14676
35512b788af2 Editor can now handle multiple files in tabs.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
122
35512b788af2 Editor can now handle multiple files in tabs.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
123 protected:
16558
5fc1ce2947bd style fixes
John W. Eaton <jwe@octave.org>
parents: 16547
diff changeset
124
14680
628eeaf879f7 Copy/Paste buttons get greyed out in the editor correctly again. Removed margin in editor tabs and status bar.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14676
diff changeset
125 void closeEvent (QCloseEvent *event);
15300
fd27e10b9b05 pass QString by const reference instead of value
John W. Eaton <jwe@octave.org>
parents: 15204
diff changeset
126 void set_file_name (const QString& fileName);
14676
35512b788af2 Editor can now handle multiple files in tabs.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
127
15848
424edeca3c66 Redo portions of file editor to use more signals/slots rather than casting.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 15425
diff changeset
128 private slots:
16558
5fc1ce2947bd style fixes
John W. Eaton <jwe@octave.org>
parents: 16547
diff changeset
129
5fc1ce2947bd style fixes
John W. Eaton <jwe@octave.org>
parents: 16547
diff changeset
130 // When user closes message box for reload question.
15848
424edeca3c66 Redo portions of file editor to use more signals/slots rather than casting.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 15425
diff changeset
131 void handle_file_reload_answer (int decision);
16558
5fc1ce2947bd style fixes
John W. Eaton <jwe@octave.org>
parents: 16547
diff changeset
132
5fc1ce2947bd style fixes
John W. Eaton <jwe@octave.org>
parents: 16547
diff changeset
133 // When user closes message box for resave question.
15848
424edeca3c66 Redo portions of file editor to use more signals/slots rather than casting.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 15425
diff changeset
134 void handle_file_resave_answer (int decision);
16558
5fc1ce2947bd style fixes
John W. Eaton <jwe@octave.org>
parents: 16547
diff changeset
135
5fc1ce2947bd style fixes
John W. Eaton <jwe@octave.org>
parents: 16547
diff changeset
136 // When user closes message box for modified question.
15848
424edeca3c66 Redo portions of file editor to use more signals/slots rather than casting.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 15425
diff changeset
137 void handle_file_modified_answer (int decision);
16558
5fc1ce2947bd style fixes
John W. Eaton <jwe@octave.org>
parents: 16547
diff changeset
138
5fc1ce2947bd style fixes
John W. Eaton <jwe@octave.org>
parents: 16547
diff changeset
139 // When user closes find_dialog box.
15848
424edeca3c66 Redo portions of file editor to use more signals/slots rather than casting.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 15425
diff changeset
140 void handle_find_dialog_finished (int decision);
16558
5fc1ce2947bd style fixes
John W. Eaton <jwe@octave.org>
parents: 16547
diff changeset
141
5fc1ce2947bd style fixes
John W. Eaton <jwe@octave.org>
parents: 16547
diff changeset
142 // When user closes QFileDialog box.
15848
424edeca3c66 Redo portions of file editor to use more signals/slots rather than casting.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 15425
diff changeset
143 void handle_save_file_as_answer (const QString& fileName);
424edeca3c66 Redo portions of file editor to use more signals/slots rather than casting.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 15425
diff changeset
144 void handle_save_file_as_answer_close (const QString& fileName);
424edeca3c66 Redo portions of file editor to use more signals/slots rather than casting.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 15425
diff changeset
145 void handle_save_file_as_answer_cancel ();
424edeca3c66 Redo portions of file editor to use more signals/slots rather than casting.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 15425
diff changeset
146
16704
e38a0fa08368 fix restoring editor files from previous session and speedup lexer preparation
Torsten <ttl@justmail.de>
parents: 16638
diff changeset
147 // When apis preparation has finished and is ready to save
e38a0fa08368 fix restoring editor files from previous session and speedup lexer preparation
Torsten <ttl@justmail.de>
parents: 16638
diff changeset
148 void save_apis_info ();
e38a0fa08368 fix restoring editor files from previous session and speedup lexer preparation
Torsten <ttl@justmail.de>
parents: 16638
diff changeset
149
16716
23b5dde25367 make octave lexer the default and dynamically set margin width for line numbers
Torsten <ttl@justmail.de>
parents: 16715
diff changeset
150 // When the numer of lines changes -> adapt width of margin
23b5dde25367 make octave lexer the default and dynamically set margin width for line numbers
Torsten <ttl@justmail.de>
parents: 16715
diff changeset
151 void auto_margin_width ();
23b5dde25367 make octave lexer the default and dynamically set margin width for line numbers
Torsten <ttl@justmail.de>
parents: 16715
diff changeset
152
14676
35512b788af2 Editor can now handle multiple files in tabs.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
153 private:
15402
7f423c6111c6 refactor GUI event handling to use new event_queue class
John W. Eaton <jwe@octave.org>
parents: 15388
diff changeset
154
16558
5fc1ce2947bd style fixes
John W. Eaton <jwe@octave.org>
parents: 16547
diff changeset
155 enum editor_markers
17790
86c6ae5f969e Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents: 17744
diff changeset
156 {
86c6ae5f969e Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents: 17744
diff changeset
157 bookmark,
86c6ae5f969e Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents: 17744
diff changeset
158 breakpoint,
86c6ae5f969e Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents: 17744
diff changeset
159 debugger_position
86c6ae5f969e Use GNU style coding conventions for code in libgui/
Rik <rik@octave.org>
parents: 17744
diff changeset
160 };
16558
5fc1ce2947bd style fixes
John W. Eaton <jwe@octave.org>
parents: 16547
diff changeset
161
15402
7f423c6111c6 refactor GUI event handling to use new event_queue class
John W. Eaton <jwe@octave.org>
parents: 15388
diff changeset
162 struct bp_info
7f423c6111c6 refactor GUI event handling to use new event_queue class
John W. Eaton <jwe@octave.org>
parents: 15388
diff changeset
163 {
16568
477bfd5d95f5 use dir, not path, to refer to directory name
John W. Eaton <jwe@octave.org>
parents: 16558
diff changeset
164 bp_info (const QString& f, const QString& d, const QString& fn, int l)
477bfd5d95f5 use dir, not path, to refer to directory name
John W. Eaton <jwe@octave.org>
parents: 16558
diff changeset
165 : file (f.toStdString ()), dir (d.toStdString ()),
16547
3cd80afc3509 improve debugging with the GUI
John W. Eaton <jwe@octave.org>
parents: 16452
diff changeset
166 function_name (fn.toStdString ()), line (l)
15402
7f423c6111c6 refactor GUI event handling to use new event_queue class
John W. Eaton <jwe@octave.org>
parents: 15388
diff changeset
167 { }
7f423c6111c6 refactor GUI event handling to use new event_queue class
John W. Eaton <jwe@octave.org>
parents: 15388
diff changeset
168
16547
3cd80afc3509 improve debugging with the GUI
John W. Eaton <jwe@octave.org>
parents: 16452
diff changeset
169 std::string file;
16568
477bfd5d95f5 use dir, not path, to refer to directory name
John W. Eaton <jwe@octave.org>
parents: 16558
diff changeset
170 std::string dir;
15402
7f423c6111c6 refactor GUI event handling to use new event_queue class
John W. Eaton <jwe@octave.org>
parents: 15388
diff changeset
171 std::string function_name;
7f423c6111c6 refactor GUI event handling to use new event_queue class
John W. Eaton <jwe@octave.org>
parents: 15388
diff changeset
172 int line;
7f423c6111c6 refactor GUI event handling to use new event_queue class
John W. Eaton <jwe@octave.org>
parents: 15388
diff changeset
173 };
7f423c6111c6 refactor GUI event handling to use new event_queue class
John W. Eaton <jwe@octave.org>
parents: 15388
diff changeset
174
15848
424edeca3c66 Redo portions of file editor to use more signals/slots rather than casting.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 15425
diff changeset
175 void save_file (const QString& saveFileName, bool remove_on_success = false);
424edeca3c66 Redo portions of file editor to use more signals/slots rather than casting.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 15425
diff changeset
176 void save_file_as (bool remove_on_success = false);
424edeca3c66 Redo portions of file editor to use more signals/slots rather than casting.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 15425
diff changeset
177 void message_duplicate_file_name (const QString& fileName);
424edeca3c66 Redo portions of file editor to use more signals/slots rather than casting.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 15425
diff changeset
178
14869
db3c84d38345 Now supporting c/cc/cpp syntax highlighting.
Jacob Dawid <jacob.dawid@gmail.com>
parents: 14829
diff changeset
179 void update_lexer ();
14827
6b90737f69cc Very basic breakpoint setting and removing in the editor works.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14825
diff changeset
180 void request_add_breakpoint (int line);
6b90737f69cc Very basic breakpoint setting and removing in the editor works.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14825
diff changeset
181 void request_remove_breakpoint (int line);
6b90737f69cc Very basic breakpoint setting and removing in the editor works.
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14825
diff changeset
182
16018
e0df71fbe39b gui: clearer message box with cancel button when closing an unsaved editor file
Torsten <ttl@justmail.de>
parents: 15984
diff changeset
183 int check_file_modified ();
14709
f50591409306 Started to rename class names and methods from camel case to underscore-
Jacob Dawid <jacob.dawid@googlemail.com>
parents: 14707
diff changeset
184 void do_comment_selected_text (bool comment);
16719
0f6f14e3ac6a commenting selected lines in the editor uses comment string depending on lexer
Torsten <ttl@justmail.de>
parents: 16716
diff changeset
185 QString comment_string (const QString&);
14676
35512b788af2 Editor can now handle multiple files in tabs.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
186
15402
7f423c6111c6 refactor GUI event handling to use new event_queue class
John W. Eaton <jwe@octave.org>
parents: 15388
diff changeset
187 void add_breakpoint_callback (const bp_info& info);
7f423c6111c6 refactor GUI event handling to use new event_queue class
John W. Eaton <jwe@octave.org>
parents: 15388
diff changeset
188 void remove_breakpoint_callback (const bp_info& info);
7f423c6111c6 refactor GUI event handling to use new event_queue class
John W. Eaton <jwe@octave.org>
parents: 15388
diff changeset
189 void remove_all_breakpoints_callback (const bp_info& info);
16389
f5204f486a29 gui: add shortcut for goto line action in the editor and center the target line
Torsten <ttl@justmail.de>
parents: 16386
diff changeset
190 void center_current_line ();
15402
7f423c6111c6 refactor GUI event handling to use new event_queue class
John W. Eaton <jwe@octave.org>
parents: 15388
diff changeset
191
16731
01d523d5f796 add help for word at mouse or text cursor to the editors context menu
Torsten <ttl@justmail.de>
parents: 16719
diff changeset
192 octave_qscintilla *_edit_area;
14676
35512b788af2 Editor can now handle multiple files in tabs.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
193
16558
5fc1ce2947bd style fixes
John W. Eaton <jwe@octave.org>
parents: 16547
diff changeset
194 QString _file_name;
5fc1ce2947bd style fixes
John W. Eaton <jwe@octave.org>
parents: 16547
diff changeset
195 QString _file_name_short;
14676
35512b788af2 Editor can now handle multiple files in tabs.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
196
16558
5fc1ce2947bd style fixes
John W. Eaton <jwe@octave.org>
parents: 16547
diff changeset
197 bool _long_title;
5fc1ce2947bd style fixes
John W. Eaton <jwe@octave.org>
parents: 16547
diff changeset
198 bool _copy_available;
16638
3c2e457eeb72 ask for saving modified editor files if octave is closed (bug #38689)
Torsten <ttl@justmail.de>
parents: 16635
diff changeset
199 bool _app_closing;
14676
35512b788af2 Editor can now handle multiple files in tabs.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
200
16558
5fc1ce2947bd style fixes
John W. Eaton <jwe@octave.org>
parents: 16547
diff changeset
201 QFileSystemWatcher _file_system_watcher;
15848
424edeca3c66 Redo portions of file editor to use more signals/slots rather than casting.
Daniel J Sebald <daniel.sebald@ieee.org>
parents: 15425
diff changeset
202
16558
5fc1ce2947bd style fixes
John W. Eaton <jwe@octave.org>
parents: 16547
diff changeset
203 find_dialog *_find_dialog;
5fc1ce2947bd style fixes
John W. Eaton <jwe@octave.org>
parents: 16547
diff changeset
204 bool _find_dialog_is_visible;
5fc1ce2947bd style fixes
John W. Eaton <jwe@octave.org>
parents: 16547
diff changeset
205 QRect _find_dialog_geometry;
16704
e38a0fa08368 fix restoring editor files from previous session and speedup lexer preparation
Torsten <ttl@justmail.de>
parents: 16638
diff changeset
206
e38a0fa08368 fix restoring editor files from previous session and speedup lexer preparation
Torsten <ttl@justmail.de>
parents: 16638
diff changeset
207 QsciAPIs *_lexer_apis;
16715
96ed7ab44e2e save prepared apis info for qscintilla into a path depending on octave version
Torsten <ttl@justmail.de>
parents: 16704
diff changeset
208 QString _prep_apis_file;
14676
35512b788af2 Editor can now handle multiple files in tabs.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
209 };
35512b788af2 Editor can now handle multiple files in tabs.
Jacob Dawid <jacob.dawid@googlemail.com>
parents:
diff changeset
210
16558
5fc1ce2947bd style fixes
John W. Eaton <jwe@octave.org>
parents: 16547
diff changeset
211 #endif