- Timestamp:
- Feb 1, 2000, 1:53:31 PM (26 years ago)
- Location:
- trunk/src/gdi32
- Files:
-
- 4 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gdi32/dibsect.cpp
r2581 r2592 1 /* $Id: dibsect.cpp,v 1.1 3 2000-01-31 22:30:07sandervl Exp $ */1 /* $Id: dibsect.cpp,v 1.14 2000-02-01 12:53:29 sandervl Exp $ */ 2 2 3 3 /* … … 43 43 //****************************************************************************** 44 44 //****************************************************************************** 45 DIBSection::DIBSection(WINBITMAPINFOHEADER *pbmi, DWORD handle, int fFlip)45 DIBSection::DIBSection(WINBITMAPINFOHEADER *pbmi, DWORD iUsage, DWORD handle, int fFlip) 46 46 : bmpBits(NULL), pOS2bmp(NULL), next(NULL) 47 47 { … … 96 96 pOS2bmp->cBitCount = pbmi->biBitCount; 97 97 pOS2bmp->ulCompression = pbmi->biCompression; 98 //SvL: Ignore BI_BITFIELDS type (GpiDrawBits fails otherwise) 99 if(pOS2bmp->ulCompression == 3) { 100 pOS2bmp->ulCompression = 0; 101 } 98 102 pOS2bmp->cbImage = pbmi->biSizeImage; 99 103 dprintf(("handle %x", handle)); … … 104 108 dprintf(("pOS2bmp->ulCompression %d\n", pOS2bmp->ulCompression)); 105 109 dprintf(("pOS2bmp->cbImage %d\n", pOS2bmp->cbImage)); 106 dprintf(("Bits at 0x%08X\n",bmpBits));110 dprintf(("Bits at %x, size %d",bmpBits, bmpsize*pbmi->biHeight)); 107 111 108 112 this->handle = handle; 113 this->iUsage = iUsage; 109 114 110 115 dibMutex.enter(); … … 312 317 WinReleasePS(hps); 313 318 } 314 if(rc == GPI_OK) 315 return(TRUE);316 319 if(rc == GPI_OK) { 320 return(TRUE); 321 } 317 322 dprintf(("DIBSection::BitBlt %X (%d,%d) (%d,%d) to (%d,%d) (%d,%d) returned %d\n", hps, point[0].x, point[0].y, point[1].x, point[1].y, point[2].x, point[2].y, point[3].x, point[3].y, rc)); 318 323 dprintf(("WinGetLastError returned %X\n", WinGetLastError(WinQueryAnchorBlock(hwndDest)) & 0xFFFF)); … … 325 330 this->hdc = hdc; 326 331 hwndParent = WinWindowFromDC(hdc); 327 dprintf(("SelectDIBObject (0x%08X) hwndParent = 0x%08X\n",hdc, hwndParent));332 dprintf(("SelectDIBObject %x into %x hwndParent = %x", handle, hdc, hwndParent)); 328 333 } 329 334 //****************************************************************************** … … 380 385 LPWINBITMAP dsBm = (LPWINBITMAP)lpBuffer; 381 386 387 dprintf2(("GetDIBSection %x %d %x", handle, iSize, lpBuffer)); 382 388 if(iSize == sizeof(DIBSECTION)) 383 389 { -
trunk/src/gdi32/dibsect.h
r2267 r2592 1 /* $Id: dibsect.h,v 1. 9 1999-12-30 11:21:30sandervl Exp $ */1 /* $Id: dibsect.h,v 1.10 2000-02-01 12:53:29 sandervl Exp $ */ 2 2 3 3 /* … … 63 63 { 64 64 public: 65 DIBSection(WINBITMAPINFOHEADER *pbmi, DWORD handle, int fFlip);65 DIBSection(WINBITMAPINFOHEADER *pbmi, DWORD iUsage, DWORD handle, int fFlip); 66 66 ~DIBSection(); 67 67 … … 70 70 char GetBitCount(); 71 71 void UnSelectDIBObject() { this->hdc = 0; }; 72 73 DWORD GetBitmapHandle() { return handle; }; 74 DWORD GetRGBUsage() { return iUsage; }; 72 75 73 76 BOOL BitBlt(HDC hdcDest, int nXdest, int nYDest, … … 92 95 93 96 private: 94 DWORD handle ;97 DWORD handle, iUsage; 95 98 HWND hwndParent; 96 99 HDC hdc; -
trunk/src/gdi32/gdi32.cpp
r2581 r2592 1 /* $Id: gdi32.cpp,v 1.3 6 2000-01-31 22:30:08sandervl Exp $ */1 /* $Id: gdi32.cpp,v 1.37 2000-02-01 12:53:30 sandervl Exp $ */ 2 2 3 3 /* … … 21 21 #include "oslibgpi.h" 22 22 #include "oslibgdi.h" 23 24 static ULONG QueryPaletteSize(BITMAPINFOHEADER *pBHdr)25 {26 ULONG cbPalette;27 28 switch (pBHdr->biBitCount)29 {30 case 1:31 case 4:32 case 8:33 cbPalette = (1 << pBHdr->biBitCount) * sizeof(RGBQUAD);34 break;35 36 case 16:37 case 24:38 case 32:39 cbPalette = 0;40 break;41 42 default:43 dprintf(("QueryPaletteSize: error pBHdr->biBitCount = %d", pBHdr->biBitCount));44 cbPalette = -1;45 }46 47 return cbPalette;48 }49 50 static ULONG CalcBitmapSize(ULONG cBits, LONG cx, LONG cy)51 {52 ULONG alignment;53 ULONG factor;54 BOOL flag = TRUE; //true: '*' false: '/'55 56 cy = cy < 0 ? -cy : cy;57 58 switch(cBits)59 {60 case 1:61 factor = 8;62 flag = FALSE;63 break;64 65 case 4:66 factor = 2;67 flag = FALSE;68 break;69 70 case 8:71 factor = 1;72 break;73 74 case 16:75 factor = 2;76 break;77 78 case 24:79 factor = 3;80 break;81 82 case 32:83 return cx*cy;84 85 default:86 return 0;87 }88 89 if (flag)90 alignment = (cx = (cx*factor)) % 4;91 else92 alignment = (cx = ((cx+factor-1)/factor)) % 4;93 94 if (alignment != 0)95 cx += 4 - alignment;96 97 return cx*cy;98 }99 23 100 24 //****************************************************************************** … … 155 79 //****************************************************************************** 156 80 //****************************************************************************** 157 UINT WIN32API RealizePalette( HDC arg1)158 {159 dprintf(("GDI32: RealizePalette(0x%08X)\n",arg1));160 return O32_RealizePalette(arg1);161 }162 //******************************************************************************163 //******************************************************************************164 81 int WIN32API GetObjectA( HGDIOBJ hObject, int size, void *lpBuffer) 165 82 { … … 220 137 //****************************************************************************** 221 138 //****************************************************************************** 222 HPALETTE WIN32API CreatePalette( const LOGPALETTE * arg1)223 {224 HPALETTE rc;225 dprintf(("GDI32: CreatePalette\n"));226 for(int i=0; i<arg1->palNumEntries;i++)227 {228 dprintf2(("Index %d : 0x%08X\n",i, *((DWORD*)(&arg1->palPalEntry[i])) ));229 }230 rc = O32_CreatePalette(arg1);231 dprintf((" returns 0x%08X\n",rc));232 233 return rc;234 }235 //******************************************************************************236 //******************************************************************************237 139 HBRUSH WIN32API CreatePatternBrush(HBITMAP arg1) 238 140 { … … 259 161 //****************************************************************************** 260 162 //****************************************************************************** 261 HRGN WIN32API CreatePolyPolygonRgn( const POINT * arg1, const INT * arg2, int arg3, int arg4)262 {263 dprintf(("GDI32: CreatePolyPolygonRgn\n"));264 return O32_CreatePolyPolygonRgn(arg1, arg2, arg3, arg4);265 }266 //******************************************************************************267 //******************************************************************************268 HRGN WIN32API CreatePolygonRgn(const POINT * arg1, int arg2, int arg3)269 {270 dprintf(("GDI32: CreatePolygonRgn"));271 return O32_CreatePolygonRgn(arg1, arg2, arg3);272 }273 //******************************************************************************274 //******************************************************************************275 163 HBRUSH WIN32API CreateDIBPatternBrushPt( const VOID * arg1, UINT arg2) 276 164 { 277 165 dprintf(("GDI32: CreateDIBPatternBrushPt\n")); 278 166 return O32_CreateDIBPatternBrushPt(arg1, arg2); 279 }280 //******************************************************************************281 //******************************************************************************282 HBITMAP WIN32API CreateDIBitmap(HDC arg1, const BITMAPINFOHEADER * arg2, DWORD arg3, const void * arg4, const BITMAPINFO * arg5, UINT arg6)283 {284 int iHeight;285 HBITMAP rc;286 dprintf(("GDI32: CreateDIBitmap\n"));287 288 //TEMPORARY HACK TO PREVENT CRASH IN OPEN32 (WSeB GA)289 290 iHeight = arg2->biHeight;291 if(arg2->biHeight < 0)292 {293 ((BITMAPINFOHEADER *)arg2)->biHeight = -arg2->biHeight;294 }295 296 rc = O32_CreateDIBitmap(arg1, arg2, arg3, arg4, arg5, arg6);297 298 ((BITMAPINFOHEADER *)arg2)->biHeight = iHeight;299 300 return rc;301 }302 //******************************************************************************303 //******************************************************************************304 HBITMAP WIN32API CreateCompatibleBitmap( HDC arg1, int arg2, int arg3)305 {306 dprintf(("GDI32: CreateCompatibleBitmap\n"));307 return O32_CreateCompatibleBitmap(arg1, arg2, arg3);308 167 } 309 168 //****************************************************************************** … … 369 228 //****************************************************************************** 370 229 //****************************************************************************** 371 BOOL WIN32API StretchBlt(HDC hdcDest, int nXOriginDest, int nYOriginDest,372 int nWidthDest, int nHeightDest,373 HDC hdcSrc, int nXOriginSrc, int nYOriginSrc,374 int nWidthSrc, int nHeightSrc, DWORD dwRop)375 {376 dprintf(("GDI32: StretchBlt Dest: (%d, %d) size (%d, %d)\n",377 nXOriginDest, nYOriginDest, nWidthDest, nHeightDest));378 dprintf(("GDI32: StretchBlt Src : (%d, %d) size (%d, %d)\n",379 nXOriginSrc, nYOriginSrc, nWidthSrc, nHeightSrc));380 if(DIBSection::getSection() != NULL)381 {382 DIBSection *dsect = DIBSection::findHDC(hdcSrc);383 if(dsect)384 {385 dprintf((" Do stretched DIB Blt\n"));386 return(dsect->BitBlt( hdcDest,387 nXOriginDest, nYOriginDest, nWidthDest, nHeightDest,388 nXOriginSrc, nYOriginSrc, nWidthSrc, nHeightSrc,389 dwRop));390 }391 }392 return O32_StretchBlt(hdcDest, nXOriginDest, nYOriginDest, nWidthDest, nHeightDest, hdcSrc, nXOriginSrc, nYOriginSrc, nWidthSrc, nHeightSrc, dwRop);393 }394 //******************************************************************************395 //******************************************************************************396 230 BOOL WIN32API StrokeAndFillPath( HDC arg1) 397 231 { … … 408 242 //****************************************************************************** 409 243 //****************************************************************************** 410 int WIN32API SetStretchBltMode( HDC arg1, int arg2)411 {412 dprintf(("GDI32: SetStretchBltMode 0x%08X, 0x%08X\n",arg1, arg2));413 414 if(DIBSection::getSection() != NULL)415 {416 DIBSection *dsect = DIBSection::findHDC(arg1);417 if(dsect)418 {419 dprintf((" - DC is DIBSection\n"));420 }421 }422 return O32_SetStretchBltMode(arg1, arg2);423 }424 //******************************************************************************425 //******************************************************************************426 244 HGDIOBJ WIN32API SelectObject(HDC hdc, HGDIOBJ hObj) 427 245 { 428 246 HGDIOBJ rc; 429 247 430 //// dprintf(("GDI32: SelectObject\n"));248 dprintf2(("GDI32: SelectObject %x %x", hdc, hObj)); 431 249 432 250 if(DIBSection::getSection() != NULL) … … 459 277 //****************************************************************************** 460 278 //****************************************************************************** 461 HPALETTE WIN32API SelectPalette(HDC arg1, HPALETTE arg2, BOOL arg3)462 {463 dprintf(("GDI32: SelectPalette (0x%08X, 0x%08X, 0x%08X)\n", arg1, arg2, arg3));464 if(DIBSection::getSection() != NULL)465 {466 DIBSection *dsect = DIBSection::findHDC(arg1);467 if(dsect)468 {469 PALETTEENTRY Pal[256];470 char PalSize = dsect->GetBitCount();471 dprintf((" - Set Palette Values in DIBSection\n"));472 if(PalSize<=8)473 {474 GetPaletteEntries( arg2, 0, 1<<PalSize, (LPPALETTEENTRY)&Pal);475 dsect->SetDIBColorTable(0, 1<< PalSize, (RGBQUAD*)&Pal);476 }477 478 }479 }480 return O32_SelectPalette(arg1, arg2, arg3);481 }482 //******************************************************************************483 //******************************************************************************484 279 int WIN32API SetBkMode( HDC arg1, int arg2) 485 280 { … … 552 347 //****************************************************************************** 553 348 //****************************************************************************** 554 BOOL WIN32API AnimatePalette( HPALETTE arg1, UINT arg2, UINT arg3, const PALETTEENTRY * arg4)555 {556 dprintf(("GDI32: AnimatePalette"));557 return O32_AnimatePalette(arg1, arg2, arg3, arg4);558 }559 //******************************************************************************560 //******************************************************************************561 349 BOOL WIN32API Arc( HDC arg1, int arg2, int arg3, int arg4, int arg5, int arg6, int arg7, int arg8, int arg9) 562 350 { … … 580 368 //****************************************************************************** 581 369 //****************************************************************************** 582 BOOL WIN32API BitBlt(HDC hdcDest, int arg2, int arg3, int arg4, int arg5, HDC hdcSrc, int arg7, int arg8, DWORD arg9)583 {584 if(DIBSection::getSection() != NULL) {585 DIBSection *dsect = DIBSection::findHDC(hdcSrc);586 if(dsect) {587 return(dsect->BitBlt(hdcDest, arg2, arg3, arg4, arg5, arg7, arg8, arg4, arg5, arg9));588 }589 }590 dprintf(("GDI32: BitBlt to hdc %X from (%d,%d) to (%d,%d), (%d,%d) rop %X\n", hdcDest, arg7, arg8, arg2, arg3, arg4, arg5, arg9));591 return O32_BitBlt(hdcDest, arg2, arg3, arg4, arg5, hdcSrc, arg7, arg8, arg9);592 }593 //******************************************************************************594 //******************************************************************************595 370 BOOL WIN32API Chord( HDC arg1, int arg2, int arg3, int arg4, int arg5, int arg6, int arg7, int arg8, int arg9) 596 371 { … … 600 375 //****************************************************************************** 601 376 //****************************************************************************** 602 HENHMETAFILE WIN32API CloseEnhMetaFile( HDC arg1)603 {604 dprintf(("GDI32: CloseEnhMetaFile"));605 return O32_CloseEnhMetaFile(arg1);606 }607 //******************************************************************************608 //******************************************************************************609 377 BOOL WIN32API CloseFigure( HDC arg1) 610 378 { 611 379 dprintf(("GDI32: CloseFigure")); 612 380 return O32_CloseFigure(arg1); 613 }614 //******************************************************************************615 //******************************************************************************616 HMETAFILE WIN32API CloseMetaFile( HDC arg1)617 {618 dprintf(("GDI32: CloseMetaFile"));619 return O32_CloseMetaFile(arg1);620 }621 //******************************************************************************622 //******************************************************************************623 int WIN32API CombineRgn( HRGN arg1, HRGN arg2, HRGN arg3, int arg4)624 {625 dprintf(("GDI32: CombineRgn"));626 return O32_CombineRgn(arg1, arg2, arg3, arg4);627 }628 //******************************************************************************629 //******************************************************************************630 HENHMETAFILE WIN32API CopyEnhMetaFileA( HENHMETAFILE arg1, LPCSTR arg2)631 {632 dprintf(("GDI32: CopyEnhMetaFileA"));633 return O32_CopyEnhMetaFile(arg1, arg2);634 }635 //******************************************************************************636 //******************************************************************************637 HENHMETAFILE WIN32API CopyEnhMetaFileW( HENHMETAFILE arg1, LPCWSTR arg2)638 {639 char *astring = UnicodeToAsciiString((LPWSTR)arg2);640 HENHMETAFILE rc;641 642 dprintf(("GDI32: CopyEnhMetaFileW"));643 rc = O32_CopyEnhMetaFile(arg1, astring);644 FreeAsciiString(astring);645 return rc;646 }647 //******************************************************************************648 //******************************************************************************649 HMETAFILE WIN32API CopyMetaFileA( HMETAFILE arg1, LPCSTR arg2)650 {651 dprintf(("GDI32: CopyMetaFileA"));652 return O32_CopyMetaFile(arg1, arg2);653 }654 //******************************************************************************655 //******************************************************************************656 HMETAFILE WIN32API CopyMetaFileW( HMETAFILE arg1, LPCWSTR arg2)657 {658 char *astring = UnicodeToAsciiString((LPWSTR)arg2);659 HMETAFILE rc;660 661 dprintf(("GDI32: CopyMetaFileW"));662 rc = O32_CopyMetaFile(arg1, astring);663 FreeAsciiString(astring);664 return rc;665 }666 //******************************************************************************667 //******************************************************************************668 HBITMAP WIN32API CreateBitmap(int nWidth, int nHeight, UINT cPlanes,669 UINT cBitsPerPel, const void *lpvBits)670 {671 HBITMAP rc;672 673 rc = O32_CreateBitmap(nWidth, nHeight, cPlanes, cBitsPerPel, lpvBits);674 dprintf(("GDI32: CreateBitmap (%d,%d) bps %d returned %d\n", nWidth, nHeight, cBitsPerPel, rc));675 return(rc);676 }677 //******************************************************************************678 //******************************************************************************679 HBITMAP WIN32API CreateBitmapIndirect( const BITMAP * arg1)680 {681 dprintf(("GDI32: CreateBitmapIndirect"));682 return O32_CreateBitmapIndirect(arg1);683 381 } 684 382 //****************************************************************************** … … 774 472 //****************************************************************************** 775 473 //****************************************************************************** 776 HRGN WIN32API CreateEllipticRgn( int arg1, int arg2, int arg3, int arg4)777 {778 dprintf(("GDI32: CreateEllipticRgn"));779 return O32_CreateEllipticRgn(arg1, arg2, arg3, arg4);780 }781 //******************************************************************************782 //******************************************************************************783 HRGN WIN32API CreateEllipticRgnIndirect( const RECT * arg1)784 {785 dprintf(("GDI32: CreateEllipticRgnIndirect"));786 return O32_CreateEllipticRgnIndirect(arg1);787 }788 //******************************************************************************789 //******************************************************************************790 HENHMETAFILE WIN32API CreateEnhMetaFileA( HDC arg1, LPCSTR arg2, const RECT * arg3, LPCSTR arg4)791 {792 dprintf(("GDI32: CreateEnhMetaFileA"));793 return O32_CreateEnhMetaFile(arg1, arg2, arg3, arg4);794 }795 //******************************************************************************796 //******************************************************************************797 HENHMETAFILE WIN32API CreateEnhMetaFileW( HDC arg1, LPCWSTR arg2, const RECT * arg3, LPCWSTR arg4)798 {799 char *astring1 = UnicodeToAsciiString((LPWSTR)arg2);800 char *astring2 = UnicodeToAsciiString((LPWSTR)arg4);801 HENHMETAFILE rc;802 803 dprintf(("GDI32: CreateMetaFileW"));804 rc = O32_CreateEnhMetaFile(arg1,astring1,arg3,astring2);805 FreeAsciiString(astring1);806 FreeAsciiString(astring2);807 return rc;808 }809 //******************************************************************************810 //******************************************************************************811 //******************************************************************************812 //******************************************************************************813 474 HBRUSH WIN32API CreateHatchBrush( int arg1, COLORREF arg2) 814 475 { … … 897 558 //****************************************************************************** 898 559 //****************************************************************************** 899 HDC WIN32API CreateMetaFileA( LPCSTR arg1)900 {901 dprintf(("GDI32: CreateMetaFileA"));902 return O32_CreateMetaFile(arg1);903 }904 //******************************************************************************905 //******************************************************************************906 HDC WIN32API CreateMetaFileW( LPCWSTR arg1)907 {908 char *astring = UnicodeToAsciiString((LPWSTR)arg1);909 HDC rc;910 911 dprintf(("GDI32: CreateMetaFileW"));912 rc = O32_CreateMetaFile(astring);913 FreeAsciiString(astring);914 return rc;915 }916 //******************************************************************************917 //******************************************************************************918 HRGN WIN32API CreateRectRgn( int nLeftRect, int nTopRect, int nRightRect, int nBottomRect)919 {920 dprintf(("GDI32: CreateRectRgn (%d,%d)(%d,%d)", nLeftRect, nTopRect, nRightRect, nBottomRect));921 return O32_CreateRectRgn(nLeftRect, nTopRect, nRightRect, nBottomRect);922 }923 //******************************************************************************924 //******************************************************************************925 HRGN WIN32API CreateRectRgnIndirect( const RECT * lpRect)926 {927 if(lpRect == NULL) {928 SetLastError(ERROR_INVALID_PARAMETER);929 return 0;930 }931 dprintf(("GDI32: CreateRectRgnIndirect (%d,%d)(%d,%d)", lpRect->left, lpRect->top, lpRect->right, lpRect->bottom));932 return O32_CreateRectRgnIndirect(lpRect);933 }934 //******************************************************************************935 //******************************************************************************936 HRGN WIN32API CreateRoundRectRgn(int nLeftRect, int nTopRect, int nRightRect, int nBottomRect,937 int nWidthEllipse, int nHeightEllipse)938 {939 dprintf(("GDI32: CreateRoundRectRgn (%d,%d)(%d,%d) (%d,%d)", nLeftRect, nTopRect, nRightRect, nBottomRect, nWidthEllipse, nHeightEllipse));940 return O32_CreateRoundRectRgn(nLeftRect, nTopRect, nRightRect, nBottomRect, nWidthEllipse, nHeightEllipse);941 }942 //******************************************************************************943 //******************************************************************************944 560 HBRUSH WIN32API CreateSolidBrush( COLORREF arg1) 945 561 { … … 956 572 //****************************************************************************** 957 573 //****************************************************************************** 958 BOOL WIN32API DeleteEnhMetaFile( HENHMETAFILE arg1)959 {960 dprintf(("GDI32: DeleteEnhMetaFile\n"));961 return O32_DeleteEnhMetaFile(arg1);962 }963 //******************************************************************************964 //******************************************************************************965 BOOL WIN32API DeleteMetaFile( HMETAFILE arg1)966 {967 dprintf(("GDI32: DeleteMetaFile"));968 return O32_DeleteMetaFile(arg1);969 }970 //******************************************************************************971 //******************************************************************************972 574 BOOL WIN32API Ellipse( HDC arg1, int arg2, int arg3, int arg4, int arg5) 973 575 { … … 998 600 //****************************************************************************** 999 601 //****************************************************************************** 1000 BOOL WIN32API EnumEnhMetaFile( HDC arg1, HENHMETAFILE arg2, ENHMFENUMPROC arg3, PVOID arg4, const RECT * arg5)1001 {1002 dprintf(("GDI32: EnumEnhMetaFile DOESN'T WORK!"));1003 // return O32_EnumEnhMetaFile(arg1, arg2, arg3, arg4, arg5);1004 return 0;1005 }1006 //******************************************************************************1007 //******************************************************************************1008 BOOL WIN32API PatBlt(HDC hdc,int nXLeft,int nYLeft,int nWidth,int nHeight,DWORD dwRop)1009 {1010 BOOL rc;1011 1012 //CB: Open32 bug: negative width/height not supported!1013 if (nWidth < 0)1014 {1015 nXLeft += nWidth+1;1016 nWidth = -nWidth;1017 }1018 if (nHeight < 0)1019 {1020 nYLeft += nHeight+1;1021 nHeight = -nHeight;1022 }1023 rc = O32_PatBlt(hdc,nXLeft,nYLeft,nWidth,nHeight,dwRop);1024 dprintf(("GDI32: PatBlt (%d,%d) (%d,%d) returned %d\n",nXLeft,nYLeft,nWidth,nHeight,rc));1025 return(rc);1026 }1027 //******************************************************************************1028 //******************************************************************************1029 602 BOOL WIN32API Rectangle( HDC arg1, int arg2, int arg3, int arg4, int arg5) 1030 603 { … … 1038 611 dprintf(("GDI32: SetROP2 %x %x", hdc, rop2)); 1039 612 return O32_SetROP2(hdc, rop2); 1040 }1041 //******************************************************************************1042 //TODO: Callback1043 //******************************************************************************1044 BOOL WIN32API EnumMetaFile( HDC arg1, HMETAFILE arg2, MFENUMPROC arg3, LPARAM arg4)1045 {1046 dprintf(("GDI32: EnumMetaFile STUB"));1047 //calling convention differences1048 // return O32_EnumMetaFile(arg1, arg2, arg3, arg4);1049 return 0;1050 613 } 1051 614 //****************************************************************************** … … 1060 623 //****************************************************************************** 1061 624 //****************************************************************************** 1062 BOOL WIN32API EqualRgn( HRGN arg1, HRGN arg2)1063 {1064 dprintf(("GDI32: EqualRgn"));1065 return O32_EqualRgn(arg1, arg2);1066 }1067 //******************************************************************************1068 //******************************************************************************1069 625 int WIN32API Escape( HDC arg1, int arg2, int arg3, LPCSTR arg4, PVOID arg5) 1070 626 { … … 1088 644 //****************************************************************************** 1089 645 //****************************************************************************** 1090 HRGN WIN32API ExtCreateRegion( const XFORM * arg1, DWORD arg2, const RGNDATA * arg3)1091 {1092 dprintf(("GDI32: ExtCreateRegion"));1093 return O32_ExtCreateRegion(arg1, arg2, arg3);1094 }1095 //******************************************************************************1096 //******************************************************************************1097 646 BOOL WIN32API ExtFloodFill( HDC arg1, int arg2, int arg3, COLORREF arg4, UINT arg5) 1098 647 { … … 1102 651 //****************************************************************************** 1103 652 //****************************************************************************** 1104 int WIN32API ExtSelectClipRgn( HDC arg1, HRGN arg2, int arg3)1105 {1106 dprintf(("GDI32: ExtSelectClipRgn"));1107 return O32_ExtSelectClipRgn(arg1, arg2, arg3);1108 }1109 //******************************************************************************1110 //******************************************************************************1111 653 BOOL WIN32API FillPath( HDC arg1) 1112 654 { … … 1116 658 //****************************************************************************** 1117 659 //****************************************************************************** 1118 BOOL WIN32API FillRgn( HDC arg1, HRGN arg2, HBRUSH arg3)1119 {1120 dprintf(("GDI32: FillRgn"));1121 return O32_FillRgn(arg1, arg2, arg3);1122 }1123 //******************************************************************************1124 //******************************************************************************1125 660 BOOL WIN32API FlattenPath( HDC arg1) 1126 661 { … … 1137 672 //****************************************************************************** 1138 673 //****************************************************************************** 1139 BOOL WIN32API FrameRgn( HDC arg1, HRGN arg2, HBRUSH arg3, int arg4, int arg5)1140 {1141 dprintf(("GDI32: FrameRgn"));1142 return O32_FrameRgn(arg1, arg2, arg3, arg4, arg5);1143 }1144 //******************************************************************************1145 //******************************************************************************1146 674 int WIN32API GetArcDirection( HDC arg1) 1147 675 { … … 1155 683 dprintf(("GDI32: GetAspectRatioFilterEx")); 1156 684 return O32_GetAspectRatioFilterEx(arg1, arg2); 1157 }1158 //******************************************************************************1159 //******************************************************************************1160 LONG WIN32API GetBitmapBits( HBITMAP arg1, LONG arg2, PVOID arg3)1161 {1162 dprintf(("GDI32: GetBitmapBits"));1163 return O32_GetBitmapBits(arg1, arg2, arg3);1164 }1165 //******************************************************************************1166 //******************************************************************************1167 BOOL WIN32API GetBitmapDimensionEx( HBITMAP arg1, PSIZE arg2)1168 {1169 dprintf(("GDI32: GetBitmapDimensionEx"));1170 return O32_GetBitmapDimensionEx(arg1, arg2);1171 685 } 1172 686 //****************************************************************************** … … 1240 754 //****************************************************************************** 1241 755 //****************************************************************************** 1242 int WIN32API GetClipRgn( HDC arg1, HRGN arg2)1243 {1244 dprintf(("GDI32: GetClipRgn"));1245 return O32_GetClipRgn(arg1, arg2);1246 }1247 //******************************************************************************1248 //******************************************************************************1249 756 HANDLE WIN32API GetCurrentObject( HDC hdc, UINT arg2) 1250 757 { … … 1258 765 dprintf(("GDI32: GetCurrentPositionEx")); 1259 766 return O32_GetCurrentPositionEx(arg1, arg2); 1260 }1261 //******************************************************************************1262 //******************************************************************************1263 int WIN32API GetDIBits(HDC hdc, HBITMAP hBitmap, UINT uStartScan, UINT cScanLines,1264 void *lpvBits, PBITMAPINFO lpbi, UINT uUsage)1265 {1266 #if 11267 dprintf(("GDI32: GetDIBits"));1268 return O32_GetDIBits(hdc, hBitmap, uStartScan, cScanLines, lpvBits, lpbi, uUsage);1269 #else1270 int rc;1271 1272 rc = O32_GetDIBits(hdc, hBitmap, uStartScan, cScanLines, lpvBits, lpbi, uUsage);1273 dprintf(("GDI32: GetDIBits %x %x %d %d %x %x %d returned %d", hdc, hBitmap, uStartScan, cScanLines, lpvBits, lpbi, uUsage, rc));1274 //SvL: Wrong Open32 return value1275 return (rc == TRUE) ? cScanLines : 0;1276 #endif1277 767 } 1278 768 //****************************************************************************** … … 1291 781 //****************************************************************************** 1292 782 //****************************************************************************** 1293 HENHMETAFILE WIN32API GetEnhMetaFileA( LPCSTR arg1)1294 {1295 dprintf(("GDI32: GetEnhMetaFileA"));1296 return O32_GetEnhMetaFile(arg1);1297 }1298 //******************************************************************************1299 //******************************************************************************1300 UINT WIN32API GetEnhMetaFileBits( HENHMETAFILE arg1, UINT arg2, PBYTE arg3)1301 {1302 dprintf(("GDI32: GetEnhMetaFileBits"));1303 return O32_GetEnhMetaFileBits(arg1, arg2, arg3);1304 }1305 //******************************************************************************1306 //******************************************************************************1307 UINT WIN32API GetEnhMetaFileHeader( HENHMETAFILE arg1, UINT arg2, LPENHMETAHEADER arg3)1308 {1309 dprintf(("GDI32: GetEnhMetaFileHeader"));1310 return O32_GetEnhMetaFileHeader(arg1, arg2, arg3);1311 }1312 //******************************************************************************1313 //******************************************************************************1314 UINT WIN32API GetEnhMetaFilePaletteEntries( HENHMETAFILE arg1, UINT arg2, PPALETTEENTRY arg3)1315 {1316 dprintf(("GDI32: GetEnhMetaFilePaletteEntries"));1317 return O32_GetEnhMetaFilePaletteEntries(arg1, arg2, arg3);1318 }1319 //******************************************************************************1320 //******************************************************************************1321 HENHMETAFILE WIN32API GetEnhMetaFileW( LPCWSTR arg1)1322 {1323 char *astring = UnicodeToAsciiString((LPWSTR)arg1);1324 HENHMETAFILE rc;1325 1326 dprintf(("GDI32: GetEnhMetaFileW"));1327 // NOTE: This will not work as is (needs UNICODE support)1328 rc = O32_GetEnhMetaFile(astring);1329 FreeAsciiString(astring);1330 return rc;1331 }1332 //******************************************************************************1333 //******************************************************************************1334 783 int WIN32API GetGraphicsMode(HDC arg1) 1335 784 { … … 1361 810 //****************************************************************************** 1362 811 //****************************************************************************** 1363 HMETAFILE WIN32API GetMetaFileA( LPCSTR arg1)1364 {1365 dprintf(("GDI32: GetMetaFileA"));1366 return O32_GetMetaFile(arg1);1367 }1368 //******************************************************************************1369 //******************************************************************************1370 UINT WIN32API GetMetaFileBitsEx( HMETAFILE arg1, UINT arg2, LPVOID arg3)1371 {1372 dprintf(("GDI32: GetMetaFileBitsEx"));1373 return O32_GetMetaFileBitsEx(arg1, arg2, arg3);1374 }1375 //******************************************************************************1376 //******************************************************************************1377 HMETAFILE WIN32API GetMetaFileW( LPCWSTR arg1)1378 {1379 char *astring = UnicodeToAsciiString((LPWSTR)arg1);1380 HENHMETAFILE rc;1381 1382 dprintf(("GDI32: GetMetaFileW"));1383 rc = O32_GetMetaFile(astring);1384 FreeAsciiString(astring);1385 return rc;1386 1387 }1388 //******************************************************************************1389 //******************************************************************************1390 812 BOOL WIN32API GetMiterLimit( HDC arg1, float * arg2) 1391 813 { … … 1399 821 dprintf(("GDI32: GetNearestColor\n")); 1400 822 return O32_GetNearestColor(arg1, arg2); 1401 }1402 //******************************************************************************1403 //******************************************************************************1404 UINT WIN32API GetNearestPaletteIndex( HPALETTE arg1, COLORREF arg2)1405 {1406 UINT rc;1407 dprintf(("GDI32: GetNearestPaletteIndex (0x%08X ,0x%08X) ",arg1,arg2));1408 rc = O32_GetNearestPaletteIndex(arg1, arg2);1409 dprintf(("Returns %d\n",rc));1410 return rc;1411 823 } 1412 824 //****************************************************************************** … … 1428 840 //****************************************************************************** 1429 841 //****************************************************************************** 1430 UINT WIN32API GetPaletteEntries( HPALETTE arg1, UINT arg2, UINT arg3, PPALETTEENTRY arg4)1431 {1432 dprintf(("GDI32: GetPaletteEntries"));1433 return O32_GetPaletteEntries(arg1, arg2, arg3, arg4);1434 }1435 //******************************************************************************1436 //******************************************************************************1437 842 INT WIN32API GetPath( HDC arg1, PPOINT arg2, PBYTE arg3, int arg4) 1438 843 { … … 1460 865 dprintf(("GDI32: GetRasterizerCaps")); 1461 866 return O32_GetRasterizerCaps(arg1, arg2); 1462 }1463 //******************************************************************************1464 //******************************************************************************1465 DWORD WIN32API GetRegionData( HRGN arg1, DWORD arg2, PRGNDATA arg3)1466 {1467 dprintf(("GDI32: GetRegionData"));1468 return O32_GetRegionData(arg1, arg2, arg3);1469 }1470 //******************************************************************************1471 //******************************************************************************1472 int WIN32API GetRgnBox( HRGN arg1, PRECT arg2)1473 {1474 dprintf(("GDI32: GetRgnBox"));1475 return O32_GetRgnBox(arg1, arg2);1476 }1477 //******************************************************************************1478 //******************************************************************************1479 int WIN32API GetStretchBltMode( HDC arg1)1480 {1481 dprintf(("GDI32: GetStretchBltMode"));1482 return O32_GetStretchBltMode(arg1);1483 }1484 //******************************************************************************1485 //******************************************************************************1486 UINT WIN32API GetSystemPaletteEntries( HDC arg1, UINT arg2, UINT arg3, PPALETTEENTRY arg4)1487 {1488 UINT rc;1489 1490 dprintf(("GDI32: GetSystemPaletteEntries start %d nr %d pal ptr %X", arg2, arg3, arg4));1491 rc = O32_GetSystemPaletteEntries(arg1, arg2, arg3, arg4);1492 dprintf((" GetSystemPaletteEntries returned %d", rc));1493 return(rc);1494 867 } 1495 868 //****************************************************************************** … … 1637 1010 //****************************************************************************** 1638 1011 //****************************************************************************** 1639 UINT WIN32API GetWinMetaFileBits( HENHMETAFILE arg1, UINT arg2, PBYTE arg3, int arg4, HDC arg5)1640 {1641 dprintf(("GDI32: GetWinMetaFileBits"));1642 return O32_GetWinMetaFileBits(arg1, arg2, arg3, arg4, arg5);1643 }1644 //******************************************************************************1645 //******************************************************************************1646 1012 BOOL WIN32API GetWindowOrgEx( HDC arg1, PPOINT arg2) 1647 1013 { … … 1668 1034 //****************************************************************************** 1669 1035 //****************************************************************************** 1670 BOOL WIN32API InvertRgn( HDC arg1, HRGN arg2)1671 {1672 dprintf(("GDI32: InvertRgn"));1673 return O32_InvertRgn(arg1, arg2);1674 }1675 //******************************************************************************1676 //******************************************************************************1677 1036 BOOL WIN32API LPtoDP( HDC arg1, PPOINT arg2, int arg3) 1678 1037 { … … 1682 1041 //****************************************************************************** 1683 1042 //****************************************************************************** 1684 BOOL WIN32API MaskBlt( HDC arg1, int arg2, int arg3, int arg4, int arg5, HDC arg6, int arg7, int arg8, HBITMAP arg9, int arg10, int arg11, DWORD arg12)1685 {1686 dprintf(("GDI32: MaskBlt"));1687 return O32_MaskBlt(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11, arg12);1688 }1689 //******************************************************************************1690 //******************************************************************************1691 1043 BOOL WIN32API ModifyWorldTransform( HDC arg1, const XFORM *arg2, DWORD arg3) 1692 1044 { … … 1696 1048 //****************************************************************************** 1697 1049 //****************************************************************************** 1698 int WIN32API OffsetClipRgn( HDC arg1, int arg2, int arg3)1699 {1700 dprintf(("GDI32: OffsetClipRgn"));1701 return O32_OffsetClipRgn(arg1, arg2, arg3);1702 }1703 //******************************************************************************1704 //******************************************************************************1705 int WIN32API OffsetRgn( HRGN arg1, int arg2, int arg3)1706 {1707 dprintf(("GDI32: OffsetRgn"));1708 return O32_OffsetRgn(arg1, arg2, arg3);1709 }1710 //******************************************************************************1711 //******************************************************************************1712 1050 BOOL WIN32API OffsetViewportOrgEx( HDC arg1, int arg2, int arg3, PPOINT arg4) 1713 1051 { … … 1721 1059 dprintf(("GDI32: OffsetWindowOrgEx")); 1722 1060 return O32_OffsetWindowOrgEx(arg1, arg2, arg3, arg4); 1723 }1724 //******************************************************************************1725 //******************************************************************************1726 BOOL WIN32API PaintRgn( HDC arg1, HRGN arg2)1727 {1728 dprintf(("GDI32: PaintRgn"));1729 return O32_PaintRgn(arg1, arg2);1730 }1731 //******************************************************************************1732 //******************************************************************************1733 HRGN WIN32API PathToRegion( HDC arg1)1734 {1735 dprintf(("GDI32: PathToRegion"));1736 return O32_PathToRegion(arg1);1737 1061 } 1738 1062 //****************************************************************************** … … 1751 1075 //****************************************************************************** 1752 1076 //****************************************************************************** 1753 BOOL WIN32API PlayEnhMetaFile( HDC arg1, HENHMETAFILE arg2, const RECT * arg3)1754 {1755 dprintf(("GDI32: PlayEnhMetaFile"));1756 return O32_PlayEnhMetaFile(arg1, arg2, arg3);1757 }1758 //******************************************************************************1759 //******************************************************************************1760 BOOL WIN32API PlayMetaFile( HDC arg1, HMETAFILE arg2)1761 {1762 dprintf(("GDI32: PlayMetaFile"));1763 return O32_PlayMetaFile(arg1, arg2);1764 }1765 //******************************************************************************1766 //******************************************************************************1767 BOOL WIN32API PlayMetaFileRecord( HDC arg1, LPHANDLETABLE arg2, LPMETARECORD arg3, UINT arg4)1768 {1769 dprintf(("GDI32: PlayMetaFileRecord"));1770 return O32_PlayMetaFileRecord(arg1, arg2, arg3, (int)arg4);1771 }1772 //******************************************************************************1773 //******************************************************************************1774 1077 BOOL WIN32API PolyBezier( HDC arg1, const POINT * arg2, DWORD arg3) 1775 1078 { … … 1815 1118 //****************************************************************************** 1816 1119 //****************************************************************************** 1817 BOOL WIN32API PtInRegion( HRGN arg1, int arg2, int arg3)1818 {1819 dprintf(("GDI32: PtInRegion"));1820 return O32_PtInRegion(arg1, arg2, arg3);1821 }1822 //******************************************************************************1823 //******************************************************************************1824 1120 BOOL WIN32API PtVisible( HDC arg1, int arg2, int arg3) 1825 1121 { 1826 1122 dprintf(("GDI32: PtVisible")); 1827 1123 return O32_PtVisible(arg1, arg2, arg3); 1828 }1829 //******************************************************************************1830 //******************************************************************************1831 BOOL WIN32API RectInRegion( HRGN arg1, const RECT * arg2)1832 {1833 dprintf(("GDI32: RectInRegion"));1834 return O32_RectInRegion(arg1, arg2);1835 1124 } 1836 1125 //****************************************************************************** … … 1858 1147 //****************************************************************************** 1859 1148 //****************************************************************************** 1860 BOOL WIN32API ResizePalette( HPALETTE arg1, UINT arg2)1861 {1862 dprintf(("GDI32: ResizePalette\n"));1863 return O32_ResizePalette(arg1, arg2);1864 }1865 //******************************************************************************1866 //******************************************************************************1867 1149 BOOL WIN32API RestoreDC( HDC arg1, int arg2) 1868 1150 { … … 1900 1182 //****************************************************************************** 1901 1183 //****************************************************************************** 1902 int WIN32API SelectClipRgn( HDC hdc, HRGN hRgn)1903 {1904 dprintf(("GDI32: SelectClipRgn %x %x", hdc, hRgn));1905 return O32_SelectClipRgn(hdc, hRgn);1906 }1907 //******************************************************************************1908 //******************************************************************************1909 1184 int WIN32API SetArcDirection( HDC arg1, int arg2) 1910 1185 { 1911 1186 dprintf(("GDI32: SetArcDirection")); 1912 1187 return O32_SetArcDirection(arg1, arg2); 1913 }1914 //******************************************************************************1915 //******************************************************************************1916 LONG WIN32API SetBitmapBits( HBITMAP arg1, LONG arg2, const VOID * arg3)1917 {1918 dprintf(("GDI32: SetBitmapBits"));1919 return O32_SetBitmapBits(arg1, (DWORD)arg2, arg3);1920 }1921 //******************************************************************************1922 //******************************************************************************1923 BOOL WIN32API SetBitmapDimensionEx( HBITMAP arg1, int arg2, int arg3, PSIZE arg4)1924 {1925 dprintf(("GDI32: SetBitmapDimensionEx"));1926 return O32_SetBitmapDimensionEx(arg1, arg2, arg3, arg4);1927 1188 } 1928 1189 //****************************************************************************** … … 1945 1206 //****************************************************************************** 1946 1207 //****************************************************************************** 1947 int WIN32API SetDIBits( HDC arg1, HBITMAP arg2, UINT arg3, UINT arg4, const VOID * arg5, const BITMAPINFO * arg6, UINT arg7)1948 {1949 dprintf(("GDI32: SetDIBits %x %x %x %x %x %x %x\n", arg1, arg2, arg3, arg4, arg5, arg6, arg7));1950 1951 if(DIBSection::getSection() != NULL) {1952 DIBSection *dsect;1953 1954 dsect = DIBSection::find((DWORD)arg2);1955 if(dsect) {1956 return dsect->SetDIBits(arg1, arg2, arg3, arg4, arg5, (WINBITMAPINFOHEADER *)&arg6->bmiHeader, arg7);1957 }1958 }1959 return O32_SetDIBits(arg1, arg2, arg3, arg4, arg5, arg6, arg7);1960 }1961 //******************************************************************************1962 //******************************************************************************1963 INT WIN32API SetDIBitsToDevice(HDC hdc, INT xDest, INT yDest, DWORD cx,1964 DWORD cy, INT xSrc, INT ySrc,1965 UINT startscan, UINT lines, LPCVOID bits,1966 const BITMAPINFO *info, UINT coloruse)1967 {1968 INT result, imgsize, palsize, height, width;1969 char *ptr;1970 1971 SetLastError(0);1972 if(info == NULL) {1973 goto invalid_parameter;1974 }1975 height = info->bmiHeader.biHeight;1976 width = info->bmiHeader.biWidth;1977 1978 if (height < 0) height = -height;1979 if (!lines || (startscan >= height)) {1980 goto invalid_parameter;1981 }1982 if (startscan + lines > height) lines = height - startscan;1983 1984 if (ySrc < startscan) ySrc = startscan;1985 else if (ySrc >= startscan + lines) goto invalid_parameter;1986 1987 if (xSrc >= width) goto invalid_parameter;1988 1989 if (ySrc + cy >= startscan + lines) cy = startscan + lines - ySrc;1990 1991 if (xSrc + cx >= width) cx = width - xSrc;1992 1993 if (!cx || !cy) goto invalid_parameter;1994 1995 // EB: ->>> Crazy. Nobody seen this Open32 bug ?1996 // Dont't like dirty pointers, but Open32 needs a bit help.1997 // Only tested with winmine.1998 palsize = QueryPaletteSize((BITMAPINFOHEADER*)&info->bmiHeader);1999 imgsize = CalcBitmapSize(info->bmiHeader.biBitCount,2000 info->bmiHeader.biWidth, info->bmiHeader.biHeight);2001 ptr = ((char *)info) + palsize + sizeof(BITMAPINFOHEADER);2002 if(bits >= ptr && bits < ptr + imgsize)2003 {2004 bits = (char *)bits - imgsize +2005 CalcBitmapSize(info->bmiHeader.biBitCount,2006 info->bmiHeader.biWidth, lines);2007 }2008 // EB: <<<-2009 2010 // if(xDest == 0 && yDest == 0 && xSrc == 0 && ySrc == 0 && cx == width && cy == height) {2011 // result = OSLibSetDIBitsToDevice(hdc, xDest, yDest, cx, cy, xSrc, ySrc, startscan, lines, (PVOID) bits, (WINBITMAPINFOHEADER*)info, coloruse);2012 // result = lines;2013 // }2014 // else {2015 result = O32_SetDIBitsToDevice(hdc, xDest, yDest, cx, cy, xSrc, ySrc, startscan, lines, (PVOID) bits, (PBITMAPINFO)info, coloruse);2016 //SvL: Wrong Open32 return value2017 result = (result == TRUE) ? lines : 0;2018 // }2019 2020 dprintf(("GDI32: SetDIBitsToDevice hdc:%X xDest:%d yDest:%d, cx:%d, cy:%d, xSrc:%d, ySrc:%d, startscan:%d, lines:%d, bits:%X, info%X, coloruse:%d returned %d",2021 hdc, xDest, yDest, cx, cy, xSrc, ySrc, startscan, lines, (LPVOID) bits, (PBITMAPINFO)info, coloruse, result));2022 return result;2023 2024 invalid_parameter:2025 SetLastError(ERROR_INVALID_PARAMETER);2026 return 0;2027 }2028 //******************************************************************************2029 //******************************************************************************2030 HENHMETAFILE WIN32API SetEnhMetaFileBits( UINT arg1, const BYTE * arg2)2031 {2032 dprintf(("GDI32: SetEnhMetaFileBits"));2033 return O32_SetEnhMetaFileBits(arg1, arg2);2034 }2035 //******************************************************************************2036 //******************************************************************************2037 1208 int WIN32API SetGraphicsMode(HDC arg1, int arg2) 2038 1209 { … … 2056 1227 //****************************************************************************** 2057 1228 //****************************************************************************** 2058 HMETAFILE WIN32API SetMetaFileBitsEx( UINT arg1, const BYTE * arg2)2059 {2060 dprintf(("GDI32: SetMetaFileBitsEx"));2061 return O32_SetMetaFileBitsEx(arg1, (PBYTE)arg2);2062 }2063 //******************************************************************************2064 //******************************************************************************2065 1229 BOOL WIN32API SetMiterLimit( HDC arg1, float arg2, float * arg3) 2066 1230 { … … 2070 1234 //****************************************************************************** 2071 1235 //****************************************************************************** 2072 UINT WIN32API SetPaletteEntries( HPALETTE arg1, UINT arg2, UINT arg3, PALETTEENTRY * arg4)2073 {2074 dprintf(("GDI32: SetPaletteEntries"));2075 return O32_SetPaletteEntries(arg1, arg2, arg3, (const PALETTEENTRY *)arg4);2076 }2077 //******************************************************************************2078 //******************************************************************************2079 1236 int WIN32API SetPolyFillMode( HDC arg1, int arg2) 2080 1237 { … … 2084 1241 //****************************************************************************** 2085 1242 //****************************************************************************** 2086 BOOL WIN32API SetRectRgn( HRGN arg1, int arg2, int arg3, int arg4, int arg5)2087 {2088 dprintf(("GDI32: SetRectRgn"));2089 return O32_SetRectRgn(arg1, arg2, arg3, arg4, arg5);2090 }2091 //******************************************************************************2092 //******************************************************************************2093 1243 UINT WIN32API SetTextAlign( HDC arg1, UINT arg2) 2094 1244 { … … 2123 1273 dprintf(("GDI32: SetViewportOrgEx")); 2124 1274 return O32_SetViewportOrgEx(arg1, arg2, arg3, arg4); 2125 }2126 //******************************************************************************2127 //******************************************************************************2128 HENHMETAFILE WIN32API SetWinMetaFileBits( UINT arg1, const BYTE * arg2, HDC arg3, const METAFILEPICT * arg4)2129 {2130 dprintf(("GDI32: SetWinMetaFileBits"));2131 return O32_SetWinMetaFileBits(arg1, arg2, arg3, arg4);2132 1275 } 2133 1276 //****************************************************************************** … … 2190 1333 } 2191 1334 //****************************************************************************** 2192 //CreateDisardableBitmap is obsolete and can be replaced by CreateCompatibleBitmap2193 //******************************************************************************2194 HBITMAP WIN32API CreateDiscardableBitmap(HDC hDC, int nWidth, int nHeight)2195 {2196 dprintf(("GDI32: CreateDisardableBitmap\n"));2197 return O32_CreateCompatibleBitmap(hDC, nWidth, nHeight);2198 }2199 //******************************************************************************2200 1335 //TODO: Not implemented 2201 1336 //****************************************************************************** … … 2224 1359 dprintf(("GDI32: SetColorAdjustment, not implemented!(TRUE)\n")); 2225 1360 return(TRUE); 2226 }2227 //******************************************************************************2228 //WINE: OBJECTS\DIB.C2229 //*********************************************************************************2230 HBITMAP WIN32API CreateDIBSection( HDC hdc, BITMAPINFO *pbmi, UINT iUsage,2231 VOID **ppvBits, HANDLE hSection, DWORD dwOffset)2232 {2233 HBITMAP res = 0;2234 BOOL fFlip = 0;2235 int iHeight, iWidth;2236 2237 dprintf(("GDI32: CreateDIBSection %x %x %x %d", hdc, iUsage, hSection, dwOffset));2238 if(hSection)2239 {2240 dprintf(("GDI32: CreateDIBSection, hSection != NULL, not supported!\n"));2241 return NULL;2242 }2243 2244 //SvL: 13-9-98: StarCraft uses bitmap with negative height2245 iWidth = pbmi->bmiHeader.biWidth;2246 if(pbmi->bmiHeader.biWidth < 0)2247 {2248 dprintf(("CreateDIBSection: width %d", pbmi->bmiHeader.biWidth));2249 pbmi->bmiHeader.biWidth = -pbmi->bmiHeader.biWidth;2250 fFlip = FLIP_HOR;2251 }2252 iHeight = pbmi->bmiHeader.biHeight;2253 if(pbmi->bmiHeader.biHeight < 0)2254 {2255 dprintf(("CreateDIBSection: height %d", pbmi->bmiHeader.biHeight));2256 pbmi->bmiHeader.biHeight = -pbmi->bmiHeader.biHeight;2257 fFlip |= FLIP_VERT;2258 }2259 2260 res = O32_CreateDIBitmap(hdc, &pbmi->bmiHeader, 0, NULL, pbmi, 0);2261 if (res)2262 {2263 ULONG Pal[256];2264 char PalSize;2265 LOGPALETTE tmpPal = { 0x300,1,{0,0,0,0}};2266 HPALETTE hpalCur, hpalTmp;2267 DIBSection *dsect = new DIBSection((WINBITMAPINFOHEADER *)&pbmi->bmiHeader, (DWORD)res, fFlip);2268 2269 if(NULL!=dsect)2270 {2271 PalSize = dsect->GetBitCount();2272 if(PalSize<=8)2273 {2274 // Now get the current Palette from the DC2275 hpalTmp = CreatePalette(&tmpPal);2276 hpalCur = SelectPalette(hdc, hpalTmp, FALSE);2277 2278 // and use it to set the DIBColorTable2279 GetPaletteEntries( hpalCur, 0, 1<<PalSize, (LPPALETTEENTRY)&Pal);2280 dsect->SetDIBColorTable(0, 1<< PalSize, (RGBQUAD*)&Pal);2281 2282 // Restore the DC Palette2283 SelectPalette(hdc,hpalCur,FALSE);2284 DeleteObject(hpalTmp);2285 }2286 // Set the hdc in the DIBSection so we can update the palete if a new2287 // Paletet etc. gets selected into the DC.2288 2289 dsect->SelectDIBObject(hdc);2290 2291 if(ppvBits!=NULL)2292 *ppvBits = dsect->GetDIBObject();2293 2294 pbmi->bmiHeader.biWidth = iWidth;2295 pbmi->bmiHeader.biHeight = iHeight;2296 2297 return(res);2298 }2299 }2300 2301 /* Error. */2302 if (res)2303 DeleteObject(res);2304 *ppvBits = NULL;2305 #ifdef DEBUG2306 dprintf(("GDI32: CreateDIBSection, error!\n"));2307 dprintf(("pbmi->biWidth %d", pbmi->bmiHeader.biWidth));2308 dprintf(("pbmi->biHeight %d", pbmi->bmiHeader.biHeight));2309 dprintf(("pbmi->biBitCount %d", pbmi->bmiHeader.biBitCount));2310 #endif2311 2312 return 0;2313 }2314 //******************************************************************************2315 //******************************************************************************2316 UINT WIN32API GetDIBColorTable( HDC hdc, UINT uStartIndex, UINT cEntries,2317 RGBQUAD *pColors)2318 {2319 HPALETTE hpal = O32_GetCurrentObject(hdc, OBJ_PAL);2320 UINT rc;2321 int i;2322 2323 rc = O32_GetPaletteEntries(hpal,2324 uStartIndex,2325 cEntries,2326 (PALETTEENTRY *)pColors);2327 for(i=0;2328 i<cEntries;2329 i++)2330 {2331 BYTE tmp;2332 tmp = pColors[i].rgbBlue;2333 pColors[i].rgbBlue = pColors[i].rgbRed;2334 pColors[i].rgbRed = tmp;2335 pColors[i].rgbReserved = 0;2336 }2337 dprintf(("GDI32: GetDIBColorTable returns %d\n", rc));2338 return(rc);2339 }2340 //******************************************************************************2341 //******************************************************************************2342 UINT WIN32API SetDIBColorTable(HDC hdc, UINT uStartIndex, UINT cEntries,2343 RGBQUAD *pColors)2344 {2345 DIBSection *dsect = DIBSection::findHDC(hdc);2346 2347 dprintf(("GDI32: SetDIBColorTable\n"));2348 if(dsect)2349 {2350 return(dsect->SetDIBColorTable(uStartIndex, cEntries, pColors));2351 }2352 else2353 return(0);2354 }2355 //******************************************************************************2356 //******************************************************************************2357 HPALETTE WIN32API CreateHalftonePalette(HDC hdc)2358 {2359 dprintf(("GDI32: CreateHalftonePalette, not implemented\n"));2360 return(NULL);2361 1361 } 2362 1362 //****************************************************************************** … … 2434 1434 { 2435 1435 dprintf(("GDI32: GetColorAdjustment, not implemented\n")); 2436 return(FALSE);2437 }2438 //******************************************************************************2439 //******************************************************************************2440 BOOL WIN32API PlgBlt(HDC hdcDest, CONST POINT *lpPoint, HDC hdcSrc, int nXSrc,2441 int nYSrc, int nWidth, int nHeight, HBITMAP hbmMask,2442 int xMast, int yMask)2443 {2444 dprintf(("GDI32: PlgBlt, not implemented\n"));2445 1436 return(FALSE); 2446 1437 } … … 2534 1525 FreeAsciiString(astring); 2535 1526 return rc; 2536 }2537 //******************************************************************************2538 //******************************************************************************2539 BOOL WIN32API PlayEnhMetaFileRecord( /*KSO Thu 21.05.1998*/2540 HDC arg1,2541 LPHANDLETABLE arg2,2542 CONST ENHMETARECORD *arg3,2543 UINT arg42544 )2545 {2546 dprintf(("GDI32: PlayEnhMetaFileRecord - stub\n"));2547 return FALSE;2548 }2549 //******************************************************************************2550 UINT WIN32API GetEnhMetaFileDescriptionA( /*KSO Thu 21.05.1998*/2551 HENHMETAFILE arg1,2552 UINT arg2,2553 LPSTR arg32554 )2555 {2556 dprintf(("GDI32: GetEnhMetaFileDescriptionA - stub\n"));2557 return FALSE;2558 }2559 //******************************************************************************2560 //******************************************************************************2561 UINT WIN32API GetEnhMetaFileDescriptionW( /*KSO Thu 21.05.1998*/2562 HENHMETAFILE arg1,2563 UINT arg2,2564 LPWSTR arg32565 )2566 {2567 dprintf(("GDI32: GetEnhMetaFileDescriptionW - stub\n"));2568 return FALSE;2569 1527 } 2570 1528 //****************************************************************************** … … 3173 2131 3174 2132 /***************************************************************************** 3175 * Name : int GetMetaRgn3176 * Purpose : The GetMetaRgn function retrieves the current metaregion for3177 * the specified device context.3178 * Parameters: HDC hdc handle of device context3179 * HRGN hrgn handle of region3180 * Variables :3181 * Result : 0 / 13182 * Remark :3183 * Status : UNTESTED STUB3184 *3185 * Author : Patrick Haller [Mon, 1998/06/15 08:00]3186 *****************************************************************************/3187 3188 int WIN32API GetMetaRgn(HDC hdc,3189 HRGN hrgn)3190 {3191 dprintf(("GDI32: GetMetaRgn(%08xh, %08xh) not implemented.\n",3192 hdc,3193 hrgn));3194 3195 return (0);3196 }3197 3198 /*****************************************************************************3199 2133 * Name : BOOL SetDeviceGammaRamp 3200 2134 * Purpose : The SetDeviceGammaRamp function sets the gamma ramp on direct … … 3270 2204 } 3271 2205 3272 3273 /*****************************************************************************3274 * Name : int SetMetaRgn3275 * Purpose : The SetMetaRgn function intersects the current clipping region3276 * for the specified device context with the current metaregion3277 * and saves the combined region as the new metaregion for the3278 * specified device context. The clipping region is reset to a null region.3279 * Parameters: HDC hdc handle of device context3280 * Variables :3281 * Result : TRUE / FALSE3282 * Remark :3283 * Status : UNTESTED STUB3284 *3285 * Author : Patrick Haller [Mon, 1998/06/15 08:00]3286 *****************************************************************************/3287 3288 BOOL WIN32API SetMetaRgn(HDC hdc)3289 {3290 dprintf(("GDI32: SetMetaRgn(%08xh) not implemented.\n",3291 hdc));3292 3293 return (NULLREGION);3294 }3295 2206 3296 2207 -
trunk/src/gdi32/makefile
r2254 r2592 1 # $Id: makefile,v 1.1 5 1999-12-29 18:51:45sandervl Exp $1 # $Id: makefile,v 1.16 2000-02-01 12:53:30 sandervl Exp $ 2 2 3 3 # … … 26 26 27 27 OBJS = gdi32.obj opengl.obj callback.obj dibsect.obj initterm.obj resource.obj \ 28 oslibgdi.obj font.obj text.obj palette.obj line.obj oslibgpi.obj 28 oslibgdi.obj font.obj text.obj palette.obj line.obj oslibgpi.obj region.obj \ 29 metafile.obj dibitmap.obj blit.obj 29 30 30 31 … … 57 58 $(PDWIN32_INCLUDE)\misc.h \ 58 59 60 region.obj: region.cpp $(PDWIN32_INCLUDE)\misc.h 61 62 metafile.obj: metafile.cpp $(PDWIN32_INCLUDE)\misc.h 63 64 dibitmap.obj: dibitmap.cpp dibsect.h $(PDWIN32_INCLUDE)\misc.h 65 blit.obj: blit.cpp dibsect.h $(PDWIN32_INCLUDE)\misc.h 66 59 67 font.obj: font.cpp \ 60 68 $(PDWIN32_INCLUDE)\misc.h \ … … 64 72 65 73 palette.obj: palette.cpp \ 66 $(PDWIN32_INCLUDE)\misc.h \74 $(PDWIN32_INCLUDE)\misc.h dibsect.h \ 67 75 68 76 dibsect.obj: dibsect.cpp \ -
trunk/src/gdi32/oslibgdi.cpp
r2551 r2592 1 /* $Id: oslibgdi.cpp,v 1. 3 2000-01-28 22:24:58sandervl Exp $ */1 /* $Id: oslibgdi.cpp,v 1.4 2000-02-01 12:53:30 sandervl Exp $ */ 2 2 3 3 /* … … 57 57 os2bmpinfo.cclrImportant = info->biClrImportant; 58 58 59 //rc = GpiDrawBits((HPS)hdc, (VOID *)bits, &os2bmpinfo, 4,60 //points, ROP_SRCCOPY, BBO_IGNORE);59 rc = GpiDrawBits((HPS)hdc, (VOID *)bits, &os2bmpinfo, 4, 60 points, ROP_SRCCOPY, BBO_IGNORE); 61 61 62 //if(rc != GPI_OK) {63 //dprintf(("GpiDrawBits returned %d", rc));64 //}62 if(rc != GPI_OK) { 63 dprintf(("GpiDrawBits returned %d", rc)); 64 } 65 65 return lines; 66 66 } -
trunk/src/gdi32/palette.cpp
r1931 r2592 1 /* $Id: palette.cpp,v 1. 1 1999-12-01 23:30:30sandervl Exp $ */1 /* $Id: palette.cpp,v 1.2 2000-02-01 12:53:31 sandervl Exp $ */ 2 2 3 3 /* … … 16 16 #include <misc.h> 17 17 #include <string.h> 18 #include "dibsect.h" 18 19 19 20 static UINT SystemPaletteUse = SYSPAL_STATIC; /* currently not considered */ … … 46 47 return SystemPaletteUse; 47 48 } 49 //****************************************************************************** 50 //****************************************************************************** 51 UINT WIN32API RealizePalette( HDC hdc) 52 { 53 dprintf(("GDI32: RealizePalette %x", hdc)); 54 return O32_RealizePalette(hdc); 55 } 56 //****************************************************************************** 57 //****************************************************************************** 58 HPALETTE WIN32API CreatePalette( const LOGPALETTE * arg1) 59 { 60 HPALETTE rc; 61 dprintf(("GDI32: CreatePalette\n")); 62 for(int i=0; i<arg1->palNumEntries;i++) 63 { 64 dprintf2(("Index %d : 0x%08X\n",i, *((DWORD*)(&arg1->palPalEntry[i])) )); 65 } 66 rc = O32_CreatePalette(arg1); 67 dprintf((" returns 0x%08X\n",rc)); 68 69 return rc; 70 } 71 //****************************************************************************** 72 //****************************************************************************** 73 HPALETTE WIN32API SelectPalette(HDC arg1, HPALETTE arg2, BOOL arg3) 74 { 75 dprintf(("GDI32: SelectPalette (0x%08X, 0x%08X, 0x%08X)\n", arg1, arg2, arg3)); 76 if(DIBSection::getSection() != NULL) 77 { 78 DIBSection *dsect = DIBSection::findHDC(arg1); 79 if(dsect) 80 { 81 PALETTEENTRY Pal[256]; 82 char PalSize = dsect->GetBitCount(); 83 dprintf((" - Set Palette Values in DIBSection\n")); 84 if(PalSize<=8) 85 { 86 GetPaletteEntries( arg2, 0, 1<<PalSize, (LPPALETTEENTRY)&Pal); 87 dsect->SetDIBColorTable(0, 1<< PalSize, (RGBQUAD*)&Pal); 88 } 89 90 } 91 } 92 return O32_SelectPalette(arg1, arg2, arg3); 93 } 94 //****************************************************************************** 95 //****************************************************************************** 96 BOOL WIN32API AnimatePalette( HPALETTE arg1, UINT arg2, UINT arg3, const PALETTEENTRY * arg4) 97 { 98 dprintf(("GDI32: AnimatePalette")); 99 return O32_AnimatePalette(arg1, arg2, arg3, arg4); 100 } 101 //****************************************************************************** 102 //****************************************************************************** 103 UINT WIN32API GetNearestPaletteIndex( HPALETTE arg1, COLORREF arg2) 104 { 105 UINT rc; 106 dprintf(("GDI32: GetNearestPaletteIndex (0x%08X ,0x%08X) ",arg1,arg2)); 107 rc = O32_GetNearestPaletteIndex(arg1, arg2); 108 dprintf(("Returns %d\n",rc)); 109 return rc; 110 } 111 //****************************************************************************** 112 //****************************************************************************** 113 UINT WIN32API GetPaletteEntries( HPALETTE arg1, UINT arg2, UINT arg3, PPALETTEENTRY arg4) 114 { 115 dprintf(("GDI32: GetPaletteEntries")); 116 return O32_GetPaletteEntries(arg1, arg2, arg3, arg4); 117 } 118 //****************************************************************************** 119 //****************************************************************************** 120 UINT WIN32API GetSystemPaletteEntries( HDC arg1, UINT arg2, UINT arg3, PPALETTEENTRY arg4) 121 { 122 UINT rc; 123 124 dprintf(("GDI32: GetSystemPaletteEntries start %d nr %d pal ptr %X", arg2, arg3, arg4)); 125 rc = O32_GetSystemPaletteEntries(arg1, arg2, arg3, arg4); 126 dprintf((" GetSystemPaletteEntries returned %d", rc)); 127 return(rc); 128 } 129 //****************************************************************************** 130 //****************************************************************************** 131 BOOL WIN32API ResizePalette( HPALETTE arg1, UINT arg2) 132 { 133 dprintf(("GDI32: ResizePalette\n")); 134 return O32_ResizePalette(arg1, arg2); 135 } 136 //****************************************************************************** 137 //****************************************************************************** 138 UINT WIN32API SetPaletteEntries( HPALETTE arg1, UINT arg2, UINT arg3, PALETTEENTRY * arg4) 139 { 140 dprintf(("GDI32: SetPaletteEntries")); 141 return O32_SetPaletteEntries(arg1, arg2, arg3, (const PALETTEENTRY *)arg4); 142 } 143 //****************************************************************************** 144 //****************************************************************************** 145 HPALETTE WIN32API CreateHalftonePalette(HDC hdc) 146 { 147 dprintf(("GDI32: CreateHalftonePalette, not implemented\n")); 148 return(NULL); 149 } 150 //****************************************************************************** 151 //******************************************************************************
Note:
See TracChangeset
for help on using the changeset viewer.