projects
/
chise
/
xemacs-chise.git-
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
(byte_table_same_value_p): Use `internal_equal' instead of `EQ'.
[chise/xemacs-chise.git-]
/
src
/
glyphs-eimage.c
diff --git
a/src/glyphs-eimage.c
b/src/glyphs-eimage.c
index
4005413
..
cb61afa
100644
(file)
--- a/
src/glyphs-eimage.c
+++ b/
src/glyphs-eimage.c
@@
-56,6
+56,7
@@
Boston, MA 02111-1307, USA. */
#include "buffer.h"
#include "frame.h"
#include "opaque.h"
#include "buffer.h"
#include "frame.h"
#include "opaque.h"
+#include "window.h"
#include "sysfile.h"
#include "sysfile.h"
@@
-314,7
+315,7
@@
jpeg_instantiate (Lisp_Object image_instance, Lisp_Object instantiator,
Lisp_Object pointer_fg, Lisp_Object pointer_bg,
int dest_mask, Lisp_Object domain)
{
Lisp_Object pointer_fg, Lisp_Object pointer_bg,
int dest_mask, Lisp_Object domain)
{
- struct Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
+ Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
/* It is OK for the unwind data to be local to this function,
because the unwind-protect is always executed when this
stack frame is still valid. */
/* It is OK for the unwind data to be local to this function,
because the unwind-protect is always executed when this
stack frame is still valid. */
@@
-372,13
+373,13
@@
jpeg_instantiate (Lisp_Object image_instance, Lisp_Object instantiator,
{
Lisp_Object data = find_keyword_in_vector (instantiator, Q_data);
{
Lisp_Object data = find_keyword_in_vector (instantiator, Q_data);
- CONST Extbyte *bytes;
+ const Extbyte *bytes;
Extcount len;
/* #### This is a definite problem under Mule due to the amount of
stack data it might allocate. Need to be able to convert and
write out to a file. */
Extcount len;
/* #### This is a definite problem under Mule due to the amount of
stack data it might allocate. Need to be able to convert and
write out to a file. */
- GET_STRING_BINARY_DATA_ALLOCA (data, bytes, len);
+ TO_EXTERNAL_FORMAT (LISP_STRING, data, ALLOCA, (bytes, len), Qbinary);
jpeg_memory_src (&cinfo, (JOCTET *) bytes, len);
}
jpeg_memory_src (&cinfo, (JOCTET *) bytes, len);
}
@@
-480,7
+481,7
@@
jpeg_instantiate (Lisp_Object image_instance, Lisp_Object instantiator,
/* Step 6.5: Create the pixmap and set up the image instance */
/* now instantiate */
/* Step 6.5: Create the pixmap and set up the image instance */
/* now instantiate */
- MAYBE_DEVMETH (XDEVICE (ii->device),
+ MAYBE_DEVMETH (DOMAIN_XDEVICE (ii->domain),
init_image_instance_from_eimage,
(ii, cinfo.output_width, cinfo.output_height, 1,
unwind.eimage, dest_mask,
init_image_instance_from_eimage,
(ii, cinfo.output_width, cinfo.output_height, 1,
unwind.eimage, dest_mask,
@@
-580,12
+581,12
@@
gif_memory_close(VoidPtr data)
struct gif_error_struct
{
struct gif_error_struct
{
- CONST char *err_str; /* return the error string */
+ const char *err_str; /* return the error string */
jmp_buf setjmp_buffer; /* for return to caller */
};
static void
jmp_buf setjmp_buffer; /* for return to caller */
};
static void
-gif_error_func(CONST char *err_str, VoidPtr error_ptr)
+gif_error_func(const char *err_str, VoidPtr error_ptr)
{
struct gif_error_struct *error_data = (struct gif_error_struct*)error_ptr;
{
struct gif_error_struct *error_data = (struct gif_error_struct*)error_ptr;
@@
-599,7
+600,7
@@
gif_instantiate (Lisp_Object image_instance, Lisp_Object instantiator,
Lisp_Object pointer_fg, Lisp_Object pointer_bg,
int dest_mask, Lisp_Object domain)
{
Lisp_Object pointer_fg, Lisp_Object pointer_bg,
int dest_mask, Lisp_Object domain)
{
- struct Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
+ Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
/* It is OK for the unwind data to be local to this function,
because the unwind-protect is always executed when this
stack frame is still valid. */
/* It is OK for the unwind data to be local to this function,
because the unwind-protect is always executed when this
stack frame is still valid. */
@@
-623,7
+624,7
@@
gif_instantiate (Lisp_Object image_instance, Lisp_Object instantiator,
assert (!NILP (data));
if (!(unwind.giffile = GifSetup()))
assert (!NILP (data));
if (!(unwind.giffile = GifSetup()))
- signal_image_error ("Insufficent memory to instantiate GIF image", instantiator);
+ signal_image_error ("Insufficient memory to instantiate GIF image", instantiator);
/* set up error facilities */
if (setjmp(gif_err.setjmp_buffer))
/* set up error facilities */
if (setjmp(gif_err.setjmp_buffer))
@@
-636,7
+637,7
@@
gif_instantiate (Lisp_Object image_instance, Lisp_Object instantiator,
}
GifSetErrorFunc(unwind.giffile, (Gif_error_func)gif_error_func, (VoidPtr)&gif_err);
}
GifSetErrorFunc(unwind.giffile, (Gif_error_func)gif_error_func, (VoidPtr)&gif_err);
- GET_STRING_BINARY_DATA_ALLOCA (data, bytes, len);
+ TO_EXTERNAL_FORMAT (LISP_STRING, data, ALLOCA, (bytes, len), Qbinary);
mem_struct.bytes = bytes;
mem_struct.len = len;
mem_struct.index = 0;
mem_struct.bytes = bytes;
mem_struct.len = len;
mem_struct.index = 0;
@@
-663,7
+664,7
@@
gif_instantiate (Lisp_Object image_instance, Lisp_Object instantiator,
height = unwind.giffile->SHeight;
width = unwind.giffile->SWidth;
height = unwind.giffile->SHeight;
width = unwind.giffile->SWidth;
- unwind.eimage = (unsigned char*)
+ unwind.eimage = (unsigned char*)
xmalloc (width * height * 3 * unwind.giffile->ImageCount);
if (!unwind.eimage)
signal_image_error("Unable to allocate enough memory for image", instantiator);
xmalloc (width * height * 3 * unwind.giffile->ImageCount);
if (!unwind.eimage)
signal_image_error("Unable to allocate enough memory for image", instantiator);
@@
-695,7
+696,7
@@
gif_instantiate (Lisp_Object image_instance, Lisp_Object instantiator,
eip = unwind.eimage + (width * height * 3 * slice) + (row * width * 3);
for (j = 0; j < width; j++)
{
eip = unwind.eimage + (width * height * 3 * slice) + (row * width * 3);
for (j = 0; j < width; j++)
{
- unsigned char pixel =
+ unsigned char pixel =
unwind.giffile->SavedImages[slice].RasterBits[(i * width) + j];
*eip++ = cmo->Colors[pixel].Red;
*eip++ = cmo->Colors[pixel].Green;
unwind.giffile->SavedImages[slice].RasterBits[(i * width) + j];
*eip++ = cmo->Colors[pixel].Red;
*eip++ = cmo->Colors[pixel].Green;
@@
-706,7
+707,7
@@
gif_instantiate (Lisp_Object image_instance, Lisp_Object instantiator,
}
/* now instantiate */
}
/* now instantiate */
- MAYBE_DEVMETH (XDEVICE (ii->device),
+ MAYBE_DEVMETH (DOMAIN_XDEVICE (ii->domain),
init_image_instance_from_eimage,
(ii, width, height, unwind.giffile->ImageCount, unwind.eimage, dest_mask,
instantiator, domain));
init_image_instance_from_eimage,
(ii, width, height, unwind.giffile->ImageCount, unwind.eimage, dest_mask,
instantiator, domain));
@@
-727,7
+728,7
@@
gif_instantiate (Lisp_Object image_instance, Lisp_Object instantiator,
unwind.giffile->SavedImages[0].ExtensionBlockCount)
{
timeout = (unsigned short)
unwind.giffile->SavedImages[0].ExtensionBlockCount)
{
timeout = (unsigned short)
- ((unwind.giffile->SavedImages[0].ExtensionBlocks[0].Bytes[2] << 8) +
+ ((unwind.giffile->SavedImages[0].ExtensionBlocks[0].Bytes[2] << 8) +
unwind.giffile-> SavedImages[0].ExtensionBlocks[0].Bytes[1]) * 10;
}
unwind.giffile-> SavedImages[0].ExtensionBlocks[0].Bytes[1]) * 10;
}
@@
-737,7
+738,7
@@
gif_instantiate (Lisp_Object image_instance, Lisp_Object instantiator,
if (!NILP (tid))
IMAGE_INSTANCE_PIXMAP_TIMEOUT (ii) = XINT (tid);
}
if (!NILP (tid))
IMAGE_INSTANCE_PIXMAP_TIMEOUT (ii) = XINT (tid);
}
-
+
unbind_to (speccount, Qnil);
}
unbind_to (speccount, Qnil);
}
@@
-769,7
+770,7
@@
png_possible_dest_types (void)
struct png_memory_storage
{
struct png_memory_storage
{
- CONST Extbyte *bytes; /* The data */
+ const Extbyte *bytes; /* The data */
Extcount len; /* How big is it? */
int index; /* Where are we? */
};
Extcount len; /* How big is it? */
int index; /* Where are we? */
};
@@
-789,7
+790,7
@@
png_read_from_memory(png_structp png_ptr, png_bytep data,
struct png_error_struct
{
struct png_error_struct
{
- CONST char *err_str;
+ const char *err_str;
jmp_buf setjmp_buffer; /* for return to caller */
};
jmp_buf setjmp_buffer; /* for return to caller */
};
@@
-844,7
+845,7
@@
png_instantiate (Lisp_Object image_instance, Lisp_Object instantiator,
Lisp_Object pointer_fg, Lisp_Object pointer_bg,
int dest_mask, Lisp_Object domain)
{
Lisp_Object pointer_fg, Lisp_Object pointer_bg,
int dest_mask, Lisp_Object domain)
{
- struct Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
+ Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
struct png_unwind_data unwind;
int speccount = specpdl_depth ();
int height, width;
struct png_unwind_data unwind;
int speccount = specpdl_depth ();
int height, width;
@@
-893,14
+894,14
@@
png_instantiate (Lisp_Object image_instance, Lisp_Object instantiator,
/* Initialize the IO layer and read in header information */
{
Lisp_Object data = find_keyword_in_vector (instantiator, Q_data);
/* Initialize the IO layer and read in header information */
{
Lisp_Object data = find_keyword_in_vector (instantiator, Q_data);
- CONST Extbyte *bytes;
+ const Extbyte *bytes;
Extcount len;
assert (!NILP (data));
/* #### This is a definite problem under Mule due to the amount of
stack data it might allocate. Need to think about using Lstreams */
Extcount len;
assert (!NILP (data));
/* #### This is a definite problem under Mule due to the amount of
stack data it might allocate. Need to think about using Lstreams */
- GET_STRING_BINARY_DATA_ALLOCA (data, bytes, len);
+ TO_EXTERNAL_FORMAT (LISP_STRING, data, ALLOCA, (bytes, len), Qbinary);
tbr.bytes = bytes;
tbr.len = len;
tbr.index = 0;
tbr.bytes = bytes;
tbr.len = len;
tbr.index = 0;
@@
-942,16
+943,16
@@
png_instantiate (Lisp_Object image_instance, Lisp_Object instantiator,
}
else
{
}
else
{
- struct Lisp_Color_Instance *c;
+ Lisp_Color_Instance *c;
Lisp_Object rgblist;
c = XCOLOR_INSTANCE (bkgd);
rgblist = MAYBE_LISP_DEVMETH (XDEVICE (c->device),
color_instance_rgb_components,
(c));
Lisp_Object rgblist;
c = XCOLOR_INSTANCE (bkgd);
rgblist = MAYBE_LISP_DEVMETH (XDEVICE (c->device),
color_instance_rgb_components,
(c));
- my_background.red = XINT (XCAR (rgblist));
- my_background.green = XINT (XCAR (XCDR (rgblist)));
- my_background.blue = XINT (XCAR (XCDR (XCDR (rgblist))));
+ my_background.red = (unsigned short) XINT (XCAR (rgblist));
+ my_background.green = (unsigned short) XINT (XCAR (XCDR (rgblist)));
+ my_background.blue = (unsigned short) XINT (XCAR (XCDR (XCDR (rgblist))));
}
if (png_get_bKGD (png_ptr, info_ptr, &image_background))
}
if (png_get_bKGD (png_ptr, info_ptr, &image_background))
@@
-1017,7
+1018,7
@@
png_instantiate (Lisp_Object image_instance, Lisp_Object instantiator,
}
/* now instantiate */
}
/* now instantiate */
- MAYBE_DEVMETH (XDEVICE (ii->device),
+ MAYBE_DEVMETH (DOMAIN_XDEVICE (ii->domain),
init_image_instance_from_eimage,
(ii, width, height, 1, unwind.eimage, dest_mask,
instantiator, domain));
init_image_instance_from_eimage,
(ii, width, height, 1, unwind.eimage, dest_mask,
instantiator, domain));
@@
-1155,7
+1156,7
@@
tiff_memory_size(thandle_t data)
struct tiff_error_struct
{
struct tiff_error_struct
{
-#if HAVE_VSNPRINTF
+#ifdef HAVE_VSNPRINTF
char err_str[256];
#else
char err_str[1024]; /* return the error string */
char err_str[256];
#else
char err_str[1024]; /* return the error string */
@@
-1170,12
+1171,12
@@
struct tiff_error_struct
static struct tiff_error_struct tiff_err_data;
static void
static struct tiff_error_struct tiff_err_data;
static void
-tiff_error_func(CONST char *module, CONST char *fmt, ...)
+tiff_error_func(const char *module, const char *fmt, ...)
{
va_list vargs;
va_start (vargs, fmt);
{
va_list vargs;
va_start (vargs, fmt);
-#if HAVE_VSNPRINTF
+#ifdef HAVE_VSNPRINTF
vsnprintf (tiff_err_data.err_str, 255, fmt, vargs);
#else
/* pray this doesn't overflow... */
vsnprintf (tiff_err_data.err_str, 255, fmt, vargs);
#else
/* pray this doesn't overflow... */
@@
-1187,17
+1188,17
@@
tiff_error_func(CONST char *module, CONST char *fmt, ...)
}
static void
}
static void
-tiff_warning_func(CONST char *module, CONST char *fmt, ...)
+tiff_warning_func(const char *module, const char *fmt, ...)
{
va_list vargs;
{
va_list vargs;
-#if HAVE_VSNPRINTF
+#ifdef HAVE_VSNPRINTF
char warn_str[256];
#else
char warn_str[1024];
#endif
va_start (vargs, fmt);
char warn_str[256];
#else
char warn_str[1024];
#endif
va_start (vargs, fmt);
-#if HAVE_VSNPRINTF
+#ifdef HAVE_VSNPRINTF
vsnprintf (warn_str, 255, fmt, vargs);
#else
vsprintf (warn_str, fmt, vargs);
vsnprintf (warn_str, 255, fmt, vargs);
#else
vsprintf (warn_str, fmt, vargs);
@@
-1212,7
+1213,7
@@
tiff_instantiate (Lisp_Object image_instance, Lisp_Object instantiator,
Lisp_Object pointer_fg, Lisp_Object pointer_bg,
int dest_mask, Lisp_Object domain)
{
Lisp_Object pointer_fg, Lisp_Object pointer_bg,
int dest_mask, Lisp_Object domain)
{
- struct Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
+ Lisp_Image_Instance *ii = XIMAGE_INSTANCE (image_instance);
tiff_memory_storage mem_struct;
/* It is OK for the unwind data to be local to this function,
because the unwind-protect is always executed when this
tiff_memory_storage mem_struct;
/* It is OK for the unwind data to be local to this function,
because the unwind-protect is always executed when this
@@
-1247,7
+1248,9
@@
tiff_instantiate (Lisp_Object image_instance, Lisp_Object instantiator,
/* #### This is a definite problem under Mule due to the amount of
stack data it might allocate. Think about Lstreams... */
/* #### This is a definite problem under Mule due to the amount of
stack data it might allocate. Think about Lstreams... */
- GET_STRING_BINARY_DATA_ALLOCA (data, bytes, len);
+ TO_EXTERNAL_FORMAT (LISP_STRING, data,
+ ALLOCA, (bytes, len),
+ Qbinary);
mem_struct.bytes = bytes;
mem_struct.len = len;
mem_struct.index = 0;
mem_struct.bytes = bytes;
mem_struct.len = len;
mem_struct.index = 0;
@@
-1258,13
+1261,13
@@
tiff_instantiate (Lisp_Object image_instance, Lisp_Object instantiator,
tiff_memory_seek, tiff_memory_close, tiff_memory_size,
tiff_map_noop, tiff_unmap_noop);
if (!unwind.tiff)
tiff_memory_seek, tiff_memory_close, tiff_memory_size,
tiff_map_noop, tiff_unmap_noop);
if (!unwind.tiff)
- signal_image_error ("Insufficent memory to instantiate TIFF image", instantiator);
+ signal_image_error ("Insufficient memory to instantiate TIFF image", instantiator);
TIFFGetField (unwind.tiff, TIFFTAG_IMAGEWIDTH, &width);
TIFFGetField (unwind.tiff, TIFFTAG_IMAGELENGTH, &height);
unwind.eimage = (unsigned char *) xmalloc (width * height * 3);
TIFFGetField (unwind.tiff, TIFFTAG_IMAGEWIDTH, &width);
TIFFGetField (unwind.tiff, TIFFTAG_IMAGELENGTH, &height);
unwind.eimage = (unsigned char *) xmalloc (width * height * 3);
- /* ### This is little more than proof-of-concept/function testing.
+ /* #### This is little more than proof-of-concept/function testing.
It needs to be reimplemented via scanline reads for both memory
compactness. */
raster = (uint32*) _TIFFmalloc (width * height * sizeof (uint32));
It needs to be reimplemented via scanline reads for both memory
compactness. */
raster = (uint32*) _TIFFmalloc (width * height * sizeof (uint32));
@@
-1297,7
+1300,7
@@
tiff_instantiate (Lisp_Object image_instance, Lisp_Object instantiator,
}
/* now instantiate */
}
/* now instantiate */
- MAYBE_DEVMETH (XDEVICE (ii->device),
+ MAYBE_DEVMETH (DOMAIN_XDEVICE (ii->domain),
init_image_instance_from_eimage,
(ii, width, height, 1, unwind.eimage, dest_mask,
instantiator, domain));
init_image_instance_from_eimage,
(ii, width, height, 1, unwind.eimage, dest_mask,
instantiator, domain));