jpayne@69: /* jpayne@69: * tk3d.h -- jpayne@69: * jpayne@69: * Declarations of types and functions shared by the 3d border module. jpayne@69: * jpayne@69: * Copyright (c) 1996-1997 by Sun Microsystems, Inc. jpayne@69: * jpayne@69: * See the file "license.terms" for information on usage and redistribution of jpayne@69: * this file, and for a DISCLAIMER OF ALL WARRANTIES. jpayne@69: */ jpayne@69: jpayne@69: #ifndef _TK3D jpayne@69: #define _TK3D jpayne@69: jpayne@69: #include "tkInt.h" jpayne@69: jpayne@69: /* jpayne@69: * One of the following data structures is allocated for each 3-D border jpayne@69: * currently in use. Structures of this type are indexed by borderTable, so jpayne@69: * that a single structure can be shared for several uses. jpayne@69: */ jpayne@69: jpayne@69: typedef struct TkBorder { jpayne@69: Screen *screen; /* Screen on which the border will be used. */ jpayne@69: Visual *visual; /* Visual for all windows and pixmaps using jpayne@69: * the border. */ jpayne@69: int depth; /* Number of bits per pixel of drawables where jpayne@69: * the border will be used. */ jpayne@69: Colormap colormap; /* Colormap out of which pixels are jpayne@69: * allocated. */ jpayne@69: int resourceRefCount; /* Number of active uses of this color (each jpayne@69: * active use corresponds to a call to jpayne@69: * Tk_Alloc3DBorderFromObj or Tk_Get3DBorder). jpayne@69: * If this count is 0, then this structure is jpayne@69: * no longer valid and it isn't present in jpayne@69: * borderTable: it is being kept around only jpayne@69: * because there are objects referring to it. jpayne@69: * The structure is freed when objRefCount and jpayne@69: * resourceRefCount are both 0. */ jpayne@69: int objRefCount; /* The number of Tcl objects that reference jpayne@69: * this structure. */ jpayne@69: XColor *bgColorPtr; /* Background color (intensity between jpayne@69: * lightColorPtr and darkColorPtr). */ jpayne@69: XColor *darkColorPtr; /* Color for darker areas (must free when jpayne@69: * deleting structure). NULL means shadows jpayne@69: * haven't been allocated yet.*/ jpayne@69: XColor *lightColorPtr; /* Color used for lighter areas of border jpayne@69: * (must free this when deleting structure). jpayne@69: * NULL means shadows haven't been allocated jpayne@69: * yet. */ jpayne@69: Pixmap shadow; /* Stipple pattern to use for drawing shadows jpayne@69: * areas. Used for displays with <= 64 colors jpayne@69: * or where colormap has filled up. */ jpayne@69: GC bgGC; /* Used (if necessary) to draw areas in the jpayne@69: * background color. */ jpayne@69: GC darkGC; /* Used to draw darker parts of the border. jpayne@69: * NULL means the shadow colors haven't been jpayne@69: * allocated yet.*/ jpayne@69: GC lightGC; /* Used to draw lighter parts of the border. jpayne@69: * NULL means the shadow colors haven't been jpayne@69: * allocated yet. */ jpayne@69: Tcl_HashEntry *hashPtr; /* Entry in borderTable (needed in order to jpayne@69: * delete structure). */ jpayne@69: struct TkBorder *nextPtr; /* Points to the next TkBorder structure with jpayne@69: * the same color name. Borders with the same jpayne@69: * name but different screens or colormaps are jpayne@69: * chained together off a single entry in jpayne@69: * borderTable. */ jpayne@69: } TkBorder; jpayne@69: jpayne@69: /* jpayne@69: * Maximum intensity for a color: jpayne@69: */ jpayne@69: jpayne@69: #define MAX_INTENSITY 65535 jpayne@69: jpayne@69: /* jpayne@69: * Declarations for platform specific interfaces used by this module. jpayne@69: */ jpayne@69: jpayne@69: MODULE_SCOPE TkBorder *TkpGetBorder(void); jpayne@69: MODULE_SCOPE void TkpGetShadows(TkBorder *borderPtr, Tk_Window tkwin); jpayne@69: MODULE_SCOPE void TkpFreeBorder(TkBorder *borderPtr); jpayne@69: jpayne@69: #endif /* _TK3D */