|
/* $Header: /cvsroot/esrg/sfesrg/esrgpcpj/shared/tk_base/tkcolor.h,v 1.1.1.1 2001/06/13 04:58:33 dtashley Exp $ */ |
|
|
|
|
|
/* |
|
|
* tkColor.h -- |
|
|
* |
|
|
* Declarations of data types and functions used by the |
|
|
* Tk color module. |
|
|
* |
|
|
* 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.1.1.1 2001/06/13 04:58:33 dtashley Exp $ |
|
|
*/ |
|
|
|
|
|
#ifndef _TKCOLOR |
|
|
#define _TKCOLOR |
|
|
|
|
|
#include "tkInt.h" |
|
|
|
|
|
#ifdef BUILD_tk |
|
|
# undef TCL_STORAGE_CLASS |
|
|
# define TCL_STORAGE_CLASS DLLEXPORT |
|
|
#endif |
|
|
|
|
|
/* |
|
|
* One of the following data structures is used to keep track of |
|
|
* each color that is being used by the application; typically there |
|
|
* 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 { |
|
|
XColor color; /* Information about this color. */ |
|
|
unsigned int magic; /* Used for quick integrity check on this |
|
|
* structure. Must always have the |
|
|
* value COLOR_MAGIC. */ |
|
|
GC gc; /* Simple gc with this color as foreground |
|
|
* color and all other fields defaulted. |
|
|
* May be None. */ |
|
|
Screen *screen; /* Screen where this color is valid. Used |
|
|
* to delete it, and to find its display. */ |
|
|
Colormap colormap; /* Colormap from which this entry was |
|
|
* allocated. */ |
|
|
Visual *visual; /* Visual associated with colormap. */ |
|
|
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. */ |
|
|
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 |
|
|
* 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; |
|
|
|
|
|
/* |
|
|
* Common APIs exported from all platform-specific implementations. |
|
|
*/ |
|
|
|
|
|
#ifndef TkpFreeColor |
|
|
extern void TkpFreeColor _ANSI_ARGS_((TkColor *tkColPtr)); |
|
|
#endif |
|
|
extern TkColor * TkpGetColor _ANSI_ARGS_((Tk_Window tkwin, |
|
|
Tk_Uid name)); |
|
|
extern TkColor * TkpGetColorByValue _ANSI_ARGS_((Tk_Window tkwin, |
|
|
XColor *colorPtr)); |
|
|
|
|
|
# undef TCL_STORAGE_CLASS |
|
|
# define TCL_STORAGE_CLASS DLLIMPORT |
|
|
|
|
|
#endif /* _TKCOLOR */ |
|
|
|
|
|
|
|
|
/* $History: tkColor.h $ |
|
|
* |
|
|
* ***************** Version 1 ***************** |
|
|
* User: Dtashley Date: 1/02/01 Time: 2:40a |
|
|
* Created in $/IjuScripter, IjuConsole/Source/Tk Base |
|
|
* Initial check-in. |
|
|
*/ |
|
|
|
|
|
/* End of TKCOLOR.H */ |
|
1 |
|
/* $Header$ */ |
2 |
|
|
3 |
|
/* |
4 |
|
* tkColor.h -- |
5 |
|
* |
6 |
|
* Declarations of data types and functions used by the |
7 |
|
* Tk color module. |
8 |
|
* |
9 |
|
* Copyright (c) 1996-1997 by Sun Microsystems, Inc. |
10 |
|
* |
11 |
|
* See the file "license.terms" for information on usage and redistribution |
12 |
|
* of this file, and for a DISCLAIMER OF ALL WARRANTIES. |
13 |
|
* |
14 |
|
* RCS: @(#) $Id: tkcolor.h,v 1.1.1.1 2001/06/13 04:58:33 dtashley Exp $ |
15 |
|
*/ |
16 |
|
|
17 |
|
#ifndef _TKCOLOR |
18 |
|
#define _TKCOLOR |
19 |
|
|
20 |
|
#include "tkInt.h" |
21 |
|
|
22 |
|
#ifdef BUILD_tk |
23 |
|
# undef TCL_STORAGE_CLASS |
24 |
|
# define TCL_STORAGE_CLASS DLLEXPORT |
25 |
|
#endif |
26 |
|
|
27 |
|
/* |
28 |
|
* One of the following data structures is used to keep track of |
29 |
|
* each color that is being used by the application; typically there |
30 |
|
* is a colormap entry allocated for each of these colors. |
31 |
|
*/ |
32 |
|
|
33 |
|
#define TK_COLOR_BY_NAME 1 |
34 |
|
#define TK_COLOR_BY_VALUE 2 |
35 |
|
|
36 |
|
#define COLOR_MAGIC ((unsigned int) 0x46140277) |
37 |
|
|
38 |
|
typedef struct TkColor { |
39 |
|
XColor color; /* Information about this color. */ |
40 |
|
unsigned int magic; /* Used for quick integrity check on this |
41 |
|
* structure. Must always have the |
42 |
|
* value COLOR_MAGIC. */ |
43 |
|
GC gc; /* Simple gc with this color as foreground |
44 |
|
* color and all other fields defaulted. |
45 |
|
* May be None. */ |
46 |
|
Screen *screen; /* Screen where this color is valid. Used |
47 |
|
* to delete it, and to find its display. */ |
48 |
|
Colormap colormap; /* Colormap from which this entry was |
49 |
|
* allocated. */ |
50 |
|
Visual *visual; /* Visual associated with colormap. */ |
51 |
|
int resourceRefCount; /* Number of active uses of this color (each |
52 |
|
* active use corresponds to a call to |
53 |
|
* Tk_AllocColorFromObj or Tk_GetColor). |
54 |
|
* If this count is 0, then this TkColor |
55 |
|
* structure is no longer valid and it isn't |
56 |
|
* present in a hash table: it is being |
57 |
|
* kept around only because there are objects |
58 |
|
* referring to it. The structure is freed |
59 |
|
* when resourceRefCount and objRefCount |
60 |
|
* are both 0. */ |
61 |
|
int objRefCount; /* The number of Tcl objects that reference |
62 |
|
* this structure. */ |
63 |
|
int type; /* TK_COLOR_BY_NAME or TK_COLOR_BY_VALUE */ |
64 |
|
Tcl_HashEntry *hashPtr; /* Pointer to hash table entry for this |
65 |
|
* structure. (for use in deleting entry). */ |
66 |
|
struct TkColor *nextPtr; /* Points to the next TkColor structure with |
67 |
|
* the same color name. Colors with the |
68 |
|
* same name but different screens or |
69 |
|
* colormaps are chained together off a |
70 |
|
* single entry in nameTable. For colors in |
71 |
|
* valueTable (those allocated by |
72 |
|
* Tk_GetColorByValue) this field is always |
73 |
|
* NULL. */ |
74 |
|
} TkColor; |
75 |
|
|
76 |
|
/* |
77 |
|
* Common APIs exported from all platform-specific implementations. |
78 |
|
*/ |
79 |
|
|
80 |
|
#ifndef TkpFreeColor |
81 |
|
extern void TkpFreeColor _ANSI_ARGS_((TkColor *tkColPtr)); |
82 |
|
#endif |
83 |
|
extern TkColor * TkpGetColor _ANSI_ARGS_((Tk_Window tkwin, |
84 |
|
Tk_Uid name)); |
85 |
|
extern TkColor * TkpGetColorByValue _ANSI_ARGS_((Tk_Window tkwin, |
86 |
|
XColor *colorPtr)); |
87 |
|
|
88 |
|
# undef TCL_STORAGE_CLASS |
89 |
|
# define TCL_STORAGE_CLASS DLLIMPORT |
90 |
|
|
91 |
|
#endif /* _TKCOLOR */ |
92 |
|
|
93 |
|
/* End of tkcolor.h */ |