X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f6bcfd974ef26faf6f91a62cac09827e09463fd1..c10f20703e5b4e9c605b908f480b863c89ca31ee:/src/xpm/scan.c diff --git a/src/xpm/scan.c b/src/xpm/scan.c index 8660ff99ed..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 @@ -273,11 +282,8 @@ XpmCreateXpmImageFromImage(display, image, shapeimage, # endif /* AMIGA */ #else -#ifndef __OS2__ ErrorStatus = MSWGetImagePixels(display, shapeimage, width, height, &pmap, storeMaskPixel); -/* calling convention all messed up OS/2 -- figure out later */ -#endif #endif /* ndef for FOR_MSW */ @@ -318,10 +324,8 @@ XpmCreateXpmImageFromImage(display, image, shapeimage, # endif /* AMIGA */ #else -#ifndef __VISAGECPP30__ ErrorStatus = MSWGetImagePixels(display, image, width, height, &pmap, storePixel); -#endif #endif @@ -601,7 +605,7 @@ ScanOtherColors(display, colors, ncolors, pixels, mask, cpp, attributes) #else sprintf(buf, "#%02x%02x%02x", xcolor->red, xcolor->green, xcolor->blue); -#endif +#endif color->c_color = (char *) xpmstrdup(buf); } if (!color->c_color) { @@ -1025,8 +1029,8 @@ MSWGetImagePixels(display, image, width, height, pmap, storeFunc) unsigned int x, y; Pixel pixel; #ifdef __OS2__ - HAB hab; - HPS hps; + HAB hab = WinQueryAnchorBlock(HWND_DESKTOP); + HDC shapedc; DEVOPENSTRUC dop = {NULL, "DISPLAY", NULL, NULL, NULL, NULL, NULL, NULL, NULL}; SIZEL sizl = {0, 0}; POINTL point; @@ -1035,8 +1039,9 @@ MSWGetImagePixels(display, image, width, height, pmap, storeFunc) iptr = pmap->pixelindex; #ifdef __OS2__ - hps = GpiCreatePS(hab, *display, &sizl, GPIA_ASSOC | PU_PELS); - GpiSetBitmap(hps, image->bitmap); + shapedc = DevOpenDC(hab, OD_MEMORY, "*", 5L, (PDEVOPENDATA)&dop, NULLHANDLE); + *display = GpiCreatePS(hab, shapedc, &sizl, GPIA_ASSOC | PU_PELS); + GpiSetBitmap(*display, image->bitmap); #else SelectObject(*display, image->bitmap); #endif @@ -1046,7 +1051,7 @@ MSWGetImagePixels(display, image, width, height, pmap, storeFunc) #ifdef __OS2__ point.x = x; point.y = y; - pixel = GpiQueryPel(hps, &point); + pixel = GpiQueryPel(*display, &point); #else pixel = GetPixel(*display, x, y); #endif