emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] emacs/src ChangeLog fns.c image.c


From: Dan Nicolaescu
Subject: [Emacs-diffs] emacs/src ChangeLog fns.c image.c
Date: Mon, 19 Oct 2009 22:33:44 +0000

CVSROOT:        /cvsroot/emacs
Module name:    emacs
Changes by:     Dan Nicolaescu <dann>   09/10/19 22:33:44

Modified files:
        src            : ChangeLog fns.c image.c 

Log message:
        * fns.c: Remove code for unsupported system: MAC_OS.
        * image.c: Likewise.  Include setjmp.h.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/emacs/src/ChangeLog?cvsroot=emacs&r1=1.7803&r2=1.7804
http://cvs.savannah.gnu.org/viewcvs/emacs/src/fns.c?cvsroot=emacs&r1=1.462&r2=1.463
http://cvs.savannah.gnu.org/viewcvs/emacs/src/image.c?cvsroot=emacs&r1=1.124&r2=1.125

Patches:
Index: ChangeLog
===================================================================
RCS file: /cvsroot/emacs/emacs/src/ChangeLog,v
retrieving revision 1.7803
retrieving revision 1.7804
diff -u -b -r1.7803 -r1.7804
--- ChangeLog   19 Oct 2009 18:08:53 -0000      1.7803
+++ ChangeLog   19 Oct 2009 22:33:42 -0000      1.7804
@@ -1,3 +1,8 @@
+2009-10-19  Dan Nicolaescu  <address@hidden>
+
+       * fns.c: Remove code for unsupported system: MAC_OS.
+       * image.c: Likewise.  Include setjmp.h.
+
 2009-10-19  Jan Djärv  <address@hidden>
 
        * xterm.c (x_create_toolkit_scroll_bar): Don't allocate color for

Index: fns.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/fns.c,v
retrieving revision 1.462
retrieving revision 1.463
diff -u -b -r1.462 -r1.463
--- fns.c       19 Oct 2009 04:27:15 -0000      1.462
+++ fns.c       19 Oct 2009 22:33:43 -0000      1.463
@@ -45,9 +45,6 @@
 #ifdef HAVE_MENUS
 #if defined (HAVE_X_WINDOWS)
 #include "xterm.h"
-#elif defined (MAC_OS)
-#include "macterm.h"
-#endif
 #endif
 
 #ifndef NULL

Index: image.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/image.c,v
retrieving revision 1.124
retrieving revision 1.125
diff -u -b -r1.124 -r1.125
--- image.c     19 Oct 2009 04:27:15 -0000      1.124
+++ image.c     19 Oct 2009 22:33:44 -0000      1.125
@@ -35,6 +35,8 @@
 #endif
 #endif 
 
+#include <setjmp.h>
+
 /* This makes the fields of a Display accessible, in Xlib header files.  */
 
 #define XLIB_ILLEGAL_ACCESS
@@ -148,248 +150,6 @@
    the bitmaps yourself.  That is, creating a bitmap from the same
    data more than once will not be caught.  */
 
