diff options
author | hobbs <hobbs> | 2000-03-02 23:52:36 (GMT) |
---|---|---|
committer | hobbs <hobbs> | 2000-03-02 23:52:36 (GMT) |
commit | 2e992346d67c6e23c86d6d3808a0895116140fea (patch) | |
tree | 7de3d6716b43c5986c312c8a093a24dfdf3eebdf | |
parent | 5cb508c4cca65602bd2fdb7013f5accbff1ddb18 (diff) | |
download | tk-2e992346d67c6e23c86d6d3808a0895116140fea.zip tk-2e992346d67c6e23c86d6d3808a0895116140fea.tar.gz tk-2e992346d67c6e23c86d6d3808a0895116140fea.tar.bz2 |
* win/tkWinInt.h: change extern to EXTERN for TkWinChildProc
declaration with extra #defs. [Bug: 4240]
* tests/color.test:
* xlib/xcolors.c (XParseColor FindColor):
* win/tkWinColor.c (XAllocColor): Fixed bit fiddling for colors to
return "correct" values for color mapping. [Bug: 4282]
-rw-r--r-- | win/tkWinColor.c | 17 | ||||
-rw-r--r-- | win/tkWinInt.h | 16 |
2 files changed, 24 insertions, 9 deletions
diff --git a/win/tkWinColor.c b/win/tkWinColor.c index febf0cb..91a482b 100644 --- a/win/tkWinColor.c +++ b/win/tkWinColor.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkWinColor.c,v 1.3 1999/04/16 01:51:49 stanton Exp $ + * RCS: @(#) $Id: tkWinColor.c,v 1.4 2000/03/02 23:52:36 hobbs Exp $ */ #include "tkWinInt.h" @@ -373,9 +373,9 @@ XAllocColor(display, colormap, color) if ((index >= cmap->size) || (newPixel != closePixel)) { if (cmap->size == sizePalette) { - color->red = closeEntry.peRed << 8; - color->green = closeEntry.peGreen << 8; - color->blue = closeEntry.peBlue << 8; + color->red = (closeEntry.peRed << 8) | closeEntry.peRed; + color->green = (closeEntry.peGreen << 8) | closeEntry.peGreen; + color->blue = (closeEntry.peBlue << 8) | closeEntry.peBlue; entry = closeEntry; if (index >= cmap->size) { OutputDebugString("XAllocColor: Colormap is bigger than we thought"); @@ -404,9 +404,12 @@ XAllocColor(display, colormap, color) color->pixel = GetNearestColor(dc, RGB(entry.peRed, entry.peGreen, entry.peBlue)); - color->red = (GetRValue(color->pixel) << 8); - color->green = (GetGValue(color->pixel) << 8); - color->blue = (GetBValue(color->pixel) << 8); + color->red = GetRValue(color->pixel); + color->red |= (color->red << 8); + color->green = GetGValue(color->pixel); + color->green |= (color->green << 8); + color->blue = GetBValue(color->pixel); + color->blue |= (color->blue << 8); } ReleaseDC(NULL, dc); diff --git a/win/tkWinInt.h b/win/tkWinInt.h index 7aaabaa..6b5e85f 100644 --- a/win/tkWinInt.h +++ b/win/tkWinInt.h @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkWinInt.h,v 1.7 1999/11/19 22:00:19 hobbs Exp $ + * RCS: @(#) $Id: tkWinInt.h,v 1.8 2000/03/02 23:52:37 hobbs Exp $ */ #ifndef _TKWININT @@ -151,8 +151,20 @@ extern int tkpWinRopModes[]; #include "tkIntPlatDecls.h" -extern LRESULT CALLBACK TkWinChildProc _ANSI_ARGS_((HWND hwnd, UINT message, +/* + * We need to specially add the TkWinChildProc because of the special + * prototype it has (doesn't fit into stubs schema) + */ +#ifdef BUILD_tk +#undef TCL_STORAGE_CLASS +#define TCL_STORAGE_CLASS DLLEXPORT +#endif + +EXTERN LRESULT CALLBACK TkWinChildProc _ANSI_ARGS_((HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)); +#undef TCL_STORAGE_CLASS +#define TCL_STORAGE_CLASS DLLIMPORT + #endif /* _TKWININT */ |