98eb5abde16a0c8720930faaeb3ab1c98cd9d008
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 ()
46 tui_data_window::refresh_window ()
50 for (int i
= 0; i
< content_size
; i
++)
52 struct tui_gen_win_info
*data_item_win_ptr
;
54 data_item_win_ptr
= content
[i
]->which_element
.data_window
;
55 if (data_item_win_ptr
!= NULL
56 && data_item_win_ptr
->handle
!= NULL
)
57 wrefresh (data_item_win_ptr
->handle
);
61 tui_gen_win_info::refresh_window ();
64 /* Function to delete the curses window, checking for NULL. */
66 tui_delete_win (WINDOW
*window
)
75 /* Draw a border arround the window. */
77 box_win (struct tui_gen_win_info
*win_info
,
80 if (win_info
&& win_info
->handle
)
85 win
= win_info
->handle
;
86 if (highlight_flag
== HILITE
)
87 attrs
= tui_active_border_attrs
;
89 attrs
= tui_border_attrs
;
93 wborder (win
, tui_border_vline
, tui_border_vline
,
94 tui_border_hline
, tui_border_hline
,
95 tui_border_ulcorner
, tui_border_urcorner
,
96 tui_border_llcorner
, tui_border_lrcorner
);
98 box (win
, tui_border_vline
, tui_border_hline
);
101 mvwaddstr (win
, 0, 3, win_info
->title
);
102 wattroff (win
, attrs
);
108 tui_unhighlight_win (struct tui_win_info
*win_info
)
111 && win_info
->can_highlight
112 && win_info
->handle
!= NULL
)
114 box_win (win_info
, NO_HILITE
);
115 wrefresh (win_info
->handle
);
116 win_info
->set_highlight (false);
122 tui_highlight_win (struct tui_win_info
*win_info
)
125 && win_info
->can_highlight
126 && win_info
->handle
!= NULL
)
128 box_win (win_info
, HILITE
);
129 wrefresh (win_info
->handle
);
130 win_info
->set_highlight (true);
135 tui_check_and_display_highlight_if_needed (struct tui_win_info
*win_info
)
137 if (win_info
!= NULL
&& win_info
->type
!= CMD_WIN
)
139 if (win_info
->is_highlighted
)
140 tui_highlight_win (win_info
);
142 tui_unhighlight_win (win_info
);
150 tui_make_window (struct tui_gen_win_info
*win_info
, enum tui_box box_it
)
154 handle
= newwin (win_info
->height
,
158 win_info
->handle
= handle
;
161 if (box_it
== BOX_WINDOW
)
162 box_win (win_info
, NO_HILITE
);
163 win_info
->is_visible
= true;
164 scrollok (handle
, TRUE
);
169 /* We can't really make windows visible, or invisible. So we have to
170 delete the entire window when making it visible, and create it
171 again when making it visible. */
173 tui_gen_win_info::make_visible (bool visible
)
179 tui_make_window (this, (tui_win_is_auxillary (type
)
180 ? DONT_BOX_WINDOW
: BOX_WINDOW
));
189 tui_delete_win (handle
);
195 tui_make_visible (struct tui_gen_win_info
*win_info
)
197 win_info
->make_visible (true);
201 tui_make_invisible (struct tui_gen_win_info
*win_info
)
203 win_info
->make_visible (false);
206 /* See tui-data.h. */
209 tui_source_window_base::make_visible (bool visible
)
211 if (execution_info
!= nullptr)
212 execution_info
->make_visible (visible
);
213 tui_win_info::make_visible (visible
);
216 /* Makes all windows invisible (except the command and locator
219 make_all_visible (bool visible
)
223 for (i
= 0; i
< MAX_MAJOR_WINDOWS
; i
++)
225 if (tui_win_list
[i
] != NULL
)
226 tui_win_list
[i
]->make_visible (visible
);
233 tui_make_all_visible (void)
235 make_all_visible (true);
239 tui_make_all_invisible (void)
241 make_all_visible (false);
244 /* See tui-data.h. */
247 tui_win_info::refresh ()
253 /* See tui-data.h. */
256 tui_source_window_base::refresh ()
258 touchwin (execution_info
->handle
);
259 execution_info
->refresh_window ();
260 tui_win_info::refresh ();
263 /* Function to refresh all the windows currently displayed. */
266 tui_refresh_all (struct tui_win_info
**list
)
269 struct tui_gen_win_info
*locator
= tui_locator_win_info_ptr ();
271 for (type
= SRC_WIN
; (type
< MAX_MAJOR_WINDOWS
); type
++)
273 if (list
[type
] && list
[type
]->is_visible
)
274 list
[type
]->refresh ();
276 if (locator
->is_visible
)
278 touchwin (locator
->handle
);
279 locator
->refresh_window ();
284 /*********************************
285 ** Local Static Functions
286 *********************************/
This page took 0.03752 seconds and 3 git commands to generate.