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 ()
47 /* Function to delete the curses window, checking for NULL. */
49 tui_delete_win (WINDOW
*window
)
56 /* Draw a border arround the window. */
58 box_win (struct tui_gen_win_info
*win_info
,
61 if (win_info
&& win_info
->handle
)
66 win
= win_info
->handle
;
67 if (highlight_flag
== HILITE
)
68 attrs
= tui_active_border_attrs
;
70 attrs
= tui_border_attrs
;
74 wborder (win
, tui_border_vline
, tui_border_vline
,
75 tui_border_hline
, tui_border_hline
,
76 tui_border_ulcorner
, tui_border_urcorner
,
77 tui_border_llcorner
, tui_border_lrcorner
);
79 box (win
, tui_border_vline
, tui_border_hline
);
82 mvwaddstr (win
, 0, 3, win_info
->title
);
83 wattroff (win
, attrs
);
89 tui_unhighlight_win (struct tui_win_info
*win_info
)
92 && win_info
->can_highlight
93 && win_info
->handle
!= NULL
)
95 box_win (win_info
, NO_HILITE
);
96 win_info
->refresh_window ();
97 win_info
->set_highlight (false);
103 tui_highlight_win (struct tui_win_info
*win_info
)
106 && win_info
->can_highlight
107 && win_info
->handle
!= NULL
)
109 box_win (win_info
, HILITE
);
110 win_info
->refresh_window ();
111 win_info
->set_highlight (true);
116 tui_win_info::check_and_display_highlight_if_needed ()
121 tui_highlight_win (this);
123 tui_unhighlight_win (this);
129 tui_make_window (struct tui_gen_win_info
*win_info
)
133 handle
= newwin (win_info
->height
,
137 win_info
->handle
= handle
;
140 if (win_info
->can_box ())
141 box_win (win_info
, NO_HILITE
);
142 win_info
->is_visible
= true;
143 scrollok (handle
, TRUE
);
148 /* We can't really make windows visible, or invisible. So we have to
149 delete the entire window when making it visible, and create it
150 again when making it visible. */
152 tui_gen_win_info::make_visible (bool visible
)
154 if (is_visible
== visible
)
156 is_visible
= visible
;
159 tui_make_window (this);
162 tui_delete_win (handle
);
167 /* See tui-wingeneral.h. */
170 tui_make_all_invisible (void)
172 for (tui_win_info
*win_info
: all_tui_windows ())
173 win_info
->make_visible (false);
176 /* Function to refresh all the windows currently displayed. */
181 struct tui_locator_window
*locator
= tui_locator_win_info_ptr ();
183 for (tui_win_info
*win_info
: all_tui_windows ())
185 if (win_info
->is_visible
)
186 win_info
->refresh_window ();
188 if (locator
->is_visible
)
189 locator
->refresh_window ();
193 /*********************************
194 ** Local Static Functions
195 *********************************/
This page took 0.033233 seconds and 4 git commands to generate.