1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236
|
/*
* bltTkInt.h --
*
* Contains copies of internal Tk structures.
*
* Copyright 1993-1998 Lucent Technologies, Inc.
*
* Permission to use, copy, modify, and distribute this software and
* its documentation for any purpose and without fee is hereby
* granted, provided that the above copyright notice appear in all
* copies and that both that the copyright notice and warranty
* disclaimer appear in supporting documentation, and that the names
* of Lucent Technologies any of their entities not be used in
* advertising or publicity pertaining to distribution of the software
* without specific, written prior permission.
*
* Lucent Technologies disclaims all warranties with regard to this
* software, including all implied warranties of merchantability and
* fitness. In no event shall Lucent Technologies be liable for any
* special, indirect or consequential damages or any damages
* whatsoever resulting from loss of use, data or profits, whether in
* an action of contract, negligence or other tortuous action, arising
* out of or in connection with the use or performance of this
* software.
*/
#ifndef _BLT_TKINT_H
#define _BLT_TKINT_H
typedef struct TkFontAttributes {
Tk_Uid family; /* Font family. The most important field. */
int pointsize; /* Pointsize of font, 0 for default size, or
* negative number meaning pixel size. */
int weight; /* Weight flag; see below for def'n. */
int slant; /* Slant flag; see below for def'n. */
int underline; /* Non-zero for underline font. */
int overstrike; /* Non-zero for overstrike font. */
} TkFontAttributes;
typedef struct TkFontMetrics {
int ascent; /* From baseline to top of font. */
int descent; /* From baseline to bottom of font. */
int maxWidth; /* Width of widest character in font. */
int fixed; /* Non-zero if this is a fixed-width font,
* 0 otherwise. */
} TkFontMetrics;
typedef struct TkFont {
/*
* Fields used and maintained exclusively by generic code.
*/
#if (TK_VERSION_NUMBER >= _VERSION(8,1,0))
int resourceRefCount; /* Number of active uses of this font (each
* active use corresponds to a call to
* Tk_AllocFontFromTable or Tk_GetFont).
* If this count is 0, then this TkFont
* 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. */
#else
int refCount; /* Number of users of the TkFont. */
#endif
Tcl_HashEntry *cacheHashPtr;/* Entry in font cache for this structure,
* used when deleting it. */
Tcl_HashEntry *namedHashPtr;/* Pointer to hash table entry that
* corresponds to the named font that the
* tkfont was based on, or NULL if the tkfont
* was not based on a named font. */
#if (TK_VERSION_NUMBER >= _VERSION(8,1,0))
Screen *screen; /* The screen where this font is valid. */
#endif /* TK_VERSION_NUMBER >= 8.1.0 */
int tabWidth; /* Width of tabs in this font (pixels). */
int underlinePos; /* Offset from baseline to origin of
* underline bar (used for drawing underlines
* on a non-underlined font). */
int underlineHeight; /* Height of underline bar (used for drawing
* underlines on a non-underlined font). */
/*
* Fields in the generic font structure that are filled in by
* platform-specific code.
*/
Font fid; /* For backwards compatibility with XGCValues
* structures. Remove when TkGCValues is
* implemented. */
TkFontAttributes fa; /* Actual font attributes obtained when the
* the font was created, as opposed to the
* desired attributes passed in to
* TkpGetFontFromAttributes(). The desired
* metrics can be determined from the string
* that was used to create this font. */
TkFontMetrics fm; /* Font metrics determined when font was
* created. */
#if (TK_VERSION_NUMBER >= _VERSION(8,1,0))
struct TkFont *nextPtr; /* Points to the next TkFont structure with
* the same name. All fonts with the
* same name (but different displays) are
* chained together off a single entry in
* a hash table. */
#endif /* TK_VERSION_NUMBER >= 8.1.0 */
} TkFont;
/*
* This structure is used by the Mac and Window porting layers as
* the internal representation of a clip_mask in a GC.
*/
typedef struct TkRegion_ *TkRegion;
typedef struct TkpClipMask {
int type; /* One of TKP_CLIP_PIXMAP or TKP_CLIP_REGION */
union {
Pixmap pixmap;
TkRegion region;
} value;
} TkpClipMask;
#define TKP_CLIP_PIXMAP 0
#define TKP_CLIP_REGION 1
#ifdef WIN32
/*
* The TkWinDrawable is the internal implementation of an X Drawable (either
* a Window or a Pixmap). The following constants define the valid Drawable
* types.
*/
#define TWD_BITMAP 1
#define TWD_WINDOW 2
#define TWD_WINDC 3
struct TkWindow;
typedef struct {
int type;
HWND handle;
struct TkWindow *winPtr;
} TkWinWindow;
typedef struct {
int type;
HBITMAP handle;
Colormap colormap;
int depth;
} TkWinBitmap;
typedef struct {
int type;
HDC hdc;
} TkWinDC;
typedef union {
int type;
TkWinWindow window;
TkWinBitmap bitmap;
TkWinDC winDC;
} TkWinDrawable;
/*
* The TkWinDCState is used to save the state of a device context
* so that it can be restored later.
*/
typedef struct TkWinDCState {
HPALETTE palette;
} TkWinDCState;
extern HDC TkWinGetDrawableDC(Display *display, Drawable drawable,
TkWinDCState * state);
extern HDC TkWinReleaseDrawableDC(Drawable drawable, HDC dc,
TkWinDCState * state);
extern HWND Tk_GetHWND _ANSI_ARGS_((Window window));
extern HINSTANCE Tk_GetHINSTANCE _ANSI_ARGS_((void));
extern Window Tk_AttachHWND _ANSI_ARGS_((Tk_Window tkwin, HWND hWnd));
#endif /* WIN32 */
/*
* The Border structure used internally by the Tk_3D* routines.
* The following is a copy of it from tk3d.c.
*/
typedef struct {
Screen *screen; /* Screen on which the border will be used. */
Visual *visual; /* Visual for all windows and pixmaps using
* the border. */
int depth; /* Number of bits per pixel of drawables where
* the border will be used. */
Colormap colormap; /* Colormap out of which pixels are
* allocated. */
int refCount; /* Number of different users of
* this border. */
#if (TK_VERSION_NUMBER >= _VERSION(8,1,0))
int objRefCount; /* The number of Tcl objects that reference
* this structure. */
#endif /* TK_VERSION_NUMBER >= 8.1.0 */
XColor *bgColor; /* Background color (intensity between
* lightColorPtr and darkColorPtr). */
XColor *darkColor; /* Color for darker areas (must free when
* deleting structure). NULL means shadows
* haven't been allocated yet.*/
XColor *lightColor; /* Color used for lighter areas of border
* (must free this when deleting structure).
* NULL means shadows haven't been allocated
* yet. */
Pixmap shadow; /* Stipple pattern to use for drawing
* shadows areas. Used for displays with
* <= 64 colors or where colormap has filled
* up. */
GC bgGC; /* Used (if necessary) to draw areas in
* the background color. */
GC darkGC; /* Used to draw darker parts of the
* border. None means the shadow colors
* haven't been allocated yet.*/
GC lightGC; /* Used to draw lighter parts of
* the border. None means the shadow colors
* haven't been allocated yet. */
Tcl_HashEntry *hashPtr; /* Entry in borderTable (needed in
* order to delete structure). */
struct TkBorder *nextPtr; /* Points to the next TkBorder structure with
* the same color name. Borders with the
* same name but different screens or
* colormaps are chained together off a
* single entry in borderTable. */
} TkBorder;
#endif /* BLT_TKINT_H */
|