Mercurial > octave
annotate liboctave/util/oct-rl-edit.h @ 33661:4c378dd47cf2 default tip @
command-widget: Use new signal-slot syntax for better compiler diagnostics.
* libgui/src/command-widget.cc (console::console): Use new signal-slot syntax
for better compiler diagnostics.
author | Markus Mützel <markus.muetzel@gmx.de> |
---|---|
date | Wed, 12 Jun 2024 17:24:20 +0200 |
parents | 2e484f9f1f18 |
children |
rev | line source |
---|---|
27923
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
1 //////////////////////////////////////////////////////////////////////// |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
2 // |
32632
2e484f9f1f18
maint: update Octave Project Developers copyright for the new year
John W. Eaton <jwe@octave.org>
parents:
31706
diff
changeset
|
3 // Copyright (C) 2000-2024 The Octave Project Developers |
27923
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
4 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
5 // See the file COPYRIGHT.md in the top-level directory of this |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
6 // distribution or <https://octave.org/copyright/>. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
7 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
8 // This file is part of Octave. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
9 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
10 // Octave is free software: you can redistribute it and/or modify it |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
11 // under the terms of the GNU General Public License as published by |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
12 // the Free Software Foundation, either version 3 of the License, or |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
13 // (at your option) any later version. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
14 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
15 // Octave is distributed in the hope that it will be useful, but |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
16 // WITHOUT ANY WARRANTY; without even the implied warranty of |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
18 // GNU General Public License for more details. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
19 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
20 // You should have received a copy of the GNU General Public License |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
21 // along with Octave; see the file COPYING. If not, see |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
22 // <https://www.gnu.org/licenses/>. |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
23 // |
bd51beb6205e
update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents:
27919
diff
changeset
|
24 //////////////////////////////////////////////////////////////////////// |
3519 | 25 |
20791
f7084eae3318
maint: Use Octave coding conventions for #if statements.
Rik <rik@octave.org>
parents:
19702
diff
changeset
|
26 #if ! defined (octave_oct_rl_edit_h) |
17822
ebb3ef964372
maint: Use common #define syntax "octave_filename_h" in h_files.
Rik <rik@octave.org>
parents:
17744
diff
changeset
|
27 #define octave_oct_rl_edit_h 1 |
3519 | 28 |
21244
1473547f50f5
include octave-config.h in public header files
John W. Eaton <jwe@octave.org>
parents:
20919
diff
changeset
|
29 #include "octave-config.h" |
1473547f50f5
include octave-config.h in public header files
John W. Eaton <jwe@octave.org>
parents:
20919
diff
changeset
|
30 |
23442
53f5f8231c37
allow most header files to be compiled separately
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
31 #if defined (__cplusplus) |
53f5f8231c37
allow most header files to be compiled separately
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
32 # include <cstdio> |
53f5f8231c37
allow most header files to be compiled separately
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
33 #else |
53f5f8231c37
allow most header files to be compiled separately
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
34 # include <stdio.h> |
53f5f8231c37
allow most header files to be compiled separately
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
35 #endif |
53f5f8231c37
allow most header files to be compiled separately
John W. Eaton <jwe@octave.org>
parents:
23220
diff
changeset
|
36 |
4802 | 37 typedef int (*rl_startup_hook_fcn_ptr) (void); |
3519 | 38 |
16570
d5ae5aa80d42
preserve pending command line input when running commands from GUI actions
John W. Eaton <jwe@octave.org>
parents:
16539
diff
changeset
|
39 typedef int (*rl_pre_input_hook_fcn_ptr) (void); |
d5ae5aa80d42
preserve pending command line input when running commands from GUI actions
John W. Eaton <jwe@octave.org>
parents:
16539
diff
changeset
|
40 |
4802 | 41 typedef int (*rl_event_hook_fcn_ptr) (void); |
3519 | 42 |
43 typedef int (*rl_fcn_ptr) (int, int); | |
44 | |
45 typedef char ** (*rl_attempted_completion_fcn_ptr) (const char *, int, int); | |
46 | |
47 typedef char * (*rl_completer_fcn_ptr) (const char *, int); | |
48 | |
21798
12e7456f7619
Tab completion of multiple directory levels. (bug #44095)
Lachlan Andrew <lachlanbis@gmail.com>
parents:
21724
diff
changeset
|
49 typedef char * (*rl_completion_hook_fcn_ptr) (void); |
12e7456f7619
Tab completion of multiple directory levels. (bug #44095)
Lachlan Andrew <lachlanbis@gmail.com>
parents:
21724
diff
changeset
|
50 |
6979 | 51 typedef char * (*rl_quoting_fcn_ptr) (char *, int, char *); |
52 | |
53 typedef char * (*rl_dequoting_fcn_ptr) (char *, int); | |
54 | |
55 typedef int (*rl_char_is_quoted_fcn_ptr) (char *, int); | |
56 | |
57 typedef int (*rl_command_fcn_ptr) (int, int); | |
58 | |
21724
aba2e6293dd8
use "#if ..." consistently instead of "#ifdef" and "#ifndef"
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
59 #if defined (__cplusplus) |
3519 | 60 extern "C" |
61 { | |
62 #endif | |
63 | |
16539
8ea8df0747e9
make undo button and menu item work for command window
John W. Eaton <jwe@octave.org>
parents:
16537
diff
changeset
|
64 extern void octave_rl_redisplay (void); |
6979 | 65 |
3519 | 66 extern int octave_rl_screen_height (void); |
67 | |
68 extern int octave_rl_screen_width (void); | |
69 | |
3779 | 70 extern void octave_rl_enable_paren_matching (int); |
3519 | 71 |
19378
f7ccd02bc060
provide access to the readline variable rl_erase_empty_line
John W. Eaton <jwe@octave.org>
parents:
19309
diff
changeset
|
72 extern int octave_rl_erase_empty_line (int); |
f7ccd02bc060
provide access to the readline variable rl_erase_empty_line
John W. Eaton <jwe@octave.org>
parents:
19309
diff
changeset
|
73 |
16537
106a38d7b396
optionall disable redisplay in command editor clear screen function
John W. Eaton <jwe@octave.org>
parents:
16534
diff
changeset
|
74 extern void octave_rl_clear_screen (int skip_redisplay); |
3519 | 75 |
76 extern void octave_rl_resize_terminal (void); | |
77 | |
19309
735bc47d18af
command_editor: provide access to rl_set_screen_size
John W. Eaton <jwe@octave.org>
parents:
19304
diff
changeset
|
78 extern void octave_rl_resize_terminal (void); |
735bc47d18af
command_editor: provide access to rl_set_screen_size
John W. Eaton <jwe@octave.org>
parents:
19304
diff
changeset
|
79 |
735bc47d18af
command_editor: provide access to rl_set_screen_size
John W. Eaton <jwe@octave.org>
parents:
19304
diff
changeset
|
80 extern void octave_rl_set_screen_size (int ht, int wd); |
735bc47d18af
command_editor: provide access to rl_set_screen_size
John W. Eaton <jwe@octave.org>
parents:
19304
diff
changeset
|
81 |
3519 | 82 extern void octave_rl_restore_terminal_state (void); |
83 | |
23446
cd4e1ee28716
maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents:
23442
diff
changeset
|
84 extern char * octave_rl_copy_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
|
85 |
d5ae5aa80d42
preserve pending command line input when running commands from GUI actions
John W. Eaton <jwe@octave.org>
parents:
16539
diff
changeset
|
86 extern void octave_rl_replace_line (const char *s, int clear_undo); |
d5ae5aa80d42
preserve pending command line input when running commands from GUI actions
John W. Eaton <jwe@octave.org>
parents:
16539
diff
changeset
|
87 |
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
|
88 extern void octave_rl_kill_full_line (void); |
c048358da712
also kill pending input line when gui command window is cleared (bug #44015)
John W. Eaton <jwe@octave.org>
parents:
19697
diff
changeset
|
89 |
3519 | 90 extern void octave_rl_insert_text (const char *); |
91 | |
6979 | 92 extern int octave_rl_newline (int, int); |
93 | |
23446
cd4e1ee28716
maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents:
23442
diff
changeset
|
94 extern const char * octave_rl_line_buffer (void); |
3519 | 95 |
22171
0a4c5a90f286
Allow tab completion of arrays of structures.
Lachlan Andrew <lachlanbis@gmail.com>
parents:
21798
diff
changeset
|
96 extern int octave_rl_point (void); |
0a4c5a90f286
Allow tab completion of arrays of structures.
Lachlan Andrew <lachlanbis@gmail.com>
parents:
21798
diff
changeset
|
97 |
16539
8ea8df0747e9
make undo button and menu item work for command window
John W. Eaton <jwe@octave.org>
parents:
16537
diff
changeset
|
98 extern int octave_rl_do_undo (void); |
8ea8df0747e9
make undo button and menu item work for command window
John W. Eaton <jwe@octave.org>
parents:
16537
diff
changeset
|
99 |
3519 | 100 extern void octave_rl_clear_undo_list (void); |
101 | |
102 extern void octave_rl_set_name (const char *); | |
103 | |
23446
cd4e1ee28716
maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents:
23442
diff
changeset
|
104 extern char * octave_rl_readline (const char *); |
3519 | 105 |
106 extern void octave_rl_set_input_stream (FILE *); | |
107 | |
23446
cd4e1ee28716
maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents:
23442
diff
changeset
|
108 extern FILE * octave_rl_get_input_stream (void); |
3519 | 109 |
110 extern void octave_rl_set_output_stream (FILE *); | |
111 | |
23446
cd4e1ee28716
maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents:
23442
diff
changeset
|
112 extern FILE * octave_rl_get_output_stream (void); |
3519 | 113 |
114 extern void octave_rl_read_init_file (const char *); | |
115 | |
7758
8e14a01ffe9f
input.cc (Fre_read_readline_init_file): new function
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
116 extern void octave_rl_re_read_init_file (void); |
8e14a01ffe9f
input.cc (Fre_read_readline_init_file): new function
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
117 |
4143 | 118 extern int octave_rl_filename_completion_desired (int); |
119 | |
6979 | 120 extern int octave_rl_filename_quoting_desired (int); |
121 | |
19304
ad93e9be78ee
command_editor: provide access to rl_prefer_env_winsize
John W. Eaton <jwe@octave.org>
parents:
17822
diff
changeset
|
122 extern int octave_rl_prefer_env_winsize (int); |
ad93e9be78ee
command_editor: provide access to rl_prefer_env_winsize
John W. Eaton <jwe@octave.org>
parents:
17822
diff
changeset
|
123 |
16382
389b09a914e2
allow gui to force readline to return from its idle/read loop
John W. Eaton <jwe@octave.org>
parents:
15271
diff
changeset
|
124 extern void octave_rl_done (int); |
389b09a914e2
allow gui to force readline to return from its idle/read loop
John W. Eaton <jwe@octave.org>
parents:
15271
diff
changeset
|
125 |
23446
cd4e1ee28716
maint: Use convention 'void * fcn ()' for functions which return pointers.
Rik <rik@octave.org>
parents:
23442
diff
changeset
|
126 extern char * octave_rl_filename_completion_function (const char *, int); |
4604 | 127 |
3933 | 128 extern void octave_rl_set_basic_word_break_characters (const char *); |
129 | |
130 extern void octave_rl_set_completer_word_break_characters (const char *); | |
131 | |
31480
1bbcaa97b2dd
adapt to rl_completer_word_break_characters being declared const
John W. Eaton <jwe@octave.org>
parents:
30564
diff
changeset
|
132 extern const char * octave_rl_get_completer_word_break_characters (void); |
21798
12e7456f7619
Tab completion of multiple directory levels. (bug #44095)
Lachlan Andrew <lachlanbis@gmail.com>
parents:
21724
diff
changeset
|
133 |
12e7456f7619
Tab completion of multiple directory levels. (bug #44095)
Lachlan Andrew <lachlanbis@gmail.com>
parents:
21724
diff
changeset
|
134 extern void octave_rl_set_completion_word_break_hook (rl_completion_hook_fcn_ptr); |
12e7456f7619
Tab completion of multiple directory levels. (bug #44095)
Lachlan Andrew <lachlanbis@gmail.com>
parents:
21724
diff
changeset
|
135 |
3519 | 136 extern void octave_rl_set_basic_quote_characters (const char *); |
137 | |
6979 | 138 extern void octave_rl_set_filename_quote_characters (const char *); |
139 | |
140 extern void octave_rl_set_completer_quote_characters (const char *); | |
141 | |
3519 | 142 extern void octave_rl_set_completion_append_character (char); |
143 | |
144 extern void | |
145 octave_rl_set_completion_function (rl_attempted_completion_fcn_ptr); | |
146 | |
6979 | 147 extern void |
148 octave_rl_set_quoting_function (rl_quoting_fcn_ptr); | |
149 | |
150 extern void | |
151 octave_rl_set_dequoting_function (rl_dequoting_fcn_ptr); | |
152 | |
153 extern void octave_rl_set_char_is_quoted_function (rl_char_is_quoted_fcn_ptr); | |
154 | |
3519 | 155 extern void octave_rl_set_startup_hook (rl_startup_hook_fcn_ptr); |
156 | |
157 extern rl_startup_hook_fcn_ptr octave_rl_get_startup_hook (void); | |
158 | |
16570
d5ae5aa80d42
preserve pending command line input when running commands from GUI actions
John W. Eaton <jwe@octave.org>
parents:
16539
diff
changeset
|
159 extern void octave_rl_set_pre_input_hook (rl_startup_hook_fcn_ptr); |
d5ae5aa80d42
preserve pending command line input when running commands from GUI actions
John W. Eaton <jwe@octave.org>
parents:
16539
diff
changeset
|
160 |
d5ae5aa80d42
preserve pending command line input when running commands from GUI actions
John W. Eaton <jwe@octave.org>
parents:
16539
diff
changeset
|
161 extern rl_pre_input_hook_fcn_ptr octave_rl_get_pre_input_hook (void); |
d5ae5aa80d42
preserve pending command line input when running commands from GUI actions
John W. Eaton <jwe@octave.org>
parents:
16539
diff
changeset
|
162 |
3519 | 163 extern void octave_rl_set_event_hook (rl_event_hook_fcn_ptr f); |
164 | |
165 extern rl_event_hook_fcn_ptr octave_rl_get_event_hook (void); | |
166 | |
167 extern char ** | |
168 octave_rl_completion_matches (const char *, rl_completer_fcn_ptr); | |
169 | |
170 extern char octave_rl_prompt_start_ignore (void); | |
171 | |
172 extern char octave_rl_prompt_end_ignore (void); | |
173 | |
20919
cfb58d9805fa
eliminate some type conversion warnings
John W. Eaton <jwe@octave.org>
parents:
20791
diff
changeset
|
174 extern void octave_rl_add_defun (const char *, rl_fcn_ptr, int); |
3519 | 175 |
176 extern void octave_rl_set_terminal_name (const char *); | |
177 | |
178 extern void octave_rl_initialize (void); | |
179 | |
180 extern int octave_rl_history_search_forward (int, int); | |
181 | |
182 extern int octave_rl_history_search_backward (int, int); | |
183 | |
20919
cfb58d9805fa
eliminate some type conversion warnings
John W. Eaton <jwe@octave.org>
parents:
20791
diff
changeset
|
184 extern int octave_rl_ctrl (char); |
3519 | 185 |
20919
cfb58d9805fa
eliminate some type conversion warnings
John W. Eaton <jwe@octave.org>
parents:
20791
diff
changeset
|
186 extern int octave_rl_meta (char); |
3519 | 187 |
24520
c5c11b07598a
refactor signal handling (bug #52757)
John W. Eaton <jwe@octave.org>
parents:
24131
diff
changeset
|
188 extern void octave_rl_recover_from_interrupt (void); |
c5c11b07598a
refactor signal handling (bug #52757)
John W. Eaton <jwe@octave.org>
parents:
24131
diff
changeset
|
189 |
21724
aba2e6293dd8
use "#if ..." consistently instead of "#ifdef" and "#ifndef"
John W. Eaton <jwe@octave.org>
parents:
21244
diff
changeset
|
190 #if defined (__cplusplus) |
3519 | 191 } |
192 #endif | |
193 | |
194 #endif |