* nsimage.m (ImageList, imageListNext, imageListSetNext:)
(reference): Remove. (allocInitFromFile:): Remove searching ImageList and calling reference. (dealloc): Remove handling if ImageList. * nsterm.h (EmacsImage): Remove imageListNext, refCount, reference, imageListSetNext, imageListNext. Fixes: debbugs:18918
This commit is contained in:
parent
f26d02a625
commit
65bb8d055c
3 changed files with 12 additions and 60 deletions
|
@ -1,3 +1,14 @@
|
|||
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-11-02 Andreas Schwab <schwab@linux-m68k.org>
|
||||
|
||||
* process.c (catch_child_signal): Fix incorrect assertion.
|
||||
|
|
|
@ -160,25 +160,11 @@ Updated by Christian Limpach (chris@nice.ch)
|
|||
|
||||
@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);
|
||||
|
@ -205,54 +191,14 @@ @implementation EmacsImage
|
|||
[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];
|
||||
}
|
||||
|
||||
|
|
|
@ -338,16 +338,11 @@ typedef float EmacsCGFloat;
|
|||
|
||||
@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;
|
||||
|
|
Loading…
Add table
Reference in a new issue