Hopefully create a branch and not destroy the svn repository.
[reactos.git] / base / applications / taskmgr / graphctl.h
1 /*
2 * ReactOS Task Manager
3 *
4 * GraphCtrl.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 #ifndef __GRAPH_CTRL_H__
24 #define __GRAPH_CTRL_H__
25
26 #define MAX_PLOTS 4
27 #define MAX_CTRLS 4
28
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32
33 #if 0
34
35 /* Attributes */
36 public:
37 void SetXUnits(const char* string);
38 void SetYUnits(const char* string);
39
40 /* Operations */
41 public:
42 BOOL Create(DWORD dwStyle, const RECT& rect, HWND hParentWnd, UINT nID=NULL);
43
44 #endif
45
46 typedef struct
47 {
48 int m_nShiftPixels; /* amount to shift with each new point */
49 int m_nYDecimals;
50
51 char m_strXUnitsString[50];
52 char m_strYUnitsString[50];
53
54 COLORREF m_crBackColor; /* background color */
55 COLORREF m_crGridColor; /* grid color */
56 COLORREF m_crPlotColor[MAX_PLOTS]; /* data color */
57
58 double m_dCurrentPosition[MAX_PLOTS]; /* current position */
59 double m_dPreviousPosition[MAX_PLOTS]; /* previous position */
60
61 /* those were protected fields */
62 int m_nHalfShiftPixels;
63 int m_nPlotShiftPixels;
64 int m_nClientHeight;
65 int m_nClientWidth;
66 int m_nPlotHeight;
67 int m_nPlotWidth;
68
69 double m_dLowerLimit; /* lower bounds */
70 double m_dUpperLimit; /* upper bounds */
71 double m_dRange;
72 double m_dVerticalFactor;
73
74 HWND m_hWnd;
75 HWND m_hParentWnd;
76 HDC m_dcGrid;
77 HDC m_dcPlot;
78 HBITMAP m_bitmapOldGrid;
79 HBITMAP m_bitmapOldPlot;
80 HBITMAP m_bitmapGrid;
81 HBITMAP m_bitmapPlot;
82 HBRUSH m_brushBack;
83 HPEN m_penPlot[MAX_PLOTS];
84 RECT m_rectClient;
85 RECT m_rectPlot;
86 } TGraphCtrl;
87
88 extern WNDPROC OldGraphCtrlWndProc;
89 double GraphCtrl_AppendPoint(TGraphCtrl* this,
90 double dNewPoint0, double dNewPoint1,
91 double dNewPoint2, double dNewPoint3);
92 BOOL GraphCtrl_Create(TGraphCtrl* this, HWND hWnd, HWND hParentWnd,
93 UINT nID);
94 void GraphCtrl_Dispose(TGraphCtrl* this);
95 void GraphCtrl_DrawPoint(TGraphCtrl* this);
96 void GraphCtrl_InvalidateCtrl(TGraphCtrl* this, BOOL bResize);
97 void GraphCtrl_Paint(TGraphCtrl* this, HWND hWnd, HDC dc);
98 void GraphCtrl_Reset(TGraphCtrl* this);
99 void GraphCtrl_Resize(TGraphCtrl* this);
100 void GraphCtrl_SetBackgroundColor(TGraphCtrl* this, COLORREF
101 color);
102 void GraphCtrl_SetGridColor(TGraphCtrl* this, COLORREF color);
103 void GraphCtrl_SetPlotColor(TGraphCtrl* this, int plot, COLORREF
104 color);
105 void GraphCtrl_SetRange(TGraphCtrl* this, double dLower, double
106 dUpper, int nDecimalPlaces);
107
108 INT_PTR CALLBACK GraphCtrl_WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
109
110 #ifdef __cplusplus
111 }
112 #endif
113
114 #endif /* __GRAPH_CTRL_H__ */