1*c2c66affSColin Finck /*
2*c2c66affSColin Finck * ReactOS RosPerf - ReactOS GUI performance test program
3*c2c66affSColin Finck *
4*c2c66affSColin Finck * This program is free software; you can redistribute it and/or modify
5*c2c66affSColin Finck * it under the terms of the GNU General Public License as published by
6*c2c66affSColin Finck * the Free Software Foundation; either version 2 of the License, or
7*c2c66affSColin Finck * (at your option) any later version.
8*c2c66affSColin Finck *
9*c2c66affSColin Finck * This program is distributed in the hope that it will be useful,
10*c2c66affSColin Finck * but WITHOUT ANY WARRANTY; without even the implied warranty of
11*c2c66affSColin Finck * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12*c2c66affSColin Finck * GNU General Public License for more details.
13*c2c66affSColin Finck *
14*c2c66affSColin Finck * You should have received a copy of the GNU General Public License
15*c2c66affSColin Finck * along with this program; if not, write to the Free Software
16*c2c66affSColin Finck * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17*c2c66affSColin Finck */
18*c2c66affSColin Finck
19*c2c66affSColin Finck #include <windows.h>
20*c2c66affSColin Finck #include "rosperf.h"
21*c2c66affSColin Finck
22*c2c66affSColin Finck void
LinesProc(void * Context,PPERF_INFO PerfInfo,unsigned Reps)23*c2c66affSColin Finck LinesProc(void *Context, PPERF_INFO PerfInfo, unsigned Reps)
24*c2c66affSColin Finck {
25*c2c66affSColin Finck unsigned Rep;
26*c2c66affSColin Finck int Dest;
27*c2c66affSColin Finck HDC Dc;
28*c2c66affSColin Finck
29*c2c66affSColin Finck for (Rep = 0; Rep < Reps; )
30*c2c66affSColin Finck {
31*c2c66affSColin Finck Dc = (Rep & 0x1000) ? PerfInfo->BackgroundDc : PerfInfo->ForegroundDc;
32*c2c66affSColin Finck
33*c2c66affSColin Finck for (Dest = 2; Dest < PerfInfo->WndHeight && Rep < Reps; Rep++, Dest += 2)
34*c2c66affSColin Finck {
35*c2c66affSColin Finck MoveToEx(Dc, 0, 0, NULL);
36*c2c66affSColin Finck LineTo(Dc, PerfInfo->WndWidth, Dest);
37*c2c66affSColin Finck }
38*c2c66affSColin Finck
39*c2c66affSColin Finck for (Dest = PerfInfo->WndWidth - 2; 0 <= Dest && Rep < Reps; Rep++, Dest -= 2)
40*c2c66affSColin Finck {
41*c2c66affSColin Finck MoveToEx(Dc, PerfInfo->WndWidth, 0, NULL);
42*c2c66affSColin Finck LineTo(Dc, Dest, PerfInfo->WndHeight);
43*c2c66affSColin Finck }
44*c2c66affSColin Finck
45*c2c66affSColin Finck for (Dest = PerfInfo->WndHeight - 2; 0 <= Dest && Rep < Reps; Rep++, Dest -= 2)
46*c2c66affSColin Finck {
47*c2c66affSColin Finck MoveToEx(Dc, PerfInfo->WndWidth, PerfInfo->WndHeight, NULL);
48*c2c66affSColin Finck LineTo(Dc, 0, Dest);
49*c2c66affSColin Finck }
50*c2c66affSColin Finck
51*c2c66affSColin Finck for (Dest = 2; Dest < PerfInfo->WndWidth && Rep < Reps; Rep++, Dest += 2)
52*c2c66affSColin Finck {
53*c2c66affSColin Finck MoveToEx(Dc, 0, PerfInfo->WndHeight, NULL);
54*c2c66affSColin Finck LineTo(Dc, Dest, 0);
55*c2c66affSColin Finck }
56*c2c66affSColin Finck }
57*c2c66affSColin Finck }
58*c2c66affSColin Finck
59*c2c66affSColin Finck void
LinesHorizontalProc(void * Context,PPERF_INFO PerfInfo,unsigned Reps)60*c2c66affSColin Finck LinesHorizontalProc(void *Context, PPERF_INFO PerfInfo, unsigned Reps)
61*c2c66affSColin Finck {
62*c2c66affSColin Finck unsigned Rep;
63*c2c66affSColin Finck int y;
64*c2c66affSColin Finck HDC Dc;
65*c2c66affSColin Finck
66*c2c66affSColin Finck for (Rep = 0; Rep < Reps; )
67*c2c66affSColin Finck {
68*c2c66affSColin Finck Dc = (Rep & 0x10000) ? PerfInfo->BackgroundDc : PerfInfo->ForegroundDc;
69*c2c66affSColin Finck
70*c2c66affSColin Finck for (y = 0; y < PerfInfo->WndHeight && Rep < Reps; Rep++, y += 3)
71*c2c66affSColin Finck {
72*c2c66affSColin Finck MoveToEx(Dc, 0, y, NULL);
73*c2c66affSColin Finck LineTo(Dc, PerfInfo->WndWidth, y);
74*c2c66affSColin Finck }
75*c2c66affSColin Finck }
76*c2c66affSColin Finck }
77*c2c66affSColin Finck
78*c2c66affSColin Finck void
LinesVerticalProc(void * Context,PPERF_INFO PerfInfo,unsigned Reps)79*c2c66affSColin Finck LinesVerticalProc(void *Context, PPERF_INFO PerfInfo, unsigned Reps)
80*c2c66affSColin Finck {
81*c2c66affSColin Finck unsigned Rep;
82*c2c66affSColin Finck int x;
83*c2c66affSColin Finck HDC Dc;
84*c2c66affSColin Finck
85*c2c66affSColin Finck for (Rep = 0; Rep < Reps; )
86*c2c66affSColin Finck {
87*c2c66affSColin Finck Dc = (Rep & 0x1000) ? PerfInfo->BackgroundDc : PerfInfo->ForegroundDc;
88*c2c66affSColin Finck
89*c2c66affSColin Finck for (x = 0; x < PerfInfo->WndWidth && Rep < Reps; Rep++, x += 3)
90*c2c66affSColin Finck {
91*c2c66affSColin Finck MoveToEx(Dc, x, 0, NULL);
92*c2c66affSColin Finck LineTo(Dc, x, PerfInfo->WndHeight);
93*c2c66affSColin Finck }
94*c2c66affSColin Finck }
95*c2c66affSColin Finck }
96*c2c66affSColin Finck
97*c2c66affSColin Finck /* EOF */
98