1 /* Specific command window processing.
3 Copyright (C) 1998-2015 Free Software Foundation, Inc.
5 Contributed by Hewlett-Packard Company.
7 This file is part of GDB.
9 This program is free software; you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation; either version 3 of the License, or
12 (at your option) any later version.
14 This program is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with this program. If not, see <http://www.gnu.org/licenses/>. */
25 #include "tui/tui-data.h"
26 #include "tui/tui-win.h"
27 #include "tui/tui-io.h"
28 #include "tui/tui-command.h"
30 #include "gdb_curses.h"
31 /*****************************************
32 ** STATIC LOCAL FUNCTIONS FORWARD DECLS **
33 ******************************************/
37 /*****************************************
38 ** PUBLIC FUNCTIONS **
39 ******************************************/
41 /* Dispatch the correct tui function based upon the control
44 tui_dispatch_ctrl_char (unsigned int ch
)
46 struct tui_win_info
*win_info
= tui_win_with_focus ();
48 /* Handle the CTRL-L refresh for each window. */
50 tui_refresh_all_win ();
52 /* If the command window has the logical focus, or no-one does
53 assume it is the command window; in this case, pass the character
54 on through and do nothing here. */
55 if (win_info
== NULL
|| win_info
== TUI_CMD_WIN
)
59 unsigned int c
= 0, ch_copy
= ch
;
63 /* If this is an xterm, page next/prev keys aren't returned by
64 keypad as a single char, so we must handle them here. Seems
65 like a bug in the curses library? */
66 term
= (char *) getenv ("TERM");
69 for (i
= 0; term
[i
]; i
++)
70 term
[i
] = toupper (term
[i
]);
71 if ((strcmp (term
, "XTERM") == 0)
72 && key_is_start_sequence (ch
))
74 unsigned int page_ch
= 0;
75 unsigned int tmp_char
;
76 WINDOW
*w
= TUI_CMD_WIN
->generic
.handle
;
79 while (!key_is_end_sequence (tmp_char
))
81 tmp_char
= (int) wgetch (w
);
90 else if (tmp_char
== 54)
104 tui_scroll_forward (win_info
, 0);
107 tui_scroll_backward (win_info
, 0);
111 tui_scroll_forward (win_info
, 1);
115 tui_scroll_backward (win_info
, 1);
118 tui_scroll_left (win_info
, 1);
121 tui_scroll_right (win_info
, 1);
133 /* See tui-command.h. */
136 tui_refresh_cmd_win (void)
138 WINDOW
*w
= TUI_CMD_WIN
->generic
.handle
;
142 /* FIXME: It's not clear why this is here.
143 It was present in the original tui_puts code and is kept in order to
144 not introduce some subtle breakage. */
This page took 0.03236 seconds and 4 git commands to generate.