home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Media Share 9
/
MEDIASHARE_09.ISO
/
mag&info
/
msjv7_6.zip
/
TOPTEN.ARJ
/
ETO.ARJ
/
ETO.85L
< 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:59:43 1992
Program Statistics
------------------
Total time: 16171.004 milliseconds
Time before any line: 11.392 milliseconds
Total lines: 102
Total hits: 16374
Line coverage: 97.1%
Module Statistics for f:\exttext\eto.exe
----------------------------------------
Time in module: 16159.611 milliseconds
Percent of time in module: 100.0%
Lines in module: 102
Hits in module: 16374
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.009 0.0 1 {
35: MSG msg ;
36: WNDCLASS wndclass ;
37: int i;
38:
39: 0.008 0.0 1 if (!hPrevInstance)
40: {
41: // Register the Parent Window
42:
43: 0.008 0.0 1 wndclass.style = CS_BYTEALIGNCLIENT;
44: 0.010 0.0 1 wndclass.lpfnWndProc = (WNDPROC)WndProc ;
45: 0.008 0.0 1 wndclass.cbClsExtra = 0 ;
46: 0.010 0.0 1 wndclass.cbWndExtra = 0 ;
47: 0.008 0.0 1 wndclass.hInstance = hInstance ;
48: 0.010 0.0 1 wndclass.hIcon = NULL;
49: 0.174 0.0 1 wndclass.hCursor = LoadCursor (NULL, IDC_ARROW) ;
50: 0.022 0.0 1 wndclass.hbrBackground = GetStockObject ( LTGRAY_BRUSH ) ;
51: 0.009 0.0 1 wndclass.lpszMenuName = (LPSTR)"PlainMenu" ;
52: 0.010 0.0 1 wndclass.lpszClassName = szAppName ;
53:
54: 0.362 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.010 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: 2.146 0.0 16 );
71:
72: 0.009 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: 4.069 0.0 1 NULL, NULL, hInstance, NULL) ;
80:
81:
82: 0.072 0.0 1 ShowWindow ( ghWnd, nCmdShow );
83: 0.075 0.0 1 UpdateWindow ( ghWnd );
84:
85: 5387.754 33.3 112 while (GetMessage((LPMSG)&msg, NULL, 0, 0))
86: {
87: 10.895 0.1 111 TranslateMessage(&msg);
88: 15.098 0.1 111 DispatchMessage(&msg);
89: 10.633 0.1 111 }
90:
91: 0.084 0.0 1 for ( i = 0; i < 16; i++ )
92: 3.481 0.0 16 DeleteObject ( hRGBBrush[i] );
93:
94: 0.082 0.0 1 return msg.wParam ;
95: 0.109 0.0 1 }
96:
97: /*********************************************************************
98: * *
99: * WndProc: Main Message Translator *
100: * *
101: *********************************************************************/
102:
103: WINPROC WndProc ( WINDOWS_PARAMS )
104: 40.897 0.3 462 {
105: 39.003 0.2 462 switch ( msg )
106: {
107: case WM_COMMAND :
108:
109: 0.342 0.0 4 switch ( wParam )
110: {
111: 0.081 0.0 1 case IDM_RECT_FILLRECT: TestIDM_RECT_FILLRECT ( hWnd ); break;
112: 0.083 0.0 1 case IDM_RECT_ETO : TestIDM_RECT_ETO ( hWnd ); break;
113: 0.082 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.328 0.0 4 break;
117:
118: case WM_CREATE :
119:
120: 0.006 0.0 1 break;
121:
122: case WM_DESTROY :
123:
124: 0.098 0.0 1 PostQuitMessage (0) ;
125: 0.080 0.0 1 break ;
126:
127: default :
128:
129: 117.449 0.7 456 return DefWindowProc ( hWnd, msg, wParam, lParam );
130:
131: 0.000 0.0 0 }
132: 0.410 0.0 6 return 0L ;
133: 3059.840 18.9 462 }
134: //*************************************************************************
135: //
136: //
137: //
138: //*************************************************************************
139:
140: void TestIDM_RECT_FILLRECT ( HWND hWnd )
141: 0.084 0.0 1 {
142: RECT r;
143: int i, j;
144: HDC hDC;
145:
146: 0.100 0.0 1 GetClientRect ( hWnd, &r );
147:
148: 0.553 0.0 1 hDC = GetDC ( hWnd );
149:
150: 0.083 0.0 1 for ( j = 0; j < 3; j++ )
151: 0.248 0.0 3 for ( i = 0; i < 16; i++ )
152: 542.617 3.4 48 FillRect ( hDC, &r, hRGBBrush[i] );
153:
154: 0.346 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.081 0.0 1 {
166: RECT r;
167: int i, j;
168: HDC hDC;
169:
170: 0.098 0.0 1 GetClientRect ( hWnd, &r );
171:
172: 0.548 0.0 1 hDC = GetDC ( hWnd );
173:
174: 0.082 0.0 1 for ( j = 0; j < 3; j++ )
175: 0.248 0.0 3 for ( i = 0; i < 16; i++ )
176: {
177: 7.892 0.0 48 SetBkColor ( hDC, dwRGB[i] );
178: 526.781 3.3 48 ExtTextOut ( hDC, 0, 0, ETO_OPAQUE, &r, NULL, NULL, NULL );
179: 3.948 0.0 48 }
180:
181: 0.335 0.0 1 ReleaseDC ( hWnd, hDC );
182: 0.085 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.098 0.0 1 char szTest[] = "This is a test!!!! ABCDEFGHIJKLMNOPQRSTUVWXYZ";
198: 0.104 0.0 1 int cbTest = lstrlen ( szTest );
199:
200: 0.101 0.0 1 GetClientRect ( hWnd, &r );
201:
202: 0.548 0.0 1 hDC = GetDC ( hWnd );
203:
204: 0.227 0.0 1 wCharHeight = HIWORD (GetTextExtent(hDC, szTest, cbTest));
205:
206: 0.202 0.0 1 r.left = LOWORD (GetTextExtent(hDC, szTest, cbTest));
207:
208: 0.084 0.0 1 iNumLines = r.bottom / wCharHeight;
209:
210: 0.082 0.0 1 for ( j = 0; j < 3; j++ )
211: 0.248 0.0 3 for ( i = 0; i < 16; i++ )
212: {
213: 8.575 0.1 48 SetBkColor ( hDC, dwRGB[i] );
214: 7.812 0.0 48 SetTextColor ( hDC, dwRGB[15-i] );
215:
216: 4.009 0.0 48 for ( k = 0; k < iNumLines; k++ )
217: {
218: 129.210 0.8 1488 r.top = k*wCharHeight;
219: 130.044 0.8 1488 r.bottom = r.top + wCharHeight;
220: 2225.483 13.8 1488 TextOut ( hDC, 0, k*wCharHeight, szTest, cbTest );
221: 474.886 2.9 1488 FillRect ( hDC, &r, hRGBBrush[i] );
222: 128.220 0.8 1488 }
223:
224: 3.952 0.0 48 }
225:
226: 0.345 0.0 1 ReleaseDC ( hWnd, hDC );
227: 0.084 0.0 1 }
228:
229: //*************************************************************************
230: //
231: //
232: //
233: //*************************************************************************
234:
235: void TestIDM_TEXT_ETO ( HWND hWnd )
236: 0.085 0.0 1 {
237: RECT r;
238: int i, j, k;
239: HDC hDC;
240: int iNumLines;
241: WORD wCharHeight;
242: 0.099 0.0 1 char szTest[] = "This is a test!!!! ABCDEFGHIJKLMNOPQRSTUVWXYZ";
243: 0.106 0.0 1 int cbTest = lstrlen ( szTest );
244:
245: 0.103 0.0 1 GetClientRect ( hWnd, &r );
246:
247: 0.556 0.0 1 hDC = GetDC ( hWnd );
248:
249: 0.229 0.0 1 wCharHeight = HIWORD (GetTextExtent(hDC, szTest, cbTest));
250:
251: 0.081 0.0 1 iNumLines = r.bottom / wCharHeight;
252:
253: 0.083 0.0 1 for ( j = 0; j < 3; j++ )
254: 0.252 0.0 3 for ( i = 0; i < 16; i++ )
255: {
256: 8.089 0.1 48 SetBkColor ( hDC, dwRGB[i] );
257: 7.310 0.0 48 SetTextColor ( hDC, dwRGB[15-i] );
258:
259: 4.216 0.0 48 for ( k = 0; k < iNumLines; k++ )
260: {
261: 129.966 0.8 1488 r.top = k*wCharHeight;
262: 127.270 0.8 1488 r.bottom = r.top + wCharHeight;
263: 2856.132 17.7 1488 ExtTextOut ( hDC, 0, k*wCharHeight, ETO_OPAQUE, &r, szTest, cbTest, NULL );
264: 127.629 0.8 1488 }
265:
266: 4.411 0.0 48 }
267:
268: 0.349 0.0 1 ReleaseDC ( hWnd, hDC );
269: 0.085 0.0 1 }
270: