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--create a new panel */
33 #pragma ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.3 */
37 #include <sys/types.h>
42 /* add_top - Put a new or hidden panel on top of the pile */
48 _Bottom_panel
= panel
;
50 _Top_panel
-> above
= panel
;
51 panel
-> below
= _Top_panel
;
56 panel
-> obscured
= 0;
59 /* Determine which panels the new panel obscures */
61 _intersect_panel(panel
);
66 new_panel(WINDOW
*window
)
73 if (!window
|| !_alloc_overlap(_Panel_cnt
) ||
74 !(panel
= (PANEL
*) malloc(sizeof (PANEL
))))
77 panel
-> win
= window
;
78 getbegyx(window
, panel
-> wstarty
, panel
-> wstartx
);
79 getmaxyx(window
, lines
, cols
);
80 panel
-> wendy
= panel
->wstarty
+ lines
- 1;
81 panel
-> wendx
= panel
->wstartx
+ cols
- 1;
84 /* put the new panel on top of the pile */
92 show_panel(PANEL
*panel
)
94 /* Allocate the obscured nodes for the new panel */
96 if (!panel
|| panel
!= panel
-> below
|| !_alloc_overlap(_Panel_cnt
))
99 /* put the new panel on top of the pile */
102 (void) touchwin(panel
-> win
);