* 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.
This commit is contained in:
Stephane Carrez 2002-08-24 12:28:33 +00:00
parent e9ae5755d3
commit bc712bbf17
8 changed files with 67 additions and 134 deletions

View File

@ -1,3 +1,26 @@
2002-08-24 Stephane Carrez <stcarrez@nerim.fr>
* 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 <stcarrez@nerim.fr>
* tuiSourceWin.c (tuiSrcWinIsDisplayed): Remove.

View File

@ -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;
}

View File

@ -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);

View File

@ -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 */
}
/*

View File

@ -259,22 +259,6 @@ tuiClearSourceContent (TuiWinInfoPtr winInfo, int displayPrompt)
} /* tuiClearSourceContent */
/*
** tuiClearAllSourceWinsContent().
*/
void
tuiClearAllSourceWinsContent (int displayPrompt)
{
int i;
for (i = 0; i < (sourceWindows ())->count; i++)
tuiClearSourceContent ((TuiWinInfoPtr) (sourceWindows ())->list[i],
displayPrompt);
return;
} /* tuiClearAllSourceWinsContent */
/*
** tuiEraseSourceContent().
*/
@ -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;
int lineno;
for (curLine = 1; (curLine <= winInfo->generic.contentSize); curLine++)
mvwaddstr (
winInfo->generic.handle,
curLine,
1,
((TuiWinElementPtr)
winInfo->generic.content[curLine - 1])->whichElement.source.line);
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 */
}
/*

View File

@ -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 *);

View File

@ -397,37 +397,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);

View File

@ -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);