Mercurial > octave
annotate liboctave/util/cmd-edit.h @ 22402:4caa7b28d183
maint: Style check C++ code in liboctave/
* Array-C.cc, Array-b.cc, Array-ch.cc, Array-d.cc, Array-f.cc, Array-fC.cc,
Array-i.cc, Array-idx-vec.cc, Array-s.cc, Array-str.cc, Array-util.cc,
Array-util.h, Array-voidp.cc, Array.cc, Array.h, CColVector.cc, CColVector.h,
CDiagMatrix.cc, CDiagMatrix.h, CMatrix.cc, CMatrix.h, CNDArray.cc, CNDArray.h,
CRowVector.cc, CRowVector.h, CSparse.cc, CSparse.h, DiagArray2.cc,
DiagArray2.h, MArray-C.cc, MArray-d.cc, MArray-f.cc, MArray-fC.cc, MArray-i.cc,
MArray-s.cc, MArray.cc, MArray.h, MDiagArray2.cc, MDiagArray2.h, MSparse-C.cc,
MSparse-d.cc, MSparse.cc, MSparse.h, Matrix.h, MatrixType.cc, MatrixType.h,
PermMatrix.cc, PermMatrix.h, Range.cc, Range.h, Sparse-C.cc, Sparse-b.cc,
Sparse-d.cc, Sparse.cc, Sparse.h, boolMatrix.cc, boolMatrix.h, boolNDArray.cc,
boolNDArray.h, boolSparse.cc, boolSparse.h, chMatrix.cc, chMatrix.h,
chNDArray.cc, chNDArray.h, dColVector.cc, dColVector.h, dDiagMatrix.cc,
dDiagMatrix.h, dMatrix.cc, dMatrix.h, dNDArray.cc, dNDArray.h, dRowVector.cc,
dRowVector.h, dSparse.cc, dSparse.h, dim-vector.cc, dim-vector.h,
fCColVector.cc, fCColVector.h, fCDiagMatrix.cc, fCDiagMatrix.h, fCMatrix.cc,
fCMatrix.h, fCNDArray.cc, fCNDArray.h, fCRowVector.cc, fCRowVector.h,
fColVector.cc, fColVector.h, fDiagMatrix.cc, fDiagMatrix.h, fMatrix.cc,
fMatrix.h, fNDArray.cc, fNDArray.h, fRowVector.cc, fRowVector.h, idx-vector.cc,
idx-vector.h, int16NDArray.cc, int16NDArray.h, int32NDArray.cc, int32NDArray.h,
int64NDArray.cc, int64NDArray.h, int8NDArray.cc, int8NDArray.h, intNDArray.cc,
intNDArray.h, uint16NDArray.cc, uint16NDArray.h, uint32NDArray.cc,
uint32NDArray.h, uint64NDArray.h, uint8NDArray.h, blaswrap.c, cquit.c,
f77-extern.cc, f77-fcn.c, f77-fcn.h, lo-error.c, lo-error.h, quit.cc, quit.h,
liboctave-build-info.h, liboctave-build-info.in.cc, CollocWt.cc, CollocWt.h,
DAE.h, DAEFunc.h, DAERT.h, DAERTFunc.h, DASPK.cc, DASPK.h, DASRT.cc, DASRT.h,
DASSL.cc, DASSL.h, DET.h, EIG.cc, EIG.h, LSODE.cc, LSODE.h, ODE.h, ODEFunc.h,
ODES.cc, ODES.h, ODESFunc.h, Quad.cc, Quad.h, aepbalance.cc, aepbalance.h,
base-dae.h, base-de.h, base-min.h, bsxfun-decl.h, bsxfun-defs.cc, bsxfun.h,
chol.cc, chol.h, eigs-base.cc, eigs-base.h, fEIG.cc, fEIG.h, gepbalance.cc,
gepbalance.h, gsvd.cc, gsvd.h, hess.cc, hess.h, lo-amos-proto.h,
lo-arpack-proto.h, lo-blas-proto.h, lo-fftpack-proto.h, lo-lapack-proto.h,
lo-mappers.cc, lo-mappers.h, lo-qrupdate-proto.h, lo-ranlib-proto.h,
lo-slatec-proto.h, lo-specfun.cc, lo-specfun.h, lu.cc, lu.h, oct-convn.cc,
oct-fftw.cc, oct-fftw.h, oct-norm.h, oct-rand.cc, oct-rand.h, oct-spparms.cc,
oct-spparms.h, qr.cc, qr.h, qrp.cc, qrp.h, randgamma.cc, randgamma.h,
randmtzig.cc, randmtzig.h, randpoisson.cc, randpoisson.h, schur.cc, schur.h,
sparse-chol.cc, sparse-chol.h, sparse-dmsolve.cc, sparse-dmsolve.h,
sparse-lu.cc, sparse-lu.h, sparse-qr.cc, sparse-qr.h, svd.cc, svd.h,
Sparse-diag-op-defs.h, Sparse-op-decls.h, Sparse-op-defs.h,
Sparse-perm-op-defs.h, mx-base.h, mx-defs.h, mx-ext.h, mx-inlines.cc,
mx-op-decl.h, mx-op-defs.h, child-list.cc, child-list.h, dir-ops.cc, dir-ops.h,
file-ops.cc, file-ops.h, file-stat.cc, file-stat.h, lo-sysdep.cc, lo-sysdep.h,
mach-info.cc, mach-info.h, oct-env.cc, oct-env.h, oct-group.cc, oct-group.h,
oct-passwd.cc, oct-passwd.h, oct-syscalls.cc, oct-time.cc, oct-time.h,
oct-uname.cc, oct-uname.h, action-container.h, base-list.h, byte-swap.h,
caseless-str.h, cmd-edit.cc, cmd-edit.h, cmd-hist.cc, cmd-hist.h, data-conv.cc,
data-conv.h, f2c-main.c, functor.h, glob-match.cc, glob-match.h, kpse.cc,
kpse.h, lo-array-errwarn.cc, lo-array-errwarn.h, lo-array-gripes.cc,
lo-array-gripes.h, lo-cutils.c, lo-cutils.h, lo-hash.cc, lo-hash.h, lo-ieee.cc,
lo-ieee.h, lo-macros.h, lo-math.h, lo-regexp.cc, lo-regexp.h, lo-traits.h,
lo-utils.cc, lo-utils.h, oct-alloc.h, oct-base64.cc, oct-binmap.h, oct-cmplx.h,
oct-glob.cc, oct-glob.h, oct-inttypes-fwd.h, oct-inttypes.cc, oct-inttypes.h,
oct-locbuf.cc, oct-mutex.cc, oct-mutex.h, oct-refcount.h, oct-rl-edit.c,
oct-rl-edit.h, oct-rl-hist.c, oct-rl-hist.h, oct-shlib.cc, oct-shlib.h,
oct-sort.cc, oct-sort.h, oct-sparse.h, oct-string.cc, oct-string.h,
pathsearch.cc, pathsearch.h, singleton-cleanup.cc, singleton-cleanup.h,
sparse-sort.cc, sparse-sort.h, sparse-util.cc, sparse-util.h, str-vec.cc,
str-vec.h, sun-utils.h, unwind-prot.cc, unwind-prot.h, url-transfer.cc,
url-transfer.h, areadlink-wrapper.c, areadlink-wrapper.h,
async-system-wrapper.c, async-system-wrapper.h, base64-wrappers.c,
base64-wrappers.h, canonicalize-file-name-wrapper.c,
canonicalize-file-name-wrapper.h, dirent-wrappers.c, dirent-wrappers.h,
fcntl-wrappers.c, fcntl-wrappers.h, filepos-wrappers.c, filepos-wrappers.h,
fpucw-wrappers.c, fpucw-wrappers.h, gen-tempname-wrapper.c,
gen-tempname-wrapper.h, getopt-wrapper.c, glob-wrappers.c, hash-wrappers.c,
hash-wrappers.h, math-wrappers.c, math-wrappers.h, mkostemp-wrapper.c,
mkostemp-wrapper.h, nanosleep-wrapper.c, nanosleep-wrapper.h, nproc-wrapper.c,
nproc-wrapper.h, octave-popen2.c, octave-popen2.h, putenv-wrapper.c,
putenv-wrapper.h, set-program-name-wrapper.c, set-program-name-wrapper.h,
signal-wrappers.c, signal-wrappers.h, stat-wrappers.c, stat-wrappers.h,
strdup-wrapper.c, strdup-wrapper.h, strftime-wrapper.c, strftime-wrapper.h,
strmode-wrapper.c, strmode-wrapper.h, strptime-wrapper.c, strptime-wrapper.h,
time-wrappers.c, time-wrappers.h, tmpfile-wrapper.c, tmpfile-wrapper.h,
uname-wrapper.c, uname-wrapper.h, unistd-wrappers.c, unistd-wrappers.h,
unsetenv-wrapper.c, unsetenv-wrapper.h, vasprintf-wrapper.c,
vasprintf-wrapper.h, wait-for-input.c, wait-for-input.h, wait-wrappers.c,
wait-wrappers.h:
Wrap long lines < 80 characters. Update incorrect indentation.
author | Rik <rik@octave.org> |
---|---|
date | Mon, 29 Aug 2016 11:09:25 -0700 |
parents | bac0d6f07a3e |
children | 3a2b891d0b33 e9a0469dedd9 |
rev | line source |
---|---|
2926 | 1 /* |
2 | |
22323
bac0d6f07a3e
maint: Update copyright notices for 2016.
John W. Eaton <jwe@octave.org>
parents:
22171
diff
changeset
|
3 Copyright (C) 1996-2016 John W. Eaton |
2926 | 4 |
5 This file is part of Octave. | |
6 | |
7 Octave is free software; you can redistribute it and/or modify it | |
8 under the terms of the GNU General Public License as published by the | |
7016 | 9 Free Software Foundation; either version 3 of the License, or (at your |
10 option) any later version. | |
2926 | 11 |
12 Octave is distributed in the hope that it will be useful, but WITHOUT | |
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
15 for more details. | |
16 | |
17 You should have received a copy of the GNU General Public License | |
7016 | 18 along with Octave; see the file COPYING. If not, see |
19 <http://www.gnu.org/licenses/>. | |
2926 | 20 |
21 */ | |
22 | |
20791
f7084eae3318
maint: Use Octave coding conventions for #if statements.
Rik <rik@octave.org>
parents:
19702
diff
changeset
|
23 #if ! defined (octave_cmd_edit_h) |
2926 | 24 #define octave_cmd_edit_h 1 |
25 | |
21244
1473547f50f5
include octave-config.h in public header files
John W. Eaton <jwe@octave.org>
parents:
21017
diff
changeset
|
26 #include "octave-config.h" |
1473547f50f5
include octave-config.h in public header files
John W. Eaton <jwe@octave.org>
parents:
21017
diff
changeset
|
27 |
2926 | 28 #include <cstdio> |
29 | |
6913 | 30 #include <set> |
2926 | 31 #include <string> |
32 | |
4604 | 33 #include "str-vec.h" |
34 | |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
35 namespace octave |
2926 | 36 { |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
37 class |
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
38 OCTAVE_API |
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
39 command_editor |
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
40 { |
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
41 protected: |
2926 | 42 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
43 command_editor (void) |
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
44 : command_number (0), interrupted (false), initial_input () { } |
2926 | 45 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
46 public: |
3519 | 47 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
48 typedef int (*startup_hook_fcn) (void); |
16570
d5ae5aa80d42
preserve pending command line input when running commands from GUI actions
John W. Eaton <jwe@octave.org>
parents:
16539
diff
changeset
|
49 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
50 typedef int (*pre_input_hook_fcn) (void); |
2926 | 51 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
52 typedef int (*event_hook_fcn) (void); |
2941 | 53 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
54 typedef std::string (*completion_fcn) (const std::string&, int); |
6979 | 55 |
21798
12e7456f7619
Tab completion of multiple directory levels. (bug #44095)
Lachlan Andrew <lachlanbis@gmail.com>
parents:
21752
diff
changeset
|
56 typedef char * (*completion_hook_fcn) (); |
12e7456f7619
Tab completion of multiple directory levels. (bug #44095)
Lachlan Andrew <lachlanbis@gmail.com>
parents:
21752
diff
changeset
|
57 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
58 typedef std::string (*quoting_fcn) (const std::string&, int, char); |
6979 | 59 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
60 typedef std::string (*dequoting_fcn) (const std::string&, int); |
6979 | 61 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
62 typedef int (*char_is_quoted_fcn) (const std::string&, int); |
6979 | 63 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
64 typedef void (*user_accept_line_fcn) (const std::string&); |
2926 | 65 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
66 virtual ~command_editor (void) { } |
2926 | 67 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
68 static void set_name (const std::string& n); |
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
69 |
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
70 static std::string readline (const std::string& prompt); |
2926 | 71 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
72 static std::string readline (const std::string& prompt, bool& eof); |
3219 | 73 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
74 static void set_input_stream (FILE *f); |
2926 | 75 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
76 static FILE *get_input_stream (void); |
2926 | 77 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
78 static void set_output_stream (FILE *f); |
2926 | 79 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
80 static FILE *get_output_stream (void); |
2926 | 81 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
82 static void redisplay (void); |
16539
8ea8df0747e9
make undo button and menu item work for command window
John W. Eaton <jwe@octave.org>
parents:
16537
diff
changeset
|
83 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
84 static int terminal_rows (void); |
2926 | 85 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
86 static int terminal_cols (void); |
2926 | 87 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
88 static void clear_screen (bool skip_redisplay = false); |
2926 | 89 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
90 static void resize_terminal (void); |
3281 | 91 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
92 static void set_screen_size (int ht, int wd); |
19309
735bc47d18af
command_editor: provide access to rl_set_screen_size
John W. Eaton <jwe@octave.org>
parents:
19304
diff
changeset
|
93 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
94 static std::string decode_prompt_string (const std::string& s); |
2926 | 95 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
96 static void restore_terminal_state (void); |
2926 | 97 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
98 static void blink_matching_paren (bool flag); |
2926 | 99 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
100 static bool erase_empty_line (bool flag); |
19378
f7ccd02bc060
provide access to the readline variable rl_erase_empty_line
John W. Eaton <jwe@octave.org>
parents:
19309
diff
changeset
|
101 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
102 static void set_basic_word_break_characters (const std::string& s); |
3933 | 103 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
104 static void set_completer_word_break_characters (const std::string& s); |
3933 | 105 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
106 static void set_basic_quote_characters (const std::string& s); |
2926 | 107 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
108 static void set_filename_quote_characters (const std::string& s); |
6979 | 109 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
110 static void set_completer_quote_characters (const std::string& s); |
6979 | 111 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
112 static void set_completion_append_character (char c); |
2926 | 113 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
114 static void set_completion_function (completion_fcn f); |
2941 | 115 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
116 static void set_quoting_function (quoting_fcn f); |
6979 | 117 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
118 static void set_dequoting_function (dequoting_fcn f); |
6979 | 119 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
120 static void set_char_is_quoted_function (char_is_quoted_fcn f); |
6979 | 121 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
122 static void set_user_accept_line_function (user_accept_line_fcn f); |
6979 | 123 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
124 static completion_fcn get_completion_function (void); |
2926 | 125 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
126 static quoting_fcn get_quoting_function (void); |
6979 | 127 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
128 static dequoting_fcn get_dequoting_function (void); |
6979 | 129 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
130 static char_is_quoted_fcn get_char_is_quoted_function (void); |
6979 | 131 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
132 static user_accept_line_fcn get_user_accept_line_function (void); |
6979 | 133 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
134 static string_vector generate_filename_completions (const std::string& text); |
4604 | 135 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
136 static std::string get_line_buffer (void); |
9485
3cee58bf4acf
selectively complete filenames in some cases
John W. Eaton <jwe@octave.org>
parents:
9321
diff
changeset
|
137 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
138 static std::string get_current_line (void); |
16570
d5ae5aa80d42
preserve pending command line input when running commands from GUI actions
John W. Eaton <jwe@octave.org>
parents:
16539
diff
changeset
|
139 |
22171
0a4c5a90f286
Allow tab completion of arrays of structures.
Lachlan Andrew <lachlanbis@gmail.com>
parents:
21862
diff
changeset
|
140 static char get_prev_char (int); |
0a4c5a90f286
Allow tab completion of arrays of structures.
Lachlan Andrew <lachlanbis@gmail.com>
parents:
21862
diff
changeset
|
141 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
142 static void replace_line (const std::string& text, bool clear_undo = true); |
16570
d5ae5aa80d42
preserve pending command line input when running commands from GUI actions
John W. Eaton <jwe@octave.org>
parents:
16539
diff
changeset
|
143 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
144 static void kill_full_line (void); |
19702
c048358da712
also kill pending input line when gui command window is cleared (bug #44015)
John W. Eaton <jwe@octave.org>
parents:
19697
diff
changeset
|
145 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
146 static void insert_text (const std::string& text); |
2926 | 147 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
148 static void newline (void); |
2926 | 149 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
150 static void accept_line (void); |
6979 | 151 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
152 static bool undo (void); |
16539
8ea8df0747e9
make undo button and menu item work for command window
John W. Eaton <jwe@octave.org>
parents:
16537
diff
changeset
|
153 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
154 static void clear_undo_list (void); |
2926 | 155 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
156 static void add_startup_hook (startup_hook_fcn f); |
2926 | 157 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
158 static void remove_startup_hook (startup_hook_fcn f); |
2926 | 159 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
160 static void add_pre_input_hook (pre_input_hook_fcn f); |
16570
d5ae5aa80d42
preserve pending command line input when running commands from GUI actions
John W. Eaton <jwe@octave.org>
parents:
16539
diff
changeset
|
161 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
162 static void remove_pre_input_hook (pre_input_hook_fcn f); |
16570
d5ae5aa80d42
preserve pending command line input when running commands from GUI actions
John W. Eaton <jwe@octave.org>
parents:
16539
diff
changeset
|
163 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
164 static void add_event_hook (event_hook_fcn f); |
3215 | 165 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
166 static void remove_event_hook (event_hook_fcn f); |
3215 | 167 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
168 static void run_event_hooks (void); |
13924
3b654a0753b1
Implement waitfor, uiwait and uiresume.
Michael Goffioul <michael.goffioul@gmail.com>
parents:
11586
diff
changeset
|
169 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
170 static void read_init_file (const std::string& file = ""); |
3189 | 171 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
172 static void re_read_init_file (void); |
7758
8e14a01ffe9f
input.cc (Fre_read_readline_init_file): new function
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
173 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
174 static bool filename_completion_desired (bool); |
4143 | 175 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
176 static bool filename_quoting_desired (bool); |
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
177 |
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
178 static bool prefer_env_winsize (bool); |
6979 | 179 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
180 static bool interrupt (bool = true); |
19304
ad93e9be78ee
command_editor: provide access to rl_prefer_env_winsize
John W. Eaton <jwe@octave.org>
parents:
17769
diff
changeset
|
181 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
182 static int current_command_number (void); |
16382
389b09a914e2
allow gui to force readline to return from its idle/read loop
John W. Eaton <jwe@octave.org>
parents:
15271
diff
changeset
|
183 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
184 static void reset_current_command_number (int n); |
2926 | 185 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
186 static void increment_current_command_number (void); |
2926 | 187 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
188 static void force_default_editor (void); |
2967 | 189 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
190 static void set_initial_input (const std::string& text); |
9321
9b87aeb24ea9
avoid using readline at all when line editing suppressed or interpreter embedded
Jaroslav Hajek <highegg@gmail.com>
parents:
8920
diff
changeset
|
191 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
192 static int insert_initial_input (void); |
16570
d5ae5aa80d42
preserve pending command line input when running commands from GUI actions
John W. Eaton <jwe@octave.org>
parents:
16539
diff
changeset
|
193 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
194 private: |
16570
d5ae5aa80d42
preserve pending command line input when running commands from GUI actions
John W. Eaton <jwe@octave.org>
parents:
16539
diff
changeset
|
195 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
196 // No copying! |
2926 | 197 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
198 command_editor (const command_editor&); |
2926 | 199 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
200 command_editor& operator = (const command_editor&); |
2926 | 201 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
202 static bool instance_ok (void); |
2926 | 203 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
204 static void make_command_editor (void); |
2926 | 205 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
206 static int startup_handler (void); |
2926 | 207 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
208 static int pre_input_handler (void); |
6913 | 209 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
210 static int event_handler (void); |
16570
d5ae5aa80d42
preserve pending command line input when running commands from GUI actions
John W. Eaton <jwe@octave.org>
parents:
16539
diff
changeset
|
211 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
212 static std::set<startup_hook_fcn> startup_hook_set; |
6913 | 213 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
214 static std::set<pre_input_hook_fcn> pre_input_hook_set; |
6913 | 215 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
216 static std::set<event_hook_fcn> event_hook_set; |
16570
d5ae5aa80d42
preserve pending command line input when running commands from GUI actions
John W. Eaton <jwe@octave.org>
parents:
16539
diff
changeset
|
217 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
218 // The real thing. |
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
219 static command_editor *instance; |
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
220 |
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
221 static void cleanup_instance (void) { delete instance; instance = 0; } |
6913 | 222 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
223 protected: |
2926 | 224 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
225 // To use something other than the GNU readline library, derive a new |
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
226 // class from command_editor, overload these functions as |
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
227 // necessary, and make instance point to the new class. |
2926 | 228 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
229 virtual void do_set_name (const std::string&) { } |
2926 | 230 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
231 std::string do_readline (const std::string& prompt) |
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
232 { |
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
233 bool eof; |
3219 | 234 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
235 return do_readline (prompt, eof); |
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
236 } |
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
237 |
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
238 virtual std::string do_readline (const std::string&, bool&) = 0; |
3219 | 239 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
240 virtual void do_set_input_stream (FILE *) = 0; |
2926 | 241 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
242 virtual FILE *do_get_input_stream (void) = 0; |
2926 | 243 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
244 virtual void do_set_output_stream (FILE *) = 0; |
2926 | 245 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
246 virtual FILE *do_get_output_stream (void) = 0; |
2926 | 247 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
248 virtual void do_redisplay (void) { } |
2926 | 249 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
250 virtual int do_terminal_rows (void) { return 24; } |
16539
8ea8df0747e9
make undo button and menu item work for command window
John W. Eaton <jwe@octave.org>
parents:
16537
diff
changeset
|
251 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
252 virtual int do_terminal_cols (void) { return 80; } |
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
253 |
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
254 virtual void do_clear_screen (bool) { } |
2926 | 255 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
256 virtual void do_resize_terminal (void) { } |
2926 | 257 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
258 virtual void do_set_screen_size (int, int) { } |
2926 | 259 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
260 virtual std::string do_decode_prompt_string (const std::string&); |
3281 | 261 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
262 virtual std::string newline_chars (void) { return "\n"; } |
19309
735bc47d18af
command_editor: provide access to rl_set_screen_size
John W. Eaton <jwe@octave.org>
parents:
19304
diff
changeset
|
263 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
264 virtual void do_restore_terminal_state (void) { } |
2926 | 265 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
266 virtual void do_blink_matching_paren (bool) { } |
2926 | 267 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
268 virtual bool do_erase_empty_line (bool) { return false; } |
2926 | 269 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
270 virtual void do_set_basic_word_break_characters (const std::string&) { } |
2926 | 271 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
272 virtual void do_set_completer_word_break_characters (const std::string&) { } |
19378
f7ccd02bc060
provide access to the readline variable rl_erase_empty_line
John W. Eaton <jwe@octave.org>
parents:
19309
diff
changeset
|
273 |
21798
12e7456f7619
Tab completion of multiple directory levels. (bug #44095)
Lachlan Andrew <lachlanbis@gmail.com>
parents:
21752
diff
changeset
|
274 virtual void do_set_completer_word_break_hook (completion_hook_fcn) { } |
12e7456f7619
Tab completion of multiple directory levels. (bug #44095)
Lachlan Andrew <lachlanbis@gmail.com>
parents:
21752
diff
changeset
|
275 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
276 virtual void do_set_basic_quote_characters (const std::string&) { } |
3933 | 277 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
278 virtual void do_set_filename_quote_characters (const std::string&) { } |
3933 | 279 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
280 virtual void do_set_completer_quote_characters (const std::string&) { } |
2926 | 281 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
282 virtual void do_set_completion_append_character (char) { } |
6979 | 283 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
284 virtual void do_set_completion_function (completion_fcn) { } |
6979 | 285 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
286 virtual void do_set_quoting_function (quoting_fcn) { } |
2926 | 287 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
288 virtual void do_set_dequoting_function (dequoting_fcn) { } |
2941 | 289 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
290 virtual void do_set_char_is_quoted_function (char_is_quoted_fcn) { } |
6979 | 291 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
292 virtual void do_set_user_accept_line_function (user_accept_line_fcn) { } |
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
293 |
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
294 virtual completion_fcn do_get_completion_function (void) const { return 0; } |
6979 | 295 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
296 virtual quoting_fcn do_get_quoting_function (void) const { return 0; } |
6979 | 297 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
298 virtual dequoting_fcn do_get_dequoting_function (void) const { return 0; } |
6979 | 299 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
300 virtual char_is_quoted_fcn do_get_char_is_quoted_function (void) const |
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
301 { return 0; } |
2926 | 302 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
303 virtual user_accept_line_fcn do_get_user_accept_line_function (void) const |
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
304 { return 0; } |
6979 | 305 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
306 virtual string_vector |
22402
4caa7b28d183
maint: Style check C++ code in liboctave/
Rik <rik@octave.org>
parents:
22323
diff
changeset
|
307 do_generate_filename_completions (const std::string& text) = 0; |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
308 |
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
309 virtual std::string do_get_line_buffer (void) const = 0; |
6979 | 310 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
311 virtual std::string do_get_current_line (void) const = 0; |
6979 | 312 |
22171
0a4c5a90f286
Allow tab completion of arrays of structures.
Lachlan Andrew <lachlanbis@gmail.com>
parents:
21862
diff
changeset
|
313 virtual char do_get_prev_char (int) const = 0; |
0a4c5a90f286
Allow tab completion of arrays of structures.
Lachlan Andrew <lachlanbis@gmail.com>
parents:
21862
diff
changeset
|
314 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
315 virtual void do_replace_line (const std::string& text, bool clear_undo) = 0; |
4604 | 316 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
317 virtual void do_kill_full_line (void) = 0; |
9485
3cee58bf4acf
selectively complete filenames in some cases
John W. Eaton <jwe@octave.org>
parents:
9321
diff
changeset
|
318 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
319 virtual void do_insert_text (const std::string& text) = 0; |
16570
d5ae5aa80d42
preserve pending command line input when running commands from GUI actions
John W. Eaton <jwe@octave.org>
parents:
16539
diff
changeset
|
320 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
321 virtual void do_newline (void) = 0; |
16570
d5ae5aa80d42
preserve pending command line input when running commands from GUI actions
John W. Eaton <jwe@octave.org>
parents:
16539
diff
changeset
|
322 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
323 virtual void do_accept_line (void) = 0; |
19702
c048358da712
also kill pending input line when gui command window is cleared (bug #44015)
John W. Eaton <jwe@octave.org>
parents:
19697
diff
changeset
|
324 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
325 virtual bool do_undo (void) { return false; } |
2926 | 326 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
327 virtual void do_clear_undo_list (void) { } |
2926 | 328 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
329 virtual void set_startup_hook (startup_hook_fcn) { } |
6979 | 330 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
331 virtual void restore_startup_hook (void) { } |
16539
8ea8df0747e9
make undo button and menu item work for command window
John W. Eaton <jwe@octave.org>
parents:
16537
diff
changeset
|
332 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
333 virtual void set_pre_input_hook (pre_input_hook_fcn) { } |
2926 | 334 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
335 virtual void restore_pre_input_hook (void) { } |
2926 | 336 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
337 virtual void set_event_hook (event_hook_fcn) { } |
2926 | 338 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
339 virtual void restore_event_hook (void) { } |
16570
d5ae5aa80d42
preserve pending command line input when running commands from GUI actions
John W. Eaton <jwe@octave.org>
parents:
16539
diff
changeset
|
340 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
341 virtual void do_read_init_file (const std::string&) { } |
16570
d5ae5aa80d42
preserve pending command line input when running commands from GUI actions
John W. Eaton <jwe@octave.org>
parents:
16539
diff
changeset
|
342 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
343 virtual void do_re_read_init_file (void) { } |
3215 | 344 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
345 virtual bool do_filename_completion_desired (bool) { return false; } |
3215 | 346 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
347 virtual bool do_filename_quoting_desired (bool) { return false; } |
3189 | 348 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
349 virtual bool do_prefer_env_winsize (bool) { return false; } |
7758
8e14a01ffe9f
input.cc (Fre_read_readline_init_file): new function
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
350 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
351 virtual void do_interrupt (bool) { } |
4143 | 352 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
353 int do_insert_initial_input (void); |
6979 | 354 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
355 int read_octal (const std::string& s); |
19304
ad93e9be78ee
command_editor: provide access to rl_prefer_env_winsize
John W. Eaton <jwe@octave.org>
parents:
17769
diff
changeset
|
356 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
357 void error (int); |
16382
389b09a914e2
allow gui to force readline to return from its idle/read loop
John W. Eaton <jwe@octave.org>
parents:
15271
diff
changeset
|
358 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
359 void error (const std::string&); |
16570
d5ae5aa80d42
preserve pending command line input when running commands from GUI actions
John W. Eaton <jwe@octave.org>
parents:
16539
diff
changeset
|
360 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
361 // The current command number. |
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
362 int command_number; |
2926 | 363 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
364 bool interrupted; |
2926 | 365 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
366 std::string initial_input; |
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
367 }; |
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
368 } |
16382
389b09a914e2
allow gui to force readline to return from its idle/read loop
John W. Eaton <jwe@octave.org>
parents:
15271
diff
changeset
|
369 |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
370 #if defined (OCTAVE_USE_DEPRECATED_FUNCTIONS) |
16570
d5ae5aa80d42
preserve pending command line input when running commands from GUI actions
John W. Eaton <jwe@octave.org>
parents:
16539
diff
changeset
|
371 |
21752
949cb46e6bdb
use consistent style for deprecated function/class messages
John W. Eaton <jwe@octave.org>
parents:
21748
diff
changeset
|
372 OCTAVE_DEPRECATED ("use 'octave::command_editor' instead") |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
373 typedef octave::command_editor command_editor; |
2926 | 374 |
375 #endif | |
21748
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
376 |
176536b15d68
use namespace for command_editor and command_history classes
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
377 #endif |
22402
4caa7b28d183
maint: Style check C++ code in liboctave/
Rik <rik@octave.org>
parents:
22323
diff
changeset
|
378 |