diff options
author | Eric Norum <WENorum@lbl.gov> | 1999-11-25 13:49:26 +0000 |
---|---|---|
committer | Eric Norum <WENorum@lbl.gov> | 1999-11-25 13:49:26 +0000 |
commit | 529e6fe7d7d81c223c0965d3b6b298d4a3d33f93 (patch) | |
tree | b3751563b51732074a71a89e9f020b4eeb4475ad /ncurses-5.2 | |
parent | Useful add-on libraries (diff) | |
download | rtems-addon-packages-529e6fe7d7d81c223c0965d3b6b298d4a3d33f93.tar.bz2 |
Useful add-on libraries
Diffstat (limited to 'ncurses-5.2')
-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_hide.c | 57 | ||||
-rw-r--r-- | ncurses-5.2/panel/p_move.c | 54 | ||||
-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_update.c | 60 |
7 files changed, 415 insertions, 0 deletions
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_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_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_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; + } +} |