Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
07ccd5a3
Commit
07ccd5a3
authored
Feb 05, 2009
by
Francois Gouget
Committed by
Alexandre Julliard
Feb 05, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
taskmgr: Reorder some functions to avoid forward declarations in graphctl.c.
parent
097863ba
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
119 additions
and
123 deletions
+119
-123
graphctl.c
programs/taskmgr/graphctl.c
+119
-119
graphctl.h
programs/taskmgr/graphctl.h
+0
-4
No files found.
programs/taskmgr/graphctl.c
View file @
07ccd5a3
...
...
@@ -124,66 +124,45 @@ TGraphCtrl::~TGraphCtrl(void)
}
#endif
BOOL
GraphCtrl_Create
(
TGraphCtrl
*
this
,
HWND
hWnd
,
HWND
hParentWnd
,
UINT
nID
)
void
GraphCtrl_Resize
(
TGraphCtrl
*
this
)
{
GraphCtrl_Init
(
this
);
this
->
m_hParentWnd
=
hParentWnd
;
this
->
m_hWnd
=
hWnd
;
GraphCtrl_Resize
(
this
);
return
0
;
}
/* NOTE: Resize automatically gets called during the setup of the control */
GetClientRect
(
this
->
m_hWnd
,
&
this
->
m_rectClient
);
void
GraphCtrl_SetRange
(
TGraphCtrl
*
this
,
double
dLower
,
double
dUpper
,
int
nDecimalPlaces
)
{
/* ASSERT(dUpper > dLower); */
this
->
m_dLowerLimit
=
dLower
;
this
->
m_dUpperLimit
=
dUpper
;
this
->
m_nYDecimals
=
nDecimalPlaces
;
this
->
m_dRange
=
this
->
m_dUpperLimit
-
this
->
m_dLowerLimit
;
this
->
m_dVerticalFactor
=
(
double
)
this
->
m_nPlotHeight
/
this
->
m_dRange
;
/* clear out the existing garbage, re-start with a clean plot */
GraphCtrl_InvalidateCtrl
(
this
);
}
/* set some member variables to avoid multiple function calls */
this
->
m_nClientHeight
=
this
->
m_rectClient
.
bottom
-
this
->
m_rectClient
.
top
;
/* m_rectClient.Height(); */
this
->
m_nClientWidth
=
this
->
m_rectClient
.
right
-
this
->
m_rectClient
.
left
;
/* m_rectClient.Width(); */
/* the "left" coordinate and "width" will be modified in */
/* InvalidateCtrl to be based on the width of the y axis scaling */
#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();
}
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
void
GraphCtrl_SetGridColor
(
TGraphCtrl
*
this
,
COLORREF
color
)
{
this
->
m_crGridColor
=
color
;
/* clear out the existing garbage, re-start with a clean plot */
GraphCtrl_InvalidateCtrl
(
this
);
}
/* set some member variables to avoid multiple function calls */
this
->
m_nPlotHeight
=
this
->
m_rectPlot
.
bottom
-
this
->
m_rectPlot
.
top
;
/* m_rectPlot.Height(); */
this
->
m_nPlotWidth
=
this
->
m_rectPlot
.
right
-
this
->
m_rectPlot
.
left
;
/* m_rectPlot.Width(); */
void
GraphCtrl_SetPlotColor
(
TGraphCtrl
*
this
,
int
plot
,
COLORREF
color
)
{
this
->
m_crPlotColor
[
plot
]
=
color
;
DeleteObject
(
this
->
m_penPlot
[
plot
]);
this
->
m_penPlot
[
plot
]
=
CreatePen
(
PS_SOLID
,
0
,
this
->
m_crPlotColor
[
plot
]);
/* clear out the existing garbage, re-start with a clean plot */
GraphCtrl_InvalidateCtrl
(
this
);
/* set the scaling factor for now, this can be adjusted */
/* in the SetRange functions */
this
->
m_dVerticalFactor
=
(
double
)
this
->
m_nPlotHeight
/
this
->
m_dRange
;
}
void
GraphCtrl_SetBackgroundColor
(
TGraphCtrl
*
this
,
COLORREF
color
)
BOOL
GraphCtrl_Create
(
TGraphCtrl
*
this
,
HWND
hWnd
,
HWND
hParentWnd
,
UINT
nID
)
{
this
->
m_crBackColor
=
color
;
DeleteObject
(
this
->
m_brushBack
)
;
this
->
m_
brushBack
=
CreateSolidBrush
(
this
->
m_crBackColor
)
;
/* clear out the existing garbage, re-start with a clean plot */
GraphCtrl_InvalidateCtrl
(
this
)
;
GraphCtrl_Init
(
this
)
;
this
->
m_hParentWnd
=
hParentWnd
;
this
->
m_
hWnd
=
hWnd
;
GraphCtrl_Resize
(
this
);
return
0
;
}
void
GraphCtrl_InvalidateCtrl
(
TGraphCtrl
*
this
)
...
...
@@ -342,57 +321,57 @@ void GraphCtrl_InvalidateCtrl(TGraphCtrl* this)
ReleaseDC
(
this
->
m_hParentWnd
,
dc
);
}
double
GraphCtrl_AppendPoint
(
TGraphCtrl
*
this
,
double
dNewPoint0
,
double
dNewPoint1
,
double
dNewPoint2
,
double
dNewPoint3
)
void
GraphCtrl_SetRange
(
TGraphCtrl
*
this
,
double
dLower
,
double
dUpper
,
int
nDecimalPlaces
)
{
/* append a data point to the plot & return the previous point */
double
dPrevious
;
dPrevious
=
this
->
m_dCurrentPosition
[
0
];
this
->
m_dCurrentPosition
[
0
]
=
dNewPoint0
;
this
->
m_dCurrentPosition
[
1
]
=
dNewPoint1
;
this
->
m_dCurrentPosition
[
2
]
=
dNewPoint2
;
this
->
m_dCurrentPosition
[
3
]
=
dNewPoint3
;
GraphCtrl_DrawPoint
(
this
);
/* Invalidate(); */
return
dPrevious
;
/* ASSERT(dUpper > dLower); */
this
->
m_dLowerLimit
=
dLower
;
this
->
m_dUpperLimit
=
dUpper
;
this
->
m_nYDecimals
=
nDecimalPlaces
;
this
->
m_dRange
=
this
->
m_dUpperLimit
-
this
->
m_dLowerLimit
;
this
->
m_dVerticalFactor
=
(
double
)
this
->
m_nPlotHeight
/
this
->
m_dRange
;
/* clear out the existing garbage, re-start with a clean plot */
GraphCtrl_InvalidateCtrl
(
this
);
}
void
GraphCtrl_Paint
(
TGraphCtrl
*
this
,
HWND
hWnd
,
HDC
dc
)
#if 0
void TGraphCtrl::SetXUnits(const char* string)
{
HDC
memDC
;
HBITMAP
memBitmap
;
HBITMAP
oldBitmap
;
/* bitmap originally found in CMemDC */
lstrcpynA(m_strXUnitsString, string, sizeof(m_strXUnitsString));
/* clear out the existing garbage, re-start with a clean plot */
InvalidateCtrl();
}
/* RECT rcClient; */
/* GetClientRect(hWnd, &rcClient); */
/* FillSolidRect(dc, &rcClient, RGB(255, 0, 255)); */
/* m_nClientWidth = rcClient.right - rcClient.left; */
/* m_nClientHeight = rcClient.bottom - rcClient.top; */
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
/* no real plotting work is performed here, */
/* just putting the existing bitmaps on the client */
/* to avoid flicker, establish a memory dc, draw to it */
/* and then BitBlt it to the client */
memDC
=
CreateCompatibleDC
(
dc
);
memBitmap
=
CreateCompatibleBitmap
(
dc
,
this
->
m_nClientWidth
,
this
->
m_nClientHeight
);
oldBitmap
=
SelectObject
(
memDC
,
memBitmap
);
void
GraphCtrl_SetGridColor
(
TGraphCtrl
*
this
,
COLORREF
color
)
{
this
->
m_crGridColor
=
color
;
/* clear out the existing garbage, re-start with a clean plot */
GraphCtrl_InvalidateCtrl
(
this
);
}
if
(
memDC
!=
NULL
)
{
/* first drop the grid on the memory dc */
BitBlt
(
memDC
,
0
,
0
,
this
->
m_nClientWidth
,
this
->
m_nClientHeight
,
this
->
m_dcGrid
,
0
,
0
,
SRCCOPY
);
/* now add the plot on top as a "pattern" via SRCPAINT. */
/* works well with dark background and a light plot */
BitBlt
(
memDC
,
0
,
0
,
this
->
m_nClientWidth
,
this
->
m_nClientHeight
,
this
->
m_dcPlot
,
0
,
0
,
SRCPAINT
);
/* SRCPAINT */
/* finally send the result to the display */
BitBlt
(
dc
,
0
,
0
,
this
->
m_nClientWidth
,
this
->
m_nClientHeight
,
memDC
,
0
,
0
,
SRCCOPY
);
}
SelectObject
(
memDC
,
oldBitmap
);
DeleteObject
(
memBitmap
);
DeleteDC
(
memDC
);
void
GraphCtrl_SetPlotColor
(
TGraphCtrl
*
this
,
int
plot
,
COLORREF
color
)
{
this
->
m_crPlotColor
[
plot
]
=
color
;
DeleteObject
(
this
->
m_penPlot
[
plot
]);
this
->
m_penPlot
[
plot
]
=
CreatePen
(
PS_SOLID
,
0
,
this
->
m_crPlotColor
[
plot
]);
/* clear out the existing garbage, re-start with a clean plot */
GraphCtrl_InvalidateCtrl
(
this
);
}
void
GraphCtrl_SetBackgroundColor
(
TGraphCtrl
*
this
,
COLORREF
color
)
{
this
->
m_crBackColor
=
color
;
DeleteObject
(
this
->
m_brushBack
);
this
->
m_brushBack
=
CreateSolidBrush
(
this
->
m_crBackColor
);
/* clear out the existing garbage, re-start with a clean plot */
GraphCtrl_InvalidateCtrl
(
this
);
}
void
GraphCtrl_DrawPoint
(
TGraphCtrl
*
this
)
...
...
@@ -481,36 +460,57 @@ void GraphCtrl_DrawPoint(TGraphCtrl* this)
}
}
void
GraphCtrl_Resize
(
TGraphCtrl
*
this
)
double
GraphCtrl_AppendPoint
(
TGraphCtrl
*
this
,
double
dNewPoint0
,
double
dNewPoint1
,
double
dNewPoint2
,
double
dNewPoint3
)
{
/*
NOTE: Resize automatically gets called during the setup of the control
*/
GetClientRect
(
this
->
m_hWnd
,
&
this
->
m_rectClient
)
;
/*
append a data point to the plot & return the previous point
*/
double
dPrevious
;
/* set some member variables to avoid multiple function calls */
this
->
m_nClientHeight
=
this
->
m_rectClient
.
bottom
-
this
->
m_rectClient
.
top
;
/* m_rectClient.Height(); */
this
->
m_nClientWidth
=
this
->
m_rectClient
.
right
-
this
->
m_rectClient
.
left
;
/* m_rectClient.Width(); */
dPrevious
=
this
->
m_dCurrentPosition
[
0
];
this
->
m_dCurrentPosition
[
0
]
=
dNewPoint0
;
this
->
m_dCurrentPosition
[
1
]
=
dNewPoint1
;
this
->
m_dCurrentPosition
[
2
]
=
dNewPoint2
;
this
->
m_dCurrentPosition
[
3
]
=
dNewPoint3
;
GraphCtrl_DrawPoint
(
this
);
/* Invalidate(); */
return
dPrevious
;
}
/* 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
void
GraphCtrl_Paint
(
TGraphCtrl
*
this
,
HWND
hWnd
,
HDC
dc
)
{
HDC
memDC
;
HBITMAP
memBitmap
;
HBITMAP
oldBitmap
;
/* bitmap originally found in CMemDC */
/* set some member variables to avoid multiple function calls */
this
->
m_nPlotHeight
=
this
->
m_rectPlot
.
bottom
-
this
->
m_rectPlot
.
top
;
/* m_rectPlot.Height(); */
this
->
m_nPlotWidth
=
this
->
m_rectPlot
.
right
-
this
->
m_rectPlot
.
left
;
/* m_rectPlot.Width(); */
/* RECT rcClient; */
/* GetClientRect(hWnd, &rcClient); */
/* FillSolidRect(dc, &rcClient, RGB(255, 0, 255)); */
/* m_nClientWidth = rcClient.right - rcClient.left; */
/* m_nClientHeight = rcClient.bottom - rcClient.top; */
/* set the scaling factor for now, this can be adjusted */
/* in the SetRange functions */
this
->
m_dVerticalFactor
=
(
double
)
this
->
m_nPlotHeight
/
this
->
m_dRange
;
/* no real plotting work is performed here, */
/* just putting the existing bitmaps on the client */
/* to avoid flicker, establish a memory dc, draw to it */
/* and then BitBlt it to the client */
memDC
=
CreateCompatibleDC
(
dc
);
memBitmap
=
CreateCompatibleBitmap
(
dc
,
this
->
m_nClientWidth
,
this
->
m_nClientHeight
);
oldBitmap
=
SelectObject
(
memDC
,
memBitmap
);
if
(
memDC
!=
NULL
)
{
/* first drop the grid on the memory dc */
BitBlt
(
memDC
,
0
,
0
,
this
->
m_nClientWidth
,
this
->
m_nClientHeight
,
this
->
m_dcGrid
,
0
,
0
,
SRCCOPY
);
/* now add the plot on top as a "pattern" via SRCPAINT. */
/* works well with dark background and a light plot */
BitBlt
(
memDC
,
0
,
0
,
this
->
m_nClientWidth
,
this
->
m_nClientHeight
,
this
->
m_dcPlot
,
0
,
0
,
SRCPAINT
);
/* SRCPAINT */
/* finally send the result to the display */
BitBlt
(
dc
,
0
,
0
,
this
->
m_nClientWidth
,
this
->
m_nClientHeight
,
memDC
,
0
,
0
,
SRCCOPY
);
}
SelectObject
(
memDC
,
oldBitmap
);
DeleteObject
(
memBitmap
);
DeleteDC
(
memDC
);
}
#if 0
...
...
programs/taskmgr/graphctl.h
View file @
07ccd5a3
...
...
@@ -91,11 +91,7 @@ double GraphCtrl_AppendPoint(TGraphCtrl* this,
double
dNewPoint2
,
double
dNewPoint3
);
BOOL
GraphCtrl_Create
(
TGraphCtrl
*
this
,
HWND
hWnd
,
HWND
hParentWnd
,
UINT
nID
);
void
GraphCtrl_DrawPoint
(
TGraphCtrl
*
this
);
void
GraphCtrl_InvalidateCtrl
(
TGraphCtrl
*
this
);
void
GraphCtrl_Paint
(
TGraphCtrl
*
this
,
HWND
hWnd
,
HDC
dc
);
void
GraphCtrl_Reset
(
TGraphCtrl
*
this
);
void
GraphCtrl_Resize
(
TGraphCtrl
*
this
);
void
GraphCtrl_SetBackgroundColor
(
TGraphCtrl
*
this
,
COLORREF
color
);
void
GraphCtrl_SetGridColor
(
TGraphCtrl
*
this
,
COLORREF
color
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment