aboutsummaryrefslogtreecommitdiff
path: root/panel
diff options
context:
space:
mode:
authorRong-En Fan <rafan@FreeBSD.org>2008-11-09 09:06:04 +0000
committerRong-En Fan <rafan@FreeBSD.org>2008-11-09 09:06:04 +0000
commita388f199193767bacbb38b172ab89cb84369736c (patch)
treea1816f5667d2280b970ca44e407bac8cc4496c0a /panel
parentaa59d4d4c5dda7e1c6f9dc0cc6edc58992a525c7 (diff)
downloadsrc-a388f199193767bacbb38b172ab89cb84369736c.tar.gz
src-a388f199193767bacbb38b172ab89cb84369736c.zip
- Flatten the vendor area
Notes
Notes: svn path=/vendor/ncurses/dist/; revision=184786
Diffstat (limited to 'panel')
-rw-r--r--panel/Makefile.in159
-rw-r--r--panel/headers32
-rw-r--r--panel/llib-lpanel182
-rw-r--r--panel/llib-lpanelw182
-rw-r--r--panel/modules51
-rw-r--r--panel/p_above.c52
-rw-r--r--panel/p_below.c54
-rw-r--r--panel/p_bottom.c72
-rw-r--r--panel/p_delete.c57
-rw-r--r--panel/p_hidden.c48
-rw-r--r--panel/p_hide.c58
-rw-r--r--panel/p_move.c56
-rw-r--r--panel/p_new.c108
-rw-r--r--panel/p_replace.c58
-rw-r--r--panel/p_show.c69
-rw-r--r--panel/p_top.c46
-rw-r--r--panel/p_update.c63
-rw-r--r--panel/p_user.c56
-rw-r--r--panel/p_win.c46
-rw-r--r--panel/panel.c157
-rw-r--r--panel/panel.h77
-rw-r--r--panel/panel.priv.h191
22 files changed, 1874 insertions, 0 deletions
diff --git a/panel/Makefile.in b/panel/Makefile.in
new file mode 100644
index 000000000000..89dbeeac9009
--- /dev/null
+++ b/panel/Makefile.in
@@ -0,0 +1,159 @@
+# $Id: Makefile.in,v 1.52 2007/04/28 14:56:11 tom Exp $
+##############################################################################
+# Copyright (c) 1998-2006,2007 Free Software Foundation, Inc. #
+# #
+# Permission is hereby granted, free of charge, to any person obtaining a #
+# copy of this software and associated documentation files (the "Software"), #
+# to deal in the Software without restriction, including without limitation #
+# the rights to use, copy, modify, merge, publish, distribute, distribute #
+# with modifications, sublicense, and/or sell copies of the Software, and to #
+# permit persons to whom the Software is furnished to do so, subject to the #
+# following conditions: #
+# #
+# The above copyright notice and this permission notice shall be included in #
+# all copies or substantial portions of the Software. #
+# #
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR #
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, #
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL #
+# THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER #
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING #
+# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER #
+# DEALINGS IN THE SOFTWARE. #
+# #
+# Except as contained in this notice, the name(s) of the above copyright #
+# holders shall not be used in advertising or otherwise to promote the sale, #
+# use or other dealings in this Software without prior written #
+# authorization. #
+##############################################################################
+#
+# Author: Thomas E. Dickey 1996-on
+#
+# Makefile for panels source code.
+#
+# This makes the following:
+# libraries (normal/debug/profile/shared)
+#
+# The variable 'srcdir' refers to the source-distribution, and can be set with
+# the configure script by "--srcdir=DIR".
+#
+# The rules are organized to produce the libraries for the configured models,
+
+# turn off _all_ suffix rules; we'll generate our own
+.SUFFIXES:
+
+SHELL = /bin/sh
+THIS = Makefile
+
+x = @EXEEXT@
+o = .@OBJEXT@
+
+MODEL = @DFT_LWR_MODEL@
+DESTDIR = @DESTDIR@
+srcdir = @srcdir@
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+bindir = @bindir@
+libdir = @libdir@
+includedir = @includedir@
+datadir = @datadir@
+
+LIBTOOL = @LIBTOOL@
+LIBTOOL_CLEAN = @LIB_CLEAN@
+LIBTOOL_COMPILE = @LIB_COMPILE@
+LIBTOOL_LINK = @LIB_LINK@
+LIBTOOL_INSTALL = @LIB_INSTALL@
+LIBTOOL_UNINSTALL = @LIB_UNINSTALL@
+
+INSTALL = @INSTALL@
+INSTALL_LIB = @INSTALL@ @INSTALL_LIB@
+INSTALL_PROG = @INSTALL_PROGRAM@
+INSTALL_DATA = @INSTALL_DATA@
+
+AR = @AR@
+AR_OPTS = @AR_OPTS@
+AWK = @AWK@
+LD = @LD@
+LN_S = @LN_S@
+
+CC = @CC@
+CPP = @CPP@
+CFLAGS = @CFLAGS@
+
+CPPFLAGS = -I@top_srcdir@/ncurses -DHAVE_CONFIG_H @CPPFLAGS@
+
+CCFLAGS = $(CPPFLAGS) $(CFLAGS)
+
+CFLAGS_LIBTOOL = $(CCFLAGS)
+CFLAGS_NORMAL = $(CCFLAGS)
+CFLAGS_DEBUG = $(CCFLAGS) @CC_G_OPT@ -DTRACE
+CFLAGS_PROFILE = $(CCFLAGS) -pg
+CFLAGS_SHARED = $(CCFLAGS) @CC_SHARED_OPTS@
+
+CFLAGS_DEFAULT = $(CFLAGS_@DFT_UPR_MODEL@)
+
+LINK = $(LIBTOOL_LINK)
+LDFLAGS = @LDFLAGS@ @LD_MODEL@ @LIBS@
+
+SHLIB_DIRS = -L../lib
+SHLIB_LIST = $(SHLIB_DIRS) -lncurses@LIB_SUFFIX@ @SHLIB_LIST@
+
+MK_SHARED_LIB = @MK_SHARED_LIB@
+
+NCURSES_MAJOR = @NCURSES_MAJOR@
+NCURSES_MINOR = @NCURSES_MINOR@
+REL_VERSION = @cf_cv_rel_version@
+ABI_VERSION = @cf_cv_abi_version@
+
+RANLIB = @LIB_PREP@
+
+LIBRARIES = @LIBS_TO_MAKE@
+
+LINT = @LINT@
+LINT_OPTS = @LINT_OPTS@
+LINT_LIBS = -lpanel -lncurses @LIBS@
+
+AUTO_SRC = \
+ ../include/panel.h
+
+################################################################################
+all \
+libs \
+install :: $(AUTO_SRC) $(LIBRARIES)
+
+sources: $(AUTO_SRC)
+
+$(DESTDIR)$(bindir) \
+$(DESTDIR)$(libdir) :
+ sh $(srcdir)/../mkdirs.sh $@
+
+# make a copy to simplify include-paths while still keeping panel's include
+# file in this directory.
+../include/panel.h : $(srcdir)/panel.h
+ -rm -f $@
+ cp $(srcdir)/panel.h $@
+
+PANEL_PRIV_H = \
+ $(srcdir)/panel.priv.h \
+ $(srcdir)/panel.h
+
+tags:
+ ctags *.[ch]
+
+@MAKE_UPPER_TAGS@TAGS:
+@MAKE_UPPER_TAGS@ etags *.[ch]
+
+mostlyclean ::
+ -rm -f core tags TAGS *~ *.bak *.i *.ln *.atac trace
+
+clean :: mostlyclean
+ -rm -f $(AUTO_SRC)
+
+distclean :: clean
+ -rm -f Makefile
+
+realclean :: distclean
+
+###############################################################################
+# The remainder of this file is automatically generated during configuration
+###############################################################################
diff --git a/panel/headers b/panel/headers
new file mode 100644
index 000000000000..8719ea15dc7b
--- /dev/null
+++ b/panel/headers
@@ -0,0 +1,32 @@
+##############################################################################
+# Copyright (c) 1998,2006 Free Software Foundation, Inc. #
+# #
+# Permission is hereby granted, free of charge, to any person obtaining a #
+# copy of this software and associated documentation files (the "Software"), #
+# to deal in the Software without restriction, including without limitation #
+# the rights to use, copy, modify, merge, publish, distribute, distribute #
+# with modifications, sublicense, and/or sell copies of the Software, and to #
+# permit persons to whom the Software is furnished to do so, subject to the #
+# following conditions: #
+# #
+# The above copyright notice and this permission notice shall be included in #
+# all copies or substantial portions of the Software. #
+# #
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR #
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, #
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL #
+# THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER #
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING #
+# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER #
+# DEALINGS IN THE SOFTWARE. #
+# #
+# Except as contained in this notice, the name(s) of the above copyright #
+# holders shall not be used in advertising or otherwise to promote the sale, #
+# use or other dealings in this Software without prior written #
+# authorization. #
+##############################################################################
+#
+# Author: Thomas E. Dickey <dickey@clark.net> 1996
+#
+$(srcdir)/panel.h
+# vile:makemode
diff --git a/panel/llib-lpanel b/panel/llib-lpanel
new file mode 100644
index 000000000000..de49c234ecaa
--- /dev/null
+++ b/panel/llib-lpanel
@@ -0,0 +1,182 @@
+/****************************************************************************
+ * Copyright (c) 1998-2002,2005 Free Software Foundation, Inc. *
+ * *
+ * Permission is hereby granted, free of charge, to any person obtaining a *
+ * copy of this software and associated documentation files (the *
+ * "Software"), to deal in the Software without restriction, including *
+ * without limitation the rights to use, copy, modify, merge, publish, *
+ * distribute, distribute with modifications, sublicense, and/or sell *
+ * copies of the Software, and to permit persons to whom the Software is *
+ * furnished to do so, subject to the following conditions: *
+ * *
+ * The above copyright notice and this permission notice shall be included *
+ * in all copies or substantial portions of the Software. *
+ * *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
+ * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
+ * THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
+ * *
+ * Except as contained in this notice, the name(s) of the above copyright *
+ * holders shall not be used in advertising or otherwise to promote the *
+ * sale, use or other dealings in this Software without prior written *
+ * authorization. *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Author: Thomas E. Dickey 1997,2002,2005 *
+ ****************************************************************************/
+/* LINTLIBRARY */
+
+/* ./panel.c */
+
+#include "panel.priv.h"
+
+#undef _nc_retrace_panel
+PANEL *_nc_retrace_panel(
+ PANEL *pan)
+ { return(*(PANEL **)0); }
+
+#undef _nc_my_visbuf
+const char *_nc_my_visbuf(
+ const void *ptr)
+ { return(*(const char **)0); }
+
+#undef _nc_dPanel
+void _nc_dPanel(
+ const char *text,
+ const PANEL *pan)
+ { /* void */ }
+
+#undef _nc_dStack
+void _nc_dStack(
+ const char *fmt,
+ int num,
+ const PANEL *pan)
+ { /* void */ }
+
+#undef _nc_Wnoutrefresh
+void _nc_Wnoutrefresh(
+ const PANEL *pan)
+ { /* void */ }
+
+#undef _nc_Touchpan
+void _nc_Touchpan(
+ const PANEL *pan)
+ { /* void */ }
+
+#undef _nc_Touchline
+void _nc_Touchline(
+ const PANEL *pan,
+ int start,
+ int count)
+ { /* void */ }
+
+/* ./p_above.c */
+
+#undef panel_above
+PANEL *panel_above(
+ const PANEL *pan)
+ { return(*(PANEL **)0); }
+
+/* ./p_below.c */
+
+#undef panel_below
+PANEL *panel_below(
+ const PANEL *pan)
+ { return(*(PANEL **)0); }
+
+/* ./p_bottom.c */
+
+#undef bottom_panel
+int bottom_panel(
+ PANEL *pan)
+ { return(*(int *)0); }
+
+/* ./p_delete.c */
+
+#undef del_panel
+int del_panel(
+ PANEL *pan)
+ { return(*(int *)0); }
+
+/* ./p_hide.c */
+
+#undef hide_panel
+int hide_panel(
+ PANEL *pan)
+ { return(*(int *)0); }
+
+/* ./p_hidden.c */
+
+#undef panel_hidden
+int panel_hidden(
+ const PANEL *pan)
+ { return(*(int *)0); }
+
+/* ./p_move.c */
+
+#undef move_panel
+int move_panel(
+ PANEL *pan,
+ int starty,
+ int startx)
+ { return(*(int *)0); }
+
+/* ./p_new.c */
+
+#undef new_panel
+PANEL *new_panel(
+ WINDOW *win)
+ { return(*(PANEL **)0); }
+
+/* ./p_replace.c */
+
+#undef replace_panel
+int replace_panel(
+ PANEL *pan,
+ WINDOW *win)
+ { return(*(int *)0); }
+
+/* ./p_show.c */
+
+#undef show_panel
+int show_panel(
+ PANEL *pan)
+ { return(*(int *)0); }
+
+/* ./p_top.c */
+
+#undef top_panel
+int top_panel(
+ PANEL *pan)
+ { return(*(int *)0); }
+
+/* ./p_update.c */
+
+#undef update_panels
+void update_panels(void)
+ { /* void */ }
+
+/* ./p_user.c */
+
+#undef set_panel_userptr
+int set_panel_userptr(
+ PANEL *pan,
+ void *uptr)
+ { return(*(int *)0); }
+
+#undef panel_userptr
+void *panel_userptr(
+ const PANEL *pan)
+ { return(*(void **)0); }
+
+/* ./p_win.c */
+
+#undef panel_window
+WINDOW *panel_window(
+ const PANEL *pan)
+ { return(*(WINDOW **)0); }
diff --git a/panel/llib-lpanelw b/panel/llib-lpanelw
new file mode 100644
index 000000000000..48bd1e0db5a7
--- /dev/null
+++ b/panel/llib-lpanelw
@@ -0,0 +1,182 @@
+/****************************************************************************
+ * Copyright (c) 2002,2005 Free Software Foundation, Inc. *
+ * *
+ * Permission is hereby granted, free of charge, to any person obtaining a *
+ * copy of this software and associated documentation files (the *
+ * "Software"), to deal in the Software without restriction, including *
+ * without limitation the rights to use, copy, modify, merge, publish, *
+ * distribute, distribute with modifications, sublicense, and/or sell *
+ * copies of the Software, and to permit persons to whom the Software is *
+ * furnished to do so, subject to the following conditions: *
+ * *
+ * The above copyright notice and this permission notice shall be included *
+ * in all copies or substantial portions of the Software. *
+ * *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
+ * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
+ * THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
+ * *
+ * Except as contained in this notice, the name(s) of the above copyright *
+ * holders shall not be used in advertising or otherwise to promote the *
+ * sale, use or other dealings in this Software without prior written *
+ * authorization. *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Author: Thomas E. Dickey 2002,2005 *
+ ****************************************************************************/
+/* LINTLIBRARY */
+
+/* ./panel.c */
+
+#include "panel.priv.h"
+
+#undef _nc_retrace_panel
+PANEL *_nc_retrace_panel(
+ PANEL *pan)
+ { return(*(PANEL **)0); }
+
+#undef _nc_my_visbuf
+const char *_nc_my_visbuf(
+ const void *ptr)
+ { return(*(const char **)0); }
+
+#undef _nc_dPanel
+void _nc_dPanel(
+ const char *text,
+ const PANEL *pan)
+ { /* void */ }
+
+#undef _nc_dStack
+void _nc_dStack(
+ const char *fmt,
+ int num,
+ const PANEL *pan)
+ { /* void */ }
+
+#undef _nc_Wnoutrefresh
+void _nc_Wnoutrefresh(
+ const PANEL *pan)
+ { /* void */ }
+
+#undef _nc_Touchpan
+void _nc_Touchpan(
+ const PANEL *pan)
+ { /* void */ }
+
+#undef _nc_Touchline
+void _nc_Touchline(
+ const PANEL *pan,
+ int start,
+ int count)
+ { /* void */ }
+
+/* ./p_above.c */
+
+#undef panel_above
+PANEL *panel_above(
+ const PANEL *pan)
+ { return(*(PANEL **)0); }
+
+/* ./p_below.c */
+
+#undef panel_below
+PANEL *panel_below(
+ const PANEL *pan)
+ { return(*(PANEL **)0); }
+
+/* ./p_bottom.c */
+
+#undef bottom_panel
+int bottom_panel(
+ PANEL *pan)
+ { return(*(int *)0); }
+
+/* ./p_delete.c */
+
+#undef del_panel
+int del_panel(
+ PANEL *pan)
+ { return(*(int *)0); }
+
+/* ./p_hide.c */
+
+#undef hide_panel
+int hide_panel(
+ PANEL *pan)
+ { return(*(int *)0); }
+
+/* ./p_hidden.c */
+
+#undef panel_hidden
+int panel_hidden(
+ const PANEL *pan)
+ { return(*(int *)0); }
+
+/* ./p_move.c */
+
+#undef move_panel
+int move_panel(
+ PANEL *pan,
+ int starty,
+ int startx)
+ { return(*(int *)0); }
+
+/* ./p_new.c */
+
+#undef new_panel
+PANEL *new_panel(
+ WINDOW *win)
+ { return(*(PANEL **)0); }
+
+/* ./p_replace.c */
+
+#undef replace_panel
+int replace_panel(
+ PANEL *pan,
+ WINDOW *win)
+ { return(*(int *)0); }
+
+/* ./p_show.c */
+
+#undef show_panel
+int show_panel(
+ PANEL *pan)
+ { return(*(int *)0); }
+
+/* ./p_top.c */
+
+#undef top_panel
+int top_panel(
+ PANEL *pan)
+ { return(*(int *)0); }
+
+/* ./p_update.c */
+
+#undef update_panels
+void update_panels(void)
+ { /* void */ }
+
+/* ./p_user.c */
+
+#undef set_panel_userptr
+int set_panel_userptr(
+ PANEL *pan,
+ void *uptr)
+ { return(*(int *)0); }
+
+#undef panel_userptr
+void *panel_userptr(
+ const PANEL *pan)
+ { return(*(void **)0); }
+
+/* ./p_win.c */
+
+#undef panel_window
+WINDOW *panel_window(
+ const PANEL *pan)
+ { return(*(WINDOW **)0); }
diff --git a/panel/modules b/panel/modules
new file mode 100644
index 000000000000..d0f7a796678f
--- /dev/null
+++ b/panel/modules
@@ -0,0 +1,51 @@
+# $Id: modules,v 1.9 2006/12/24 00:53:17 tom Exp $
+##############################################################################
+# Copyright (c) 1998,2006 Free Software Foundation, Inc. #
+# #
+# Permission is hereby granted, free of charge, to any person obtaining a #
+# copy of this software and associated documentation files (the "Software"), #
+# to deal in the Software without restriction, including without limitation #
+# the rights to use, copy, modify, merge, publish, distribute, distribute #
+# with modifications, sublicense, and/or sell copies of the Software, and to #
+# permit persons to whom the Software is furnished to do so, subject to the #
+# following conditions: #
+# #
+# The above copyright notice and this permission notice shall be included in #
+# all copies or substantial portions of the Software. #
+# #
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR #
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, #
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL #
+# THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER #
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING #
+# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER #
+# DEALINGS IN THE SOFTWARE. #
+# #
+# Except as contained in this notice, the name(s) of the above copyright #
+# holders shall not be used in advertising or otherwise to promote the sale, #
+# use or other dealings in this Software without prior written #
+# authorization. #
+##############################################################################
+#
+# Author: Thomas E. Dickey 1995-on
+#
+
+@ base
+# Library objects
+panel lib $(srcdir) $(PANEL_PRIV_H)
+p_above lib $(srcdir) $(PANEL_PRIV_H)
+p_below lib $(srcdir) $(PANEL_PRIV_H)
+p_bottom lib $(srcdir) $(PANEL_PRIV_H)
+p_delete lib $(srcdir) $(PANEL_PRIV_H)
+p_hide lib $(srcdir) $(PANEL_PRIV_H)
+p_hidden lib $(srcdir) $(PANEL_PRIV_H)
+p_move lib $(srcdir) $(PANEL_PRIV_H)
+p_new lib $(srcdir) $(PANEL_PRIV_H)
+p_replace lib $(srcdir) $(PANEL_PRIV_H)
+p_show lib $(srcdir) $(PANEL_PRIV_H)
+p_top lib $(srcdir) $(PANEL_PRIV_H)
+p_update lib $(srcdir) $(PANEL_PRIV_H)
+p_user lib $(srcdir) $(PANEL_PRIV_H)
+p_win lib $(srcdir) $(PANEL_PRIV_H)
+
+# vile:makemode
diff --git a/panel/p_above.c b/panel/p_above.c
new file mode 100644
index 000000000000..32495f627f2d
--- /dev/null
+++ b/panel/p_above.c
@@ -0,0 +1,52 @@
+/****************************************************************************
+ * Copyright (c) 1998-2000,2005 Free Software Foundation, Inc. *
+ * *
+ * Permission is hereby granted, free of charge, to any person obtaining a *
+ * copy of this software and associated documentation files (the *
+ * "Software"), to deal in the Software without restriction, including *
+ * without limitation the rights to use, copy, modify, merge, publish, *
+ * distribute, distribute with modifications, sublicense, and/or sell *
+ * copies of the Software, and to permit persons to whom the Software is *
+ * furnished to do so, subject to the following conditions: *
+ * *
+ * The above copyright notice and this permission notice shall be included *
+ * in all copies or substantial portions of the Software. *
+ * *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
+ * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
+ * THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
+ * *
+ * Except as contained in this notice, the name(s) of the above copyright *
+ * holders shall not be used in advertising or otherwise to promote the *
+ * sale, use or other dealings in this Software without prior written *
+ * authorization. *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1995 *
+ * and: Eric S. Raymond <esr@snark.thyrsus.com> *
+ ****************************************************************************/
+
+/* p_above.c
+ */
+#include "panel.priv.h"
+
+MODULE_ID("$Id: p_above.c,v 1.6 2005/02/19 16:44:57 tom Exp $")
+
+NCURSES_EXPORT(PANEL *)
+panel_above(const PANEL * pan)
+{
+ T((T_CALLED("panel_above(%p)"), pan));
+ if (!pan)
+ {
+ /* if top and bottom are equal, we have no or only the pseudo panel;
+ if not, we return the panel above the pseudo panel */
+ returnPanel(EMPTY_STACK()? (PANEL *) 0 : _nc_bottom_panel->above);
+ }
+ else
+ returnPanel(pan->above);
+}
diff --git a/panel/p_below.c b/panel/p_below.c
new file mode 100644
index 000000000000..c4b241015f5b
--- /dev/null
+++ b/panel/p_below.c
@@ -0,0 +1,54 @@
+/****************************************************************************
+ * Copyright (c) 1998-2000,2005 Free Software Foundation, Inc. *
+ * *
+ * Permission is hereby granted, free of charge, to any person obtaining a *
+ * copy of this software and associated documentation files (the *
+ * "Software"), to deal in the Software without restriction, including *
+ * without limitation the rights to use, copy, modify, merge, publish, *
+ * distribute, distribute with modifications, sublicense, and/or sell *
+ * copies of the Software, and to permit persons to whom the Software is *
+ * furnished to do so, subject to the following conditions: *
+ * *
+ * The above copyright notice and this permission notice shall be included *
+ * in all copies or substantial portions of the Software. *
+ * *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
+ * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
+ * THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
+ * *
+ * Except as contained in this notice, the name(s) of the above copyright *
+ * holders shall not be used in advertising or otherwise to promote the *
+ * sale, use or other dealings in this Software without prior written *
+ * authorization. *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1995 *
+ * and: Eric S. Raymond <esr@snark.thyrsus.com> *
+ ****************************************************************************/
+
+/* p_below.c
+ */
+#include "panel.priv.h"
+
+MODULE_ID("$Id: p_below.c,v 1.6 2005/02/19 16:45:10 tom Exp $")
+
+NCURSES_EXPORT(PANEL *)
+panel_below(const PANEL * pan)
+{
+ T((T_CALLED("panel_below(%p)"), pan));
+ if (!pan)
+ {
+ /* if top and bottom are equal, we have no or only the pseudo panel */
+ returnPanel(EMPTY_STACK()? (PANEL *) 0 : _nc_top_panel);
+ }
+ else
+ {
+ /* we must not return the pseudo panel */
+ returnPanel(Is_Pseudo(pan->below) ? (PANEL *) 0 : pan->below);
+ }
+}
diff --git a/panel/p_bottom.c b/panel/p_bottom.c
new file mode 100644
index 000000000000..b861fd9b2ce7
--- /dev/null
+++ b/panel/p_bottom.c
@@ -0,0 +1,72 @@
+/****************************************************************************
+ * Copyright (c) 1998-2000,2005 Free Software Foundation, Inc. *
+ * *
+ * Permission is hereby granted, free of charge, to any person obtaining a *
+ * copy of this software and associated documentation files (the *
+ * "Software"), to deal in the Software without restriction, including *
+ * without limitation the rights to use, copy, modify, merge, publish, *
+ * distribute, distribute with modifications, sublicense, and/or sell *
+ * copies of the Software, and to permit persons to whom the Software is *
+ * furnished to do so, subject to the following conditions: *
+ * *
+ * The above copyright notice and this permission notice shall be included *
+ * in all copies or substantial portions of the Software. *
+ * *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
+ * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
+ * THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
+ * *
+ * Except as contained in this notice, the name(s) of the above copyright *
+ * holders shall not be used in advertising or otherwise to promote the *
+ * sale, use or other dealings in this Software without prior written *
+ * authorization. *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1995 *
+ * and: Eric S. Raymond <esr@snark.thyrsus.com> *
+ ****************************************************************************/
+
+/* p_bottom.c
+ * Place a panel on bottom of the stack; may already be in the stack
+ */
+#include "panel.priv.h"
+
+MODULE_ID("$Id: p_bottom.c,v 1.11 2005/02/19 16:38:16 tom Exp $")
+
+NCURSES_EXPORT(int)
+bottom_panel(PANEL * pan)
+{
+ int err = OK;
+
+ T((T_CALLED("bottom_panel(%p)"), pan));
+ if (pan)
+ {
+ if (!Is_Bottom(pan))
+ {
+
+ dBug(("--> bottom_panel %s", USER_PTR(pan->user)));
+
+ HIDE_PANEL(pan, err, OK);
+ assert(_nc_bottom_panel == _nc_stdscr_pseudo_panel);
+
+ dStack("<lb%d>", 1, pan);
+
+ pan->below = _nc_bottom_panel;
+ pan->above = _nc_bottom_panel->above;
+ if (pan->above)
+ pan->above->below = pan;
+ _nc_bottom_panel->above = pan;
+
+ dStack("<lb%d>", 9, pan);
+ }
+ }
+ else
+ err = ERR;
+
+ returnCode(err);
+}
diff --git a/panel/p_delete.c b/panel/p_delete.c
new file mode 100644
index 000000000000..24ee26b4ff23
--- /dev/null
+++ b/panel/p_delete.c
@@ -0,0 +1,57 @@
+/****************************************************************************
+ * Copyright (c) 1998-2000,2005 Free Software Foundation, Inc. *
+ * *
+ * Permission is hereby granted, free of charge, to any person obtaining a *
+ * copy of this software and associated documentation files (the *
+ * "Software"), to deal in the Software without restriction, including *
+ * without limitation the rights to use, copy, modify, merge, publish, *
+ * distribute, distribute with modifications, sublicense, and/or sell *
+ * copies of the Software, and to permit persons to whom the Software is *
+ * furnished to do so, subject to the following conditions: *
+ * *
+ * The above copyright notice and this permission notice shall be included *
+ * in all copies or substantial portions of the Software. *
+ * *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
+ * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
+ * THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
+ * *
+ * Except as contained in this notice, the name(s) of the above copyright *
+ * holders shall not be used in advertising or otherwise to promote the *
+ * sale, use or other dealings in this Software without prior written *
+ * authorization. *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1995 *
+ * and: Eric S. Raymond <esr@snark.thyrsus.com> *
+ ****************************************************************************/
+
+/* p_delete.c
+ * Remove a panel from stack, if in it, and free struct
+ */
+#include "panel.priv.h"
+
+MODULE_ID("$Id: p_delete.c,v 1.8 2005/02/19 16:38:45 tom Exp $")
+
+NCURSES_EXPORT(int)
+del_panel(PANEL * pan)
+{
+ int err = OK;
+
+ T((T_CALLED("del_panel(%p)"), pan));
+ if (pan)
+ {
+ dBug(("--> del_panel %s", USER_PTR(pan->user)));
+ HIDE_PANEL(pan, err, OK);
+ free((void *)pan);
+ }
+ else
+ err = ERR;
+
+ returnCode(err);
+}
diff --git a/panel/p_hidden.c b/panel/p_hidden.c
new file mode 100644
index 000000000000..624c07dae0ba
--- /dev/null
+++ b/panel/p_hidden.c
@@ -0,0 +1,48 @@
+/****************************************************************************
+ * Copyright (c) 1998-2000,2005 Free Software Foundation, Inc. *
+ * *
+ * Permission is hereby granted, free of charge, to any person obtaining a *
+ * copy of this software and associated documentation files (the *
+ * "Software"), to deal in the Software without restriction, including *
+ * without limitation the rights to use, copy, modify, merge, publish, *
+ * distribute, distribute with modifications, sublicense, and/or sell *
+ * copies of the Software, and to permit persons to whom the Software is *
+ * furnished to do so, subject to the following conditions: *
+ * *
+ * The above copyright notice and this permission notice shall be included *
+ * in all copies or substantial portions of the Software. *
+ * *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
+ * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
+ * THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
+ * *
+ * Except as contained in this notice, the name(s) of the above copyright *
+ * holders shall not be used in advertising or otherwise to promote the *
+ * sale, use or other dealings in this Software without prior written *
+ * authorization. *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1995 *
+ * and: Eric S. Raymond <esr@snark.thyrsus.com> *
+ ****************************************************************************/
+
+/* p_hidden.c
+ * Test whether or not panel is hidden
+ */
+#include "panel.priv.h"
+
+MODULE_ID("$Id: p_hidden.c,v 1.7 2005/02/19 16:39:17 tom Exp $")
+
+NCURSES_EXPORT(int)
+panel_hidden(const PANEL * pan)
+{
+ T((T_CALLED("panel_hidden(%p)"), pan));
+ if (!pan)
+ returnCode(ERR);
+ returnCode(IS_LINKED(pan) ? FALSE : TRUE);
+}
diff --git a/panel/p_hide.c b/panel/p_hide.c
new file mode 100644
index 000000000000..08d8853a201c
--- /dev/null
+++ b/panel/p_hide.c
@@ -0,0 +1,58 @@
+/****************************************************************************
+ * Copyright (c) 1998-2000,2005 Free Software Foundation, Inc. *
+ * *
+ * Permission is hereby granted, free of charge, to any person obtaining a *
+ * copy of this software and associated documentation files (the *
+ * "Software"), to deal in the Software without restriction, including *
+ * without limitation the rights to use, copy, modify, merge, publish, *
+ * distribute, distribute with modifications, sublicense, and/or sell *
+ * copies of the Software, and to permit persons to whom the Software is *
+ * furnished to do so, subject to the following conditions: *
+ * *
+ * The above copyright notice and this permission notice shall be included *
+ * in all copies or substantial portions of the Software. *
+ * *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
+ * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
+ * THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
+ * *
+ * Except as contained in this notice, the name(s) of the above copyright *
+ * holders shall not be used in advertising or otherwise to promote the *
+ * sale, use or other dealings in this Software without prior written *
+ * authorization. *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1995 *
+ * and: Eric S. Raymond <esr@snark.thyrsus.com> *
+ ****************************************************************************/
+
+/* p_hide.c
+ * Remove a panel from the stack
+ */
+#include "panel.priv.h"
+
+MODULE_ID("$Id: p_hide.c,v 1.9 2005/02/19 16:39:41 tom Exp $")
+
+NCURSES_EXPORT(int)
+hide_panel(register PANEL * pan)
+{
+ int err = OK;
+
+ T((T_CALLED("hide_panel(%p)"), pan));
+ if (!pan)
+ returnCode(ERR);
+
+ dBug(("--> hide_panel %s", USER_PTR(pan->user)));
+ dStack("<u%d>", 1, pan);
+
+ HIDE_PANEL(pan, err, ERR);
+
+ dStack("<u%d>", 9, pan);
+
+ returnCode(err);
+}
diff --git a/panel/p_move.c b/panel/p_move.c
new file mode 100644
index 000000000000..3818e8cba860
--- /dev/null
+++ b/panel/p_move.c
@@ -0,0 +1,56 @@
+/****************************************************************************
+ * Copyright (c) 1998-2000,2005 Free Software Foundation, Inc. *
+ * *
+ * Permission is hereby granted, free of charge, to any person obtaining a *
+ * copy of this software and associated documentation files (the *
+ * "Software"), to deal in the Software without restriction, including *
+ * without limitation the rights to use, copy, modify, merge, publish, *
+ * distribute, distribute with modifications, sublicense, and/or sell *
+ * copies of the Software, and to permit persons to whom the Software is *
+ * furnished to do so, subject to the following conditions: *
+ * *
+ * The above copyright notice and this permission notice shall be included *
+ * in all copies or substantial portions of the Software. *
+ * *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
+ * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
+ * THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
+ * *
+ * Except as contained in this notice, the name(s) of the above copyright *
+ * holders shall not be used in advertising or otherwise to promote the *
+ * sale, use or other dealings in this Software without prior written *
+ * authorization. *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1995 *
+ * and: Eric S. Raymond <esr@snark.thyrsus.com> *
+ ****************************************************************************/
+
+/* p_move.c
+ * Move a panel to a new location
+ */
+#include "panel.priv.h"
+
+MODULE_ID("$Id: p_move.c,v 1.9 2005/02/19 16:46:49 tom Exp $")
+
+NCURSES_EXPORT(int)
+move_panel(PANEL * pan, int starty, int startx)
+{
+ T((T_CALLED("move_panel(%p,%d,%d)"), pan, starty, startx));
+
+ if (!pan)
+ returnCode(ERR);
+
+ if (IS_LINKED(pan))
+ {
+ Touchpan(pan);
+ PANEL_UPDATE(pan, (PANEL *) 0);
+ }
+
+ returnCode(mvwin(pan->win, starty, startx));
+}
diff --git a/panel/p_new.c b/panel/p_new.c
new file mode 100644
index 000000000000..3e48e3696735
--- /dev/null
+++ b/panel/p_new.c
@@ -0,0 +1,108 @@
+/****************************************************************************
+ * Copyright (c) 1998-2000,2005 Free Software Foundation, Inc. *
+ * *
+ * Permission is hereby granted, free of charge, to any person obtaining a *
+ * copy of this software and associated documentation files (the *
+ * "Software"), to deal in the Software without restriction, including *
+ * without limitation the rights to use, copy, modify, merge, publish, *
+ * distribute, distribute with modifications, sublicense, and/or sell *
+ * copies of the Software, and to permit persons to whom the Software is *
+ * furnished to do so, subject to the following conditions: *
+ * *
+ * The above copyright notice and this permission notice shall be included *
+ * in all copies or substantial portions of the Software. *
+ * *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
+ * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
+ * THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
+ * *
+ * Except as contained in this notice, the name(s) of the above copyright *
+ * holders shall not be used in advertising or otherwise to promote the *
+ * sale, use or other dealings in this Software without prior written *
+ * authorization. *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1995 *
+ * and: Eric S. Raymond <esr@snark.thyrsus.com> *
+ ****************************************************************************/
+
+/* p_new.c
+ * Creation of a new panel
+ */
+#include "panel.priv.h"
+
+MODULE_ID("$Id: p_new.c,v 1.8 2005/02/19 16:41:03 tom Exp $")
+
+#ifdef TRACE
+static char *stdscr_id;
+static char *new_id;
+#endif
+
+/*+-------------------------------------------------------------------------
+ Get root (i.e. stdscr's) panel.
+ Establish the pseudo panel for stdscr if necessary.
+--------------------------------------------------------------------------*/
+static PANEL *
+root_panel(void)
+{
+ if (_nc_stdscr_pseudo_panel == (PANEL *) 0)
+ {
+
+ assert(stdscr && !_nc_bottom_panel && !_nc_top_panel);
+ _nc_stdscr_pseudo_panel = (PANEL *) malloc(sizeof(PANEL));
+ if (_nc_stdscr_pseudo_panel != 0)
+ {
+ PANEL *pan = _nc_stdscr_pseudo_panel;
+ WINDOW *win = stdscr;
+
+ pan->win = win;
+ pan->below = (PANEL *) 0;
+ pan->above = (PANEL *) 0;
+#ifdef TRACE
+ if (!stdscr_id)
+ stdscr_id = strdup("stdscr");
+ pan->user = stdscr_id;
+#else
+ pan->user = (void *)0;
+#endif
+ _nc_bottom_panel = _nc_top_panel = pan;
+ }
+ }
+ return _nc_stdscr_pseudo_panel;
+}
+
+NCURSES_EXPORT(PANEL *)
+new_panel(WINDOW *win)
+{
+ PANEL *pan = (PANEL *) 0;
+
+ T((T_CALLED("new_panel(%p)"), win));
+
+ if (!win)
+ returnPanel(pan);
+
+ if (!_nc_stdscr_pseudo_panel)
+ (void)root_panel();
+ assert(_nc_stdscr_pseudo_panel);
+
+ if (!(win->_flags & _ISPAD) && (pan = (PANEL *) malloc(sizeof(PANEL))))
+ {
+ pan->win = win;
+ pan->above = (PANEL *) 0;
+ pan->below = (PANEL *) 0;
+#ifdef TRACE
+ if (!new_id)
+ new_id = strdup("new");
+ pan->user = new_id;
+#else
+ pan->user = (char *)0;
+#endif
+ (void)show_panel(pan);
+ }
+ returnPanel(pan);
+}
diff --git a/panel/p_replace.c b/panel/p_replace.c
new file mode 100644
index 000000000000..5d0d295c8b17
--- /dev/null
+++ b/panel/p_replace.c
@@ -0,0 +1,58 @@
+/****************************************************************************
+ * Copyright (c) 1998-2000,2005 Free Software Foundation, Inc. *
+ * *
+ * Permission is hereby granted, free of charge, to any person obtaining a *
+ * copy of this software and associated documentation files (the *
+ * "Software"), to deal in the Software without restriction, including *
+ * without limitation the rights to use, copy, modify, merge, publish, *
+ * distribute, distribute with modifications, sublicense, and/or sell *
+ * copies of the Software, and to permit persons to whom the Software is *
+ * furnished to do so, subject to the following conditions: *
+ * *
+ * The above copyright notice and this permission notice shall be included *
+ * in all copies or substantial portions of the Software. *
+ * *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
+ * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
+ * THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
+ * *
+ * Except as contained in this notice, the name(s) of the above copyright *
+ * holders shall not be used in advertising or otherwise to promote the *
+ * sale, use or other dealings in this Software without prior written *
+ * authorization. *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1995 *
+ * and: Eric S. Raymond <esr@snark.thyrsus.com> *
+ ****************************************************************************/
+
+/* p_replace.c
+ * Replace a panels window.
+ */
+#include "panel.priv.h"
+
+MODULE_ID("$Id: p_replace.c,v 1.9 2005/02/19 16:41:31 tom Exp $")
+
+NCURSES_EXPORT(int)
+replace_panel(PANEL * pan, WINDOW *win)
+{
+ T((T_CALLED("replace_panel(%p,%p)"), pan, win));
+
+ if (!pan)
+ returnCode(ERR);
+
+ if (IS_LINKED(pan))
+ {
+ Touchpan(pan);
+ PANEL_UPDATE(pan, (PANEL *) 0);
+ }
+
+ pan->win = win;
+
+ returnCode(OK);
+}
diff --git a/panel/p_show.c b/panel/p_show.c
new file mode 100644
index 000000000000..35eee237b958
--- /dev/null
+++ b/panel/p_show.c
@@ -0,0 +1,69 @@
+/****************************************************************************
+ * Copyright (c) 1998-2000,2005 Free Software Foundation, Inc. *
+ * *
+ * Permission is hereby granted, free of charge, to any person obtaining a *
+ * copy of this software and associated documentation files (the *
+ * "Software"), to deal in the Software without restriction, including *
+ * without limitation the rights to use, copy, modify, merge, publish, *
+ * distribute, distribute with modifications, sublicense, and/or sell *
+ * copies of the Software, and to permit persons to whom the Software is *
+ * furnished to do so, subject to the following conditions: *
+ * *
+ * The above copyright notice and this permission notice shall be included *
+ * in all copies or substantial portions of the Software. *
+ * *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
+ * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
+ * THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
+ * *
+ * Except as contained in this notice, the name(s) of the above copyright *
+ * holders shall not be used in advertising or otherwise to promote the *
+ * sale, use or other dealings in this Software without prior written *
+ * authorization. *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1995 *
+ * and: Eric S. Raymond <esr@snark.thyrsus.com> *
+ ****************************************************************************/
+
+/* p_show.c
+ * Place a panel on top of the stack; may already be in the stack
+ */
+#include "panel.priv.h"
+
+MODULE_ID("$Id: p_show.c,v 1.11 2005/02/19 16:42:02 tom Exp $")
+
+NCURSES_EXPORT(int)
+show_panel(PANEL * pan)
+{
+ int err = OK;
+
+ T((T_CALLED("show_panel(%p)"), pan));
+
+ if (!pan)
+ returnCode(ERR);
+
+ if (Is_Top(pan))
+ returnCode(OK);
+
+ dBug(("--> show_panel %s", USER_PTR(pan->user)));
+
+ HIDE_PANEL(pan, err, OK);
+
+ dStack("<lt%d>", 1, pan);
+ assert(_nc_bottom_panel == _nc_stdscr_pseudo_panel);
+
+ _nc_top_panel->above = pan;
+ pan->below = _nc_top_panel;
+ pan->above = (PANEL *) 0;
+ _nc_top_panel = pan;
+
+ dStack("<lt%d>", 9, pan);
+
+ returnCode(OK);
+}
diff --git a/panel/p_top.c b/panel/p_top.c
new file mode 100644
index 000000000000..8bd1d9fb3fec
--- /dev/null
+++ b/panel/p_top.c
@@ -0,0 +1,46 @@
+/****************************************************************************
+ * Copyright (c) 1998-2000,2005 Free Software Foundation, Inc. *
+ * *
+ * Permission is hereby granted, free of charge, to any person obtaining a *
+ * copy of this software and associated documentation files (the *
+ * "Software"), to deal in the Software without restriction, including *
+ * without limitation the rights to use, copy, modify, merge, publish, *
+ * distribute, distribute with modifications, sublicense, and/or sell *
+ * copies of the Software, and to permit persons to whom the Software is *
+ * furnished to do so, subject to the following conditions: *
+ * *
+ * The above copyright notice and this permission notice shall be included *
+ * in all copies or substantial portions of the Software. *
+ * *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
+ * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
+ * THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
+ * *
+ * Except as contained in this notice, the name(s) of the above copyright *
+ * holders shall not be used in advertising or otherwise to promote the *
+ * sale, use or other dealings in this Software without prior written *
+ * authorization. *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1995 *
+ * and: Eric S. Raymond <esr@snark.thyrsus.com> *
+ ****************************************************************************/
+
+/* p_top.c
+ * Place a panel on top of the stack.
+ */
+#include "panel.priv.h"
+
+MODULE_ID("$Id: p_top.c,v 1.5 2005/02/19 16:42:23 tom Exp $")
+
+NCURSES_EXPORT(int)
+top_panel(PANEL * pan)
+{
+ T((T_CALLED("top_panel(%p)"), pan));
+ returnCode(show_panel(pan));
+}
diff --git a/panel/p_update.c b/panel/p_update.c
new file mode 100644
index 000000000000..5967718160ff
--- /dev/null
+++ b/panel/p_update.c
@@ -0,0 +1,63 @@
+/****************************************************************************
+ * Copyright (c) 1998-2000,2005 Free Software Foundation, Inc. *
+ * *
+ * Permission is hereby granted, free of charge, to any person obtaining a *
+ * copy of this software and associated documentation files (the *
+ * "Software"), to deal in the Software without restriction, including *
+ * without limitation the rights to use, copy, modify, merge, publish, *
+ * distribute, distribute with modifications, sublicense, and/or sell *
+ * copies of the Software, and to permit persons to whom the Software is *
+ * furnished to do so, subject to the following conditions: *
+ * *
+ * The above copyright notice and this permission notice shall be included *
+ * in all copies or substantial portions of the Software. *
+ * *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
+ * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
+ * THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
+ * *
+ * Except as contained in this notice, the name(s) of the above copyright *
+ * holders shall not be used in advertising or otherwise to promote the *
+ * sale, use or other dealings in this Software without prior written *
+ * authorization. *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1995 *
+ * and: Eric S. Raymond <esr@snark.thyrsus.com> *
+ ****************************************************************************/
+
+/* p_update.c
+ * wnoutrefresh windows in an orderly fashion
+ */
+#include "panel.priv.h"
+
+MODULE_ID("$Id: p_update.c,v 1.9 2005/02/19 16:49:47 tom Exp $")
+
+NCURSES_EXPORT(void)
+update_panels(void)
+{
+ PANEL *pan;
+
+ T((T_CALLED("update_panels()")));
+ dBug(("--> update_panels"));
+ pan = _nc_bottom_panel;
+ while (pan && pan->above)
+ {
+ PANEL_UPDATE(pan, pan->above);
+ pan = pan->above;
+ }
+
+ pan = _nc_bottom_panel;
+ while (pan)
+ {
+ Wnoutrefresh(pan);
+ pan = pan->above;
+ }
+
+ returnVoid;
+}
diff --git a/panel/p_user.c b/panel/p_user.c
new file mode 100644
index 000000000000..ffa25f85ae12
--- /dev/null
+++ b/panel/p_user.c
@@ -0,0 +1,56 @@
+/****************************************************************************
+ * Copyright (c) 1998-2000,2005 Free Software Foundation, Inc. *
+ * *
+ * Permission is hereby granted, free of charge, to any person obtaining a *
+ * copy of this software and associated documentation files (the *
+ * "Software"), to deal in the Software without restriction, including *
+ * without limitation the rights to use, copy, modify, merge, publish, *
+ * distribute, distribute with modifications, sublicense, and/or sell *
+ * copies of the Software, and to permit persons to whom the Software is *
+ * furnished to do so, subject to the following conditions: *
+ * *
+ * The above copyright notice and this permission notice shall be included *
+ * in all copies or substantial portions of the Software. *
+ * *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
+ * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
+ * THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
+ * *
+ * Except as contained in this notice, the name(s) of the above copyright *
+ * holders shall not be used in advertising or otherwise to promote the *
+ * sale, use or other dealings in this Software without prior written *
+ * authorization. *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1995 *
+ * and: Eric S. Raymond <esr@snark.thyrsus.com> *
+ ****************************************************************************/
+
+/* p_user.c
+ * Set/Get panels user pointer
+ */
+#include "panel.priv.h"
+
+MODULE_ID("$Id: p_user.c,v 1.6 2005/02/19 16:52:44 tom Exp $")
+
+NCURSES_EXPORT(int)
+set_panel_userptr(PANEL * pan, NCURSES_CONST void *uptr)
+{
+ T((T_CALLED("set_panel_userptr(%p,%p)"), pan, uptr));
+ if (!pan)
+ returnCode(ERR);
+ pan->user = uptr;
+ returnCode(OK);
+}
+
+NCURSES_EXPORT(NCURSES_CONST void *)
+panel_userptr(const PANEL * pan)
+{
+ T((T_CALLED("panel_userptr(%p)"), pan));
+ returnCVoidPtr(pan ? pan->user : (NCURSES_CONST void *)0);
+}
diff --git a/panel/p_win.c b/panel/p_win.c
new file mode 100644
index 000000000000..e7d2cea8e3fe
--- /dev/null
+++ b/panel/p_win.c
@@ -0,0 +1,46 @@
+/****************************************************************************
+ * Copyright (c) 1998-2000,2005 Free Software Foundation, Inc. *
+ * *
+ * Permission is hereby granted, free of charge, to any person obtaining a *
+ * copy of this software and associated documentation files (the *
+ * "Software"), to deal in the Software without restriction, including *
+ * without limitation the rights to use, copy, modify, merge, publish, *
+ * distribute, distribute with modifications, sublicense, and/or sell *
+ * copies of the Software, and to permit persons to whom the Software is *
+ * furnished to do so, subject to the following conditions: *
+ * *
+ * The above copyright notice and this permission notice shall be included *
+ * in all copies or substantial portions of the Software. *
+ * *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
+ * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
+ * THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
+ * *
+ * Except as contained in this notice, the name(s) of the above copyright *
+ * holders shall not be used in advertising or otherwise to promote the *
+ * sale, use or other dealings in this Software without prior written *
+ * authorization. *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1995 *
+ * and: Eric S. Raymond <esr@snark.thyrsus.com> *
+ ****************************************************************************/
+
+/* p_win.c
+ * Return a panels window.
+ */
+#include "panel.priv.h"
+
+MODULE_ID("$Id: p_win.c,v 1.5 2005/02/19 16:44:16 tom Exp $")
+
+NCURSES_EXPORT(WINDOW *)
+panel_window(const PANEL * pan)
+{
+ T((T_CALLED("panel_window(%p)"), pan));
+ returnWin(pan ? pan->win : (WINDOW *)0);
+}
diff --git a/panel/panel.c b/panel/panel.c
new file mode 100644
index 000000000000..16a8083d64b2
--- /dev/null
+++ b/panel/panel.c
@@ -0,0 +1,157 @@
+/****************************************************************************
+ * Copyright (c) 1998-2004,2005 Free Software Foundation, Inc. *
+ * *
+ * Permission is hereby granted, free of charge, to any person obtaining a *
+ * copy of this software and associated documentation files (the *
+ * "Software"), to deal in the Software without restriction, including *
+ * without limitation the rights to use, copy, modify, merge, publish, *
+ * distribute, distribute with modifications, sublicense, and/or sell *
+ * copies of the Software, and to permit persons to whom the Software is *
+ * furnished to do so, subject to the following conditions: *
+ * *
+ * The above copyright notice and this permission notice shall be included *
+ * in all copies or substantial portions of the Software. *
+ * *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
+ * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
+ * THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
+ * *
+ * Except as contained in this notice, the name(s) of the above copyright *
+ * holders shall not be used in advertising or otherwise to promote the *
+ * sale, use or other dealings in this Software without prior written *
+ * authorization. *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1995 *
+ * and: Eric S. Raymond <esr@snark.thyrsus.com> *
+ ****************************************************************************/
+
+/* panel.c -- implementation of panels library, some core routines */
+#include "panel.priv.h"
+
+MODULE_ID("$Id: panel.c,v 1.23 2005/02/19 18:04:31 tom Exp $")
+
+/*+-------------------------------------------------------------------------
+ _nc_retrace_panel (pan)
+--------------------------------------------------------------------------*/
+#ifdef TRACE
+NCURSES_EXPORT(PANEL *)
+_nc_retrace_panel(PANEL * pan)
+{
+ T((T_RETURN("%p"), pan));
+ return pan;
+}
+#endif
+
+/*+-------------------------------------------------------------------------
+ _nc_my_visbuf(ptr)
+--------------------------------------------------------------------------*/
+#ifdef TRACE
+#ifndef TRACE_TXT
+NCURSES_EXPORT(const char *)
+_nc_my_visbuf(const void *ptr)
+{
+ char temp[32];
+
+ if (ptr != 0)
+ sprintf(temp, "ptr:%p", ptr);
+ else
+ strcpy(temp, "<null>");
+ return _nc_visbuf(temp);
+}
+#endif
+#endif
+
+/*+-------------------------------------------------------------------------
+ dPanel(text,pan)
+--------------------------------------------------------------------------*/
+#ifdef TRACE
+NCURSES_EXPORT(void)
+_nc_dPanel(const char *text, const PANEL * pan)
+{
+ _tracef("%s id=%s b=%s a=%s y=%d x=%d",
+ text, USER_PTR(pan->user),
+ (pan->below) ? USER_PTR(pan->below->user) : "--",
+ (pan->above) ? USER_PTR(pan->above->user) : "--",
+ PSTARTY(pan), PSTARTX(pan));
+}
+#endif
+
+/*+-------------------------------------------------------------------------
+ dStack(fmt,num,pan)
+--------------------------------------------------------------------------*/
+#ifdef TRACE
+NCURSES_EXPORT(void)
+_nc_dStack(const char *fmt, int num, const PANEL * pan)
+{
+ char s80[80];
+
+ sprintf(s80, fmt, num, pan);
+ _tracef("%s b=%s t=%s", s80,
+ (_nc_bottom_panel) ? USER_PTR(_nc_bottom_panel->user) : "--",
+ (_nc_top_panel) ? USER_PTR(_nc_top_panel->user) : "--");
+ if (pan)
+ _tracef("pan id=%s", USER_PTR(pan->user));
+ pan = _nc_bottom_panel;
+ while (pan)
+ {
+ dPanel("stk", pan);
+ pan = pan->above;
+ }
+}
+#endif
+
+/*+-------------------------------------------------------------------------
+ Wnoutrefresh(pan) - debugging hook for wnoutrefresh
+--------------------------------------------------------------------------*/
+#ifdef TRACE
+NCURSES_EXPORT(void)
+_nc_Wnoutrefresh(const PANEL * pan)
+{
+ dPanel("wnoutrefresh", pan);
+ wnoutrefresh(pan->win);
+}
+#endif
+
+/*+-------------------------------------------------------------------------
+ Touchpan(pan)
+--------------------------------------------------------------------------*/
+#ifdef TRACE
+NCURSES_EXPORT(void)
+_nc_Touchpan(const PANEL * pan)
+{
+ dPanel("Touchpan", pan);
+ touchwin(pan->win);
+}
+#endif
+
+/*+-------------------------------------------------------------------------
+ Touchline(pan,start,count)
+--------------------------------------------------------------------------*/
+#ifdef TRACE
+NCURSES_EXPORT(void)
+_nc_Touchline(const PANEL * pan, int start, int count)
+{
+ char s80[80];
+
+ sprintf(s80, "Touchline s=%d c=%d", start, count);
+ dPanel(s80, pan);
+ touchline(pan->win, start, count);
+}
+#endif
+
+#ifndef TRACE
+# ifndef __GNUC__
+ /* Some C compilers need something defined in a source file */
+extern void _nc_dummy_panel(void);
+void
+_nc_dummy_panel(void)
+{
+}
+# endif
+#endif
diff --git a/panel/panel.h b/panel/panel.h
new file mode 100644
index 000000000000..1e02091d97f2
--- /dev/null
+++ b/panel/panel.h
@@ -0,0 +1,77 @@
+/****************************************************************************
+ * Copyright (c) 1998-2001,2006 Free Software Foundation, Inc. *
+ * *
+ * Permission is hereby granted, free of charge, to any person obtaining a *
+ * copy of this software and associated documentation files (the *
+ * "Software"), to deal in the Software without restriction, including *
+ * without limitation the rights to use, copy, modify, merge, publish, *
+ * distribute, distribute with modifications, sublicense, and/or sell *
+ * copies of the Software, and to permit persons to whom the Software is *
+ * furnished to do so, subject to the following conditions: *
+ * *
+ * The above copyright notice and this permission notice shall be included *
+ * in all copies or substantial portions of the Software. *
+ * *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
+ * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
+ * THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
+ * *
+ * Except as contained in this notice, the name(s) of the above copyright *
+ * holders shall not be used in advertising or otherwise to promote the *
+ * sale, use or other dealings in this Software without prior written *
+ * authorization. *
+ ****************************************************************************/
+
+/****************************************************************************
+ * Author: Zeyd M. Ben-Halim <zmbenhal@netcom.com> 1995 *
+ * and: Eric S. Raymond <esr@snark.thyrsus.com> *
+ ****************************************************************************/
+
+/* $Id: panel.h,v 1.10 2006/05/27 19:49:40 tom Exp $ */
+
+/* panel.h -- interface file for panels library */
+
+#ifndef NCURSES_PANEL_H_incl
+#define NCURSES_PANEL_H_incl 1
+
+#include <curses.h>
+
+typedef struct panel
+{
+ WINDOW *win;
+ struct panel *below;
+ struct panel *above;
+ NCURSES_CONST void *user;
+} PANEL;
+
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
+extern NCURSES_EXPORT(WINDOW*) panel_window (const PANEL *);
+extern NCURSES_EXPORT(void) update_panels (void);
+extern NCURSES_EXPORT(int) hide_panel (PANEL *);
+extern NCURSES_EXPORT(int) show_panel (PANEL *);
+extern NCURSES_EXPORT(int) del_panel (PANEL *);
+extern NCURSES_EXPORT(int) top_panel (PANEL *);
+extern NCURSES_EXPORT(int) bottom_panel (PANEL *);
+extern NCURSES_EXPORT(PANEL*) new_panel (WINDOW *);
+extern NCURSES_EXPORT(PANEL*) panel_above (const PANEL *);
+extern NCURSES_EXPORT(PANEL*) panel_below (const PANEL *);
+extern NCURSES_EXPORT(int) set_panel_userptr (PANEL *, NCURSES_CONST void *);
+extern NCURSES_EXPORT(NCURSES_CONST void*) panel_userptr (const PANEL *);
+extern NCURSES_EXPORT(int) move_panel (PANEL *, int, int);
+extern NCURSES_EXPORT(int) replace_panel (PANEL *,WINDOW *);
+extern NCURSES_EXPORT(int) panel_hidden (const PANEL *);
+
+#if defined(__cplusplus)
+}
+#endif
+
+#endif /* NCURSES_PANEL_H_incl */
+
+/* end of panel.h */
diff --git a/panel/panel.priv.h b/panel/panel.priv.h
new file mode 100644
index 000000000000..98d741ff6ef0
--- /dev/null
+++ b/panel/panel.priv.h
@@ -0,0 +1,191 @@
+/****************************************************************************
+ * Copyright (c) 1998-2001,2005 Free Software Foundation, Inc. *
+ * *
+ * Permission is hereby granted, free of charge, to any person obtaining a *
+ * copy of this software and associated documentation files (the *
+ * "Software"), to deal in the Software without restriction, including *
+ * without limitation the rights to use, copy, modify, merge, publish, *
+ * distribute, distribute with modifications, sublicense, and/or sell *
+ * copies of the Software, and to permit persons to whom the Software is *
+ * furnished to do so, subject to the following conditions: *
+ * *
+ * The above copyright notice and this permission notice shall be included *
+ * in all copies or substantial portions of the Software. *
+ * *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS *
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF *
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. *
+ * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, *
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR *
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR *
+ * THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
+ * *
+ * Except as contained in this notice, the name(s) of the above copyright *
+ * holders shall not be used in advertising or otherwise to promote the *
+ * sale, use or other dealings in this Software without prior written *
+ * authorization. *
+ ****************************************************************************/
+
+/* $Id: panel.priv.h,v 1.21 2005/11/26 15:27:00 tom Exp $ */
+
+#ifndef NCURSES_PANEL_PRIV_H
+#define NCURSES_PANEL_PRIV_H 1
+
+#if HAVE_CONFIG_H
+# include <ncurses_cfg.h>
+#endif
+
+#include <stdlib.h>
+#include <string.h>
+#include <assert.h>
+
+#if HAVE_LIBDMALLOC
+# include <dmalloc.h> /* Gray Watson's library */
+#endif
+
+#if HAVE_LIBDBMALLOC
+# include <dbmalloc.h> /* Conor Cahill's library */
+#endif
+
+#include "curses.priv.h"
+#include "panel.h"
+#include <nc_panel.h>
+
+#if USE_RCS_IDS
+# define MODULE_ID(id) static const char Ident[] = id;
+#else
+# define MODULE_ID(id) /*nothing*/
+#endif
+
+
+#ifdef TRACE
+ extern NCURSES_EXPORT(const char *) _nc_my_visbuf (const void *);
+# ifdef TRACE_TXT
+# define USER_PTR(ptr) _nc_visbuf((const char *)ptr)
+# else
+# define USER_PTR(ptr) _nc_my_visbuf((const char *)ptr)
+# endif
+
+# define returnPanel(code) TRACE_RETURN(code,panel)
+
+ extern NCURSES_EXPORT(PANEL *) _nc_retrace_panel (PANEL *);
+ extern NCURSES_EXPORT(void) _nc_dPanel (const char*, const PANEL*);
+ extern NCURSES_EXPORT(void) _nc_dStack (const char*, int, const PANEL*);
+ extern NCURSES_EXPORT(void) _nc_Wnoutrefresh (const PANEL*);
+ extern NCURSES_EXPORT(void) _nc_Touchpan (const PANEL*);
+ extern NCURSES_EXPORT(void) _nc_Touchline (const PANEL*, int, int);
+
+# define dBug(x) _tracef x
+# define dPanel(text,pan) _nc_dPanel(text,pan)
+# define dStack(fmt,num,pan) _nc_dStack(fmt,num,pan)
+# define Wnoutrefresh(pan) _nc_Wnoutrefresh(pan)
+# define Touchpan(pan) _nc_Touchpan(pan)
+# define Touchline(pan,start,count) _nc_Touchline(pan,start,count)
+#else /* !TRACE */
+# define returnPanel(code) return code
+# define dBug(x)
+# define dPanel(text,pan)
+# define dStack(fmt,num,pan)
+# define Wnoutrefresh(pan) wnoutrefresh((pan)->win)
+# define Touchpan(pan) touchwin((pan)->win)
+# define Touchline(pan,start,count) touchline((pan)->win,start,count)
+#endif
+
+#define _nc_stdscr_pseudo_panel _nc_panelhook()->stdscr_pseudo_panel
+#define _nc_top_panel _nc_panelhook()->top_panel
+#define _nc_bottom_panel _nc_panelhook()->bottom_panel
+
+#define EMPTY_STACK() (_nc_top_panel==_nc_bottom_panel)
+#define Is_Bottom(p) (((p)!=(PANEL*)0) && !EMPTY_STACK() && (_nc_bottom_panel->above==(p)))
+#define Is_Top(p) (((p)!=(PANEL*)0) && !EMPTY_STACK() && (_nc_top_panel==(p)))
+#define Is_Pseudo(p) ((p) && ((p)==_nc_bottom_panel))
+
+/*+-------------------------------------------------------------------------
+ IS_LINKED(pan) - check to see if panel is in the stack
+--------------------------------------------------------------------------*/
+/* This works! The only case where it would fail is, when the list has
+ only one element. But this could only be the pseudo panel at the bottom */
+#define IS_LINKED(p) (((p)->above || (p)->below ||((p)==_nc_bottom_panel)) ? TRUE : FALSE)
+
+#define PSTARTX(pan) ((pan)->win->_begx)
+#define PENDX(pan) ((pan)->win->_begx + getmaxx((pan)->win) - 1)
+#define PSTARTY(pan) ((pan)->win->_begy)
+#define PENDY(pan) ((pan)->win->_begy + getmaxy((pan)->win) - 1)
+
+/*+-------------------------------------------------------------------------
+ PANELS_OVERLAPPED(pan1,pan2) - check panel overlapped
+---------------------------------------------------------------------------*/
+#define PANELS_OVERLAPPED(pan1,pan2) \
+(( !(pan1) || !(pan2) || \
+ PSTARTY(pan1) > PENDY(pan2) || PENDY(pan1) < PSTARTY(pan2) ||\
+ PSTARTX(pan1) > PENDX(pan2) || PENDX(pan1) < PSTARTX(pan2) ) \
+ ? FALSE : TRUE)
+
+
+/*+-------------------------------------------------------------------------
+ Compute the intersection rectangle of two overlapping rectangles
+---------------------------------------------------------------------------*/
+#define COMPUTE_INTERSECTION(pan1,pan2,ix1,ix2,iy1,iy2)\
+ ix1 = (PSTARTX(pan1) < PSTARTX(pan2)) ? PSTARTX(pan2) : PSTARTX(pan1);\
+ ix2 = (PENDX(pan1) < PENDX(pan2)) ? PENDX(pan1) : PENDX(pan2);\
+ iy1 = (PSTARTY(pan1) < PSTARTY(pan2)) ? PSTARTY(pan2) : PSTARTY(pan1);\
+ iy2 = (PENDY(pan1) < PENDY(pan2)) ? PENDY(pan1) : PENDY(pan2);\
+ assert((ix1<=ix2) && (iy1<=iy2));\
+
+
+/*+-------------------------------------------------------------------------
+ Walk through the panel stack starting at the given location and
+ check for intersections; overlapping panels are "touched", so they
+ are incrementally overwriting cells that should be hidden.
+ If the "touch" flag is set, the panel gets touched before it is
+ updated.
+---------------------------------------------------------------------------*/
+#define PANEL_UPDATE(pan,panstart)\
+{ PANEL* pan2 = ((panstart) ? (panstart) : _nc_bottom_panel);\
+ while(pan2) {\
+ if ((pan2 != pan) && PANELS_OVERLAPPED(pan,pan2)) {\
+ int y,ix1,ix2,iy1,iy2;\
+ COMPUTE_INTERSECTION(pan,pan2,ix1,ix2,iy1,iy2);\
+ for(y = iy1; y <= iy2; y++) {\
+ if (is_linetouched(pan->win,y - PSTARTY(pan))) {\
+ struct ldat* line = &(pan2->win->_line[y - PSTARTY(pan2)]);\
+ CHANGED_RANGE(line,ix1-PSTARTX(pan2),ix2-PSTARTX(pan2));\
+ }\
+ }\
+ }\
+ pan2 = pan2->above;\
+ }\
+}
+
+/*+-------------------------------------------------------------------------
+ Remove panel from stack.
+---------------------------------------------------------------------------*/
+#define PANEL_UNLINK(pan,err) \
+{ err = ERR;\
+ if (pan) {\
+ if (IS_LINKED(pan)) {\
+ if ((pan)->below)\
+ (pan)->below->above = (pan)->above;\
+ if ((pan)->above)\
+ (pan)->above->below = (pan)->below;\
+ if ((pan) == _nc_bottom_panel) \
+ _nc_bottom_panel = (pan)->above;\
+ if ((pan) == _nc_top_panel) \
+ _nc_top_panel = (pan)->below;\
+ err = OK;\
+ }\
+ (pan)->above = (pan)->below = (PANEL*)0;\
+ }\
+}
+
+#define HIDE_PANEL(pan,err,err_if_unlinked)\
+ if (IS_LINKED(pan)) {\
+ Touchpan(pan);\
+ PANEL_UPDATE(pan,(PANEL*)0);\
+ PANEL_UNLINK(pan,err);\
+ } \
+ else {\
+ err = err_if_unlinked;\
+ }
+
+#endif /* NCURSES_PANEL_PRIV_H */