emacs-diffs
[Top][All Lists]
Advanced

[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: Fri, 31 Jan 2003 02:20:14 -0500

Index: emacs/src/w32fns.c
diff -c emacs/src/w32fns.c:1.204 emacs/src/w32fns.c:1.205
*** emacs/src/w32fns.c:1.204    Thu Jan 30 02:20:10 2003
--- emacs/src/w32fns.c  Fri Jan 31 02:20:13 2003
***************
*** 12919,12925 ****
--- 12919,12927 ----
  
  #if HAVE_GIF
  
+ #define DrawText gif_DrawText
  #include <gif_lib.h>
+ #undef DrawText
  
  static int gif_image_p P_ ((Lisp_Object object));
  static int gif_load P_ ((struct frame *f, struct image *img));
***************
*** 12975,12980 ****
--- 12977,13001 ----
    NULL
  };
  
+ 
+ /* GIF library details.  */
+ DEF_IMGLIB_FN (DGifCloseFile);
+ DEF_IMGLIB_FN (DGifSlurp);
+ DEF_IMGLIB_FN (DGifOpen);
+ DEF_IMGLIB_FN (DGifOpenFileName);
+ 
+ static int
+ init_gif_functions (library)
+      HMODULE library;
+ {
+   LOAD_IMGLIB_FN (library, DGifCloseFile);
+   LOAD_IMGLIB_FN (library, DGifSlurp);
+   LOAD_IMGLIB_FN (library, DGifOpen);
+   LOAD_IMGLIB_FN (library, DGifOpenFileName);
+   return 1;
+ }
+ 
+ 
  /* Return non-zero if OBJECT is a valid GIF image specification.  */
  
  static int
***************
*** 13061,13067 ****
          }
  
        /* Open the GIF file.  */
!       gif = DGifOpenFileName (SDATA (file));
        if (gif == NULL)
          {
            image_error ("Cannot open `%s'", file, Qnil);
--- 13082,13088 ----
          }
  
        /* Open the GIF file.  */
!       gif = fn_DGifOpenFileName (SDATA (file));
        if (gif == NULL)
          {
            image_error ("Cannot open `%s'", file, Qnil);
***************
*** 13077,13083 ****
        memsrc.len = SBYTES (specified_data);
        memsrc.index = 0;
  
!       gif = DGifOpen(&memsrc, gif_read_from_memory);
        if (!gif)
        {
          image_error ("Cannot open memory source `%s'", img->spec, Qnil);
--- 13098,13104 ----
        memsrc.len = SBYTES (specified_data);
        memsrc.index = 0;
  
!       gif = fn_DGifOpen(&memsrc, gif_read_from_memory);
        if (!gif)
        {
          image_error ("Cannot open memory source `%s'", img->spec, Qnil);
***************
*** 13087,13097 ****
      }
  
    /* Read entire contents.  */
!   rc = DGifSlurp (gif);
    if (rc == GIF_ERROR)
      {
        image_error ("Error reading `%s'", img->spec, Qnil);
!       DGifCloseFile (gif);
        UNGCPRO;
        return 0;
      }
--- 13108,13118 ----
      }
  
    /* Read entire contents.  */
!   rc = fn_DGifSlurp (gif);
    if (rc == GIF_ERROR)
      {
        image_error ("Error reading `%s'", img->spec, Qnil);
!       fn_DGifCloseFile (gif);
        UNGCPRO;
        return 0;
      }
***************
*** 13102,13119 ****
      {
        image_error ("Invalid image number `%s' in image `%s'",
                     image, img->spec);
!       DGifCloseFile (gif);
        UNGCPRO;
        return 0;
      }
  
!   width = img->width = gif->SWidth;
!   height = img->height = gif->SHeight;
  
    /* Create the X image and pixmap.  */
    if (!x_create_x_image_and_pixmap (f, width, height, 0, &ximg, &img->pixmap))
      {
!       DGifCloseFile (gif);
        UNGCPRO;
        return 0;
      }
--- 13123,13140 ----
      {
        image_error ("Invalid image number `%s' in image `%s'",
                     image, img->spec);
!       fn_DGifCloseFile (gif);
        UNGCPRO;
        return 0;
      }
  
!   width = img->width = max (gif->SWidth, gif->Image.Left + gif->Image.Width);
!   height = img->height = max (gif->SHeight, gif->Image.Top + 
gif->Image.Height);
  
    /* Create the X image and pixmap.  */
    if (!x_create_x_image_and_pixmap (f, width, height, 0, &ximg, &img->pixmap))
      {
!       fn_DGifCloseFile (gif);
        UNGCPRO;
        return 0;
      }
***************
*** 13122,13140 ****
    gif_color_map = gif->SavedImages[ino].ImageDesc.ColorMap;
    if (!gif_color_map)
      gif_color_map = gif->SColorMap;
    init_color_table ();
    bzero (pixel_colors, sizeof pixel_colors);
  
    for (i = 0; i < gif_color_map->ColorCount; ++i)
      {
!       int r = gif_color_map->Colors[i].Red << 8;
!       int g = gif_color_map->Colors[i].Green << 8;
!       int b = gif_color_map->Colors[i].Blue << 8;
        pixel_colors[i] = lookup_rgb_color (f, r, g, b);
      }
  
    img->colors = colors_in_color_table (&img->ncolors);
    free_color_table ();
  
    /* Clear the part of the screen image that are not covered by
       the image from the GIF file.  Full animated GIF support
--- 13143,13169 ----
    gif_color_map = gif->SavedImages[ino].ImageDesc.ColorMap;
    if (!gif_color_map)
      gif_color_map = gif->SColorMap;
+ #if 0 /* TODO: Color tables */
    init_color_table ();
+ #endif
    bzero (pixel_colors, sizeof pixel_colors);
  
    for (i = 0; i < gif_color_map->ColorCount; ++i)
      {
!       int r = gif_color_map->Colors[i].Red;
!       int g = gif_color_map->Colors[i].Green;
!       int b = gif_color_map->Colors[i].Blue;
! #if 0 /* TODO: Color tables */
        pixel_colors[i] = lookup_rgb_color (f, r, g, b);
+ #else
+       pixel_colors[i] = PALETTERGB (r, g, b);
+ #endif
      }
  
+ #if 0 /* TODO: Color tables */
    img->colors = colors_in_color_table (&img->ncolors);
    free_color_table ();
+ #endif
  
    /* Clear the part of the screen image that are not covered by
       the image from the GIF file.  Full animated GIF support
***************
*** 13205,13211 ****
          }
      }
  
!   DGifCloseFile (gif);
  
    /* Maybe fill in the background field while we have ximg handy. */
    if (NILP (image_spec_value (img->spec, QCbackground, NULL)))
--- 13234,13240 ----
          }
      }
  
!   fn_DGifCloseFile (gif);
  
    /* Maybe fill in the background field while we have ximg handy. */
    if (NILP (image_spec_value (img->spec, QCbackground, NULL)))
***************
*** 15694,15700 ****
  #endif
  
  #if HAVE_GIF
!   define_image_type (&gif_type);
  #endif
  
  #if HAVE_PNG
--- 15723,15733 ----
  #endif
  
  #if HAVE_GIF
!   if (library = LoadLibrary ("libungif.dll"))
!     {
!       if (init_gif_functions (library))
!         define_image_type (&gif_type);
!     }
  #endif
  
  #if HAVE_PNG




reply via email to

[Prev in Thread] Current Thread [Next in Thread]