#endif /* HAVE_X_WINDOWS */
#ifdef HAVE_NTGUI
-#include "w32.h"
+# ifdef WINDOWSNT
+/* We only need (or want) w32.h when we're _not_
+ * compiling for Cygwin */
+# include "w32.h"
+# endif /* WINDOWSNT */
/* W32_TODO : Color tables on W32. */
#undef COLOR_TABLE_SUPPORT
static void x_emboss (struct frame *, struct image *);
static int x_build_heuristic_mask (struct frame *, struct image *,
Lisp_Object);
-#ifdef HAVE_NTGUI
+#ifdef WINDOWSNT
+extern Lisp_Object Vlibrary_cache;
#define CACHE_IMAGE_TYPE(type, status) \
do { Vlibrary_cache = Fcons (Fcons (type, status), Vlibrary_cache); } while (0)
#else
#define CACHE_IMAGE_TYPE(type, status)
-#endif
+#endif /* WINDOWSNT */
#define ADD_IMAGE_TYPE(type) \
do { Vimage_types = Fcons (type, Vimage_types); } while (0)
X / NS / W32 support code
***********************************************************************/
-#ifdef HAVE_NTGUI
+#ifdef WINDOWSNT
/* Macro for defining functions that will be loaded from image DLLs. */
#define DEF_IMGLIB_FN(rettype,func,args) static rettype (FAR CDECL *fn_##func)args
if (!fn_##func) return 0; \
}
-#endif /* HAVE_NTGUI */
+#endif /* WINDOWSNT */
static int x_create_x_image_and_pixmap (struct frame *, int, int, int,
XImagePtr *, Pixmap *);
else
bits = (char *) XBOOL_VECTOR (data)->data;
-#ifdef WINDOWSNT
+#ifdef HAVE_NTGUI
{
char *invertedBits;
int nbytes, i;
#endif /* ALLOC_XPM_COLORS */
-#ifdef HAVE_NTGUI
+#ifdef WINDOWSNT
/* XPM library details. */
return 1;
}
-#endif /* HAVE_NTGUI */
+#endif /* WINDOWSNT */
+#ifdef HAVE_NTGUI
+/* Glue for code below */
+#define fn_XpmReadFileToImage XpmReadFileToImage
+#define fn_XpmCreateImageFromBuffer XpmCreateImageFromBuffer
+#define fn_XImageFree XImageFree
+#define fn_XpmFreeAttributes XpmFreeAttributes
+#endif /* HAVE_NTGUI */
/* Value is non-zero if COLOR_SYMBOLS is a valid color symbols list
for XPM images. Such a list must consist of conses whose car and
#ifdef HAVE_PNG
-#ifdef HAVE_NTGUI
+#ifdef WINDOWSNT
/* PNG library details. */
DEF_IMGLIB_FN (png_voidp, png_get_io_ptr, (png_structp));
#define fn_png_set_longjmp_fn png_set_longjmp_fn
#endif /* libpng version >= 1.5 */
-#endif /* HAVE_NTGUI */
+#endif /* WINDOWSNT */
/* Possibly inefficient/inexact substitutes for _setjmp and _longjmp.
Do not use sys_setjmp, as PNG supports only jmp_buf. The _longjmp
#define __WIN32__ 1
#endif
+/* Work around conflict between jpeg boolean and rpcndr.h
+ under Windows. */
+#define boolean jpeg_boolean
#include <jpeglib.h>
#include <jerror.h>
+/* Don't undefine boolean --- use the JPEG boolean
+ through the rest of the file. */
+
#ifdef HAVE_STLIB_H_1
#define HAVE_STDLIB_H 1
#endif
-#ifdef HAVE_NTGUI
+#ifdef WINDOWSNT
/* JPEG library details. */
DEF_IMGLIB_FN (void, jpeg_CreateDecompress, (j_decompress_ptr, int, size_t));
#define fn_jpeg_std_error jpeg_std_error
#define jpeg_resync_to_restart_wrapper jpeg_resync_to_restart
-#endif /* HAVE_NTGUI */
+#endif /* WINDOWSNT */
struct my_jpeg_error_mgr
{
#include <tiffio.h>
-#ifdef HAVE_NTGUI
+#ifdef WINDOWSNT
/* TIFF library details. */
DEF_IMGLIB_FN (TIFFErrorHandler, TIFFSetErrorHandler, (TIFFErrorHandler));
#define fn_TIFFReadRGBAImage TIFFReadRGBAImage
#define fn_TIFFClose TIFFClose
#define fn_TIFFSetDirectory TIFFSetDirectory
-#endif /* HAVE_NTGUI */
+#endif /* WINDOWSNT */
/* Reading from a memory buffer for TIFF images Based on the PNG
#endif /* HAVE_NTGUI */
-#ifdef HAVE_NTGUI
+#ifdef WINDOWSNT
/* GIF library details. */
DEF_IMGLIB_FN (int, DGifCloseFile, (GifFileType *));
#define fn_DGifOpen DGifOpen
#define fn_DGifOpenFileName DGifOpenFileName
-#endif /* HAVE_NTGUI */
+#endif /* WINDOWSNT */
/* Reading a GIF image from memory
Based on the PNG memory stuff to a certain extent. */
#include <librsvg/rsvg.h>
-#ifdef HAVE_NTGUI
+#ifdef WINDOWSNT
/* SVG library functions. */
DEF_IMGLIB_FN (RsvgHandle *, rsvg_handle_new);
#define fn_g_type_init g_type_init
#define fn_g_object_unref g_object_unref
#define fn_g_error_free g_error_free
-#endif /* !HAVE_NTGUI */
+#endif /* !WINDOWSNT */
/* Load SVG image IMG for use on frame F. Value is non-zero if
successful. this function will go into the svg_type structure, and
Initialization
***********************************************************************/
-#ifdef HAVE_NTGUI
+#ifdef WINDOWSNT
/* Image types that rely on external libraries are loaded dynamically
if the library is available. */
#define CHECK_LIB_AVAILABLE(image_type, init_lib_fn, libraries) \
#else
#define CHECK_LIB_AVAILABLE(image_type, init_lib_fn, libraries) \
define_image_type (image_type, 1)
-#endif /* HAVE_NTGUI */
+#endif /* WINDOWSNT */
DEFUN ("init-image-library", Finit_image_library, Sinit_image_library, 2, 2, 0,
doc: /* Initialize image library implementing image type TYPE.
of `dynamic-library-alist', which see). */)
(Lisp_Object type, Lisp_Object libraries)
{
-#ifdef HAVE_NTGUI
+#ifdef WINDOWSNT
/* Don't try to reload the library. */
Lisp_Object tested = Fassq (type, Vlibrary_cache);
if (CONSP (tested))