[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/src/w32fns.c
From: |
Juanma Barranquero |
Subject: |
[Emacs-diffs] Changes to emacs/src/w32fns.c |
Date: |
Mon, 27 Jan 2003 17:18:35 -0500 |
Index: emacs/src/w32fns.c
diff -c emacs/src/w32fns.c:1.201 emacs/src/w32fns.c:1.202
*** emacs/src/w32fns.c:1.201 Sat Jan 25 20:21:25 2003
--- emacs/src/w32fns.c Mon Jan 27 17:18:35 2003
***************
*** 2361,2367 ****
set_frame_cursor_types (f, arg);
/* Make sure the cursor gets redrawn. */
! cursor_type_changed = 1;
}
void
--- 2361,2367 ----
set_frame_cursor_types (f, arg);
/* Make sure the cursor gets redrawn. */
! cursor_type_changed = 1;
}
void
***************
*** 5090,5096 ****
return 0;
goto dflt;
!
case WM_EMACS_SETCURSOR:
{
Cursor cursor = (Cursor) wParam;
--- 5090,5096 ----
return 0;
goto dflt;
!
case WM_EMACS_SETCURSOR:
{
Cursor cursor = (Cursor) wParam;
***************
*** 5098,5104 ****
SetCursor (cursor);
return 0;
}
!
case WM_EMACS_CREATESCROLLBAR:
return (LRESULT) w32_createscrollbar ((struct frame *) wParam,
(struct scroll_bar *) lParam);
--- 5098,5104 ----
SetCursor (cursor);
return 0;
}
!
case WM_EMACS_CREATESCROLLBAR:
return (LRESULT) w32_createscrollbar ((struct frame *) wParam,
(struct scroll_bar *) lParam);
***************
*** 8789,8795 ****
mask = CreateCompatibleDC (frame_dc);
release_frame_dc (f, frame_dc);
! prev = SelectObject (mask, img->mask);
}
img->background_transparent
--- 8789,8795 ----
mask = CreateCompatibleDC (frame_dc);
release_frame_dc (f, frame_dc);
! prev = SelectObject (mask, img->mask);
}
img->background_transparent
***************
*** 9339,9350 ****
/* Macro for defining functions that will be loaded from image DLLs. */
#define DEF_IMGLIB_FN(func) FARPROC fn_##func
!
/* Macro for loading those image functions from the library. */
#define LOAD_IMGLIB_FN(lib,func) { \
fn_##func = (void *) GetProcAddress (lib, #func); \
if (!fn_##func) return 0; \
! }
static int x_create_x_image_and_pixmap P_ ((struct frame *, int, int, int,
XImage **, Pixmap *));
--- 9339,9350 ----
/* Macro for defining functions that will be loaded from image DLLs. */
#define DEF_IMGLIB_FN(func) FARPROC fn_##func
!
/* Macro for loading those image functions from the library. */
#define LOAD_IMGLIB_FN(lib,func) { \
fn_##func = (void *) GetProcAddress (lib, #func); \
if (!fn_##func) return 0; \
! }
static int x_create_x_image_and_pixmap P_ ((struct frame *, int, int, int,
XImage **, Pixmap *));
***************
*** 10055,10061 ****
0, 0, SRCCOPY);
SelectObject (old_img_dc, old_prev);
! SelectObject (new_img_dc, new_prev);
DeleteDC (old_img_dc);
DeleteDC (new_img_dc);
DeleteObject (img->pixmap);
--- 10055,10061 ----
0, 0, SRCCOPY);
SelectObject (old_img_dc, old_prev);
! SelectObject (new_img_dc, new_prev);
DeleteDC (old_img_dc);
DeleteDC (new_img_dc);
DeleteObject (img->pixmap);
***************
*** 11643,11649 ****
DEF_IMGLIB_FN (png_create_info_struct);
DEF_IMGLIB_FN (png_destroy_read_struct);
DEF_IMGLIB_FN (png_set_read_fn);
! DEF_IMGLIB_FN (png_init_io);
DEF_IMGLIB_FN (png_set_sig_bytes);
DEF_IMGLIB_FN (png_read_info);
DEF_IMGLIB_FN (png_get_IHDR);
--- 11643,11649 ----
DEF_IMGLIB_FN (png_create_info_struct);
DEF_IMGLIB_FN (png_destroy_read_struct);
DEF_IMGLIB_FN (png_set_read_fn);
! DEF_IMGLIB_FN (png_init_io);
DEF_IMGLIB_FN (png_set_sig_bytes);
DEF_IMGLIB_FN (png_read_info);
DEF_IMGLIB_FN (png_get_IHDR);
***************
*** 11670,11676 ****
LOAD_IMGLIB_FN (library, png_create_info_struct);
LOAD_IMGLIB_FN (library, png_destroy_read_struct);
LOAD_IMGLIB_FN (library, png_set_read_fn);
! LOAD_IMGLIB_FN (library, png_init_io);
LOAD_IMGLIB_FN (library, png_set_sig_bytes);
LOAD_IMGLIB_FN (library, png_read_info);
LOAD_IMGLIB_FN (library, png_get_IHDR);
--- 11670,11676 ----
LOAD_IMGLIB_FN (library, png_create_info_struct);
LOAD_IMGLIB_FN (library, png_destroy_read_struct);
LOAD_IMGLIB_FN (library, png_set_read_fn);
! LOAD_IMGLIB_FN (library, png_init_io);
LOAD_IMGLIB_FN (library, png_set_sig_bytes);
LOAD_IMGLIB_FN (library, png_read_info);
LOAD_IMGLIB_FN (library, png_get_IHDR);
***************
*** 11697,11703 ****
{
struct image_keyword fmt[PNG_LAST];
bcopy (png_format, fmt, sizeof fmt);
!
if (!parse_image_spec (object, fmt, PNG_LAST, Qpng))
return 0;
--- 11697,11703 ----
{
struct image_keyword fmt[PNG_LAST];
bcopy (png_format, fmt, sizeof fmt);
!
if (!parse_image_spec (object, fmt, PNG_LAST, Qpng))
return 0;
***************
*** 11754,11760 ****
if (length > tbr->len - tbr->index)
fn_png_error (png_ptr, "Read error");
!
bcopy (tbr->bytes + tbr->index, data, length);
tbr->index = tbr->index + length;
}
--- 11754,11760 ----
if (length > tbr->len - tbr->index)
fn_png_error (png_ptr, "Read error");
!
bcopy (tbr->bytes + tbr->index, data, length);
tbr->index = tbr->index + length;
}
***************
*** 11896,11909 ****
fn_png_get_IHDR (png_ptr, info_ptr, &width, &height, &bit_depth,
&color_type,
&interlace_type, NULL, NULL);
! /* If image contains simply transparency data, we prefer to
construct a clipping mask. */
if (fn_png_get_valid (png_ptr, info_ptr, PNG_INFO_tRNS))
transparent_p = 1;
else
transparent_p = 0;
! /* This function is easier to write if we only have to handle
one data format: RGB or RGBA with 8 bits per channel. Let's
transform other formats into that format. */
--- 11896,11909 ----
fn_png_get_IHDR (png_ptr, info_ptr, &width, &height, &bit_depth,
&color_type,
&interlace_type, NULL, NULL);
! /* If image contains simply transparency data, we prefer to
construct a clipping mask. */
if (fn_png_get_valid (png_ptr, info_ptr, PNG_INFO_tRNS))
transparent_p = 1;
else
transparent_p = 0;
! /* This function is easier to write if we only have to handle
one data format: RGB or RGBA with 8 bits per channel. Let's
transform other formats into that format. */
***************
*** 11916,11922 ****
fn_png_set_expand (png_ptr);
/* Convert grayscale images to RGB. */
! if (color_type == PNG_COLOR_TYPE_GRAY
|| color_type == PNG_COLOR_TYPE_GRAY_ALPHA)
fn_png_set_gray_to_rgb (png_ptr);
--- 11916,11922 ----
fn_png_set_expand (png_ptr);
/* Convert grayscale images to RGB. */
! if (color_type == PNG_COLOR_TYPE_GRAY
|| color_type == PNG_COLOR_TYPE_GRAY_ALPHA)
fn_png_set_gray_to_rgb (png_ptr);
***************
*** 11965,11978 ****
}
}
else if (fn_png_get_bKGD (png_ptr, info_ptr, &image_bg))
! /* Image contains a background color with which to
combine the image. */
fn_png_set_background (png_ptr, image_bg,
PNG_BACKGROUND_GAMMA_FILE, 1, 1.0);
else
{
/* Image does not contain a background color with which
! to combine the image data via an alpha channel. Use
the frame's background instead. */
COLORREF color;
png_color_16 frame_background;
--- 11965,11978 ----
}
}
else if (fn_png_get_bKGD (png_ptr, info_ptr, &image_bg))
! /* Image contains a background color with which to
combine the image. */
fn_png_set_background (png_ptr, image_bg,
PNG_BACKGROUND_GAMMA_FILE, 1, 1.0);
else
{
/* Image does not contain a background color with which
! to combine the image data via an alpha channel. Use
the frame's background instead. */
COLORREF color;
png_color_16 frame_background;
***************
*** 12022,12033 ****
fclose (fp);
fp = NULL;
}
!
/* Create the X image and pixmap. */
if (!x_create_x_image_and_pixmap (f, width, height, 0, &ximg,
&img->pixmap))
goto error;
!
/* Create an image and pixmap serving as mask if the PNG image
contains an alpha channel. */
if (channels == 4
--- 12022,12033 ----
fclose (fp);
fp = NULL;
}
!
/* Create the X image and pixmap. */
if (!x_create_x_image_and_pixmap (f, width, height, 0, &ximg,
&img->pixmap))
goto error;
!
/* Create an image and pixmap serving as mask if the PNG image
contains an alpha channel. */
if (channels == 4
***************
*** 12062,12077 ****
XPutPixel (ximg, x, y, PALETTERGB (r, g, b));
#endif
/* An alpha channel, aka mask channel, associates variable
! transparency with an image. Where other image formats
! support binary transparency---fully transparent or fully
opaque---PNG allows up to 254 levels of partial transparency.
The PNG library implements partial transparency by combining
the image with a specified background color.
I'm not sure how to handle this here nicely: because the
background on which the image is displayed may change, for
! real alpha channel support, it would be necessary to create
! a new image for each possible background.
What I'm doing now is that a mask is created if we have
boolean transparency information. Otherwise I'm using
--- 12062,12077 ----
XPutPixel (ximg, x, y, PALETTERGB (r, g, b));
#endif
/* An alpha channel, aka mask channel, associates variable
! transparency with an image. Where other image formats
! support binary transparency---fully transparent or fully
opaque---PNG allows up to 254 levels of partial transparency.
The PNG library implements partial transparency by combining
the image with a specified background color.
I'm not sure how to handle this here nicely: because the
background on which the image is displayed may change, for
! real alpha channel support, it would be necessary to create
! a new image for each possible background.
What I'm doing now is that a mask is created if we have
boolean transparency information. Otherwise I'm using
***************
*** 12262,12270 ****
Lisp_Object object;
{
struct image_keyword fmt[JPEG_LAST];
!
bcopy (jpeg_format, fmt, sizeof fmt);
!
if (!parse_image_spec (object, fmt, JPEG_LAST, Qjpeg))
return 0;
--- 12262,12270 ----
Lisp_Object object;
{
struct image_keyword fmt[JPEG_LAST];
!
bcopy (jpeg_format, fmt, sizeof fmt);
!
if (!parse_image_spec (object, fmt, JPEG_LAST, Qjpeg))
return 0;
***************
*** 12335,12341 ****
{
if (num_bytes > src->bytes_in_buffer)
ERREXIT (cinfo, JERR_INPUT_EOF);
!
src->bytes_in_buffer -= num_bytes;
src->next_input_byte += num_bytes;
}
--- 12335,12341 ----
{
if (num_bytes > src->bytes_in_buffer)
ERREXIT (cinfo, JERR_INPUT_EOF);
!
src->bytes_in_buffer -= num_bytes;
src->next_input_byte += num_bytes;
}
***************
*** 12373,12379 ****
src = (struct jpeg_source_mgr *) cinfo->src;
src->next_input_byte = data;
}
!
src = (struct jpeg_source_mgr *) cinfo->src;
src->init_source = our_init_source;
src->fill_input_buffer = our_fill_input_buffer;
--- 12373,12379 ----
src = (struct jpeg_source_mgr *) cinfo->src;
src->next_input_byte = data;
}
!
src = (struct jpeg_source_mgr *) cinfo->src;
src->init_source = our_init_source;
src->fill_input_buffer = our_fill_input_buffer;
***************
*** 12388,12394 ****
/* Load image IMG for use on frame F. Patterned after example.c
from the JPEG lib. */
! static int
jpeg_load (f, img)
struct frame *f;
struct image *img;
--- 12388,12394 ----
/* Load image IMG for use on frame F. Patterned after example.c
from the JPEG lib. */
! static int
jpeg_load (f, img)
struct frame *f;
struct image *img;
***************
*** 12421,12427 ****
UNGCPRO;
return 0;
}
!
fp = fopen (SDATA (file), "r");
if (fp == NULL)
{
--- 12421,12427 ----
UNGCPRO;
return 0;
}
!
fp = fopen (SDATA (file), "r");
if (fp == NULL)
{
***************
*** 12435,12441 ****
error is detected. This function will perform a longjmp. */
cinfo.err = fn_jpeg_std_error (&mgr.pub);
mgr.pub.error_exit = my_error_exit;
!
if ((rc = setjmp (mgr.setjmp_buffer)) != 0)
{
if (rc == 1)
--- 12435,12441 ----
error is detected. This function will perform a longjmp. */
cinfo.err = fn_jpeg_std_error (&mgr.pub);
mgr.pub.error_exit = my_error_exit;
!
if ((rc = setjmp (mgr.setjmp_buffer)) != 0)
{
if (rc == 1)
***************
*** 12446,12452 ****
image_error ("Error reading JPEG image `%s': %s", img->spec,
build_string (buffer));
}
!
/* Close the input file and destroy the JPEG object. */
if (fp)
fclose ((FILE *) fp);
--- 12446,12452 ----
image_error ("Error reading JPEG image `%s': %s", img->spec,
build_string (buffer));
}
!
/* Close the input file and destroy the JPEG object. */
if (fp)
fclose ((FILE *) fp);
***************
*** 12457,12463 ****
/* Free pixmap and colors. */
x_clear_image (f, img);
!
UNGCPRO;
return 0;
}
--- 12457,12463 ----
/* Free pixmap and colors. */
x_clear_image (f, img);
!
UNGCPRO;
return 0;
}
***************
*** 12509,12515 ****
#endif
colors = (unsigned long *) alloca (cinfo.actual_number_of_colors
* sizeof *colors);
!
for (i = 0; i < cinfo.actual_number_of_colors; ++i)
{
int r = cinfo.colormap[ir][i];
--- 12509,12515 ----
#endif
colors = (unsigned long *) alloca (cinfo.actual_number_of_colors
* sizeof *colors);
!
for (i = 0; i < cinfo.actual_number_of_colors; ++i)
{
int r = cinfo.colormap[ir][i];
***************
*** 12549,12555 ****
/* Maybe fill in the background field while we have ximg handy. */
if (NILP (image_spec_value (img->spec, QCbackground, NULL)))
IMAGE_BACKGROUND (img, f, ximg);
!
/* Put the image into the pixmap. */
x_put_x_image (f, ximg, img->pixmap, width, height);
x_destroy_x_image (ximg);
--- 12549,12555 ----
/* Maybe fill in the background field while we have ximg handy. */
if (NILP (image_spec_value (img->spec, QCbackground, NULL)))
IMAGE_BACKGROUND (img, f, ximg);
!
/* Put the image into the pixmap. */
x_put_x_image (f, ximg, img->pixmap, width, height);
x_destroy_x_image (ximg);
***************
*** 15649,15655 ****
defsubr (&Sx_file_dialog);
}
!
/*
globals_of_w32fns is used to initialize those global variables that
must always be initialized on startup even when the global variable
--- 15649,15655 ----
defsubr (&Sx_file_dialog);
}
!
/*
globals_of_w32fns is used to initialize those global variables that
must always be initialized on startup even when the global variable
***************
*** 15680,15686 ****
#if HAVE_JPEG
/* Try loading jpeg library under probable names. */
! if (library = LoadLibrary ("jpeg.dll"))
{
if (init_jpeg_functions (library))
define_image_type (&jpeg_type);
--- 15680,15687 ----
#if HAVE_JPEG
/* Try loading jpeg library under probable names. */
! if ((library = LoadLibrary ("libjpeg.dll"))
! || (library = LoadLibrary ("jpeg.dll")))
{
if (init_jpeg_functions (library))
define_image_type (&jpeg_type);
- [Emacs-diffs] Changes to emacs/src/w32fns.c, Jason Rumney, 2003/01/25
- [Emacs-diffs] Changes to emacs/src/w32fns.c, Jason Rumney, 2003/01/25
- [Emacs-diffs] Changes to emacs/src/w32fns.c, Jason Rumney, 2003/01/25
- [Emacs-diffs] Changes to emacs/src/w32fns.c,
Juanma Barranquero <=
- [Emacs-diffs] Changes to emacs/src/w32fns.c, Jason Rumney, 2003/01/29
- [Emacs-diffs] Changes to emacs/src/w32fns.c, Juanma Barranquero, 2003/01/30
- [Emacs-diffs] Changes to emacs/src/w32fns.c, Juanma Barranquero, 2003/01/31
- [Emacs-diffs] Changes to emacs/src/w32fns.c, Juanma Barranquero, 2003/01/31