/* Delete all curses windows associated with winInfo, leaving everything else intact. */ void tuiDelWindow (TuiWinInfoPtr winInfo) { TuiGenWinInfoPtr genericWin; switch (winInfo->generic.type) { case SRC_WIN: case DISASSEM_WIN: genericWin = locatorWinInfoPtr (); if (genericWin != (TuiGenWinInfoPtr) NULL) { tuiDelwin (genericWin->handle); genericWin->handle = (WINDOW *) NULL; genericWin->isVisible = FALSE; } if (winInfo->detail.sourceInfo.filename) { xfree (winInfo->detail.sourceInfo.filename); winInfo->detail.sourceInfo.filename = 0; } genericWin = winInfo->detail.sourceInfo.executionInfo; if (genericWin != (TuiGenWinInfoPtr) NULL) { tuiDelwin (genericWin->handle); genericWin->handle = (WINDOW *) NULL; genericWin->isVisible = FALSE; } break; case DATA_WIN: if (winInfo->generic.content != (OpaquePtr) NULL) { tuiDelDataWindows (winInfo->detail.dataDisplayInfo.regsContent, winInfo->detail.dataDisplayInfo.regsContentCount); tuiDelDataWindows (winInfo->detail.dataDisplayInfo.dataContent, winInfo->detail.dataDisplayInfo.dataContentCount); } break; default: break; } if (winInfo->generic.handle != (WINDOW *) NULL) { tuiDelwin (winInfo->generic.handle); winInfo->generic.handle = (WINDOW *) NULL; winInfo->generic.isVisible = FALSE; } }
/* ** makeVisible(). ** We can't really make windows visible, or invisible. So we ** have to delete the entire window when making it visible, ** and create it again when making it visible. */ void makeVisible (TuiGenWinInfoPtr winInfo, int visible) { /* Don't tear down/recreate command window */ if (winInfo->type == CMD_WIN) return; if (visible) { if (!winInfo->isVisible) { makeWindow ( winInfo, (winInfo->type != CMD_WIN && !m_winIsAuxillary (winInfo->type))); winInfo->isVisible = TRUE; } tuiRefreshWin (winInfo); } else if (!visible && winInfo->isVisible && winInfo->handle != (WINDOW *) NULL) { winInfo->isVisible = FALSE; tuiClearWin (winInfo); tuiDelwin (winInfo->handle); winInfo->handle = (WINDOW *) NULL; } return; } /* makeVisible */
void freeDataContent (TuiWinContent content, int contentSize) { int i; /* ** Remember that data window content elements are of type TuiGenWinInfoPtr, ** each of which whose single element is a data element. */ for (i = 0; i < contentSize; i++) { TuiGenWinInfoPtr genericWin = &content[i]->whichElement.dataWindow; if (genericWin != (TuiGenWinInfoPtr) NULL) { tuiDelwin (genericWin->handle); genericWin->handle = (WINDOW *) NULL; freeWinContent (genericWin); } } freeContent (content, contentSize, DATA_WIN); return; } /* freeDataContent */
void tuiDelDataWindows (TuiWinContent content, int contentSize) { int i; /* ** Remember that data window content elements are of type TuiGenWinInfoPtr, ** each of which whose single element is a data element. */ for (i = 0; i < contentSize; i++) { TuiGenWinInfoPtr genericWin = &content[i]->whichElement.dataWindow; if (genericWin != (TuiGenWinInfoPtr) NULL) { tuiDelwin (genericWin->handle); genericWin->handle = (WINDOW *) NULL; genericWin->isVisible = FALSE; } } return; } /* tuiDelDataWindows */
/* ** freeWindow(). */ void freeWindow (TuiWinInfoPtr winInfo) { TuiGenWinInfoPtr genericWin; switch (winInfo->generic.type) { case SRC_WIN: case DISASSEM_WIN: genericWin = locatorWinInfoPtr (); if (genericWin != (TuiGenWinInfoPtr) NULL) { tuiDelwin (genericWin->handle); genericWin->handle = (WINDOW *) NULL; } freeWinContent (genericWin); if (winInfo->detail.sourceInfo.filename) { xfree (winInfo->detail.sourceInfo.filename); winInfo->detail.sourceInfo.filename = 0; } genericWin = winInfo->detail.sourceInfo.executionInfo; if (genericWin != (TuiGenWinInfoPtr) NULL) { tuiDelwin (genericWin->handle); genericWin->handle = (WINDOW *) NULL; freeWinContent (genericWin); } break; case DATA_WIN: if (winInfo->generic.content != (OpaquePtr) NULL) { freeDataContent ( winInfo->detail.dataDisplayInfo.regsContent, winInfo->detail.dataDisplayInfo.regsContentCount); winInfo->detail.dataDisplayInfo.regsContent = (TuiWinContent) NULL; winInfo->detail.dataDisplayInfo.regsContentCount = 0; freeDataContent ( winInfo->detail.dataDisplayInfo.dataContent, winInfo->detail.dataDisplayInfo.dataContentCount); winInfo->detail.dataDisplayInfo.dataContent = (TuiWinContent) NULL; winInfo->detail.dataDisplayInfo.dataContentCount = 0; winInfo->detail.dataDisplayInfo.regsDisplayType = TUI_UNDEFINED_REGS; winInfo->detail.dataDisplayInfo.regsColumnCount = 1; winInfo->detail.dataDisplayInfo.displayRegs = FALSE; winInfo->generic.content = (OpaquePtr) NULL; winInfo->generic.contentSize = 0; } break; default: break; } if (winInfo->generic.handle != (WINDOW *) NULL) { tuiDelwin (winInfo->generic.handle); winInfo->generic.handle = (WINDOW *) NULL; freeWinContent (&winInfo->generic); } if (winInfo->generic.title) xfree (winInfo->generic.title); xfree (winInfo); }