diff options
author | Jason Rumney <jasonr@gnu.org> | 2009-01-03 11:16:32 +0000 |
---|---|---|
committer | Jason Rumney <jasonr@gnu.org> | 2009-01-03 11:16:32 +0000 |
commit | 8b7d0a16b2a5074f23516b8ca0e16c76ae85d93b (patch) | |
tree | 8e71f743a10ad960afbaa97a24d524c27613695d /src/w32term.c | |
parent | 958a2b4c49b5f39a1eee119f311bb0995f7d29e1 (diff) | |
download | emacs-8b7d0a16b2a5074f23516b8ca0e16c76ae85d93b.tar.gz |
* w32term.c (x_query_colors, x_query_color): New functions.
* image.c (x_to_xcolors, png_load): Eliminate W32 specific code.
(svg_load_image): Cast returned pointers from dynamically loaded
functions. Eliminate W32 specific code.
Diffstat (limited to 'src/w32term.c')
-rw-r--r-- | src/w32term.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/w32term.c b/src/w32term.c index f771427e548..eb7aebde881 100644 --- a/src/w32term.c +++ b/src/w32term.c @@ -1526,6 +1526,35 @@ w32_alloc_lighter_color (f, color, factor, delta) return 1; } +/* On frame F, translate pixel colors to RGB values for the NCOLORS + colors in COLORS. On W32, we no longer try to map colors to + a palette. */ +void +x_query_colors (f, colors, ncolors) + struct frame *f; + XColor *colors; + int ncolors; +{ + int i; + + for (i = 0; i < ncolors; i++) + { + DWORD pixel = colors[i].pixel; + /* Convert to a 16 bit value in range 0 - 0xffff. */ + colors[i].red = GetRValue (pixel) * 257; + colors[i].green = GetGValue (pixel) * 257; + colors[i].blue = GetBValue (pixel) * 257; + } +} + +void +x_query_color (f, color) + struct frame *f; + XColor *color; +{ + x_query_colors (f, color, 1); +} + /* Set up the foreground color for drawing relief lines of glyph string S. RELIEF is a pointer to a struct relief containing the GC |