diff --git a/src/os2/bitmap.cpp b/src/os2/bitmap.cpp index 2bf5a7dc48..11f601c829 100644 --- a/src/os2/bitmap.cpp +++ b/src/os2/bitmap.cpp @@ -989,24 +989,24 @@ HBITMAP wxInvertMask( ,&vBmhdr ); nWidth = (int)vBmhdr.cx; - nHeight = (int)vBmhdr.cyt; + nHeight = (int)vBmhdr.cy; } BITMAPINFOHEADER2 vBmih; SIZEL vSize = {0, 0}; DEVOPENSTRUC vDop = {0L, "DISPLAY", NULL, 0L, 0L, 0L, 0L, 0L, 0L}; - HDC hDCSrc = ::DevOpenDC(ghAb, OD_MEMORY, "*", 5L, (PDEVOPENDATA)&vDop, NULLHANDLE); - HDC hDCDst = ::DevOpenDC(ghAb, OD_MEMORY, "*", 5L, (PDEVOPENDATA)&vDop, NULLHANDLE); - HPS hPSSrc = ::GpiCreatePS(ghAb, hDCSrc, &vSize, PU_PELS | GPIA_ASSOC); - HPS hPSDst = ::GpiCreatePS(ghAb, hDCDst, &vSize, PU_PELS | GPIA_ASSOC); - POINTL vPoint[4] = { 0 ,0, rBitmap.GetWidth(), rBitmap.GetHeight(), - 0, 0, rBitmap.GetWidth(), rBitmap.GetHeight() + HDC hDCSrc = ::DevOpenDC(vHabmain, OD_MEMORY, "*", 5L, (PDEVOPENDATA)&vDop, NULLHANDLE); + HDC hDCDst = ::DevOpenDC(vHabmain, OD_MEMORY, "*", 5L, (PDEVOPENDATA)&vDop, NULLHANDLE); + HPS hPSSrc = ::GpiCreatePS(vHabmain, hDCSrc, &vSize, PU_PELS | GPIA_ASSOC); + HPS hPSDst = ::GpiCreatePS(vHabmain, hDCDst, &vSize, PU_PELS | GPIA_ASSOC); + POINTL vPoint[4] = { 0 ,0, nWidth, nHeight, + 0, 0, nWidth, nHeight }; - memset(&vBmih, NULLC, sizeof(BITMAPINFOHEADER2)); + memset(&vBmih, '\0', sizeof(BITMAPINFOHEADER2)); vBmih.cbFix = sizeof(BITMAPINFOHEADER2); - vBmih.cx = lWidth; - vBmih.cy = lHeight; + vBmih.cx = nWidth; + vBmih.cy = nHeight; vBmih.cPlanes = 1; vBmih.cBitCount = 1; @@ -1023,7 +1023,7 @@ HBITMAP wxInvertMask( ::GpiBitBlt( hPSDst ,hPSSrc ,4L - ,&vPoint + ,vPoint ,ROP_SRCCOPY ,BBO_IGNORE ); @@ -1031,7 +1031,7 @@ HBITMAP wxInvertMask( ::GpiDestroyPS(hPSSrc); ::GpiDestroyPS(hPSDst); ::DevCloseDC(hDCSrc); - ::DevCloseDC(hDCDtl); + ::DevCloseDC(hDCDst); return hBmpInvMask; } // end of WxWinGdi_InvertMask diff --git a/src/xpm/create.c b/src/xpm/create.c index cf198e1d2c..85537529f3 100644 --- a/src/xpm/create.c +++ b/src/xpm/create.c @@ -865,7 +865,7 @@ XpmCreateImageFromXpmImage(display, image, #endif { #ifdef __OS2__ - HAB hab; + HAB hab = WinQueryAnchorBlock(HWND_DESKTOP); HPS hps; SIZEL sizl = {0, 0}; #endif @@ -2578,7 +2578,7 @@ ParseAndPutPixels( { unsigned int a, x, y; #ifdef __OS2__ - HAB hab; + HAB hab = WinQueryAnchorBlock(HWND_DESKTOP); DEVOPENSTRUC dop = {NULL, "DISPLAY", NULL, NULL, NULL, NULL, NULL, NULL, NULL}; SIZEL sizl = {0, 0}; POINTL point; diff --git a/src/xpm/scan.c b/src/xpm/scan.c index 4390a0d612..f5e61bb78d 100644 --- a/src/xpm/scan.c +++ b/src/xpm/scan.c @@ -96,16 +96,25 @@ LFUNC(AGetImagePixels, int, (XImage *image, unsigned int width, int (*storeFunc) ())); # endif/* AMIGA */ #else /* ndef FOR_MSW */ + +#if defined(__OS2__) && defined(__VISAGECPP30__) +LFUNC(MSWGetImagePixels, int, (Display* display, XImage* image, unsigned int width, + unsigned int height, PixelsMap* pmap, + int (*storeFunc) (Pixel, PixelsMap*, unsigned int*))); +#else LFUNC(MSWGetImagePixels, int, (Display *d, XImage *image, unsigned int width, - unsigned int height, PixelsMap *pmap, - int (*storeFunc) ())); + unsigned int height, PixelsMap *pmap, + int (*storeFunc) ())); #endif + +#endif + LFUNC(ScanTransparentColor, int, (XpmColor *color, unsigned int cpp, - XpmAttributes *attributes)); + XpmAttributes *attributes)); LFUNC(ScanOtherColors, int, (Display *display, XpmColor *colors, int ncolors, - Pixel *pixels, unsigned int mask, - unsigned int cpp, XpmAttributes *attributes)); + Pixel *pixels, unsigned int mask, + unsigned int cpp, XpmAttributes *attributes)); /* * This function stores the given pixel in the given arrays which are grown @@ -1020,7 +1029,7 @@ MSWGetImagePixels(display, image, width, height, pmap, storeFunc) unsigned int x, y; Pixel pixel; #ifdef __OS2__ - HAB hab; + HAB hab = WinQueryAnchorBlock(HWND_DESKTOP); HDC shapedc; DEVOPENSTRUC dop = {NULL, "DISPLAY", NULL, NULL, NULL, NULL, NULL, NULL, NULL}; SIZEL sizl = {0, 0}; diff --git a/src/xpm/simx.c b/src/xpm/simx.c index a196a26aa0..a804e3e4bd 100644 --- a/src/xpm/simx.c +++ b/src/xpm/simx.c @@ -274,10 +274,8 @@ XCreateImage(Display *d, Visual *v, { XImage *img = (XImage *) XpmMalloc(sizeof(XImage)); #ifdef __OS2__ - HPS hps; BITMAPINFOHEADER2 bmih; - hps = WinGetScreenPS(HWND_DESKTOP); memset(&bmih, 0, sizeof(BITMAPINFOHEADER2)); bmih.cbFix = sizeof(BITMAPINFOHEADER2); bmih.cx = width; @@ -295,7 +293,7 @@ XCreateImage(Display *d, Visual *v, img->bitmap = CreateCompatibleBitmap(*d, width, height); } else*/ { #ifdef __OS2__ - img->bitmap = GpiCreateBitmap(hps, &bmih, 0L, NULL, NULL); + img->bitmap = GpiCreateBitmap(*d, &bmih, 0L, NULL, NULL); WinReleasePS(hps); #else img->bitmap = CreateBitmap(width, height, 1 /* plane */ ,