From 51ba147a0976351c48ee6b5dbec41aedf273354b Mon Sep 17 00:00:00 2001 From: Alexander Gramiak Date: Sat, 13 Apr 2019 20:41:31 -0600 Subject: Add terminal hook query_frame_background_color * src/termhooks.c (query_frame_background_color): New terminal hook. * src/image.c (image_query_frame_background_color): Remove. Use the terminal hook instead. * src/nsterm.m: * src/w32term.c: * src/xterm.c: Implement and set the new terminal hook. --- src/image.c | 23 ++++------------------- 1 file changed, 4 insertions(+), 19 deletions(-) (limited to 'src/image.c') diff --git a/src/image.c b/src/image.c index e3b7873f0a4..0528d46ad08 100644 --- a/src/image.c +++ b/src/image.c @@ -1306,22 +1306,6 @@ image_background_transparent (struct image *img, struct frame *f, XImagePtr_or_D return img->background_transparent; } -#if defined (HAVE_PNG) || defined (HAVE_IMAGEMAGICK) || defined (HAVE_RSVG) - -/* Store F's background color into *BGCOLOR. */ -static void -image_query_frame_background_color (struct frame *f, XColor *bgcolor) -{ -#ifndef HAVE_NS - bgcolor->pixel = FRAME_BACKGROUND_PIXEL (f); - x_query_color (f, bgcolor); -#else - ns_query_color (FRAME_BACKGROUND_COLOR (f), bgcolor, 1); -#endif -} - -#endif /* HAVE_PNG || HAVE_IMAGEMAGICK || HAVE_RSVG */ - /*********************************************************************** Helper functions for X image types ***********************************************************************/ @@ -6367,7 +6351,8 @@ png_load_body (struct frame *f, struct image *img, struct png_load_context *c) &color, false, false) - : (image_query_frame_background_color (f, &color), true)) + : (FRAME_TERMINAL (f)->query_frame_background_color (f, &color), + true)) /* The user specified `:background', use that. */ { int shift = bit_depth == 16 ? 0 : 8; @@ -8818,7 +8803,7 @@ imagemagick_load_image (struct frame *f, struct image *img, &bgcolor, false, false)) - image_query_frame_background_color (f, &bgcolor); + FRAME_TERMINAL (f)->query_frame_background_color (f, &bgcolor); bg_wand = NewPixelWand (); PixelSetRed (bg_wand, (double) bgcolor.red / 65535); @@ -9557,7 +9542,7 @@ svg_load_image (struct frame *f, struct image *img, char *contents, &background, false, false)) - image_query_frame_background_color (f, &background); + FRAME_TERMINAL (f)->query_frame_background_color (f, &background); /* SVG pixmaps specify transparency in the last byte, so right shift 8 bits to get rid of it, since emacs doesn't support -- cgit v1.2.1