From bc712bbf17bd3c4ead9c0cacc917cd58f7cc5267 Mon Sep 17 00:00:00 2001 From: Stephane Carrez Date: Sat, 24 Aug 2002 12:28:33 +0000 Subject: * tuiSourceWin.c (tui_show_source_line): New function. (tuiShowSourceContent): Call it and avoid clearing the window before redrawing it. (tuiClearAllSourceWinsContent): Remove. * tuiSourceWin.h (tuiClearAllSourceWinsContent): Don't declare. * tuiWin.h (tuiClearWinFocus, tuiClearWinFocusFrom): Don't declare. * tuiWin.c (tuiClearWinFocus, tuiClearWinFocusFrom): Remove. (tuiRefreshAll): Don't clear the window. (_makeVisibleWithNewHeight): Don't clear locator line. (tuiResizeAll): Remove unused locals. (_tuiAdjustWinHeights): Likewise. (_makeInvisibleAndSetNewHeight): Likewise. (_newHeightOk): Likewise. * tuiLayout.c (showLayout): Don't clear source windows. (tuiSetLayout): Don't clear the window. (_initAndMakeWin): Likewise for status line. * tuiGeneralWin.c (makeVisible): Don't clear or refresh the window. (makeWindow): Likewise. (tuiClearWin): Remove. * tuiGeneralWin.h (tuiClearWin): Don't declare. --- gdb/tui/ChangeLog | 23 ++++++++++++++++++ gdb/tui/tuiGeneralWin.c | 39 +----------------------------- gdb/tui/tuiGeneralWin.h | 3 +-- gdb/tui/tuiLayout.c | 15 +++--------- gdb/tui/tuiSourceWin.c | 64 +++++++++++++++++++++++++------------------------ gdb/tui/tuiSourceWin.h | 3 +-- gdb/tui/tuiWin.c | 52 ++++------------------------------------ gdb/tui/tuiWin.h | 4 +--- 8 files changed, 68 insertions(+), 135 deletions(-) (limited to 'gdb/tui') diff --git a/gdb/tui/ChangeLog b/gdb/tui/ChangeLog index 1a2c668..1223a47 100644 --- a/gdb/tui/ChangeLog +++ b/gdb/tui/ChangeLog @@ -1,5 +1,28 @@ 2002-08-24 Stephane Carrez + * tuiSourceWin.c (tui_show_source_line): New function. + (tuiShowSourceContent): Call it and avoid clearing the window before + redrawing it. + (tuiClearAllSourceWinsContent): Remove. + * tuiSourceWin.h (tuiClearAllSourceWinsContent): Don't declare. + * tuiWin.h (tuiClearWinFocus, tuiClearWinFocusFrom): Don't declare. + * tuiWin.c (tuiClearWinFocus, tuiClearWinFocusFrom): Remove. + (tuiRefreshAll): Don't clear the window. + (_makeVisibleWithNewHeight): Don't clear locator line. + (tuiResizeAll): Remove unused locals. + (_tuiAdjustWinHeights): Likewise. + (_makeInvisibleAndSetNewHeight): Likewise. + (_newHeightOk): Likewise. + * tuiLayout.c (showLayout): Don't clear source windows. + (tuiSetLayout): Don't clear the window. + (_initAndMakeWin): Likewise for status line. + * tuiGeneralWin.c (makeVisible): Don't clear or refresh the window. + (makeWindow): Likewise. + (tuiClearWin): Remove. + * tuiGeneralWin.h (tuiClearWin): Don't declare. + +2002-08-24 Stephane Carrez + * tuiSourceWin.c (tuiSrcWinIsDisplayed): Remove. (tuiAsmWinIsDisplayed): Remove. (tuiShowAllSourceWinsContent): Remove. diff --git a/gdb/tui/tuiGeneralWin.c b/gdb/tui/tuiGeneralWin.c index 7b60068..b8f3b0c 100644 --- a/gdb/tui/tuiGeneralWin.c +++ b/gdb/tui/tuiGeneralWin.c @@ -191,43 +191,8 @@ makeWindow (TuiGenWinInfoPtr winInfo, int boxIt) boxWin (winInfo, NO_HILITE); winInfo->isVisible = TRUE; scrollok (handle, TRUE); - tuiRefreshWin (winInfo); - -#ifndef FOR_TEST - if ( /*!m_WinIsAuxillary(winInfo->type) && */ - (winInfo->type != CMD_WIN) && - (winInfo->content == (OpaquePtr) NULL)) - { - mvwaddstr (handle, 1, 1, winName (winInfo)); - tuiRefreshWin (winInfo); - } -#endif /*FOR_TEST */ - } - - return; -} /* makeWindow */ - - -/* - ** tuiClearWin(). - ** Clear the window of all contents without calling wclear. - */ -void -tuiClearWin (TuiGenWinInfoPtr winInfo) -{ - if (m_genWinPtrNotNull (winInfo) && winInfo->handle != (WINDOW *) NULL) - { - int curRow, curCol; - - for (curRow = 0; (curRow < winInfo->height); curRow++) - for (curCol = 0; (curCol < winInfo->width); curCol++) - mvwaddch (winInfo->handle, curRow, curCol, ' '); - - tuiRefreshWin (winInfo); } - - return; -} /* tuiClearWin */ +} /* @@ -252,13 +217,11 @@ makeVisible (TuiGenWinInfoPtr winInfo, int visible) (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; } diff --git a/gdb/tui/tuiGeneralWin.h b/gdb/tui/tuiGeneralWin.h index 2016199..42d1ce4 100644 --- a/gdb/tui/tuiGeneralWin.h +++ b/gdb/tui/tuiGeneralWin.h @@ -1,5 +1,5 @@ /* General window behavior. - Copyright 1998, 1999, 2000, 2001 Free Software Foundation, Inc. + Copyright 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. Contributed by Hewlett-Packard Company. This file is part of GDB. @@ -25,7 +25,6 @@ /* ** Functions */ -extern void tuiClearWin (TuiGenWinInfoPtr); extern void unhighlightWin (TuiWinInfoPtr); extern void makeVisible (TuiGenWinInfoPtr, int); extern void makeAllVisible (int); diff --git a/gdb/tui/tuiLayout.c b/gdb/tui/tuiLayout.c index aa98882..7db2b70 100644 --- a/gdb/tui/tuiLayout.c +++ b/gdb/tui/tuiLayout.c @@ -111,7 +111,6 @@ showLayout (TuiLayoutType layout) ** should free the content and reallocate on next display of ** source/asm */ - tuiClearAllSourceWinsContent (NO_EMPTY_SOURCE_PROMPT); freeAllSourceWinsContent (); clearSourceWindows (); if (layout == SRC_DATA_COMMAND || layout == DISASSEM_DATA_COMMAND) @@ -146,9 +145,7 @@ showLayout (TuiLayoutType layout) } } } - - return; -} /* showLayout */ +} /* @@ -195,8 +192,6 @@ tuiSetLayout (TuiLayoutType layoutType, { if (newLayout != curLayout) { - if (winWithFocus != cmdWin) - tuiClearWinFocus (); showLayout (newLayout); /* ** Now determine where focus should be @@ -291,7 +286,7 @@ tuiSetLayout (TuiLayoutType layoutType, status = TUI_FAILURE; return status; -} /* tuiSetLayout */ +} /* ** tuiAddWinToLayout(). @@ -1033,13 +1028,9 @@ _initAndMakeWin (Opaque * winInfoPtr, TuiWinType winType, ((TuiWinInfoPtr) opaqueWinInfo)->canHighlight = TRUE; } makeWindow (generic, boxIt); - if (winType == LOCATOR_WIN) - tuiClearLocatorDisplay (); } *winInfoPtr = opaqueWinInfo; - - return; -} /* _initAndMakeWin */ +} /* diff --git a/gdb/tui/tuiSourceWin.c b/gdb/tui/tuiSourceWin.c index 5f19ba6..e91cfe9 100644 --- a/gdb/tui/tuiSourceWin.c +++ b/gdb/tui/tuiSourceWin.c @@ -260,22 +260,6 @@ tuiClearSourceContent (TuiWinInfoPtr winInfo, int displayPrompt) /* - ** tuiClearAllSourceWinsContent(). - */ -void -tuiClearAllSourceWinsContent (int displayPrompt) -{ - int i; - - for (i = 0; i < (sourceWindows ())->count; i++) - tuiClearSourceContent ((TuiWinInfoPtr) (sourceWindows ())->list[i], - displayPrompt); - - return; -} /* tuiClearAllSourceWinsContent */ - - -/* ** tuiEraseSourceContent(). */ void @@ -334,33 +318,51 @@ tuiEraseAllSourceWinsContent (int displayPrompt) } /* tuiEraseAllSourceWinsContent */ +/* Redraw the complete line of a source or disassembly window. */ +static void +tui_show_source_line (TuiWinInfoPtr winInfo, int lineno) +{ + TuiWinElementPtr line; + int x, y; + + line = (TuiWinElementPtr) winInfo->generic.content[lineno - 1]; + if (line->whichElement.source.isExecPoint) + wattron (winInfo->generic.handle, A_STANDOUT); + + mvwaddstr (winInfo->generic.handle, lineno, 1, + line->whichElement.source.line); + if (line->whichElement.source.isExecPoint) + wattroff (winInfo->generic.handle, A_STANDOUT); + + /* Clear to end of line but stop before the border. */ + getyx (winInfo->generic.handle, y, x); + while (x + 1 < winInfo->generic.width) + { + waddch (winInfo->generic.handle, ' '); + getyx (winInfo->generic.handle, y, x); + } +} + /* ** tuiShowSourceContent(). */ void tuiShowSourceContent (TuiWinInfoPtr winInfo) { - int curLine, i, curX; - - tuiEraseSourceContent (winInfo, (winInfo->generic.contentSize <= 0)); if (winInfo->generic.contentSize > 0) { - char *line; - - for (curLine = 1; (curLine <= winInfo->generic.contentSize); curLine++) - mvwaddstr ( - winInfo->generic.handle, - curLine, - 1, - ((TuiWinElementPtr) - winInfo->generic.content[curLine - 1])->whichElement.source.line); + int lineno; + + for (lineno = 1; lineno <= winInfo->generic.contentSize; lineno++) + tui_show_source_line (winInfo, lineno); } + else + tuiEraseSourceContent (winInfo, TRUE); + checkAndDisplayHighlightIfNeeded (winInfo); tuiRefreshWin (&winInfo->generic); winInfo->generic.contentInUse = TRUE; - - return; -} /* tuiShowSourceContent */ +} /* diff --git a/gdb/tui/tuiSourceWin.h b/gdb/tui/tuiSourceWin.h index 391077b..8503319 100644 --- a/gdb/tui/tuiSourceWin.h +++ b/gdb/tui/tuiSourceWin.h @@ -1,5 +1,5 @@ /* TUI display source/assembly window. - Copyright 1998, 1999, 2000, 2001 Free Software Foundation, Inc. + Copyright 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. Contributed by Hewlett-Packard Company. This file is part of GDB. @@ -31,7 +31,6 @@ extern void tuiUpdateSourceWindowsWithAddr (CORE_ADDR); extern void tuiUpdateSourceWindowsWithLine (struct symtab *, int); extern void tuiUpdateSourceWindowsFromLocator (void); extern void tuiClearSourceContent (TuiWinInfoPtr, int); -extern void tuiClearAllSourceWinsContent (int); extern void tuiEraseSourceContent (TuiWinInfoPtr, int); extern void tuiEraseAllSourceWinsContent (int); extern void tuiSetSourceContentNil (TuiWinInfoPtr, char *); diff --git a/gdb/tui/tuiWin.c b/gdb/tui/tuiWin.c index a33f661..dccdcd7 100644 --- a/gdb/tui/tuiWin.c +++ b/gdb/tui/tuiWin.c @@ -398,37 +398,6 @@ Usage: w <#lines>\n"); /* - ** tuiClearWinFocusFrom - ** Clear the logical focus from winInfo - */ -void -tuiClearWinFocusFrom (TuiWinInfoPtr winInfo) -{ - if (m_winPtrNotNull (winInfo)) - { - if (winInfo->generic.type != CMD_WIN) - unhighlightWin (winInfo); - tuiSetWinWithFocus ((TuiWinInfoPtr) NULL); - } - - return; -} /* tuiClearWinFocusFrom */ - - -/* - ** tuiClearWinFocus(). - ** Clear the window that has focus. - */ -void -tuiClearWinFocus (void) -{ - tuiClearWinFocusFrom (tuiWinWithFocus ()); - - return; -} /* tuiClearWinFocus */ - - -/* ** tuiSetWinFocusTo ** Set the logical focus to winInfo */ @@ -607,9 +576,6 @@ tuiRefreshAll (void) { case SRC_WIN: case DISASSEM_WIN: - tuiClearWin (&winList[type]->generic); - if (winList[type]->detail.sourceInfo.hasLocator) - tuiClearLocatorDisplay (); tuiShowSourceContent (winList[type]); checkAndDisplayHighlightIfNeeded (winList[type]); tuiEraseExecInfoContent (winList[type]); @@ -623,11 +589,8 @@ tuiRefreshAll (void) } } } - tuiClearLocatorDisplay (); tuiShowLocatorContent (); - - return; -} /* tuiRefreshAll */ +} /* @@ -650,7 +613,7 @@ tuiResizeAll (void) TuiWinInfoPtr firstWin, secondWin; TuiGenWinInfoPtr locator = locatorWinInfoPtr (); TuiWinType winType; - int i, newHeight, splitDiff, cmdSplitDiff, numWinsDisplayed = 2; + int newHeight, splitDiff, cmdSplitDiff, numWinsDisplayed = 2; /* turn keypad off while we resize */ if (winWithFocus != cmdWin) @@ -1168,7 +1131,7 @@ _tuiAdjustWinHeights (TuiWinInfoPtr primaryWinInfo, int newHeight) status = TUI_SUCCESS; if (newHeight != primaryWinInfo->generic.height) { - int i, diff; + int diff; TuiWinInfoPtr winInfo; TuiGenWinInfoPtr locator = locatorWinInfoPtr (); TuiLayoutType curLayout = currentLayout (); @@ -1316,7 +1279,6 @@ static void _makeInvisibleAndSetNewHeight (TuiWinInfoPtr winInfo, int height) { int i; - struct symtab *s; TuiGenWinInfoPtr genWinInfo; @@ -1365,9 +1327,7 @@ _makeInvisibleAndSetNewHeight (TuiWinInfoPtr winInfo, int height) default: break; } - - return; -} /* _makeInvisibleAndSetNewHeight */ +} /* @@ -1379,7 +1339,6 @@ _makeInvisibleAndSetNewHeight (TuiWinInfoPtr winInfo, int height) static void _makeVisibleWithNewHeight (TuiWinInfoPtr winInfo) { - int i; struct symtab *s; m_beVisible (&winInfo->generic); @@ -1421,7 +1380,6 @@ _makeVisibleWithNewHeight (TuiWinInfoPtr winInfo) if (m_hasLocator (winInfo)) { m_beVisible (locatorWinInfoPtr ()); - tuiClearLocatorDisplay (); tuiShowLocatorContent (); } break; @@ -1450,7 +1408,7 @@ _newHeightOk (TuiWinInfoPtr primaryWinInfo, int newHeight) if (ok) { - int diff, curHeight; + int diff; TuiLayoutType curLayout = currentLayout (); diff = (newHeight - primaryWinInfo->generic.height) * (-1); diff --git a/gdb/tui/tuiWin.h b/gdb/tui/tuiWin.h index ac21042..76e1c88 100644 --- a/gdb/tui/tuiWin.h +++ b/gdb/tui/tuiWin.h @@ -1,5 +1,5 @@ /* TUI window generic functions. - Copyright 1998, 1999, 2000, 2001 Free Software Foundation, Inc. + Copyright 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. Contributed by Hewlett-Packard Company. This file is part of GDB. @@ -37,8 +37,6 @@ extern void tuiScrollLeft (TuiWinInfoPtr, int); extern void tuiScrollRight (TuiWinInfoPtr, int); extern void tui_scroll (TuiScrollDirection, TuiWinInfoPtr, int); extern void tuiSetWinFocusTo (TuiWinInfoPtr); -extern void tuiClearWinFocusFrom (TuiWinInfoPtr); -extern void tuiClearWinFocus (void); extern void tuiResizeAll (void); extern void tuiRefreshAll (void); extern void tuiSigwinchHandler (int); -- cgit v1.1