+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.
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 */
+}
/*
(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;
}
/* 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.
/*
** Functions
*/
-extern void tuiClearWin (TuiGenWinInfoPtr);
extern void unhighlightWin (TuiWinInfoPtr);
extern void makeVisible (TuiGenWinInfoPtr, int);
extern void makeAllVisible (int);
** 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)
}
}
}
-
- return;
-} /* showLayout */
+}
/*
{
if (newLayout != curLayout)
{
- if (winWithFocus != cmdWin)
- tuiClearWinFocus ();
showLayout (newLayout);
/*
** Now determine where focus should be
status = TUI_FAILURE;
return status;
-} /* tuiSetLayout */
+}
/*
** tuiAddWinToLayout().
((TuiWinInfoPtr) opaqueWinInfo)->canHighlight = TRUE;
}
makeWindow (generic, boxIt);
- if (winType == LOCATOR_WIN)
- tuiClearLocatorDisplay ();
}
*winInfoPtr = opaqueWinInfo;
-
- return;
-} /* _initAndMakeWin */
+}
/*
} /* tuiClearSourceContent */
-/*
- ** tuiClearAllSourceWinsContent().
- */
-void
-tuiClearAllSourceWinsContent (int displayPrompt)
-{
- int i;
-
- for (i = 0; i < (sourceWindows ())->count; i++)
- tuiClearSourceContent ((TuiWinInfoPtr) (sourceWindows ())->list[i],
- displayPrompt);
-
- return;
-} /* tuiClearAllSourceWinsContent */
-
-
/*
** tuiEraseSourceContent().
*/
} /* 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 */
+}
/*
/* 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.
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 *);
}
-/*
- ** 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
{
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]);
}
}
}
- tuiClearLocatorDisplay ();
tuiShowLocatorContent ();
-
- return;
-} /* tuiRefreshAll */
+}
/*
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)
status = TUI_SUCCESS;
if (newHeight != primaryWinInfo->generic.height)
{
- int i, diff;
+ int diff;
TuiWinInfoPtr winInfo;
TuiGenWinInfoPtr locator = locatorWinInfoPtr ();
TuiLayoutType curLayout = currentLayout ();
_makeInvisibleAndSetNewHeight (TuiWinInfoPtr winInfo, int height)
{
int i;
- struct symtab *s;
TuiGenWinInfoPtr genWinInfo;
default:
break;
}
-
- return;
-} /* _makeInvisibleAndSetNewHeight */
+}
/*
static void
_makeVisibleWithNewHeight (TuiWinInfoPtr winInfo)
{
- int i;
struct symtab *s;
m_beVisible (&winInfo->generic);
if (m_hasLocator (winInfo))
{
m_beVisible (locatorWinInfoPtr ());
- tuiClearLocatorDisplay ();
tuiShowLocatorContent ();
}
break;
if (ok)
{
- int diff, curHeight;
+ int diff;
TuiLayoutType curLayout = currentLayout ();
diff = (newHeight - primaryWinInfo->generic.height) * (-1);
/* 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.
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);