diff options
Diffstat (limited to 'ncurses-5.2/panel')
-rw-r--r-- | ncurses-5.2/panel/Makefile.in | 149 | ||||
-rw-r--r-- | ncurses-5.2/panel/headers | 31 | ||||
-rw-r--r-- | ncurses-5.2/panel/llib-lpanel | 143 | ||||
-rw-r--r-- | ncurses-5.2/panel/modules | 49 | ||||
-rw-r--r-- | ncurses-5.2/panel/p_above.c | 51 | ||||
-rw-r--r-- | ncurses-5.2/panel/p_below.c | 53 | ||||
-rw-r--r-- | ncurses-5.2/panel/p_bottom.c | 70 | ||||
-rw-r--r-- | ncurses-5.2/panel/p_delete.c | 54 | ||||
-rw-r--r-- | ncurses-5.2/panel/p_hidden.c | 47 | ||||
-rw-r--r-- | ncurses-5.2/panel/p_hide.c | 57 | ||||
-rw-r--r-- | ncurses-5.2/panel/p_move.c | 54 | ||||
-rw-r--r-- | ncurses-5.2/panel/p_new.c | 104 | ||||
-rw-r--r-- | ncurses-5.2/panel/p_replace.c | 53 | ||||
-rw-r--r-- | ncurses-5.2/panel/p_show.c | 67 | ||||
-rw-r--r-- | ncurses-5.2/panel/p_top.c | 45 | ||||
-rw-r--r-- | ncurses-5.2/panel/p_update.c | 60 | ||||
-rw-r--r-- | ncurses-5.2/panel/p_user.c | 55 | ||||
-rw-r--r-- | ncurses-5.2/panel/p_win.c | 49 | ||||
-rw-r--r-- | ncurses-5.2/panel/panel.c | 136 | ||||
-rw-r--r-- | ncurses-5.2/panel/panel.h | 75 | ||||
-rw-r--r-- | ncurses-5.2/panel/panel.priv.h | 203 |
21 files changed, 1605 insertions, 0 deletions
diff --git a/ncurses-5.2/panel/Makefile.in b/ncurses-5.2/panel/Makefile.in new file mode 100644 index 0000000..75b8d3e --- /dev/null +++ b/ncurses-5.2/panel/Makefile.in @@ -0,0 +1,149 @@ +# $Id$ +############################################################################## +# Copyright (c) 1998-2000 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,1997 +# +# 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 + +MODEL = @DFT_LWR_MODEL@ +DESTDIR = @DESTDIR@ +srcdir = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ +libdir = @libdir@ +includedir = @includedir@ +datadir = @datadir@ + +LIBTOOL = @LIBTOOL@ + +INSTALL = @INSTALL@ +INSTALL_LIB = @INSTALL@ @INSTALL_LIB@ +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 = @CPPFLAGS@ \ + -DHAVE_CONFIG_H + +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) $(CC) +LDFLAGS = @LDFLAGS@ @LD_MODEL@ @LIBS@ + +SHLIB_DIRS = -L../lib -L$(libdir) +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 = @RANLIB@ + +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)$(libdir) : + $(srcdir)/../mkinstalldirs $@ + +# 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 *~ *.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/ncurses-5.2/panel/headers b/ncurses-5.2/panel/headers new file mode 100644 index 0000000..fa0164c --- /dev/null +++ b/ncurses-5.2/panel/headers @@ -0,0 +1,31 @@ +############################################################################## +# Copyright (c) 1998 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 diff --git a/ncurses-5.2/panel/llib-lpanel b/ncurses-5.2/panel/llib-lpanel new file mode 100644 index 0000000..2ca1a3e --- /dev/null +++ b/ncurses-5.2/panel/llib-lpanel @@ -0,0 +1,143 @@ +/**************************************************************************** + * Copyright (c) 1998 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> 1997 * + ****************************************************************************/ +/* LINTLIBRARY */ + +/* ./panel.c */ + +#include "panel.priv.h" + + +/* ./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/ncurses-5.2/panel/modules b/ncurses-5.2/panel/modules new file mode 100644 index 0000000..ed51d2c --- /dev/null +++ b/ncurses-5.2/panel/modules @@ -0,0 +1,49 @@ +############################################################################## +# Copyright (c) 1998 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> 1995,1997 +# + +@ 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) + diff --git a/ncurses-5.2/panel/p_above.c b/ncurses-5.2/panel/p_above.c new file mode 100644 index 0000000..b1dc979 --- /dev/null +++ b/ncurses-5.2/panel/p_above.c @@ -0,0 +1,51 @@ +/**************************************************************************** + * Copyright (c) 1998 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$") + +PANEL* +panel_above(const PANEL *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 */ + return(EMPTY_STACK() ? (PANEL*)0 : _nc_bottom_panel->above); + } + else + return(pan->above); +} diff --git a/ncurses-5.2/panel/p_below.c b/ncurses-5.2/panel/p_below.c new file mode 100644 index 0000000..e4758f7 --- /dev/null +++ b/ncurses-5.2/panel/p_below.c @@ -0,0 +1,53 @@ +/**************************************************************************** + * Copyright (c) 1998 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$") + +PANEL* +panel_below(const PANEL *pan) +{ + if(!pan) + { + /* if top and bottom are equal, we have no or only the pseudo panel */ + return(EMPTY_STACK() ? (PANEL*)0 : _nc_top_panel); + } + else + { + /* we must not return the pseudo panel */ + return(Is_Pseudo(pan->below) ? (PANEL*) 0 : pan->below); + } +} diff --git a/ncurses-5.2/panel/p_bottom.c b/ncurses-5.2/panel/p_bottom.c new file mode 100644 index 0000000..13a719d --- /dev/null +++ b/ncurses-5.2/panel/p_bottom.c @@ -0,0 +1,70 @@ +/**************************************************************************** + * Copyright (c) 1998 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$") + +int +bottom_panel(PANEL *pan) +{ + int err = OK; + + if (pan) { + + if(!Is_Bottom(pan)) { + + dBug(("--> bottom_panel %s", USER_PTR(pan->user))); + + HIDE_PANEL(pan,err,FALSE); + 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; + + return(err); +} diff --git a/ncurses-5.2/panel/p_delete.c b/ncurses-5.2/panel/p_delete.c new file mode 100644 index 0000000..bbb358d --- /dev/null +++ b/ncurses-5.2/panel/p_delete.c @@ -0,0 +1,54 @@ +/**************************************************************************** + * Copyright (c) 1998 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$") + +int +del_panel(PANEL *pan) +{ + int err = OK; + if(pan) + { + dBug(("--> del_panel %s", USER_PTR(pan->user))); + HIDE_PANEL(pan,err,FALSE); + free((void *)pan); + } + else + err = ERR; + return(err); +} diff --git a/ncurses-5.2/panel/p_hidden.c b/ncurses-5.2/panel/p_hidden.c new file mode 100644 index 0000000..a1710a0 --- /dev/null +++ b/ncurses-5.2/panel/p_hidden.c @@ -0,0 +1,47 @@ +/**************************************************************************** + * Copyright (c) 1998 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$") + +int +panel_hidden(const PANEL *pan) +{ + if(!pan) + return(ERR); + return(IS_LINKED(pan) ? FALSE : TRUE); +} diff --git a/ncurses-5.2/panel/p_hide.c b/ncurses-5.2/panel/p_hide.c new file mode 100644 index 0000000..a056cdd --- /dev/null +++ b/ncurses-5.2/panel/p_hide.c @@ -0,0 +1,57 @@ +/**************************************************************************** + * Copyright (c) 1998 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$") + +int +hide_panel(register PANEL *pan) +{ + int err = OK; + + if(!pan) + return(ERR); + + dBug(("--> hide_panel %s", USER_PTR(pan->user))); + dStack("<u%d>",1,pan); + + HIDE_PANEL(pan,err,TRUE); + + dStack("<u%d>",9,pan); + + return(err); +} diff --git a/ncurses-5.2/panel/p_move.c b/ncurses-5.2/panel/p_move.c new file mode 100644 index 0000000..57b36f9 --- /dev/null +++ b/ncurses-5.2/panel/p_move.c @@ -0,0 +1,54 @@ +/**************************************************************************** + * Copyright (c) 1998 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$") + +int +move_panel(PANEL *pan, int starty, int startx) +{ + if(!pan) + return(ERR); + + if (IS_LINKED(pan)) + PANEL_UPDATE(pan,(PANEL*)0, TRUE); + + if (mvwin(pan->win,starty,startx)) + return(ERR); + + return(OK); +} diff --git a/ncurses-5.2/panel/p_new.c b/ncurses-5.2/panel/p_new.c new file mode 100644 index 0000000..d849b2c --- /dev/null +++ b/ncurses-5.2/panel/p_new.c @@ -0,0 +1,104 @@ +/**************************************************************************** + * Copyright (c) 1998 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$") + +#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; +} + +PANEL * +new_panel(WINDOW *win) +{ + PANEL *pan = (PANEL*)0; + + if (!win) + return(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); + } + return(pan); +} diff --git a/ncurses-5.2/panel/p_replace.c b/ncurses-5.2/panel/p_replace.c new file mode 100644 index 0000000..433249b --- /dev/null +++ b/ncurses-5.2/panel/p_replace.c @@ -0,0 +1,53 @@ +/**************************************************************************** + * Copyright (c) 1998 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$") + +int +replace_panel(PANEL *pan, WINDOW *win) +{ + if(!pan) + return(ERR); + + if (IS_LINKED(pan)) + PANEL_UPDATE(pan,(PANEL*)0, TRUE); + + pan->win = win; + + return(OK); +} diff --git a/ncurses-5.2/panel/p_show.c b/ncurses-5.2/panel/p_show.c new file mode 100644 index 0000000..d3423fc --- /dev/null +++ b/ncurses-5.2/panel/p_show.c @@ -0,0 +1,67 @@ +/**************************************************************************** + * Copyright (c) 1998 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$") + +int +show_panel(PANEL *pan) +{ + int err = OK; + + if(!pan) + return(ERR); + + if (Is_Top(pan)) + return(OK); + + dBug(("--> show_panel %s", USER_PTR(pan->user))); + + HIDE_PANEL(pan,err,FALSE); + + 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); + + return(OK); +} diff --git a/ncurses-5.2/panel/p_top.c b/ncurses-5.2/panel/p_top.c new file mode 100644 index 0000000..077690c --- /dev/null +++ b/ncurses-5.2/panel/p_top.c @@ -0,0 +1,45 @@ +/**************************************************************************** + * Copyright (c) 1998 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$") + +int +top_panel(PANEL *pan) +{ + return(show_panel(pan)); +} diff --git a/ncurses-5.2/panel/p_update.c b/ncurses-5.2/panel/p_update.c new file mode 100644 index 0000000..874f6a9 --- /dev/null +++ b/ncurses-5.2/panel/p_update.c @@ -0,0 +1,60 @@ +/**************************************************************************** + * Copyright (c) 1998 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$") + +void +update_panels(void) +{ + PANEL *pan; + + dBug(("--> update_panels")); + pan = _nc_bottom_panel; + while(pan && pan->above) + { + PANEL_UPDATE(pan,pan->above, FALSE); + pan = pan->above; + } + + pan = _nc_bottom_panel; + while (pan) + { + Wnoutrefresh(pan); + pan = pan->above; + } +} diff --git a/ncurses-5.2/panel/p_user.c b/ncurses-5.2/panel/p_user.c new file mode 100644 index 0000000..1654549 --- /dev/null +++ b/ncurses-5.2/panel/p_user.c @@ -0,0 +1,55 @@ +/**************************************************************************** + * Copyright (c) 1998 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$") + +int +set_panel_userptr(PANEL *pan, NCURSES_CONST void *uptr) +{ + if(!pan) + return(ERR); + pan->user = uptr; + return(OK); +} + +NCURSES_CONST void* +panel_userptr(const PANEL *pan) +{ + return(pan ? pan->user : (NCURSES_CONST void *)0); +} + diff --git a/ncurses-5.2/panel/p_win.c b/ncurses-5.2/panel/p_win.c new file mode 100644 index 0000000..c96dbbb --- /dev/null +++ b/ncurses-5.2/panel/p_win.c @@ -0,0 +1,49 @@ +/**************************************************************************** + * Copyright (c) 1998 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$") + +WINDOW* +panel_window(const PANEL *pan) +{ + return(pan ? pan->win : (WINDOW *)0); +} + + + + diff --git a/ncurses-5.2/panel/panel.c b/ncurses-5.2/panel/panel.c new file mode 100644 index 0000000..7bc2678 --- /dev/null +++ b/ncurses-5.2/panel/panel.c @@ -0,0 +1,136 @@ +/**************************************************************************** + * Copyright (c) 1998 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$") + +#ifdef TRACE +#ifndef TRACE_TXT +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 +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 +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 +void +_nc_Wnoutrefresh(const PANEL *pan) +{ + dPanel("wnoutrefresh",pan); + wnoutrefresh(pan->win); +} +#endif + +/*+------------------------------------------------------------------------- + Touchpan(pan) +--------------------------------------------------------------------------*/ +#ifdef TRACE +void +_nc_Touchpan(const PANEL *pan) +{ + dPanel("Touchpan",pan); + touchwin(pan->win); +} +#endif + +/*+------------------------------------------------------------------------- + Touchline(pan,start,count) +--------------------------------------------------------------------------*/ +#ifdef TRACE +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 */ + static char GCC_UNUSED dummy; +# endif +#endif diff --git a/ncurses-5.2/panel/panel.h b/ncurses-5.2/panel/panel.h new file mode 100644 index 0000000..dc33071 --- /dev/null +++ b/ncurses-5.2/panel/panel.h @@ -0,0 +1,75 @@ +/**************************************************************************** + * Copyright (c) 1998 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.h -- interface file for panels library */ + +#ifndef _PANEL_H +#define _PANEL_H + +#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 WINDOW* panel_window(const PANEL *); +extern void update_panels(void); +extern int hide_panel(PANEL *); +extern int show_panel(PANEL *); +extern int del_panel(PANEL *); +extern int top_panel(PANEL *); +extern int bottom_panel(PANEL *); +extern PANEL* new_panel(WINDOW *); +extern PANEL* panel_above(const PANEL *); +extern PANEL* panel_below(const PANEL *); +extern int set_panel_userptr(PANEL *, NCURSES_CONST void *); +extern NCURSES_CONST void* panel_userptr(const PANEL *); +extern int move_panel(PANEL *, int, int); +extern int replace_panel(PANEL *,WINDOW *); +extern int panel_hidden(const PANEL *); + +#if defined(__cplusplus) +} +#endif + +#endif /* _PANEL_H */ + +/* end of panel.h */ diff --git a/ncurses-5.2/panel/panel.priv.h b/ncurses-5.2/panel/panel.priv.h new file mode 100644 index 0000000..6b448e4 --- /dev/null +++ b/ncurses-5.2/panel/panel.priv.h @@ -0,0 +1,203 @@ +/**************************************************************************** + * Copyright (c) 2000 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$ */ + +#ifndef _PANEL_PRIV_H +#define _PANEL_PRIV_H + +#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 <nc_panel.h> +#include "panel.h" + +#if ( CC_HAS_INLINE_FUNCS && !defined(TRACE) ) +# define INLINE inline +#else +# define INLINE +#endif + +#if USE_RCS_IDS +# define MODULE_ID(id) static const char Ident[] = id; +#else +# define MODULE_ID(id) /*nothing*/ +#endif + + +#ifdef TRACE + extern 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 + + extern void _nc_dPanel(const char*, const PANEL*); + extern void _nc_dStack(const char*, int, const PANEL*); + extern void _nc_Wnoutrefresh(const PANEL*); + extern void _nc_Touchpan(const PANEL*); + extern 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 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)) + +/* borrowed from curses.priv.h */ +#define CHANGED_RANGE(line,start,end) \ + if (line->firstchar == _NOCHANGE \ + || line->firstchar > (start)) \ + line->firstchar = start; \ + if (line->lastchar == _NOCHANGE \ + || line->lastchar < (end)) \ + line->lastchar = end + +/*+------------------------------------------------------------------------- + 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,touch)\ +{ PANEL* pan2 = ((panstart) ? (panstart) : _nc_bottom_panel);\ + if (touch)\ + Touchpan(pan);\ + 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)) {\ + PANEL_UPDATE(pan,(PANEL*)0,TRUE);\ + PANEL_UNLINK(pan,err);\ + } \ + else {\ + if (err_if_unlinked)\ + err = ERR;\ + } + +#endif /* _PANEL_PRIV_H */ |