tkWinInt.h

Go to the documentation of this file.
00001 /*
00002  * tkWinInt.h --
00003  *
00004  *      This file contains declarations that are shared among the
00005  *      Windows-specific parts of Tk, but aren't used by the rest of
00006  *      Tk.
00007  *
00008  * Copyright (c) 1995-1997 Sun Microsystems, Inc.
00009  * Copyright (c) 1998-2000 by Scriptics Corporation.
00010  *
00011  * See the file "license.terms" for information on usage and redistribution
00012  * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
00013  *
00014  * RCS: @(#) $Id: tkWinInt.h,v 1.1 2001/08/18 00:48:57 fmk Exp $
00015  */
00016 
00017 #ifndef _TKWININT
00018 #define _TKWININT
00019 
00020 #ifndef _TKINT
00021 #include "tkInt.h"
00022 #endif
00023 
00024 /*
00025  * Include platform specific public interfaces.
00026  */
00027 
00028 #ifndef _TKWIN
00029 #include "tkWin.h"
00030 #endif
00031 
00032 #ifndef _TKPORT
00033 #include "tkPort.h"
00034 #endif
00035 
00036 
00037 /*
00038  * Define constants missing from older Win32 SDK header files.
00039  */
00040 
00041 #ifndef WS_EX_TOOLWINDOW
00042 #define WS_EX_TOOLWINDOW        0x00000080L 
00043 #endif
00044 
00045 /*
00046  * The TkWinDCState is used to save the state of a device context
00047  * so that it can be restored later.
00048  */
00049 
00050 typedef struct TkWinDCState {
00051     HPALETTE palette;
00052     int bkmode;
00053 } TkWinDCState;
00054 
00055 /*
00056  * The TkWinDrawable is the internal implementation of an X Drawable (either
00057  * a Window or a Pixmap).  The following constants define the valid Drawable
00058  * types.
00059  */
00060 
00061 #define TWD_BITMAP      1
00062 #define TWD_WINDOW      2
00063 #define TWD_WINDC       3
00064 
00065 typedef struct {
00066     int type;
00067     HWND handle;
00068     TkWindow *winPtr;
00069 } TkWinWindow;
00070 
00071 typedef struct {
00072     int type;
00073     HBITMAP handle;
00074     Colormap colormap;
00075     int depth;
00076 } TkWinBitmap;
00077 
00078 typedef struct {
00079     int type;
00080     HDC hdc;
00081 }TkWinDC;
00082 
00083 typedef union {
00084     int type;
00085     TkWinWindow window;
00086     TkWinBitmap bitmap;
00087     TkWinDC winDC;
00088 } TkWinDrawable;
00089 
00090 /*
00091  * The following macros are used to retrieve internal values from a Drawable.
00092  */
00093 
00094 #define TkWinGetHWND(w)         (((TkWinDrawable *) w)->window.handle)
00095 #define TkWinGetWinPtr(w)       (((TkWinDrawable *) w)->window.winPtr)
00096 #define TkWinGetHBITMAP(w)      (((TkWinDrawable *) w)->bitmap.handle)
00097 #define TkWinGetColormap(w)     (((TkWinDrawable *) w)->bitmap.colormap)
00098 #define TkWinGetHDC(w)          (((TkWinDrawable *) w)->winDC.hdc)
00099 
00100 /*
00101  * The following structure is used to encapsulate palette information.
00102  */
00103 
00104 typedef struct {
00105     HPALETTE palette;           /* Palette handle used when drawing. */
00106     UINT size;                  /* Number of entries in the palette. */
00107     int stale;                  /* 1 if palette needs to be realized,
00108                                  * otherwise 0.  If the palette is stale,
00109                                  * then an idle handler is scheduled to
00110                                  * realize the palette. */
00111     Tcl_HashTable refCounts;    /* Hash table of palette entry reference counts
00112                                  * indexed by pixel value. */
00113 } TkWinColormap;
00114 
00115 /*
00116  * The following macro retrieves the Win32 palette from a colormap.
00117  */
00118 
00119 #define TkWinGetPalette(colormap) (((TkWinColormap *) colormap)->palette)
00120 
00121 /*
00122  * The following macros define the class names for Tk Window types.
00123  */
00124 
00125 #define TK_WIN_TOPLEVEL_CLASS_NAME "TkTopLevel"
00126 #define TK_WIN_CHILD_CLASS_NAME "TkChild"
00127 
00128 /*
00129  * The following variable is a translation table between X gc functions and
00130  * Win32 raster op modes.
00131  */
00132 
00133 extern int tkpWinRopModes[];
00134 
00135 /*
00136  * The following defines are used with TkWinGetBorderPixels to get the
00137  * extra 2 border colors from a Tk_3DBorder.
00138  */
00139 
00140 #define TK_3D_LIGHT2 TK_3D_DARK_GC+1
00141 #define TK_3D_DARK2 TK_3D_DARK_GC+2
00142 
00143 /*
00144  * Internal procedures used by more than one source file.
00145  */
00146 
00147 #include "tkIntPlatDecls.h"
00148 
00149 /*
00150  * We need to specially add the TkWinChildProc because of the special
00151  * prototype it has (doesn't fit into stubs schema)
00152  */
00153 #ifdef BUILD_tk
00154 #undef TCL_STORAGE_CLASS
00155 #define TCL_STORAGE_CLASS DLLEXPORT
00156 #endif
00157 
00158 EXTERN LRESULT CALLBACK TkWinChildProc _ANSI_ARGS_((HWND hwnd, UINT message,
00159                             WPARAM wParam, LPARAM lParam));
00160 
00161 /*
00162  * Special proc needed as tsd accessor function between
00163  * tkWinX.c:GenerateXEvent and tkWinClipboard.c:UpdateClipboard
00164  */
00165 EXTERN void     TkWinUpdatingClipboard(int mode);
00166 
00167 #undef TCL_STORAGE_CLASS
00168 #define TCL_STORAGE_CLASS DLLIMPORT
00169 
00170 #endif /* _TKWININT */
00171 

Generated on Mon Oct 23 15:05:30 2006 for OpenSees by doxygen 1.5.0