home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Media Share 9
/
MEDIASHARE_09.ISO
/
mag&info
/
msjv7_6.zip
/
TOPTEN.ARJ
/
ETO.ARJ
/
ETO.85S
< 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 12:01:20 1992
Program Statistics
------------------
Total time: 16706.216 milliseconds
Time before any line: 12.342 milliseconds
Total lines: 102
Total hits: 19962
Line coverage: 97.1%
Module Statistics for f:\exttext\eto.exe
----------------------------------------
Time in module: 16693.874 milliseconds
Percent of time in module: 100.0%
Lines in module: 102
Hits in module: 19962
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.000 0.0 1 {
35: MSG msg ;
36: WNDCLASS wndclass ;
37: int i;
38:
39: 0.000 0.0 1 if (!hPrevInstance)
40: {
41: // Register the Parent Window
42:
43: 0.000 0.0 1 wndclass.style = CS_BYTEALIGNCLIENT;
44: 0.000 0.0 1 wndclass.lpfnWndProc = (WNDPROC)WndProc ;
45: 0.000 0.0 1 wndclass.cbClsExtra = 0 ;
46: 0.000 0.0 1 wndclass.cbWndExtra = 0 ;
47: 0.000 0.0 1 wndclass.hInstance = hInstance ;
48: 0.001 0.0 1 wndclass.hIcon = NULL;
49: 0.164 0.0 1 wndclass.hCursor = LoadCursor (NULL, IDC_ARROW) ;
50: 0.013 0.0 1 wndclass.hbrBackground = GetStockObject ( LTGRAY_BRUSH ) ;
51: 0.000 0.0 1 wndclass.lpszMenuName = (LPSTR)"PlainMenu" ;
52: 0.000 0.0 1 wndclass.lpszClassName = szAppName ;
53:
54: 0.349 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.000 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.933 0.0 16 );
71:
72: 0.000 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.040 0.0 1 NULL, NULL, hInstance, NULL) ;
80:
81:
82: 0.065 0.0 1 ShowWindow ( ghWnd, nCmdShow );
83: 0.056 0.0 1 UpdateWindow ( ghWnd );
84:
85: 5166.409 30.9 95 while (GetMessage((LPMSG)&msg, NULL, 0, 0))
86: {
87: 8.966 0.1 94 TranslateMessage(&msg);
88: 13.870 0.1 94 DispatchMessage(&msg);
89: 8.188 0.0 94 }
90:
91: 0.078 0.0 1 for ( i = 0; i < 16; i++ )
92: 3.239 0.0 16 DeleteObject ( hRGBBrush[i] );
93:
94: 0.078 0.0 1 return msg.wParam ;
95: 0.090 0.0 1 }
96:
97: /*********************************************************************
98: * *
99: * WndProc: Main Message Translator *
100: * *
101: *********************************************************************/
102:
103: WINPROC WndProc ( WINDOWS_PARAMS )
104: 33.509 0.2 404 {
105: 33.548 0.2 404 switch ( msg )
106: {
107: case WM_COMMAND :
108:
109: 0.324 0.0 4 switch ( wParam )
110: {
111: 0.077 0.0 1 case IDM_RECT_FILLRECT: TestIDM_RECT_FILLRECT ( hWnd ); break;
112: 0.079 0.0 1 case IDM_RECT_ETO : TestIDM_RECT_ETO ( hWnd ); break;
113: 0.080 0.0 1 case IDM_TEXT_TEXTOUT : TestIDM_TEXT_TEXTOUT ( hWnd ); break;
114: 0.078 0.0 1 case IDM_TEXT_ETO : TestIDM_TEXT_ETO ( hWnd ); break;
115: 0.000 0.0 0 }
116: 0.312 0.0 4 break;
117:
118: case WM_CREATE :
119:
120: 0.000 0.0 1 break;
121:
122: case WM_DESTROY :
123:
124: 0.091 0.0 1 PostQuitMessage (0) ;
125: 0.076 0.0 1 break ;
126:
127: default :
128:
129: 95.426 0.6 398 return DefWindowProc ( hWnd, msg, wParam, lParam );
130:
131: 0.000 0.0 0 }
132: 0.406 0.0 6 return 0L ;
133: 3048.542 18.3 404 }
134: //*************************************************************************
135: //
136: //
137: //
138: //*************************************************************************
139:
140: void TestIDM_RECT_FILLRECT ( HWND hWnd )
141: 0.075 0.0 1 {
142: RECT r;
143: int i, j;
144: HDC hDC;
145:
146: 0.091 0.0 1 GetClientRect ( hWnd, &r );
147:
148: 0.543 0.0 1 hDC = GetDC ( hWnd );
149:
150: 0.080 0.0 1 for ( j = 0; j < 3; j++ )
151: 0.228 0.0 3 for ( i = 0; i < 16; i++ )
152: 561.634 3.4 48 FillRect ( hDC, &r, hRGBBrush[i] );
153:
154: 0.334 0.0 1 ReleaseDC ( hWnd, hDC );
155:
156: 0.079 0.0 1 }
157:
158: //*************************************************************************
159: //
160: //
161: //
162: //*************************************************************************
163:
164: void TestIDM_RECT_ETO ( HWND hWnd )
165: 0.077 0.0 1 {
166: RECT r;
167: int i, j;
168: HDC hDC;
169:
170: 0.089 0.0 1 GetClientRect ( hWnd, &r );
171:
172: 0.546 0.0 1 hDC = GetDC ( hWnd );
173:
174: 0.080 0.0 1 for ( j = 0; j < 3; j++ )
175: 0.239 0.0 3 for ( i = 0; i < 16; i++ )
176: {
177: 8.128 0.0 48 SetBkColor ( hDC, dwRGB[i] );
178: 545.074 3.3 48 ExtTextOut ( hDC, 0, 0, ETO_OPAQUE, &r, NULL, NULL, NULL );
179: 3.733 0.0 48 }
180:
181: 0.321 0.0 1 ReleaseDC ( hWnd, hDC );
182: 0.080 0.0 1 }
183:
184: //*************************************************************************
185: //
186: //
187: //
188: //*************************************************************************
189:
190: void TestIDM_TEXT_TEXTOUT ( HWND hWnd )
191: 0.078 0.0 1 {
192: RECT r;
193: int i, j, k;
194: HDC hDC;
195: int iNumLines;
196: WORD wCharHeight;
197: 0.091 0.0 1 char szTest[] = "This is a test!!!! ABCDEFGHIJKLMNOPQRSTUVWXYZ";
198: 0.099 0.0 1 int cbTest = lstrlen ( szTest );
199:
200: 0.094 0.0 1 GetClientRect ( hWnd, &r );
201:
202: 0.547 0.0 1 hDC = GetDC ( hWnd );
203:
204: 0.215 0.0 1 wCharHeight = HIWORD (GetTextExtent(hDC, szTest, cbTest));
205:
206: 0.184 0.0 1 r.left = LOWORD (GetTextExtent(hDC, szTest, cbTest));
207:
208: 0.077 0.0 1 iNumLines = r.bottom / wCharHeight;
209:
210: 0.076 0.0 1 for ( j = 0; j < 3; j++ )
211: 0.230 0.0 3 for ( i = 0; i < 16; i++ )
212: {
213: 7.571 0.0 48 SetBkColor ( hDC, dwRGB[i] );
214: 7.247 0.0 48 SetTextColor ( hDC, dwRGB[15-i] );
215:
216: 3.745 0.0 48 for ( k = 0; k < iNumLines; k++ )
217: {
218: 154.989 0.9 1920 r.top = k*wCharHeight;
219: 155.831 0.9 1920 r.bottom = r.top + wCharHeight;
220: 2405.826 14.4 1920 TextOut ( hDC, 0, k*wCharHeight, szTest, cbTest );
221: 600.355 3.6 1920 FillRect ( hDC, &r, hRGBBrush[i] );
222: 153.971 0.9 1920 }
223:
224: 3.673 0.0 48 }
225:
226: 0.323 0.0 1 ReleaseDC ( hWnd, hDC );
227: 0.076 0.0 1 }
228:
229: //*************************************************************************
230: //
231: //
232: //
233: //*************************************************************************
234:
235: void TestIDM_TEXT_ETO ( HWND hWnd )
236: 0.091 0.0 1 {
237: RECT r;
238: int i, j, k;
239: HDC hDC;
240: int iNumLines;
241: WORD wCharHeight;
242: 0.092 0.0 1 char szTest[] = "This is a test!!!! ABCDEFGHIJKLMNOPQRSTUVWXYZ";
243: 0.097 0.0 1 int cbTest = lstrlen ( szTest );
244:
245: 0.094 0.0 1 GetClientRect ( hWnd, &r );
246:
247: 0.554 0.0 1 hDC = GetDC ( hWnd );
248:
249: 0.216 0.0 1 wCharHeight = HIWORD (GetTextExtent(hDC, szTest, cbTest));
250:
251: 0.078 0.0 1 iNumLines = r.bottom / wCharHeight;
252:
253: 0.077 0.0 1 for ( j = 0; j < 3; j++ )
254: 0.226 0.0 3 for ( i = 0; i < 16; i++ )
255: {
256: 7.614 0.0 48 SetBkColor ( hDC, dwRGB[i] );
257: 7.029 0.0 48 SetTextColor ( hDC, dwRGB[15-i] );
258:
259: 3.983 0.0 48 for ( k = 0; k < iNumLines; k++ )
260: {
261: 153.921 0.9 1920 r.top = k*wCharHeight;
262: 156.180 0.9 1920 r.bottom = r.top + wCharHeight;
263: 3163.973 19.0 1920 ExtTextOut ( hDC, 0, k*wCharHeight, ETO_OPAQUE, &r, szTest, cbTest, NULL );
264: 157.700 0.9 1920 }
265:
266: 3.730 0.0 48 }
267:
268: 0.330 0.0 1 ReleaseDC ( hWnd, hDC );
269: 0.076 0.0 1 }
270: