diff --git a/configure.ac b/configure.ac index 9f3677bea34..a3ba5e69a2f 100644 --- a/configure.ac +++ b/configure.ac @@ -3079,14 +3079,13 @@ if test "${HAVE_W32}" = "yes"; then # the rc file), not a linker script. W32_RES_LINK="-Wl,emacs.res" else - W32_OBJ="$W32_OBJ w32.o w32console.o w32heap.o w32inevt.o w32proc.o" + W32_OBJ="$W32_OBJ w32.o w32console.o w32heap.o w32image.o w32inevt.o w32proc.o" dnl FIXME: This should probably be supported for Cygwin/w32 as dnl well, but the Cygwin build needs to link against -lgdiplus if test "${with_native_image_api}" = yes; then AC_DEFINE([HAVE_NATIVE_IMAGE_API], [1], [Define to use native OS APIs for images.]) NATIVE_IMAGE_API="yes (w32)" - W32_OBJ="$W32_OBJ w32image.o" fi W32_LIBS="$W32_LIBS -lwinmm -lgdi32 -lcomdlg32" W32_LIBS="$W32_LIBS -lmpr -lwinspool -lole32 -lcomctl32" diff --git a/etc/NEWS b/etc/NEWS index fd39d965a40..c54941382c3 100644 --- a/etc/NEWS +++ b/etc/NEWS @@ -4681,9 +4681,7 @@ color Emoji font installed on your system for the 'emoji' script. +++ ** Emacs on MS-Windows now supports 'yank-media'. This command inserts clipboard data of different formats into the -current buffer, if the major mode supports it. (Support for -'yank-media' will be unavailable on MS-Windows if Emacs was configured -'--without-native-image-api'.) +current buffer, if the major mode supports it. --- ** Emacs on MS-Windows now supports up to 1024 sub-processes. diff --git a/src/emacs.c b/src/emacs.c index 23e0c6f5318..7ae572120f6 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -2362,7 +2362,7 @@ Using an Emacs configured with --with-x-toolkit=lucid does not have this problem syms_of_fringe (); syms_of_image (); #ifdef HAVE_NTGUI -# if HAVE_NATIVE_IMAGE_API +# if WINDOWSNT syms_of_w32image (); # endif #endif /* HAVE_NTGUI */ @@ -2504,7 +2504,7 @@ Using an Emacs configured with --with-x-toolkit=lucid does not have this problem globals_of_w32font (); globals_of_w32fns (); globals_of_w32menu (); -# if HAVE_NATIVE_IMAGE_API +# if WINDOWSNT globals_of_w32image (); # endif #endif /* HAVE_NTGUI */ diff --git a/src/w32.c b/src/w32.c index f43c96902e8..409d4238bc9 100644 --- a/src/w32.c +++ b/src/w32.c @@ -10548,9 +10548,8 @@ term_ntproc (int ignored) term_w32select (); /* Exit all worker threads of sys_select if necessary. */ free_wait_pool (); -#if HAVE_NATIVE_IMAGE_API + w32_gdiplus_shutdown (); -#endif } void diff --git a/src/w32fns.c b/src/w32fns.c index 33f1006d398..1749f2ba390 100644 --- a/src/w32fns.c +++ b/src/w32fns.c @@ -11469,6 +11469,7 @@ Optional arg TYPE should be either `jpeg' (default), `bmp', `png', Value is non-nil if FRAME was successfully exported, nil otherwise. */) (Lisp_Object frame, Lisp_Object file, Lisp_Object type) { +#ifdef WINDOWSNT struct frame *f = decode_live_frame (frame); if (NILP (type)) @@ -11494,6 +11495,9 @@ Value is non-nil if FRAME was successfully exported, nil otherwise. */) unblock_input (); return result >= 0 ? Qt : Qnil; +#else /* !WINDOWSNT */ + return Qnil; +#endif } diff --git a/src/w32select.c b/src/w32select.c index e3c948b3c8b..b1f00853e87 100644 --- a/src/w32select.c +++ b/src/w32select.c @@ -825,7 +825,7 @@ static const char *stdfmt_name[] = { static bool convert_dibv5_to_png (char *data, int size, char *temp_file) { -#ifdef HAVE_NATIVE_IMAGE_API +#ifdef WINDOWSNT CLSID clsid_png; if (!w32_gdiplus_startup () @@ -859,7 +859,7 @@ convert_dibv5_to_png (char *data, int size, char *temp_file) if (status != Ok) return false; return true; -#else /* !HAVE_NATIVE_IMAGE_API */ +#else /* !WINDOWSNT */ return false; #endif } diff --git a/src/w32term.c b/src/w32term.c index 5b7d9c5f17d..43d2440854b 100644 --- a/src/w32term.c +++ b/src/w32term.c @@ -2109,7 +2109,7 @@ w32_draw_image_foreground (struct glyph_string *s) compat_hdc, s->slice.x, s->slice.y, SRCCOPY); else { -#ifdef HAVE_NATIVE_IMAGE_API +#ifdef WINDOWSNT if (s->img->smoothing && w32_gdiplus_startup ()) { GpGraphics *graphics;