home *** CD-ROM | disk | FTP | other *** search
/ Media Share 9 / MEDIASHARE_09.ISO / mag&info / msjv7_6.zip / TOPTEN.ARJ / ETO.ARJ / ETO.SVG < prev    next >
Text File  |  1992-10-01  |  17KB  |  287 lines

  1. Microsoft PLIST Version 1.20
  2.  
  3. Profile: Line timing, sorted by line.
  4. Date:    Sun Jun 07 11:56:58 1992
  5.  
  6.  
  7. Program Statistics
  8. ------------------
  9.     Total time: 19805.340 milliseconds
  10.     Time before any line: 11.210 milliseconds
  11.     Total lines: 102
  12.     Total hits: 15290
  13.     Line coverage:  97.1%
  14.  
  15. Module Statistics for f:\exttext\eto.exe
  16. ----------------------------------------
  17.     Time in module: 19794.130 milliseconds
  18.     Percent of time in module: 100.0%
  19.     Lines in module: 102
  20.     Hits in module: 15290
  21.     Module line coverage:  97.1%
  22.  
  23. Source file: f:\exttext\eto.c
  24.  
  25.                Line        Hit  
  26.   Line         Time   %   count Source
  27. --------------------------------------
  28.     1:                          #include <windows.h>
  29.     2:                          
  30.     3:                          #include "basedefs.h"
  31.     4:                          #include "eto.h"
  32.     5:                          
  33.     6:                          WINPROC WndProc     ( WINDOWS_PARAMS );
  34.     7:                          
  35.     8:                          void TestIDM_RECT_FILLRECT ( HWND hWnd );
  36.     9:                          void TestIDM_RECT_ETO      ( HWND hWnd );
  37.    10:                          void TestIDM_TEXT_TEXTOUT  ( HWND hWnd );
  38.    11:                          void TestIDM_TEXT_ETO      ( HWND hWnd );
  39.    12:                          
  40.    13:                          /**************************************************************
  41.    14:                          *                                                             *
  42.    15:                          *                   Global Variables                          *
  43.    16:                          *                                                             *
  44.    17:                          **************************************************************/
  45.    18:                          
  46.    19:                          HANDLE   ghInst;
  47.    20:                          HWND     ghWnd;
  48.    21:                          char     szNullString[] = "";
  49.    22:                          char     szAppName[] = "ETO";
  50.    23:                          HBRUSH   hRGBBrush[16];
  51.    24:                          COLORREF dwRGB[16];
  52.    25:                          
  53.    26:                          /**************************************************************
  54.    27:                          *                                                             *
  55.    28:                          *                      WinMain                                *
  56.    29:                          *                                                             *
  57.    30:                          **************************************************************/
  58.    31:                          
  59.    32:                          int PASCAL WinMain (HANDLE hInstance,  HANDLE hPrevInstance, 
  60.    33:                                              LPSTR lpszCmdLine, int    nCmdShow       )
  61.    34:        0.015   0.0     1 {
  62.    35:                            MSG         msg       ;
  63.    36:                            WNDCLASS    wndclass  ;
  64.    37:                            int         i;
  65.    38:                          
  66.    39:        0.007   0.0     1   if (!hPrevInstance) 
  67.    40:                              {
  68.    41:                              // Register the Parent Window
  69.    42:                          
  70.    43:        0.005   0.0     1     wndclass.style         = CS_BYTEALIGNCLIENT;
  71.    44:        0.045   0.0     1     wndclass.lpfnWndProc   = (WNDPROC)WndProc ;
  72.    45:        0.011   0.0     1     wndclass.cbClsExtra    = 0 ;
  73.    46:        0.007   0.0     1     wndclass.cbWndExtra    = 0 ;
  74.    47:        0.007   0.0     1     wndclass.hInstance     = hInstance ;
  75.    48:        0.008   0.0     1     wndclass.hIcon         = NULL;
  76.    49:        0.152   0.0     1     wndclass.hCursor       = LoadCursor (NULL, IDC_ARROW) ;
  77.    50:        0.018   0.0     1     wndclass.hbrBackground = GetStockObject ( LTGRAY_BRUSH ) ;
  78.    51:        0.007   0.0     1     wndclass.lpszMenuName  = (LPSTR)"PlainMenu" ;
  79.    52:        0.007   0.0     1     wndclass.lpszClassName = szAppName ;
  80.    53:                          
  81.    54:        0.357   0.0     1     if (!RegisterClass (&wndclass))
  82.    55:        0.000   0.0     0          return FALSE;
  83.    56:                          
  84.    57:                              }
  85.    58:                          
  86.    59:                            // Generate sixteen cached brushes, for each of the solid colors,
  87.    60:                            // and fill in the dwRGB array
  88.    61:                          
  89.    62:        0.011   0.0     1   for ( i = 0; i < 16; i++ )
  90.    63:                              hRGBBrush[i] = CreateSolidBrush ( dwRGB[i] =
  91.    64:                                                                 RGB
  92.    65:                                                                     ( 
  93.    66:                                                                       min ((((i%8)&4)/4)*(((i%16)/8)+1)*128, 255),
  94.    67:                                                                       min ((((i%8)&2)/2)*(((i%16)/8)+1)*128, 255),
  95.    68:                                                                       min ((((i%8)&1)/1)*(((i%16)/8)+1)*128, 255)
  96.    69:                                                                     )
  97.    70:        2.059   0.0    16                                      );
  98.    71:                          
  99.    72:        0.008   0.0     1   ghInst   = hInstance;
  100.    73:                          
  101.    74:                          
  102.    75:                            ghWnd =        CreateWindow (szAppName, "Tiny Windows App",
  103.    76:                                                         WS_OVERLAPPEDWINDOW,
  104.    77:                                                         CW_USEDEFAULT, 0,
  105.    78:                                                         CW_USEDEFAULT, 0,
  106.    79:        3.754   0.0     1                                NULL, NULL, hInstance, NULL) ;
  107.    80:                          
  108.    81:                          
  109.    82:        0.065   0.0     1   ShowWindow ( ghWnd, nCmdShow );
  110.    83:        0.063   0.0     1   UpdateWindow ( ghWnd );
  111.    84:                          
  112.    85:     6503.405  32.9    75   while (GetMessage((LPMSG)&msg, NULL, 0, 0))
  113.    86:                              {
  114.    87:        8.487   0.0    74     TranslateMessage(&msg);
  115.    88:       12.135   0.1    74     DispatchMessage(&msg);
  116.    89:        6.562   0.0    74     }
  117.    90:                          
  118.    91:        0.092   0.0     1   for ( i = 0; i < 16; i++ )
  119.    92:        3.668   0.0    16     DeleteObject ( hRGBBrush[i] );
  120.    93:                           
  121.    94:        0.092   0.0     1   return msg.wParam ;
  122.    95:        0.109   0.0     1 }
  123.    96:                          
  124.    97:                          /*********************************************************************
  125.    98:                          *                                                                    *
  126.    99:                          *                       WndProc: Main Message Translator             *
  127.   100:                          *                                                                    *
  128.   101:                          *********************************************************************/
  129.   102:                          
  130.   103:                          WINPROC WndProc ( WINDOWS_PARAMS )
  131.   104:       32.107   0.2   336 {
  132.   105:       34.028   0.2   336   switch ( msg )
  133.   106:                              {
  134.   107:                              case WM_COMMAND :
  135.   108:                          
  136.   109:        0.393   0.0     4       switch ( wParam )
  137.   110:                                  {
  138.   111:        0.091   0.0     1         case IDM_RECT_FILLRECT: TestIDM_RECT_FILLRECT ( hWnd ); break;
  139.   112:        0.092   0.0     1         case IDM_RECT_ETO     : TestIDM_RECT_ETO      ( hWnd ); break;
  140.   113:        0.091   0.0     1         case IDM_TEXT_TEXTOUT : TestIDM_TEXT_TEXTOUT  ( hWnd ); break;
  141.   114:        0.092   0.0     1         case IDM_TEXT_ETO     : TestIDM_TEXT_ETO      ( hWnd ); break;
  142.   115:        0.000   0.0     0         }
  143.   116:        0.358   0.0     4       break;
  144.   117:                          
  145.   118:                              case WM_CREATE  :
  146.   119:                          
  147.   120:        0.007   0.0     1       break;
  148.   121:                          
  149.   122:                              case WM_DESTROY :
  150.   123:                          
  151.   124:        0.107   0.0     1       PostQuitMessage (0) ;
  152.   125:        0.091   0.0     1       break ;
  153.   126:                          
  154.   127:                              default :
  155.   128:                          
  156.   129:      142.015   0.7   330       return DefWindowProc ( hWnd, msg, wParam, lParam );
  157.   130:                          
  158.   131:        0.000   0.0     0     }
  159.   132:        0.453   0.0     6   return 0L ;
  160.   133:     3068.006  15.5   336 }
  161.   134:                          //*************************************************************************    iNumLines    ┌╧eto.obj    7.00ù,ùeto.cf(-28=LValÇåÄQWçô£╢┬╬╤┘⌠·"0>LZÇâåìɺ┼╬┌Ω∙ FQZjyäîö½╩Σ∩° />Ilüîö£│═╒▐τ)CNXhÇÅ₧⌐╠╫▀τ■ )2[jäÅ"'+,                
  162.   146:        0.102   0.0     1   GetClientRect ( hWnd, &r );
  163.   147:                          
  164.   148:        0.545   0.0     1   hDC = GetDC ( hWnd );
  165.   149:                          
  166.   150:        0.341   0.0     1   for ( j = 0; j < 3; j++ )
  167.   151:        0.277   0.0     3     for ( i = 0; i < 16; i++ )
  168.   152:     1564.127   7.9    48       FillRect ( hDC, &r, hRGBBrush[i] );
  169.   153:                          
  170.   154:        0.329   0.0     1   ReleaseDC ( hWnd, hDC );
  171.   155:                            
  172.   156:        0.092   0.0     1 }
  173.   157:                          
  174.   158:                          //*************************************************************************
  175.   159:                          //
  176.   160:                          //
  177.   161:                          //
  178.   162:                          //*************************************************************************
  179.   163:                          
  180.   164:                          void TestIDM_RECT_ETO      ( HWND hWnd )
  181.   165:        0.094   0.0     1 {
  182.   166:                            RECT r;
  183.   167:                            int  i, j;
  184.   168:                            HDC  hDC;
  185.   169:                          
  186.   170:        0.106   0.0     1   GetClientRect ( hWnd, &r );
  187.   171:                          
  188.   172:        0.543   0.0     1   hDC = GetDC ( hWnd );
  189.   173:                          
  190.   174:        0.092   0.0     1   for ( j = 0; j < 3; j++ )
  191.   175:        0.273   0.0     3     for ( i = 0; i < 16; i++ )
  192.   176:                                {
  193.   177:        7.031   0.0    48       SetBkColor ( hDC, dwRGB[i] );
  194.   178:     1613.601   8.2    48       ExtTextOut ( hDC, 0, 0, ETO_OPAQUE, &r, NULL, NULL, NULL );
  195.   179:        4.862   0.0    48       }
  196.   180:                          
  197.   181:        0.311   0.0     1   ReleaseDC ( hWnd, hDC );
  198.   182:        0.091   0.0     1 }
  199.   183:                          
  200.   184:                          //*************************************************************************
  201.   185:                          //
  202.   186:                          //
  203.   187:                          //
  204.   188:                          //*************************************************************************
  205.   189:                          
  206.   190:                          void TestIDM_TEXT_TEXTOUT  ( HWND hWnd )
  207.   191:        0.091   0.0     1 {
  208.   192:                            RECT r;
  209.   193:                            int  i, j, k;
  210.   194:                            HDC  hDC;
  211.   195:                            int  iNumLines;
  212.   196:                            WORD wCharHeight;
  213.   197:        0.105   0.0     1   char szTest[] = "This is a test!!!! ABCDEFGHIJKLMNOPQRSTUVWXYZ";
  214.   198:        0.113   0.0     1   int  cbTest = lstrlen ( szTest );
  215.   199:                          
  216.   200:        0.107   0.0     1   GetClientRect ( hWnd, &r );
  217.   201:                          
  218.   202:        0.546   0.0     1   hDC = GetDC ( hWnd );
  219.   203:                          
  220.   204:        0.221   0.0     1   wCharHeight = HIWORD (GetTextExtent(hDC, szTest, cbTest));
  221.   205:                          
  222.   206:        0.189   0.0     1   r.left = LOWORD (GetTextExtent(hDC, szTest, cbTest));
  223.   207:                          
  224.   208:        0.089   0.0     1   iNumLines = r.bottom / wCharHeight;
  225.   209:                          
  226.   210:        0.092   0.0     1   for ( j = 0; j < 3; j++ )
  227.   211:        0.277   0.0     3     for ( i = 0; i < 16; i++ )
  228.   212:                                {
  229.   213:        7.421   0.0    48       SetBkColor   ( hDC, dwRGB[i]    );
  230.   214:        6.354   0.0    48       SetTextColor ( hDC, dwRGB[15-i] );
  231.   215:                          
  232.   216:        4.969   0.0    48       for ( k = 0; k < iNumLines; k++ )
  233.   217:                                  {
  234.   218:      152.306   0.8  1440         r.top    = k*wCharHeight;
  235.   219:      144.468   0.7  1440         r.bottom = r.top + wCharHeight;
  236.   220:     1826.176   9.2  1440         TextOut ( hDC, 0, k*wCharHeight, szTest, cbTest ); 
  237.   221:     1280.725   6.5  1440         FillRect ( hDC, &r, hRGBBrush[i] );
  238.   222:      139.929   0.7  1440         }
  239.   223:                                
  240.   224:        4.518   0.0    48       }
  241.   225:                          
  242.   226:        0.319   0.0     1   ReleaseDC ( hWnd, hDC );
  243.   227:        0.096   0.0     1 }
  244.   228:                          
  245.   229:                          //*************************************************************************
  246.   230:                          //
  247.   231:                          //
  248.   232:                          //
  249.   233:                          //*************************************************************************
  250.   234:                          
  251.   235:                          void TestIDM_TEXT_ETO      ( HWND hWnd )
  252.   236:        0.096   0.0     1 {
  253.   237:                            RECT r;
  254.   238:                            int  i, j, k;
  255.   239:                            HDC  hDC;
  256.   240:                            int  iNumLines;
  257.   241:                            WORD wCharHeight;
  258.   242:        0.106   0.0     1   char szTest[] = "This is a test!!!! ABCDEFGHIJKLMNOPQRSTUVWXYZ";
  259.   243:        0.113   0.0     1   int  cbTest = lstrlen ( szTest );
  260.   244:                          
  261.   245:        0.104   0.0     1   GetClientRect ( hWnd, &r );
  262.   246:                          
  263.   247:        0.545   0.0     1   hDC = GetDC ( hWnd );
  264.   248:                          
  265.   249:        0.220   0.0     1   wCharHeight = HIWORD (GetTextExtent(hDC, szTest, cbTest));
  266.   250:                          
  267.   251:        0.090   0.0     1   iNumLines = r.bottom / wCharHeight;
  268.   252:                          
  269.   253:        0.090   0.0     1   for ( j = 0; j < 3; j++ )
  270.   254:        0.272   0.0     3     for ( i = 0; i < 16; i++ )
  271.   255:                                {
  272.   256:        7.125   0.0    48       SetBkColor   ( hDC, dwRGB[i]    );
  273.   257:        6.665   0.0    48       SetTextColor ( hDC, dwRGB[15-i] );
  274.   258:                          
  275.   259:        4.651   0.0    48       for ( k = 0; k < iNumLines; k++ )
  276.   260:                                  {
  277.   261:      147.391   0.7  1440         r.top    = k*wCharHeight;
  278.   262:      143.763   0.7  1440         r.bottom = r.top + wCharHeight;
  279.   263:     2756.344  13.9  1440         ExtTextOut ( hDC, 0, k*wCharHeight, ETO_OPAQUE, &r, szTest, cbTest, NULL ); 
  280.   264:      140.762   0.7  1440         }
  281.   265:                                
  282.   266:        4.281   0.0    48       }
  283.   267:                          
  284.   268:        0.320   0.0     1   ReleaseDC ( hWnd, hDC );
  285.   269:        0.092   0.0     1 }
  286.   270:                          
  287.