home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Media Share 9
/
MEDIASHARE_09.ISO
/
mag&info
/
msjv7_6.zip
/
TOPTEN.ARJ
/
ETO.ARJ
/
ETO.VGA
< prev
next >
Wrap
Text File
|
1992-10-01
|
17KB
|
298 lines
Microsoft PLIST Version 1.20
Profile: Line timing, sorted by line.
Date: Sun Jun 07 11:53:20 1992
Program Statistics
------------------
Total time: 13754.184 milliseconds
Time before any line: 10.978 milliseconds
Total lines: 102
Total hits: 11850
Line coverage: 97.1%
Module Statistics for f:\exttext\eto.exe
----------------------------------------
Time in module: 13743.206 milliseconds
Percent of time in module: 100.0%
Lines in module: 102
Hits in module: 11850
Module line coverage: 97.1%
Source file: f:\exttext\eto.c
Line Hit
Line Time % count Source
--------------------------------------
1: #include <windows.h>
2:
3: #include "basedefs.h"
4: #include "eto.h"
5:
6: WINPROC WndProc ( WINDOWS_PARAMS );
7:
8: void TestIDM_RECT_FILLRECT ( HWND hWnd );
9: void TestIDM_RECT_ETO ( HWND hWnd );
10: void TestIDM_TEXT_TEXTOUT ( HWND hWnd );
11: void TestIDM_TEXT_ETO ( HWND hWnd );
12:
13: /**************************************************************
14: * *
15: * Global Variables *
16: * *
17: **************************************************************/
18:
19: HANDLE ghInst;
20: HWND ghWnd;
21: char szNullString[] = "";
22: char szAppName[] = "ETO";
23: HBRUSH hRGBBrush[16];
24: COLORREF dwRGB[16];
25:
26: /**************************************************************
27: * *
28: * WinMain *
29: * *
30: **************************************************************/
31:
32: int PASCAL WinMain (HANDLE hInstance, HANDLE hPrevInstance,
33: LPSTR lpszCmdLine, int nCmdShow )
34: 0.008 0.0 1 {
35: MSG msg ;
36: WNDCLASS wndclass ;
37: int i;
38:
39: 0.003 0.0 1 if (!hPrevInstance)
40: {
41: // Register the Parent Window
42:
43: 0.003 0.0 1 wndclass.style = CS_BYTEALIGNCLIENT;
44: 0.003 0.0 1 wndclass.lpfnWndProc = (WNDPROC)WndProc ;
45: 0.005 0.0 1 wndclass.cbClsExtra = 0 ;
46: 0.003 0.0 1 wndclass.cbWndExtra = 0 ;
47: 0.005 0.0 1 wndclass.hInstance = hInstance ;
48: 0.003 0.0 1 wndclass.hIcon = NULL;
49: 0.151 0.0 1 wndclass.hCursor = LoadCursor (NULL, IDC_ARROW) ;
50: 0.013 0.0 1 wndclass.hbrBackground = GetStockObject ( LTGRAY_BRUSH ) ;
51: 0.002 0.0 1 wndclass.lpszMenuName = (LPSTR)"PlainMenu" ;
52: 0.003 0.0 1 wndclass.lpszClassName = szAppName ;
53:
54: 0.350 0.0 1 if (!RegisterClass (&wndclass))
55: 0.000 0.0 0 return FALSE;
56:
57: }
58:
59: // Generate sixteen cached brushes, for each of the solid colors,
60: // and fill in the dwRGB array
61:
62: 0.007 0.0 1 for ( i = 0; i < 16; i++ )
63: hRGBBrush[i] = CreateSolidBrush ( dwRGB[i] =
64: RGB
65: (
66: min ((((i%8)&4)/4)*(((i%16)/8)+1)*128, 255),
67: min ((((i%8)&2)/2)*(((i%16)/8)+1)*128, 255),
68: min ((((i%8)&1)/1)*(((i%16)/8)+1)*128, 255)
69: )
70: 1.856 0.0 16 );
71:
72: 0.003 0.0 1 ghInst = hInstance;
73:
74:
75: ghWnd = CreateWindow (szAppName, "Tiny Windows App",
76: WS_OVERLAPPEDWINDOW,
77: CW_USEDEFAULT, 0,
78: CW_USEDEFAULT, 0,
79: 3.771 0.0 1 NULL, NULL, hInstance, NULL) ;
80:
81:
82: 0.056 0.0 1 ShowWindow ( ghWnd, nCmdShow );
83: 0.056 0.0 1 UpdateWindow ( ghWnd );
84:
85: 4485.348 32.6 78 while (GetMessage((LPMSG)&msg, NULL, 0, 0))
86: {
87: 10.675 0.1 77 TranslateMessage(&msg);
88: 14.888 0.1 77 DispatchMessage(&msg);
89: 6.302 0.0 77 }
90:
91: 0.081 0.0 1 for ( i = 0; i < 16; i++ )
92: 3.747 0.0 16 DeleteObject ( hRGBBrush[i] );
93:
94: 0.080 0.0 1 return msg.wParam ;
95: 0.107 0.0 1 }
96:
97: /*********************************************************************
98: * *
99: * WndProc: Main Message Translator *
100: * *
101: *********************************************************************/
102:
103: WINPROC WndProc ( WINDOWS_PARAMS )
104: 28.903 0.2 337 {
105: 27.827 0.2 337 switch ( msg )
106: {
107: case WM_COMMAND :
108:
109: 0.338 0.0 4 switch ( wParam )
110: {
111: 0.084 0.0 1 case IDM_RECT_FILLRECT: TestIDM_RECT_FILLRECT ( hWnd ); break;
112: 0.082 0.0 1 case IDM_RECT_ETO : TestIDM_RECT_ETO ( hWnd ); break;
113: 0.083 0.0 1 case IDM_TEXT_TEXTOUT : TestIDM_TEXT_TEXTOUT ( hWnd ); break;
114: 0.083 0.0 1 case IDM_TEXT_ETO : TestIDM_TEXT_ETO ( hWnd ); break;
115: 0.000 0.0 0 }
116: 0.330 0.0 4 break;
117:
118: case WM_CREATE :
119:
120: 0.004 0.0 1 break;
121:
122: case WM_DESTROY :
123:
124: 0.099 0.0 1 PostQuitMessage (0) ;
125: 0.081 0.0 1 break ;
126:
127: default :
128:
129: 116.185 0.8 331 return DefWindowProc ( hWnd, msg, wParam, lParam );
130:
131: 0.000 0.0 0 }
132: 0.837 0.0 6 return 0L ;
133: 2762.242 20.1 337 }
134: //*************************************************************************
135: //
136: //
137: //
138: //*************************************************************************
139:
140: void TestIDM_RECT_FILLRECT ( HWND hWnd )
141: 0.082 0.0 1 {
142: RECT r;
143: int i, j;
144: HDC hDC;
145:
146: 0.096 0.0 1 GetClientRect ( hWnd, &r );
147:
148: 0.541 0.0 1 hDC = GetDC ( hWnd );
149:
150: 0.084 0.0 1 for ( j = 0; j < 3; j++ )
151: 0.251 0.0 3 for ( i = 0; i < 16; i++ )
152: 923.935 6.7 48 FillRect ( hDC, &r, hRGBBrush[i] );
153:
154: 0.322 0.0 1 ReleaseDC ( hWnd, hDC );
155:
156: 0.084 0.0 1 }
157:
158: //*************************************************************************
159: //
160: //
161: //
162: //*************************************************************************
163:
164: void TestIDM_RECT_ETO ( HWND hWnd )
165: 0.082 0.0 1 {
166: RECT r;
167: int i, j;
168: HDC hDC;
169:
170: 0.093 0.0 1 GetClientRect ( hWnd, &r );
171:
172: 0.545 0.0 1 hDC = GetDC ( hWnd );
173:
174: 0.085 0.0 1 for ( j = 0; j < 3; j++ )
175: 0.251 0.0 3 for ( i = 0; i < 16; i++ )
176: {
177: 8.316 0.1 48 SetBkColor ( hDC, dwRGB[i] );
178: 952.456 6.9 48 ExtTextOut ( hDC, 0, 0, ETO_OPAQUE, &r, NULL, NULL, NULL );
179: 4.004 0.0 48 }
180:
181: 0.318 0.0 1 ReleaseDC ( hWnd, hDC );
182: 0.086 0.0 1 }
183:
184: //*************************************************************************
185: //
186: //
187: //
188: //*************************************************************************
189:
190: void TestIDM_TEXT_TEXTOUT ( HWND hWnd )
191: 0.082 0.0 1 {
192: RECT r;
193: int i, j, k;
194: HDC hDC;
195: int iNumLines;
196: WORD wCharHeight;
197: 0.096 0.0 1 char szTest[] = "This is a test!!!! ABCDEFGHIJKLMNOPQRSTUVWXYZ";
198: 0.105 0.0 1 int cbTest = lstrlen ( szTest );
199:
200: 0.095 0.0 1 GetClientRect ( hWnd, &r );
201:
202: 0.551 0.0 1 hDC = GetDC ( hWnd );
203:
204: 0.207 0.0 1 wCharHeight = HIWORD (GetTextExtent(hDC, szTest, cbTest));
205:
206: 0.183 0.0 1 r.left = LOWORD (GetTextExtent(hDC, szTest, cbTest));
207:
208: 0.082 0.0 1 iNumLines = r.bottom / wCharHeight;
209:
210: 0.085 0.0 1 for ( j = 0; j < 3; j++ )
211: 0.252 0.0 3 for ( i = 0; i < 16; i++ )
212: {
213: 6.341 0.0 48 SetBkColor ( hDC, dwRGB[i] );
214: 6.059 0.0 48 SetTextColor ( hDC, dwRGB[15-i] );
215:
216: 4.061 0.0 48 for ( k = 0; k < iNumLines; k++ )
217: {
218: 96.338 0.7 1056 r.top = k*wCharHeight;
219: 91.389 0.7 1056 r.bottom = r.top + wCharHeight;
220: 1312.952 9.6 1056 TextOut ( hDC, 0, k*wCharHeight, szTest, cbTest );
221: 702.363 5.1 1056 FillRect ( hDC, &r, hRGBBrush[i] );
222: 92.060 0.7 1056 }
223:
224: 4.410 0.0 48 }
225:
226: 0.322 0.0 1 ReleaseDC ( hWnd, hDC );
227: 0.087 0.0 1 }
228:
229: //*************************************************************************
230: //
231: //
232: //
233: //*************************************************************************
234:
235: void TestIDM_TEXT_ETO ( HWND hWnd )
236: 0.081 0.0 1 {
237: RECT r;
238: int i, j, k;
239: HDC hDC;
240: int iNumLines;
241: WORD wCharHeight;
242: 0.097 0.0 1 char szTest[] = "This is a test!!!! ABCDEFGHIJKLMNOPQRSTUVWXYZ";
243: 0.104 0.0 1 int cbTest = lstrlen ( szTest );
244:
245: 0.096 0.0 1 GetClientRect ( hWnd, &r );
246:
247: 0.554 0.0 1 hDC = GetDC ( hWnd );
248:
249: 0.209 0.0 1 wCharHeight = HIWORD (GetTextExtent(hDC, szTest, cbTest));
250:
251: 0.084 0.0 1 iNumLines = r.bottom / wCharHeight;
252:
253: 0.082 0.0 1 for ( j = 0; j < 3; j++ )
254: 0.246 0.0 3 for ( i = 0; i < 16; i++ )
255: {
256: 6.481 0.0 48 SetBkColor ( hDC, dwRGB[i] );
257: 6.087 0.0 48 SetTextColor ( hDC, dwRGB[15-i] );
258:
259: 4.074 0.0 48 for ( k = 0; k < iNumLines; k++ )
260: {
261: 94.930 0.7 1056 r.top = k*wCharHeight;
262: 91.861 0.7 1056 r.bottom = r.top + wCharHeight;
263: 1755.664 12.8 1056 ExtTextOut ( hDC, 0, k*wCharHeight, ETO_OPAQUE, &r, szTest, cbTest, NULL );
264: 103.702 0.8 1056 }
265:
266: 3.983 0.0 48 }
267:
268: 0.324 0.0 1 ReleaseDC ( hWnd, hDC );
269: 0.087 0.0 1 }
270: