tk3d.h 3.0 KB

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