/* Image support for the NeXT/Open/GNUstep and MacOSX window system.
- Copyright (C) 1989, 1992, 1993, 1994, 2005, 2006, 2008, 2009, 2010, 2011
+ Copyright (C) 1989, 1992-1994, 2005-2006, 2008-2012
Free Software Foundation, Inc.
This file is part of GNU Emacs.
{
NSData *data;
- data = [NSData dataWithBytes: SDATA (spec_data)
+ data = [NSData dataWithBytes: SSDATA (spec_data)
length: SBYTES (spec_data)];
eImg = [[EmacsImage alloc] initWithData: data];
[eImg setPixmapData];
/* look for an existing image of the same name */
while (image != nil &&
- [[image name] compare: [NSString stringWithUTF8String: SDATA (file)]]
+ [[image name] compare: [NSString stringWithUTF8String: SSDATA (file)]]
!= NSOrderedSame)
image = [image imageListNext];
return nil;
image = [[EmacsImage alloc] initByReferencingFile:
- [NSString stringWithUTF8String: SDATA (found)]];
+ [NSString stringWithUTF8String: SSDATA (found)]];
+#if defined (NS_IMPL_COCOA) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_6
+ imgRep = [NSBitmapImageRep imageRepWithData:[image TIFFRepresentation]];
+#else
imgRep = [image bestRepresentationForDevice: nil];
+#endif
if (imgRep == nil)
{
[image release];
[image setScalesWhenResized: YES];
[image setSize: NSMakeSize([imgRep pixelsWide], [imgRep pixelsHigh])];
- [image setName: [NSString stringWithUTF8String: SDATA (file)]];
+ [image setName: [NSString stringWithUTF8String: SSDATA (file)]];
[image reference];
ImageList = [image imageListSetNext: ImageList];
- setXBMColor: (NSColor *)color
{
NSSize s = [self size];
- int len = (int) s.width * s.height;
unsigned char *planes[5];
CGFloat r, g, b, a;
NSColor *rgbColor;
NSImageRep *rep;
reps = [[self representations] objectEnumerator];
- while (rep = (NSImageRep *) [reps nextObject])
+ while ((rep = (NSImageRep *) [reps nextObject]))
{
if ([rep respondsToSelector: @selector (getBitmapDataPlanes:)])
{
@end
-// arch-tag: 6b310280-6892-4e5e-8f34-41c4d384874f