Sync with trunk (r48545)
[reactos.git] / base / applications / taskmgr / graphctl.h
1 /*
2 * ReactOS Task Manager
3 *
4 * graphctl.h
5 *
6 * Copyright (C) 2002 Robert Dickenson <robd@reactos.org>
7 *
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public
10 * License as published by the Free Software Foundation; either
11 * version 2.1 of the License, or (at your option) any later version.
12 *
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this library; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 */
22
23 #pragma once
24
25 #define MAX_PLOTS 4
26 #define MAX_CTRLS 4
27
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31
32 #if 0
33
34 /* Attributes */
35 public:
36 void SetXUnits(const char* string);
37 void SetYUnits(const char* string);
38
39 /* Operations */
40 public:
41 BOOL Create(DWORD dwStyle, const RECT& rect, HWND hParentWnd, UINT nID=NULL);
42
43 #endif
44
45 typedef struct
46 {
47 int m_nShiftPixels; /* amount to shift with each new point */
48 int m_nYDecimals;
49
50 char m_strXUnitsString[50];
51 char m_strYUnitsString[50];
52
53 COLORREF m_crBackColor; /* background color */
54 COLORREF m_crGridColor; /* grid color */
55 COLORREF m_crPlotColor[MAX_PLOTS]; /* data color */
56
57 double m_dCurrentPosition[MAX_PLOTS]; /* current position */
58 double m_dPreviousPosition[MAX_PLOTS]; /* previous position */
59
60 /* those were protected fields */
61 int m_nHalfShiftPixels;
62 int m_nPlotShiftPixels;
63 int m_nClientHeight;
64 int m_nClientWidth;
65 int m_nPlotHeight;
66 int m_nPlotWidth;
67
68 double m_dLowerLimit; /* lower bounds */
69 double m_dUpperLimit; /* upper bounds */
70 double m_dRange;
71 double m_dVerticalFactor;
72
73 HWND m_hWnd;
74 HWND m_hParentWnd;
75 HDC m_dcGrid;
76 HDC m_dcPlot;
77 HBITMAP m_bitmapOldGrid;
78 HBITMAP m_bitmapOldPlot;
79 HBITMAP m_bitmapGrid;
80 HBITMAP m_bitmapPlot;
81 HBRUSH m_brushBack;
82 HPEN m_penPlot[MAX_PLOTS];
83 RECT m_rectClient;
84 RECT m_rectPlot;
85 } TGraphCtrl;
86
87 extern WNDPROC OldGraphCtrlWndProc;
88 double GraphCtrl_AppendPoint(TGraphCtrl* this,
89 double dNewPoint0, double dNewPoint1,
90 double dNewPoint2, double dNewPoint3);
91 BOOL GraphCtrl_Create(TGraphCtrl* this, HWND hWnd, HWND hParentWnd,
92 UINT nID);
93 void GraphCtrl_Dispose(TGraphCtrl* this);
94 void GraphCtrl_DrawPoint(TGraphCtrl* this);
95 void GraphCtrl_InvalidateCtrl(TGraphCtrl* this, BOOL bResize);
96 void GraphCtrl_Paint(TGraphCtrl* this, HWND hWnd, HDC dc);
97 void GraphCtrl_Reset(TGraphCtrl* this);
98 void GraphCtrl_Resize(TGraphCtrl* this);
99 void GraphCtrl_SetBackgroundColor(TGraphCtrl* this, COLORREF
100 color);
101 void GraphCtrl_SetGridColor(TGraphCtrl* this, COLORREF color);
102 void GraphCtrl_SetPlotColor(TGraphCtrl* this, int plot, COLORREF
103 color);
104 void GraphCtrl_SetRange(TGraphCtrl* this, double dLower, double
105 dUpper, int nDecimalPlaces);
106
107 INT_PTR CALLBACK GraphCtrl_WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
108
109 #ifdef __cplusplus
110 }
111 #endif