]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
* tuiSourceWin.c (tui_show_source_line): New function.
authorStephane Carrez <stcarrez@nerim.fr>
Sat, 24 Aug 2002 12:28:33 +0000 (12:28 +0000)
committerStephane Carrez <stcarrez@nerim.fr>
Sat, 24 Aug 2002 12:28:33 +0000 (12:28 +0000)
(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
gdb/tui/tuiGeneralWin.c
gdb/tui/tuiGeneralWin.h
gdb/tui/tuiLayout.c
gdb/tui/tuiSourceWin.c
gdb/tui/tuiSourceWin.h
gdb/tui/tuiWin.c
gdb/tui/tuiWin.h

index 1a2c668334d4890f11dc9bc0e1edddad1bd5d820..1223a47c4c54e93603725f112b3e3f0d2f906dc8 100644 (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.
index 7b60068d2a07e5d5f707a2c465ba5dc47fb99951..b8f3b0c50736b77bda0b2d978d1546df394f2668 100644 (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;
     }
index 201619966dade7d24da59a4bfcc5da4782800f15..42d1ce46add279b467d1ba66af8bf36b80135cef 100644 (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);
index aa98882d9d38143ee952079272ac4c7390d2f896..7db2b707a7c15ddda2c14a9c9479455a53e65cce 100644 (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 */
+}
 
 
 /*
index 5f19ba69c9969f4deae930fb39a094608673d837..e91cfe9b458323239521bb4de2a131ea48b2b490 100644 (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;
-
-      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 */
+}
 
 
 /*
index 391077bc20582270b428e92521b0b982a366ad0f..850331918282412d408ec556f8d8e4d340e53d7d 100644 (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 *);
index a33f6613606269338f9f0f27926b6d4b370bb077..dccdcd7f8d5acf93ad89abc607b6160a5bc030bf 100644 (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);
index ac210421e0d4fd782b882312b4293c9c357fd286..76e1c8895b052085f886bdf970ef911e637e5b0b 100644 (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);