From 50eff40ff15b6349137bc9618d021495c72815af Mon Sep 17 00:00:00 2001 From: YAMAMOTO Mitsuharu Date: Fri, 2 May 2008 09:40:19 +0000 Subject: [PATCH] [HAVE_CARBON && HAVE_AVAILABILITYMACROS_H]: Include AvailabilityMacros.h. (USE_MAC_IMAGE_IO, LIBS_IMAGE) [HAVE_CARBON]: New defines. (LIBS_CARBON) [HAVE_CARBON]: Use LIBS_IMAGE. --- src/ChangeLog | 40 ++++++++++++++++++++++++++++++++++++++++ src/s/darwin.h | 24 +++++++++++++++++++++++- 2 files changed, 63 insertions(+), 1 deletion(-) diff --git a/src/ChangeLog b/src/ChangeLog index 94a8862ed10..0849e9ee4b7 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,43 @@ +2008-05-02 YAMAMOTO Mitsuharu + + * config.in: Regenerate. + + * image.c (PIX_MASK_DRAW, PIX_MASK_RETAIN) [USE_MAC_IMAGE_IO]: + New definitions for Image I/O support. + (XGetImage, XPutPixel, XGetPixel, XDestroyImage) + (mac_create_cg_image_from_image, x_create_x_image_and_pixmap) + [USE_MAC_IMAGE_IO]: Add implementations for Image I/O support. + (mac_data_provider_release_data, image_load_image_io) + [USE_MAC_IMAGE_IO]: New functions. + (CGImageCreateWithPNGDataProviderProcType) [MAC_OSX]: Remove typedef. + (MyCGImageCreateWithPNGDataProvider) [MAC_OSX]: Remove variable. + (init_image_func_pointer) [MAC_OSX]: Remove function. + (image_load_quartz2d) [MAC_OSX]: Check availability of + CGImageCreateWithPNGDataProvider at compile time. + Use lowercase `false' for boolean constant. + (png_load, jpeg_load, tiff_load, gif_load) [USE_MAC_IMAGE_IO]: + Use image_load_image_io. + (png_load) [!USE_MAC_IMAGE_IO && MAC_OSX]: + Don't check MyCGImageCreateWithPNGDataProvider. + (init_image) [MAC_OSX && TARGET_API_MAC_CARBON]: + Don't call init_image_func_pointer. + + * macgui.h (Pixmap) [USE_MAC_IMAGE_IO]: New definition for Image I/O. + + * macterm.c (mac_cg_color_space_rgb) [USE_CG_DRAWING]: + Make variable non-static. + (XDrawLine, XCreatePixmap, XCreatePixmapFromBitmapData, XFreePixmap) + [USE_MAC_IMAGE_IO]: Add implementations for Image I/O support. + + * macterm.h (ARGB_TO_ULONG, ALPHA_FROM_ULONG): New macros. + (RED_FROM_ULONG): Mask off higher bits. + (mac_cg_color_space_rgb) [USE_MAC_IMAGE_IO]: New extern. + + * s/darwin.h [HAVE_CARBON && HAVE_AVAILABILITYMACROS_H]: + Include AvailabilityMacros.h. + (USE_MAC_IMAGE_IO, LIBS_IMAGE) [HAVE_CARBON]: New defines. + (LIBS_CARBON) [HAVE_CARBON]: Use LIBS_IMAGE. + 2008-04-25 Chip Coldwell * m/sparc.h: Additional redefinitions for GNU/Linux. diff --git a/src/s/darwin.h b/src/s/darwin.h index ba784805ea7..2017bd2e6cf 100644 --- a/src/s/darwin.h +++ b/src/s/darwin.h @@ -262,9 +262,31 @@ Boston, MA 02110-1301, USA. */ /* Indicate that we are compiling for Mac OS X. */ #define C_SWITCH_SYSTEM -fpascal-strings -DMAC_OSX +#ifdef HAVE_CARBON + +#ifdef HAVE_AVAILABILITYMACROS_H +#include +#endif + +/* Whether to use the Image I/O framework for reading images. */ +#ifndef USE_MAC_IMAGE_IO +#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1040 && (MAC_OS_X_VERSION_MIN_REQUIRED >= 1040 || MAC_OS_X_VERSION_MIN_REQUIRED < 1020) +#define USE_MAC_IMAGE_IO 1 +#endif +#endif + +/* If the Image I/O framework is not used, fall back on QuickTime. */ +#if USE_MAC_IMAGE_IO +#define LIBS_IMAGE +#else +#define LIBS_IMAGE -framework QuickTime +#endif + +#endif /* HAVE_CARBON */ + /* Link in the Carbon lib. */ #ifdef HAVE_CARBON -#define LIBS_CARBON -framework Carbon -framework QuickTime +#define LIBS_CARBON -framework Carbon LIBS_IMAGE #else #define LIBS_CARBON #endif -- 2.39.2