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 NUM_PLOTS    2
26 #define PLOT_SHIFT   2
27 
28 #ifdef __cplusplus
29 extern "C" {
30 #endif
31 
32 
33 
34 typedef struct _TM_GRAPH_CONTROL
35 {
36     HWND     hParentWnd;
37     HWND     hWnd;
38     HDC      hdcGraph;
39     HBITMAP  hbmGraph;
40     HPEN     hPenGrid;
41     HPEN     hPen0;
42     HPEN     hPen1;
43     HBRUSH   hBrushBack;
44 
45     INT      BitmapWidth;
46     INT      BitmapHeight;
47     INT      GridCellWidth;
48     INT      GridCellHeight;
49     INT      CurrShift;
50 
51     PBYTE    PointBuffer;
52     UINT32   NumberOfPoints;
53     UINT32   CurrIndex;
54 
55     FLOAT    ftPixelsPerPercent;
56     BOOL     DrawSecondaryPlot;
57 }
58 TM_GRAPH_CONTROL, *PTM_GRAPH_CONTROL;
59 
60 typedef struct _TM_FORMAT
61 {
62     COLORREF  clrBack;
63     COLORREF  clrGrid;
64     COLORREF  clrPlot0;
65     COLORREF  clrPlot1;
66     INT       GridCellWidth;
67     INT       GridCellHeight;
68     BOOL      DrawSecondaryPlot;
69 }
70 TM_FORMAT, *PTM_FORMAT;
71 
72 extern WNDPROC OldGraphCtrlWndProc;
73 INT_PTR CALLBACK GraphCtrl_WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
74 
75 BOOL GraphCtrl_Create(PTM_GRAPH_CONTROL inst, HWND hWnd, HWND hParentWnd, PTM_FORMAT fmt);
76 void GraphCtrl_Dispose(PTM_GRAPH_CONTROL inst);
77 void GraphCtrl_AddPoint(PTM_GRAPH_CONTROL inst, BYTE val0, BYTE val1);
78 void GraphCtrl_RedrawOnHeightChange(PTM_GRAPH_CONTROL inst, INT nh);
79 void GraphCtrl_RedrawBitmap(PTM_GRAPH_CONTROL inst, INT h);
80 
81 #ifdef __cplusplus
82 }
83 #endif
84