X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=panel%2Fp_bottom.c;h=0e5b090aa694654235f9e315d6d8d84683f0c030;hp=47abc694a8f41df28612e690c54de6f7ec04dbfe;hb=a28e782d7794ddeec23e7cb212dc455f0d93dc22;hpb=661078ddbde3ce0f3b06e95642fbb9b5fef7dca1 diff --git a/panel/p_bottom.c b/panel/p_bottom.c index 47abc694..0e5b090a 100644 --- a/panel/p_bottom.c +++ b/panel/p_bottom.c @@ -1,5 +1,6 @@ /**************************************************************************** - * Copyright (c) 1998 Free Software Foundation, Inc. * + * Copyright 2020 Thomas E. Dickey * + * Copyright 1998-2008,2010 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 * @@ -29,6 +30,7 @@ /**************************************************************************** * Author: Zeyd M. Ben-Halim 1995 * * and: Eric S. Raymond * + * and: Juergen Pfeifer 1997-1999,2008 * ****************************************************************************/ /* p_bottom.c @@ -36,18 +38,38 @@ */ #include "panel.priv.h" -MODULE_ID("$Id: p_bottom.c,v 1.2 1998/02/11 12:14:01 tom Exp $") +MODULE_ID("$Id: p_bottom.c,v 1.16 2020/09/26 18:02:35 tom Exp $") -int -bottom_panel(PANEL *pan) +PANEL_EXPORT(int) +bottom_panel(PANEL * pan) { - if(!pan) - return(ERR); - if(pan == _nc_bottom_panel) - return(OK); - dBug(("--> bottom_panel %s", USER_PTR(pan->user))); - if(_nc_panel_is_linked(pan)) - (void)hide_panel(pan); - _nc_panel_link_bottom(pan); - return(OK); + int err = OK; + + T((T_CALLED("bottom_panel(%p)"), (void *)pan)); + if (pan) + { + GetHook(pan); + if (!Is_Bottom(pan)) + { + + dBug(("--> bottom_panel %s", USER_PTR(pan->user, 1))); + + HIDE_PANEL(pan, err, OK); + assert(_nc_bottom_panel == _nc_stdscr_pseudo_panel); + + dStack("", 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("", 9, pan); + } + } + else + err = ERR; + + returnCode(err); }