Michael Stefaniuc : taskmgr: Remove some old commented out code, mostly C++.

Alexandre Julliard julliard at winehq.org
Thu Jul 14 08:58:05 CDT 2016


Module: wine
Branch: master
Commit: 4c5e3205eee1653b153494951807e51fd9e59de5
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=4c5e3205eee1653b153494951807e51fd9e59de5

Author: Michael Stefaniuc <mstefani at redhat.de>
Date:   Wed Jul 13 09:51:26 2016 +0200

taskmgr: Remove some old commented out code, mostly C++.

Signed-off-by: Michael Stefaniuc <mstefani at redhat.de>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 programs/taskmgr/applpage.c |   6 ---
 programs/taskmgr/graphctl.c | 108 --------------------------------------------
 programs/taskmgr/graphctl.h |  13 ------
 programs/taskmgr/perfpage.c |  24 +---------
 programs/taskmgr/procpage.c |   6 ---
 5 files changed, 1 insertion(+), 156 deletions(-)

diff --git a/programs/taskmgr/applpage.c b/programs/taskmgr/applpage.c
index c7debec..e2874b5 100644
--- a/programs/taskmgr/applpage.c
+++ b/programs/taskmgr/applpage.c
@@ -49,12 +49,6 @@ static HANDLE   hApplicationPageEvent = NULL;   /* When this event becomes signa
 static BOOL     bSortAscending = TRUE;
 
 static const WCHAR    wszUser32[] = {'U','S','E','R','3','2','.','D','L','L',0};
-#if 0
-void SwitchToThisWindow (
-HWND hWnd,   /* Handle to the window that should be activated */
-BOOL bRestore /* Restore the window if it is minimized */
-);
-#endif
 
 static void ApplicationPageUpdate(void)
 {
diff --git a/programs/taskmgr/graphctl.c b/programs/taskmgr/graphctl.c
index 6e83412..70051eb 100644
--- a/programs/taskmgr/graphctl.c
+++ b/programs/taskmgr/graphctl.c
@@ -106,21 +106,6 @@ static void GraphCtrl_Init(TGraphCtrl* this)
     this->m_bitmapOldPlot = NULL;
 }
 
-#if 0
-TGraphCtrl::~TGraphCtrl(void)
-{
-    /*  just to be picky restore the bitmaps for the two memory dc's */
-    /*  (these dc's are being destroyed so there shouldn't be any leaks) */
-    if (m_bitmapOldGrid != NULL) SelectObject(m_dcGrid, m_bitmapOldGrid);  
-    if (m_bitmapOldPlot != NULL) SelectObject(m_dcPlot, m_bitmapOldPlot);  
-    if (m_bitmapGrid    != NULL) DeleteObject(m_bitmapGrid);
-    if (m_bitmapPlot    != NULL) DeleteObject(m_bitmapPlot);
-    if (m_dcGrid        != NULL) DeleteDC(m_dcGrid);
-    if (m_dcPlot        != NULL) DeleteDC(m_dcPlot);
-    if (m_brushBack     != NULL) DeleteObject(m_brushBack);
-}
-#endif
-
 static void GraphCtrl_Resize(TGraphCtrl* this)
 {
     /*  NOTE: Resize automatically gets called during the setup of the control */
@@ -132,17 +117,10 @@ static void GraphCtrl_Resize(TGraphCtrl* this)
 
     /*  the "left" coordinate and "width" will be modified in  */
     /*  InvalidateCtrl to be based on the width of the y axis scaling */
-#if 0
-    this->m_rectPlot.left   = 20;
-    this->m_rectPlot.top    = 10;
-    this->m_rectPlot.right  = this->m_rectClient.right-10;
-    this->m_rectPlot.bottom = this->m_rectClient.bottom-25;
-#else
     this->m_rectPlot.left   = 0;
     this->m_rectPlot.top    = -1;
     this->m_rectPlot.right  = this->m_rectClient.right-0;
     this->m_rectPlot.bottom = this->m_rectClient.bottom-0;
-#endif
 
     /*  set some member variables to avoid multiple function calls */
     this->m_nPlotHeight = this->m_rectPlot.bottom - this->m_rectPlot.top;/* m_rectPlot.Height(); */
@@ -242,61 +220,6 @@ static void GraphCtrl_InvalidateCtrl(TGraphCtrl* this)
         }
     }
 
