Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

92 lines
2.6 KiB

  1. /*++
  2. Copyright (C) 1996-1999 Microsoft Corporation
  3. Module Name:
  4. grphdsp.h
  5. Abstract:
  6. Header file for the sysmon.ocx graph display.
  7. --*/
  8. #ifndef _GRPHDSP_H_
  9. #define _GRPHDSP_H_
  10. class CSysmonControl;
  11. class CGraphDisp
  12. {
  13. //friend LRESULT APIENTRY GraphDispWndProc (HWND hWnd,
  14. // UINT uiMsg,
  15. // WPARAM wParam,
  16. // LPARAM lParam);
  17. public:
  18. void ChangeFont ( HDC );
  19. static BOOL RegisterWndClass (HINSTANCE hInst) ;
  20. CGraphDisp ( void );
  21. ~CGraphDisp ( void);
  22. BOOL Init ( CSysmonControl *pCtrl, PGRAPHDATA pGraph ) ;
  23. void Update ( HDC );
  24. void Draw ( HDC, HDC hAttribDC, BOOL fMetafile, BOOL fEntire, PRECT prcUpdate);
  25. void HiliteItem ( PCGraphItem pItem );
  26. void SizeComponents ( HDC hDC, PRECT pRect );
  27. void GetPlotRect ( PRECT pRect ) { *pRect = m_rectPlot; }
  28. void SetBarConfigChanged ( BOOL bChanged = TRUE ) { m_bBarConfigChanged = bChanged; };
  29. PCGraphItem GetItem ( INT xPos, INT yPos );
  30. private:
  31. enum eGraphDisplayConstant {
  32. eHitRegion = 4
  33. };
  34. void DrawTimeLine ( HDC hDC, INT x);
  35. void DrawStartStopLine ( HDC hDC, INT x);
  36. void StartUpdate ( HDC hDC, BOOL fMetafile, BOOL fEntire, INT xLeft, INT xRight, BOOL bFill = TRUE );
  37. void FinishUpdate ( HDC hDC, BOOL fMetafile );
  38. void DrawGrid ( HDC hDC, INT iLeft, INT iRight);
  39. void PlotBarGraph ( HDC hDC , BOOL fUpdate);
  40. void PlotData ( HDC hDC, INT iHistIndx, INT nSteps, CStepper *pStepper );
  41. void UpdateTimeBar ( HDC, BOOL bPlotData = TRUE );
  42. PCGraphItem GetItemInLineGraph ( SHORT xPos, SHORT yPos );
  43. PCGraphItem GetItemInBarGraph ( SHORT xPos, SHORT yPos );
  44. INT RGBToLightness ( COLORREF );
  45. BOOL CalcYPosition ( PCGraphItem pItem, INT iHistIndex, BOOL bLog, INT y[3] );
  46. PGRAPHDATA m_pGraph;
  47. CSysmonControl *m_pCtrl;
  48. RECT m_rect;
  49. RECT m_rectPlot;
  50. CStepper m_GridStepper;
  51. HFONT m_hFontVertical;
  52. PCGraphItem m_pHiliteItem;
  53. HRGN m_rgnClipSave;
  54. BOOL m_bBarConfigChanged;
  55. // Min, Max and PixelScale are used for plot, hit test.
  56. double m_dMin;
  57. double m_dMax;
  58. double m_dPixelScale;
  59. COLORREF m_clrCurrentTimeBar;
  60. COLORREF m_clrCurrentGrid;
  61. HPEN m_hPenTimeBar;
  62. HPEN m_hPenGrid;
  63. };
  64. typedef CGraphDisp *PGRAPHDISP;
  65. #endif