- Timestamp:
- Dec 15, 2001, 7:51:16 PM (24 years ago)
- Location:
- trunk/src/gdi32
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gdi32/dibitmap.cpp
r7327 r7635 1 /* $Id: dibitmap.cpp,v 1.2 8 2001-11-13 13:18:22sandervl Exp $ */1 /* $Id: dibitmap.cpp,v 1.29 2001-12-15 18:50:25 sandervl Exp $ */ 2 2 3 3 /* … … 19 19 #include "dibsect.h" 20 20 #include "rgbcvt.h" 21 #include <stats.h> 21 22 22 23 #define DBG_LOCALLOG DBG_dibitmap … … 131 132 ((BITMAPINFOHEADER *)lpbmih)->biBitCount = biBitCount; 132 133 134 if(rc) STATS_CreateDIBitmap(rc, hdc, lpbmih, fdwInit, lpbInit, lpbmi, fuUsage); 135 133 136 return rc; 134 137 } … … 141 144 hBitmap = O32_CreateCompatibleBitmap(hdc, nWidth, nHeight); 142 145 dprintf(("GDI32: CreateCompatibleBitmap %x (%d,%d) returned %x", hdc, nWidth, nHeight, hBitmap)); 146 if(hBitmap) STATS_CreateCompatibleBitmap(hBitmap,hdc, nWidth, nHeight); 147 143 148 return hBitmap; 144 149 } … … 160 165 hBitmap = O32_CreateBitmap(nWidth, nHeight, cPlanes, cBitsPerPel, lpvBits); 161 166 dprintf(("GDI32: CreateBitmap (%d,%d) bps %d returned %x", nWidth, nHeight, cBitsPerPel, hBitmap)); 167 if(hBitmap) STATS_CreateBitmap(hBitmap,nWidth, nHeight, cPlanes, cBitsPerPel, lpvBits); 168 162 169 return(hBitmap); 163 170 } … … 170 177 dprintf(("GDI32: CreateBitmapIndirect (%d,%d) bpp %d bits %x", pBitmap->bmWidth, pBitmap->bmHeight, pBitmap->bmBitsPixel, pBitmap->bmBits)); 171 178 hBitmap = O32_CreateBitmapIndirect(pBitmap); 179 if(hBitmap) STATS_CreateBitmapIndirect(hBitmap, pBitmap); 180 172 181 dprintf(("GDI32: CreateBitmapIndirect returned %x", hBitmap)); 173 182 return hBitmap; … … 243 252 244 253 if(fCreateDC) DeleteDC(hdc); 254 255 STATS_CreateDIBSection(res, hdc, pbmi, iUsage, ppvBits, hSection, dwOffset); 256 245 257 return(res); 246 258 } -
trunk/src/gdi32/font.cpp
r7330 r7635 1 /* $Id: font.cpp,v 1.2 1 2001-11-13 15:42:05sandervl Exp $ */1 /* $Id: font.cpp,v 1.22 2001-12-15 18:50:26 sandervl Exp $ */ 2 2 3 3 /* … … 38 38 #include <wprocess.h> 39 39 #include <odininst.h> 40 #include <stats.h> 40 41 41 42 #define DBG_LOCALLOG DBG_font … … 287 288 hFont = O32_CreateFontIndirect(&afont); 288 289 290 if(hFont) { 291 STATS_CreateFontIndirect(hFont, &afont); 292 } 289 293 return(hFont); 290 294 } -
trunk/src/gdi32/gdi32.cpp
r7330 r7635 1 /* $Id: gdi32.cpp,v 1.7 6 2001-11-13 15:42:05sandervl Exp $ */1 /* $Id: gdi32.cpp,v 1.77 2001-12-15 18:50:26 sandervl Exp $ */ 2 2 3 3 /* … … 25 25 #include <winuser32.h> 26 26 #include "font.h" 27 #include <stats.h> 27 28 28 29 #define DBG_LOCALLOG DBG_gdi32 … … 77 78 //****************************************************************************** 78 79 //****************************************************************************** 79 HBRUSH WIN32API CreatePatternBrush(HBITMAP arg1)80 {81 HBRUSH brush;82 83 brush = O32_CreatePatternBrush(arg1);84 dprintf(("GDI32: CreatePatternBrush from bitmap %X returned %X\n", arg1, brush));85 return(brush);86 }87 //******************************************************************************88 //******************************************************************************89 80 ODINFUNCTION3(HPEN, CreatePen, int, fnPenStyle, int, nWidth, COLORREF, crColor) 90 81 { 82 HPEN hPen; 83 91 84 //CB: todo: PS_DOT is different in Win32 (. . . . and not - - - -) 92 85 // Open32 looks like LINETYPE_SHORTDASH instead of LINETYPE_DOT!!! 93 86 // -> difficult to fix without performance decrease! 94 87 95 return O32_CreatePen(fnPenStyle,nWidth,crColor); 88 hPen = O32_CreatePen(fnPenStyle,nWidth,crColor); 89 if(hPen) STATS_CreatePen(hPen, fnPenStyle,nWidth,crColor); 90 return hPen; 96 91 } 97 92 //****************************************************************************** … … 99 94 HPEN WIN32API CreatePenIndirect(const LOGPEN * lplgpn) 100 95 { 96 HPEN hPen; 97 101 98 dprintf(("GDI32: CreatePenIndirect %x", lplgpn)); 102 return O32_CreatePenIndirect(lplgpn); 99 hPen = O32_CreatePenIndirect(lplgpn); 100 if(hPen) STATS_CreatePenIndirect(hPen, lplgpn); 101 return hPen; 102 } 103 //****************************************************************************** 104 //****************************************************************************** 105 HPEN WIN32API ExtCreatePen(DWORD dwPenStyle, DWORD dwWidth, const LOGBRUSH *lplb, 106 DWORD dwStyleCount, const DWORD *lpStyle) 107 { 108 HPEN hPen; 109 110 hPen = O32_ExtCreatePen(dwPenStyle, dwWidth, lplb, dwStyleCount, lpStyle); 111 dprintf(("GDI32: ExtCreatePen %x %x %x %x %x returned %x", dwPenStyle, dwWidth, lplb, dwStyleCount, lpStyle, hPen)); 112 if(hPen) STATS_ExtCreatePen(hPen, dwPenStyle, dwWidth, lplb, dwStyleCount, lpStyle); 113 return hPen; 114 } 115 //****************************************************************************** 116 //****************************************************************************** 117 HBRUSH WIN32API CreatePatternBrush(HBITMAP hBitmap) 118 { 119 HBRUSH hBrush; 120 121 hBrush = O32_CreatePatternBrush(hBitmap); 122 if(hBrush) STATS_CreatePatternBrush(hBrush, hBitmap); 123 124 dprintf(("GDI32: CreatePatternBrush from bitmap %X returned %X\n", hBitmap, hBrush)); 125 return(hBrush); 126 } 127 //****************************************************************************** 128 //****************************************************************************** 129 ODINFUNCTION1(HBRUSH, CreateSolidBrush, COLORREF, color) 130 { 131 HBRUSH hBrush; 132 133 hBrush = O32_CreateSolidBrush(color); 134 if(hBrush) STATS_CreateSolidBrush(hBrush, color); 135 return(hBrush); 136 } 137 //****************************************************************************** 138 //****************************************************************************** 139 HBRUSH WIN32API CreateBrushIndirect( const LOGBRUSH *pLogBrush) 140 { 141 HBRUSH hBrush; 142 143 hBrush = O32_CreateBrushIndirect((LPLOGBRUSH)pLogBrush); 144 dprintf(("GDI32: CreateBrushIndirect %x %x %x returned %x", pLogBrush->lbStyle, pLogBrush->lbColor, pLogBrush->lbHatch, hBrush)); 145 if(hBrush) STATS_CreateBrushIndirect(hBrush, (LPLOGBRUSH)pLogBrush); 146 return hBrush; 147 } 148 //****************************************************************************** 149 //****************************************************************************** 150 HBRUSH WIN32API CreateHatchBrush(int fnStyle, COLORREF clrref) 151 { 152 HBRUSH hBrush; 153 154 dprintf(("GDI32: CreateHatchBrush %x %x", fnStyle, clrref)); 155 hBrush = O32_CreateHatchBrush(fnStyle, clrref); 156 if(hBrush) STATS_CreateHatchBrush(hBrush, fnStyle, clrref); 157 return hBrush; 103 158 } 104 159 //****************************************************************************** … … 106 161 HBRUSH WIN32API CreateDIBPatternBrushPt( const VOID * buffer, UINT usage) 107 162 { 163 HBRUSH hBrush; 164 108 165 dprintf(("GDI32: CreateDIBPatternBrushPt %x %x", buffer, usage)); 109 return O32_CreateDIBPatternBrushPt(buffer, usage); 166 hBrush = O32_CreateDIBPatternBrushPt(buffer, usage); 167 if(hBrush) STATS_CreateDIBPatternBrushPt(hBrush, buffer, usage); 168 return hBrush; 110 169 } 111 170 /***************************************************************************** … … 151 210 } 152 211 else { 153 dprintf((" ERROR: CreateDIBPatternBrush (%08xh, %08xh) -> INVALID memory handle!!",212 dprintf(("!ERROR!: CreateDIBPatternBrush (%08xh, %08xh) -> INVALID memory handle!!", 154 213 hglbDIBPacked, fuColorSpec)); 155 214 } … … 166 225 if (!oldcp) /* If new DC is to be created */ 167 226 oldcp = GetDisplayCodepage(); 227 228 if(newHdc) STATS_CreateCompatibleDC(hdc, newHdc); 168 229 169 230 OSLibGpiSetCp(newHdc, oldcp); … … 197 258 } 198 259 260 STATS_DeleteDC(hdc); 199 261 return O32_DeleteDC(hdc); 200 262 } … … 310 372 dprintf(("GDI32: CloseFigure %x", hdc)); 311 373 return O32_CloseFigure(hdc); 312 }313 //******************************************************************************314 //******************************************************************************315 HBRUSH WIN32API CreateBrushIndirect( const LOGBRUSH *pLogBrush)316 {317 HBRUSH hBrush;318 319 hBrush = O32_CreateBrushIndirect((LPLOGBRUSH)pLogBrush);320 dprintf(("GDI32: CreateBrushIndirect %x %x %x returned %x", pLogBrush->lbStyle, pLogBrush->lbColor, pLogBrush->lbHatch, hBrush));321 return hBrush;322 374 } 323 375 //****************************************************************************** … … 342 394 if(hdc) { 343 395 OSLibGpiSetCp(hdc, GetDisplayCodepage()); 396 STATS_CreateDCA(hdc, lpszDriver, lpszDevice, lpszOutput, lpInitData); 344 397 } 345 398 … … 422 475 //****************************************************************************** 423 476 //****************************************************************************** 424 HBRUSH WIN32API CreateHatchBrush( int arg1, COLORREF arg2)425 {426 dprintf(("GDI32: CreateHatchBrush"));427 return O32_CreateHatchBrush(arg1, arg2);428 }429 //******************************************************************************430 //******************************************************************************431 477 HDC WIN32API CreateICA(LPCSTR lpszDriver, LPCSTR lpszDevice, LPCSTR lpszOutput, 432 478 const DEVMODEA *lpdvmInit) 433 479 { 434 480 static char *szDisplay = "DISPLAY"; 481 HDC hdc; 435 482 436 483 dprintf(("GDI32: CreateICA")); … … 443 490 lpszDriver = lpszDevice; 444 491 } 445 return O32_CreateIC(lpszDriver, lpszDevice, lpszOutput, lpdvmInit); 492 hdc = O32_CreateIC(lpszDriver, lpszDevice, lpszOutput, lpdvmInit); 493 if(hdc) STATS_CreateICA(hdc, lpszDriver, lpszDevice, lpszOutput, lpdvmInit); 494 return hdc; 446 495 } 447 496 //****************************************************************************** … … 519 568 //****************************************************************************** 520 569 //****************************************************************************** 521 ODINFUNCTION1(HBRUSH, CreateSolidBrush, COLORREF, color)522 {523 return O32_CreateSolidBrush(color);524 }525 //******************************************************************************526 //******************************************************************************527 570 BOOL WIN32API Ellipse(HDC hdc, int nLeftRect, int nTopRect, int nRightRect, 528 571 int nBottomRect) … … 631 674 //****************************************************************************** 632 675 //****************************************************************************** 633 int WIN32API EnumObjects( HDC hdc, int objType, GOBJENUMPROC objFunc, LPARAM lParam)634 {635 //calling convention differences636 dprintf(("ERROR: GDI32: EnumObjects STUB"));637 // return O32_EnumObjects(arg1, arg2, arg3, arg4);638 return 0;639 }640 //******************************************************************************641 //******************************************************************************642 676 int WIN32API Escape( HDC hdc, int nEscape, int cbInput, LPCSTR lpvInData, PVOID lpvOutData) 643 677 { … … 651 685 652 686 return rc; 653 }654 //******************************************************************************655 //******************************************************************************656 HPEN WIN32API ExtCreatePen( DWORD arg1, DWORD arg2, const LOGBRUSH * arg3, DWORD arg4, const DWORD * arg5)657 {658 dprintf(("GDI32: ExtCreatePen"));659 return O32_ExtCreatePen(arg1, arg2, arg3, arg4, arg5);660 687 } 661 688 //****************************************************************************** … … 778 805 dprintf(("GDI32: GetCharWidth32W might not work properly %x %x %x %x", hdc, iFirstChar, iLastChar, pWidthArray)); 779 806 return O32_GetCharWidth(hdc, iFirstChar, iLastChar, pWidthArray); 780 }781 //******************************************************************************782 //******************************************************************************783 HANDLE WIN32API GetCurrentObject( HDC hdc, UINT arg2)784 {785 dprintf(("GDI32: GetCurrentObject %x %x", hdc, arg2));786 return (HANDLE)O32_GetCurrentObject(hdc, arg2);787 807 } 788 808 //****************************************************************************** … … 1157 1177 //****************************************************************************** 1158 1178 //****************************************************************************** 1159 //******************************************************************************1160 //******************************************************************************1161 BOOL WIN32API UnrealizeObject( HGDIOBJ hObject)1162 {1163 dprintf(("GDI32: UnrealizeObject %x", hObject));1164 return O32_UnrealizeObject(hObject);1165 }1166 //******************************************************************************1167 //******************************************************************************1168 1179 BOOL WIN32API WidenPath( HDC hdc) 1169 1180 { -
trunk/src/gdi32/initgdi32.cpp
r7074 r7635 1 /* $Id: initgdi32.cpp,v 1. 8 2001-10-16 11:40:17sandervl Exp $1 /* $Id: initgdi32.cpp,v 1.9 2001-12-15 18:50:26 sandervl Exp $ 2 2 * 3 3 * DLL entry point … … 39 39 #include "region.h" 40 40 #include <initdll.h> 41 #include <stats.h> 41 42 42 43 extern "C" { … … 59 60 60 61 case DLL_PROCESS_DETACH: 62 STATS_DumpStats(); 61 63 ctordtorTerm(); 62 64 return TRUE; -
trunk/src/gdi32/makefile
r6918 r7635 1 # $Id: makefile,v 1.4 0 2001-10-01 01:40:08 birdExp $1 # $Id: makefile,v 1.41 2001-12-15 18:50:27 sandervl Exp $ 2 2 3 3 # … … 51 51 $(OBJDIR)\objhandle.obj \ 52 52 $(OBJDIR)\printer.obj \ 53 $(OBJDIR)\gdistats.obj \ 53 54 $(OBJDIR)\dbglocal.obj \ 54 55 $(OBJDIR)\gdi32rsrc.obj -
trunk/src/gdi32/objhandle.cpp
r7330 r7635 1 /* $Id: objhandle.cpp,v 1. 19 2001-11-13 15:42:06sandervl Exp $ */1 /* $Id: objhandle.cpp,v 1.20 2001-12-15 18:50:27 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Handle Management Code for OS/2 … … 26 26 #include <unicode.h> 27 27 #include "font.h" 28 #include <stats.h> 28 29 29 30 #define DBG_LOCALLOG DBG_objhandle … … 328 329 DWORD WIN32API GetObjectType( HGDIOBJ hObj) 329 330 { 330 dprintf2(("GDI32: GetObjectType %x", hObj)); 331 DWORD objtype; 332 331 333 //TODO: must use 16 bits gdi object handles 332 334 if(HIWORD(hObj) == 0) { … … 334 336 } 335 337 if(ObjGetHandleType(hObj) == GDIOBJ_REGION) { 338 dprintf2(("GDI32: GetObjectType %x REGION", hObj)); 336 339 SetLastError(ERROR_SUCCESS); 337 340 return OBJ_REGION; 338 341 } 339 return O32_GetObjectType(hObj); 342 objtype = O32_GetObjectType(hObj); 343 dprintf2(("GDI32: GetObjectType %x objtype %d", hObj, objtype)); 344 return objtype; 340 345 } 341 346 //****************************************************************************** … … 344 349 BOOL WIN32API DeleteObject(HANDLE hObj) 345 350 { 351 DWORD objtype; 352 346 353 dprintf(("GDI32: DeleteObject %x", hObj)); 347 354 … … 353 360 354 361 //System objects can't be deleted (TODO: any others?? (fonts?))!!!!) 355 switch (GetObjectType(hObj)) 362 objtype = GetObjectType(hObj); 363 switch (objtype) 356 364 { 357 365 case OBJ_PEN: … … 385 393 } 386 394 395 STATS_DeleteObject(hObj, objtype); 396 387 397 if(ObjGetHandleType(hObj) == GDIOBJ_REGION) 388 398 { … … 398 408 //****************************************************************************** 399 409 //****************************************************************************** 410 int WIN32API EnumObjects( HDC hdc, int objType, GOBJENUMPROC objFunc, LPARAM lParam) 411 { 412 //calling convention differences 413 dprintf(("!ERROR!: GDI32: EnumObjects STUB")); 414 // return O32_EnumObjects(arg1, arg2, arg3, arg4); 415 return 0; 416 } 417 //****************************************************************************** 418 //****************************************************************************** 419 HANDLE WIN32API GetCurrentObject( HDC hdc, UINT arg2) 420 { 421 dprintf(("GDI32: GetCurrentObject %x %x", hdc, arg2)); 422 return (HANDLE)O32_GetCurrentObject(hdc, arg2); 423 } 424 //****************************************************************************** 425 //****************************************************************************** 400 426 BOOL WIN32API SetObjectOwner( HGDIOBJ arg1, int arg2 ) 401 427 { … … 406 432 //****************************************************************************** 407 433 //****************************************************************************** 434 BOOL WIN32API UnrealizeObject( HGDIOBJ hObject) 435 { 436 dprintf(("GDI32: UnrealizeObject %x", hObject)); 437 return O32_UnrealizeObject(hObject); 438 } 439 //****************************************************************************** 440 //****************************************************************************** -
trunk/src/gdi32/region.cpp
r7074 r7635 1 /* $Id: region.cpp,v 1.2 4 2001-10-16 11:40:18sandervl Exp $ */1 /* $Id: region.cpp,v 1.25 2001-12-15 18:50:27 sandervl Exp $ */ 2 2 3 3 /* … … 33 33 #include <winuser32.h> 34 34 #include "oslibgpi.h" 35 #include <stats.h> 35 36 36 37 #define DBG_LOCALLOG DBG_region … … 832 833 833 834 if(ObjAllocateHandle(&hrgn, hrgn, GDIOBJ_REGION) == FALSE) { 835 GpiDestroyRegion(hpsRegion, hrgn); 834 836 SetLastError(ERROR_OUTOFMEMORY_W); 835 837 return 0; 836 838 } 839 STATS_CreatePolyPolygonRgn(hrgn, lppt, pPolyCount, nCount, fnPolyFillMode); 840 837 841 SetLastError(ERROR_SUCCESS_W); 838 842 return hrgn; … … 853 857 854 858 if(ObjAllocateHandle(&hrgn, hrgn, GDIOBJ_REGION) == FALSE) { 859 GpiDestroyRegion(hpsRegion, hrgn); 855 860 SetLastError(ERROR_OUTOFMEMORY_W); 856 861 return 0; 857 862 } 863 STATS_CreateRectRgn(hrgn, left, top, right, bottom); 864 858 865 dprintf(("CreateRectRegion (%d,%d)(%d,%d) returned %x", left, top, right, bottom, hrgn)); 859 866 SetLastError(ERROR_SUCCESS_W); … … 885 892 886 893 if(ObjAllocateHandle(&hrgn, hrgn, GDIOBJ_REGION) == FALSE) { 894 GpiDestroyRegion(hpsRegion, hrgn); 887 895 SetLastError(ERROR_OUTOFMEMORY_W); 888 896 return 0; 889 897 } 898 STATS_CreateRoundRectRgn(hrgn, left, top, right, bottom, nWidthEllipse, nHeightEllipse); 899 890 900 dprintf(("CreateRoundRectRegion (%d,%d)(%d,%d) (%d,%d) returned %x", left, top, right, bottom, nWidthEllipse, nHeightEllipse, hrgn)); 891 901 SetLastError(ERROR_SUCCESS_W); … … 995 1005 996 1006 if(ObjAllocateHandle(&hrgn, hrgn, GDIOBJ_REGION) == FALSE) { 997 SetLastError(ERROR_OUTOFMEMORY_W); 998 return 0; 999 } 1007 GpiDestroyRegion(hpsRegion, hrgn); 1008 SetLastError(ERROR_OUTOFMEMORY_W); 1009 return 0; 1010 } 1011 STATS_ExtCreateRegion(hrgn, (PVOID)pXform, count, pData); 1000 1012 SetLastError(ERROR_SUCCESS_W); 1001 1013 return hrgn; … … 1016 1028 1017 1029 if(ObjAllocateHandle(&hrgn, hrgn, GDIOBJ_REGION) == FALSE) { 1018 SetLastError(ERROR_OUTOFMEMORY_W); 1019 return 0; 1020 } 1030 GpiDestroyRegion(hpsRegion, hrgn); 1031 SetLastError(ERROR_OUTOFMEMORY_W); 1032 return 0; 1033 } 1034 STATS_CreateEllipticRgn(hrgn, left, top, right, bottom); 1021 1035 SetLastError(ERROR_SUCCESS_W); 1022 1036 return hrgn; … … 1054 1068 return 0; 1055 1069 } 1056 1057 1070 dprintf(("CreatePolygonRgn %x %d %d", lppt, cPoints, fnPolyFillMode)); 1058 1059 1071 1060 1072 POLYGON polygon; … … 1066 1078 1067 1079 if(ObjAllocateHandle(&hrgn, hrgn, GDIOBJ_REGION) == FALSE) { 1068 SetLastError(ERROR_OUTOFMEMORY_W); 1069 return 0; 1070 } 1080 GpiDestroyRegion(hpsRegion, hrgn); 1081 SetLastError(ERROR_OUTOFMEMORY_W); 1082 return 0; 1083 } 1084 STATS_CreatePolygonRgn(hrgn, lppt, cPoints, fnPolyFillMode); 1071 1085 SetLastError(ERROR_SUCCESS_W); 1072 1086 return hrgn;
Note:
See TracChangeset
for help on using the changeset viewer.