summaryrefslogtreecommitdiffstats
path: root/win/tkWinColor.c
diff options
context:
space:
mode:
authorstanton <stanton>1999-04-16 01:51:06 (GMT)
committerstanton <stanton>1999-04-16 01:51:06 (GMT)
commit03656f44f81469f459031fa3a4a7b09c8bc77712 (patch)
tree31378e81bd58f8c726fc552d6b30cbf3ca07497b /win/tkWinColor.c
parent404fc236f34304df53b7e44bc7971d786b87d453 (diff)
downloadtk-03656f44f81469f459031fa3a4a7b09c8bc77712.zip
tk-03656f44f81469f459031fa3a4a7b09c8bc77712.tar.gz
tk-03656f44f81469f459031fa3a4a7b09c8bc77712.tar.bz2
* Merged 8.1 branch into the main trunk
Diffstat (limited to 'win/tkWinColor.c')
-rw-r--r--win/tkWinColor.c25
1 files changed, 12 insertions, 13 deletions
diff --git a/win/tkWinColor.c b/win/tkWinColor.c
index 2c941ba..febf0cb 100644
--- a/win/tkWinColor.c
+++ b/win/tkWinColor.c
@@ -9,11 +9,11 @@
* 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.2 1998/09/14 18:23:59 stanton Exp $
+ * RCS: @(#) $Id: tkWinColor.c,v 1.3 1999/04/16 01:51:49 stanton Exp $
*/
-#include <tkColor.h>
-#include <tkWinInt.h>
+#include "tkWinInt.h"
+#include "tkColor.h"
/*
* The following structure is used to keep track of each color that is
@@ -27,12 +27,6 @@ typedef struct WinColor {
} WinColor;
/*
- * colorTable is a hash table used to look up X colors by name.
- */
-
-static Tcl_HashTable colorTable;
-
-/*
* The sysColors array contains the names and index values for the
* Windows indirect system color names. In use, all of the names
* will have the string "System" prepended, but we omit it in the table
@@ -75,7 +69,10 @@ static SystemColorEntry sysColors[] = {
NULL, 0
};
-static int ncolors = 0;
+typedef struct ThreadSpecificData {
+ int ncolors;
+} ThreadSpecificData;
+static Tcl_ThreadDataKey dataKey;
/*
* Forward declarations for functions defined later in this file.
@@ -111,13 +108,15 @@ FindSystemColor(name, colorPtr, indexPtr)
int *indexPtr; /* Out parameter to store color index. */
{
int l, u, r, i;
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
/*
* Count the number of elements in the color array if we haven't
* done so yet.
*/
- if (ncolors == 0) {
+ if (tsdPtr->ncolors == 0) {
SystemColorEntry *ePtr;
int version;
@@ -130,7 +129,7 @@ FindSystemColor(name, colorPtr, indexPtr)
ePtr->index = COLOR_BTNHIGHLIGHT;
}
}
- ncolors++;
+ tsdPtr->ncolors++;
}
}
@@ -139,7 +138,7 @@ FindSystemColor(name, colorPtr, indexPtr)
*/
l = 0;
- u = ncolors - 1;
+ u = tsdPtr->ncolors - 1;
while (l <= u) {
i = (l + u) / 2;
r = strcasecmp(name, sysColors[i].name);