-#if 0
-    /*  create some fonts (horizontal and vertical) */
-    /*  use a height of 14 pixels and 300 weight  */
-    /*  (these may need to be adjusted depending on the display) */
-    axisFont = CreateFont (14, 0, 0, 0, 300,
-                           FALSE, FALSE, 0, ANSI_CHARSET,
-                           OUT_DEFAULT_PRECIS, 
-                           CLIP_DEFAULT_PRECIS,
-                           DEFAULT_QUALITY, 
-                           DEFAULT_PITCH|FF_SWISS, "Arial");
-    yUnitFont = CreateFont (14, 0, 900, 0, 300,
-                            FALSE, FALSE, 0, ANSI_CHARSET,
-                            OUT_DEFAULT_PRECIS, 
-                            CLIP_DEFAULT_PRECIS,
-                            DEFAULT_QUALITY, 
-                            DEFAULT_PITCH|FF_SWISS, "Arial");
-  
-    /*  grab the horizontal font */
-    oldFont = SelectObject(m_dcGrid, axisFont);
-  
-    /*  y max */
-    SetTextColor(m_dcGrid, m_crGridColor);
-    SetTextAlign(m_dcGrid, TA_RIGHT|TA_TOP);
-    sprintf(strTemp, "%.*lf", m_nYDecimals, m_dUpperLimit);
-    TextOut(m_dcGrid, m_rectPlot.left-4, m_rectPlot.top, strTemp, _tcslen(strTemp));
-
-    /*  y min */
-    SetTextAlign(m_dcGrid, TA_RIGHT|TA_BASELINE);
-    sprintf(strTemp, "%.*lf", m_nYDecimals, m_dLowerLimit);
-    TextOut(m_dcGrid, m_rectPlot.left-4, m_rectPlot.bottom, strTemp, _tcslen(strTemp));
-
-    /*  x min */
-    SetTextAlign(m_dcGrid, TA_LEFT|TA_TOP);
-    TextOut(m_dcGrid, m_rectPlot.left, m_rectPlot.bottom+4, "0", 1);
-
-    /*  x max */
-    SetTextAlign(m_dcGrid, TA_RIGHT|TA_TOP);
-    sprintf(strTemp, "%d", m_nPlotWidth/m_nShiftPixels); 
-    TextOut(m_dcGrid, m_rectPlot.right, m_rectPlot.bottom+4, strTemp, _tcslen(strTemp));
-
-    /*  x units */
-    SetTextAlign(m_dcGrid, TA_CENTER|TA_TOP);
-    TextOut(m_dcGrid, (m_rectPlot.left+m_rectPlot.right)/2, 
-            m_rectPlot.bottom+4, m_strXUnitsString, _tcslen(m_strXUnitsString));
-
-    /*  restore the font */
-    SelectObject(m_dcGrid, oldFont);
-
-    /*  y units */
-    oldFont = SelectObject(m_dcGrid, yUnitFont);
-    SetTextAlign(m_dcGrid, TA_CENTER|TA_BASELINE);
-    TextOut(m_dcGrid, (m_rectClient.left+m_rectPlot.left)/2, 
-            (m_rectPlot.bottom+m_rectPlot.top)/2, m_strYUnitsString, _tcslen(m_strYUnitsString));
-    SelectObject(m_dcGrid, oldFont);
-#endif
     /*  at this point we are done filling the grid bitmap,  */
     /*  no more drawing to this bitmap is needed until the settings are changed */
   
@@ -329,22 +252,6 @@ void GraphCtrl_SetRange(TGraphCtrl* this, double dLower, double dUpper, int nDec
     GraphCtrl_InvalidateCtrl(this);
 }
 
-#if 0
-void TGraphCtrl::SetXUnits(const char* string)
-{
-    lstrcpynA(m_strXUnitsString, string, sizeof(m_strXUnitsString));
-    /*  clear out the existing garbage, re-start with a clean plot */
-    InvalidateCtrl();
-}
-
-void TGraphCtrl::SetYUnits(const char* string)
-{
-    lstrcpynA(m_strYUnitsString, string, sizeof(m_strYUnitsString));
-    /*  clear out the existing garbage, re-start with a clean plot */
-    InvalidateCtrl();
-}
-#endif
-
 void GraphCtrl_SetGridColor(TGraphCtrl* this, COLORREF color)
 {
     this->m_crGridColor = color;
@@ -479,12 +386,6 @@ static void GraphCtrl_Paint(TGraphCtrl* this, HWND hWnd, HDC dc)
     HBITMAP memBitmap;
     HBITMAP oldBitmap; /*  bitmap originally found in CMemDC */
 
-/*   RECT rcClient; */
-/*   GetClientRect(hWnd, &rcClient); */
-/*   FillSolidRect(dc, &rcClient, RGB(255, 0, 255)); */
-/*   m_nClientWidth = rcClient.right - rcClient.left; */
-/*   m_nClientHeight = rcClient.bottom - rcClient.top; */
-
     /*  no real plotting work is performed here,  */
     /*  just putting the existing bitmaps on the client */
 
@@ -509,15 +410,6 @@ static void GraphCtrl_Paint(TGraphCtrl* this, HWND hWnd, HDC dc)
     DeleteDC(memDC);
 }
 
