annotate CSP2/CSP2_env/env-d9b9114564458d9d-741b3de822f2aaca6c6caa4325c4afce/include/tk3d.h @ 69:33d812a61356

planemo upload commit 2e9511a184a1ca667c7be0c6321a36dc4e3d116d
author jpayne
date Tue, 18 Mar 2025 17:55:14 -0400
parents
children
rev   line source
jpayne@69 1 /*
jpayne@69 2 * tk3d.h --
jpayne@69 3 *
jpayne@69 4 * Declarations of types and functions shared by the 3d border module.
jpayne@69 5 *
jpayne@69 6 * Copyright (c) 1996-1997 by Sun Microsystems, Inc.
jpayne@69 7 *
jpayne@69 8 * See the file "license.terms" for information on usage and redistribution of
jpayne@69 9 * this file, and for a DISCLAIMER OF ALL WARRANTIES.
jpayne@69 10 */
jpayne@69 11
jpayne@69 12 #ifndef _TK3D
jpayne@69 13 #define _TK3D
jpayne@69 14
jpayne@69 15 #include "tkInt.h"
jpayne@69 16
jpayne@69 17 /*
jpayne@69 18 * One of the following data structures is allocated for each 3-D border
jpayne@69 19 * currently in use. Structures of this type are indexed by borderTable, so
jpayne@69 20 * that a single structure can be shared for several uses.
jpayne@69 21 */
jpayne@69 22
jpayne@69 23 typedef struct TkBorder {
jpayne@69 24 Screen *screen; /* Screen on which the border will be used. */
jpayne@69 25 Visual *visual; /* Visual for all windows and pixmaps using
jpayne@69 26 * the border. */
jpayne@69 27 int depth; /* Number of bits per pixel of drawables where
jpayne@69 28 * the border will be used. */
jpayne@69 29 Colormap colormap; /* Colormap out of which pixels are
jpayne@69 30 * allocated. */
jpayne@69 31 int resourceRefCount; /* Number of active uses of this color (each
jpayne@69 32 * active use corresponds to a call to
jpayne@69 33 * Tk_Alloc3DBorderFromObj or Tk_Get3DBorder).
jpayne@69 34 * If this count is 0, then this structure is
jpayne@69 35 * no longer valid and it isn't present in
jpayne@69 36 * borderTable: it is being kept around only
jpayne@69 37 * because there are objects referring to it.
jpayne@69 38 * The structure is freed when objRefCount and
jpayne@69 39 * resourceRefCount are both 0. */
jpayne@69 40 int objRefCount; /* The number of Tcl objects that reference
jpayne@69 41 * this structure. */
jpayne@69 42 XColor *bgColorPtr; /* Background color (intensity between
jpayne@69 43 * lightColorPtr and darkColorPtr). */
jpayne@69 44 XColor *darkColorPtr; /* Color for darker areas (must free when
jpayne@69 45 * deleting structure). NULL means shadows
jpayne@69 46 * haven't been allocated yet.*/
jpayne@69 47 XColor *lightColorPtr; /* Color used for lighter areas of border
jpayne@69 48 * (must free this when deleting structure).
jpayne@69 49 * NULL means shadows haven't been allocated
jpayne@69 50 * yet. */
jpayne@69 51 Pixmap shadow; /* Stipple pattern to use for drawing shadows
jpayne@69 52 * areas. Used for displays with <= 64 colors
jpayne@69 53 * or where colormap has filled up. */
jpayne@69 54 GC bgGC; /* Used (if necessary) to draw areas in the
jpayne@69 55 * background color. */
jpayne@69 56 GC darkGC; /* Used to draw darker parts of the border.
jpayne@69 57 * NULL means the shadow colors haven't been
jpayne@69 58 * allocated yet.*/
jpayne@69 59 GC lightGC; /* Used to draw lighter parts of the border.
jpayne@69 60 * NULL means the shadow colors haven't been
jpayne@69 61 * allocated yet. */
jpayne@69 62 Tcl_HashEntry *hashPtr; /* Entry in borderTable (needed in order to
jpayne@69 63 * delete structure). */
jpayne@69 64 struct TkBorder *nextPtr; /* Points to the next TkBorder structure with
jpayne@69 65 * the same color name. Borders with the same
jpayne@69 66 * name but different screens or colormaps are
jpayne@69 67 * chained together off a single entry in
jpayne@69 68 * borderTable. */
jpayne@69 69 } TkBorder;
jpayne@69 70
jpayne@69 71 /*
jpayne@69 72 * Maximum intensity for a color:
jpayne@69 73 */
jpayne@69 74
jpayne@69 75 #define MAX_INTENSITY 65535
jpayne@69 76
jpayne@69 77 /*
jpayne@69 78 * Declarations for platform specific interfaces used by this module.
jpayne@69 79 */
jpayne@69 80
jpayne@69 81 MODULE_SCOPE TkBorder *TkpGetBorder(void);
jpayne@69 82 MODULE_SCOPE void TkpGetShadows(TkBorder *borderPtr, Tk_Window tkwin);
jpayne@69 83 MODULE_SCOPE void TkpFreeBorder(TkBorder *borderPtr);
jpayne@69 84
jpayne@69 85 #endif /* _TK3D */