summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
Diffstat (limited to 'generic')
-rw-r--r--generic/tk.h6
-rw-r--r--generic/tkColor.c20
-rw-r--r--generic/tkColor.h8
-rw-r--r--generic/tkEntry.c4
4 files changed, 21 insertions, 17 deletions
diff --git a/generic/tk.h b/generic/tk.h
index 2e62d05..8d72323 100644
--- a/generic/tk.h
+++ b/generic/tk.h
@@ -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: tk.h,v 1.30.2.2 1999/10/30 09:35:56 hobbs Exp $
+ * RCS: @(#) $Id: tk.h,v 1.30.2.3 1999/11/19 23:35:43 hobbs Exp $
*/
#ifndef _TK
@@ -46,10 +46,10 @@ extern "C" {
#define TK_MAJOR_VERSION 8
#define TK_MINOR_VERSION 2
#define TK_RELEASE_LEVEL TCL_FINAL_RELEASE
-#define TK_RELEASE_SERIAL 2
+#define TK_RELEASE_SERIAL 3
#define TK_VERSION "8.2"
-#define TK_PATCH_LEVEL "8.2.2"
+#define TK_PATCH_LEVEL "8.2.3"
/*
* The following definitions set up the proper options for Macintosh
diff --git a/generic/tkColor.c b/generic/tkColor.c
index 8c6b0be..e3025d3 100644
--- a/generic/tkColor.c
+++ b/generic/tkColor.c
@@ -11,7 +11,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkColor.c,v 1.5 1999/04/21 21:53:25 rjohnson Exp $
+ * RCS: @(#) $Id: tkColor.c,v 1.5.6.1 1999/11/19 23:35:44 hobbs Exp $
*/
#include "tkColor.h"
@@ -254,7 +254,7 @@ Tk_GetColor(interp, tkwin, name)
tkColPtr->visual = Tk_Visual(tkwin);
tkColPtr->resourceRefCount = 1;
tkColPtr->objRefCount = 0;
- tkColPtr->tablePtr = &dispPtr->colorNameTable;
+ tkColPtr->type = TK_COLOR_BY_NAME;
tkColPtr->hashPtr = nameHashPtr;
tkColPtr->nextPtr = existingColPtr;
Tcl_SetHashValue(nameHashPtr, tkColPtr);
@@ -334,7 +334,7 @@ Tk_GetColorByValue(tkwin, colorPtr)
tkColPtr->visual = Tk_Visual(tkwin);
tkColPtr->resourceRefCount = 1;
tkColPtr->objRefCount = 0;
- tkColPtr->tablePtr = &dispPtr->colorValueTable;
+ tkColPtr->type = TK_COLOR_BY_VALUE;
tkColPtr->hashPtr = valueHashPtr;
tkColPtr->nextPtr = NULL;
Tcl_SetHashValue(valueHashPtr, tkColPtr);
@@ -368,15 +368,17 @@ Tk_NameOfColor(colorPtr)
XColor *colorPtr; /* Color whose name is desired. */
{
register TkColor *tkColPtr = (TkColor *) colorPtr;
- ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
- Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
- if (tkColPtr->magic == COLOR_MAGIC) {
+ if ((tkColPtr->magic == COLOR_MAGIC) &&
+ (tkColPtr->type == TK_COLOR_BY_NAME)) {
return tkColPtr->hashPtr->key.string;
+ } else {
+ ThreadSpecificData *tsdPtr = (ThreadSpecificData *)
+ Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData));
+ sprintf(tsdPtr->rgbString, "#%04x%04x%04x", colorPtr->red,
+ colorPtr->green, colorPtr->blue);
+ return tsdPtr->rgbString;
}
- sprintf(tsdPtr->rgbString, "#%04x%04x%04x", colorPtr->red,
- colorPtr->green, colorPtr->blue);
- return tsdPtr->rgbString;
}
/*
diff --git a/generic/tkColor.h b/generic/tkColor.h
index 7e1ab3b..fe1c01b 100644
--- a/generic/tkColor.h
+++ b/generic/tkColor.h
@@ -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: tkColor.h,v 1.5 1999/04/16 01:51:12 stanton Exp $
+ * RCS: @(#) $Id: tkColor.h,v 1.5.6.1 1999/11/19 23:35:44 hobbs Exp $
*/
#ifndef _TKCOLOR
@@ -28,6 +28,9 @@
* is a colormap entry allocated for each of these colors.
*/
+#define TK_COLOR_BY_NAME 1
+#define TK_COLOR_BY_VALUE 2
+
#define COLOR_MAGIC ((unsigned int) 0x46140277)
typedef struct TkColor {
@@ -55,8 +58,7 @@ typedef struct TkColor {
* are both 0. */
int objRefCount; /* The number of Tcl objects that reference
* this structure. */
- Tcl_HashTable *tablePtr; /* Hash table that indexes this structure
- * (needed when deleting structure). */
+ int type; /* TK_COLOR_BY_NAME or TK_COLOR_BY_VALUE */
Tcl_HashEntry *hashPtr; /* Pointer to hash table entry for this
* structure. (for use in deleting entry). */
struct TkColor *nextPtr; /* Points to the next TkColor structure with
diff --git a/generic/tkEntry.c b/generic/tkEntry.c
index fd46cb3..937f42f 100644
--- a/generic/tkEntry.c
+++ b/generic/tkEntry.c
@@ -11,7 +11,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tkEntry.c,v 1.5 1999/08/10 05:05:48 jingham Exp $
+ * RCS: @(#) $Id: tkEntry.c,v 1.5.4.1 1999/11/19 23:35:44 hobbs Exp $
*/
#include "tkInt.h"
@@ -1946,7 +1946,7 @@ EntryCmdDeletedProc(clientData)
* destroys the widget.
*/
- if (! entryPtr->flags & ENTRY_DELETED) {
+ if (!(entryPtr->flags & ENTRY_DELETED)) {
Tk_DestroyWindow(entryPtr->tkwin);
}
}