/*+------------------------------------------------------------------------- __panel_link_bottom(pan) - link panel into stack at bottom --------------------------------------------------------------------------*/ void _nc_panel_link_bottom(PANEL *pan) { #ifdef TRACE dStack("<lb%d>",1,pan); if(_nc_panel_is_linked(pan)) return; #endif pan->above = (PANEL *)0; pan->below = (PANEL *)0; if(_nc_bottom_panel) { /* the stdscr pseudo panel always stays real bottom; so we insert after bottom panel*/ pan->below = _nc_bottom_panel; pan->above = _nc_bottom_panel->above; if (pan->above) pan->above->below = pan; _nc_bottom_panel->above = pan; } else _nc_bottom_panel = pan; if(!_nc_top_panel) _nc_top_panel = pan; assert(_nc_bottom_panel == _nc_stdscr_pseudo_panel); _nc_calculate_obscure(); dStack("<lb%d>",9,pan); }
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); }
// link panel into stack at bottom //------------------------------------------------------------------------------ static void _panel_link_bottom( PANEL* pan ) { __QCS_FCONTEXT( "_panel_link_bottom" ); #ifdef PANEL_DEBUG dStack( "<lb%d>", 1, pan ); if( _panel_is_linked( pan ) ) { return; } #endif pan->above = (PANEL*)0; pan->below = (PANEL*)0; if( _bottom_panel ) { _bottom_panel->below = pan; pan->above = _bottom_panel; } _bottom_panel = pan; if( !_top_panel ) { _top_panel = pan; } _calculate_obscure(); dStack( "<lb%d>", 9, pan ); }
show_panel(PANEL * pan) { int err = ERR; T((T_CALLED("show_panel(%p)"), (void *)pan)); if (pan) { GetHook(pan); 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; err = OK; dStack("<lt%d>", 9, pan); } returnCode(err); }
//------------------------------------------------------------------------------ static void _panel_unlink( PANEL* pan ) { __QCS_FCONTEXT( "_panel_unlink" ); PANEL* prev; PANEL* next; #ifdef PANEL_DEBUG dStack( "<u%d>", 1, pan ); if( !_panel_is_linked( pan ) ) { return; } #endif _override( pan, 0 ); _free_obscure( pan ); prev = pan->below; next = pan->above; // if non-zero, we will not update the list head if( prev ) { prev->above = next; if( next ) { next->below = prev; } } else if( next ) { next->below = prev; } if( pan == _bottom_panel ) { _bottom_panel = next; } if( pan == _top_panel ) { _top_panel = prev; } _calculate_obscure(); pan->above = (PANEL*)0; pan->below = (PANEL*)0; dStack( "<u%d>", 9, pan ); }
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); }
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); }
hide_panel(register PANEL * pan) { int err = ERR; T((T_CALLED("hide_panel(%p)"), (void *)pan)); if (pan) { GetHook(pan); dBug(("--> hide_panel %s", USER_PTR(pan->user))); dStack("<u%d>", 1, pan); HIDE_PANEL(pan, err, ERR); err = OK; dStack("<u%d>", 9, pan); } returnCode(err); }
static void _panel_link_top(PANEL *pan) { #ifdef PANEL_DEBUG dStack("<lt%d>", 1, pan); if (_panel_is_linked(pan)) return; #endif pan->above = (PANEL *)0; pan->below = (PANEL *)0; if (_top_panel) { _top_panel->above = pan; pan->below = _top_panel; } _top_panel = pan; if (!_bottom_panel) _bottom_panel = pan; _calculate_obscure(); dStack("<lt%d>", 9, pan); }