4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
22 /* Copyright (c) 1988 AT&T */
23 /* All Rights Reserved */
27 * Copyright (c) 1997, by Sun Microsystems, Inc.
28 * All rights reserved.
31 /* A panels subsystem built on curses--Delete panel routines */
33 #pragma ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.3 */
37 #include <sys/types.h>
42 /* hide_panel - Unlink a panel from the pile and remove it from the screen. */
44 hide_panel(PANEL
*panel
)
49 /* It is ok to hide a panel that is already hidden. */
51 if (panel
== panel
-> below
)
56 _remove_overlap(panel
);
57 if (panel
== _Bottom_panel
)
58 _Bottom_panel
= panel
-> above
;
60 panel
-> below
-> above
= panel
-> above
;
62 if (panel
== _Top_panel
)
63 _Top_panel
= panel
-> below
;
65 panel
-> above
-> below
= panel
-> below
;
68 panel
-> below
= panel
;
73 * del_panel - Delete a panel from the pile
74 * and free all memory associated with it.
77 del_panel(PANEL
*panel
)
79 return ((hide_panel(panel
) == OK
) ? free(panel
), OK
: ERR
);
84 * Remove all references to a panel from the obscured lists of all panels.
85 * Also remove all obscured nodes from the given panel. This routine
86 * touches the appropriate places to ensure that everybody is properly
90 _remove_overlap(PANEL
*panel
)
94 _obscured_list
*prev_obs
;
96 /* Make sure that the background gets updated */
98 (void) touchline(stdscr
, panel
->wstarty
,
99 panel
->wendy
- panel
->wstarty
+ 1);
101 /* Remove all references to the panel from the remaining panels */
103 for (pnl
= _Bottom_panel
; pnl
!= panel
; pnl
= pnl
->above
) {
104 if (obs
= _unlink_obs(pnl
, panel
))
108 /* delete the obscured list from the panel */
110 if ((obs
= panel
-> obscured
) != 0) {
114 _free_overlap(prev_obs
);
116 while (obs
!= panel
-> obscured
);
117 panel
-> obscured
= 0;