ports/181060: x11-toolkits/blt: Fix build with Tcl/Tk 8.6
KATO Tsuguru
tkato432 at yahoo.com
Thu Oct 31 20:40:01 UTC 2013
The following reply was made to PR ports/181060; it has been noted by GNATS.
From: KATO Tsuguru <tkato432 at yahoo.com>
To: bug-followup at FreeBSD.org
Cc:
Subject: Re: ports/181060: x11-toolkits/blt: Fix build with Tcl/Tk 8.6
Date: Fri, 1 Nov 2013 05:30:00 +0900
This is a multi-part message in MIME format.
--Multipart=_Fri__1_Nov_2013_05_30_00_+0900_z4gWL20z9aogO=dd
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Remake of the patch against current tree.
--Multipart=_Fri__1_Nov_2013_05_30_00_+0900_z4gWL20z9aogO=dd
Content-Type: text/x-diff;
name="x11-toolkits_blt.diff"
Content-Disposition: attachment;
filename="x11-toolkits_blt.diff"
Content-Transfer-Encoding: 7bit
diff -urN /usr/ports/x11-toolkits/blt/Makefile x11-toolkits/blt/Makefile
--- /usr/ports/x11-toolkits/blt/Makefile 2013-10-31 15:20:40.000000000 +0900
+++ x11-toolkits/blt/Makefile 2013-11-01 00:00:00.000000000 +0900
@@ -3,43 +3,28 @@
PORTNAME= blt
PORTVERSION= 2.4z
-PORTREVISION= 7
+PORTREVISION= 8
CATEGORIES= x11-toolkits tk
-MASTER_SITES= SF/${PORTNAME}/BLT/BLT%20${PORTVERSION} \
- ftp://ftp.csl.sony.co.jp/pub/kjc/ttt-libs/
+MASTER_SITES= SF/${PORTNAME}/BLT/BLT%20${PORTVERSION}
DISTNAME= BLT${PORTVERSION}
-PATCH_SITES= ${MASTER_SITE_SOURCEFORGE:C/%SUBDIR%/${PORTNAME}\/BLT\/BLT%20${PORTVERSION}/} \
- ftp://ftp.csl.sony.co.jp/pub/kjc/ttt-libs/
+PATCH_SITES= ${MASTER_SITE_SOURCEFORGE:C/%SUBDIR%/${PORTNAME}\/BLT\/BLT%20${PORTVERSION}/}
PATCH_SITE_SUBDIR= ${PORTNAME}
PATCHFILES= blt2.4z-patch-2
-PATCH_DIST_STRIP=-p1
+PATCH_DIST_STRIP= -p1
MAINTAINER= ports at FreeBSD.org
-COMMENT= Extension for the Tk toolkit (with shared libs)
+COMMENT= Tk extension (with shared libs)
-LIB_DEPENDS= libjpeg.so:${PORTSDIR}/graphics/jpeg
-
-USE_LDCONFIG= yes
-USE_AUTOTOOLS= libtool
+LICENSE= BSD
-WRKSRC= ${WRKDIR}/blt2.4z
-GNU_CONFIGURE= yes
-CFLAGS+= -Wall -Wno-uninitialized
-CFLAGS+= -I${TK_INCLUDEDIR}/generic -I${TK_INCLUDEDIR}/unix
-
-USES+= tk:84,85
-USE_XORG= x11
+LIB_DEPENDS= libjpeg.so:${PORTSDIR}/graphics/jpeg
-post-patch:
- ${FIND} ${WRKSRC} -name Makefile.in | ${XARGS} \
- ${REINPLACE_CMD} -e '/^INSTALL_ROOT/s|$$|$${DESTDIR}|'
+WRKSRC= ${WRKDIR}/${PORTNAME}${PORTVERSION}
-post-install:
- ${LN} -sf libBLT24.so.3 ${STAGEDIR}${PREFIX}/lib/libBLT24.so
- ${LN} -sf libBLTlite24.so.3 ${STAGEDIR}${PREFIX}/lib/libBLTlite24.so
-
-CONFIGURE_ARGS+=--exec_prefix=${PREFIX} \
+USES= tk
+USE_AUTOTOOLS= libtool
+CONFIGURE_ARGS= --exec_prefix=${PREFIX} \
--enable-jpeg=${LOCALBASE} \
--with-tcl=${TCL_LIBDIR} \
--with-tk=${TK_LIBDIR} \
@@ -47,5 +32,14 @@
--with-tklibs=${LOCALBASE}/lib/ \
--with-tclincls=${TCL_INCLUDEDIR} \
--with-tkincls=${TK_INCLUDEDIR}
+MAKE_ARGS= INSTALL_ROOT=${STAGEDIR} INSTALL_DIR=${STAGEDIR}
+USE_LDCONFIG= yes
+
+CFLAGS+= -Wall -Wno-uninitialized
+CFLAGS+= -I${TK_INCLUDEDIR}/generic -I${TK_INCLUDEDIR}/unix
+
+post-install:
+ ${LN} -sf libBLT24.so.3 ${STAGEDIR}${PREFIX}/lib/libBLT24.so
+ ${LN} -sf libBLTlite24.so.3 ${STAGEDIR}${PREFIX}/lib/libBLTlite24.so
.include <bsd.port.mk>
diff -urN /usr/ports/x11-toolkits/blt/files/patch-Makefile.in x11-toolkits/blt/files/patch-Makefile.in
--- /usr/ports/x11-toolkits/blt/files/patch-Makefile.in 2013-10-31 15:20:40.000000000 +0900
+++ x11-toolkits/blt/files/patch-Makefile.in 2013-11-01 00:00:00.000000000 +0900
@@ -1,12 +1,11 @@
---- Makefile.in.orig 2013-10-30 13:46:13.000000000 +0100
-+++ Makefile.in 2013-10-30 13:46:28.000000000 +0100
-@@ -47,9 +47,6 @@
+--- Makefile.in.orig
++++ Makefile.in
+@@ -45,7 +45,7 @@
+ install-all:
+ (cd src; $(MAKE) install)
(cd library; $(MAKE) install)
- (cd man; $(MAKE) install)
+- (cd man; $(MAKE) install)
++## (cd man; $(MAKE) install)
(cd demos; $(MAKE) install)
-- $(INSTALL_DATA) $(srcdir)/README $(INSTALL_DIR)$(scriptdir)
-- $(INSTALL_DATA) $(srcdir)/PROBLEMS $(INSTALL_DIR)$(scriptdir)
-- $(INSTALL_DATA) $(srcdir)/NEWS $(INSTALL_DIR)$(scriptdir)
-
- mkdirs:
- @for i in $(instdirs) ; do \
+ $(INSTALL_DATA) $(srcdir)/README $(INSTALL_DIR)$(scriptdir)
+ $(INSTALL_DATA) $(srcdir)/PROBLEMS $(INSTALL_DIR)$(scriptdir)
diff -urN /usr/ports/x11-toolkits/blt/files/patch-aa x11-toolkits/blt/files/patch-aa
--- /usr/ports/x11-toolkits/blt/files/patch-aa 2013-06-21 03:54:39.000000000 +0900
+++ x11-toolkits/blt/files/patch-aa 1970-01-01 09:00:00.000000000 +0900
@@ -1,55 +0,0 @@
---- configure.orig Fri Oct 4 13:33:59 2002
-+++ configure Tue Feb 13 16:39:48 2007
-@@ -1202,7 +1202,7 @@
- #
- # 1. command line (--with-cflags)
- # 2. cached variable ($blt_cv_prog_cflags)
--# 3. set to "-O6" if using gcc ($blt_have_gcc)
-+# 3. set to "-O2" if using gcc ($blt_have_gcc)
- # 4. otherwise, default to "-O"
- #
- echo $ac_n "checking default compiler flags""... $ac_c" 1>&6
-@@ -1212,7 +1212,7 @@
- elif test "x${blt_cv_prog_cflags}" != "x" ; then
- CFLAGS=${blt_cv_prog_cflags}
- elif test "${blt_have_gcc}" = "yes" ; then
-- CFLAGS=-O6
-+ CFLAGS=-O2
- else
- CFLAGS=-O
- fi
-@@ -3197,6 +3197,7 @@
- if test "x$tcl_config_sh" = "x" ; then
- for dir in \
- `ls -dr /usr/local/tcl/tcl[7-9].[0-9]* 2>/dev/null` \
-+ `ls -dr /usr/local/lib/tcl[7-9].[0-9]* 2>/dev/null` \
- /usr/local/tcl \
- /usr/local \
- /usr
-@@ -3295,6 +3296,7 @@
- if test "x$tk_config_sh" = "x" ; then
- for dir in \
- `ls -dr /usr/local/tcl/tcl[7-9].[0-9]* 2>/dev/null` \
-+ `ls -dr /usr/local/lib/tk[7-9].[0-9]* 2>/dev/null` \
- /usr/local/tcl \
- /usr/local \
- ${x_libraries} \
-@@ -3379,7 +3381,7 @@
- fi
-
- case $target in
-- *-sunos4*|*-*-netbsd|NetBSD-*|FreeBSD-*|OpenBSD-*|*-*-cygwin*|*-*-mingw*)
-+ *-sunos4*|*-*-netbsd|NetBSD-*|*-*-freebsd*|OpenBSD-*|*-*-cygwin*|*-*-mingw*)
- TCL_LIB_NAME="tcl${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}"
- TK_LIB_NAME="tk${TK_MAJOR_VERSION}${TK_MINOR_VERSION}"
- ;;
-@@ -4111,7 +4113,8 @@
- if test "$test_ok" = yes; then
- SHLIB_CFLAGS="-fpic"
- SHLIB_LD="ld"
-- SHLIB_LD_FLAGS="-Bshareable -x"
-+ SHLIB_LD_FLAGS="-Bshareable -x -soname \$@"
-+ SHLIB_SUFFIX=".so.3"
- fi
- ;;
-
diff -urN /usr/ports/x11-toolkits/blt/files/patch-ab x11-toolkits/blt/files/patch-ab
--- /usr/ports/x11-toolkits/blt/files/patch-ab 2013-06-21 03:54:39.000000000 +0900
+++ x11-toolkits/blt/files/patch-ab 1970-01-01 09:00:00.000000000 +0900
@@ -1,24 +0,0 @@
---- src/bltTree.c.orig Sun Sep 29 07:44:12 2002
-+++ src/bltTree.c Mon Oct 13 13:16:45 2003
-@@ -96,16 +96,16 @@
-
- #define REBUILD_MULTIPLIER 3
-
--#if (SIZEOF_VOID_P == 8)
--#define RANDOM_INDEX(i) HashOneWord(mask, downshift, i)
--#define BITSPERWORD 64
--#else
--
- #define START_LOGSIZE 5 /* Initial hash table size is 32. */
- #define MAX_LIST_VALUES 20 /* Convert to hash table when node
- * value list gets bigger than this
- * many values. */
-
-+
-+#if (SIZEOF_VOID_P == 8)
-+#define RANDOM_INDEX(i) HashOneWord(mask, downshift, i)
-+#define BITSPERWORD 64
-+#else
- /*
- * The following macro takes a preliminary integer hash value and
- * produces an index into a hash tables bucket list. The idea is
diff -urN /usr/ports/x11-toolkits/blt/files/patch-ac x11-toolkits/blt/files/patch-ac
--- /usr/ports/x11-toolkits/blt/files/patch-ac 2013-06-21 03:54:39.000000000 +0900
+++ x11-toolkits/blt/files/patch-ac 1970-01-01 09:00:00.000000000 +0900
@@ -1,11 +0,0 @@
---- Makefile.in.orig Wed Feb 23 18:28:23 2005
-+++ Makefile.in Wed Feb 23 18:32:19 2005
-@@ -45,7 +45,7 @@
- install-all:
- (cd src; $(MAKE) install)
- (cd library; $(MAKE) install)
-- (cd man; $(MAKE) install)
-+## (cd man; $(MAKE) install)
- (cd demos; $(MAKE) install)
- $(INSTALL_DATA) $(srcdir)/README $(INSTALL_DIR)$(scriptdir)
- $(INSTALL_DATA) $(srcdir)/PROBLEMS $(INSTALL_DIR)$(scriptdir)
diff -urN /usr/ports/x11-toolkits/blt/files/patch-configure x11-toolkits/blt/files/patch-configure
--- /usr/ports/x11-toolkits/blt/files/patch-configure 1970-01-01 09:00:00.000000000 +0900
+++ x11-toolkits/blt/files/patch-configure 2013-11-01 00:00:00.000000000 +0900
@@ -0,0 +1,55 @@
+--- configure.orig
++++ configure
+@@ -1202,7 +1202,7 @@
+ #
+ # 1. command line (--with-cflags)
+ # 2. cached variable ($blt_cv_prog_cflags)
+-# 3. set to "-O6" if using gcc ($blt_have_gcc)
++# 3. set to "-O2" if using gcc ($blt_have_gcc)
+ # 4. otherwise, default to "-O"
+ #
+ echo $ac_n "checking default compiler flags""... $ac_c" 1>&6
+@@ -1212,7 +1212,7 @@
+ elif test "x${blt_cv_prog_cflags}" != "x" ; then
+ CFLAGS=${blt_cv_prog_cflags}
+ elif test "${blt_have_gcc}" = "yes" ; then
+- CFLAGS=-O6
++ CFLAGS=-O2
+ else
+ CFLAGS=-O
+ fi
+@@ -3197,6 +3197,7 @@
+ if test "x$tcl_config_sh" = "x" ; then
+ for dir in \
+ `ls -dr /usr/local/tcl/tcl[7-9].[0-9]* 2>/dev/null` \
++ `ls -dr /usr/local/lib/tcl[7-9].[0-9]* 2>/dev/null` \
+ /usr/local/tcl \
+ /usr/local \
+ /usr
+@@ -3295,6 +3296,7 @@
+ if test "x$tk_config_sh" = "x" ; then
+ for dir in \
+ `ls -dr /usr/local/tcl/tcl[7-9].[0-9]* 2>/dev/null` \
++ `ls -dr /usr/local/lib/tk[7-9].[0-9]* 2>/dev/null` \
+ /usr/local/tcl \
+ /usr/local \
+ ${x_libraries} \
+@@ -3379,7 +3381,7 @@
+ fi
+
+ case $target in
+- *-sunos4*|*-*-netbsd|NetBSD-*|FreeBSD-*|OpenBSD-*|*-*-cygwin*|*-*-mingw*)
++ *-sunos4*|*-*-netbsd|NetBSD-*|*-*-freebsd*|OpenBSD-*|*-*-cygwin*|*-*-mingw*)
+ TCL_LIB_NAME="tcl${TCL_MAJOR_VERSION}${TCL_MINOR_VERSION}"
+ TK_LIB_NAME="tk${TK_MAJOR_VERSION}${TK_MINOR_VERSION}"
+ ;;
+@@ -4111,7 +4113,8 @@
+ if test "$test_ok" = yes; then
+ SHLIB_CFLAGS="-fpic"
+ SHLIB_LD="ld"
+- SHLIB_LD_FLAGS="-Bshareable -x"
++ SHLIB_LD_FLAGS="-Bshareable -x -soname \$@"
++ SHLIB_SUFFIX=".so.3"
+ fi
+ ;;
+
diff -urN /usr/ports/x11-toolkits/blt/files/patch-newertcl x11-toolkits/blt/files/patch-newertcl
--- /usr/ports/x11-toolkits/blt/files/patch-newertcl 2013-06-21 03:54:39.000000000 +0900
+++ x11-toolkits/blt/files/patch-newertcl 1970-01-01 09:00:00.000000000 +0900
@@ -1,186 +0,0 @@
---- src/bltNsUtil.h 2002-07-18 02:35:32.000000000 -0400
-+++ src/bltNsUtil.h 2010-01-16 11:39:20.000000000 -0500
-@@ -47,7 +47,8 @@
- #endif
-
--
-+#if TCL_MAJOR_VERSION < 8 || TCL_MINOR_VERSION < 5
- EXTERN Tcl_Command Tcl_FindCommand _ANSI_ARGS_((Tcl_Interp *interp,
- char *name, Tcl_Namespace *nsPtr, int flags));
-+#endif
-
- #define NS_SEARCH_NONE (0)
-@@ -64,15 +65,19 @@
- EXTERN Tcl_Namespace *Tcl_GetGlobalNamespace _ANSI_ARGS_((Tcl_Interp *interp));
-
--#if (TCL_MAJOR_VERSION >= 8)
-+#if TCL_MAJOR_VERSION == 8
-+# if TCL_MINOR_VERSION < 5
- EXTERN Tcl_Namespace *Tcl_CreateNamespace _ANSI_ARGS_((Tcl_Interp *interp,
-- char *name, ClientData clientData, Tcl_NamespaceDeleteProc *nsDelProc));
--
--EXTERN void Tcl_DeleteNamespace _ANSI_ARGS_((Tcl_Namespace *nsPtr));
-+ const char *name, ClientData clientData,
-+ Tcl_NamespaceDeleteProc *nsDelProc));
-
- EXTERN Tcl_Namespace *Tcl_FindNamespace _ANSI_ARGS_((Tcl_Interp *interp,
-- char *name, Tcl_Namespace *context, int flags));
-+ const char *name, Tcl_Namespace *context, int flags));
-+
-+EXTERN int Tcl_Export _ANSI_ARGS_((Tcl_Interp *interp,
-+ Tcl_Namespace *nsPtr,
-+ const char *pattern, int resetFlag));
-+# endif
-
--EXTERN int Tcl_Export _ANSI_ARGS_((Tcl_Interp *interp, Tcl_Namespace *nsPtr,
-- char *name, int resetFlag));
-+EXTERN void Tcl_DeleteNamespace _ANSI_ARGS_((Tcl_Namespace *nsPtr));
-
- EXTERN Tcl_Var Tcl_FindNamespaceVar _ANSI_ARGS_((Tcl_Interp *interp, char *name,
-@@ -87,5 +92,5 @@
- Tcl_Interp *interp, CONST char *varName, int flags));
-
--#endif /* TCL_MAJOR_VERSION >= 8 */
-+#endif /* TCL_MAJOR_VERSION == 8 */
-
-
---- src/bltCanvEps.c 2002-08-15 01:22:10.000000000 -0400
-+++ src/bltCanvEps.c 2010-01-16 23:36:39.000000000 -0500
-@@ -324,5 +324,5 @@
- int width, int height, int imgWidth, int imgHeight));
- static int EpsCoords _ANSI_ARGS_((Tcl_Interp *interp, Tk_Canvas canvas,
-- Tk_Item * itemPtr, int argc, char **argv));
-+ Tk_Item * itemPtr, int argc, Tcl_Obj * const objv[]));
- static int EpsToArea _ANSI_ARGS_((Tk_Canvas canvas, Tk_Item * itemPtr,
- double *rectPtr));
-@@ -331,7 +331,7 @@
- static void ComputeEpsBbox _ANSI_ARGS_((Tk_Canvas canvas, EpsItem *imgPtr));
- static int ConfigureEps _ANSI_ARGS_((Tcl_Interp *interp, Tk_Canvas canvas,
-- Tk_Item * itemPtr, int argc, char **argv, int flags));
-+ Tk_Item * itemPtr, int argc, Tcl_Obj * const objv[], int flags));
- static int CreateEps _ANSI_ARGS_((Tcl_Interp *interp, Tk_Canvas canvas,
-- struct Tk_Item * itemPtr, int argc, char **argv));
-+ struct Tk_Item * itemPtr, int argc, Tcl_Obj * const objv[]));
- static void DeleteEps _ANSI_ARGS_((Tk_Canvas canvas, Tk_Item * itemPtr,
- Display *display));
-@@ -916,5 +916,5 @@
- */
- static int
--CreateEps(interp, canvas, itemPtr, argc, argv)
-+CreateEps(interp, canvas, itemPtr, argc, objv)
- Tcl_Interp *interp; /* Interpreter for error reporting. */
- Tk_Canvas canvas; /* Canvas to hold new item. */
-@@ -922,5 +922,5 @@
- * has been initialized by caller. */
- int argc; /* Number of arguments in argv. */
-- char **argv; /* Arguments describing rectangle. */
-+ Tcl_Obj * const objv[]; /* Arguments describing rectangle. */
- {
- EpsItem *epsPtr = (EpsItem *)itemPtr;
-@@ -972,10 +972,9 @@
- * Process the arguments to fill in the item record.
- */
--
-- if ((Tk_CanvasGetCoord(interp, canvas, argv[0], &(epsPtr->x)) != TCL_OK) ||
-- (Tk_CanvasGetCoord(interp, canvas, argv[1], &(epsPtr->y)) != TCL_OK)) {
-+ if ((Tk_CanvasGetCoord(interp, canvas, Tcl_GetString(objv[0]), &(epsPtr->x)) != TCL_OK) ||
-+ (Tk_CanvasGetCoord(interp, canvas, Tcl_GetString(objv[1]), &(epsPtr->y)) != TCL_OK)) {
- return TCL_ERROR;
- }
-- if (ConfigureEps(interp, canvas, itemPtr, argc - 2, argv + 2, 0)
-+ if (ConfigureEps(interp, canvas, itemPtr, argc - 2, objv + 2, 0)
- != TCL_OK) {
- DeleteEps(canvas, itemPtr, Tk_Display(tkwin));
-@@ -1039,10 +1038,10 @@
- */
- static int
--ConfigureEps(interp, canvas, itemPtr, argc, argv, flags)
-+ConfigureEps(interp, canvas, itemPtr, argc, objv, flags)
- Tcl_Interp *interp; /* Used for error reporting. */
- Tk_Canvas canvas; /* Canvas containing itemPtr. */
- Tk_Item *itemPtr; /* EPS item to reconfigure. */
- int argc; /* Number of elements in argv. */
-- char **argv; /* Arguments describing things to configure. */
-+ Tcl_Obj * const objv[]; /* Arguments describing things to configure. */
- int flags; /* Flags to pass to Tk_ConfigureWidget. */
- {
-@@ -1053,4 +1052,9 @@
- GC newGC;
- int width, height;
-+ char *argv[argc];
-+ int i;
-+
-+ for (i = 0; i < argc; i++)
-+ argv[i] = Tcl_GetString(objv[i]);
-
- tkwin = Tk_CanvasTkwin(canvas);
-@@ -1193,5 +1197,5 @@
- */
- static int
--EpsCoords(interp, canvas, itemPtr, argc, argv)
-+EpsCoords(interp, canvas, itemPtr, argc, objv)
- Tcl_Interp *interp; /* Used for error reporting. */
- Tk_Canvas canvas; /* Canvas containing item. */
-@@ -1200,5 +1204,5 @@
- int argc; /* Number of coordinates supplied in
- * argv. */
-- char **argv; /* Array of coordinates: x1, y1,
-+ Tcl_Obj * const objv[]; /* Array of coordinates: x1, y1,
- * x2, y2, ... */
- {
-@@ -1213,6 +1217,6 @@
- double x, y; /* Don't overwrite old coordinates on errors */
-
-- if ((Tk_CanvasGetCoord(interp, canvas, argv[0], &x) != TCL_OK) ||
-- (Tk_CanvasGetCoord(interp, canvas, argv[1], &y) != TCL_OK)) {
-+ if ((Tk_CanvasGetCoord(interp, canvas, Tcl_GetString(objv[0]), &x) != TCL_OK) ||
-+ (Tk_CanvasGetCoord(interp, canvas, Tcl_GetString(objv[1]), &y) != TCL_OK)) {
- return TCL_ERROR;
- }
-@@ -1714,5 +1718,5 @@
- Tk_CreateItemType(&epsItemType);
- /* Initialize custom canvas option routines. */
-- tagsOption.parseProc = Tk_CanvasTagsParseProc;
-+ tagsOption.parseProc = (Tk_OptionParseProc *)Tk_CanvasTagsParseProc;
- tagsOption.printProc = Tk_CanvasTagsPrintProc;
- }
-
-The problem, that these two hunks seem to solve is mentioned by other
-people, but no solution is offered anywhere.
-
- http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=524149#44
-
-These hunks do seem to fix things, but don't seem right anyway...
-
---- src/bltHtext.c 2002-07-17 05:56:00.000000000 -0400
-+++ src/bltHtext.c 2010-01-23 23:42:09.000000000 -0500
-@@ -3348,5 +3348,5 @@
- * the text.
- */
-- if ((htPtr->first != oldFirst) || (htPtr->last != oldLast)) {
-+ if (htPtr->lineArr && ((htPtr->first != oldFirst) || (htPtr->last != oldLast))) {
- int offset;
- int i;
-@@ -3377,5 +3377,6 @@
- }
- }
-- DrawPage(htPtr, deltaY);
-+ if (htPtr->lineArr)
-+ DrawPage(htPtr, deltaY);
- SendBogusEvent(tkwin);
-
-
-The patch below is obtained from RedHat
- https://bugzilla.redhat.com/show_bug.cgi?id=504388
-When the problem in Tk-8.5 is fixed, the below work-around
-can be removed from BLT.
-
---- src/bltText.c 2002-08-13 15:45:20.000000000 -0400
-+++ src/bltText.c 2010-01-23 20:35:29.000000000 -0500
-@@ -49,5 +49,5 @@
- fragPtr = textPtr->fragArr;
- for (i = 0; i < textPtr->nFrags; i++, fragPtr++) {
--#if HAVE_UTF
-+#if HAVE_UTF && (TCL_VERSION_NUMBER < _VERSION(8,5,0))
- Tk_DrawChars(display, drawable, gc, font, fragPtr->text,
- fragPtr->count, x + fragPtr->x, y + fragPtr->y);
diff -urN /usr/ports/x11-toolkits/blt/files/patch-parabuild x11-toolkits/blt/files/patch-parabuild
--- /usr/ports/x11-toolkits/blt/files/patch-parabuild 2013-06-21 03:54:39.000000000 +0900
+++ x11-toolkits/blt/files/patch-parabuild 1970-01-01 09:00:00.000000000 +0900
@@ -1,38 +0,0 @@
---- src/Makefile.in 2002-07-15 05:31:29.000000000 -0400
-+++ src/Makefile.in 2010-01-24 14:08:54.000000000 -0500
-@@ -182,7 +182,7 @@
- $(tcl_only_lib_a): $(TCL_ONLY_OBJS) $(srcdir)/bltInit.c
- $(CC) -c $(CC_SWITCHES) -DTCL_ONLY -DBLT_LIBRARY=\"$(BLT_LIBRARY)\" \
-- $(srcdir)/bltInit.c
-+ $(srcdir)/bltInit.c -o bltInitTclOnly.o
- $(RM) $@
-- $(AR) $@ $(TCL_ONLY_OBJS) bltInit.o
-+ $(AR) $@ $(TCL_ONLY_OBJS) bltInitTclOnly.o
- $(RANLIB) $@
-
-@@ -225,5 +225,5 @@
-
- clean:
-- $(RM) $(OBJS) bltInit.o $(lib_a) $(tcl_only_lib_a) \
-+ $(RM) $(OBJS) bltInit.o bltInitTclOnly.o $(lib_a) $(tcl_only_lib_a) \
- $(bltsh)* $(bltwish)* *pure* .pure*
- (cd shared; $(MAKE) clean)
---- src/shared/Makefile.in 2002-05-14 17:37:19.000000000 -0400
-+++ src/shared/Makefile.in 2010-01-24 14:10:10.000000000 -0500
-@@ -150,7 +150,7 @@
- $(tcl_only_lib_so): $(TCL_ONLY_OBJS)
- $(CC) -c $(CC_SWITCHES) -DTCL_ONLY -DBLT_LIBRARY=\"$(scriptdir)\" \
-- $(srcdir)/bltInit.c
-+ $(srcdir)/bltInit.c -o bltInitTclOnly.o
- $(RM) $@
-- $(SHLIB_LD) $(SHLIB_LD_FLAGS) -o $@ bltInit.o $(TCL_ONLY_OBJS) \
-+ $(SHLIB_LD) $(SHLIB_LD_FLAGS) -o $@ bltInitTclOnly.o $(TCL_ONLY_OBJS) \
- $(SHLIB_TCL_ONLY_LIB_SPECS)
-
-@@ -176,5 +176,5 @@
- clean:
- $(RM) $(OBJS) $(lib_so) $(tcl_only_lib_so) $(bltwish) $(bltsh) \
-- *pure* .pure*
-+ *pure* .pure* bltInit.o bltInitTclOnly.o
-
- distclean: clean
diff -urN /usr/ports/x11-toolkits/blt/files/patch-src-shared-Makefile.in x11-toolkits/blt/files/patch-src-shared-Makefile.in
--- /usr/ports/x11-toolkits/blt/files/patch-src-shared-Makefile.in 2013-06-21 03:54:39.000000000 +0900
+++ x11-toolkits/blt/files/patch-src-shared-Makefile.in 2013-11-01 00:00:00.000000000 +0900
@@ -10,3 +10,24 @@
SHLIB_TCL_ONLY_LIB_SPECS = @SHLIB_TCL_ONLY_LIB_SPECS@
SHLIB_LIB_SPECS = @SHLIB_LIB_SPECS@
SHLIB_LD = @SHLIB_LD@
+@@ -149,9 +149,9 @@
+
+ $(tcl_only_lib_so): $(TCL_ONLY_OBJS)
+ $(CC) -c $(CC_SWITCHES) -DTCL_ONLY -DBLT_LIBRARY=\"$(scriptdir)\" \
+- $(srcdir)/bltInit.c
++ $(srcdir)/bltInit.c -o bltInitTclOnly.o
+ $(RM) $@
+- $(SHLIB_LD) $(SHLIB_LD_FLAGS) -o $@ bltInit.o $(TCL_ONLY_OBJS) \
++ $(SHLIB_LD) $(SHLIB_LD_FLAGS) -o $@ bltInitTclOnly.o $(TCL_ONLY_OBJS) \
+ $(SHLIB_TCL_ONLY_LIB_SPECS)
+
+ install: mkdirs install-lib install-demo
+@@ -175,7 +175,7 @@
+ done
+ clean:
+ $(RM) $(OBJS) $(lib_so) $(tcl_only_lib_so) $(bltwish) $(bltsh) \
+- *pure* .pure*
++ *pure* .pure* bltInit.o bltInitTclOnly.o
+
+ distclean: clean
+ $(RM) $(srcdir)/*.bak $(srcdir)/*\~ $(srcdir)/"#"*
diff -urN /usr/ports/x11-toolkits/blt/files/patch-src__Makefile.in x11-toolkits/blt/files/patch-src__Makefile.in
--- /usr/ports/x11-toolkits/blt/files/patch-src__Makefile.in 1970-01-01 09:00:00.000000000 +0900
+++ x11-toolkits/blt/files/patch-src__Makefile.in 2013-11-01 00:00:00.000000000 +0900
@@ -0,0 +1,23 @@
+--- src/Makefile.in.orig
++++ src/Makefile.in
+@@ -181,9 +181,9 @@
+
+ $(tcl_only_lib_a): $(TCL_ONLY_OBJS) $(srcdir)/bltInit.c
+ $(CC) -c $(CC_SWITCHES) -DTCL_ONLY -DBLT_LIBRARY=\"$(BLT_LIBRARY)\" \
+- $(srcdir)/bltInit.c
++ $(srcdir)/bltInit.c -o bltInitTclOnly.o
+ $(RM) $@
+- $(AR) $@ $(TCL_ONLY_OBJS) bltInit.o
++ $(AR) $@ $(TCL_ONLY_OBJS) bltInitTclOnly.o
+ $(RANLIB) $@
+
+ install: mkdirs install-lib install-demo install-headers
+@@ -224,7 +224,7 @@
+ $(XREF) $(XREFFLAGS) $(DEFINES) $(INCLUDES) $(SRCS)
+
+ clean:
+- $(RM) $(OBJS) bltInit.o $(lib_a) $(tcl_only_lib_a) \
++ $(RM) $(OBJS) bltInit.o bltInitTclOnly.o $(lib_a) $(tcl_only_lib_a) \
+ $(bltsh)* $(bltwish)* *pure* .pure*
+ (cd shared; $(MAKE) clean)
+
diff -urN /usr/ports/x11-toolkits/blt/files/patch-src__blt.h x11-toolkits/blt/files/patch-src__blt.h
--- /usr/ports/x11-toolkits/blt/files/patch-src__blt.h 1970-01-01 09:00:00.000000000 +0900
+++ x11-toolkits/blt/files/patch-src__blt.h 2013-11-01 00:00:00.000000000 +0900
@@ -0,0 +1,14 @@
+--- src/blt.h.orig
++++ src/blt.h
+@@ -55,9 +55,9 @@
+
+ typedef char *Blt_Uid;
+
+-EXTERN Blt_Uid Blt_GetUid _ANSI_ARGS_((char *string));
++EXTERN Blt_Uid Blt_GetUid _ANSI_ARGS_((const char *string));
+ EXTERN void Blt_FreeUid _ANSI_ARGS_((Blt_Uid uid));
+-EXTERN Blt_Uid Blt_FindUid _ANSI_ARGS_((char *string));
++EXTERN Blt_Uid Blt_FindUid _ANSI_ARGS_((const char *string));
+
+ #if (TCL_MAJOR_VERSION >= 8)
+ EXTERN int Blt_GetArrayFromObj _ANSI_ARGS_((Tcl_Interp *interp,
diff -urN /usr/ports/x11-toolkits/blt/files/patch-src__bltBgexec.c x11-toolkits/blt/files/patch-src__bltBgexec.c
--- /usr/ports/x11-toolkits/blt/files/patch-src__bltBgexec.c 1970-01-01 09:00:00.000000000 +0900
+++ x11-toolkits/blt/files/patch-src__bltBgexec.c 2013-11-01 00:00:00.000000000 +0900
@@ -0,0 +1,74 @@
+--- src/bltBgexec.c.orig
++++ src/bltBgexec.c
+@@ -55,7 +55,7 @@
+ HANDLE hProcess;
+ } Process;
+ #else
+-typedef int Process;
++typedef pid_t Process;
+ #endif
+
+ #if (TCL_VERSION_NUMBER < _VERSION(8,1,0))
+@@ -124,7 +124,7 @@
+
+ typedef struct {
+ int number;
+- char *name;
++ const char *name;
+ } SignalId;
+
+ static SignalId signalIds[] =
+@@ -645,7 +645,7 @@
+ sinkPtr->name = name;
+ sinkPtr->echo = FALSE;
+ sinkPtr->fd = -1;
+- sinkPtr->file = (Tcl_File)NULL;
++ sinkPtr->file = 0;
+ sinkPtr->byteArr = sinkPtr->staticSpace;
+ sinkPtr->size = DEF_BUFFER_SIZE;
+ sinkPtr->encoding = encoding;
+@@ -703,7 +703,7 @@
+ Blt_Free(sinkPtr->byteArr);
+ }
+ sinkPtr->fd = -1;
+- sinkPtr->file = (Tcl_File)NULL;
++ sinkPtr->file = 0;
+ #if (TCL_MAJOR_VERSION >= 8)
+ if (sinkPtr->objv != NULL) {
+ register int i;
+@@ -855,7 +855,7 @@
+ #else
+ Tcl_DeleteFileHandler(sinkPtr->fd);
+ #endif
+- sinkPtr->file = (Tcl_File)NULL;
++ sinkPtr->file = 0;
+ sinkPtr->fd = -1;
+
+ #if WINDEBUG
+@@ -1072,7 +1072,7 @@
+ #endif
+ timeout = (flags & WNOHANG) ? 0 : INFINITE;
+ status = WaitForSingleObject(child.hProcess, timeout);
+-
++
+ #if WINDEBUG
+ PurifyPrintf("WAITPID: wait status is %d\n", status);
+ #endif
+@@ -1309,7 +1309,7 @@
+ if ((sinkPtr->mark > sinkPtr->lastMark) &&
+ (sinkPtr->flags & SINK_NOTIFY)) {
+ unsigned char *data;
+- int length;
++ int length = 0;
+
+ if (sinkPtr->flags & SINK_BUFFERED) {
+ /* For line-by-line updates, call NotifyOnUpdate for each
+@@ -1471,7 +1471,7 @@
+ #if (TCL_MAJOR_VERSION == 7)
+ Tcl_DetachPids(1, &bgPtr->procArr[i]);
+ #else
+- Tcl_DetachPids(1, (Tcl_Pid *)bgPtr->procArr[i]);
++ Tcl_DetachPids(1, (Tcl_Pid *)(intptr_t)bgPtr->procArr[i]);
+ #endif /* TCL_MAJOR_VERSION == 7 */
+ #endif /* WIN32 */
+ }
diff -urN /usr/ports/x11-toolkits/blt/files/patch-src__bltCanvEps.c x11-toolkits/blt/files/patch-src__bltCanvEps.c
--- /usr/ports/x11-toolkits/blt/files/patch-src__bltCanvEps.c 1970-01-01 09:00:00.000000000 +0900
+++ x11-toolkits/blt/files/patch-src__bltCanvEps.c 2013-11-01 00:00:00.000000000 +0900
@@ -0,0 +1,117 @@
+--- src/bltCanvEps.c.orig
++++ src/bltCanvEps.c
+@@ -323,16 +323,16 @@
+ static void ImageChangedProc _ANSI_ARGS_((ClientData clientData, int x, int y,
+ int width, int height, int imgWidth, int imgHeight));
+ static int EpsCoords _ANSI_ARGS_((Tcl_Interp *interp, Tk_Canvas canvas,
+- Tk_Item * itemPtr, int argc, char **argv));
++ Tk_Item * itemPtr, int argc, Tcl_Obj * const objv[]));
+ static int EpsToArea _ANSI_ARGS_((Tk_Canvas canvas, Tk_Item * itemPtr,
+ double *rectPtr));
+ static double EpsToPoint _ANSI_ARGS_((Tk_Canvas canvas, Tk_Item * itemPtr,
+ double *coordPtr));
+ static void ComputeEpsBbox _ANSI_ARGS_((Tk_Canvas canvas, EpsItem *imgPtr));
+ static int ConfigureEps _ANSI_ARGS_((Tcl_Interp *interp, Tk_Canvas canvas,
+- Tk_Item * itemPtr, int argc, char **argv, int flags));
++ Tk_Item * itemPtr, int argc, Tcl_Obj * const objv[], int flags));
+ static int CreateEps _ANSI_ARGS_((Tcl_Interp *interp, Tk_Canvas canvas,
+- struct Tk_Item * itemPtr, int argc, char **argv));
++ struct Tk_Item * itemPtr, int argc, Tcl_Obj * const objv[]));
+ static void DeleteEps _ANSI_ARGS_((Tk_Canvas canvas, Tk_Item * itemPtr,
+ Display *display));
+ static void DisplayEps _ANSI_ARGS_((Tk_Canvas canvas, Tk_Item * itemPtr,
+@@ -915,13 +915,13 @@
+ *----------------------------------------------------------------------
+ */
+ static int
+-CreateEps(interp, canvas, itemPtr, argc, argv)
++CreateEps(interp, canvas, itemPtr, argc, objv)
+ Tcl_Interp *interp; /* Interpreter for error reporting. */
+ Tk_Canvas canvas; /* Canvas to hold new item. */
+ Tk_Item *itemPtr; /* Record to hold new item; header
+ * has been initialized by caller. */
+ int argc; /* Number of arguments in argv. */
+- char **argv; /* Arguments describing rectangle. */
++ Tcl_Obj * const objv[]; /* Arguments describing rectangle. */
+ {
+ EpsItem *epsPtr = (EpsItem *)itemPtr;
+ Tk_Window tkwin;
+@@ -971,12 +971,11 @@
+ /*
+ * Process the arguments to fill in the item record.
+ */
+-
+- if ((Tk_CanvasGetCoord(interp, canvas, argv[0], &(epsPtr->x)) != TCL_OK) ||
+- (Tk_CanvasGetCoord(interp, canvas, argv[1], &(epsPtr->y)) != TCL_OK)) {
++ if ((Tk_CanvasGetCoord(interp, canvas, Tcl_GetString(objv[0]), &(epsPtr->x)) != TCL_OK) ||
++ (Tk_CanvasGetCoord(interp, canvas, Tcl_GetString(objv[1]), &(epsPtr->y)) != TCL_OK)) {
+ return TCL_ERROR;
+ }
+- if (ConfigureEps(interp, canvas, itemPtr, argc - 2, argv + 2, 0)
++ if (ConfigureEps(interp, canvas, itemPtr, argc - 2, objv + 2, 0)
+ != TCL_OK) {
+ DeleteEps(canvas, itemPtr, Tk_Display(tkwin));
+ return TCL_ERROR;
+@@ -1038,12 +1037,12 @@
+ *----------------------------------------------------------------------
+ */
+ static int
+-ConfigureEps(interp, canvas, itemPtr, argc, argv, flags)
++ConfigureEps(interp, canvas, itemPtr, argc, objv, flags)
+ Tcl_Interp *interp; /* Used for error reporting. */
+ Tk_Canvas canvas; /* Canvas containing itemPtr. */
+ Tk_Item *itemPtr; /* EPS item to reconfigure. */
+ int argc; /* Number of elements in argv. */
+- char **argv; /* Arguments describing things to configure. */
++ Tcl_Obj * const objv[]; /* Arguments describing things to configure. */
+ int flags; /* Flags to pass to Tk_ConfigureWidget. */
+ {
+ EpsItem *epsPtr = (EpsItem *)itemPtr;
+@@ -1052,6 +1051,11 @@
+ unsigned long gcMask;
+ GC newGC;
+ int width, height;
++ char *argv[argc];
++ int i;
++
++ for (i = 0; i < argc; i++)
++ argv[i] = Tcl_GetString(objv[i]);
+
+ tkwin = Tk_CanvasTkwin(canvas);
+ if (Tk_ConfigureWidget(interp, tkwin, configSpecs, argc,
+@@ -1192,14 +1196,14 @@
+ *----------------------------------------------------------------------
+ */
+ static int
+-EpsCoords(interp, canvas, itemPtr, argc, argv)
++EpsCoords(interp, canvas, itemPtr, argc, objv)
+ Tcl_Interp *interp; /* Used for error reporting. */
+ Tk_Canvas canvas; /* Canvas containing item. */
+ Tk_Item *itemPtr; /* Item whose coordinates are to be
+ * read or modified. */
+ int argc; /* Number of coordinates supplied in
+ * argv. */
+- char **argv; /* Array of coordinates: x1, y1,
++ Tcl_Obj * const objv[]; /* Array of coordinates: x1, y1,
+ * x2, y2, ... */
+ {
+ EpsItem *epsPtr = (EpsItem *)itemPtr;
+@@ -1212,8 +1216,8 @@
+ if (argc == 2) {
+ double x, y; /* Don't overwrite old coordinates on errors */
+
+- if ((Tk_CanvasGetCoord(interp, canvas, argv[0], &x) != TCL_OK) ||
+- (Tk_CanvasGetCoord(interp, canvas, argv[1], &y) != TCL_OK)) {
++ if ((Tk_CanvasGetCoord(interp, canvas, Tcl_GetString(objv[0]), &x) != TCL_OK) ||
++ (Tk_CanvasGetCoord(interp, canvas, Tcl_GetString(objv[1]), &y) != TCL_OK)) {
+ return TCL_ERROR;
+ }
+ epsPtr->x = x;
+@@ -1713,6 +1717,6 @@
+ {
+ Tk_CreateItemType(&epsItemType);
+ /* Initialize custom canvas option routines. */
+- tagsOption.parseProc = Tk_CanvasTagsParseProc;
++ tagsOption.parseProc = (Tk_OptionParseProc *)Tk_CanvasTagsParseProc;
+ tagsOption.printProc = Tk_CanvasTagsPrintProc;
+ }
diff -urN /usr/ports/x11-toolkits/blt/files/patch-src__bltColor.c x11-toolkits/blt/files/patch-src__bltColor.c
--- /usr/ports/x11-toolkits/blt/files/patch-src__bltColor.c 1970-01-01 09:00:00.000000000 +0900
+++ x11-toolkits/blt/files/patch-src__bltColor.c 2013-11-01 00:00:00.000000000 +0900
@@ -0,0 +1,262 @@
+--- src/bltColor.c.orig
++++ src/bltColor.c
+@@ -77,59 +77,6 @@
+
+ #define NCOLORS 256
+
+-
+-static void
+-GetPaletteSizes(nColors, nRedsPtr, nGreensPtr, nBluesPtr)
+- int nColors; /* Number of colors requested. */
+- unsigned int *nRedsPtr; /* (out) Number of red components. */
+- unsigned int *nGreensPtr; /* (out) Number of green components. */
+- unsigned int *nBluesPtr; /* (out) Number of blue components. */
+-{
+- unsigned int nBlues, nReds, nGreens;
+-
+- assert(nColors > 1);
+- nBlues = nReds = nGreens = 0;
+- while ((nBlues * nBlues * nBlues) <= nColors) {
+- nBlues++;
+- }
+- nBlues--;
+- while ((nReds * nReds * nBlues) <= nColors) {
+- nReds++;
+- }
+- nReds--;
+- nGreens = nColors / (nBlues * nReds);
+-
+- *nRedsPtr = nReds;
+- *nGreensPtr = nGreens;
+- *nBluesPtr = nBlues;
+-}
+-
+-static void
+-BuildColorRamp(palettePtr, nColors)
+- Pix32 *palettePtr;
+- int nColors;
+-{
+- register unsigned int r, g, b;
+- unsigned int short red, green, blue;
+- unsigned int nReds, nGreens, nBlues;
+-
+- GetPaletteSizes(nColors, &nReds, &nGreens, &nBlues);
+- for (r = 0; r < nReds; r++) {
+- red = (r * USHRT_MAX) / (nReds - 1);
+- for (g = 0; g < nGreens; g++) {
+- green = (g * USHRT_MAX) / (nGreens - 1);
+- for (b = 0; b < nBlues; b++) {
+- blue = (b * USHRT_MAX) / (nBlues - 1);
+- palettePtr->Red = red;
+- palettePtr->Green = green;
+- palettePtr->Blue = blue;
+- palettePtr++;
+- }
+- }
+- }
+-
+-}
+-
+ /*
+ *----------------------------------------------------------------------
+ *
+@@ -200,149 +147,6 @@
+ return numAvail;
+ }
+
+-static void
+-FindClosestColor(colorPtr, mapColors, numMapColors)
+- ColorInfo *colorPtr;
+- XColor mapColors[];
+- int numMapColors;
+-{
+- double r, g, b;
+- register int i;
+- double dist, min;
+- XColor *lastMatch;
+- register XColor *mapColorPtr;
+-
+- min = DBL_MAX; /* Any color is closer. */
+- lastMatch = NULL;
+-
+- /* Linear search of color */
+-
+- mapColorPtr = mapColors;
+- for (i = 0; i < numMapColors; i++, mapColorPtr++) {
+- r = (double)mapColorPtr->red - (double)colorPtr->exact.red;
+- g = (double)mapColorPtr->green - (double)colorPtr->exact.green;
+- b = (double)mapColorPtr->blue - (double)colorPtr->exact.blue;
+-
+- dist = (r * r) + (b * b) + (g * g);
+- if (dist < min) {
+- min = dist;
+- lastMatch = mapColorPtr;
+- }
+- }
+- colorPtr->best = *lastMatch;
+- colorPtr->best.flags = (DoRed | DoGreen | DoBlue);
+- colorPtr->error = (float)sqrt(min);
+-}
+-
+-static int
+-CompareColors(a, b)
+- void *a, *b;
+-{
+- ColorInfo *i1Ptr, *i2Ptr;
+-
+- i1Ptr = *(ColorInfo **) a;
+- i2Ptr = *(ColorInfo **) b;
+- if (i2Ptr->error > i1Ptr->error) {
+- return 1;
+- } else if (i2Ptr->error < i1Ptr->error) {
+- return -1;
+- }
+- return 0;
+-}
+-
+-static float
+-MatchColors(colorTabPtr, rgbPtr, numColors, numAvailColors, numMapColors,
+- mapColors)
+- struct ColorTableStruct *colorTabPtr;
+- Pix32 *rgbPtr;
+- int numColors;
+- int numAvailColors;
+- int numMapColors;
+- XColor mapColors[NCOLORS];
+-{
+- int numMatched;
+- float sum;
+- register int i;
+- register ColorInfo *colorPtr;
+-
+- /*
+- * For each quantized color, compute and store the error (i.e
+- * the distance from a color that's already been allocated).
+- * We'll use this information to sort the colors based upon how
+- * badly they match and their frequency to the color image.
+- */
+- colorPtr = colorTabPtr->colorInfo;
+- for (i = 0; i < numColors; i++, colorPtr++, rgbPtr++) {
+- colorPtr->index = i;
+- colorTabPtr->sortedColors[i] = colorPtr;
+- colorPtr->exact.red = rgbPtr->Red;
+- colorPtr->exact.green = rgbPtr->Green;
+- colorPtr->exact.blue = rgbPtr->Blue;
+- colorPtr->exact.flags = (DoRed | DoGreen | DoBlue);
+- FindClosestColor(colorPtr, mapColors, numMapColors);
+- }
+-
+- /* Sort the colors, first by frequency (most to least), then by
+- * matching error (worst to best).
+- */
+- qsort(colorTabPtr->sortedColors, numColors, sizeof(ColorInfo *),
+- (QSortCompareProc *)CompareColors);
+-
+- for (i = 0; i < numColors; i++) {
+- colorPtr = colorTabPtr->sortedColors[i];
+- fprintf(stderr, "%d. %04x%04x%04x / %04x%04x%04x = %f (%d)\n", i,
+- colorPtr->exact.red, colorPtr->exact.green, colorPtr->exact.blue,
+- colorPtr->best.red, colorPtr->best.green, colorPtr->best.blue,
+- colorPtr->error, colorPtr->freq);
+- }
+- sum = 0.0;
+- numMatched = 0;
+- for (i = numAvailColors; i < numColors; i++) {
+- colorPtr = colorTabPtr->sortedColors[i];
+- sum += colorPtr->error;
+- numMatched++;
+- }
+- if (numMatched > 0) {
+- sum /= numMatched;
+- }
+- return sum;
+-}
+-
+-
+-static int
+-AllocateColors(nImageColors, colorTabPtr, matchOnly)
+- int nImageColors;
+- struct ColorTableStruct *colorTabPtr;
+- int matchOnly;
+-{
+- register int i;
+- register ColorInfo *colorPtr;
+- unsigned long int pixelValue;
+-
+- for (i = 0; i < nImageColors; i++) {
+- colorPtr = colorTabPtr->sortedColors[i];
+- if (matchOnly) {
+- XAllocColor(colorTabPtr->display, colorTabPtr->colorMap,
+- &colorPtr->best);
+- pixelValue = colorPtr->best.pixel;
+- } else {
+- colorPtr->allocated = XAllocColor(colorTabPtr->display,
+- colorTabPtr->colorMap, &colorPtr->exact);
+-
+- if (colorPtr->allocated) {
+- pixelValue = colorPtr->exact.pixel;
+- } else {
+- XAllocColor(colorTabPtr->display, colorTabPtr->colorMap,
+- &colorPtr->best);
+- pixelValue = colorPtr->best.pixel;
+- }
+- }
+- colorTabPtr->pixelValues[colorPtr->index] = pixelValue;
+- }
+- colorTabPtr->nPixels = nImageColors;
+- return 1;
+-}
+-
+ ColorTable
+ Blt_CreateColorTable(tkwin)
+ Tk_Window tkwin;
+@@ -510,49 +314,9 @@
+ return colorTabPtr;
+ }
+
+-/*
+- * First attempt:
+- * Allocate colors all the colors in the image (up to NCOLORS). Bail out
+- * on the first failure or if we need more than NCOLORS.
+- */
+-static int
+-GetUniqueColors(image)
+- Blt_ColorImage image;
+-{
+- register int i, nColors;
+- register Pix32 *pixelPtr;
+- Pix32 color;
+- Blt_HashEntry *hPtr;
+- int isNew, nPixels;
+- int refCount;
+- Blt_HashTable colorTable;
+-
+- Blt_InitHashTable(&colorTable, BLT_ONE_WORD_KEYS);
+-
+- nPixels = Blt_ColorImageWidth(image) * Blt_ColorImageHeight(image);
+- nColors = 0;
+- pixelPtr = Blt_ColorImageBits(image);
+- for (i = 0; i < nPixels; i++, pixelPtr++) {
+- color.value = pixelPtr->value;
+- color.Alpha = 0xFF; /* Ignore alpha-channel values */
+- hPtr = Blt_CreateHashEntry(&colorTable, (char *)color.value, &isNew);
+- if (isNew) {
+- refCount = 1;
+- nColors++;
+- } else {
+- refCount = (int)Blt_GetHashValue(hPtr);
+- refCount++;
+- }
+- Blt_SetHashValue(hPtr, (ClientData)refCount);
+- }
+- Blt_DeleteHashTable(&colorTable);
+- return nColors;
+-}
+-
+ #define Blt_DefaultColormap(tkwin) \
+ DefaultColormap(Tk_Display(tkwin), Tk_ScreenNumber(tkwin))
+
+-
+ static void
+ PrivateColormap(interp, colorTabPtr, image, tkwin)
+ Tcl_Interp *interp;
diff -urN /usr/ports/x11-toolkits/blt/files/patch-src__bltConfig.c x11-toolkits/blt/files/patch-src__bltConfig.c
--- /usr/ports/x11-toolkits/blt/files/patch-src__bltConfig.c 1970-01-01 09:00:00.000000000 +0900
+++ x11-toolkits/blt/files/patch-src__bltConfig.c 2013-11-01 00:00:00.000000000 +0900
@@ -0,0 +1,38 @@
+--- src/bltConfig.c.orig
++++ src/bltConfig.c
+@@ -275,7 +275,7 @@
+ char *widgRec; /* Cubicle structure record */
+ int offset; /* Offset of style in record */
+ {
+- unsigned int mask = (unsigned int)clientData; /* Bit to be tested */
++ unsigned int mask = (uintptr_t)clientData; /* Bit to be tested */
+ int *flagPtr = (int *)(widgRec + offset);
+ int bool;
+
+@@ -311,7 +311,7 @@
+ int offset; /* Offset of fill in widget record */
+ Tcl_FreeProc **freeProcPtr; /* Not Used. */
+ {
+- unsigned int mask = (unsigned int)clientData; /* Bit to be tested */
++ unsigned int mask = (uintptr_t)clientData; /* Bit to be tested */
+ unsigned int bool = *(unsigned int *)(widgRec + offset);
+
+ return (bool & mask) ? "1" : "0";
+@@ -392,7 +392,7 @@
+ int offset; /* Offset of pixel size in record */
+ {
+ int *valuePtr = (int *)(widgRec + offset);
+- return Blt_GetPixels(interp, tkwin, string, (int)clientData, valuePtr);
++ return Blt_GetPixels(interp, tkwin, string, (intptr_t)clientData, valuePtr);
+ }
+
+ /*
+@@ -481,7 +481,7 @@
+ int offset; /* Offset of pixel size in record */
+ {
+ int *valuePtr = (int *)(widgRec + offset);
+- return Blt_GetInt(interp, string, (int)clientData, valuePtr);
++ return Blt_GetInt(interp, string, (intptr_t)clientData, valuePtr);
+ }
+
+ /*
diff -urN /usr/ports/x11-toolkits/blt/files/patch-src__bltContainer.c x11-toolkits/blt/files/patch-src__bltContainer.c
--- /usr/ports/x11-toolkits/blt/files/patch-src__bltContainer.c 1970-01-01 09:00:00.000000000 +0900
+++ x11-toolkits/blt/files/patch-src__bltContainer.c 2013-11-01 00:00:00.000000000 +0900
@@ -0,0 +1,11 @@
+--- src/bltContainer.c.orig
++++ src/bltContainer.c
+@@ -822,7 +822,7 @@
+ char *widgRec; /* Widget record */
+ int offset; /* Offset to field in structure */
+ {
+- unsigned int flags = (int)clientData;
++ unsigned int flags = (uintptr_t)clientData;
+ Container *cntrPtr = (Container *)widgRec;
+ Window *winPtr = (Window *) (widgRec + offset);
+ Tk_Window tkAdopted;
diff -urN /usr/ports/x11-toolkits/blt/files/patch-src__bltGrAxis.c x11-toolkits/blt/files/patch-src__bltGrAxis.c
--- /usr/ports/x11-toolkits/blt/files/patch-src__bltGrAxis.c 1970-01-01 09:00:00.000000000 +0900
+++ x11-toolkits/blt/files/patch-src__bltGrAxis.c 2013-11-01 00:00:00.000000000 +0900
@@ -0,0 +1,50 @@
+--- src/bltGrAxis.c.oirg
++++ src/bltGrAxis.c
+@@ -669,7 +669,7 @@
+ char *widgRec; /* Pointer to structure record. */
+ int offset; /* Offset of field in structure. */
+ {
+- unsigned int mask = (unsigned int)clientData;
++ unsigned int mask = (uintptr_t)clientData;
+ Axis *axisPtr = (Axis *)widgRec;
+ Ticks **ticksPtrPtr = (Ticks **) (widgRec + offset);
+ int nTicks;
+@@ -1420,7 +1420,7 @@
+ double min, max;
+ {
+ double range;
+- double tickMin, tickMax;
++ double tickMin = 0, tickMax = 0;
+ double majorStep, minorStep;
+ int nMajor, nMinor;
+
+@@ -1549,9 +1549,9 @@
+ Axis *axisPtr;
+ double min, max;
+ {
+- double range, step;
++ double range, step = 0;
+ double tickMin, tickMax;
+- double axisMin, axisMax;
++ double axisMin = 0, axisMax = 0;
+ int nTicks;
+
+ nTicks = 0;
+@@ -3647,7 +3647,7 @@
+ Blt_Uid classUid;
+ int margin;
+
+- margin = (int)argv[-1];
++ margin = (intptr_t)argv[-1];
+ chainPtr = graphPtr->margins[margin].axes;
+ if (argc == 0) {
+ for (linkPtr = Blt_ChainFirstLink(chainPtr); linkPtr!= NULL;
+@@ -4190,7 +4190,7 @@
+ if (proc == NULL) {
+ return TCL_ERROR;
+ }
+- argv[2] = (char *)margin; /* Hack. Slide a reference to the margin in
++ argv[2] = (char *)(intptr_t)margin; /* Hack. Slide a reference to the margin in
+ * the argument list. Needed only for UseOp.
+ */
+ axisPtr = Blt_GetFirstAxis(graphPtr->margins[margin].axes);
diff -urN /usr/ports/x11-toolkits/blt/files/patch-src__bltGrBar.c x11-toolkits/blt/files/patch-src__bltGrBar.c
--- /usr/ports/x11-toolkits/blt/files/patch-src__bltGrBar.c 1970-01-01 09:00:00.000000000 +0900
+++ x11-toolkits/blt/files/patch-src__bltGrBar.c 2013-11-01 00:00:00.000000000 +0900
@@ -0,0 +1,36 @@
+--- src/bltGrBar.c.orig
++++ src/bltGrBar.c
+@@ -2147,7 +2147,8 @@
+ Blt_HashEntry *hPtr;
+ Blt_HashSearch cursor;
+ Bar *barPtr;
+- int isNew, count;
++ int isNew;
++ intptr_t count;
+ int nStacks, nSegs;
+ int nPoints;
+ FreqKey key;
+@@ -2197,7 +2198,7 @@
+ if (isNew) {
+ count = 1;
+ } else {
+- count = (int)Blt_GetHashValue(hPtr);
++ count = (intptr_t)Blt_GetHashValue(hPtr);
+ if (count == 1) {
+ nStacks++;
+ }
+@@ -2219,12 +2220,12 @@
+ infoPtr = graphPtr->freqArr;
+ for (hPtr = Blt_FirstHashEntry(&freqTable, &cursor); hPtr != NULL;
+ hPtr = Blt_NextHashEntry(&cursor)) {
+- count = (int)Blt_GetHashValue(hPtr);
++ count = (intptr_t)Blt_GetHashValue(hPtr);
+ keyPtr = (FreqKey *)Blt_GetHashKey(&freqTable, hPtr);
+ if (count > 1) {
+ h2Ptr = Blt_CreateHashEntry(&(graphPtr->freqTable),
+ (char *)keyPtr, &isNew);
+- count = (int)Blt_GetHashValue(hPtr);
++ count = (intptr_t)Blt_GetHashValue(hPtr);
+ infoPtr->freq = count;
+ infoPtr->axes = keyPtr->axes;
+ Blt_SetHashValue(h2Ptr, infoPtr);
diff -urN /usr/ports/x11-toolkits/blt/files/patch-src__bltGrMisc.c x11-toolkits/blt/files/patch-src__bltGrMisc.c
--- /usr/ports/x11-toolkits/blt/files/patch-src__bltGrMisc.c 1970-01-01 09:00:00.000000000 +0900
+++ x11-toolkits/blt/files/patch-src__bltGrMisc.c 2013-11-01 00:00:00.000000000 +0900
@@ -0,0 +1,20 @@
+--- src/bltGrMisc.c.orig
++++ src/bltGrMisc.c
+@@ -74,7 +74,7 @@
+ Blt_GetXY(interp, tkwin, string, xPtr, yPtr)
+ Tcl_Interp *interp;
+ Tk_Window tkwin;
+- char *string;
++ const char *string;
+ int *xPtr, *yPtr;
+ {
+ char *comma;
+@@ -260,7 +260,7 @@
+ {
+ ColorPair *pairPtr = (ColorPair *)(widgRec + offset);
+ ColorPair sample;
+- int allowDefault = (int)clientData;
++ int allowDefault = (intptr_t)clientData;
+
+ sample.fgColor = sample.bgColor = NULL;
+ if ((string != NULL) && (*string != '\0')) {
diff -urN /usr/ports/x11-toolkits/blt/files/patch-src__bltHash.h.in x11-toolkits/blt/files/patch-src__bltHash.h.in
--- /usr/ports/x11-toolkits/blt/files/patch-src__bltHash.h.in 1970-01-01 09:00:00.000000000 +0900
+++ x11-toolkits/blt/files/patch-src__bltHash.h.in 2013-11-01 00:00:00.000000000 +0900
@@ -0,0 +1,11 @@
+--- src/bltHash.h.in.orig
++++ src/bltHash.h.in
+@@ -88,7 +88,7 @@
+ * Acceptable key types for hash tables:
+ */
+ #define BLT_STRING_KEYS 0
+-#define BLT_ONE_WORD_KEYS ((size_t)-1)
++#define BLT_ONE_WORD_KEYS ((unsigned int)-1)
+
+ /*
+ * Forward declaration of Blt_HashTable. Needed by some C++ compilers
diff -urN /usr/ports/x11-toolkits/blt/files/patch-src__bltHierbox.c x11-toolkits/blt/files/patch-src__bltHierbox.c
--- /usr/ports/x11-toolkits/blt/files/patch-src__bltHierbox.c 1970-01-01 09:00:00.000000000 +0900
+++ x11-toolkits/blt/files/patch-src__bltHierbox.c 2013-11-01 00:00:00.000000000 +0900
@@ -0,0 +1,52 @@
+--- src/bltHierbox.c.orig
++++ src/bltHierbox.c
+@@ -2077,7 +2077,7 @@
+ /* Generate a unique node serial number. */
+ do {
+ serial = hboxPtr->nextSerial++;
+- hPtr = Blt_CreateHashEntry(&(hboxPtr->nodeTable), (char *)serial,
++ hPtr = Blt_CreateHashEntry(&(hboxPtr->nodeTable), (char *)(intptr_t)serial,
+ &isNew);
+ } while (!isNew);
+ Blt_SetHashValue(hPtr, treePtr);
+@@ -2364,7 +2364,7 @@
+ static Tree *
+ GetNodeByIndex(hboxPtr, string)
+ Hierbox *hboxPtr;
+- char *string;
++ const char *string;
+ {
+ if (isdigit(UCHAR(string[0]))) {
+ int serial;
+@@ -2372,7 +2372,7 @@
+ if (Tcl_GetInt(NULL, string, &serial) == TCL_OK) {
+ Blt_HashEntry *hPtr;
+
+- hPtr = Blt_FindHashEntry(&(hboxPtr->nodeTable), (char *)serial);
++ hPtr = Blt_FindHashEntry(&(hboxPtr->nodeTable), (char *)(intptr_t)serial);
+ if (hPtr != NULL) {
+ return (Tree *) Blt_GetHashValue(hPtr);
+ }
+@@ -2402,11 +2402,11 @@
+ Hierbox *hboxPtr;
+ Tree *nodePtr;
+ {
+- static char string[200];
++ static char string[31];
+ int serial;
+
+ /* Node table keys are integers. Convert them to strings. */
+- serial = (int)Blt_GetHashKey(&(hboxPtr->nodeTable),
++ serial = (intptr_t)Blt_GetHashKey(&(hboxPtr->nodeTable),
+ nodePtr->entryPtr->hashPtr);
+ sprintf(string, "%d", serial);
+
+@@ -2457,7 +2457,7 @@
+ static int
+ GetNode(hboxPtr, string, treePtrPtr)
+ Hierbox *hboxPtr;
+- char *string;
++ const char *string;
+ Tree **treePtrPtr;
+ {
+ Tree *nodePtr;
diff -urN /usr/ports/x11-toolkits/blt/files/patch-src__bltHtext.c x11-toolkits/blt/files/patch-src__bltHtext.c
--- /usr/ports/x11-toolkits/blt/files/patch-src__bltHtext.c 1970-01-01 09:00:00.000000000 +0900
+++ x11-toolkits/blt/files/patch-src__bltHtext.c 2013-11-01 00:00:00.000000000 +0900
@@ -0,0 +1,21 @@
+--- src/bltHtext.c.orig
++++ src/bltHtext.c
+@@ -3347,7 +3347,7 @@
+ * The page is always draw at full width and the viewport will clip
+ * the text.
+ */
+- if ((htPtr->first != oldFirst) || (htPtr->last != oldLast)) {
++ if (htPtr->lineArr && ((htPtr->first != oldFirst) || (htPtr->last != oldLast))) {
+ int offset;
+ int i;
+ int first, last;
+@@ -3376,7 +3376,8 @@
+ }
+ }
+ }
+- DrawPage(htPtr, deltaY);
++ if (htPtr->lineArr)
++ DrawPage(htPtr, deltaY);
+ SendBogusEvent(tkwin);
+
+ /* Reset flags */
diff -urN /usr/ports/x11-toolkits/blt/files/patch-src__bltImage.c x11-toolkits/blt/files/patch-src__bltImage.c
--- /usr/ports/x11-toolkits/blt/files/patch-src__bltImage.c 1970-01-01 09:00:00.000000000 +0900
+++ x11-toolkits/blt/files/patch-src__bltImage.c 2013-11-01 00:00:00.000000000 +0900
@@ -0,0 +1,58 @@
+--- src/bltImage.c.orig
++++ src/bltImage.c
+@@ -2418,22 +2418,19 @@
+ }
+ }
+
+-static unsigned int *
+-CreateColorLookupTable(s, cubes, nColors)
++static void
++CreateColorLookupTable(s, cubes, nColors, lut)
+ ColorImageStatistics *s;
+ Cube *cubes;
+ int nColors;
++ unsigned int lut[33][33][33];
+ {
+- unsigned int *lut;
+ Pix32 color;
+ unsigned int red, green, blue;
+ unsigned int weight;
+ register Cube *cubePtr;
+ register int i;
+
+- lut = Blt_Calloc(sizeof(unsigned int), 33 * 33 * 33);
+- assert(lut);
+-
+ color.Alpha = (unsigned char)-1;
+ for (cubePtr = cubes, i = 0; i < nColors; i++, cubePtr++) {
+ weight = Volume(cubePtr, s->wt);
+@@ -2450,7 +2447,6 @@
+ color.Blue = blue >> 8;
+ Mark(cubePtr, color.value, lut);
+ }
+- return lut;
+ }
+
+ static void
+@@ -2513,7 +2509,7 @@
+ Cube *cubes;
+ ColorImageStatistics *statistics;
+ int nColors;
+- unsigned int *lut;
++ unsigned int lut[33][33][33];
+
+ /*
+ * Allocated a structure to hold color statistics.
+@@ -2527,11 +2523,10 @@
+ nColors = SplitColorSpace(statistics, cubes, reduceColors);
+ assert(nColors <= reduceColors);
+
+- lut = CreateColorLookupTable(statistics, cubes, nColors);
++ CreateColorLookupTable(statistics, cubes, nColors, lut);
+ Blt_Free(statistics);
+ Blt_Free(cubes);
+ MapColors(src, dest, lut);
+- Blt_Free(lut);
+ return TCL_OK;
+ }
+
diff -urN /usr/ports/x11-toolkits/blt/files/patch-src__bltInit.c x11-toolkits/blt/files/patch-src__bltInit.c
--- /usr/ports/x11-toolkits/blt/files/patch-src__bltInit.c 1970-01-01 09:00:00.000000000 +0900
+++ x11-toolkits/blt/files/patch-src__bltInit.c 2013-11-01 00:00:00.000000000 +0900
@@ -0,0 +1,55 @@
+--- src/bltInit.c.orig
++++ src/bltInit.c
+@@ -403,9 +403,9 @@
+ Blt_Init(interp)
+ Tcl_Interp *interp; /* Interpreter to add extra commands */
+ {
+- int flags;
++ intptr_t flags;
+
+- flags = (int)Tcl_GetAssocData(interp, BLT_THREAD_KEY, NULL);
++ flags = (intptr_t)Tcl_GetAssocData(interp, BLT_THREAD_KEY, NULL);
+ if ((flags & BLT_TCL_CMDS) == 0) {
+ register Tcl_AppInitProc **p;
+ Tcl_Namespace *nsPtr;
+@@ -415,7 +415,7 @@
+ * Check that the versions of Tcl that have been loaded are
+ * the same ones that BLT was compiled against.
+ */
+- if (Tcl_PkgRequire(interp, "Tcl", TCL_VERSION, EXACT) == NULL) {
++ if (Tcl_PkgRequire(interp, "Tcl", TCL_PATCH_LEVEL, EXACT) == NULL) {
+ return TCL_ERROR;
+ }
+ /* Set the "blt_version", "blt_patchLevel", and "blt_libPath" Tcl
+@@ -462,7 +462,7 @@
+ Tcl_Namespace *nsPtr;
+
+ #if (TCL_VERSION_NUMBER >= _VERSION(8,1,0))
+- if (Tcl_PkgPresent(interp, "Tk", TK_VERSION, EXACT) == NULL) {
++ if (Tcl_PkgPresent(interp, "Tk", TK_PATCH_LEVEL, EXACT) == NULL) {
+ return TCL_OK;
+ }
+ #else
+@@ -514,7 +514,7 @@
+ * Check that the versions of Tcl that have been loaded are
+ * the same ones that BLT was compiled against.
+ */
+- if (Tcl_PkgRequire(interp, "Tcl", TCL_VERSION, EXACT) == NULL) {
++ if (Tcl_PkgRequire(interp, "Tcl", TCL_PATCH_LEVEL, EXACT) == NULL) {
+ return TCL_ERROR;
+ }
+ /* Set the "blt_version", "blt_patchLevel", and "blt_libPath" Tcl
+@@ -552,11 +552,11 @@
+ register Tcl_AppInitProc **p;
+
+ #if (TCL_VERSION_NUMBER >= _VERSION(8,1,0))
+- if (Tcl_PkgPresent(interp, "Tk", TK_VERSION, EXACT) == NULL) {
++ if (Tcl_PkgPresent(interp, "Tk", TK_PATCH_LEVEL, EXACT) == NULL) {
+ return TCL_OK;
+ }
+ #else
+- if (Tcl_PkgRequire(interp, "Tk", TK_VERSION, EXACT) == NULL) {
++ if (Tcl_PkgRequire(interp, "Tk", TK_PATCH_LEVEL, EXACT) == NULL) {
+ Tcl_ResetResult(interp);
+ return TCL_OK;
+ }
diff -urN /usr/ports/x11-toolkits/blt/files/patch-src__bltInt.h x11-toolkits/blt/files/patch-src__bltInt.h
--- /usr/ports/x11-toolkits/blt/files/patch-src__bltInt.h 1970-01-01 09:00:00.000000000 +0900
+++ x11-toolkits/blt/files/patch-src__bltInt.h 2013-11-01 00:00:00.000000000 +0900
@@ -0,0 +1,11 @@
+--- src/bltInt.h.orig
++++ src/bltInt.h
+@@ -713,7 +713,7 @@
+ extern char *Blt_NameOfFill _ANSI_ARGS_((int fill));
+
+ extern int Blt_GetXY _ANSI_ARGS_((Tcl_Interp *interp, Tk_Window tkwin,
+- char *string, int *x, int *y));
++ const char *string, int *x, int *y));
+
+ extern Point2D Blt_GetProjection _ANSI_ARGS_((int x, int y, Point2D *p,
+ Point2D *q));
diff -urN /usr/ports/x11-toolkits/blt/files/patch-src__bltNsUtil.h x11-toolkits/blt/files/patch-src__bltNsUtil.h
--- /usr/ports/x11-toolkits/blt/files/patch-src__bltNsUtil.h 1970-01-01 09:00:00.000000000 +0900
+++ x11-toolkits/blt/files/patch-src__bltNsUtil.h 2013-11-01 00:00:00.000000000 +0900
@@ -0,0 +1,52 @@
+--- src/bltNsUtil.h.orig
++++ src/bltNsUtil.h
+@@ -46,9 +46,10 @@
+ #define TCL_NAMESPACE_ONLY TCL_GLOBAL_ONLY
+ #endif
+
+-
++#if TCL_MAJOR_VERSION < 8 || TCL_MINOR_VERSION < 5
+ EXTERN Tcl_Command Tcl_FindCommand _ANSI_ARGS_((Tcl_Interp *interp,
+ char *name, Tcl_Namespace *nsPtr, int flags));
++#endif
+
+ #define NS_SEARCH_NONE (0)
+ #define NS_SEARCH_CURRENT (1<<0)
+@@ -63,17 +64,21 @@
+
+ EXTERN Tcl_Namespace *Tcl_GetGlobalNamespace _ANSI_ARGS_((Tcl_Interp *interp));
+
+-#if (TCL_MAJOR_VERSION >= 8)
++#if TCL_MAJOR_VERSION == 8
++# if TCL_MINOR_VERSION < 5
+ EXTERN Tcl_Namespace *Tcl_CreateNamespace _ANSI_ARGS_((Tcl_Interp *interp,
+- char *name, ClientData clientData, Tcl_NamespaceDeleteProc *nsDelProc));
+-
+-EXTERN void Tcl_DeleteNamespace _ANSI_ARGS_((Tcl_Namespace *nsPtr));
++ const char *name, ClientData clientData,
++ Tcl_NamespaceDeleteProc *nsDelProc));
+
+ EXTERN Tcl_Namespace *Tcl_FindNamespace _ANSI_ARGS_((Tcl_Interp *interp,
+- char *name, Tcl_Namespace *context, int flags));
++ const char *name, Tcl_Namespace *context, int flags));
++
++EXTERN int Tcl_Export _ANSI_ARGS_((Tcl_Interp *interp,
++ Tcl_Namespace *nsPtr,
++ const char *pattern, int resetFlag));
++# endif
+
+-EXTERN int Tcl_Export _ANSI_ARGS_((Tcl_Interp *interp, Tcl_Namespace *nsPtr,
+- char *name, int resetFlag));
++EXTERN void Tcl_DeleteNamespace _ANSI_ARGS_((Tcl_Namespace *nsPtr));
+
+ EXTERN Tcl_Var Tcl_FindNamespaceVar _ANSI_ARGS_((Tcl_Interp *interp, char *name,
+ Tcl_Namespace *contextNsPtr, int flags));
+@@ -86,7 +91,7 @@
+ extern Tcl_HashTable *Blt_GetArrayVariableTable _ANSI_ARGS_((
+ Tcl_Interp *interp, CONST char *varName, int flags));
+
+-#endif /* TCL_MAJOR_VERSION >= 8 */
++#endif /* TCL_MAJOR_VERSION == 8 */
+
+
+ /*
diff -urN /usr/ports/x11-toolkits/blt/files/patch-src__bltObjConfig.c x11-toolkits/blt/files/patch-src__bltObjConfig.c
--- /usr/ports/x11-toolkits/blt/files/patch-src__bltObjConfig.c 1970-01-01 09:00:00.000000000 +0900
+++ x11-toolkits/blt/files/patch-src__bltObjConfig.c 2013-11-01 00:00:00.000000000 +0900
@@ -0,0 +1,30 @@
+--- src/bltObjConfig.c.orig
++++ src/bltObjConfig.c
+@@ -1219,13 +1219,13 @@
+ case BLT_CONFIG_BITFLAG:
+ {
+ int bool;
+- unsigned int flag;
++ uintptr_t flag;
+
+
+ if (Tcl_GetBooleanFromObj(interp, objPtr, &bool) != TCL_OK) {
+ return TCL_ERROR;
+ }
+- flag = (unsigned int)specPtr->customPtr;
++ flag = (uintptr_t)specPtr->customPtr;
+ *(int *)ptr &= ~flag;
+ if (bool) {
+ *(int *)ptr |= flag;
+@@ -1498,9 +1498,9 @@
+
+ case BLT_CONFIG_BITFLAG:
+ {
+- unsigned int flag;
++ uintptr_t flag;
+
+- flag = (*(int *)ptr) & (unsigned int)specPtr->customPtr;
++ flag = (*(int *)ptr) & (uintptr_t)specPtr->customPtr;
+ return Tcl_NewBooleanObj((flag != 0));
+ }
+
diff -urN /usr/ports/x11-toolkits/blt/files/patch-src__bltPs.c x11-toolkits/blt/files/patch-src__bltPs.c
--- /usr/ports/x11-toolkits/blt/files/patch-src__bltPs.c 1970-01-01 09:00:00.000000000 +0900
+++ x11-toolkits/blt/files/patch-src__bltPs.c 2013-11-01 00:00:00.000000000 +0900
@@ -0,0 +1,49 @@
+--- src/bltPs.c.orig
++++ src/bltPs.c
+@@ -893,7 +893,7 @@
+ return;
+ }
+ if ((relief == TK_RELIEF_SOLID) ||
+- (borderPtr->lightColor == NULL) || (borderPtr->darkColor == NULL)) {
++ (borderPtr->lightColorPtr == NULL) || (borderPtr->darkColorPtr == NULL)) {
+ if (relief == TK_RELIEF_SOLID) {
+ darkColor.red = darkColor.blue = darkColor.green = 0x00;
+ lightColor.red = lightColor.blue = lightColor.green = 0x00;
+@@ -901,7 +901,7 @@
+ } else {
+ Screen *screenPtr;
+
+- lightColor = *borderPtr->bgColor;
++ lightColor = *borderPtr->bgColorPtr;
+ screenPtr = Tk_Screen(tokenPtr->tkwin);
+ if (lightColor.pixel == WhitePixelOfScreen(screenPtr)) {
+ darkColor.red = darkColor.blue = darkColor.green = 0x00;
+@@ -912,8 +912,8 @@
+ lightColorPtr = &lightColor;
+ darkColorPtr = &darkColor;
+ } else {
+- lightColorPtr = borderPtr->lightColor;
+- darkColorPtr = borderPtr->darkColor;
++ lightColorPtr = borderPtr->lightColorPtr;
++ darkColorPtr = borderPtr->darkColorPtr;
+ }
+
+
+@@ -942,7 +942,7 @@
+ topColor = darkColorPtr;
+ bottomColor = lightColorPtr;
+ } else {
+- topColor = bottomColor = borderPtr->bgColor;
++ topColor = bottomColor = borderPtr->bgColorPtr;
+ }
+ Blt_BackgroundToPostScript(tokenPtr, bottomColor);
+ Blt_RectangleToPostScript(tokenPtr, x, y + height - borderWidth, width,
+@@ -982,7 +982,7 @@
+ * Setting the pen color as foreground or background only affects
+ * the plot when the colormode option is "monochrome".
+ */
+- Blt_BackgroundToPostScript(tokenPtr, borderPtr->bgColor);
++ Blt_BackgroundToPostScript(tokenPtr, borderPtr->bgColorPtr);
+ Blt_RectangleToPostScript(tokenPtr, x, y, width, height);
+ Blt_Draw3DRectangleToPostScript(tokenPtr, border, x, y, width, height,
+ borderWidth, relief);
diff -urN /usr/ports/x11-toolkits/blt/files/patch-src__bltScrollbar.c x11-toolkits/blt/files/patch-src__bltScrollbar.c
--- /usr/ports/x11-toolkits/blt/files/patch-src__bltScrollbar.c 1970-01-01 09:00:00.000000000 +0900
+++ x11-toolkits/blt/files/patch-src__bltScrollbar.c 2013-11-01 00:00:00.000000000 +0900
@@ -0,0 +1,11 @@
+--- src/bltScrollbar.c.orig
++++ src/bltScrollbar.c
+@@ -534,7 +534,7 @@
+ } else {
+ fraction = ((double)pixels / (double)barWidth);
+ }
+- sprintf(interp->result, "%g", fraction);
++ sprintf(Tcl_GetStringResult(interp), "%g", fraction);
+ } else if ((c == 'f') && (strncmp(argv[1], "fraction", length) == 0)) {
+ int x, y, pos, barWidth;
+ double fraction;
diff -urN /usr/ports/x11-toolkits/blt/files/patch-src__bltTable.c x11-toolkits/blt/files/patch-src__bltTable.c
--- /usr/ports/x11-toolkits/blt/files/patch-src__bltTable.c 1970-01-01 09:00:00.000000000 +0900
+++ x11-toolkits/blt/files/patch-src__bltTable.c 2013-11-01 00:00:00.000000000 +0900
@@ -0,0 +1,38 @@
+--- src/bltTable.c.orig
++++ src/bltTable.c
+@@ -2034,7 +2034,7 @@
+ key = 0; /* Initialize key to bogus span */
+ for (node = Blt_ListFirstNode(list); node != NULL;
+ node = Blt_ListNextNode(node)) {
+- key = (int)Blt_ListGetKey(node);
++ key = (intptr_t)Blt_ListGetKey(node);
+ if (entryPtr->row.span <= key) {
+ break;
+ }
+@@ -2046,7 +2046,7 @@
+ * Create a new list (bucket) to hold entries of that size
+ * span and and link it into the list of buckets.
+ */
+- newNode = Blt_ListCreateNode(list, (char *)entryPtr->row.span);
++ newNode = Blt_ListCreateNode(list, (char *)(intptr_t)entryPtr->row.span);
+ Blt_ListSetValue(newNode, (char *)Blt_ChainCreate());
+ Blt_ListLinkBefore(list, newNode, node);
+ node = newNode;
+@@ -2063,7 +2063,7 @@
+ key = 0;
+ for (node = Blt_ListFirstNode(list); node != NULL;
+ node = Blt_ListNextNode(node)) {
+- key = (int)Blt_ListGetKey(node);
++ key = (intptr_t)Blt_ListGetKey(node);
+ if (entryPtr->column.span <= key) {
+ break;
+ }
+@@ -2075,7 +2075,7 @@
+ * Create a new list (bucket) to hold entries of that size
+ * span and and link it into the list of buckets.
+ */
+- newNode = Blt_ListCreateNode(list, (char *)entryPtr->column.span);
++ newNode = Blt_ListCreateNode(list, (char *)(intptr_t)entryPtr->column.span);
+ Blt_ListSetValue(newNode, (char *)Blt_ChainCreate());
+ Blt_ListLinkBefore(list, newNode, node);
+ node = newNode;
diff -urN /usr/ports/x11-toolkits/blt/files/patch-src__bltTed.c x11-toolkits/blt/files/patch-src__bltTed.c
--- /usr/ports/x11-toolkits/blt/files/patch-src__bltTed.c 1970-01-01 09:00:00.000000000 +0900
+++ x11-toolkits/blt/files/patch-src__bltTed.c 2013-11-01 00:00:00.000000000 +0900
@@ -0,0 +1,196 @@
+--- src/bltTed.c.orig
++++ src/bltTed.c
+@@ -306,10 +306,8 @@
+ static void DisplayTed _ANSI_ARGS_((ClientData clientData));
+ static void DestroyTed _ANSI_ARGS_((DestroyData destroyData));
+ static void DisplayEntry _ANSI_ARGS_((ClientData clientData));
+-static void DestroyEntry _ANSI_ARGS_((DestroyData destoryData));
+
+ static Tcl_CmdProc TedCmd;
+-static Tk_EventProc EntryEventProc;
+ static Tk_EventProc TedEventProc;
+
+ /*
+@@ -342,74 +340,6 @@
+ }
+
+ /*
+- *----------------------------------------------------------------------
+- *
+- * EventuallyRedraw --
+- *
+- * Queues a request to redraw the text window at the next idle
+- * point.
+- *
+- * Results:
+- * None.
+- *
+- * Side effects:
+- * Information gets redisplayed. Right now we don't do selective
+- * redisplays: the whole window will be redrawn. This doesn't
+- * seem to hurt performance noticeably, but if it does then this
+- * could be changed.
+- *
+- *----------------------------------------------------------------------
+- */
+-static void
+-EventuallyRedrawEntry(repPtr)
+- EntryRep *repPtr; /* Information about editor. */
+-{
+- if ((repPtr->tkwin != NULL) && !(repPtr->flags & REDRAW_PENDING)) {
+- repPtr->flags |= REDRAW_PENDING;
+- Tcl_DoWhenIdle(DisplayEntry, repPtr);
+- }
+-}
+-
+-/*
+- * --------------------------------------------------------------
+- *
+- * EntryEventProc --
+- *
+- * This procedure is invoked by the Tk dispatcher for various
+- * events on the editing grid for the table.
+- *
+- * Results:
+- * None.
+- *
+- * Side effects:
+- * When the window gets deleted, internal structures get
+- * cleaned up. When it gets exposed, it is redisplayed.
+- *
+- * --------------------------------------------------------------
+- */
+-static void
+-EntryEventProc(clientData, eventPtr)
+- ClientData clientData; /* Information about window. */
+- XEvent *eventPtr; /* Information about event. */
+-{
+- EntryRep *repPtr = (EntryRep *) clientData;
+-
+- if (eventPtr->type == ConfigureNotify) {
+- EventuallyRedrawEntry(repPtr);
+- } else if (eventPtr->type == Expose) {
+- if (eventPtr->xexpose.count == 0) {
+- EventuallyRedrawEntry(repPtr);
+- }
+- } else if (eventPtr->type == DestroyNotify) {
+- repPtr->tkwin = NULL;
+- if (repPtr->flags & REDRAW_PENDING) {
+- Tcl_CancelIdleCall(DisplayEntry, repPtr);
+- }
+- Tcl_EventuallyFree(repPtr, DestroyEntry);
+- }
+-}
+-
+-/*
+ * --------------------------------------------------------------
+ *
+ * TedEventProc --
+@@ -544,80 +474,6 @@
+ /*
+ * ----------------------------------------------------------------------------
+ *
+- * CreateEntry --
+- *
+- * ----------------------------------------------------------------------------
+- */
+-static int
+-CreateEntry(tedPtr, entryPtr)
+- Ted *tedPtr;
+- Entry *entryPtr;
+-{
+- Tk_Window tkwin, master;
+- char string[200];
+- EntryRep *repPtr;
+- Blt_ChainLink *linkPtr;
+-
+- repPtr = Blt_Calloc(1, sizeof(EntryRep));
+- assert(repPtr);
+- repPtr->tablePtr = tedPtr->tablePtr;
+- repPtr->tedPtr = tedPtr;
+- repPtr->interp = tedPtr->interp;
+- repPtr->entryPtr = entryPtr;
+- repPtr->mapped = 0;
+-
+- /*
+- * Create a sibling window to cover the master window. It will
+- * be stacked just above the master window.
+- */
+-
+- master = tedPtr->tablePtr->tkwin;
+- sprintf(string, "bltTed%d", tedPtr->nextWindowId);
+- tedPtr->nextWindowId++;
+- tkwin = Tk_CreateWindow(tedPtr->interp, master, string, (char *)NULL);
+- if (tkwin == NULL) {
+- Blt_Free(repPtr);
+- return TCL_ERROR;
+- }
+- Tk_SetClass(tkwin, "BltTed");
+- Tk_CreateEventHandler(tkwin, ExposureMask | StructureNotifyMask,
+- EntryEventProc, repPtr);
+- repPtr->tkwin = tkwin;
+- linkPtr = Blt_ChainNewLink();
+- Blt_ChainSetValue(linkPtr, repPtr);
+- Blt_ChainLinkAfter(tedPtr->chainPtr, linkPtr, (Blt_ChainLink *)NULL);
+- return TCL_OK;
+-}
+-
+-/*
+- * ----------------------------------------------------------------------------
+- *
+- * DestroyEntry --
+- *
+- * ----------------------------------------------------------------------------
+- */
+-static void
+-DestroyEntry(data)
+- DestroyData data;
+-{
+- EntryRep *repPtr = (EntryRep *)data;
+- Blt_ChainLink *linkPtr;
+- Entry *entryPtr;
+-
+- for (linkPtr = Blt_ChainFirstLink(repPtr->tedPtr->chainPtr);
+- linkPtr != NULL; linkPtr = Blt_ChainNextLink(linkPtr)) {
+- entryPtr = Blt_ChainGetValue(linkPtr);
+- if (entryPtr == repPtr->entryPtr) {
+- Blt_ChainDeleteLink(repPtr->tedPtr->chainPtr, linkPtr);
+- Blt_Free(repPtr);
+- return;
+- }
+- }
+-}
+-
+-/*
+- * ----------------------------------------------------------------------------
+- *
+ * DisplayEntry --
+ *
+ * ----------------------------------------------------------------------------
+@@ -1504,7 +1360,7 @@
+ tablePtr->flags |= ARRANGE_PENDING;
+ Tcl_DoWhenIdle(tablePtr->arrangeProc, tablePtr);
+ }
+- interp->result = Tk_PathName(tedPtr->tkwin);
++ Tcl_SetResult(interp, (char*)Tk_PathName(tedPtr->tkwin), TCL_VOLATILE);
+ tedPtr->flags |= LAYOUT_PENDING;
+ EventuallyRedraw(tedPtr);
+ return TCL_OK;
+@@ -1678,7 +1534,7 @@
+ tedPtr->activeRectArr[4].width = grip - 1;
+ tedPtr->activeRectArr[4].height = grip - 1;
+
+- interp->result = Tk_PathName(entryPtr->tkwin);
++ Tcl_SetResult(interp, (char*)Tk_PathName(entryPtr->tkwin), TCL_VOLATILE);
+ active = 1;
+ break;
+ }
+@@ -1751,7 +1607,7 @@
+ tablePtr->flags |= ARRANGE_PENDING;
+ Tcl_DoWhenIdle(tablePtr->arrangeProc, tablePtr);
+ }
+- interp->result = Tk_PathName(tedPtr->tkwin);
++ Tcl_SetResult(interp, (char*)Tk_PathName(tedPtr->tkwin), TCL_VOLATILE);
+ tedPtr->flags |= LAYOUT_PENDING;
+ EventuallyRedraw(tedPtr);
+ return TCL_OK;
diff -urN /usr/ports/x11-toolkits/blt/files/patch-src__bltText.c x11-toolkits/blt/files/patch-src__bltText.c
--- /usr/ports/x11-toolkits/blt/files/patch-src__bltText.c 1970-01-01 09:00:00.000000000 +0900
+++ x11-toolkits/blt/files/patch-src__bltText.c 2013-11-01 00:00:00.000000000 +0900
@@ -0,0 +1,29 @@
+--- src/bltText.c.orig
++++ src/bltText.c
+@@ -48,7 +48,7 @@
+
+ fragPtr = textPtr->fragArr;
+ for (i = 0; i < textPtr->nFrags; i++, fragPtr++) {
+-#if HAVE_UTF
++#if HAVE_UTF && (TCL_VERSION_NUMBER < _VERSION(8,5,0))
+ Tk_DrawChars(display, drawable, gc, font, fragPtr->text,
+ fragPtr->count, x + fragPtr->x, y + fragPtr->y);
+ #else
+@@ -690,7 +690,7 @@
+ TkBorder *borderPtr = (TkBorder *) tsPtr->border;
+ XColor *color1, *color2;
+
+- color1 = borderPtr->lightColor, color2 = borderPtr->darkColor;
++ color1 = borderPtr->lightColorPtr, color2 = borderPtr->darkColorPtr;
+ if (tsPtr->state & STATE_EMPHASIS) {
+ XColor *hold;
+
+@@ -754,7 +754,7 @@
+ TkBorder *borderPtr = (TkBorder *) tsPtr->border;
+ XColor *color1, *color2;
+
+- color1 = borderPtr->lightColor, color2 = borderPtr->darkColor;
++ color1 = borderPtr->lightColorPtr, color2 = borderPtr->darkColorPtr;
+ if (tsPtr->state & STATE_EMPHASIS) {
+ XColor *hold;
+
diff -urN /usr/ports/x11-toolkits/blt/files/patch-src__bltTkInt.h x11-toolkits/blt/files/patch-src__bltTkInt.h
--- /usr/ports/x11-toolkits/blt/files/patch-src__bltTkInt.h 1970-01-01 09:00:00.000000000 +0900
+++ x11-toolkits/blt/files/patch-src__bltTkInt.h 2013-11-01 00:00:00.000000000 +0900
@@ -0,0 +1,220 @@
+--- src/bltTkInt.h.orig
++++ src/bltTkInt.h
+@@ -27,214 +27,8 @@
+ #ifndef _BLT_TKINT_H
+ #define _BLT_TKINT_H
+
+-typedef struct {
+- 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 {
+- 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 TkFontStruct {
+- /*
+- * 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 TkFontStruct *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 TkRegionStruct *TkRegion;
+-
+-typedef struct {
+- 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
+-
+-typedef struct TkWindowStruct TkWindow;
+-
+-typedef struct {
+- int type;
+- HWND handle;
+- 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 {
+- HPALETTE palette;
+- int bkmode; /* This field was added in Tk
+- * 8.3.1. Be careful that you don't
+- * use this structure in a context
+- * where its size is important. */
+-} 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 TkBorderStruct {
+- 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 TkBorderStruct *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;
++#include <tkInt.h>
++#include <tk3d.h>
++#include <tkFont.h>
+
+ #endif /* BLT_TKINT_H */
diff -urN /usr/ports/x11-toolkits/blt/files/patch-src__bltTree.c x11-toolkits/blt/files/patch-src__bltTree.c
--- /usr/ports/x11-toolkits/blt/files/patch-src__bltTree.c 1970-01-01 09:00:00.000000000 +0900
+++ x11-toolkits/blt/files/patch-src__bltTree.c 2013-11-01 00:00:00.000000000 +0900
@@ -0,0 +1,60 @@
+--- src/bltTree.c.orig
++++ src/bltTree.c
+@@ -96,16 +96,16 @@
+
+ #define REBUILD_MULTIPLIER 3
+
+-#if (SIZEOF_VOID_P == 8)
+-#define RANDOM_INDEX(i) HashOneWord(mask, downshift, i)
+-#define BITSPERWORD 64
+-#else
+-
+ #define START_LOGSIZE 5 /* Initial hash table size is 32. */
+ #define MAX_LIST_VALUES 20 /* Convert to hash table when node
+ * value list gets bigger than this
+ * many values. */
+
++
++#if (SIZEOF_VOID_P == 8)
++#define RANDOM_INDEX(i) HashOneWord(mask, downshift, i)
++#define BITSPERWORD 64
++#else
+ /*
+ * The following macro takes a preliminary integer hash value and
+ * produces an index into a hash tables bucket list. The idea is
+@@ -403,7 +403,7 @@
+ TreeDestroyValues(nodePtr);
+ UnlinkNode(nodePtr);
+ treeObjPtr->nNodes--;
+- hPtr = Blt_FindHashEntry(&treeObjPtr->nodeTable, (char *)nodePtr->inode);
++ hPtr = Blt_FindHashEntry(&treeObjPtr->nodeTable, (char *)(uintptr_t)nodePtr->inode);
+ assert(hPtr);
+ Blt_DeleteHashEntry(&treeObjPtr->nodeTable, hPtr);
+ Blt_PoolFreeItem(treeObjPtr->nodePool, (char *)nodePtr);
+@@ -836,7 +836,7 @@
+ /* Generate an unique serial number for this node. */
+ do {
+ inode = treeObjPtr->nextInode++;
+- hPtr = Blt_CreateHashEntry(&treeObjPtr->nodeTable,(char *)inode,
++ hPtr = Blt_CreateHashEntry(&treeObjPtr->nodeTable,(char *)(uintptr_t)inode,
+ &isNew);
+ } while (!isNew);
+ nodePtr = NewNode(treeObjPtr, name, inode);
+@@ -891,7 +891,7 @@
+ int isNew;
+
+ treeObjPtr = parentPtr->treeObject;
+- hPtr = Blt_CreateHashEntry(&treeObjPtr->nodeTable,(char *)inode, &isNew);
++ hPtr = Blt_CreateHashEntry(&treeObjPtr->nodeTable,(char *)(uintptr_t)inode, &isNew);
+ if (!isNew) {
+ return NULL;
+ }
+@@ -997,7 +997,7 @@
+ TreeObject *treeObjPtr = clientPtr->treeObject;
+ Blt_HashEntry *hPtr;
+
+- hPtr = Blt_FindHashEntry(&treeObjPtr->nodeTable, (char *)inode);
++ hPtr = Blt_FindHashEntry(&treeObjPtr->nodeTable, (char *)(uintptr_t)inode);
+ if (hPtr != NULL) {
+ return (Blt_TreeNode)Blt_GetHashValue(hPtr);
+ }
diff -urN /usr/ports/x11-toolkits/blt/files/patch-src__bltTreeCmd.c x11-toolkits/blt/files/patch-src__bltTreeCmd.c
--- /usr/ports/x11-toolkits/blt/files/patch-src__bltTreeCmd.c 1970-01-01 09:00:00.000000000 +0900
+++ x11-toolkits/blt/files/patch-src__bltTreeCmd.c 2013-11-01 00:00:00.000000000 +0900
@@ -0,0 +1,76 @@
+--- src/bltTreeCmd.c.orig
++++ src/bltTreeCmd.c
+@@ -950,7 +950,7 @@
+ Tcl_Interp *interp = cmdPtr->interp;
+ Blt_Tree tree = cmdPtr->tree;
+ char c;
+- Blt_TreeNode node;
++ Blt_TreeNode node = NULL;
+ char *string;
+ char *p;
+
+@@ -1283,8 +1283,8 @@
+ if (parentId == -1) { /* Dump marks root's parent as -1. */
+ node = dataPtr->root;
+ /* Create a mapping between the old id and the new node */
+- hPtr = Blt_CreateHashEntry(&dataPtr->idTable, (char *)nodeId,
+- &isNew);
++ hPtr = Blt_CreateHashEntry(&dataPtr->idTable,
++ (char *)(uintptr_t)nodeId, &isNew);
+ Blt_SetHashValue(hPtr, node);
+ Blt_TreeRelabelNode(cmdPtr->tree, node, names[0]);
+ } else {
+@@ -1293,7 +1293,7 @@
+ * This can happen when there's a id collision with an
+ * existing node.
+ */
+- hPtr = Blt_FindHashEntry(&dataPtr->idTable, (char *)parentId);
++ hPtr = Blt_FindHashEntry(&dataPtr->idTable, (char *)(uintptr_t)parentId);
+ if (hPtr != NULL) {
+ parent = Blt_GetHashValue(hPtr);
+ } else {
+@@ -1330,7 +1330,7 @@
+ if (dataPtr->flags & RESTORE_OVERWRITE) {
+ node = Blt_TreeFindChild(parent, names[nNames - 1]);
+ /* Create a mapping between the old id and the new node */
+- hPtr = Blt_CreateHashEntry(&dataPtr->idTable, (char *)nodeId,
++ hPtr = Blt_CreateHashEntry(&dataPtr->idTable, (char *)(uintptr_t)nodeId,
+ &isNew);
+ Blt_SetHashValue(hPtr, node);
+ }
+@@ -1340,7 +1340,7 @@
+ node = Blt_TreeCreateNode(cmdPtr->tree, parent,
+ names[nNames - 1], -1);
+ /* Create a mapping between the old id and the new node */
+- hPtr = Blt_CreateHashEntry(&dataPtr->idTable, (char *)nodeId,
++ hPtr = Blt_CreateHashEntry(&dataPtr->idTable, (char *)(uintptr_t)nodeId,
+ &isNew);
+ Blt_SetHashValue(hPtr, node);
+ } else {
+@@ -1667,7 +1667,7 @@
+ for (node = Blt_ListFirstNode(patternList); node != NULL;
+ node = Blt_ListNextNode(node)) {
+
+- type = (int)Blt_ListGetValue(node);
++ type = (intptr_t)Blt_ListGetValue(node);
+ pattern = (char *)Blt_ListGetKey(node);
+ switch (type) {
+ case PATTERN_EXACT:
+@@ -2602,7 +2602,7 @@
+ for (hPtr = Blt_FirstHashEntry(tablePtr, &cursor);
+ hPtr != NULL; hPtr = Blt_NextHashEntry(&cursor)) {
+ node = Blt_GetHashValue(hPtr);
+- Blt_ChainAppend(chainPtr, (ClientData)Blt_TreeNodeId(node));
++ Blt_ChainAppend(chainPtr, (ClientData)(uintptr_t)Blt_TreeNodeId(node));
+ }
+ /*
+ * Iterate through this list to delete the nodes. By
+@@ -2612,7 +2612,7 @@
+ for (linkPtr = Blt_ChainFirstLink(chainPtr); linkPtr != NULL;
+ linkPtr = nextPtr) {
+ nextPtr = Blt_ChainNextLink(linkPtr);
+- inode = (int)Blt_ChainGetValue(linkPtr);
++ inode = (intptr_t)Blt_ChainGetValue(linkPtr);
+ node = Blt_TreeGetNode(cmdPtr->tree, inode);
+ if (node != NULL) {
+ DeleteNode(cmdPtr, node);
diff -urN /usr/ports/x11-toolkits/blt/files/patch-src__bltTreeView.c x11-toolkits/blt/files/patch-src__bltTreeView.c
--- /usr/ports/x11-toolkits/blt/files/patch-src__bltTreeView.c 1970-01-01 09:00:00.000000000 +0900
+++ x11-toolkits/blt/files/patch-src__bltTreeView.c 2013-11-01 00:00:00.000000000 +0900
@@ -0,0 +1,32 @@
+--- src/bltTreeView.c.orig
++++ src/bltTreeView.c
+@@ -1049,13 +1049,13 @@
+ {
+ Blt_HashEntry *hPtr;
+ int isNew;
+- int refCount;
++ intptr_t refCount;
+
+ hPtr = Blt_CreateHashEntry(&tvPtr->uidTable, string, &isNew);
+ if (isNew) {
+ refCount = 1;
+ } else {
+- refCount = (int)Blt_GetHashValue(hPtr);
++ refCount = (intptr_t)Blt_GetHashValue(hPtr);
+ refCount++;
+ }
+ Blt_SetHashValue(hPtr, (ClientData)refCount);
+@@ -1080,11 +1080,11 @@
+ Blt_TreeViewFreeUid(TreeView *tvPtr, UID uid)
+ {
+ Blt_HashEntry *hPtr;
+- int refCount;
++ intptr_t refCount;
+
+ hPtr = Blt_FindHashEntry(&tvPtr->uidTable, uid);
+ assert(hPtr != NULL);
+- refCount = (int)Blt_GetHashValue(hPtr);
++ refCount = (intptr_t)Blt_GetHashValue(hPtr);
+ refCount--;
+ if (refCount > 0) {
+ Blt_SetHashValue(hPtr, (ClientData)refCount);
diff -urN /usr/ports/x11-toolkits/blt/files/patch-src__bltTreeView.h x11-toolkits/blt/files/patch-src__bltTreeView.h
--- /usr/ports/x11-toolkits/blt/files/patch-src__bltTreeView.h 1970-01-01 09:00:00.000000000 +0900
+++ x11-toolkits/blt/files/patch-src__bltTreeView.h 2013-11-01 00:00:00.000000000 +0900
@@ -0,0 +1,11 @@
+--- src/bltTreeView.h.orig
++++ src/bltTreeView.h
+@@ -1004,6 +1004,8 @@
+
+ extern void Blt_TreeViewDrawRule _ANSI_ARGS_((TreeView *tvPtr,
+ TreeViewColumn *columnPtr, Drawable drawable));
++extern int Blt_TreeViewTextbox _ANSI_ARGS_((TreeView *tvPtr,
++ TreeViewEntry *entryPtr, TreeViewColumn *columnPtr));
+ extern int Blt_TreeViewTextOp _ANSI_ARGS_((TreeView *tvPtr, Tcl_Interp *interp,
+ int objc, Tcl_Obj *CONST *objv));
+ extern int Blt_TreeViewCombobox _ANSI_ARGS_((TreeView *tvPtr,
diff -urN /usr/ports/x11-toolkits/blt/files/patch-src__bltTreeViewStyle.c x11-toolkits/blt/files/patch-src__bltTreeViewStyle.c
--- /usr/ports/x11-toolkits/blt/files/patch-src__bltTreeViewStyle.c 1970-01-01 09:00:00.000000000 +0900
+++ x11-toolkits/blt/files/patch-src__bltTreeViewStyle.c 2013-11-01 00:00:00.000000000 +0900
@@ -0,0 +1,72 @@
+--- src/bltTreeViewStyle.c.orig
++++ src/bltTreeViewStyle.c
+@@ -415,7 +415,7 @@
+ static StyleEditProc EditTextBox, EditCheckBox, EditComboBox;
+ static StyleFreeProc FreeTextBox, FreeCheckBox, FreeComboBox;
+ static StyleMeasureProc MeasureTextBox, MeasureCheckBox, MeasureComboBox;
+-static StylePickProc PickCheckBox, PickComboBox;
++static StylePickProc PickComboBox;
+
+ /*
+ *----------------------------------------------------------------------
+@@ -1263,60 +1263,6 @@
+ /*
+ *----------------------------------------------------------------------
+ *
+- * PickCheckbox --
+- *
+- * Draws the "checkbox" given the screen coordinates and the
+- * value to be displayed.
+- *
+- * Results:
+- * None.
+- *
+- * Side Effects:
+- * The checkbox value is drawn.
+- *
+- *----------------------------------------------------------------------
+- */
+-static int
+-PickCheckBox(entryPtr, valuePtr, stylePtr, worldX, worldY)
+- TreeViewEntry *entryPtr;
+- TreeViewValue *valuePtr;
+- TreeViewStyle *stylePtr;
+- int worldX, worldY;
+-{
+- TreeViewColumn *columnPtr;
+- TreeViewCheckBox *cbPtr = (TreeViewCheckBox *)stylePtr;
+- int columnWidth;
+- int x, y, width, height;
+-
+- columnPtr = valuePtr->columnPtr;
+- columnWidth = columnPtr->width -
+- (2 * columnPtr->borderWidth + PADDING(columnPtr->pad));
+- if (columnWidth > valuePtr->width) {
+- switch(columnPtr->justify) {
+- case TK_JUSTIFY_RIGHT:
+- worldX += (columnWidth - valuePtr->width);
+- break;
+- case TK_JUSTIFY_CENTER:
+- worldX += (columnWidth - valuePtr->width) / 2;
+- break;
+- case TK_JUSTIFY_LEFT:
+- break;
+- }
+- }
+- width = height = ODD(cbPtr->size) + 2 * cbPtr->lineWidth;
+- x = columnPtr->worldX + columnPtr->pad.side1 + cbPtr->gap -
+- cbPtr->lineWidth;
+- y = entryPtr->worldY + (entryPtr->height - height) / 2;
+- if ((worldX >= x) && (worldX < (x + width)) &&
+- (worldY >= y) && (worldY < (y + height))) {
+- return TRUE;
+- }
+- return FALSE;
+-}
+-
+-/*
+- *----------------------------------------------------------------------
+- *
+ * EditCheckbox --
+ *
+ * Edits the "checkbox".
diff -urN /usr/ports/x11-toolkits/blt/files/patch-src__bltUnixImage.c x11-toolkits/blt/files/patch-src__bltUnixImage.c
--- /usr/ports/x11-toolkits/blt/files/patch-src__bltUnixImage.c 1970-01-01 09:00:00.000000000 +0900
+++ x11-toolkits/blt/files/patch-src__bltUnixImage.c 2013-11-01 00:00:00.000000000 +0900
@@ -0,0 +1,11 @@
+--- src/bltUnixImage.c.orig
++++ src/bltUnixImage.c
+@@ -574,7 +574,7 @@
+ destPtr = Blt_ColorImageBits(image);
+ endPtr = destPtr + nPixels;
+ for (/* empty */; destPtr < endPtr; destPtr++) {
+- hPtr = Blt_FindHashEntry(&pixelTable, (char *)destPtr->value);
++ hPtr = Blt_FindHashEntry(&pixelTable, (char *)(intptr_t)destPtr->value);
+ colorPtr = (XColor *)Blt_GetHashValue(hPtr);
+ destPtr->Red = lut[colorPtr->red >> 8];
+ destPtr->Green = lut[colorPtr->green >> 8];
diff -urN /usr/ports/x11-toolkits/blt/files/patch-src__bltUnixPipe.c x11-toolkits/blt/files/patch-src__bltUnixPipe.c
--- /usr/ports/x11-toolkits/blt/files/patch-src__bltUnixPipe.c 1970-01-01 09:00:00.000000000 +0900
+++ x11-toolkits/blt/files/patch-src__bltUnixPipe.c 2013-11-01 00:00:00.000000000 +0900
@@ -0,0 +1,11 @@
+--- src/bltUnixPipe.c.orig
++++ src/bltUnixPipe.c
+@@ -477,7 +477,7 @@
+ * Reap the child process now if an error occurred during its
+ * startup.
+ */
+- Tcl_WaitPid((Tcl_Pid)pid, &status, WNOHANG);
++ Tcl_WaitPid((Tcl_Pid)(intptr_t)pid, &status, WNOHANG);
+ }
+ if (errPipeIn >= 0) {
+ CloseFile(errPipeIn);
diff -urN /usr/ports/x11-toolkits/blt/files/patch-src__bltUtil.c x11-toolkits/blt/files/patch-src__bltUtil.c
--- /usr/ports/x11-toolkits/blt/files/patch-src__bltUtil.c 1970-01-01 09:00:00.000000000 +0900
+++ x11-toolkits/blt/files/patch-src__bltUtil.c 2013-11-01 00:00:00.000000000 +0900
@@ -0,0 +1,46 @@
+--- src/bltUtil.c.orig
++++ src/bltUtil.c
+@@ -779,11 +779,11 @@
+ */
+ Blt_Uid
+ Blt_GetUid(string)
+- char *string; /* String to convert. */
++ const char *string; /* String to convert. */
+ {
+ int isNew;
+ Blt_HashEntry *hPtr;
+- int refCount;
++ intptr_t refCount;
+
+ if (!uidInitialized) {
+ Blt_InitHashTable(&uidTable, BLT_STRING_KEYS);
+@@ -793,7 +793,7 @@
+ if (isNew) {
+ refCount = 0;
+ } else {
+- refCount = (int)Blt_GetHashValue(hPtr);
++ refCount = (intptr_t)Blt_GetHashValue(hPtr);
+ }
+ refCount++;
+ Blt_SetHashValue(hPtr, (ClientData)refCount);
+@@ -828,9 +828,9 @@
+ }
+ hPtr = Blt_FindHashEntry(&uidTable, uid);
+ if (hPtr) {
+- int refCount;
++ intptr_t refCount;
+
+- refCount = (int)Blt_GetHashValue(hPtr);
++ refCount = (intptr_t)Blt_GetHashValue(hPtr);
+ refCount--;
+ if (refCount == 0) {
+ Blt_DeleteHashEntry(&uidTable, hPtr);
+@@ -856,7 +856,7 @@
+ */
+ Blt_Uid
+ Blt_FindUid(string)
+- char *string; /* String to find. */
++ const char *string; /* String to find. */
+ {
+ Blt_HashEntry *hPtr;
+
diff -urN /usr/ports/x11-toolkits/blt/files/patch-src__bltVecMath.c x11-toolkits/blt/files/patch-src__bltVecMath.c
--- /usr/ports/x11-toolkits/blt/files/patch-src__bltVecMath.c 1970-01-01 09:00:00.000000000 +0900
+++ x11-toolkits/blt/files/patch-src__bltVecMath.c 2013-11-01 00:00:00.000000000 +0900
@@ -0,0 +1,35 @@
+--- src/bltVecMath.c.orig
++++ src/bltVecMath.c
+@@ -764,20 +764,20 @@
+ if ((errno == EDOM) || (value != value)) {
+ Tcl_AppendResult(interp, "domain error: argument not in valid range",
+ (char *)NULL);
+- Tcl_SetErrorCode(interp, "ARITH", "DOMAIN", interp->result,
++ Tcl_SetErrorCode(interp, "ARITH", "DOMAIN", Tcl_GetStringResult(interp),
+ (char *)NULL);
+ } else if ((errno == ERANGE) || IS_INF(value)) {
+ if (value == 0.0) {
+ Tcl_AppendResult(interp,
+ "floating-point value too small to represent",
+ (char *)NULL);
+- Tcl_SetErrorCode(interp, "ARITH", "UNDERFLOW", interp->result,
++ Tcl_SetErrorCode(interp, "ARITH", "UNDERFLOW", Tcl_GetStringResult(interp),
+ (char *)NULL);
+ } else {
+ Tcl_AppendResult(interp,
+ "floating-point value too large to represent",
+ (char *)NULL);
+- Tcl_SetErrorCode(interp, "ARITH", "OVERFLOW", interp->result,
++ Tcl_SetErrorCode(interp, "ARITH", "OVERFLOW", Tcl_GetStringResult(interp),
+ (char *)NULL);
+ }
+ } else {
+@@ -786,7 +786,7 @@
+ sprintf(buf, "%d", errno);
+ Tcl_AppendResult(interp, "unknown floating-point error, ",
+ "errno = ", buf, (char *)NULL);
+- Tcl_SetErrorCode(interp, "ARITH", "UNKNOWN", interp->result,
++ Tcl_SetErrorCode(interp, "ARITH", "UNKNOWN", Tcl_GetStringResult(interp),
+ (char *)NULL);
+ }
+ }
diff -urN /usr/ports/x11-toolkits/blt/files/patch-src__bltWindow.c x11-toolkits/blt/files/patch-src__bltWindow.c
--- /usr/ports/x11-toolkits/blt/files/patch-src__bltWindow.c 1970-01-01 09:00:00.000000000 +0900
+++ x11-toolkits/blt/files/patch-src__bltWindow.c 2013-11-01 00:00:00.000000000 +0900
@@ -0,0 +1,782 @@
+--- src/bltWindow.c.orig
++++ src/bltWindow.c
+@@ -33,25 +33,7 @@
+ #include <X11/Xproto.h>
+ #endif
+
+-typedef struct TkIdStackStruct TkIdStack;
+-typedef struct TkErrorHandlerStruct TkErrorHandler;
+-typedef struct TkSelectionInfoStruct TkSelectionInfo;
+-typedef struct TkClipboardTargetStruct TkClipboardTarget;
+-
+-#ifndef WIN32
+-typedef struct TkWindowStruct TkWindow;
+-#endif
+-typedef struct TkWindowEventStruct TkWindowEvent;
+-typedef struct TkMainInfoStruct TkMainInfo;
+-typedef struct TkEventHandlerStruct TkEventHandler;
+-typedef struct TkSelHandlerStruct TkSelHandler;
+-typedef struct TkWinInfoStruct TkWinInfo;
+-typedef struct TkClassProcsStruct TkClassProcs;
+-typedef struct TkWindowPrivateStruct TkWindowPrivate;
+-typedef struct TkGrabEventStruct TkGrabEvent;
+-typedef struct TkColormapStruct TkColormap;
+-typedef struct TkStressedCmapStruct TkStressedCmap;
+-typedef struct TkWmInfoStruct TkWmInfo;
++#include <tkInt.h>
+
+ #ifdef XNQueryInputStyle
+ #define TK_USE_INPUT_METHODS
+@@ -70,752 +52,6 @@
+ #define TK_REPARENTED 0
+ #endif
+
+-#if (TK_VERSION_NUMBER >= _VERSION(8,1,0))
+-
+-typedef struct TkCaret {
+- struct TkWindow *winPtr; /* the window on which we requested caret
+- * placement */
+- int x; /* relative x coord of the caret */
+- int y; /* relative y coord of the caret */
+- int height; /* specified height of the window */
+-} TkCaret;
+-
+-/*
+- * One of the following structures is maintained for each display
+- * containing a window managed by Tk. In part, the structure is
+- * used to store thread-specific data, since each thread will have
+- * its own TkDisplay structure.
+- */
+-
+-typedef struct TkDisplayStruct {
+- Display *display; /* Xlib's info about display. */
+- struct TkDisplayStruct *nextPtr; /* Next in list of all displays. */
+- char *name; /* Name of display (with any screen
+- * identifier removed). Malloc-ed. */
+- Time lastEventTime; /* Time of last event received for this
+- * display. */
+-
+- /*
+- * Information used primarily by tk3d.c:
+- */
+-
+- int borderInit; /* 0 means borderTable needs initializing. */
+- Tcl_HashTable borderTable; /* Maps from color name to TkBorder
+- * structure. */
+-
+- /*
+- * Information used by tkAtom.c only:
+- */
+-
+- int atomInit; /* 0 means stuff below hasn't been
+- * initialized yet. */
+- Tcl_HashTable nameTable; /* Maps from names to Atom's. */
+- Tcl_HashTable atomTable; /* Maps from Atom's back to names. */
+-
+- /*
+- * Information used primarily by tkBind.c:
+- */
+-
+- int bindInfoStale; /* Non-zero means the variables in this
+- * part of the structure are potentially
+- * incorrect and should be recomputed. */
+- unsigned int modeModMask; /* Has one bit set to indicate the modifier
+- * corresponding to "mode shift". If no
+- * such modifier, than this is zero. */
+- unsigned int metaModMask; /* Has one bit set to indicate the modifier
+- * corresponding to the "Meta" key. If no
+- * such modifier, then this is zero. */
+- unsigned int altModMask; /* Has one bit set to indicate the modifier
+- * corresponding to the "Meta" key. If no
+- * such modifier, then this is zero. */
+- enum {
+- LU_IGNORE, LU_CAPS, LU_SHIFT
+- } lockUsage; /* Indicates how to interpret lock modifier. */
+- int numModKeyCodes; /* Number of entries in modKeyCodes array
+- * below. */
+- KeyCode *modKeyCodes; /* Pointer to an array giving keycodes for
+- * all of the keys that have modifiers
+- * associated with them. Malloc'ed, but
+- * may be NULL. */
+-
+- /*
+- * Information used by tkBitmap.c only:
+- */
+-
+- int bitmapInit; /* 0 means tables above need initializing. */
+- int bitmapAutoNumber; /* Used to number bitmaps. */
+- Tcl_HashTable bitmapNameTable;
+- /* Maps from name of bitmap to the first
+- * TkBitmap record for that name. */
+- Tcl_HashTable bitmapIdTable;/* Maps from bitmap id to the TkBitmap
+- * structure for the bitmap. */
+- Tcl_HashTable bitmapDataTable;
+- /* Used by Tk_GetBitmapFromData to map from
+- * a collection of in-core data about a
+- * bitmap to a reference giving an auto-
+- * matically-generated name for the bitmap. */
+-
+- /*
+- * Information used by tkCanvas.c only:
+- */
+-
+- int numIdSearches;
+- int numSlowSearches;
+-
+- /*
+- * Used by tkColor.c only:
+- */
+-
+- int colorInit; /* 0 means color module needs initializing. */
+- TkStressedCmap *stressPtr; /* First in list of colormaps that have
+- * filled up, so we have to pick an
+- * approximate color. */
+- Tcl_HashTable colorNameTable;
+- /* Maps from color name to TkColor structure
+- * for that color. */
+- Tcl_HashTable colorValueTable;
+- /* Maps from integer RGB values to TkColor
+- * structures. */
+-
+- /*
+- * Used by tkCursor.c only:
+- */
+-
+- int cursorInit; /* 0 means cursor module need initializing. */
+- Tcl_HashTable cursorNameTable;
+- /* Maps from a string name to a cursor to the
+- * TkCursor record for the cursor. */
+- Tcl_HashTable cursorDataTable;
+- /* Maps from a collection of in-core data
+- * about a cursor to a TkCursor structure. */
+- Tcl_HashTable cursorIdTable;
+- /* Maps from a cursor id to the TkCursor
+- * structure for the cursor. */
+- char cursorString[20]; /* Used to store a cursor id string. */
+- Font cursorFont; /* Font to use for standard cursors.
+- * None means font not loaded yet. */
+-
+- /*
+- * Information used by tkError.c only:
+- */
+-
+- struct TkErrorHandler *errorPtr;
+- /* First in list of error handlers
+- * for this display. NULL means
+- * no handlers exist at present. */
+- int deleteCount; /* Counts # of handlers deleted since
+- * last time inactive handlers were
+- * garbage-collected. When this number
+- * gets big, handlers get cleaned up. */
+-
+- /*
+- * Used by tkEvent.c only:
+- */
+-
+- struct TkWindowEvent *delayedMotionPtr;
+- /* Points to a malloc-ed motion event
+- * whose processing has been delayed in
+- * the hopes that another motion event
+- * will come along right away and we can
+- * merge the two of them together. NULL
+- * means that there is no delayed motion
+- * event. */
+-
+- /*
+- * Information used by tkFocus.c only:
+- */
+-
+- int focusDebug; /* 1 means collect focus debugging
+- * statistics. */
+- struct TkWindow *implicitWinPtr;
+- /* If the focus arrived at a toplevel window
+- * implicitly via an Enter event (rather
+- * than via a FocusIn event), this points
+- * to the toplevel window. Otherwise it is
+- * NULL. */
+- struct TkWindow *focusPtr; /* Points to the window on this display that
+- * should be receiving keyboard events. When
+- * multiple applications on the display have
+- * the focus, this will refer to the
+- * innermost window in the innermost
+- * application. This information isn't used
+- * under Unix or Windows, but it's needed on
+- * the Macintosh. */
+-
+- /*
+- * Information used by tkGC.c only:
+- */
+-
+- Tcl_HashTable gcValueTable; /* Maps from a GC's values to a TkGC structure
+- * describing a GC with those values. */
+- Tcl_HashTable gcIdTable; /* Maps from a GC to a TkGC. */
+- int gcInit; /* 0 means the tables below need
+- * initializing. */
+-
+- /*
+- * Information used by tkGeometry.c only:
+- */
+-
+- Tcl_HashTable maintainHashTable;
+- /* Hash table that maps from a master's
+- * Tk_Window token to a list of slaves
+- * managed by that master. */
+- int geomInit;
+-
+- /*
+- * Information used by tkGet.c only:
+- */
+-
+- Tcl_HashTable uidTable; /* Stores all Tk_Uids used in a thread. */
+- int uidInit; /* 0 means uidTable needs initializing. */
+-
+- /*
+- * Information used by tkGrab.c only:
+- */
+-
+- struct TkWindow *grabWinPtr;
+- /* Window in which the pointer is currently
+- * grabbed, or NULL if none. */
+- struct TkWindow *eventualGrabWinPtr;
+- /* Value that grabWinPtr will have once the
+- * grab event queue (below) has been
+- * completely emptied. */
+- struct TkWindow *buttonWinPtr;
+- /* Window in which first mouse button was
+- * pressed while grab was in effect, or NULL
+- * if no such press in effect. */
+- struct TkWindow *serverWinPtr;
+- /* If no application contains the pointer then
+- * this is NULL. Otherwise it contains the
+- * last window for which we've gotten an
+- * Enter or Leave event from the server (i.e.
+- * the last window known to have contained
+- * the pointer). Doesn't reflect events
+- * that were synthesized in tkGrab.c. */
+- TkGrabEvent *firstGrabEventPtr;
+- /* First in list of enter/leave events
+- * synthesized by grab code. These events
+- * must be processed in order before any other
+- * events are processed. NULL means no such
+- * events. */
+- TkGrabEvent *lastGrabEventPtr;
+- /* Last in list of synthesized events, or NULL
+- * if list is empty. */
+- int grabFlags; /* Miscellaneous flag values. See definitions
+- * in tkGrab.c. */
+-
+- /*
+- * Information used by tkGrid.c only:
+- */
+-
+- int gridInit; /* 0 means table below needs initializing. */
+- Tcl_HashTable gridHashTable;/* Maps from Tk_Window tokens to
+- * corresponding Grid structures. */
+-
+- /*
+- * Information used by tkImage.c only:
+- */
+-
+- int imageId; /* Value used to number image ids. */
+-
+- /*
+- * Information used by tkMacWinMenu.c only:
+- */
+-
+- int postCommandGeneration;
+-
+- /*
+- * Information used by tkOption.c only.
+- */
+-
+-
+-
+- /*
+- * Information used by tkPack.c only.
+- */
+-
+- int packInit; /* 0 means table below needs initializing. */
+- Tcl_HashTable packerHashTable;
+- /* Maps from Tk_Window tokens to
+- * corresponding Packer structures. */
+-
+-
+- /*
+- * Information used by tkPlace.c only.
+- */
+-
+- int placeInit; /* 0 means tables below need initializing. */
+- Tcl_HashTable masterTable; /* Maps from Tk_Window toke to the Master
+- * structure for the window, if it exists. */
+- Tcl_HashTable slaveTable; /* Maps from Tk_Window toke to the Slave
+- * structure for the window, if it exists. */
+-
+- /*
+- * Information used by tkSelect.c and tkClipboard.c only:
+- */
+-
+-
+- struct TkSelectionInfo *selectionInfoPtr;
+- /* First in list of selection information
+- * records. Each entry contains information
+- * about the current owner of a particular
+- * selection on this display. */
+- Atom multipleAtom; /* Atom for MULTIPLE. None means
+- * selection stuff isn't initialized. */
+- Atom incrAtom; /* Atom for INCR. */
+- Atom targetsAtom; /* Atom for TARGETS. */
+- Atom timestampAtom; /* Atom for TIMESTAMP. */
+- Atom textAtom; /* Atom for TEXT. */
+- Atom compoundTextAtom; /* Atom for COMPOUND_TEXT. */
+- Atom applicationAtom; /* Atom for TK_APPLICATION. */
+- Atom windowAtom; /* Atom for TK_WINDOW. */
+- Atom clipboardAtom; /* Atom for CLIPBOARD. */
+-#if (TK_VERSION_NUMBER >= _VERSION(8,4,0))
+- Atom utf8Atom;
+-#endif
+- Tk_Window clipWindow; /* Window used for clipboard ownership and to
+- * retrieve selections between processes. NULL
+- * means clipboard info hasn't been
+- * initialized. */
+- int clipboardActive; /* 1 means we currently own the clipboard
+- * selection, 0 means we don't. */
+- struct TkMainInfo *clipboardAppPtr;
+- /* Last application that owned clipboard. */
+- struct TkClipboardTarget *clipTargetPtr;
+- /* First in list of clipboard type information
+- * records. Each entry contains information
+- * about the buffers for a given selection
+- * target. */
+-
+- /*
+- * Information used by tkSend.c only:
+- */
+-
+- Tk_Window commTkwin; /* Window used for communication
+- * between interpreters during "send"
+- * commands. NULL means send info hasn't
+- * been initialized yet. */
+- Atom commProperty; /* X's name for comm property. */
+- Atom registryProperty; /* X's name for property containing
+- * registry of interpreter names. */
+- Atom appNameProperty; /* X's name for property used to hold the
+- * application name on each comm window. */
+-
+- /*
+- * Information used by tkXId.c only:
+- */
+-
+- struct TkIdStack *idStackPtr;
+- /* First in list of chunks of free resource
+- * identifiers, or NULL if there are no free
+- * resources. */
+- XID(*defaultAllocProc) _ANSI_ARGS_((Display *display));
+- /* Default resource allocator for display. */
+- struct TkIdStack *windowStackPtr;
+- /* First in list of chunks of window
+- * identifers that can't be reused right
+- * now. */
+-#if (TK_VERSION_NUMBER < _VERSION(8,4,0))
+- int idCleanupScheduled; /* 1 means a call to WindowIdCleanup has
+- * already been scheduled, 0 means it
+- * hasn't. */
+-#else
+- Tcl_TimerToken idCleanupScheduled;
+- /* If set, it means a call to WindowIdCleanup
+- * has already been scheduled, 0 means it
+- * hasn't. */
+-#endif
+- /*
+- * Information used by tkUnixWm.c and tkWinWm.c only:
+- */
+-
+-#if (TK_VERSION_NUMBER < _VERSION(8,4,0))
+- int wmTracing; /* Used to enable or disable tracing in
+- * this module. If tracing is enabled,
+- * then information is printed on
+- * standard output about interesting
+- * interactions with the window manager. */
+-#endif
+- struct TkWmInfo *firstWmPtr; /* Points to first top-level window. */
+- struct TkWmInfo *foregroundWmPtr;
+- /* Points to the foreground window. */
+-
+- /*
+- * Information maintained by tkWindow.c for use later on by tkXId.c:
+- */
+-
+-
+- int destroyCount; /* Number of Tk_DestroyWindow operations
+- * in progress. */
+- unsigned long lastDestroyRequest;
+- /* Id of most recent XDestroyWindow request;
+- * can re-use ids in windowStackPtr when
+- * server has seen this request and event
+- * queue is empty. */
+-
+- /*
+- * Information used by tkVisual.c only:
+- */
+-
+- TkColormap *cmapPtr; /* First in list of all non-default colormaps
+- * allocated for this display. */
+-
+- /*
+- * Miscellaneous information:
+- */
+-
+-#ifdef TK_USE_INPUT_METHODS
+- XIM inputMethod; /* Input method for this display */
+-#if (TK_VERSION_NUMBER >= _VERSION(8,4,0))
+-#if TK_XIM_SPOT
+- XFontSet inputXfs; /* XFontSet cached for over-the-spot XIM. */
+-#endif /* TK_XIM_SPOT */
+-#endif /* TK_VERSION_NUMBER >= 8.4 */
+-#endif /* TK_USE_INPUT_METHODS */
+- Tcl_HashTable winTable; /* Maps from X window ids to TkWindow ptrs. */
+- int refCount; /* Reference count of how many Tk applications
+- * are using this display. Used to clean up
+- * the display when we no longer have any
+- * Tk applications using it.
+- */
+- /*
+- * The following field were all added for Tk8.3
+- */
+- int mouseButtonState; /* current mouse button state for this
+- * display */
+-#if (TK_VERSION_NUMBER < _VERSION(8,4,0))
+- int warpInProgress;
+-#endif
+- Window warpWindow;
+- int warpX;
+- int warpY;
+-#if (TK_VERSION_NUMBER < _VERSION(8,4,0))
+- int useInputMethods; /* Whether to use input methods */
+-#else
+- /*
+- * The following field(s) were all added for Tk8.4
+- */
+- long deletionEpoch; /* Incremented by window deletions */
+- unsigned int flags; /* Various flag values: these are all
+- * defined in below. */
+- TkCaret caret; /* information about the caret for this
+- * display. This is not a pointer. */
+-#endif
+-} TkDisplay;
+-
+-#else
+-
+-/*
+- * One of the following structures is maintained for each display
+- * containing a window managed by Tk:
+- */
+-typedef struct TkDisplayStruct {
+- Display *display; /* Xlib's info about display. */
+- struct TkDisplayStruct *nextPtr; /* Next in list of all displays. */
+- char *name; /* Name of display (with any screen
+- * identifier removed). Malloc-ed. */
+- Time lastEventTime; /* Time of last event received for this
+- * display. */
+-
+- /*
+- * Information used primarily by tkBind.c:
+- */
+-
+- int bindInfoStale; /* Non-zero means the variables in this
+- * part of the structure are potentially
+- * incorrect and should be recomputed. */
+- unsigned int modeModMask; /* Has one bit set to indicate the modifier
+- * corresponding to "mode shift". If no
+- * such modifier, than this is zero. */
+- unsigned int metaModMask; /* Has one bit set to indicate the modifier
+- * corresponding to the "Meta" key. If no
+- * such modifier, then this is zero. */
+- unsigned int altModMask; /* Has one bit set to indicate the modifier
+- * corresponding to the "Meta" key. If no
+- * such modifier, then this is zero. */
+- enum {
+- LU_IGNORE, LU_CAPS, LU_SHIFT
+- } lockUsage;
+- /* Indicates how to interpret lock modifier. */
+- int numModKeyCodes; /* Number of entries in modKeyCodes array
+- * below. */
+- KeyCode *modKeyCodes; /* Pointer to an array giving keycodes for
+- * all of the keys that have modifiers
+- * associated with them. Malloc'ed, but
+- * may be NULL. */
+-
+- /*
+- * Information used by tkError.c only:
+- */
+-
+- TkErrorHandler *errorPtr;
+- /* First in list of error handlers
+- * for this display. NULL means
+- * no handlers exist at present. */
+- int deleteCount; /* Counts # of handlers deleted since
+- * last time inactive handlers were
+- * garbage-collected. When this number
+- * gets big, handlers get cleaned up. */
+-
+- /*
+- * Information used by tkSend.c only:
+- */
+-
+- Tk_Window commTkwin; /* Window used for communication
+- * between interpreters during "send"
+- * commands. NULL means send info hasn't
+- * been initialized yet. */
+- Atom commProperty; /* X's name for comm property. */
+- Atom registryProperty; /* X's name for property containing
+- * registry of interpreter names. */
+- Atom appNameProperty; /* X's name for property used to hold the
+- * application name on each comm window. */
+-
+- /*
+- * Information used by tkSelect.c and tkClipboard.c only:
+- */
+-
+- TkSelectionInfo *selectionInfoPtr;
+- /* First in list of selection information
+- * records. Each entry contains information
+- * about the current owner of a particular
+- * selection on this display. */
+- Atom multipleAtom; /* Atom for MULTIPLE. None means
+- * selection stuff isn't initialized. */
+- Atom incrAtom; /* Atom for INCR. */
+- Atom targetsAtom; /* Atom for TARGETS. */
+- Atom timestampAtom; /* Atom for TIMESTAMP. */
+- Atom textAtom; /* Atom for TEXT. */
+- Atom compoundTextAtom; /* Atom for COMPOUND_TEXT. */
+- Atom applicationAtom; /* Atom for TK_APPLICATION. */
+- Atom windowAtom; /* Atom for TK_WINDOW. */
+- Atom clipboardAtom; /* Atom for CLIPBOARD. */
+-
+- Tk_Window clipWindow; /* Window used for clipboard ownership and to
+- * retrieve selections between processes. NULL
+- * means clipboard info hasn't been
+- * initialized. */
+- int clipboardActive; /* 1 means we currently own the clipboard
+- * selection, 0 means we don't. */
+- TkMainInfo *clipboardAppPtr;
+- /* Last application that owned clipboard. */
+- TkClipboardTarget *clipTargetPtr;
+- /* First in list of clipboard type information
+- * records. Each entry contains information
+- * about the buffers for a given selection
+- * target. */
+-
+- /*
+- * Information used by tkAtom.c only:
+- */
+-
+- int atomInit; /* 0 means stuff below hasn't been
+- * initialized yet. */
+- Tcl_HashTable nameTable; /* Maps from names to Atom's. */
+- Tcl_HashTable atomTable; /* Maps from Atom's back to names. */
+-
+- /*
+- * Information used by tkCursor.c only:
+- */
+-
+- Font cursorFont; /* Font to use for standard cursors.
+- * None means font not loaded yet. */
+-
+- /*
+- * Information used by tkGrab.c only:
+- */
+-
+- TkWindow *grabWinPtr;
+- /* Window in which the pointer is currently
+- * grabbed, or NULL if none. */
+- TkWindow *eventualGrabWinPtr;
+- /* Value that grabWinPtr will have once the
+- * grab event queue (below) has been
+- * completely emptied. */
+- TkWindow *buttonWinPtr;
+- /* Window in which first mouse button was
+- * pressed while grab was in effect, or NULL
+- * if no such press in effect. */
+- TkWindow *serverWinPtr;
+- /* If no application contains the pointer then
+- * this is NULL. Otherwise it contains the
+- * last window for which we've gotten an
+- * Enter or Leave event from the server (i.e.
+- * the last window known to have contained
+- * the pointer). Doesn't reflect events
+- * that were synthesized in tkGrab.c. */
+- TkGrabEvent *firstGrabEventPtr;
+- /* First in list of enter/leave events
+- * synthesized by grab code. These events
+- * must be processed in order before any other
+- * events are processed. NULL means no such
+- * events. */
+- TkGrabEvent *lastGrabEventPtr;
+- /* Last in list of synthesized events, or NULL
+- * if list is empty. */
+- int grabFlags; /* Miscellaneous flag values. See definitions
+- * in tkGrab.c. */
+-
+- /*
+- * Information used by tkXId.c only:
+- */
+-
+- TkIdStack *idStackPtr;
+- /* First in list of chunks of free resource
+- * identifiers, or NULL if there are no free
+- * resources. */
+- XID(*defaultAllocProc) _ANSI_ARGS_((Display *display));
+- /* Default resource allocator for display. */
+- TkIdStack *windowStackPtr;
+- /* First in list of chunks of window
+- * identifers that can't be reused right
+- * now. */
+- int idCleanupScheduled; /* 1 means a call to WindowIdCleanup has
+- * already been scheduled, 0 means it
+- * hasn't. */
+-
+- /*
+- * Information maintained by tkWindow.c for use later on by tkXId.c:
+- */
+-
+-
+- int destroyCount; /* Number of Tk_DestroyWindow operations
+- * in progress. */
+- unsigned long lastDestroyRequest;
+- /* Id of most recent XDestroyWindow request;
+- * can re-use ids in windowStackPtr when
+- * server has seen this request and event
+- * queue is empty. */
+-
+- /*
+- * Information used by tkVisual.c only:
+- */
+-
+- TkColormap *cmapPtr; /* First in list of all non-default colormaps
+- * allocated for this display. */
+-
+- /*
+- * Information used by tkFocus.c only:
+- */
+-#if (TK_MAJOR_VERSION == 4)
+-
+- TkWindow *focusWinPtr;
+- /* Window that currently has the focus for
+- * this display, or NULL if none. */
+- TkWindow *implicitWinPtr;
+- /* If the focus arrived at a toplevel window
+- * implicitly via an Enter event (rather
+- * than via a FocusIn event), this points
+- * to the toplevel window. Otherwise it is
+- * NULL. */
+- TkWindow *focusOnMapPtr;
+- /* This points to a toplevel window that is
+- * supposed to receive the X input focus as
+- * soon as it is mapped (needed to handle the
+- * fact that X won't allow the focus on an
+- * unmapped window). NULL means no delayed
+- * focus op in progress. */
+- int forceFocus; /* Associated with focusOnMapPtr: non-zero
+- * means claim the focus even if some other
+- * application currently has it. */
+-#else
+- TkWindow *implicitWinPtr;
+- /* If the focus arrived at a toplevel window
+- * implicitly via an Enter event (rather
+- * than via a FocusIn event), this points
+- * to the toplevel window. Otherwise it is
+- * NULL. */
+- TkWindow *focusPtr; /* Points to the window on this display that
+- * should be receiving keyboard events. When
+- * multiple applications on the display have
+- * the focus, this will refer to the
+- * innermost window in the innermost
+- * application. This information isn't used
+- * under Unix or Windows, but it's needed on
+- * the Macintosh. */
+-#endif /* TK_MAJOR_VERSION == 4 */
+-
+- /*
+- * Used by tkColor.c only:
+- */
+-
+- TkStressedCmap *stressPtr; /* First in list of colormaps that have
+- * filled up, so we have to pick an
+- * approximate color. */
+-
+- /*
+- * Used by tkEvent.c only:
+- */
+-
+- TkWindowEvent *delayedMotionPtr;
+- /* Points to a malloc-ed motion event
+- * whose processing has been delayed in
+- * the hopes that another motion event
+- * will come along right away and we can
+- * merge the two of them together. NULL
+- * means that there is no delayed motion
+- * event. */
+- /*
+- * Miscellaneous information:
+- */
+-
+-#ifdef TK_USE_INPUT_METHODS
+- XIM inputMethod; /* Input method for this display */
+-#endif /* TK_USE_INPUT_METHODS */
+- Tcl_HashTable winTable; /* Maps from X window ids to TkWindow ptrs. */
+-#if (TK_MAJOR_VERSION > 4)
+- int refCount; /* Reference count of how many Tk applications
+- * are using this display. Used to clean up
+- * the display when we no longer have any
+- * Tk applications using it.
+- */
+-#endif /* TK_MAJOR_VERSION > 4 */
+-
+-} TkDisplay;
+-
+-#endif /* TK_VERSION_NUMBER >= _VERSION(8,1,0) */
+-
+-
+-struct TkWindowStruct {
+- Display *display;
+- TkDisplay *dispPtr;
+- int screenNum;
+- Visual *visual;
+- int depth;
+- Window window;
+- TkWindow *childList;
+- TkWindow *lastChildPtr;
+- TkWindow *parentPtr;
+- TkWindow *nextPtr;
+- TkMainInfo *infoPtr;
+- char *pathName;
+- Tk_Uid nameUid;
+- Tk_Uid classUid;
+- XWindowChanges changes;
+- unsigned int dirtyChanges;
+- XSetWindowAttributes atts;
+- unsigned long dirtyAtts;
+- unsigned int flags;
+- TkEventHandler *handlerList;
+-#ifdef TK_USE_INPUT_METHODS
+- XIC inputContext;
+-#endif /* TK_USE_INPUT_METHODS */
+- ClientData *tagPtr;
+- int nTags;
+- int optionLevel;
+- TkSelHandler *selHandlerList;
+- Tk_GeomMgr *geomMgrPtr;
+- ClientData geomData;
+- int reqWidth, reqHeight;
+- int internalBorderWidth;
+- TkWinInfo *wmInfoPtr;
+-#if (TK_MAJOR_VERSION > 4)
+- TkClassProcs *classProcsPtr;
+- ClientData instanceData;
+-#endif
+- TkWindowPrivate *privatePtr;
+-};
+-
+ #ifdef WIN32
+ /*
+ *----------------------------------------------------------------------
diff -urN /usr/ports/x11-toolkits/blt/files/patch-src__tkButton.c x11-toolkits/blt/files/patch-src__tkButton.c
--- /usr/ports/x11-toolkits/blt/files/patch-src__tkButton.c 1970-01-01 09:00:00.000000000 +0900
+++ x11-toolkits/blt/files/patch-src__tkButton.c 2013-11-01 00:00:00.000000000 +0900
@@ -0,0 +1,20 @@
+--- src/tkButton.c.orig
++++ src/tkButton.c
+@@ -526,8 +526,6 @@
+ static Blt_TileChangedProc TileChangedProc;
+ static Tcl_CmdProc ButtonCmd, LabelCmd, CheckbuttonCmd, RadiobuttonCmd;
+
+-EXTERN int TkCopyAndGlobalEval _ANSI_ARGS_((Tcl_Interp *interp, char *script));
+-
+ #if (TK_MAJOR_VERSION > 4)
+ EXTERN void TkComputeAnchor _ANSI_ARGS_((Tk_Anchor anchor, Tk_Window tkwin,
+ int padX, int padY, int innerWidth, int innerHeight, int *xPtr,
+@@ -1890,7 +1888,7 @@
+ }
+ }
+ if ((butPtr->type != TYPE_LABEL) && (butPtr->command != NULL)) {
+- return TkCopyAndGlobalEval(butPtr->interp, butPtr->command);
++ return Tcl_EvalObjEx(butPtr->interp, butPtr->command, TCL_EVAL_GLOBAL);
+ }
+ return TCL_OK;
+ }
diff -urN /usr/ports/x11-toolkits/blt/files/patch-src__tkFrame.c x11-toolkits/blt/files/patch-src__tkFrame.c
--- /usr/ports/x11-toolkits/blt/files/patch-src__tkFrame.c 1970-01-01 09:00:00.000000000 +0900
+++ x11-toolkits/blt/files/patch-src__tkFrame.c 2013-11-01 00:00:00.000000000 +0900
@@ -0,0 +1,307 @@
+--- src/tkFrame.c.orig
++++ src/tkFrame.c
+@@ -116,7 +116,7 @@
+ int flags; /* Various flags; see below for
+ * definitions. */
+ Blt_Tile tile;
+-} Frame;
++} bltFrame;
+
+ /*
+ * Flag bits for frames:
+@@ -143,65 +143,65 @@
+ static Tk_ConfigSpec configSpecs[] =
+ {
+ {TK_CONFIG_BORDER, "-background", "background", "Background",
+- DEF_FRAME_BACKGROUND, Tk_Offset(Frame, border),
++ DEF_FRAME_BACKGROUND, Tk_Offset(bltFrame, border),
+ BOTH | TK_CONFIG_COLOR_ONLY | TK_CONFIG_NULL_OK},
+ {TK_CONFIG_BORDER, "-background", "background", "Background",
+- DEF_FRAME_BG_MONO, Tk_Offset(Frame, border),
++ DEF_FRAME_BG_MONO, Tk_Offset(bltFrame, border),
+ BOTH | TK_CONFIG_MONO_ONLY | TK_CONFIG_NULL_OK},
+ {TK_CONFIG_SYNONYM, "-bd", "borderWidth", (char *)NULL,
+ (char *)NULL, 0, BOTH},
+ {TK_CONFIG_SYNONYM, "-bg", "background", (char *)NULL,
+ (char *)NULL, 0, BOTH},
+ {TK_CONFIG_PIXELS, "-borderwidth", "borderWidth", "BorderWidth",
+- DEF_FRAME_BORDERWIDTH, Tk_Offset(Frame, borderWidth), BOTH},
++ DEF_FRAME_BORDERWIDTH, Tk_Offset(bltFrame, borderWidth), BOTH},
+ {TK_CONFIG_STRING, "-class", "class", "Class",
+- DEF_FRAME_CLASS, Tk_Offset(Frame, className), FRAME},
++ DEF_FRAME_CLASS, Tk_Offset(bltFrame, className), FRAME},
+ {TK_CONFIG_STRING, "-class", "class", "Class",
+- DEF_TOPLEVEL_CLASS, Tk_Offset(Frame, className), TOPLEVEL},
++ DEF_TOPLEVEL_CLASS, Tk_Offset(bltFrame, className), TOPLEVEL},
+ {TK_CONFIG_STRING, "-colormap", "colormap", "Colormap",
+- DEF_FRAME_COLORMAP, Tk_Offset(Frame, colormapName),
++ DEF_FRAME_COLORMAP, Tk_Offset(bltFrame, colormapName),
+ BOTH | TK_CONFIG_NULL_OK},
+ #if (TK_MAJOR_VERSION > 4)
+ {TK_CONFIG_BOOLEAN, "-container", "container", "Container",
+- DEF_FRAME_CONTAINER, Tk_Offset(Frame, isContainer), BOTH},
++ DEF_FRAME_CONTAINER, Tk_Offset(bltFrame, isContainer), BOTH},
+ #endif /* TK_MAJOR_VERSION > 4 */
+ {TK_CONFIG_ACTIVE_CURSOR, "-cursor", "cursor", "Cursor",
+- DEF_FRAME_CURSOR, Tk_Offset(Frame, cursor), BOTH | TK_CONFIG_NULL_OK},
++ DEF_FRAME_CURSOR, Tk_Offset(bltFrame, cursor), BOTH | TK_CONFIG_NULL_OK},
+ {TK_CONFIG_PIXELS, "-height", "height", "Height",
+- DEF_FRAME_HEIGHT, Tk_Offset(Frame, height), BOTH},
++ DEF_FRAME_HEIGHT, Tk_Offset(bltFrame, height), BOTH},
+ {TK_CONFIG_COLOR, "-highlightbackground", "highlightBackground",
+ "HighlightBackground", DEF_FRAME_HIGHLIGHT_BG,
+- Tk_Offset(Frame, highlightBgColorPtr), BOTH},
++ Tk_Offset(bltFrame, highlightBgColorPtr), BOTH},
+ {TK_CONFIG_COLOR, "-highlightcolor", "highlightColor", "HighlightColor",
+- DEF_FRAME_HIGHLIGHT, Tk_Offset(Frame, highlightColorPtr), BOTH},
++ DEF_FRAME_HIGHLIGHT, Tk_Offset(bltFrame, highlightColorPtr), BOTH},
+ {TK_CONFIG_PIXELS, "-highlightthickness", "highlightThickness",
+ "HighlightThickness",
+- DEF_FRAME_HIGHLIGHT_WIDTH, Tk_Offset(Frame, highlightWidth), BOTH},
++ DEF_FRAME_HIGHLIGHT_WIDTH, Tk_Offset(bltFrame, highlightWidth), BOTH},
+ #if (TK_MAJOR_VERSION > 4)
+ {TK_CONFIG_STRING, "-menu", "menu", "Menu",
+- DEF_TOPLEVEL_MENU, Tk_Offset(Frame, menuName),
++ DEF_TOPLEVEL_MENU, Tk_Offset(bltFrame, menuName),
+ TOPLEVEL | TK_CONFIG_NULL_OK},
+ #endif /* TK_MAJOR_VERSION > 4 */
+ {TK_CONFIG_RELIEF, "-relief", "relief", "Relief",
+- DEF_FRAME_RELIEF, Tk_Offset(Frame, relief), BOTH},
++ DEF_FRAME_RELIEF, Tk_Offset(bltFrame, relief), BOTH},
+ {TK_CONFIG_STRING, "-screen", "screen", "Screen",
+- DEF_TOPLEVEL_SCREEN, Tk_Offset(Frame, screenName),
++ DEF_TOPLEVEL_SCREEN, Tk_Offset(bltFrame, screenName),
+ TOPLEVEL | TK_CONFIG_NULL_OK},
+ {TK_CONFIG_STRING, "-takefocus", "takeFocus", "TakeFocus",
+- DEF_FRAME_TAKE_FOCUS, Tk_Offset(Frame, takeFocus),
++ DEF_FRAME_TAKE_FOCUS, Tk_Offset(bltFrame, takeFocus),
+ BOTH | TK_CONFIG_NULL_OK},
+ {TK_CONFIG_CUSTOM, "-tile", "tile", "Tile",
+- (char *)NULL, Tk_Offset(Frame, tile), BOTH | TK_CONFIG_NULL_OK,
++ (char *)NULL, Tk_Offset(bltFrame, tile), BOTH | TK_CONFIG_NULL_OK,
+ &bltTileOption},
+ #if (TK_MAJOR_VERSION > 4)
+ {TK_CONFIG_STRING, "-use", "use", "Use",
+- DEF_FRAME_USE, Tk_Offset(Frame, useThis), TOPLEVEL|TK_CONFIG_NULL_OK},
++ DEF_FRAME_USE, Tk_Offset(bltFrame, useThis), TOPLEVEL|TK_CONFIG_NULL_OK},
+ #endif
+ {TK_CONFIG_STRING, "-visual", "visual", "Visual",
+- DEF_FRAME_VISUAL, Tk_Offset(Frame, visualName),
++ DEF_FRAME_VISUAL, Tk_Offset(bltFrame, visualName),
+ BOTH | TK_CONFIG_NULL_OK},
+ {TK_CONFIG_PIXELS, "-width", "width", "Width",
+- DEF_FRAME_WIDTH, Tk_Offset(Frame, width), BOTH},
++ DEF_FRAME_WIDTH, Tk_Offset(bltFrame, width), BOTH},
+ {TK_CONFIG_END, (char *)NULL, (char *)NULL, (char *)NULL,
+ (char *)NULL, 0, 0}
+ };
+@@ -211,7 +211,7 @@
+ */
+
+ static int ConfigureFrame _ANSI_ARGS_((Tcl_Interp *interp,
+- Frame * framePtr, int argc, char **argv,
++ bltFrame * framePtr, int argc, CONST84 char **argv,
+ int flags));
+ static void DestroyFrame _ANSI_ARGS_((DestroyData *memPtr));
+ static void DisplayFrame _ANSI_ARGS_((ClientData clientData));
+@@ -219,27 +219,16 @@
+ ClientData clientData));
+ static void FrameEventProc _ANSI_ARGS_((ClientData clientData,
+ XEvent *eventPtr));
+-static int FrameWidgetCmd _ANSI_ARGS_((ClientData clientData,
+- Tcl_Interp *interp, int argc, char **argv));
+ static void MapFrame _ANSI_ARGS_((ClientData clientData));
+
+ static Blt_TileChangedProc TileChangedProc;
+-static Tcl_CmdProc FrameCmd, ToplevelCmd;
++static Tcl_CmdProc FrameCmd, ToplevelCmd, FrameWidgetCmd;
+
+-#ifdef TILE_MAINWINDOW
+-EXTERN
+-#else
+ static
+-#endif
+-int TkCreateFrame _ANSI_ARGS_((ClientData clientData,
+- Tcl_Interp *interp, int argc, char **argv,
++int BltCreateFrame _ANSI_ARGS_((ClientData clientData,
++ Tcl_Interp *interp, int argc, CONST84 char **argv,
+ int toplevel, char *appName));
+
+-EXTERN void TkSetWindowMenuBar _ANSI_ARGS_((Tcl_Interp *interp, Tk_Window tkwin,
+- char *oldMenuName, char *menuName));
+-
+-EXTERN Tk_Window TkCreateMainWindow _ANSI_ARGS_((Tcl_Interp * interp,
+- char * screenName, char * baseName));
+ #if (TK_MAJOR_VERSION == 8) && (TK_MINOR_VERSION > 3)
+ #define TkSetClassProcs Tk_SetClassProcs
+ #else
+@@ -247,10 +236,10 @@
+ ClientData instanceData));
+ #endif /* TK_MAJOR_VERSION == 8 && TK_MINOR_VERSION > 3 */
+
++#if 0
+ EXTERN void TkpSetMainMenubar _ANSI_ARGS_((Tcl_Interp * interp, Tk_Window tkwin,
+ char * menuName));
+-EXTERN int TkpUseWindow _ANSI_ARGS_((Tcl_Interp * interp, Tk_Window tkwin,
+- char * string));
++#endif
+ EXTERN void TkpMakeContainer _ANSI_ARGS_((Tk_Window tkwin));
+
+
+@@ -279,9 +268,9 @@
+ * interpreter. */
+ Tcl_Interp *interp; /* Current interpreter. */
+ int argc; /* Number of arguments. */
+- char **argv; /* Argument strings. */
++ CONST84 char **argv; /* Argument strings. */
+ {
+- return TkCreateFrame(clientData, interp, argc, argv, 0, (char *)NULL);
++ return BltCreateFrame(clientData, interp, argc, argv, 0, (char *)NULL);
+ }
+
+ static int
+@@ -290,9 +279,9 @@
+ * interpreter. */
+ Tcl_Interp *interp; /* Current interpreter. */
+ int argc; /* Number of arguments. */
+- char **argv; /* Argument strings. */
++ CONST84 char **argv; /* Argument strings. */
+ {
+- return TkCreateFrame(clientData, interp, argc, argv, 1, (char *)NULL);
++ return BltCreateFrame(clientData, interp, argc, argv, 1, (char *)NULL);
+ }
+
+ /*
+@@ -319,20 +308,20 @@
+ static
+ #endif /* TILE_MAINWINDOW */
+ int
+-TkCreateFrame(clientData, interp, argc, argv, toplevel, appName)
++BltCreateFrame(clientData, interp, argc, argv, toplevel, appName)
+ ClientData clientData; /* Main window associated with interpreter.
+ * If we're called by Tk_Init to create a
+ * new application, then this is NULL. */
+ Tcl_Interp *interp; /* Current interpreter. */
+ int argc; /* Number of arguments. */
+- char **argv; /* Argument strings. */
++ CONST84 char *argv[]; /* Argument strings. */
+ int toplevel; /* Non-zero means create a toplevel window,
+ * zero means create a frame. */
+ char *appName; /* Should only be non-NULL if clientData is
+ * NULL: gives the base name to use for the
+ * new application. */
+ {
+- Frame *framePtr;
++ bltFrame *framePtr;
+ Tk_Window new;
+ char *className, *screenName, *visualName, *colormapName, *arg, *useOption;
+ int i, c, length, depth;
+@@ -407,7 +396,7 @@
+ */
+
+ if (appName == NULL) {
+- panic("TkCreateFrame didn't get application name");
++ panic("BltCreateFrame didn't get application name");
+ }
+ new = (Tk_Window)TkCreateMainWindow(interp, screenName, appName);
+ }
+@@ -467,7 +456,7 @@
+ * in the widget record from the special options.
+ */
+
+- framePtr = Blt_Malloc(sizeof(Frame));
++ framePtr = Blt_Malloc(sizeof(bltFrame));
+ framePtr->tkwin = new;
+ framePtr->display = Tk_Display(new);
+ framePtr->interp = interp;
+@@ -558,9 +547,9 @@
+ ClientData clientData; /* Information about frame widget. */
+ Tcl_Interp *interp; /* Current interpreter. */
+ int argc; /* Number of arguments. */
+- char **argv; /* Argument strings. */
++ CONST84 char *argv[]; /* Argument strings. */
+ {
+- register Frame *framePtr = (Frame *) clientData;
++ register bltFrame *framePtr = (bltFrame *) clientData;
+ int result;
+ size_t length;
+ int c, i;
+@@ -660,7 +649,7 @@
+ DestroyFrame(memPtr)
+ DestroyData *memPtr; /* Info about frame widget. */
+ {
+- register Frame *framePtr = (Frame *) memPtr;
++ register bltFrame *framePtr = (bltFrame *) memPtr;
+
+ Tk_FreeOptions(configSpecs, (char *)framePtr, framePtr->display,
+ framePtr->mask);
+@@ -689,7 +678,7 @@
+ ClientData clientData;
+ Blt_Tile tile;
+ {
+- Frame *framePtr = (Frame *) clientData;
++ bltFrame *framePtr = (bltFrame *) clientData;
+
+ if (framePtr->tkwin != NULL) {
+ if (!(framePtr->flags & REDRAW_PENDING)) {
+@@ -723,10 +712,10 @@
+ static int
+ ConfigureFrame(interp, framePtr, argc, argv, flags)
+ Tcl_Interp *interp; /* Used for error reporting. */
+- register Frame *framePtr; /* Information about widget; may or may
++ register bltFrame *framePtr; /* Information about widget; may or may
+ * not already have values for some fields. */
+ int argc; /* Number of valid entries in argv. */
+- char **argv; /* Arguments. */
++ CONST84 char **argv; /* Arguments. */
+ int flags; /* Flags to pass to Tk_ConfigureWidget. */
+ {
+ #if (TK_MAJOR_VERSION > 4)
+@@ -810,7 +799,7 @@
+ DisplayFrame(clientData)
+ ClientData clientData; /* Information about widget. */
+ {
+- register Frame *framePtr = (Frame *) clientData;
++ register bltFrame *framePtr = (bltFrame *) clientData;
+ register Tk_Window tkwin = framePtr->tkwin;
+ GC gc;
+
+@@ -877,7 +866,7 @@
+ ClientData clientData; /* Information about window. */
+ register XEvent *eventPtr; /* Information about event. */
+ {
+- register Frame *framePtr = (Frame *) clientData;
++ register bltFrame *framePtr = (bltFrame *) clientData;
+
+ if (((eventPtr->type == Expose) && (eventPtr->xexpose.count == 0))
+ || (eventPtr->type == ConfigureNotify)) {
+@@ -964,7 +953,7 @@
+ FrameCmdDeletedProc(clientData)
+ ClientData clientData; /* Pointer to widget record for widget. */
+ {
+- Frame *framePtr = (Frame *) clientData;
++ bltFrame *framePtr = (bltFrame *) clientData;
+ Tk_Window tkwin = framePtr->tkwin;
+
+ #if (TK_MAJOR_VERSION > 4)
+@@ -1010,7 +999,7 @@
+ MapFrame(clientData)
+ ClientData clientData; /* Pointer to frame structure. */
+ {
+- Frame *framePtr = (Frame *) clientData;
++ bltFrame *framePtr = (bltFrame *) clientData;
+
+ /*
+ * Wait for all other background events to be processed before
+@@ -1067,9 +1056,9 @@
+ #define Tk_InstanceData(tkwin) (((Tk_FakeWin *)(tkwin))->dummy18)
+ #define Tk_MainPtr(tkwin) (((Tk_FakeWin *)(tkwin))->dummy5)
+ if (Tk_MainPtr(tkwin) != NULL) {
+- Frame *framePtr;
++ bltFrame *framePtr;
+
+- framePtr = (Frame *) Tk_InstanceData(tkwin);
++ framePtr = (bltFrame *) Tk_InstanceData(tkwin);
+ TkpMenuNotifyToplevelCreate(framePtr->interp, framePtr->menuName);
+ }
+ #endif /* TK_MAJOR_VERSION > 4 */
diff -urN /usr/ports/x11-toolkits/blt/files/patch-use-tkInt x11-toolkits/blt/files/patch-use-tkInt
--- /usr/ports/x11-toolkits/blt/files/patch-use-tkInt 2013-06-21 03:54:39.000000000 +0900
+++ x11-toolkits/blt/files/patch-use-tkInt 1970-01-01 09:00:00.000000000 +0900
@@ -1,1315 +0,0 @@
---- src/bltTkInt.h 2001-12-06 00:30:15.000000000 -0500
-+++ src/bltTkInt.h 2010-01-25 18:57:52.000000000 -0500
-@@ -28,213 +28,7 @@
- #define _BLT_TKINT_H
-
--typedef struct {
-- 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 {
-- 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 TkFontStruct {
-- /*
-- * 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 TkFontStruct *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 TkRegionStruct *TkRegion;
--
--typedef struct {
-- 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
--
--typedef struct TkWindowStruct TkWindow;
--
--typedef struct {
-- int type;
-- HWND handle;
-- 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 {
-- HPALETTE palette;
-- int bkmode; /* This field was added in Tk
-- * 8.3.1. Be careful that you don't
-- * use this structure in a context
-- * where its size is important. */
--} 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 TkBorderStruct {
-- 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 TkBorderStruct *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;
-+#include <tkInt.h>
-+#include <tk3d.h>
-+#include <tkFont.h>
-
- #endif /* BLT_TKINT_H */
---- src/bltWindow.c 2002-09-18 23:02:09.000000000 -0400
-+++ src/bltWindow.c 2010-01-25 18:47:25.000000000 -0500
-@@ -34,23 +34,5 @@
- #endif
-
--typedef struct TkIdStackStruct TkIdStack;
--typedef struct TkErrorHandlerStruct TkErrorHandler;
--typedef struct TkSelectionInfoStruct TkSelectionInfo;
--typedef struct TkClipboardTargetStruct TkClipboardTarget;
--
--#ifndef WIN32
--typedef struct TkWindowStruct TkWindow;
--#endif
--typedef struct TkWindowEventStruct TkWindowEvent;
--typedef struct TkMainInfoStruct TkMainInfo;
--typedef struct TkEventHandlerStruct TkEventHandler;
--typedef struct TkSelHandlerStruct TkSelHandler;
--typedef struct TkWinInfoStruct TkWinInfo;
--typedef struct TkClassProcsStruct TkClassProcs;
--typedef struct TkWindowPrivateStruct TkWindowPrivate;
--typedef struct TkGrabEventStruct TkGrabEvent;
--typedef struct TkColormapStruct TkColormap;
--typedef struct TkStressedCmapStruct TkStressedCmap;
--typedef struct TkWmInfoStruct TkWmInfo;
-+#include <tkInt.h>
-
- #ifdef XNQueryInputStyle
-@@ -71,750 +53,4 @@
- #endif
-
--#if (TK_VERSION_NUMBER >= _VERSION(8,1,0))
--
--typedef struct TkCaret {
-- struct TkWindow *winPtr; /* the window on which we requested caret
-- * placement */
-- int x; /* relative x coord of the caret */
-- int y; /* relative y coord of the caret */
-- int height; /* specified height of the window */
--} TkCaret;
--
--/*
-- * One of the following structures is maintained for each display
-- * containing a window managed by Tk. In part, the structure is
-- * used to store thread-specific data, since each thread will have
-- * its own TkDisplay structure.
-- */
--
--typedef struct TkDisplayStruct {
-- Display *display; /* Xlib's info about display. */
-- struct TkDisplayStruct *nextPtr; /* Next in list of all displays. */
-- char *name; /* Name of display (with any screen
-- * identifier removed). Malloc-ed. */
-- Time lastEventTime; /* Time of last event received for this
-- * display. */
--
-- /*
-- * Information used primarily by tk3d.c:
-- */
--
-- int borderInit; /* 0 means borderTable needs initializing. */
-- Tcl_HashTable borderTable; /* Maps from color name to TkBorder
-- * structure. */
--
-- /*
-- * Information used by tkAtom.c only:
-- */
--
-- int atomInit; /* 0 means stuff below hasn't been
-- * initialized yet. */
-- Tcl_HashTable nameTable; /* Maps from names to Atom's. */
-- Tcl_HashTable atomTable; /* Maps from Atom's back to names. */
--
-- /*
-- * Information used primarily by tkBind.c:
-- */
--
-- int bindInfoStale; /* Non-zero means the variables in this
-- * part of the structure are potentially
-- * incorrect and should be recomputed. */
-- unsigned int modeModMask; /* Has one bit set to indicate the modifier
-- * corresponding to "mode shift". If no
-- * such modifier, than this is zero. */
-- unsigned int metaModMask; /* Has one bit set to indicate the modifier
-- * corresponding to the "Meta" key. If no
-- * such modifier, then this is zero. */
-- unsigned int altModMask; /* Has one bit set to indicate the modifier
-- * corresponding to the "Meta" key. If no
-- * such modifier, then this is zero. */
-- enum {
-- LU_IGNORE, LU_CAPS, LU_SHIFT
-- } lockUsage; /* Indicates how to interpret lock modifier. */
-- int numModKeyCodes; /* Number of entries in modKeyCodes array
-- * below. */
-- KeyCode *modKeyCodes; /* Pointer to an array giving keycodes for
-- * all of the keys that have modifiers
-- * associated with them. Malloc'ed, but
-- * may be NULL. */
--
-- /*
-- * Information used by tkBitmap.c only:
-- */
--
-- int bitmapInit; /* 0 means tables above need initializing. */
-- int bitmapAutoNumber; /* Used to number bitmaps. */
-- Tcl_HashTable bitmapNameTable;
-- /* Maps from name of bitmap to the first
-- * TkBitmap record for that name. */
-- Tcl_HashTable bitmapIdTable;/* Maps from bitmap id to the TkBitmap
-- * structure for the bitmap. */
-- Tcl_HashTable bitmapDataTable;
-- /* Used by Tk_GetBitmapFromData to map from
-- * a collection of in-core data about a
-- * bitmap to a reference giving an auto-
-- * matically-generated name for the bitmap. */
--
-- /*
-- * Information used by tkCanvas.c only:
-- */
--
-- int numIdSearches;
-- int numSlowSearches;
--
-- /*
-- * Used by tkColor.c only:
-- */
--
-- int colorInit; /* 0 means color module needs initializing. */
-- TkStressedCmap *stressPtr; /* First in list of colormaps that have
-- * filled up, so we have to pick an
-- * approximate color. */
-- Tcl_HashTable colorNameTable;
-- /* Maps from color name to TkColor structure
-- * for that color. */
-- Tcl_HashTable colorValueTable;
-- /* Maps from integer RGB values to TkColor
-- * structures. */
--
-- /*
-- * Used by tkCursor.c only:
-- */
--
-- int cursorInit; /* 0 means cursor module need initializing. */
-- Tcl_HashTable cursorNameTable;
-- /* Maps from a string name to a cursor to the
-- * TkCursor record for the cursor. */
-- Tcl_HashTable cursorDataTable;
-- /* Maps from a collection of in-core data
-- * about a cursor to a TkCursor structure. */
-- Tcl_HashTable cursorIdTable;
-- /* Maps from a cursor id to the TkCursor
-- * structure for the cursor. */
-- char cursorString[20]; /* Used to store a cursor id string. */
-- Font cursorFont; /* Font to use for standard cursors.
-- * None means font not loaded yet. */
--
-- /*
-- * Information used by tkError.c only:
-- */
--
-- struct TkErrorHandler *errorPtr;
-- /* First in list of error handlers
-- * for this display. NULL means
-- * no handlers exist at present. */
-- int deleteCount; /* Counts # of handlers deleted since
-- * last time inactive handlers were
-- * garbage-collected. When this number
-- * gets big, handlers get cleaned up. */
--
-- /*
-- * Used by tkEvent.c only:
-- */
--
-- struct TkWindowEvent *delayedMotionPtr;
-- /* Points to a malloc-ed motion event
-- * whose processing has been delayed in
-- * the hopes that another motion event
-- * will come along right away and we can
-- * merge the two of them together. NULL
-- * means that there is no delayed motion
-- * event. */
--
-- /*
-- * Information used by tkFocus.c only:
-- */
--
-- int focusDebug; /* 1 means collect focus debugging
-- * statistics. */
-- struct TkWindow *implicitWinPtr;
-- /* If the focus arrived at a toplevel window
-- * implicitly via an Enter event (rather
-- * than via a FocusIn event), this points
-- * to the toplevel window. Otherwise it is
-- * NULL. */
-- struct TkWindow *focusPtr; /* Points to the window on this display that
-- * should be receiving keyboard events. When
-- * multiple applications on the display have
-- * the focus, this will refer to the
-- * innermost window in the innermost
-- * application. This information isn't used
-- * under Unix or Windows, but it's needed on
-- * the Macintosh. */
--
-- /*
-- * Information used by tkGC.c only:
-- */
--
-- Tcl_HashTable gcValueTable; /* Maps from a GC's values to a TkGC structure
-- * describing a GC with those values. */
-- Tcl_HashTable gcIdTable; /* Maps from a GC to a TkGC. */
-- int gcInit; /* 0 means the tables below need
-- * initializing. */
--
-- /*
-- * Information used by tkGeometry.c only:
-- */
--
-- Tcl_HashTable maintainHashTable;
-- /* Hash table that maps from a master's
-- * Tk_Window token to a list of slaves
-- * managed by that master. */
-- int geomInit;
--
-- /*
-- * Information used by tkGet.c only:
-- */
--
-- Tcl_HashTable uidTable; /* Stores all Tk_Uids used in a thread. */
-- int uidInit; /* 0 means uidTable needs initializing. */
--
-- /*
-- * Information used by tkGrab.c only:
-- */
--
-- struct TkWindow *grabWinPtr;
-- /* Window in which the pointer is currently
-- * grabbed, or NULL if none. */
-- struct TkWindow *eventualGrabWinPtr;
-- /* Value that grabWinPtr will have once the
-- * grab event queue (below) has been
-- * completely emptied. */
-- struct TkWindow *buttonWinPtr;
-- /* Window in which first mouse button was
-- * pressed while grab was in effect, or NULL
-- * if no such press in effect. */
-- struct TkWindow *serverWinPtr;
-- /* If no application contains the pointer then
-- * this is NULL. Otherwise it contains the
-- * last window for which we've gotten an
-- * Enter or Leave event from the server (i.e.
-- * the last window known to have contained
-- * the pointer). Doesn't reflect events
-- * that were synthesized in tkGrab.c. */
-- TkGrabEvent *firstGrabEventPtr;
-- /* First in list of enter/leave events
-- * synthesized by grab code. These events
-- * must be processed in order before any other
-- * events are processed. NULL means no such
-- * events. */
-- TkGrabEvent *lastGrabEventPtr;
-- /* Last in list of synthesized events, or NULL
-- * if list is empty. */
-- int grabFlags; /* Miscellaneous flag values. See definitions
-- * in tkGrab.c. */
--
-- /*
-- * Information used by tkGrid.c only:
-- */
--
-- int gridInit; /* 0 means table below needs initializing. */
-- Tcl_HashTable gridHashTable;/* Maps from Tk_Window tokens to
-- * corresponding Grid structures. */
--
-- /*
-- * Information used by tkImage.c only:
-- */
--
-- int imageId; /* Value used to number image ids. */
--
-- /*
-- * Information used by tkMacWinMenu.c only:
-- */
--
-- int postCommandGeneration;
--
-- /*
-- * Information used by tkOption.c only.
-- */
--
--
--
-- /*
-- * Information used by tkPack.c only.
-- */
--
-- int packInit; /* 0 means table below needs initializing. */
-- Tcl_HashTable packerHashTable;
-- /* Maps from Tk_Window tokens to
-- * corresponding Packer structures. */
--
--
-- /*
-- * Information used by tkPlace.c only.
-- */
--
-- int placeInit; /* 0 means tables below need initializing. */
-- Tcl_HashTable masterTable; /* Maps from Tk_Window toke to the Master
-- * structure for the window, if it exists. */
-- Tcl_HashTable slaveTable; /* Maps from Tk_Window toke to the Slave
-- * structure for the window, if it exists. */
--
-- /*
-- * Information used by tkSelect.c and tkClipboard.c only:
-- */
--
--
-- struct TkSelectionInfo *selectionInfoPtr;
-- /* First in list of selection information
-- * records. Each entry contains information
-- * about the current owner of a particular
-- * selection on this display. */
-- Atom multipleAtom; /* Atom for MULTIPLE. None means
-- * selection stuff isn't initialized. */
-- Atom incrAtom; /* Atom for INCR. */
-- Atom targetsAtom; /* Atom for TARGETS. */
-- Atom timestampAtom; /* Atom for TIMESTAMP. */
-- Atom textAtom; /* Atom for TEXT. */
-- Atom compoundTextAtom; /* Atom for COMPOUND_TEXT. */
-- Atom applicationAtom; /* Atom for TK_APPLICATION. */
-- Atom windowAtom; /* Atom for TK_WINDOW. */
-- Atom clipboardAtom; /* Atom for CLIPBOARD. */
--#if (TK_VERSION_NUMBER >= _VERSION(8,4,0))
-- Atom utf8Atom;
--#endif
-- Tk_Window clipWindow; /* Window used for clipboard ownership and to
-- * retrieve selections between processes. NULL
-- * means clipboard info hasn't been
-- * initialized. */
-- int clipboardActive; /* 1 means we currently own the clipboard
-- * selection, 0 means we don't. */
-- struct TkMainInfo *clipboardAppPtr;
-- /* Last application that owned clipboard. */
-- struct TkClipboardTarget *clipTargetPtr;
-- /* First in list of clipboard type information
-- * records. Each entry contains information
-- * about the buffers for a given selection
-- * target. */
--
-- /*
-- * Information used by tkSend.c only:
-- */
--
-- Tk_Window commTkwin; /* Window used for communication
-- * between interpreters during "send"
-- * commands. NULL means send info hasn't
-- * been initialized yet. */
-- Atom commProperty; /* X's name for comm property. */
-- Atom registryProperty; /* X's name for property containing
-- * registry of interpreter names. */
-- Atom appNameProperty; /* X's name for property used to hold the
-- * application name on each comm window. */
--
-- /*
-- * Information used by tkXId.c only:
-- */
--
-- struct TkIdStack *idStackPtr;
-- /* First in list of chunks of free resource
-- * identifiers, or NULL if there are no free
-- * resources. */
-- XID(*defaultAllocProc) _ANSI_ARGS_((Display *display));
-- /* Default resource allocator for display. */
-- struct TkIdStack *windowStackPtr;
-- /* First in list of chunks of window
-- * identifers that can't be reused right
-- * now. */
--#if (TK_VERSION_NUMBER < _VERSION(8,4,0))
-- int idCleanupScheduled; /* 1 means a call to WindowIdCleanup has
-- * already been scheduled, 0 means it
-- * hasn't. */
--#else
-- Tcl_TimerToken idCleanupScheduled;
-- /* If set, it means a call to WindowIdCleanup
-- * has already been scheduled, 0 means it
-- * hasn't. */
--#endif
-- /*
-- * Information used by tkUnixWm.c and tkWinWm.c only:
-- */
--
--#if (TK_VERSION_NUMBER < _VERSION(8,4,0))
-- int wmTracing; /* Used to enable or disable tracing in
-- * this module. If tracing is enabled,
-- * then information is printed on
-- * standard output about interesting
-- * interactions with the window manager. */
--#endif
-- struct TkWmInfo *firstWmPtr; /* Points to first top-level window. */
-- struct TkWmInfo *foregroundWmPtr;
-- /* Points to the foreground window. */
--
-- /*
-- * Information maintained by tkWindow.c for use later on by tkXId.c:
-- */
--
--
-- int destroyCount; /* Number of Tk_DestroyWindow operations
-- * in progress. */
-- unsigned long lastDestroyRequest;
-- /* Id of most recent XDestroyWindow request;
-- * can re-use ids in windowStackPtr when
-- * server has seen this request and event
-- * queue is empty. */
--
-- /*
-- * Information used by tkVisual.c only:
-- */
--
-- TkColormap *cmapPtr; /* First in list of all non-default colormaps
-- * allocated for this display. */
--
-- /*
-- * Miscellaneous information:
-- */
--
--#ifdef TK_USE_INPUT_METHODS
-- XIM inputMethod; /* Input method for this display */
--#if (TK_VERSION_NUMBER >= _VERSION(8,4,0))
--#if TK_XIM_SPOT
-- XFontSet inputXfs; /* XFontSet cached for over-the-spot XIM. */
--#endif /* TK_XIM_SPOT */
--#endif /* TK_VERSION_NUMBER >= 8.4 */
--#endif /* TK_USE_INPUT_METHODS */
-- Tcl_HashTable winTable; /* Maps from X window ids to TkWindow ptrs. */
-- int refCount; /* Reference count of how many Tk applications
-- * are using this display. Used to clean up
-- * the display when we no longer have any
-- * Tk applications using it.
-- */
-- /*
-- * The following field were all added for Tk8.3
-- */
-- int mouseButtonState; /* current mouse button state for this
-- * display */
--#if (TK_VERSION_NUMBER < _VERSION(8,4,0))
-- int warpInProgress;
--#endif
-- Window warpWindow;
-- int warpX;
-- int warpY;
--#if (TK_VERSION_NUMBER < _VERSION(8,4,0))
-- int useInputMethods; /* Whether to use input methods */
--#else
-- /*
-- * The following field(s) were all added for Tk8.4
-- */
-- long deletionEpoch; /* Incremented by window deletions */
-- unsigned int flags; /* Various flag values: these are all
-- * defined in below. */
-- TkCaret caret; /* information about the caret for this
-- * display. This is not a pointer. */
--#endif
--} TkDisplay;
--
--#else
--
--/*
-- * One of the following structures is maintained for each display
-- * containing a window managed by Tk:
-- */
--typedef struct TkDisplayStruct {
-- Display *display; /* Xlib's info about display. */
-- struct TkDisplayStruct *nextPtr; /* Next in list of all displays. */
-- char *name; /* Name of display (with any screen
-- * identifier removed). Malloc-ed. */
-- Time lastEventTime; /* Time of last event received for this
-- * display. */
--
-- /*
-- * Information used primarily by tkBind.c:
-- */
--
-- int bindInfoStale; /* Non-zero means the variables in this
-- * part of the structure are potentially
-- * incorrect and should be recomputed. */
-- unsigned int modeModMask; /* Has one bit set to indicate the modifier
-- * corresponding to "mode shift". If no
-- * such modifier, than this is zero. */
-- unsigned int metaModMask; /* Has one bit set to indicate the modifier
-- * corresponding to the "Meta" key. If no
-- * such modifier, then this is zero. */
-- unsigned int altModMask; /* Has one bit set to indicate the modifier
-- * corresponding to the "Meta" key. If no
-- * such modifier, then this is zero. */
-- enum {
-- LU_IGNORE, LU_CAPS, LU_SHIFT
-- } lockUsage;
-- /* Indicates how to interpret lock modifier. */
-- int numModKeyCodes; /* Number of entries in modKeyCodes array
-- * below. */
-- KeyCode *modKeyCodes; /* Pointer to an array giving keycodes for
-- * all of the keys that have modifiers
-- * associated with them. Malloc'ed, but
-- * may be NULL. */
--
-- /*
-- * Information used by tkError.c only:
-- */
--
-- TkErrorHandler *errorPtr;
-- /* First in list of error handlers
-- * for this display. NULL means
-- * no handlers exist at present. */
-- int deleteCount; /* Counts # of handlers deleted since
-- * last time inactive handlers were
-- * garbage-collected. When this number
-- * gets big, handlers get cleaned up. */
--
-- /*
-- * Information used by tkSend.c only:
-- */
--
-- Tk_Window commTkwin; /* Window used for communication
-- * between interpreters during "send"
-- * commands. NULL means send info hasn't
-- * been initialized yet. */
-- Atom commProperty; /* X's name for comm property. */
-- Atom registryProperty; /* X's name for property containing
-- * registry of interpreter names. */
-- Atom appNameProperty; /* X's name for property used to hold the
-- * application name on each comm window. */
--
-- /*
-- * Information used by tkSelect.c and tkClipboard.c only:
-- */
--
-- TkSelectionInfo *selectionInfoPtr;
-- /* First in list of selection information
-- * records. Each entry contains information
-- * about the current owner of a particular
-- * selection on this display. */
-- Atom multipleAtom; /* Atom for MULTIPLE. None means
-- * selection stuff isn't initialized. */
-- Atom incrAtom; /* Atom for INCR. */
-- Atom targetsAtom; /* Atom for TARGETS. */
-- Atom timestampAtom; /* Atom for TIMESTAMP. */
-- Atom textAtom; /* Atom for TEXT. */
-- Atom compoundTextAtom; /* Atom for COMPOUND_TEXT. */
-- Atom applicationAtom; /* Atom for TK_APPLICATION. */
-- Atom windowAtom; /* Atom for TK_WINDOW. */
-- Atom clipboardAtom; /* Atom for CLIPBOARD. */
--
-- Tk_Window clipWindow; /* Window used for clipboard ownership and to
-- * retrieve selections between processes. NULL
-- * means clipboard info hasn't been
-- * initialized. */
-- int clipboardActive; /* 1 means we currently own the clipboard
-- * selection, 0 means we don't. */
-- TkMainInfo *clipboardAppPtr;
-- /* Last application that owned clipboard. */
-- TkClipboardTarget *clipTargetPtr;
-- /* First in list of clipboard type information
-- * records. Each entry contains information
-- * about the buffers for a given selection
-- * target. */
--
-- /*
-- * Information used by tkAtom.c only:
-- */
--
-- int atomInit; /* 0 means stuff below hasn't been
-- * initialized yet. */
-- Tcl_HashTable nameTable; /* Maps from names to Atom's. */
-- Tcl_HashTable atomTable; /* Maps from Atom's back to names. */
--
-- /*
-- * Information used by tkCursor.c only:
-- */
--
-- Font cursorFont; /* Font to use for standard cursors.
-- * None means font not loaded yet. */
--
-- /*
-- * Information used by tkGrab.c only:
-- */
--
-- TkWindow *grabWinPtr;
-- /* Window in which the pointer is currently
-- * grabbed, or NULL if none. */
-- TkWindow *eventualGrabWinPtr;
-- /* Value that grabWinPtr will have once the
-- * grab event queue (below) has been
-- * completely emptied. */
-- TkWindow *buttonWinPtr;
-- /* Window in which first mouse button was
-- * pressed while grab was in effect, or NULL
-- * if no such press in effect. */
-- TkWindow *serverWinPtr;
-- /* If no application contains the pointer then
-- * this is NULL. Otherwise it contains the
-- * last window for which we've gotten an
-- * Enter or Leave event from the server (i.e.
-- * the last window known to have contained
-- * the pointer). Doesn't reflect events
-- * that were synthesized in tkGrab.c. */
-- TkGrabEvent *firstGrabEventPtr;
-- /* First in list of enter/leave events
-- * synthesized by grab code. These events
-- * must be processed in order before any other
-- * events are processed. NULL means no such
-- * events. */
-- TkGrabEvent *lastGrabEventPtr;
-- /* Last in list of synthesized events, or NULL
-- * if list is empty. */
-- int grabFlags; /* Miscellaneous flag values. See definitions
-- * in tkGrab.c. */
--
-- /*
-- * Information used by tkXId.c only:
-- */
--
-- TkIdStack *idStackPtr;
-- /* First in list of chunks of free resource
-- * identifiers, or NULL if there are no free
-- * resources. */
-- XID(*defaultAllocProc) _ANSI_ARGS_((Display *display));
-- /* Default resource allocator for display. */
-- TkIdStack *windowStackPtr;
-- /* First in list of chunks of window
-- * identifers that can't be reused right
-- * now. */
-- int idCleanupScheduled; /* 1 means a call to WindowIdCleanup has
-- * already been scheduled, 0 means it
-- * hasn't. */
--
-- /*
-- * Information maintained by tkWindow.c for use later on by tkXId.c:
-- */
--
--
-- int destroyCount; /* Number of Tk_DestroyWindow operations
-- * in progress. */
-- unsigned long lastDestroyRequest;
-- /* Id of most recent XDestroyWindow request;
-- * can re-use ids in windowStackPtr when
-- * server has seen this request and event
-- * queue is empty. */
--
-- /*
-- * Information used by tkVisual.c only:
-- */
--
-- TkColormap *cmapPtr; /* First in list of all non-default colormaps
-- * allocated for this display. */
--
-- /*
-- * Information used by tkFocus.c only:
-- */
--#if (TK_MAJOR_VERSION == 4)
--
-- TkWindow *focusWinPtr;
-- /* Window that currently has the focus for
-- * this display, or NULL if none. */
-- TkWindow *implicitWinPtr;
-- /* If the focus arrived at a toplevel window
-- * implicitly via an Enter event (rather
-- * than via a FocusIn event), this points
-- * to the toplevel window. Otherwise it is
-- * NULL. */
-- TkWindow *focusOnMapPtr;
-- /* This points to a toplevel window that is
-- * supposed to receive the X input focus as
-- * soon as it is mapped (needed to handle the
-- * fact that X won't allow the focus on an
-- * unmapped window). NULL means no delayed
-- * focus op in progress. */
-- int forceFocus; /* Associated with focusOnMapPtr: non-zero
-- * means claim the focus even if some other
-- * application currently has it. */
--#else
-- TkWindow *implicitWinPtr;
-- /* If the focus arrived at a toplevel window
-- * implicitly via an Enter event (rather
-- * than via a FocusIn event), this points
-- * to the toplevel window. Otherwise it is
-- * NULL. */
-- TkWindow *focusPtr; /* Points to the window on this display that
-- * should be receiving keyboard events. When
-- * multiple applications on the display have
-- * the focus, this will refer to the
-- * innermost window in the innermost
-- * application. This information isn't used
-- * under Unix or Windows, but it's needed on
-- * the Macintosh. */
--#endif /* TK_MAJOR_VERSION == 4 */
--
-- /*
-- * Used by tkColor.c only:
-- */
--
-- TkStressedCmap *stressPtr; /* First in list of colormaps that have
-- * filled up, so we have to pick an
-- * approximate color. */
--
-- /*
-- * Used by tkEvent.c only:
-- */
--
-- TkWindowEvent *delayedMotionPtr;
-- /* Points to a malloc-ed motion event
-- * whose processing has been delayed in
-- * the hopes that another motion event
-- * will come along right away and we can
-- * merge the two of them together. NULL
-- * means that there is no delayed motion
-- * event. */
-- /*
-- * Miscellaneous information:
-- */
--
--#ifdef TK_USE_INPUT_METHODS
-- XIM inputMethod; /* Input method for this display */
--#endif /* TK_USE_INPUT_METHODS */
-- Tcl_HashTable winTable; /* Maps from X window ids to TkWindow ptrs. */
--#if (TK_MAJOR_VERSION > 4)
-- int refCount; /* Reference count of how many Tk applications
-- * are using this display. Used to clean up
-- * the display when we no longer have any
-- * Tk applications using it.
-- */
--#endif /* TK_MAJOR_VERSION > 4 */
--
--} TkDisplay;
--
--#endif /* TK_VERSION_NUMBER >= _VERSION(8,1,0) */
--
--
--struct TkWindowStruct {
-- Display *display;
-- TkDisplay *dispPtr;
-- int screenNum;
-- Visual *visual;
-- int depth;
-- Window window;
-- TkWindow *childList;
-- TkWindow *lastChildPtr;
-- TkWindow *parentPtr;
-- TkWindow *nextPtr;
-- TkMainInfo *infoPtr;
-- char *pathName;
-- Tk_Uid nameUid;
-- Tk_Uid classUid;
-- XWindowChanges changes;
-- unsigned int dirtyChanges;
-- XSetWindowAttributes atts;
-- unsigned long dirtyAtts;
-- unsigned int flags;
-- TkEventHandler *handlerList;
--#ifdef TK_USE_INPUT_METHODS
-- XIC inputContext;
--#endif /* TK_USE_INPUT_METHODS */
-- ClientData *tagPtr;
-- int nTags;
-- int optionLevel;
-- TkSelHandler *selHandlerList;
-- Tk_GeomMgr *geomMgrPtr;
-- ClientData geomData;
-- int reqWidth, reqHeight;
-- int internalBorderWidth;
-- TkWinInfo *wmInfoPtr;
--#if (TK_MAJOR_VERSION > 4)
-- TkClassProcs *classProcsPtr;
-- ClientData instanceData;
--#endif
-- TkWindowPrivate *privatePtr;
--};
--
- #ifdef WIN32
- /*
---- src/bltPs.c 2002-09-18 18:30:51.000000000 -0400
-+++ src/bltPs.c 2010-01-25 19:04:13.000000000 -0500
-@@ -894,5 +894,5 @@
- }
- if ((relief == TK_RELIEF_SOLID) ||
-- (borderPtr->lightColor == NULL) || (borderPtr->darkColor == NULL)) {
-+ (borderPtr->lightColorPtr == NULL) || (borderPtr->darkColorPtr == NULL)) {
- if (relief == TK_RELIEF_SOLID) {
- darkColor.red = darkColor.blue = darkColor.green = 0x00;
-@@ -902,5 +902,5 @@
- Screen *screenPtr;
-
-- lightColor = *borderPtr->bgColor;
-+ lightColor = *borderPtr->bgColorPtr;
- screenPtr = Tk_Screen(tokenPtr->tkwin);
- if (lightColor.pixel == WhitePixelOfScreen(screenPtr)) {
-@@ -913,6 +913,6 @@
- darkColorPtr = &darkColor;
- } else {
-- lightColorPtr = borderPtr->lightColor;
-- darkColorPtr = borderPtr->darkColor;
-+ lightColorPtr = borderPtr->lightColorPtr;
-+ darkColorPtr = borderPtr->darkColorPtr;
- }
-
-@@ -943,5 +943,5 @@
- bottomColor = lightColorPtr;
- } else {
-- topColor = bottomColor = borderPtr->bgColor;
-+ topColor = bottomColor = borderPtr->bgColorPtr;
- }
- Blt_BackgroundToPostScript(tokenPtr, bottomColor);
-@@ -983,5 +983,5 @@
- * the plot when the colormode option is "monochrome".
- */
-- Blt_BackgroundToPostScript(tokenPtr, borderPtr->bgColor);
-+ Blt_BackgroundToPostScript(tokenPtr, borderPtr->bgColorPtr);
- Blt_RectangleToPostScript(tokenPtr, x, y, width, height);
- Blt_Draw3DRectangleToPostScript(tokenPtr, border, x, y, width, height,
---- src/bltText.c 2002-08-13 15:45:20.000000000 -0400
-+++ src/bltText.c 2010-01-25 20:08:01.000000000 -0500
-@@ -691,5 +691,5 @@
- XColor *color1, *color2;
-
-- color1 = borderPtr->lightColor, color2 = borderPtr->darkColor;
-+ color1 = borderPtr->lightColorPtr, color2 = borderPtr->darkColorPtr;
- if (tsPtr->state & STATE_EMPHASIS) {
- XColor *hold;
-@@ -755,5 +755,5 @@
- XColor *color1, *color2;
-
-- color1 = borderPtr->lightColor, color2 = borderPtr->darkColor;
-+ color1 = borderPtr->lightColorPtr, color2 = borderPtr->darkColorPtr;
- if (tsPtr->state & STATE_EMPHASIS) {
- XColor *hold;
---- src/tkFrame.c 2002-10-16 01:33:53.000000000 -0400
-+++ src/tkFrame.c 2010-01-25 21:36:58.000000000 -0500
-@@ -117,5 +117,5 @@
- * definitions. */
- Blt_Tile tile;
--} Frame;
-+} bltFrame;
-
- /*
-@@ -144,8 +144,8 @@
- {
- {TK_CONFIG_BORDER, "-background", "background", "Background",
-- DEF_FRAME_BACKGROUND, Tk_Offset(Frame, border),
-+ DEF_FRAME_BACKGROUND, Tk_Offset(bltFrame, border),
- BOTH | TK_CONFIG_COLOR_ONLY | TK_CONFIG_NULL_OK},
- {TK_CONFIG_BORDER, "-background", "background", "Background",
-- DEF_FRAME_BG_MONO, Tk_Offset(Frame, border),
-+ DEF_FRAME_BG_MONO, Tk_Offset(bltFrame, border),
- BOTH | TK_CONFIG_MONO_ONLY | TK_CONFIG_NULL_OK},
- {TK_CONFIG_SYNONYM, "-bd", "borderWidth", (char *)NULL,
-@@ -154,53 +154,53 @@
- (char *)NULL, 0, BOTH},
- {TK_CONFIG_PIXELS, "-borderwidth", "borderWidth", "BorderWidth",
-- DEF_FRAME_BORDERWIDTH, Tk_Offset(Frame, borderWidth), BOTH},
-+ DEF_FRAME_BORDERWIDTH, Tk_Offset(bltFrame, borderWidth), BOTH},
- {TK_CONFIG_STRING, "-class", "class", "Class",
-- DEF_FRAME_CLASS, Tk_Offset(Frame, className), FRAME},
-+ DEF_FRAME_CLASS, Tk_Offset(bltFrame, className), FRAME},
- {TK_CONFIG_STRING, "-class", "class", "Class",
-- DEF_TOPLEVEL_CLASS, Tk_Offset(Frame, className), TOPLEVEL},
-+ DEF_TOPLEVEL_CLASS, Tk_Offset(bltFrame, className), TOPLEVEL},
- {TK_CONFIG_STRING, "-colormap", "colormap", "Colormap",
-- DEF_FRAME_COLORMAP, Tk_Offset(Frame, colormapName),
-+ DEF_FRAME_COLORMAP, Tk_Offset(bltFrame, colormapName),
- BOTH | TK_CONFIG_NULL_OK},
- #if (TK_MAJOR_VERSION > 4)
- {TK_CONFIG_BOOLEAN, "-container", "container", "Container",
-- DEF_FRAME_CONTAINER, Tk_Offset(Frame, isContainer), BOTH},
-+ DEF_FRAME_CONTAINER, Tk_Offset(bltFrame, isContainer), BOTH},
- #endif /* TK_MAJOR_VERSION > 4 */
- {TK_CONFIG_ACTIVE_CURSOR, "-cursor", "cursor", "Cursor",
-- DEF_FRAME_CURSOR, Tk_Offset(Frame, cursor), BOTH | TK_CONFIG_NULL_OK},
-+ DEF_FRAME_CURSOR, Tk_Offset(bltFrame, cursor), BOTH | TK_CONFIG_NULL_OK},
- {TK_CONFIG_PIXELS, "-height", "height", "Height",
-- DEF_FRAME_HEIGHT, Tk_Offset(Frame, height), BOTH},
-+ DEF_FRAME_HEIGHT, Tk_Offset(bltFrame, height), BOTH},
- {TK_CONFIG_COLOR, "-highlightbackground", "highlightBackground",
- "HighlightBackground", DEF_FRAME_HIGHLIGHT_BG,
-- Tk_Offset(Frame, highlightBgColorPtr), BOTH},
-+ Tk_Offset(bltFrame, highlightBgColorPtr), BOTH},
- {TK_CONFIG_COLOR, "-highlightcolor", "highlightColor", "HighlightColor",
-- DEF_FRAME_HIGHLIGHT, Tk_Offset(Frame, highlightColorPtr), BOTH},
-+ DEF_FRAME_HIGHLIGHT, Tk_Offset(bltFrame, highlightColorPtr), BOTH},
- {TK_CONFIG_PIXELS, "-highlightthickness", "highlightThickness",
- "HighlightThickness",
-- DEF_FRAME_HIGHLIGHT_WIDTH, Tk_Offset(Frame, highlightWidth), BOTH},
-+ DEF_FRAME_HIGHLIGHT_WIDTH, Tk_Offset(bltFrame, highlightWidth), BOTH},
- #if (TK_MAJOR_VERSION > 4)
- {TK_CONFIG_STRING, "-menu", "menu", "Menu",
-- DEF_TOPLEVEL_MENU, Tk_Offset(Frame, menuName),
-+ DEF_TOPLEVEL_MENU, Tk_Offset(bltFrame, menuName),
- TOPLEVEL | TK_CONFIG_NULL_OK},
- #endif /* TK_MAJOR_VERSION > 4 */
- {TK_CONFIG_RELIEF, "-relief", "relief", "Relief",
-- DEF_FRAME_RELIEF, Tk_Offset(Frame, relief), BOTH},
-+ DEF_FRAME_RELIEF, Tk_Offset(bltFrame, relief), BOTH},
- {TK_CONFIG_STRING, "-screen", "screen", "Screen",
-- DEF_TOPLEVEL_SCREEN, Tk_Offset(Frame, screenName),
-+ DEF_TOPLEVEL_SCREEN, Tk_Offset(bltFrame, screenName),
- TOPLEVEL | TK_CONFIG_NULL_OK},
- {TK_CONFIG_STRING, "-takefocus", "takeFocus", "TakeFocus",
-- DEF_FRAME_TAKE_FOCUS, Tk_Offset(Frame, takeFocus),
-+ DEF_FRAME_TAKE_FOCUS, Tk_Offset(bltFrame, takeFocus),
- BOTH | TK_CONFIG_NULL_OK},
- {TK_CONFIG_CUSTOM, "-tile", "tile", "Tile",
-- (char *)NULL, Tk_Offset(Frame, tile), BOTH | TK_CONFIG_NULL_OK,
-+ (char *)NULL, Tk_Offset(bltFrame, tile), BOTH | TK_CONFIG_NULL_OK,
- &bltTileOption},
- #if (TK_MAJOR_VERSION > 4)
- {TK_CONFIG_STRING, "-use", "use", "Use",
-- DEF_FRAME_USE, Tk_Offset(Frame, useThis), TOPLEVEL|TK_CONFIG_NULL_OK},
-+ DEF_FRAME_USE, Tk_Offset(bltFrame, useThis), TOPLEVEL|TK_CONFIG_NULL_OK},
- #endif
- {TK_CONFIG_STRING, "-visual", "visual", "Visual",
-- DEF_FRAME_VISUAL, Tk_Offset(Frame, visualName),
-+ DEF_FRAME_VISUAL, Tk_Offset(bltFrame, visualName),
- BOTH | TK_CONFIG_NULL_OK},
- {TK_CONFIG_PIXELS, "-width", "width", "Width",
-- DEF_FRAME_WIDTH, Tk_Offset(Frame, width), BOTH},
-+ DEF_FRAME_WIDTH, Tk_Offset(bltFrame, width), BOTH},
- {TK_CONFIG_END, (char *)NULL, (char *)NULL, (char *)NULL,
- (char *)NULL, 0, 0}
-@@ -212,5 +212,5 @@
-
- static int ConfigureFrame _ANSI_ARGS_((Tcl_Interp *interp,
-- Frame * framePtr, int argc, char **argv,
-+ bltFrame * framePtr, int argc, CONST84 char **argv,
- int flags));
- static void DestroyFrame _ANSI_ARGS_((DestroyData *memPtr));
-@@ -220,25 +220,14 @@
- static void FrameEventProc _ANSI_ARGS_((ClientData clientData,
- XEvent *eventPtr));
--static int FrameWidgetCmd _ANSI_ARGS_((ClientData clientData,
-- Tcl_Interp *interp, int argc, char **argv));
- static void MapFrame _ANSI_ARGS_((ClientData clientData));
-
- static Blt_TileChangedProc TileChangedProc;
--static Tcl_CmdProc FrameCmd, ToplevelCmd;
-+static Tcl_CmdProc FrameCmd, ToplevelCmd, FrameWidgetCmd;
-
--#ifdef TILE_MAINWINDOW
--EXTERN
--#else
- static
--#endif
--int TkCreateFrame _ANSI_ARGS_((ClientData clientData,
-- Tcl_Interp *interp, int argc, char **argv,
-+int BltCreateFrame _ANSI_ARGS_((ClientData clientData,
-+ Tcl_Interp *interp, int argc, CONST84 char **argv,
- int toplevel, char *appName));
-
--EXTERN void TkSetWindowMenuBar _ANSI_ARGS_((Tcl_Interp *interp, Tk_Window tkwin,
-- char *oldMenuName, char *menuName));
--
--EXTERN Tk_Window TkCreateMainWindow _ANSI_ARGS_((Tcl_Interp * interp,
-- char * screenName, char * baseName));
- #if (TK_MAJOR_VERSION == 8) && (TK_MINOR_VERSION > 3)
- #define TkSetClassProcs Tk_SetClassProcs
-@@ -250,6 +239,4 @@
- EXTERN void TkpSetMainMenubar _ANSI_ARGS_((Tcl_Interp * interp, Tk_Window tkwin,
- char * menuName));
--EXTERN int TkpUseWindow _ANSI_ARGS_((Tcl_Interp * interp, Tk_Window tkwin,
-- char * string));
- EXTERN void TkpMakeContainer _ANSI_ARGS_((Tk_Window tkwin));
-
-@@ -280,7 +267,7 @@
- Tcl_Interp *interp; /* Current interpreter. */
- int argc; /* Number of arguments. */
-- char **argv; /* Argument strings. */
-+ CONST84 char **argv; /* Argument strings. */
- {
-- return TkCreateFrame(clientData, interp, argc, argv, 0, (char *)NULL);
-+ return BltCreateFrame(clientData, interp, argc, argv, 0, (char *)NULL);
- }
-
-@@ -291,7 +278,7 @@
- Tcl_Interp *interp; /* Current interpreter. */
- int argc; /* Number of arguments. */
-- char **argv; /* Argument strings. */
-+ CONST84 char **argv; /* Argument strings. */
- {
-- return TkCreateFrame(clientData, interp, argc, argv, 1, (char *)NULL);
-+ return BltCreateFrame(clientData, interp, argc, argv, 1, (char *)NULL);
- }
-
-@@ -320,5 +307,5 @@
- #endif /* TILE_MAINWINDOW */
- int
--TkCreateFrame(clientData, interp, argc, argv, toplevel, appName)
-+BltCreateFrame(clientData, interp, argc, argv, toplevel, appName)
- ClientData clientData; /* Main window associated with interpreter.
- * If we're called by Tk_Init to create a
-@@ -326,5 +313,5 @@
- Tcl_Interp *interp; /* Current interpreter. */
- int argc; /* Number of arguments. */
-- char **argv; /* Argument strings. */
-+ CONST84 char *argv[]; /* Argument strings. */
- int toplevel; /* Non-zero means create a toplevel window,
- * zero means create a frame. */
-@@ -333,5 +320,5 @@
- * new application. */
- {
-- Frame *framePtr;
-+ bltFrame *framePtr;
- Tk_Window new;
- char *className, *screenName, *visualName, *colormapName, *arg, *useOption;
-@@ -408,5 +395,5 @@
-
- if (appName == NULL) {
-- panic("TkCreateFrame didn't get application name");
-+ panic("BltCreateFrame didn't get application name");
- }
- new = (Tk_Window)TkCreateMainWindow(interp, screenName, appName);
-@@ -468,5 +455,5 @@
- */
-
-- framePtr = Blt_Malloc(sizeof(Frame));
-+ framePtr = Blt_Malloc(sizeof(bltFrame));
- framePtr->tkwin = new;
- framePtr->display = Tk_Display(new);
-@@ -559,7 +546,7 @@
- Tcl_Interp *interp; /* Current interpreter. */
- int argc; /* Number of arguments. */
-- char **argv; /* Argument strings. */
-+ CONST84 char *argv[]; /* Argument strings. */
- {
-- register Frame *framePtr = (Frame *) clientData;
-+ register bltFrame *framePtr = (bltFrame *) clientData;
- int result;
- size_t length;
-@@ -661,5 +648,5 @@
- DestroyData *memPtr; /* Info about frame widget. */
- {
-- register Frame *framePtr = (Frame *) memPtr;
-+ register bltFrame *framePtr = (bltFrame *) memPtr;
-
- Tk_FreeOptions(configSpecs, (char *)framePtr, framePtr->display,
-@@ -690,5 +677,5 @@
- Blt_Tile tile;
- {
-- Frame *framePtr = (Frame *) clientData;
-+ bltFrame *framePtr = (bltFrame *) clientData;
-
- if (framePtr->tkwin != NULL) {
-@@ -724,8 +711,8 @@
- ConfigureFrame(interp, framePtr, argc, argv, flags)
- Tcl_Interp *interp; /* Used for error reporting. */
-- register Frame *framePtr; /* Information about widget; may or may
-+ register bltFrame *framePtr; /* Information about widget; may or may
- * not already have values for some fields. */
- int argc; /* Number of valid entries in argv. */
-- char **argv; /* Arguments. */
-+ CONST84 char **argv; /* Arguments. */
- int flags; /* Flags to pass to Tk_ConfigureWidget. */
- {
-@@ -811,5 +798,5 @@
- ClientData clientData; /* Information about widget. */
- {
-- register Frame *framePtr = (Frame *) clientData;
-+ register bltFrame *framePtr = (bltFrame *) clientData;
- register Tk_Window tkwin = framePtr->tkwin;
- GC gc;
-@@ -878,5 +865,5 @@
- register XEvent *eventPtr; /* Information about event. */
- {
-- register Frame *framePtr = (Frame *) clientData;
-+ register bltFrame *framePtr = (bltFrame *) clientData;
-
- if (((eventPtr->type == Expose) && (eventPtr->xexpose.count == 0))
-@@ -965,5 +952,5 @@
- ClientData clientData; /* Pointer to widget record for widget. */
- {
-- Frame *framePtr = (Frame *) clientData;
-+ bltFrame *framePtr = (bltFrame *) clientData;
- Tk_Window tkwin = framePtr->tkwin;
-
-@@ -1011,5 +998,5 @@
- ClientData clientData; /* Pointer to frame structure. */
- {
-- Frame *framePtr = (Frame *) clientData;
-+ bltFrame *framePtr = (bltFrame *) clientData;
-
- /*
-@@ -1068,7 +1055,7 @@
- #define Tk_MainPtr(tkwin) (((Tk_FakeWin *)(tkwin))->dummy5)
- if (Tk_MainPtr(tkwin) != NULL) {
-- Frame *framePtr;
-+ bltFrame *framePtr;
-
-- framePtr = (Frame *) Tk_InstanceData(tkwin);
-+ framePtr = (bltFrame *) Tk_InstanceData(tkwin);
- TkpMenuNotifyToplevelCreate(framePtr->interp, framePtr->menuName);
- }
diff -urN /usr/ports/x11-toolkits/blt/files/patch-warnings x11-toolkits/blt/files/patch-warnings
--- /usr/ports/x11-toolkits/blt/files/patch-warnings 2013-06-21 03:54:39.000000000 +0900
+++ x11-toolkits/blt/files/patch-warnings 1970-01-01 09:00:00.000000000 +0900
@@ -1,1075 +0,0 @@
---- src/blt.h 2002-07-14 19:33:24.000000000 -0400
-+++ src/blt.h 2010-01-16 22:52:09.000000000 -0500
-@@ -56,7 +56,7 @@
- typedef char *Blt_Uid;
-
--EXTERN Blt_Uid Blt_GetUid _ANSI_ARGS_((char *string));
-+EXTERN Blt_Uid Blt_GetUid _ANSI_ARGS_((const char *string));
- EXTERN void Blt_FreeUid _ANSI_ARGS_((Blt_Uid uid));
--EXTERN Blt_Uid Blt_FindUid _ANSI_ARGS_((char *string));
-+EXTERN Blt_Uid Blt_FindUid _ANSI_ARGS_((const char *string));
-
- #if (TCL_MAJOR_VERSION >= 8)
---- src/bltInt.h 2002-08-21 16:13:12.000000000 -0400
-+++ src/bltInt.h 2010-01-17 00:04:42.000000000 -0500
-@@ -714,5 +714,5 @@
-
- extern int Blt_GetXY _ANSI_ARGS_((Tcl_Interp *interp, Tk_Window tkwin,
-- char *string, int *x, int *y));
-+ const char *string, int *x, int *y));
-
- extern Point2D Blt_GetProjection _ANSI_ARGS_((int x, int y, Point2D *p,
---- src/bltBgexec.c 2002-09-18 18:30:50.000000000 -0400
-+++ src/bltBgexec.c 2010-01-16 13:02:33.000000000 -0500
-@@ -56,5 +56,5 @@
- } Process;
- #else
--typedef int Process;
-+typedef pid_t Process;
- #endif
-
-@@ -125,5 +125,5 @@
- typedef struct {
- int number;
-- char *name;
-+ const char *name;
- } SignalId;
-
-@@ -646,5 +646,5 @@
- sinkPtr->echo = FALSE;
- sinkPtr->fd = -1;
-- sinkPtr->file = (Tcl_File)NULL;
-+ sinkPtr->file = 0;
- sinkPtr->byteArr = sinkPtr->staticSpace;
- sinkPtr->size = DEF_BUFFER_SIZE;
-@@ -704,5 +704,5 @@
- }
- sinkPtr->fd = -1;
-- sinkPtr->file = (Tcl_File)NULL;
-+ sinkPtr->file = 0;
- #if (TCL_MAJOR_VERSION >= 8)
- if (sinkPtr->objv != NULL) {
-@@ -856,5 +856,5 @@
- Tcl_DeleteFileHandler(sinkPtr->fd);
- #endif
-- sinkPtr->file = (Tcl_File)NULL;
-+ sinkPtr->file = 0;
- sinkPtr->fd = -1;
-
-@@ -1073,5 +1073,5 @@
- timeout = (flags & WNOHANG) ? 0 : INFINITE;
- status = WaitForSingleObject(child.hProcess, timeout);
--
-+
- #if WINDEBUG
- PurifyPrintf("WAITPID: wait status is %d\n", status);
-@@ -1310,5 +1310,5 @@
- (sinkPtr->flags & SINK_NOTIFY)) {
- unsigned char *data;
-- int length;
-+ int length = 0;
-
- if (sinkPtr->flags & SINK_BUFFERED) {
-@@ -1472,5 +1472,5 @@
- Tcl_DetachPids(1, &bgPtr->procArr[i]);
- #else
-- Tcl_DetachPids(1, (Tcl_Pid *)bgPtr->procArr[i]);
-+ Tcl_DetachPids(1, (Tcl_Pid *)(intptr_t)bgPtr->procArr[i]);
- #endif /* TCL_MAJOR_VERSION == 7 */
- #endif /* WIN32 */
---- src/bltHash.h.in 2002-07-13 20:08:13.000000000 -0400
-+++ src/bltHash.h.in 2010-01-16 19:38:20.000000000 -0500
-@@ -89,5 +89,5 @@
- */
- #define BLT_STRING_KEYS 0
--#define BLT_ONE_WORD_KEYS ((size_t)-1)
-+#define BLT_ONE_WORD_KEYS ((unsigned int)-1)
-
- /*
---- src/bltTree.c 2002-09-29 01:44:12.000000000 -0400
-+++ src/bltTree.c 2010-01-16 19:42:48.000000000 -0500
-@@ -404,5 +404,5 @@
- UnlinkNode(nodePtr);
- treeObjPtr->nNodes--;
-- hPtr = Blt_FindHashEntry(&treeObjPtr->nodeTable, (char *)nodePtr->inode);
-+ hPtr = Blt_FindHashEntry(&treeObjPtr->nodeTable, (char *)(uintptr_t)nodePtr->inode);
- assert(hPtr);
- Blt_DeleteHashEntry(&treeObjPtr->nodeTable, hPtr);
-@@ -837,5 +837,5 @@
- do {
- inode = treeObjPtr->nextInode++;
-- hPtr = Blt_CreateHashEntry(&treeObjPtr->nodeTable,(char *)inode,
-+ hPtr = Blt_CreateHashEntry(&treeObjPtr->nodeTable,(char *)(uintptr_t)inode,
- &isNew);
- } while (!isNew);
-@@ -892,5 +892,5 @@
-
- treeObjPtr = parentPtr->treeObject;
-- hPtr = Blt_CreateHashEntry(&treeObjPtr->nodeTable,(char *)inode, &isNew);
-+ hPtr = Blt_CreateHashEntry(&treeObjPtr->nodeTable,(char *)(uintptr_t)inode, &isNew);
- if (!isNew) {
- return NULL;
-@@ -998,5 +998,5 @@
- Blt_HashEntry *hPtr;
-
-- hPtr = Blt_FindHashEntry(&treeObjPtr->nodeTable, (char *)inode);
-+ hPtr = Blt_FindHashEntry(&treeObjPtr->nodeTable, (char *)(uintptr_t)inode);
- if (hPtr != NULL) {
- return (Blt_TreeNode)Blt_GetHashValue(hPtr);
---- src/bltTreeCmd.c 2002-09-27 18:23:01.000000000 -0400
-+++ src/bltTreeCmd.c 2010-01-16 22:43:52.000000000 -0500
-@@ -951,5 +951,5 @@
- Blt_Tree tree = cmdPtr->tree;
- char c;
-- Blt_TreeNode node;
-+ Blt_TreeNode node = NULL;
- char *string;
- char *p;
-@@ -1284,6 +1284,6 @@
- node = dataPtr->root;
- /* Create a mapping between the old id and the new node */
-- hPtr = Blt_CreateHashEntry(&dataPtr->idTable, (char *)nodeId,
-- &isNew);
-+ hPtr = Blt_CreateHashEntry(&dataPtr->idTable,
-+ (char *)(uintptr_t)nodeId, &isNew);
- Blt_SetHashValue(hPtr, node);
- Blt_TreeRelabelNode(cmdPtr->tree, node, names[0]);
-@@ -1294,5 +1294,5 @@
- * existing node.
- */
-- hPtr = Blt_FindHashEntry(&dataPtr->idTable, (char *)parentId);
-+ hPtr = Blt_FindHashEntry(&dataPtr->idTable, (char *)(uintptr_t)parentId);
- if (hPtr != NULL) {
- parent = Blt_GetHashValue(hPtr);
-@@ -1331,5 +1331,5 @@
- node = Blt_TreeFindChild(parent, names[nNames - 1]);
- /* Create a mapping between the old id and the new node */
-- hPtr = Blt_CreateHashEntry(&dataPtr->idTable, (char *)nodeId,
-+ hPtr = Blt_CreateHashEntry(&dataPtr->idTable, (char *)(uintptr_t)nodeId,
- &isNew);
- Blt_SetHashValue(hPtr, node);
-@@ -1341,5 +1341,5 @@
- names[nNames - 1], -1);
- /* Create a mapping between the old id and the new node */
-- hPtr = Blt_CreateHashEntry(&dataPtr->idTable, (char *)nodeId,
-+ hPtr = Blt_CreateHashEntry(&dataPtr->idTable, (char *)(uintptr_t)nodeId,
- &isNew);
- Blt_SetHashValue(hPtr, node);
-@@ -1668,5 +1668,5 @@
- node = Blt_ListNextNode(node)) {
-
-- type = (int)Blt_ListGetValue(node);
-+ type = (intptr_t)Blt_ListGetValue(node);
- pattern = (char *)Blt_ListGetKey(node);
- switch (type) {
-@@ -2603,5 +2603,5 @@
- hPtr != NULL; hPtr = Blt_NextHashEntry(&cursor)) {
- node = Blt_GetHashValue(hPtr);
-- Blt_ChainAppend(chainPtr, (ClientData)Blt_TreeNodeId(node));
-+ Blt_ChainAppend(chainPtr, (ClientData)(uintptr_t)Blt_TreeNodeId(node));
- }
- /*
-@@ -2613,5 +2613,5 @@
- linkPtr = nextPtr) {
- nextPtr = Blt_ChainNextLink(linkPtr);
-- inode = (int)Blt_ChainGetValue(linkPtr);
-+ inode = (intptr_t)Blt_ChainGetValue(linkPtr);
- node = Blt_TreeGetNode(cmdPtr->tree, inode);
- if (node != NULL) {
---- src/bltUnixPipe.c 2002-06-22 15:21:05.000000000 -0400
-+++ src/bltUnixPipe.c 2010-01-16 22:45:17.000000000 -0500
-@@ -478,5 +478,5 @@
- * startup.
- */
-- Tcl_WaitPid((Tcl_Pid)pid, &status, WNOHANG);
-+ Tcl_WaitPid((Tcl_Pid)(intptr_t)pid, &status, WNOHANG);
- }
- if (errPipeIn >= 0) {
---- src/bltUtil.c 2002-08-21 16:13:12.000000000 -0400
-+++ src/bltUtil.c 2010-01-16 22:53:55.000000000 -0500
-@@ -780,9 +780,9 @@
- Blt_Uid
- Blt_GetUid(string)
-- char *string; /* String to convert. */
-+ const char *string; /* String to convert. */
- {
- int isNew;
- Blt_HashEntry *hPtr;
-- int refCount;
-+ intptr_t refCount;
-
- if (!uidInitialized) {
-@@ -794,5 +794,5 @@
- refCount = 0;
- } else {
-- refCount = (int)Blt_GetHashValue(hPtr);
-+ refCount = (intptr_t)Blt_GetHashValue(hPtr);
- }
- refCount++;
-@@ -829,7 +829,7 @@
- hPtr = Blt_FindHashEntry(&uidTable, uid);
- if (hPtr) {
-- int refCount;
-+ intptr_t refCount;
-
-- refCount = (int)Blt_GetHashValue(hPtr);
-+ refCount = (intptr_t)Blt_GetHashValue(hPtr);
- refCount--;
- if (refCount == 0) {
-@@ -857,5 +857,5 @@
- Blt_Uid
- Blt_FindUid(string)
-- char *string; /* String to find. */
-+ const char *string; /* String to find. */
- {
- Blt_HashEntry *hPtr;
---- src/bltInit.c As of 2.4.2
-+++ src/bltInit.c 2010-01-16 22:59:22.000000000 -0500
-@@ -404,7 +404,7 @@
- Tcl_Interp *interp; /* Interpreter to add extra commands */
- {
-- int flags;
-+ intptr_t flags;
-
-- flags = (int)Tcl_GetAssocData(interp, BLT_THREAD_KEY, NULL);
-+ flags = (intptr_t)Tcl_GetAssocData(interp, BLT_THREAD_KEY, NULL);
- if ((flags & BLT_TCL_CMDS) == 0) {
- register Tcl_AppInitProc **p;
-@@ -416,5 +416,5 @@
- * the same ones that BLT was compiled against.
- */
-- if (Tcl_PkgRequire(interp, "Tcl", TCL_VERSION, EXACT) == NULL) {
-+ if (Tcl_PkgRequire(interp, "Tcl", TCL_PATCH_LEVEL, EXACT) == NULL) {
- return TCL_ERROR;
- }
-@@ -463,5 +463,5 @@
-
- #if (TCL_VERSION_NUMBER >= _VERSION(8,1,0))
-- if (Tcl_PkgPresent(interp, "Tk", TK_VERSION, EXACT) == NULL) {
-+ if (Tcl_PkgPresent(interp, "Tk", TK_PATCH_LEVEL, EXACT) == NULL) {
- return TCL_OK;
- }
-@@ -515,5 +515,5 @@
- * the same ones that BLT was compiled against.
- */
-- if (Tcl_PkgRequire(interp, "Tcl", TCL_VERSION, EXACT) == NULL) {
-+ if (Tcl_PkgRequire(interp, "Tcl", TCL_PATCH_LEVEL, EXACT) == NULL) {
- return TCL_ERROR;
- }
-@@ -553,9 +553,9 @@
-
- #if (TCL_VERSION_NUMBER >= _VERSION(8,1,0))
-- if (Tcl_PkgPresent(interp, "Tk", TK_VERSION, EXACT) == NULL) {
-+ if (Tcl_PkgPresent(interp, "Tk", TK_PATCH_LEVEL, EXACT) == NULL) {
- return TCL_OK;
- }
- #else
-- if (Tcl_PkgRequire(interp, "Tk", TK_VERSION, EXACT) == NULL) {
-+ if (Tcl_PkgRequire(interp, "Tk", TK_PATCH_LEVEL, EXACT) == NULL) {
- Tcl_ResetResult(interp);
- return TCL_OK;
---- src/bltGrAxis.c 2010-01-16 22:59:57.000000000 -0500
-+++ src/bltGrAxis.c 2010-01-16 23:05:00.000000000 -0500
-@@ -670,5 +670,5 @@
- int offset; /* Offset of field in structure. */
- {
-- unsigned int mask = (unsigned int)clientData;
-+ unsigned int mask = (uintptr_t)clientData;
- Axis *axisPtr = (Axis *)widgRec;
- Ticks **ticksPtrPtr = (Ticks **) (widgRec + offset);
-@@ -1421,5 +1421,5 @@
- {
- double range;
-- double tickMin, tickMax;
-+ double tickMin = 0, tickMax = 0;
- double majorStep, minorStep;
- int nMajor, nMinor;
-@@ -1550,7 +1550,7 @@
- double min, max;
- {
-- double range, step;
-+ double range, step = 0;
- double tickMin, tickMax;
-- double axisMin, axisMax;
-+ double axisMin = 0, axisMax = 0;
- int nTicks;
-
-@@ -3648,5 +3648,5 @@
- int margin;
-
-- margin = (int)argv[-1];
-+ margin = (intptr_t)argv[-1];
- chainPtr = graphPtr->margins[margin].axes;
- if (argc == 0) {
-@@ -4191,5 +4191,5 @@
- return TCL_ERROR;
- }
-- argv[2] = (char *)margin; /* Hack. Slide a reference to the margin in
-+ argv[2] = (char *)(intptr_t)margin; /* Hack. Slide a reference to the margin in
- * the argument list. Needed only for UseOp.
- */
---- src/bltGrBar.c 2002-09-18 18:30:51.000000000 -0400
-+++ src/bltGrBar.c 2010-01-16 23:06:36.000000000 -0500
-@@ -2148,5 +2148,6 @@
- Blt_HashSearch cursor;
- Bar *barPtr;
-- int isNew, count;
-+ int isNew;
-+ intptr_t count;
- int nStacks, nSegs;
- int nPoints;
-@@ -2198,5 +2199,5 @@
- count = 1;
- } else {
-- count = (int)Blt_GetHashValue(hPtr);
-+ count = (intptr_t)Blt_GetHashValue(hPtr);
- if (count == 1) {
- nStacks++;
-@@ -2220,10 +2221,10 @@
- for (hPtr = Blt_FirstHashEntry(&freqTable, &cursor); hPtr != NULL;
- hPtr = Blt_NextHashEntry(&cursor)) {
-- count = (int)Blt_GetHashValue(hPtr);
-+ count = (intptr_t)Blt_GetHashValue(hPtr);
- keyPtr = (FreqKey *)Blt_GetHashKey(&freqTable, hPtr);
- if (count > 1) {
- h2Ptr = Blt_CreateHashEntry(&(graphPtr->freqTable),
- (char *)keyPtr, &isNew);
-- count = (int)Blt_GetHashValue(hPtr);
-+ count = (intptr_t)Blt_GetHashValue(hPtr);
- infoPtr->freq = count;
- infoPtr->axes = keyPtr->axes;
---- src/bltColor.c 2002-08-09 21:29:33.000000000 -0400
-+++ src/bltColor.c 2010-01-16 23:43:28.000000000 -0500
-@@ -78,57 +78,4 @@
- #define NCOLORS 256
-
--
--static void
--GetPaletteSizes(nColors, nRedsPtr, nGreensPtr, nBluesPtr)
-- int nColors; /* Number of colors requested. */
-- unsigned int *nRedsPtr; /* (out) Number of red components. */
-- unsigned int *nGreensPtr; /* (out) Number of green components. */
-- unsigned int *nBluesPtr; /* (out) Number of blue components. */
--{
-- unsigned int nBlues, nReds, nGreens;
--
-- assert(nColors > 1);
-- nBlues = nReds = nGreens = 0;
-- while ((nBlues * nBlues * nBlues) <= nColors) {
-- nBlues++;
-- }
-- nBlues--;
-- while ((nReds * nReds * nBlues) <= nColors) {
-- nReds++;
-- }
-- nReds--;
-- nGreens = nColors / (nBlues * nReds);
--
-- *nRedsPtr = nReds;
-- *nGreensPtr = nGreens;
-- *nBluesPtr = nBlues;
--}
--
--static void
--BuildColorRamp(palettePtr, nColors)
-- Pix32 *palettePtr;
-- int nColors;
--{
-- register unsigned int r, g, b;
-- unsigned int short red, green, blue;
-- unsigned int nReds, nGreens, nBlues;
--
-- GetPaletteSizes(nColors, &nReds, &nGreens, &nBlues);
-- for (r = 0; r < nReds; r++) {
-- red = (r * USHRT_MAX) / (nReds - 1);
-- for (g = 0; g < nGreens; g++) {
-- green = (g * USHRT_MAX) / (nGreens - 1);
-- for (b = 0; b < nBlues; b++) {
-- blue = (b * USHRT_MAX) / (nBlues - 1);
-- palettePtr->Red = red;
-- palettePtr->Green = green;
-- palettePtr->Blue = blue;
-- palettePtr++;
-- }
-- }
-- }
--
--}
--
- /*
- *----------------------------------------------------------------------
-@@ -201,147 +148,4 @@
- }
-
--static void
--FindClosestColor(colorPtr, mapColors, numMapColors)
-- ColorInfo *colorPtr;
-- XColor mapColors[];
-- int numMapColors;
--{
-- double r, g, b;
-- register int i;
-- double dist, min;
-- XColor *lastMatch;
-- register XColor *mapColorPtr;
--
-- min = DBL_MAX; /* Any color is closer. */
-- lastMatch = NULL;
--
-- /* Linear search of color */
--
-- mapColorPtr = mapColors;
-- for (i = 0; i < numMapColors; i++, mapColorPtr++) {
-- r = (double)mapColorPtr->red - (double)colorPtr->exact.red;
-- g = (double)mapColorPtr->green - (double)colorPtr->exact.green;
-- b = (double)mapColorPtr->blue - (double)colorPtr->exact.blue;
--
-- dist = (r * r) + (b * b) + (g * g);
-- if (dist < min) {
-- min = dist;
-- lastMatch = mapColorPtr;
-- }
-- }
-- colorPtr->best = *lastMatch;
-- colorPtr->best.flags = (DoRed | DoGreen | DoBlue);
-- colorPtr->error = (float)sqrt(min);
--}
--
--static int
--CompareColors(a, b)
-- void *a, *b;
--{
-- ColorInfo *i1Ptr, *i2Ptr;
--
-- i1Ptr = *(ColorInfo **) a;
-- i2Ptr = *(ColorInfo **) b;
-- if (i2Ptr->error > i1Ptr->error) {
-- return 1;
-- } else if (i2Ptr->error < i1Ptr->error) {
-- return -1;
-- }
-- return 0;
--}
--
--static float
--MatchColors(colorTabPtr, rgbPtr, numColors, numAvailColors, numMapColors,
-- mapColors)
-- struct ColorTableStruct *colorTabPtr;
-- Pix32 *rgbPtr;
-- int numColors;
-- int numAvailColors;
-- int numMapColors;
-- XColor mapColors[NCOLORS];
--{
-- int numMatched;
-- float sum;
-- register int i;
-- register ColorInfo *colorPtr;
--
-- /*
-- * For each quantized color, compute and store the error (i.e
-- * the distance from a color that's already been allocated).
-- * We'll use this information to sort the colors based upon how
-- * badly they match and their frequency to the color image.
-- */
-- colorPtr = colorTabPtr->colorInfo;
-- for (i = 0; i < numColors; i++, colorPtr++, rgbPtr++) {
-- colorPtr->index = i;
-- colorTabPtr->sortedColors[i] = colorPtr;
-- colorPtr->exact.red = rgbPtr->Red;
-- colorPtr->exact.green = rgbPtr->Green;
-- colorPtr->exact.blue = rgbPtr->Blue;
-- colorPtr->exact.flags = (DoRed | DoGreen | DoBlue);
-- FindClosestColor(colorPtr, mapColors, numMapColors);
-- }
--
-- /* Sort the colors, first by frequency (most to least), then by
-- * matching error (worst to best).
-- */
-- qsort(colorTabPtr->sortedColors, numColors, sizeof(ColorInfo *),
-- (QSortCompareProc *)CompareColors);
--
-- for (i = 0; i < numColors; i++) {
-- colorPtr = colorTabPtr->sortedColors[i];
-- fprintf(stderr, "%d. %04x%04x%04x / %04x%04x%04x = %f (%d)\n", i,
-- colorPtr->exact.red, colorPtr->exact.green, colorPtr->exact.blue,
-- colorPtr->best.red, colorPtr->best.green, colorPtr->best.blue,
-- colorPtr->error, colorPtr->freq);
-- }
-- sum = 0.0;
-- numMatched = 0;
-- for (i = numAvailColors; i < numColors; i++) {
-- colorPtr = colorTabPtr->sortedColors[i];
-- sum += colorPtr->error;
-- numMatched++;
-- }
-- if (numMatched > 0) {
-- sum /= numMatched;
-- }
-- return sum;
--}
--
--
--static int
--AllocateColors(nImageColors, colorTabPtr, matchOnly)
-- int nImageColors;
-- struct ColorTableStruct *colorTabPtr;
-- int matchOnly;
--{
-- register int i;
-- register ColorInfo *colorPtr;
-- unsigned long int pixelValue;
--
-- for (i = 0; i < nImageColors; i++) {
-- colorPtr = colorTabPtr->sortedColors[i];
-- if (matchOnly) {
-- XAllocColor(colorTabPtr->display, colorTabPtr->colorMap,
-- &colorPtr->best);
-- pixelValue = colorPtr->best.pixel;
-- } else {
-- colorPtr->allocated = XAllocColor(colorTabPtr->display,
-- colorTabPtr->colorMap, &colorPtr->exact);
--
-- if (colorPtr->allocated) {
-- pixelValue = colorPtr->exact.pixel;
-- } else {
-- XAllocColor(colorTabPtr->display, colorTabPtr->colorMap,
-- &colorPtr->best);
-- pixelValue = colorPtr->best.pixel;
-- }
-- }
-- colorTabPtr->pixelValues[colorPtr->index] = pixelValue;
-- }
-- colorTabPtr->nPixels = nImageColors;
-- return 1;
--}
--
- ColorTable
- Blt_CreateColorTable(tkwin)
-@@ -511,47 +315,7 @@
- }
-
--/*
-- * First attempt:
-- * Allocate colors all the colors in the image (up to NCOLORS). Bail out
-- * on the first failure or if we need more than NCOLORS.
-- */
--static int
--GetUniqueColors(image)
-- Blt_ColorImage image;
--{
-- register int i, nColors;
-- register Pix32 *pixelPtr;
-- Pix32 color;
-- Blt_HashEntry *hPtr;
-- int isNew, nPixels;
-- int refCount;
-- Blt_HashTable colorTable;
--
-- Blt_InitHashTable(&colorTable, BLT_ONE_WORD_KEYS);
--
-- nPixels = Blt_ColorImageWidth(image) * Blt_ColorImageHeight(image);
-- nColors = 0;
-- pixelPtr = Blt_ColorImageBits(image);
-- for (i = 0; i < nPixels; i++, pixelPtr++) {
-- color.value = pixelPtr->value;
-- color.Alpha = 0xFF; /* Ignore alpha-channel values */
-- hPtr = Blt_CreateHashEntry(&colorTable, (char *)color.value, &isNew);
-- if (isNew) {
-- refCount = 1;
-- nColors++;
-- } else {
-- refCount = (int)Blt_GetHashValue(hPtr);
-- refCount++;
-- }
-- Blt_SetHashValue(hPtr, (ClientData)refCount);
-- }
-- Blt_DeleteHashTable(&colorTable);
-- return nColors;
--}
--
- #define Blt_DefaultColormap(tkwin) \
- DefaultColormap(Tk_Display(tkwin), Tk_ScreenNumber(tkwin))
-
--
- static void
- PrivateColormap(interp, colorTabPtr, image, tkwin)
---- src/bltConfig.c 2002-09-18 18:30:51.000000000 -0400
-+++ src/bltConfig.c 2010-01-16 23:45:46.000000000 -0500
-@@ -276,5 +276,5 @@
- int offset; /* Offset of style in record */
- {
-- unsigned int mask = (unsigned int)clientData; /* Bit to be tested */
-+ unsigned int mask = (uintptr_t)clientData; /* Bit to be tested */
- int *flagPtr = (int *)(widgRec + offset);
- int bool;
-@@ -312,5 +312,5 @@
- Tcl_FreeProc **freeProcPtr; /* Not Used. */
- {
-- unsigned int mask = (unsigned int)clientData; /* Bit to be tested */
-+ unsigned int mask = (uintptr_t)clientData; /* Bit to be tested */
- unsigned int bool = *(unsigned int *)(widgRec + offset);
-
-@@ -393,5 +393,5 @@
- {
- int *valuePtr = (int *)(widgRec + offset);
-- return Blt_GetPixels(interp, tkwin, string, (int)clientData, valuePtr);
-+ return Blt_GetPixels(interp, tkwin, string, (intptr_t)clientData, valuePtr);
- }
-
-@@ -482,5 +482,5 @@
- {
- int *valuePtr = (int *)(widgRec + offset);
-- return Blt_GetInt(interp, string, (int)clientData, valuePtr);
-+ return Blt_GetInt(interp, string, (intptr_t)clientData, valuePtr);
- }
-
---- src/bltContainer.c 2002-07-14 19:33:24.000000000 -0400
-+++ src/bltContainer.c 2010-01-16 23:47:10.000000000 -0500
-@@ -823,5 +823,5 @@
- int offset; /* Offset to field in structure */
- {
-- unsigned int flags = (int)clientData;
-+ unsigned int flags = (uintptr_t)clientData;
- Container *cntrPtr = (Container *)widgRec;
- Window *winPtr = (Window *) (widgRec + offset);
---- src/bltGrMisc.c 2002-07-17 05:56:00.000000000 -0400
-+++ src/bltGrMisc.c 2010-01-17 00:03:38.000000000 -0500
-@@ -75,5 +75,5 @@
- Tcl_Interp *interp;
- Tk_Window tkwin;
-- char *string;
-+ const char *string;
- int *xPtr, *yPtr;
- {
-@@ -261,5 +261,5 @@
- ColorPair *pairPtr = (ColorPair *)(widgRec + offset);
- ColorPair sample;
-- int allowDefault = (int)clientData;
-+ int allowDefault = (intptr_t)clientData;
-
- sample.fgColor = sample.bgColor = NULL;
---- src/bltHierbox.c 2002-09-18 23:02:09.000000000 -0400
-+++ src/bltHierbox.c 2010-01-17 00:02:41.000000000 -0500
-@@ -2078,5 +2078,5 @@
- do {
- serial = hboxPtr->nextSerial++;
-- hPtr = Blt_CreateHashEntry(&(hboxPtr->nodeTable), (char *)serial,
-+ hPtr = Blt_CreateHashEntry(&(hboxPtr->nodeTable), (char *)(intptr_t)serial,
- &isNew);
- } while (!isNew);
-@@ -2365,5 +2365,5 @@
- GetNodeByIndex(hboxPtr, string)
- Hierbox *hboxPtr;
-- char *string;
-+ const char *string;
- {
- if (isdigit(UCHAR(string[0]))) {
-@@ -2373,5 +2373,5 @@
- Blt_HashEntry *hPtr;
-
-- hPtr = Blt_FindHashEntry(&(hboxPtr->nodeTable), (char *)serial);
-+ hPtr = Blt_FindHashEntry(&(hboxPtr->nodeTable), (char *)(intptr_t)serial);
- if (hPtr != NULL) {
- return (Tree *) Blt_GetHashValue(hPtr);
-@@ -2403,9 +2403,9 @@
- Tree *nodePtr;
- {
-- static char string[200];
-+ static char string[31];
- int serial;
-
- /* Node table keys are integers. Convert them to strings. */
-- serial = (int)Blt_GetHashKey(&(hboxPtr->nodeTable),
-+ serial = (intptr_t)Blt_GetHashKey(&(hboxPtr->nodeTable),
- nodePtr->entryPtr->hashPtr);
- sprintf(string, "%d", serial);
-@@ -2458,5 +2458,5 @@
- GetNode(hboxPtr, string, treePtrPtr)
- Hierbox *hboxPtr;
-- char *string;
-+ const char *string;
- Tree **treePtrPtr;
- {
---- src/bltImage.c 2002-08-15 01:22:10.000000000 -0400
-+++ src/bltImage.c 2010-01-17 00:13:49.000000000 -0500
-@@ -2419,11 +2419,11 @@
- }
-
--static unsigned int *
--CreateColorLookupTable(s, cubes, nColors)
-+static void
-+CreateColorLookupTable(s, cubes, nColors, lut)
- ColorImageStatistics *s;
- Cube *cubes;
- int nColors;
-+ unsigned int lut[33][33][33];
- {
-- unsigned int *lut;
- Pix32 color;
- unsigned int red, green, blue;
-@@ -2432,7 +2432,4 @@
- register int i;
-
-- lut = Blt_Calloc(sizeof(unsigned int), 33 * 33 * 33);
-- assert(lut);
--
- color.Alpha = (unsigned char)-1;
- for (cubePtr = cubes, i = 0; i < nColors; i++, cubePtr++) {
-@@ -2451,5 +2448,4 @@
- Mark(cubePtr, color.value, lut);
- }
-- return lut;
- }
-
-@@ -2514,5 +2510,5 @@
- ColorImageStatistics *statistics;
- int nColors;
-- unsigned int *lut;
-+ unsigned int lut[33][33][33];
-
- /*
-@@ -2528,9 +2524,8 @@
- assert(nColors <= reduceColors);
-
-- lut = CreateColorLookupTable(statistics, cubes, nColors);
-+ CreateColorLookupTable(statistics, cubes, nColors, lut);
- Blt_Free(statistics);
- Blt_Free(cubes);
- MapColors(src, dest, lut);
-- Blt_Free(lut);
- return TCL_OK;
- }
---- src/bltUnixImage.c 2002-08-16 00:15:04.000000000 -0400
-+++ src/bltUnixImage.c 2010-01-17 00:15:52.000000000 -0500
-@@ -575,5 +575,5 @@
- endPtr = destPtr + nPixels;
- for (/* empty */; destPtr < endPtr; destPtr++) {
-- hPtr = Blt_FindHashEntry(&pixelTable, (char *)destPtr->value);
-+ hPtr = Blt_FindHashEntry(&pixelTable, (char *)(intptr_t)destPtr->value);
- colorPtr = (XColor *)Blt_GetHashValue(hPtr);
- destPtr->Red = lut[colorPtr->red >> 8];
---- src/bltTable.c 2002-10-14 19:31:24.000000000 -0400
-+++ src/bltTable.c 2010-01-21 23:11:06.000000000 -0500
-@@ -2035,5 +2035,5 @@
- for (node = Blt_ListFirstNode(list); node != NULL;
- node = Blt_ListNextNode(node)) {
-- key = (int)Blt_ListGetKey(node);
-+ key = (intptr_t)Blt_ListGetKey(node);
- if (entryPtr->row.span <= key) {
- break;
-@@ -2047,5 +2047,5 @@
- * span and and link it into the list of buckets.
- */
-- newNode = Blt_ListCreateNode(list, (char *)entryPtr->row.span);
-+ newNode = Blt_ListCreateNode(list, (char *)(intptr_t)entryPtr->row.span);
- Blt_ListSetValue(newNode, (char *)Blt_ChainCreate());
- Blt_ListLinkBefore(list, newNode, node);
-@@ -2064,5 +2064,5 @@
- for (node = Blt_ListFirstNode(list); node != NULL;
- node = Blt_ListNextNode(node)) {
-- key = (int)Blt_ListGetKey(node);
-+ key = (intptr_t)Blt_ListGetKey(node);
- if (entryPtr->column.span <= key) {
- break;
-@@ -2076,5 +2076,5 @@
- * span and and link it into the list of buckets.
- */
-- newNode = Blt_ListCreateNode(list, (char *)entryPtr->column.span);
-+ newNode = Blt_ListCreateNode(list, (char *)(intptr_t)entryPtr->column.span);
- Blt_ListSetValue(newNode, (char *)Blt_ChainCreate());
- Blt_ListLinkBefore(list, newNode, node);
---- src/bltTreeView.c 2010-01-17 00:06:38.000000000 -0500
-+++ src/bltTreeView.c 2010-01-21 23:12:51.000000000 -0500
-@@ -1050,5 +1050,5 @@
- Blt_HashEntry *hPtr;
- int isNew;
-- int refCount;
-+ intptr_t refCount;
-
- hPtr = Blt_CreateHashEntry(&tvPtr->uidTable, string, &isNew);
-@@ -1056,5 +1056,5 @@
- refCount = 1;
- } else {
-- refCount = (int)Blt_GetHashValue(hPtr);
-+ refCount = (intptr_t)Blt_GetHashValue(hPtr);
- refCount++;
- }
-@@ -1081,9 +1081,9 @@
- {
- Blt_HashEntry *hPtr;
-- int refCount;
-+ intptr_t refCount;
-
- hPtr = Blt_FindHashEntry(&tvPtr->uidTable, uid);
- assert(hPtr != NULL);
-- refCount = (int)Blt_GetHashValue(hPtr);
-+ refCount = (intptr_t)Blt_GetHashValue(hPtr);
- refCount--;
- if (refCount > 0) {
---- src/bltTreeView.h 2002-08-15 18:20:38.000000000 -0400
-+++ src/bltTreeView.h 2010-01-21 23:17:42.000000000 -0500
-@@ -1005,4 +1005,6 @@
- extern void Blt_TreeViewDrawRule _ANSI_ARGS_((TreeView *tvPtr,
- TreeViewColumn *columnPtr, Drawable drawable));
-+extern int Blt_TreeViewTextbox _ANSI_ARGS_((TreeView *tvPtr,
-+ TreeViewEntry *entryPtr, TreeViewColumn *columnPtr));
- extern int Blt_TreeViewTextOp _ANSI_ARGS_((TreeView *tvPtr, Tcl_Interp *interp,
- int objc, Tcl_Obj *CONST *objv));
---- src/bltTreeViewStyle.c 2002-07-22 18:18:40.000000000 -0400
-+++ src/bltTreeViewStyle.c 2010-01-21 23:19:14.000000000 -0500
-@@ -416,5 +416,5 @@
- static StyleFreeProc FreeTextBox, FreeCheckBox, FreeComboBox;
- static StyleMeasureProc MeasureTextBox, MeasureCheckBox, MeasureComboBox;
--static StylePickProc PickCheckBox, PickComboBox;
-+static StylePickProc PickComboBox;
-
- /*
-@@ -1264,58 +1264,4 @@
- *----------------------------------------------------------------------
- *
-- * PickCheckbox --
-- *
-- * Draws the "checkbox" given the screen coordinates and the
-- * value to be displayed.
-- *
-- * Results:
-- * None.
-- *
-- * Side Effects:
-- * The checkbox value is drawn.
-- *
-- *----------------------------------------------------------------------
-- */
--static int
--PickCheckBox(entryPtr, valuePtr, stylePtr, worldX, worldY)
-- TreeViewEntry *entryPtr;
-- TreeViewValue *valuePtr;
-- TreeViewStyle *stylePtr;
-- int worldX, worldY;
--{
-- TreeViewColumn *columnPtr;
-- TreeViewCheckBox *cbPtr = (TreeViewCheckBox *)stylePtr;
-- int columnWidth;
-- int x, y, width, height;
--
-- columnPtr = valuePtr->columnPtr;
-- columnWidth = columnPtr->width -
-- (2 * columnPtr->borderWidth + PADDING(columnPtr->pad));
-- if (columnWidth > valuePtr->width) {
-- switch(columnPtr->justify) {
-- case TK_JUSTIFY_RIGHT:
-- worldX += (columnWidth - valuePtr->width);
-- break;
-- case TK_JUSTIFY_CENTER:
-- worldX += (columnWidth - valuePtr->width) / 2;
-- break;
-- case TK_JUSTIFY_LEFT:
-- break;
-- }
-- }
-- width = height = ODD(cbPtr->size) + 2 * cbPtr->lineWidth;
-- x = columnPtr->worldX + columnPtr->pad.side1 + cbPtr->gap -
-- cbPtr->lineWidth;
-- y = entryPtr->worldY + (entryPtr->height - height) / 2;
-- if ((worldX >= x) && (worldX < (x + width)) &&
-- (worldY >= y) && (worldY < (y + height))) {
-- return TRUE;
-- }
-- return FALSE;
--}
--
--/*
-- *----------------------------------------------------------------------
-- *
- * EditCheckbox --
- *
---- src/bltObjConfig.c 2002-09-18 18:30:51.000000000 -0400
-+++ src/bltObjConfig.c 2010-01-21 23:21:47.000000000 -0500
-@@ -1220,5 +1220,5 @@
- {
- int bool;
-- unsigned int flag;
-+ uintptr_t flag;
-
-
-@@ -1226,5 +1226,5 @@
- return TCL_ERROR;
- }
-- flag = (unsigned int)specPtr->customPtr;
-+ flag = (uintptr_t)specPtr->customPtr;
- *(int *)ptr &= ~flag;
- if (bool) {
-@@ -1499,7 +1499,7 @@
- case BLT_CONFIG_BITFLAG:
- {
-- unsigned int flag;
-+ uintptr_t flag;
-
-- flag = (*(int *)ptr) & (unsigned int)specPtr->customPtr;
-+ flag = (*(int *)ptr) & (uintptr_t)specPtr->customPtr;
- return Tcl_NewBooleanObj((flag != 0));
- }
---- src/bltTed.c 2002-05-16 16:46:00.000000000 -0400
-+++ src/bltTed.c 2010-01-21 23:24:01.000000000 -0500
-@@ -307,8 +307,6 @@
- static void DestroyTed _ANSI_ARGS_((DestroyData destroyData));
- static void DisplayEntry _ANSI_ARGS_((ClientData clientData));
--static void DestroyEntry _ANSI_ARGS_((DestroyData destoryData));
-
- static Tcl_CmdProc TedCmd;
--static Tk_EventProc EntryEventProc;
- static Tk_EventProc TedEventProc;
-
-@@ -343,72 +341,4 @@
-
- /*
-- *----------------------------------------------------------------------
-- *
-- * EventuallyRedraw --
-- *
-- * Queues a request to redraw the text window at the next idle
-- * point.
-- *
-- * Results:
-- * None.
-- *
-- * Side effects:
-- * Information gets redisplayed. Right now we don't do selective
-- * redisplays: the whole window will be redrawn. This doesn't
-- * seem to hurt performance noticeably, but if it does then this
-- * could be changed.
-- *
-- *----------------------------------------------------------------------
-- */
--static void
--EventuallyRedrawEntry(repPtr)
-- EntryRep *repPtr; /* Information about editor. */
--{
-- if ((repPtr->tkwin != NULL) && !(repPtr->flags & REDRAW_PENDING)) {
-- repPtr->flags |= REDRAW_PENDING;
-- Tcl_DoWhenIdle(DisplayEntry, repPtr);
-- }
--}
--
--/*
-- * --------------------------------------------------------------
-- *
-- * EntryEventProc --
-- *
-- * This procedure is invoked by the Tk dispatcher for various
-- * events on the editing grid for the table.
-- *
-- * Results:
-- * None.
-- *
-- * Side effects:
-- * When the window gets deleted, internal structures get
-- * cleaned up. When it gets exposed, it is redisplayed.
-- *
-- * --------------------------------------------------------------
-- */
--static void
--EntryEventProc(clientData, eventPtr)
-- ClientData clientData; /* Information about window. */
-- XEvent *eventPtr; /* Information about event. */
--{
-- EntryRep *repPtr = (EntryRep *) clientData;
--
-- if (eventPtr->type == ConfigureNotify) {
-- EventuallyRedrawEntry(repPtr);
-- } else if (eventPtr->type == Expose) {
-- if (eventPtr->xexpose.count == 0) {
-- EventuallyRedrawEntry(repPtr);
-- }
-- } else if (eventPtr->type == DestroyNotify) {
-- repPtr->tkwin = NULL;
-- if (repPtr->flags & REDRAW_PENDING) {
-- Tcl_CancelIdleCall(DisplayEntry, repPtr);
-- }
-- Tcl_EventuallyFree(repPtr, DestroyEntry);
-- }
--}
--
--/*
- * --------------------------------------------------------------
- *
-@@ -545,78 +475,4 @@
- * ----------------------------------------------------------------------------
- *
-- * CreateEntry --
-- *
-- * ----------------------------------------------------------------------------
-- */
--static int
--CreateEntry(tedPtr, entryPtr)
-- Ted *tedPtr;
-- Entry *entryPtr;
--{
-- Tk_Window tkwin, master;
-- char string[200];
-- EntryRep *repPtr;
-- Blt_ChainLink *linkPtr;
--
-- repPtr = Blt_Calloc(1, sizeof(EntryRep));
-- assert(repPtr);
-- repPtr->tablePtr = tedPtr->tablePtr;
-- repPtr->tedPtr = tedPtr;
-- repPtr->interp = tedPtr->interp;
-- repPtr->entryPtr = entryPtr;
-- repPtr->mapped = 0;
--
-- /*
-- * Create a sibling window to cover the master window. It will
-- * be stacked just above the master window.
-- */
--
-- master = tedPtr->tablePtr->tkwin;
-- sprintf(string, "bltTed%d", tedPtr->nextWindowId);
-- tedPtr->nextWindowId++;
-- tkwin = Tk_CreateWindow(tedPtr->interp, master, string, (char *)NULL);
-- if (tkwin == NULL) {
-- Blt_Free(repPtr);
-- return TCL_ERROR;
-- }
-- Tk_SetClass(tkwin, "BltTed");
-- Tk_CreateEventHandler(tkwin, ExposureMask | StructureNotifyMask,
-- EntryEventProc, repPtr);
-- repPtr->tkwin = tkwin;
-- linkPtr = Blt_ChainNewLink();
-- Blt_ChainSetValue(linkPtr, repPtr);
-- Blt_ChainLinkAfter(tedPtr->chainPtr, linkPtr, (Blt_ChainLink *)NULL);
-- return TCL_OK;
--}
--
--/*
-- * ----------------------------------------------------------------------------
-- *
-- * DestroyEntry --
-- *
-- * ----------------------------------------------------------------------------
-- */
--static void
--DestroyEntry(data)
-- DestroyData data;
--{
-- EntryRep *repPtr = (EntryRep *)data;
-- Blt_ChainLink *linkPtr;
-- Entry *entryPtr;
--
-- for (linkPtr = Blt_ChainFirstLink(repPtr->tedPtr->chainPtr);
-- linkPtr != NULL; linkPtr = Blt_ChainNextLink(linkPtr)) {
-- entryPtr = Blt_ChainGetValue(linkPtr);
-- if (entryPtr == repPtr->entryPtr) {
-- Blt_ChainDeleteLink(repPtr->tedPtr->chainPtr, linkPtr);
-- Blt_Free(repPtr);
-- return;
-- }
-- }
--}
--
--/*
-- * ----------------------------------------------------------------------------
-- *
- * DisplayEntry --
- *
diff -urN /usr/ports/x11-toolkits/blt/pkg-descr x11-toolkits/blt/pkg-descr
--- /usr/ports/x11-toolkits/blt/pkg-descr 2013-06-21 03:54:39.000000000 +0900
+++ x11-toolkits/blt/pkg-descr 2013-11-01 00:00:00.000000000 +0900
@@ -4,3 +4,5 @@
NOTE: This kit requires as a pre-requisite the Tcl and Tk binary kits.
This version uses FreeBSD shared libraries.
+
+WWW: http://blt.sourceforge.net/
diff -urN /usr/ports/x11-toolkits/blt/pkg-plist x11-toolkits/blt/pkg-plist
--- /usr/ports/x11-toolkits/blt/pkg-plist 2013-10-31 15:20:40.000000000 +0900
+++ x11-toolkits/blt/pkg-plist 2013-11-01 00:00:00.000000000 +0900
@@ -10,6 +10,9 @@
include/bltPool.h
include/bltTree.h
include/bltVector.h
+lib/blt2.4/NEWS
+lib/blt2.4/PROBLEMS
+lib/blt2.4/README
lib/blt2.4/bltCanvEps.pro
lib/blt2.4/bltGraph.pro
lib/blt2.4/dd_protocols/dd-color.tcl
--Multipart=_Fri__1_Nov_2013_05_30_00_+0900_z4gWL20z9aogO=dd--
More information about the freebsd-ports-bugs
mailing list