1 /* General window behavior.
3 Copyright (C) 1998-2019 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/>. */
24 #include "tui/tui-data.h"
25 #include "tui/tui-wingeneral.h"
26 #include "tui/tui-win.h"
27 #include "tui/tui-stack.h"
29 #include "gdb_curses.h"
31 /***********************
33 ***********************/
38 tui_gen_win_info::refresh_window ()
44 /* Function to delete the curses window, checking for NULL. */
46 tui_delete_win (WINDOW
*window
)
53 /* Draw a border arround the window. */
55 box_win (struct tui_win_info
*win_info
,
61 win
= win_info
->handle
;
63 attrs
= tui_active_border_attrs
;
65 attrs
= tui_border_attrs
;
69 wborder (win
, tui_border_vline
, tui_border_vline
,
70 tui_border_hline
, tui_border_hline
,
71 tui_border_ulcorner
, tui_border_urcorner
,
72 tui_border_llcorner
, tui_border_lrcorner
);
74 box (win
, tui_border_vline
, tui_border_hline
);
76 if (!win_info
->title
.empty ())
77 mvwaddstr (win
, 0, 3, win_info
->title
.c_str ());
78 wattroff (win
, attrs
);
83 tui_unhighlight_win (struct tui_win_info
*win_info
)
86 && win_info
->can_highlight
87 && win_info
->handle
!= NULL
)
89 box_win (win_info
, false);
90 win_info
->refresh_window ();
91 win_info
->set_highlight (false);
97 tui_highlight_win (struct tui_win_info
*win_info
)
100 && win_info
->can_highlight
101 && win_info
->handle
!= NULL
)
103 box_win (win_info
, true);
104 win_info
->refresh_window ();
105 win_info
->set_highlight (true);
110 tui_win_info::check_and_display_highlight_if_needed ()
115 tui_highlight_win (this);
117 tui_unhighlight_win (this);
123 tui_gen_win_info::make_window ()
125 handle
= newwin (height
, width
, origin
.y
, origin
.x
);
127 scrollok (handle
, TRUE
);
131 tui_win_info::make_window ()
133 tui_gen_win_info::make_window ();
134 if (handle
!= NULL
&& can_box ())
135 box_win (this, false);
138 /* We can't really make windows visible, or invisible. So we have to
139 delete the entire window when making it visible, and create it
140 again when making it visible. */
142 tui_gen_win_info::make_visible (bool visible
)
144 if (is_visible () == visible
)
151 tui_delete_win (handle
);
156 /* See tui-wingeneral.h. */
159 tui_make_all_invisible (void)
161 for (tui_win_info
*win_info
: all_tui_windows ())
162 win_info
->make_visible (false);
165 /* Function to refresh all the windows currently displayed. */
170 struct tui_locator_window
*locator
= tui_locator_win_info_ptr ();
172 for (tui_win_info
*win_info
: all_tui_windows ())
174 if (win_info
->is_visible ())
175 win_info
->refresh_window ();
177 if (locator
->is_visible ())
178 locator
->refresh_window ();
182 /*********************************
183 ** Local Static Functions
184 *********************************/
This page took 0.098274 seconds and 5 git commands to generate.