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
/*
* scan shape mask if any
*/
- if (shapeimage)
+ if (shapeimage)
{
#ifndef FOR_MSW
# ifndef AMIGA
# 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 */
*
*/
- if (image)
+ if (image)
{
#ifndef FOR_MSW
# ifndef AMIGA
(image->byte_order == image->bitmap_bit_order))
ErrorStatus = GetImagePixels1(image, width, height, &pmap,
storePixel);
- else if (image->format == ZPixmap)
+ else if (image->format == ZPixmap)
{
if (image->bits_per_pixel == 8)
ErrorStatus = GetImagePixels8(image, width, height, &pmap);
ErrorStatus = GetImagePixels16(image, width, height, &pmap);
else if (image->bits_per_pixel == 32)
ErrorStatus = GetImagePixels32(image, width, height, &pmap);
- }
+ }
else
ErrorStatus = GetImagePixels(image, width, height, &pmap);
# else
ErrorStatus = AGetImagePixels(image, width, height, &pmap,
storePixel);
# endif /* AMIGA */
-
#else
ErrorStatus = MSWGetImagePixels(display, image, width, height, &pmap,
storePixel);
-/* calling convention all messed up OS/2 -- figure out later */
#endif
return (XpmNoMemory);
for (i = 0, i2 = mask, color = colors, xcolor = xcolors;
- i < ncolors; i++, i2++, color++, xcolor++, pixels++) {
+ i < (unsigned)ncolors; i++, i2++, color++, xcolor++, pixels++) {
if (!(s = color->string = (char *) XpmMalloc(cpp + 1))) {
XpmFree(xcolors);
}
/* end 3.2 bc */
- for (i = 0, color = colors, xcolor = xcolors; i < ncolors;
+ for (i = 0, color = colors, xcolor = xcolors; i < (unsigned)ncolors;
i++, color++, xcolor++) {
/* look for related info from the attributes if any */
#else
sprintf(buf, "#%02x%02x%02x",
xcolor->red, xcolor->green, xcolor->blue);
-#endif
+#endif
color->c_color = (char *) xpmstrdup(buf);
}
if (!color->c_color) {
#else /* ndef FOR_MSW */
#ifdef __OS2__
-/* Visual Age cannot deal with old, non-ansi, code */
-static int
-MSWGetImagePixels(
+
+#ifdef __VISAGECPP30__
+static int MSWGetImagePixels(
+ Display* display
+, XImage* image
+, unsigned int width
+, unsigned int height
+, PixelsMap* pmap
+, int (*storeFunc) (Pixel, PixelsMap*, unsigned int*)
+)
+#else
+static int MSWGetImagePixels(
Display* display
, XImage* image
, unsigned int width
, PixelsMap* pmap
, int (*storeFunc) ()
)
+#endif
+
#else
static int
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;
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
#ifdef __OS2__
point.x = x;
point.y = y;
- pixel = GpiQueryPel(hps, &point);
+ pixel = GpiQueryPel(*display, &point);
#else
pixel = GetPixel(*display, x, y);
#endif