summaryrefslogtreecommitdiffstats
path: root/macosx/tkMacOSXXStubs.c
diff options
context:
space:
mode:
Diffstat (limited to 'macosx/tkMacOSXXStubs.c')
-rw-r--r--macosx/tkMacOSXXStubs.c31
1 files changed, 30 insertions, 1 deletions
diff --git a/macosx/tkMacOSXXStubs.c b/macosx/tkMacOSXXStubs.c
index a556531..ab81fb3 100644
--- a/macosx/tkMacOSXXStubs.c
+++ b/macosx/tkMacOSXXStubs.c
@@ -12,7 +12,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkMacOSXXStubs.c,v 1.15 2006/03/24 14:58:01 das Exp $
+ * RCS: @(#) $Id: tkMacOSXXStubs.c,v 1.16 2006/09/10 17:06:32 das Exp $
*/
#include "tkMacOSXInt.h"
@@ -656,6 +656,19 @@ XQueryColor(
Colormap colormap,
XColor* def_in_out)
{
+ unsigned long p;
+ unsigned char r, g, b;
+ XColor *d = def_in_out;
+
+ p = d->pixel;
+ r = (p & 0x00FF0000) >> 16;
+ g = (p & 0x0000FF00) >> 8;
+ b = (p & 0x000000FF);
+ d->red = (r << 8) | r;
+ d->green = (g << 8) | g;
+ d->blue = (b << 8) | b;
+ d->flags = DoRed|DoGreen|DoBlue;
+ d->pad = 0;
}
void
@@ -665,6 +678,22 @@ XQueryColors(
XColor* defs_in_out,
int ncolors)
{
+ int i;
+ unsigned long p;
+ unsigned char r, g, b;
+ XColor *d = defs_in_out;
+
+ for (i = 0; i < ncolors; i++, d++) {
+ p = d->pixel;
+ r = (p & 0x00FF0000) >> 16;
+ g = (p & 0x0000FF00) >> 8;
+ b = (p & 0x000000FF);
+ d->red = (r << 8) | r;
+ d->green = (g << 8) | g;
+ d->blue = (b << 8) | b;
+ d->flags = DoRed|DoGreen|DoBlue;
+ d->pad = 0;
+ }
}
int