HCoop
/
bpt
/
emacs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Use 'inline', not 'INLINE'.
[bpt/emacs.git]
/
src
/
nsimage.m
diff --git
a/src/nsimage.m
b/src/nsimage.m
index
c95ad09
..
c38cefd
100644
(file)
--- a/
src/nsimage.m
+++ b/
src/nsimage.m
@@
-1,5
+1,5
@@
/* Image support for the NeXT/Open/GNUstep and MacOSX window system.
/* Image support for the NeXT/Open/GNUstep and MacOSX window system.
- Copyright (C) 1989, 1992
, 1993, 1994, 2005, 2006, 2008, 2009
+ Copyright (C) 1989, 1992
-1994, 2005-2006, 2008-2011
Free Software Foundation, Inc.
This file is part of GNU Emacs.
Free Software Foundation, Inc.
This file is part of GNU Emacs.
@@
-27,7
+27,8
@@
GNUstep port and post-20 update by Adrian Robert (arobert@cogsci.ucsd.edu)
/* This should be the first include, as it may set up #defines affecting
interpretation of even the system includes. */
/* This should be the first include, as it may set up #defines affecting
interpretation of even the system includes. */
-#include "config.h"
+#include <config.h>
+#include <setjmp.h>
#include "lisp.h"
#include "dispextern.h"
#include "lisp.h"
#include "dispextern.h"
@@
-82,19
+83,21
@@
int
ns_load_image (struct frame *f, struct image *img,
Lisp_Object spec_file, Lisp_Object spec_data)
{
ns_load_image (struct frame *f, struct image *img,
Lisp_Object spec_file, Lisp_Object spec_data)
{
- NSTRACE (ns_load_image);
-
- EmacsImage *eImg;
+ EmacsImage *eImg = nil;
NSSize size;
NSSize size;
- if (NILP (spec_data))
+ NSTRACE (ns_load_image);
+
+ if (STRINGP (spec_file))
{
eImg = [EmacsImage allocInitFromFile: spec_file];
}
{
eImg = [EmacsImage allocInitFromFile: spec_file];
}
- else
+ else
if (STRINGP (spec_data))
{
{
- NSData *data = [NSData dataWithBytes: XSTRING (spec_data)->data
- length: SBYTES (spec_data)];
+ NSData *data;
+
+ data = [NSData dataWithBytes: SDATA (spec_data)
+ length: SBYTES (spec_data)];
eImg = [[EmacsImage alloc] initWithData: data];
[eImg setPixmapData];
}
eImg = [[EmacsImage alloc] initWithData: data];
[eImg setPixmapData];
}
@@
-314,9
+317,9
@@
static EmacsImage *ImageList = nil;
[self addRepresentation: bmRep];
[self addRepresentation: bmRep];
-
bzero (planes[0]
, w*h);
-
bzero (planes[1]
, w*h);
-
bzero (planes[2]
, w*h);
+
memset (planes[0], 0
, w*h);
+
memset (planes[1], 0
, w*h);
+
memset (planes[2], 0
, w*h);
[self setXBMColor: [NSColor blackColor]];
return self;
}
[self setXBMColor: [NSColor blackColor]];
return self;
}
@@
-329,11
+332,11
@@
static EmacsImage *ImageList = nil;
NSSize s = [self size];
int len = (int) s.width * s.height;
unsigned char *planes[5];
NSSize s = [self size];
int len = (int) s.width * s.height;
unsigned char *planes[5];
-
f
loat r, g, b, a;
+
CGF
loat r, g, b, a;
NSColor *rgbColor;
if (bmRep == nil || color == nil)
NSColor *rgbColor;
if (bmRep == nil || color == nil)
- return;
+ return
self
;
if ([color colorSpaceName] != NSCalibratedRGBColorSpace)
rgbColor = [color colorUsingColorSpaceName: NSCalibratedRGBColorSpace];
if ([color colorSpaceName] != NSCalibratedRGBColorSpace)
rgbColor = [color colorUsingColorSpaceName: NSCalibratedRGBColorSpace];
@@
-358,6
+361,8
@@
static EmacsImage *ImageList = nil;
planes[2][i] = bb;
}
}
planes[2][i] = bb;
}
}
+
+ return self;
}
}
@@
-378,7
+383,7
@@
static EmacsImage *ImageList = nil;
[bmRep getBitmapDataPlanes: pixmapData];
for (i =0; i<4; i++)
[bmRep getBitmapDataPlanes: pixmapData];
for (i =0; i<4; i++)
-
bzero (pixmapData[i]
, width*height);
+
memset (pixmapData[i], 0
, width*height);
[self addRepresentation: bmRep];
return self;
}
[self addRepresentation: bmRep];
return self;
}
@@
-431,7
+436,7
@@
static EmacsImage *ImageList = nil;
else if (onTiger)
{
NSColor *color = [bmRep colorAtX: x y: y];
else if (onTiger)
{
NSColor *color = [bmRep colorAtX: x y: y];
-
f
loat r, g, b, a;
+
CGF
loat r, g, b, a;
[color getRed: &r green: &g blue: &b alpha: &a];
return ((int)(a * 255.0) << 24)
| ((int)(r * 255.0) << 16) | ((int)(g * 255.0) << 8)
[color getRed: &r green: &g blue: &b alpha: &a];
return ((int)(a * 255.0) << 24)
| ((int)(r * 255.0) << 16) | ((int)(g * 255.0) << 8)
@@
-494,4
+499,3
@@
static EmacsImage *ImageList = nil;
@end
@end
-// arch-tag: 6b310280-6892-4e5e-8f34-41c4d384874f