1 /* Specific command window processing.
3 Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008
4 Free Software Foundation, Inc.
6 Contributed by Hewlett-Packard Company.
8 This file is part of GDB.
10 This program is free software; you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
12 the Free Software Foundation; either version 3 of the License, or
13 (at your option) any later version.
15 This program is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
20 You should have received a copy of the GNU General Public License
21 along with this program. If not, see <http://www.gnu.org/licenses/>. */
26 #include "tui/tui-data.h"
27 #include "tui/tui-win.h"
28 #include "tui/tui-io.h"
30 #include "gdb_curses.h"
31 #include "gdb_string.h"
34 /*****************************************
35 ** STATIC LOCAL FUNCTIONS FORWARD DECLS **
36 ******************************************/
40 /*****************************************
41 ** PUBLIC FUNCTIONS **
42 ******************************************/
44 /* Dispatch the correct tui function based upon the control
47 tui_dispatch_ctrl_char (unsigned int ch
)
49 struct tui_win_info
*win_info
= tui_win_with_focus ();
51 /* Handle the CTRL-L refresh for each window. */
53 tui_refresh_all_win ();
55 /* If the command window has the logical focus, or no-one does
56 assume it is the command window; in this case, pass the character
57 on through and do nothing here. */
58 if (win_info
== NULL
|| win_info
== TUI_CMD_WIN
)
62 unsigned int c
= 0, ch_copy
= ch
;
66 /* If this is an xterm, page next/prev keys aren't returned by
67 keypad as a single char, so we must handle them here. Seems
68 like a bug in the curses library? */
69 term
= (char *) getenv ("TERM");
72 for (i
= 0; term
[i
]; i
++)
73 term
[i
] = toupper (term
[i
]);
74 if ((strcmp (term
, "XTERM") == 0)
75 && key_is_start_sequence (ch
))
77 unsigned int page_ch
= 0;
78 unsigned int tmp_char
;
79 WINDOW
*w
= TUI_CMD_WIN
->generic
.handle
;
82 while (!key_is_end_sequence (tmp_char
))
84 tmp_char
= (int) wgetch (w
);
93 else if (tmp_char
== 54)
107 tui_scroll_forward (win_info
, 0);
110 tui_scroll_backward (win_info
, 0);
114 tui_scroll_forward (win_info
, 1);
118 tui_scroll_backward (win_info
, 1);
121 tui_scroll_left (win_info
, 1);
124 tui_scroll_right (win_info
, 1);
This page took 0.032392 seconds and 4 git commands to generate.