Mercurial > octave
annotate liboctave/util/oct-rl-edit.h @ 16539:8ea8df0747e9
make undo button and menu item work for command window
* main-window.h, main-window.cc (main_window::handle_undo_request,
main_window::command_window_undo_callback): New functions.
(main_window::construct_edit_menu): Connect _undo_action::triggered to
main_window::handle_undo_request.
* cmd-edit.h, cmd-edit.cc (command_window::redisplay,
command_window::do_redisplay, command_window::undo,
command_window::do_undo, gnu_readline::do_redisplay,
gnu_readline::do_undo): New functions.
* oct-rl-edit.h, oct-rl-edit.c (octave_rl_do_undo): New function.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Thu, 18 Apr 2013 03:19:48 -0400 |
parents | 106a38d7b396 |
children | d5ae5aa80d42 |
rev | line source |
---|---|
3519 | 1 /* |
2 | |
14138
72c96de7a403
maint: update copyright notices for 2012
John W. Eaton <jwe@octave.org>
parents:
11523
diff
changeset
|
3 Copyright (C) 2000-2012 John W. Eaton |
3519 | 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. | |
3519 | 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/>. | |
3519 | 20 |
21 */ | |
22 | |
23 #if !defined (octave_rl_edit_h) | |
24 #define octave_rl_edit_h 1 | |
25 | |
4802 | 26 typedef int (*rl_startup_hook_fcn_ptr) (void); |
3519 | 27 |
4802 | 28 typedef int (*rl_event_hook_fcn_ptr) (void); |
3519 | 29 |
30 typedef int (*rl_fcn_ptr) (int, int); | |
31 | |
32 typedef char ** (*rl_attempted_completion_fcn_ptr) (const char *, int, int); | |
33 | |
34 typedef char * (*rl_completer_fcn_ptr) (const char *, int); | |
35 | |
6979 | 36 typedef char * (*rl_quoting_fcn_ptr) (char *, int, char *); |
37 | |
38 typedef char * (*rl_dequoting_fcn_ptr) (char *, int); | |
39 | |
40 typedef int (*rl_char_is_quoted_fcn_ptr) (char *, int); | |
41 | |
42 typedef int (*rl_command_fcn_ptr) (int, int); | |
43 | |
3519 | 44 #ifdef __cplusplus |
45 extern "C" | |
46 { | |
47 #endif | |
48 | |
16539
8ea8df0747e9
make undo button and menu item work for command window
John W. Eaton <jwe@octave.org>
parents:
16537
diff
changeset
|
49 extern void octave_rl_redisplay (void); |
6979 | 50 |
3519 | 51 extern int octave_rl_screen_height (void); |
52 | |
53 extern int octave_rl_screen_width (void); | |
54 | |
3779 | 55 extern void octave_rl_enable_paren_matching (int); |
3519 | 56 |
57 extern void octave_rl_init (void); | |
58 | |
16537
106a38d7b396
optionall disable redisplay in command editor clear screen function
John W. Eaton <jwe@octave.org>
parents:
16534
diff
changeset
|
59 extern void octave_rl_clear_screen (int skip_redisplay); |
3519 | 60 |
61 extern void octave_rl_resize_terminal (void); | |
62 | |
63 extern void octave_rl_restore_terminal_state (void); | |
64 | |
65 extern void octave_rl_insert_text (const char *); | |
66 | |
6979 | 67 extern int octave_rl_newline (int, int); |
68 | |
69 extern const char *octave_rl_line_buffer (void); | |
3519 | 70 |
16539
8ea8df0747e9
make undo button and menu item work for command window
John W. Eaton <jwe@octave.org>
parents:
16537
diff
changeset
|
71 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
|
72 |
3519 | 73 extern void octave_rl_clear_undo_list (void); |
74 | |
75 extern void octave_rl_set_name (const char *); | |
76 | |
77 extern char *octave_rl_readline (const char *); | |
78 | |
79 extern void octave_rl_set_input_stream (FILE *); | |
80 | |
81 extern FILE *octave_rl_get_input_stream (void); | |
82 | |
83 extern void octave_rl_set_output_stream (FILE *); | |
84 | |
85 extern FILE *octave_rl_get_output_stream (void); | |
86 | |
87 extern void octave_rl_read_init_file (const char *); | |
88 | |
7758
8e14a01ffe9f
input.cc (Fre_read_readline_init_file): new function
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
89 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
|
90 |
4143 | 91 extern int octave_rl_filename_completion_desired (int); |
92 | |
6979 | 93 extern int octave_rl_filename_quoting_desired (int); |
94 | |
16382
389b09a914e2
allow gui to force readline to return from its idle/read loop
John W. Eaton <jwe@octave.org>
parents:
15271
diff
changeset
|
95 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
|
96 |
4604 | 97 extern char *octave_rl_filename_completion_function (const char *, int); |
98 | |
3933 | 99 extern void octave_rl_set_basic_word_break_characters (const char *); |
100 | |
101 extern void octave_rl_set_completer_word_break_characters (const char *); | |
102 | |
3519 | 103 extern void octave_rl_set_basic_quote_characters (const char *); |
104 | |
6979 | 105 extern void octave_rl_set_filename_quote_characters (const char *); |
106 | |
107 extern void octave_rl_set_completer_quote_characters (const char *); | |
108 | |
3519 | 109 extern void octave_rl_set_completion_append_character (char); |
110 | |
111 extern void | |
112 octave_rl_set_completion_function (rl_attempted_completion_fcn_ptr); | |
113 | |
6979 | 114 extern void |
115 octave_rl_set_quoting_function (rl_quoting_fcn_ptr); | |
116 | |
117 extern void | |
118 octave_rl_set_dequoting_function (rl_dequoting_fcn_ptr); | |
119 | |
120 extern void octave_rl_set_char_is_quoted_function (rl_char_is_quoted_fcn_ptr); | |
121 | |
3519 | 122 extern void octave_rl_set_startup_hook (rl_startup_hook_fcn_ptr); |
123 | |
124 extern rl_startup_hook_fcn_ptr octave_rl_get_startup_hook (void); | |
125 | |
126 extern void octave_rl_set_event_hook (rl_event_hook_fcn_ptr f); | |
127 | |
128 extern rl_event_hook_fcn_ptr octave_rl_get_event_hook (void); | |
129 | |
130 extern char ** | |
131 octave_rl_completion_matches (const char *, rl_completer_fcn_ptr); | |
132 | |
133 extern char octave_rl_prompt_start_ignore (void); | |
134 | |
135 extern char octave_rl_prompt_end_ignore (void); | |
136 | |
137 extern void octave_rl_add_defun (const char *, rl_fcn_ptr, char); | |
138 | |
139 extern void octave_rl_set_terminal_name (const char *); | |
140 | |
141 extern void octave_rl_initialize (void); | |
142 | |
143 extern int octave_rl_history_search_forward (int, int); | |
144 | |
145 extern int octave_rl_history_search_backward (int, int); | |
146 | |
147 extern char octave_rl_ctrl (char); | |
148 | |
149 extern char octave_rl_meta (char); | |
150 | |
151 #ifdef __cplusplus | |
152 } | |
153 #endif | |
154 | |
155 #endif |