-#if 0
-void TGraphCtrl::Reset(void)
-{
-    /*  to clear the existing data (in the form of a bitmap) */
-    /*  simply invalidate the entire control */
-    InvalidateCtrl();
-}
-#endif
-
 extern TGraphCtrl PerformancePageCpuUsageHistoryGraph;
 extern TGraphCtrl PerformancePageMemUsageHistoryGraph;
 extern HWND hPerformancePageCpuUsageHistoryGraph;
diff --git a/programs/taskmgr/graphctl.h b/programs/taskmgr/graphctl.h
index 2adb494..f9fb967 100644
--- a/programs/taskmgr/graphctl.h
+++ b/programs/taskmgr/graphctl.h
@@ -30,19 +30,6 @@
 extern "C" {
 #endif
 
-#if 0
-
-/* Attributes */
-public:
-  void SetXUnits(const char* string);
-  void SetYUnits(const char* string);
-
-  /* Operations */
-public:
-  BOOL Create(DWORD dwStyle, const RECT& rect, HWND hParentWnd, UINT nID=NULL);
-
-#endif
-
 typedef struct
 {
   int m_nShiftPixels;          /* amount to shift with each new point */
diff --git a/programs/taskmgr/perfpage.c b/programs/taskmgr/perfpage.c
index 5276de7..3969ce4 100644
--- a/programs/taskmgr/perfpage.c
+++ b/programs/taskmgr/perfpage.c
@@ -273,9 +273,6 @@ PerformancePageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
 	int		nXDifference;
 	int		nYDifference;
 
-/*     HDC hdc; */
-/*     PAINTSTRUCT ps; */
-
     switch (message) {
 	case WM_INITDIALOG:
 		
@@ -324,11 +321,6 @@ PerformancePageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
         GraphCtrl_Create(&PerformancePageCpuUsageHistoryGraph, hPerformancePageCpuUsageHistoryGraph, hDlg, IDC_CPU_USAGE_HISTORY_GRAPH);
         /*  customize the control */
         GraphCtrl_SetRange(&PerformancePageCpuUsageHistoryGraph, 0.0, 100.0, 10);
-/*         PerformancePageCpuUsageHistoryGraph.SetYUnits("Current") ; */
-/*         PerformancePageCpuUsageHistoryGraph.SetXUnits("Samples (Windows Timer: 100 msec)") ; */
-/*         PerformancePageCpuUsageHistoryGraph.SetBackgroundColor(RGB(0, 0, 64)) ; */
-/*         PerformancePageCpuUsageHistoryGraph.SetGridColor(RGB(192, 192, 255)) ; */
-/*         PerformancePageCpuUsageHistoryGraph.SetPlotColor(RGB(255, 255, 255)) ; */
         GraphCtrl_SetBackgroundColor(&PerformancePageCpuUsageHistoryGraph, RGB(0, 0, 0)) ;
         GraphCtrl_SetGridColor(&PerformancePageCpuUsageHistoryGraph, RGB(152, 205, 152)) ;
         GraphCtrl_SetPlotColor(&PerformancePageCpuUsageHistoryGraph, 0, RGB(255, 0, 0)) ;
@@ -356,21 +348,7 @@ PerformancePageWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
 
 	case WM_COMMAND:
 		break;
-#if 0
-    case WM_NCPAINT:
-        hdc = GetDC(hDlg);
-        GetClientRect(hDlg, &rc);
-        Draw3dRect(hdc, rc.left, rc.top, rc.right, rc.top + 2, GetSysColor(COLOR_3DSHADOW), GetSysColor(COLOR_3DHILIGHT));
-        ReleaseDC(hDlg, hdc);
-        break;
-
-    case WM_PAINT:
-        hdc = BeginPaint(hDlg, &ps);
-        GetClientRect(hDlg, &rc);
-        Draw3dRect(hdc, rc.left, rc.top, rc.right, rc.top + 2, GetSysColor(COLOR_3DSHADOW), GetSysColor(COLOR_3DHILIGHT));
-        EndPaint(hDlg, &ps);
-        break;
-#endif
+
 	case WM_SIZE:
         do {
 		int		cx, cy;
diff --git a/programs/taskmgr/procpage.c b/programs/taskmgr/procpage.c
index 1b0aacd..beccd86 100644
--- a/programs/taskmgr/procpage.c
+++ b/programs/taskmgr/procpage.c
@@ -166,12 +166,6 @@ static void ProcessPageOnNotify(LPARAM lParam)
     {
         switch (pnmh->code)
         {
-#if 0
-        case LVN_ITEMCHANGED:
-            ProcessPageUpdate();
-            break;
-#endif
-            
         case LVN_GETDISPINFOW:
 
             if (!(pnmdi->item.mask & LVIF_TEXT))




More information about the wine-cvs mailing list