summaryrefslogtreecommitdiffstats
path: root/generic/tkColor.h
diff options
context:
space:
mode:
Diffstat (limited to 'generic/tkColor.h')
-rw-r--r--generic/tkColor.h29
1 files changed, 24 insertions, 5 deletions
diff --git a/generic/tkColor.h b/generic/tkColor.h
index 8aa2e59..7e1ab3b 100644
--- a/generic/tkColor.h
+++ b/generic/tkColor.h
@@ -4,12 +4,12 @@
* Declarations of data types and functions used by the
* Tk color module.
*
- * Copyright (c) 1996 by Sun Microsystems, Inc.
+ * Copyright (c) 1996-1997 by Sun Microsystems, Inc.
*
* 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.4 1998/09/14 18:23:08 stanton Exp $
+ * RCS: @(#) $Id: tkColor.h,v 1.5 1999/04/16 01:51:12 stanton Exp $
*/
#ifndef _TKCOLOR
@@ -24,8 +24,8 @@
/*
* One of the following data structures is used to keep track of
- * each color that the color module has allocated from the X display
- * server.
+ * each color that is being used by the application; typically there
+ * is a colormap entry allocated for each of these colors.
*/
#define COLOR_MAGIC ((unsigned int) 0x46140277)
@@ -43,11 +43,30 @@ typedef struct TkColor {
Colormap colormap; /* Colormap from which this entry was
* allocated. */
Visual *visual; /* Visual associated with colormap. */
- int refCount; /* Number of uses of this structure. */
+ int resourceRefCount; /* Number of active uses of this color (each
+ * active use corresponds to a call to
+ * Tk_AllocColorFromObj or Tk_GetColor).
+ * If this count is 0, then this TkColor
+ * structure is no longer valid and it isn't
+ * present in a hash table: it is being
+ * kept around only because there are objects
+ * referring to it. The structure is freed
+ * when resourceRefCount and objRefCount
+ * 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). */
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
+ * the same color name. Colors with the
+ * same name but different screens or
+ * colormaps are chained together off a
+ * single entry in nameTable. For colors in
+ * valueTable (those allocated by
+ * Tk_GetColorByValue) this field is always
+ * NULL. */
} TkColor;
/*