+2014-11-02 Jan Djärv <jan.h.d@swipnet.se>
+
+ * nsterm.h (EmacsImage): Remove imageListNext, refCount, reference,
+ imageListSetNext, imageListNext.
+
+ * nsimage.m (ImageList, imageListNext, imageListSetNext:)
+ (reference): Remove.
+ (allocInitFromFile:): Remove searching ImageList and calling
+ reference (Bug#18918).
+ (dealloc): Remove handling if ImageList.
+
2014-12-22 Jan Djärv <jan.h.d@swipnet.se>
* xterm.c (do_ewmh_fullscreen): Don't remove maximized_horz/vert
@implementation EmacsImage
-static EmacsImage *ImageList = nil;
-
+ allocInitFromFile: (Lisp_Object)file
{
- EmacsImage *image = ImageList;
NSImageRep *imgRep;
Lisp_Object found;
-
- /* look for an existing image of the same name */
- while (image != nil &&
- [[image name] compare: [NSString stringWithUTF8String: SSDATA (file)]]
- != NSOrderedSame)
- image = [image imageListNext];
-
- if (image != nil)
- {
- [image reference];
- return image;
- }
+ EmacsImage *image;
/* Search bitmap-file-path for the file, if appropriate. */
found = x_find_image_file (file);
[image setSize: NSMakeSize([imgRep pixelsWide], [imgRep pixelsHigh])];
[image setName: [NSString stringWithUTF8String: SSDATA (file)]];
- [image reference];
- ImageList = [image imageListSetNext: ImageList];
return image;
}
-- reference
-{
- refCount++;
- return self;
-}
-
-
-- imageListSetNext: (id)arg
-{
- imageListNext = arg;
- return self;
-}
-
-
-- imageListNext
-{
- return imageListNext;
-}
-
-
- (void)dealloc
{
- id list = ImageList;
-
- if (refCount > 1)
- {
- refCount--;
- return;
- }
-
[stippleMask release];
-
- if (list == self)
- ImageList = imageListNext;
- else
- {
- while (list != nil && [list imageListNext] != self)
- list = [list imageListNext];
- [list imageListSetNext: imageListNext];
- }
-
[super dealloc];
}
@interface EmacsImage : NSImage
{
- id imageListNext;
- int refCount;
NSBitmapImageRep *bmRep; /* used for accessing pixel data */
unsigned char *pixmapData[5]; /* shortcut to access pixel data */
NSColor *stippleMask;
}
+ allocInitFromFile: (Lisp_Object)file;
-- reference;
-- imageListSetNext: (id)arg;
-- imageListNext;
- (void)dealloc;
- initFromXBM: (unsigned char *)bits width: (int)w height: (int)h
flip: (BOOL)flip;