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"
28 #include "gdb_curses.h"
30 /***********************
32 ***********************/
37 tui_gen_win_info::refresh_window ()
49 tui_data_window::refresh_window ()
51 if (!regs_content
.empty ())
53 for (auto &&win
: regs_content
)
56 win
->refresh_window ();
59 tui_gen_win_info::refresh_window ();
62 /* Function to delete the curses window, checking for NULL. */
64 tui_delete_win (WINDOW
*window
)
71 /* Draw a border arround the window. */
73 box_win (struct tui_gen_win_info
*win_info
,
76 if (win_info
&& win_info
->handle
)
81 win
= win_info
->handle
;
82 if (highlight_flag
== HILITE
)
83 attrs
= tui_active_border_attrs
;
85 attrs
= tui_border_attrs
;
89 wborder (win
, tui_border_vline
, tui_border_vline
,
90 tui_border_hline
, tui_border_hline
,
91 tui_border_ulcorner
, tui_border_urcorner
,
92 tui_border_llcorner
, tui_border_lrcorner
);
94 box (win
, tui_border_vline
, tui_border_hline
);
97 mvwaddstr (win
, 0, 3, win_info
->title
);
98 wattroff (win
, attrs
);
104 tui_unhighlight_win (struct tui_win_info
*win_info
)
107 && win_info
->can_highlight
108 && win_info
->handle
!= NULL
)
110 box_win (win_info
, NO_HILITE
);
111 wrefresh (win_info
->handle
);
112 win_info
->set_highlight (false);
118 tui_highlight_win (struct tui_win_info
*win_info
)
121 && win_info
->can_highlight
122 && win_info
->handle
!= NULL
)
124 box_win (win_info
, HILITE
);
125 wrefresh (win_info
->handle
);
126 win_info
->set_highlight (true);
131 tui_check_and_display_highlight_if_needed (struct tui_win_info
*win_info
)
133 if (win_info
!= NULL
&& win_info
->can_highlight
)
135 if (win_info
->is_highlighted
)
136 tui_highlight_win (win_info
);
138 tui_unhighlight_win (win_info
);
146 tui_make_window (struct tui_gen_win_info
*win_info
, enum tui_box box_it
)
150 handle
= newwin (win_info
->height
,
154 win_info
->handle
= handle
;
157 if (box_it
== BOX_WINDOW
)
158 box_win (win_info
, NO_HILITE
);
159 win_info
->is_visible
= true;
160 scrollok (handle
, TRUE
);
165 /* We can't really make windows visible, or invisible. So we have to
166 delete the entire window when making it visible, and create it
167 again when making it visible. */
169 tui_gen_win_info::make_visible (bool visible
)
175 tui_make_window (this, (tui_win_is_auxiliary (type
)
176 ? DONT_BOX_WINDOW
: BOX_WINDOW
));
185 tui_delete_win (handle
);
191 tui_make_visible (struct tui_gen_win_info
*win_info
)
193 win_info
->make_visible (true);
197 tui_make_invisible (struct tui_gen_win_info
*win_info
)
199 win_info
->make_visible (false);
202 /* See tui-data.h. */
205 tui_source_window_base::make_visible (bool visible
)
207 if (execution_info
!= nullptr)
208 execution_info
->make_visible (visible
);
209 tui_win_info::make_visible (visible
);
212 /* Makes all windows invisible (except the command and locator
215 make_all_visible (bool visible
)
217 for (tui_win_info
*win_info
: all_tui_windows ())
218 win_info
->make_visible (visible
);
222 tui_make_all_visible (void)
224 make_all_visible (true);
228 tui_make_all_invisible (void)
230 make_all_visible (false);
233 /* See tui-data.h. */
236 tui_source_window_base::refresh_window ()
238 execution_info
->refresh_window ();
239 tui_win_info::refresh_window ();
242 /* Function to refresh all the windows currently displayed. */
247 struct tui_locator_window
*locator
= tui_locator_win_info_ptr ();
249 for (tui_win_info
*win_info
: all_tui_windows ())
251 if (win_info
->is_visible
)
252 win_info
->refresh_window ();
254 if (locator
->is_visible
)
255 locator
->refresh_window ();
259 /*********************************
260 ** Local Static Functions
261 *********************************/
This page took 0.055437 seconds and 5 git commands to generate.