-#ifdef MAC_OS
-
-static XImagePtr
-XGetImage (display, pixmap, x, y, width, height, plane_mask, format)
-     Display *display;         /* not used */
-     Pixmap pixmap;
-     int x, y;                 /* not used */
-     unsigned int width, height; /* not used */
-     unsigned long plane_mask;         /* not used */
-     int format;               /* not used */
-{
-#if !USE_MAC_IMAGE_IO
-#if GLYPH_DEBUG
-  xassert (x == 0 && y == 0);
-  {
-    Rect ri, rp;
-    SetRect (&ri, 0, 0, width, height);
-    xassert (EqualRect (&ri, GetPixBounds (GetGWorldPixMap (pixmap), &rp)));
-  }
-  xassert (! (pixelsLocked & GetPixelsState (GetGWorldPixMap (pixmap))));
-#endif
-
-  LockPixels (GetGWorldPixMap (pixmap));
-#endif
-
-  return pixmap;
-}
-
-static void
-XPutPixel (ximage, x, y, pixel)
-     XImagePtr ximage;
-     int x, y;
-     unsigned long pixel;
-{
-#if USE_MAC_IMAGE_IO
-  if (ximage->bits_per_pixel == 32)
-    ((unsigned int *)(ximage->data + y * ximage->bytes_per_line))[x] = pixel;
-  else
-    ((unsigned char *)(ximage->data + y * ximage->bytes_per_line))[x] = pixel;
-#else
-  PixMapHandle pixmap = GetGWorldPixMap (ximage);
-  short depth = GetPixDepth (pixmap);
-
-#if defined (WORDS_BIG_ENDIAN) || !USE_CG_DRAWING
-  if (depth == 32)
-    {
-      char *base_addr = GetPixBaseAddr (pixmap);
-      short row_bytes = GetPixRowBytes (pixmap);
-
-      ((unsigned long *) (base_addr + y * row_bytes))[x] = 0xff000000 | pixel;
-    }
-  else
-#endif
-  if (depth == 1)
-    {
-      char *base_addr = GetPixBaseAddr (pixmap);
-      short row_bytes = GetPixRowBytes (pixmap);
-
-      if (pixel == PIX_MASK_DRAW)
-       base_addr[y * row_bytes + x / 8] |= (1 << 7) >> (x & 7);
-      else
-       base_addr[y * row_bytes + x / 8] &= ~((1 << 7) >> (x & 7));
-    }
-  else
-    {
-      CGrafPtr old_port;
-      GDHandle old_gdh;
-      RGBColor color;
-
-      GetGWorld (&old_port, &old_gdh);
-      SetGWorld (ximage, NULL);
-
-      color.red = RED16_FROM_ULONG (pixel);
-      color.green = GREEN16_FROM_ULONG (pixel);
-      color.blue = BLUE16_FROM_ULONG (pixel);
-
-      SetCPixel (x, y, &color);
-
-      SetGWorld (old_port, old_gdh);
-    }
-#endif
-}
-
-static unsigned long
-XGetPixel (ximage, x, y)
-     XImagePtr ximage;
-     int x, y;
-{
-#if USE_MAC_IMAGE_IO
-  if (ximage->bits_per_pixel == 32)
-    return ((unsigned int *)(ximage->data + y * ximage->bytes_per_line))[x];
-  else
-    return ((unsigned char *)(ximage->data + y * ximage->bytes_per_line))[x];
-#else
-  PixMapHandle pixmap = GetGWorldPixMap (ximage);
-  short depth = GetPixDepth (pixmap);
-
-#if defined (WORDS_BIG_ENDIAN) || !USE_CG_DRAWING
-  if (depth == 32)
-    {
-      char *base_addr = GetPixBaseAddr (pixmap);
-      short row_bytes = GetPixRowBytes (pixmap);
-
-      return ((unsigned long *) (base_addr + y * row_bytes))[x] & 0x00ffffff;
-    }
-  else
-#endif
-  if (depth == 1)
-    {
-      char *base_addr = GetPixBaseAddr (pixmap);
-      short row_bytes = GetPixRowBytes (pixmap);
-
-      if (base_addr[y * row_bytes + x / 8] & (1 << (~x & 7)))
-       return PIX_MASK_DRAW;
-      else
-       return PIX_MASK_RETAIN;
-    }
-  else
-    {
-      CGrafPtr old_port;
-      GDHandle old_gdh;
-      RGBColor color;
-
-      GetGWorld (&old_port, &old_gdh);
-      SetGWorld (ximage, NULL);
-
-      GetCPixel (x, y, &color);
-
-      SetGWorld (old_port, old_gdh);
-      return RGB_TO_ULONG (color.red >> 8, color.green >> 8, color.blue >> 8);
-    }
-#endif
-}
-
-static void
-XDestroyImage (ximg)
-     XImagePtr ximg;
-{
-#if !USE_MAC_IMAGE_IO
-  UnlockPixels (GetGWorldPixMap (ximg));
-#endif
-}
-
-#if USE_CG_DRAWING
-#if USE_MAC_IMAGE_IO
-void
-mac_data_provider_release_data (info, data, size)
-     void *info;
-     const void *data;
-     size_t size;
-{
-  xfree ((void *)data);
-}
-#endif
-
-static CGImageRef
-mac_create_cg_image_from_image (f, img)
-     struct frame *f;
-     struct image *img;
-{
-#if USE_MAC_IMAGE_IO
-  XImagePtr ximg = img->pixmap;
-  CGDataProviderRef provider;
-  CGImageRef result;
-
-  if (img->mask)
-    {
-      int x, y;
-      unsigned long color, alpha;
-
-      for (y = 0; y < ximg->height; y++)
-       for (x = 0; x < ximg->width; x++)
-         {
-           color = XGetPixel (ximg, x, y);
-           alpha = XGetPixel (img->mask, x, y);
-           XPutPixel (ximg, x, y,
-                      ARGB_TO_ULONG (alpha,
-                                     RED_FROM_ULONG (color)
-                                     * alpha / PIX_MASK_DRAW,
-                                     GREEN_FROM_ULONG (color)
-                                     * alpha / PIX_MASK_DRAW,
-                                     BLUE_FROM_ULONG (color)
-                                     * alpha / PIX_MASK_DRAW));
-         }
-      xfree (img->mask->data);
-      img->mask->data = NULL;
-    }
-  BLOCK_INPUT;
-  provider = CGDataProviderCreateWithData (NULL, ximg->data,
-                                          ximg->bytes_per_line * ximg->height,
-                                          mac_data_provider_release_data);
-  ximg->data = NULL;
-  result = CGImageCreate (ximg->width, ximg->height, 8, 32,
-                         ximg->bytes_per_line, mac_cg_color_space_rgb,
-                         ((img->mask ? kCGImageAlphaPremultipliedFirst
-                           : kCGImageAlphaNoneSkipFirst)
-                          | kCGBitmapByteOrder32Host),
-                         provider, NULL, 0, kCGRenderingIntentDefault);
-  CGDataProviderRelease (provider);
-  UNBLOCK_INPUT;
-
-  return result;
-#else
-  Pixmap mask;
-  CGImageRef result = NULL;
-
-  BLOCK_INPUT;
-  if (img->mask)
-    mask = img->mask;
-  else
-    {
-      mask = XCreatePixmap (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f),
-                           img->width, img->height, 1);
-      if (mask)
-       {
-         CGrafPtr old_port;
-         GDHandle old_gdh;
-         Rect r;
-
-         GetGWorld (&old_port, &old_gdh);
-         SetGWorld (mask, NULL);
-         BackColor (blackColor); /* Don't mask.  */
-         SetRect (&r, 0, 0, img->width, img->height);
-         EraseRect (&r);
-         SetGWorld (old_port, old_gdh);
-       }
-    }
-  if (mask)
-    {
-      CreateCGImageFromPixMaps (GetGWorldPixMap (img->pixmap),
-                               GetGWorldPixMap (mask), &result);
-      if (mask != img->mask)
-       XFreePixmap (FRAME_X_DISPLAY (f), mask);
-    }
-  UNBLOCK_INPUT;
-
-  return result;
-#endif
-}
-#endif /* USE_CG_DRAWING */
-#endif /* MAC_OS */
-
 #ifdef HAVE_NS
 XImagePtr
 XGetImage (Display *display, Pixmap pixmap, int x, int y,
@@ -6412,7 +6172,6 @@
 
 #include <jpeglib.h>
 #include <jerror.h>
-#include <setjmp.h>
 
 #ifdef HAVE_STLIB_H_1
 #define HAVE_STDLIB_H 1




reply via email to

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