* Lorens Younes (d93-hyo@nada.kth.se) 4/96
*/
-#include "xpmi.h"
+#include "XpmI.h"
#include <ctype.h>
LFUNC(xpmVisualType, int, (Visual *visual));
}
else
{
- #ifdef macintosh
+ #if defined(macintosh) || defined(__APPLE__)
SET_WHITE_PIXEL( *mask_pixels ) ; // is this correct CS ????
#else
*mask_pixels = 1; // is this correct CS ????
}
}
SelectObject(*dc, obm);
-#elif macintosh
+#elif defined(macintosh) || defined(__APPLE__)
GrafPtr origPort ;
GDHandle origDevice ;
}
obm = SelectObject(*dc, image->bitmap);
- #elif macintosh
+ #elif defined(macintosh) || defined(__APPLE__)
GrafPtr origPort ;
GDHandle origDevice ;
{
SetPixel(shapedc, x, y, shape_pixels[colidx[c] - 1]);
}
- #elif macintosh
+ #elif defined(macintosh) || defined(__APPLE__)
SetCPixel( x, y, &image_pixels[colidx[c] - 1]);
- /*
- if (shapedc)
+ if (shapeimage)
{
- SetPixel(shapedc, x, y, shape_pixels[colidx[c] - 1]);
+ SetGWorld( shapeimage->gworldptr , NULL ) ;
+ SetCPixel( x, y, &shape_pixels[colidx[c] - 1]);
+ SetGWorld( image->gworldptr , NULL ) ;
}
- */
#endif
}
else
DeleteDC(shapedc);
}
SelectObject(*dc, obm);
- #elif macintosh
+ #elif defined(macintosh) || defined(__APPLE__)
SetGWorld( origPort , origDevice ) ;
#endif
}
/* array of pointers malloced by need */
unsigned short *cidx[256];
int char1;
- #ifdef macintosh
+ #if defined(macintosh) || defined(__APPLE__)
GrafPtr origPort ;
GDHandle origDevice ;
GetGWorld( &origPort , &origDevice ) ;
cidx[char1] = (unsigned short *)
XpmCalloc(256, sizeof(unsigned short));
if (cidx[char1] == NULL) { /* new block failed */
- #ifdef macintosh
+ #if defined(macintosh) || defined(__APPLE__)
SetGWorld( origPort , origDevice ) ;
#endif
FREE_CIDX;
SetPixel(*dc, x, y,
shape_pixels[cidx[cc1][cc2] - 1]);
}
- #elif macintosh
+ #elif defined(macintosh) || defined(__APPLE__)
SetCPixel( x, y, &image_pixels[cidx[cc1][cc2] - 1]);
#endif
} else
{
- #ifdef macintosh
+ #if defined(macintosh) || defined(__APPLE__)
SetGWorld( origPort , origDevice ) ;
#endif
FREE_CIDX;
return (XpmFileInvalid);
}
} else {
- #ifdef macintosh
+ #if defined(macintosh) || defined(__APPLE__)
SetGWorld( origPort , origDevice ) ;
#endif
FREE_CIDX;
}
}
}
- #ifdef macintosh
+ #if defined(macintosh) || defined(__APPLE__)
SetGWorld( origPort , origDevice ) ;
#endif
FREE_CIDX;
{
char *s;
char buf[BUFSIZ];
- #ifdef macintosh
+ #if defined(macintosh) || defined(__APPLE__)
GrafPtr origPort ;
GDHandle origDevice ;
GetGWorld( &origPort , &origDevice ) ;
slot = xpmHashSlot(hashtable, buf);
if (!*slot) /* no color matches */
{
- #ifdef macintosh
+ #if defined(macintosh) || defined(__APPLE__)
SetGWorld( origPort , origDevice ) ;
#endif
return (XpmFileInvalid);
SetPixel(*dc, x, y,
shape_pixels[HashColorIndex(slot)]);
}
- #elif macintosh
+ #elif defined(macintosh) || defined(__APPLE__)
SetCPixel( x, y, &image_pixels[HashColorIndex(slot)]);
#endif
}
break;
if (a == ncolors) /* no color matches */
{
- #ifdef macintosh
+ #if defined(macintosh) || defined(__APPLE__)
SetGWorld( origPort , origDevice ) ;
#endif
return (XpmFileInvalid);
SelectObject(*dc, shapeimage->bitmap);
SetPixel(*dc, x, y, shape_pixels[a]);
}
- #elif macintosh
+ #elif defined(macintosh) || defined(__APPLE__)
SetCPixel( x, y, &image_pixels[a]); // data is [x+y*width]
#endif
}
}
}
- #ifdef macintosh
+ #if defined(macintosh) || defined(__APPLE__)
SetGWorld( origPort , origDevice ) ;
#endif