diff options
-rw-r--r-- | ChangeLog | 68 | ||||
-rw-r--r-- | changes | 59 | ||||
-rw-r--r-- | generic/tk.h | 6 | ||||
-rw-r--r-- | generic/tkButton.c | 71 | ||||
-rw-r--r-- | generic/tkCanvLine.c | 34 | ||||
-rw-r--r-- | generic/tkConsole.c | 11 | ||||
-rw-r--r-- | generic/tkFocus.c | 11 | ||||
-rw-r--r-- | generic/tkImgBmap.c | 18 | ||||
-rw-r--r-- | generic/tkImgPhoto.c | 22 | ||||
-rw-r--r-- | generic/tkMenu.c | 21 | ||||
-rw-r--r-- | generic/tkTest.c | 5 | ||||
-rw-r--r-- | generic/tkText.c | 20 | ||||
-rw-r--r-- | generic/tkText.h | 5 | ||||
-rw-r--r-- | library/menu.tcl | 11 | ||||
-rw-r--r-- | library/prolog.ps | 4 | ||||
-rw-r--r-- | mac/tkMacAppInit.c | 12 | ||||
-rw-r--r-- | tests/main.test | 7 | ||||
-rw-r--r-- | tests/unixWm.test | 3 | ||||
-rw-r--r-- | unix/README | 20 | ||||
-rw-r--r-- | unix/configure.in | 32 | ||||
-rw-r--r-- | unix/tkAppInit.c | 6 | ||||
-rw-r--r-- | unix/tkUnixSend.c | 12 | ||||
-rw-r--r-- | win/makefile.vc | 63 | ||||
-rw-r--r-- | win/tkWinFont.c | 5 | ||||
-rw-r--r-- | win/tkWinInt.h | 3 | ||||
-rw-r--r-- | win/tkWinMenu.c | 7 | ||||
-rw-r--r-- | win/tkWinPointer.c | 28 | ||||
-rw-r--r-- | win/tkWinSend.c | 18 | ||||
-rw-r--r-- | win/tkWinWm.c | 23 | ||||
-rw-r--r-- | win/winMain.c | 9 |
30 files changed, 432 insertions, 182 deletions
@@ -1,3 +1,71 @@ +1999-02-04 <stanton@GASPODE> + + * Various cleanup related to the Tcl_Eval and Tcl_ObjSetVar + changes in Tcl. + + INTEGRATED PATCHES FROM 8.0.5b2: + + * win/tkWinMenu.c (TkpDestroyMenu): Changed so modalMenuPtr is + cleared when it is being destroyed. + + * generic/tkImgPhoto.c: Changed so color tables are freed + immediately instead of being delayed. This ensures that color + tables are properly disposed at process exit. + + * library/prolog.ps: Changed string that determines font height to + include European character with an umlaut. + + * generic/tkImgBmap.c (ImgBmapConfigureInstance): If an image + mask changed but ended up with the same XID, the GC failed to be + updated and so the new mask was not used. [Bug: 970] + + * generic/tkFocus.c (SetFocus): Changed o focus window is always + set if -force is specified. This fixes the problem on Windows + where Tk does not activate the window if it already has focus. + + * generic/tkConsole.c: Fixed so errors in console eval are + reported properly. Eliminated duplicate result messages. [Bug: 973] + + * win/tkWinWm.c: Changed so windows that aren't resizable don't + have resize handles and the zoom box is disabled. + + * win/tkWinInt.h: + * win/tkWinPointer.c: Changed to cancel the mouse timer when a + user initiated move/resize loop begins. + + * unix/configure.in: TK_LD_SEARCH_FLAGS was set incorrectly if + SHLIB_LD_LIBS='${LIBS}', and shared linking is performed through + the C compiler. Systems affected are Linux, MP-RAS and NEXTSTEP, + but also with gcc on many more systems. [Bug: 908] + + * win/makefile.vc: First stab at install target. Fixed quoting so + paths with spaces work. + + * tests/main.test: + * tests/unixWm.test: Better cleanup of temporary files. + + * mac/tkMacAppInit.c: + * generic/tkTest.c: + * generic/tkAppInit.c: + * win/winMain.c: Changed some EXTERN declarations to extern + since they are not defining exported interfaces. This avoids + generating useless declspec() attributes and makes the windows + makefile simpler. + + * library/menu.tcl (tkMenuFind): Changed so keyboard shortcuts + will only be found in the current toplevel. Previously, they + might be found in menus attached to other toplevels that might not + even be mapped. [Bug: 924] + + * generic/tkCanvLine.c: Changed to treat zero width lines like + they have width 1 for purposes of selection. [Bug: 925] + + * win/tkWinFont.c (Tk_MeasureChars): Added a workaround for a bug + in GetTextExtentExPoint on Win NT 4.0/Japanese. [Bug: 1006] + + * unix/tkUnixSend.c (Tk_SetAppName): Fixed uninitialized memory + access bug. [Bug: 919] + 1999-1-28 <stanton@GASPODE> * generic/tkGrid.c: Fixed bug in "grid forget" that failed to cancel @@ -2,7 +2,7 @@ This file summarizes all changes made to Tk since version 1.0 was released on March 13, 1991. Changes that aren't backward compatible are marked specially. -RCS: @(#) $Id: changes,v 1.1.4.6 1999/01/29 00:34:29 stanton Exp $ +RCS: @(#) $Id: changes,v 1.1.4.7 1999/02/11 04:13:44 stanton Exp $ 3/16/91 (bug fix) Modified tkWindow.c to remove Tk's Tcl commands from the interpreter when the main window is deleted (otherwise there will @@ -4286,6 +4286,63 @@ with MacOS 8.1 or later. (JI) ----------------- Released 8.0.4, 11/20/98 ----------------------- +11/24/98 (bug fix) On some X servers, XQueryLoadFont will always +return a font, even if the name is meaningless. This prevents Tk from +parsing the font name, so now we perform a quick sanity check on the +name before letting X have it. (stanton) + +12/30/98 (bug fix) Fixed bug in "grid forget" that failed to cancel +pending idle handlers, resulting in a crash in a few odd cases. (stanton) + +1/28/99 (configure change) Now support -pipe option on gcc. (RJ) + +2/4/99 (bug fix) Changed so color tables in photo images are freed +immediately instead of being delayed. This ensures that color tables +are properly disposed at process exit. (stanton) + +2/4/99 (bug fix) Changed postscript template to include a European +character with an umlaut when determining font height. (stanton) + +2/4/99 (bug fix) If an image bitmap mask changed but ended up with the +same XID, the GC failed to be updated and so the new mask was +not used. (stanton) + +2/4/99 (bug fix) Changed so focus window is always set if -force is +specified. This fixes the problem on Windows where Tk does not +activate the window if it already has focus. (stanton) + +2/4/99 (bug fix) Fixed so errors in console eval are reported +properly. Eliminated duplicate result messages. (stanton) + +2/4/99 (bug fix) Under Windows, changed so toplevels that aren't +resizable don't have resize handles and the zoom box is disabled. (stanton) + +2/4/99 (bug fix) Changed to cancel the mouse timer when a user +initiated move/resize loop begins on Windows. (stanton) + +2/4/99 (configure change) TK_LD_SEARCH_FLAGS was set incorrectly if +SHLIB_LD_LIBS='${LIBS}', and shared linking is performed through the C +compiler. Systems affected are Linux, MP-RAS and NEXTSTEP, but also +with gcc on many more systems. + +2/4/99 (bug fix) Changed some EXTERN declarations to extern since they +are not defining exported interfaces. This avoids generating useless +declspec() attributes and makes the Windows makefile simpler. (stanton) + +2/4/99 (bug fix) Changed so keyboard shortcuts will only be found in +the current toplevel. Previously, they might be found in menus +attached to other toplevels that might not even be mapped. (stanton) +*** POTENTIAL INCOMPATIBILITY *** + +2/4/99 (bug fix) Changed to treat zero width lines in the canvas like +they have width 1 for purposes of selection. (stanton) + +2/4/99 (bug fix) Added a workaround for a bug in GetTextExtentExPoint +on Win NT 4.0/Japanese that cause a crash in some cases. (stanton) + +2/4/99 (bug fix) Fixed uninitialized memory access bug in Unix send +code. (stanton) + ---------------------------------------------------------- Changes for Tk 8.0 go above this line. Changes for Tk 8.1 go below this line. diff --git a/generic/tk.h b/generic/tk.h index 04aa2f6..867c522 100644 --- a/generic/tk.h +++ b/generic/tk.h @@ -12,7 +12,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tk.h,v 1.1.4.6 1999/01/29 00:34:31 stanton Exp $ + * RCS: @(#) $Id: tk.h,v 1.1.4.7 1999/02/11 04:13:44 stanton Exp $ */ #ifndef _TK @@ -24,8 +24,8 @@ * * README * unix/configure.in - * win/makefile.bc (Not for patch release updates) - * win/makefile.vc (Not for patch release updates) + * win/makefile.bc + * win/makefile.vc * win/README * library/tk.tcl * README, win/README, unix/README, and mac/README diff --git a/generic/tkButton.c b/generic/tkButton.c index 7b10023..d2549f9 100644 --- a/generic/tkButton.c +++ b/generic/tkButton.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkButton.c,v 1.1.4.3 1998/11/30 21:03:40 stanton Exp $ + * RCS: @(#) $Id: tkButton.c,v 1.1.4.4 1999/02/11 04:13:45 stanton Exp $ */ #include "tkButton.h" @@ -776,17 +776,14 @@ ButtonWidgetObjCmd(clientData, interp, objc, objv) goto error; } if (butPtr->type == TYPE_CHECK_BUTTON) { - if (Tcl_SetObjVar2(interp, - Tcl_GetString(butPtr->selVarNamePtr), - NULL, butPtr->offValuePtr, - TCL_GLOBAL_ONLY|TCL_LEAVE_ERR_MSG) + if (Tcl_ObjSetVar2(interp, butPtr->selVarNamePtr, NULL, + butPtr->offValuePtr, TCL_GLOBAL_ONLY|TCL_LEAVE_ERR_MSG) == NULL) { goto error; } } else if (butPtr->flags & SELECTED) { - if (Tcl_SetObjVar2(interp, - Tcl_GetString(butPtr->selVarNamePtr), NULL, - Tcl_NewObj(), + if (Tcl_ObjSetVar2(interp, + butPtr->selVarNamePtr, NULL, Tcl_NewObj(), TCL_GLOBAL_ONLY|TCL_LEAVE_ERR_MSG) == NULL) { goto error; @@ -845,10 +842,8 @@ ButtonWidgetObjCmd(clientData, interp, objc, objv) Tcl_WrongNumArgs(interp, 1, objv, "select"); goto error; } - if (Tcl_SetObjVar2(interp, - Tcl_GetString(butPtr->selVarNamePtr), NULL, - butPtr->onValuePtr, - TCL_GLOBAL_ONLY|TCL_LEAVE_ERR_MSG) + if (Tcl_ObjSetVar2(interp, butPtr->selVarNamePtr, NULL, + butPtr->onValuePtr, TCL_GLOBAL_ONLY|TCL_LEAVE_ERR_MSG) == NULL) { goto error; } @@ -860,8 +855,7 @@ ButtonWidgetObjCmd(clientData, interp, objc, objv) Tcl_WrongNumArgs(interp, 1, objv, "toggle"); goto error; } - if (Tcl_SetObjVar2(interp, - Tcl_GetString(butPtr->selVarNamePtr), NULL, + if (Tcl_ObjSetVar2(interp, butPtr->selVarNamePtr, NULL, (butPtr->flags & SELECTED) ? butPtr->offValuePtr : butPtr->onValuePtr, TCL_GLOBAL_ONLY|TCL_LEAVE_ERR_MSG) @@ -1056,15 +1050,14 @@ ConfigureButton(interp, butPtr, objc, objv) } if (butPtr->type >= TYPE_CHECK_BUTTON) { - Tcl_Obj *valuePtr; - char *name; + Tcl_Obj *valuePtr, *namePtr; if (butPtr->selVarNamePtr == NULL) { butPtr->selVarNamePtr = Tcl_NewStringObj( Tk_Name(butPtr->tkwin), -1); Tcl_IncrRefCount(butPtr->selVarNamePtr); } - name = Tcl_GetString(butPtr->selVarNamePtr); + namePtr = butPtr->selVarNamePtr; /* * Select the button if the associated variable has the @@ -1073,7 +1066,7 @@ ConfigureButton(interp, butPtr, objc, objv) * changes to its value. */ - valuePtr = Tcl_GetObjVar2(interp, name, NULL, TCL_GLOBAL_ONLY); + valuePtr = Tcl_ObjGetVar2(interp, namePtr, NULL, TCL_GLOBAL_ONLY); butPtr->flags &= ~SELECTED; if (valuePtr != NULL) { if (strcmp(Tcl_GetString(valuePtr), @@ -1081,7 +1074,7 @@ ConfigureButton(interp, butPtr, objc, objv) butPtr->flags |= SELECTED; } } else { - if (Tcl_SetObjVar2(interp, name, NULL, + if (Tcl_ObjSetVar2(interp, namePtr, NULL, (butPtr->type == TYPE_CHECK_BUTTON) ? butPtr->offValuePtr : Tcl_NewObj(), TCL_GLOBAL_ONLY|TCL_LEAVE_ERR_MSG) @@ -1134,13 +1127,12 @@ ConfigureButton(interp, butPtr, objc, objv) * exist, and fetch its current value. */ - char *name; - Tcl_Obj *valuePtr; + Tcl_Obj *valuePtr, *namePtr; - name = Tcl_GetString(butPtr->textVarNamePtr); - valuePtr = Tcl_GetObjVar2(interp, name, NULL, TCL_GLOBAL_ONLY); + namePtr = butPtr->textVarNamePtr; + valuePtr = Tcl_ObjGetVar2(interp, namePtr, NULL, TCL_GLOBAL_ONLY); if (valuePtr == NULL) { - if (Tcl_SetObjVar2(interp, name, NULL, butPtr->textPtr, + if (Tcl_ObjSetVar2(interp, namePtr, NULL, butPtr->textPtr, TCL_GLOBAL_ONLY|TCL_LEAVE_ERR_MSG) == NULL) { continue; @@ -1438,42 +1430,31 @@ int TkInvokeButton(butPtr) TkButton *butPtr; /* Information about button. */ { - char *name; + Tcl_Obj *namePtr = butPtr->selVarNamePtr; - if (butPtr->selVarNamePtr != NULL) { - name = Tcl_GetString(butPtr->selVarNamePtr); - } else { - /* - * This code should be executed only if the button is a - * label or regular button, in which case the variable should - * never be used. - */ - - name = NULL; - } if (butPtr->type == TYPE_CHECK_BUTTON) { if (butPtr->flags & SELECTED) { - if (Tcl_SetObjVar2(butPtr->interp, name, NULL, butPtr->offValuePtr, - TCL_GLOBAL_ONLY|TCL_LEAVE_ERR_MSG) + if (Tcl_ObjSetVar2(butPtr->interp, namePtr, NULL, + butPtr->offValuePtr, TCL_GLOBAL_ONLY|TCL_LEAVE_ERR_MSG) == NULL) { return TCL_ERROR; } } else { - if (Tcl_SetObjVar2(butPtr->interp, name, NULL, butPtr->onValuePtr, - TCL_GLOBAL_ONLY|TCL_LEAVE_ERR_MSG) + if (Tcl_ObjSetVar2(butPtr->interp, namePtr, NULL, + butPtr->onValuePtr, TCL_GLOBAL_ONLY|TCL_LEAVE_ERR_MSG) == NULL) { return TCL_ERROR; } } } else if (butPtr->type == TYPE_RADIO_BUTTON) { - if (Tcl_SetObjVar2(butPtr->interp, name, NULL, butPtr->onValuePtr, + if (Tcl_ObjSetVar2(butPtr->interp, namePtr, NULL, butPtr->onValuePtr, TCL_GLOBAL_ONLY|TCL_LEAVE_ERR_MSG) == NULL) { return TCL_ERROR; } } if ((butPtr->type != TYPE_LABEL) && (butPtr->commandPtr != NULL)) { - return Tcl_EvalObj(butPtr->interp, butPtr->commandPtr, + return Tcl_EvalObjEx(butPtr->interp, butPtr->commandPtr, TCL_EVAL_GLOBAL); } return TCL_OK; @@ -1533,7 +1514,7 @@ ButtonVarProc(clientData, interp, name1, name2, flags) * the button. */ - valuePtr = Tcl_GetObjVar2(interp, name, NULL, TCL_GLOBAL_ONLY); + valuePtr = Tcl_GetVar2Ex(interp, name, NULL, TCL_GLOBAL_ONLY); if (valuePtr == NULL) { value = ""; } else { @@ -1599,7 +1580,7 @@ ButtonTextVarProc(clientData, interp, name1, name2, flags) if (flags & TCL_TRACE_UNSETS) { if ((flags & TCL_TRACE_DESTROYED) && !(flags & TCL_INTERP_DESTROYED)) { - Tcl_SetObjVar2(interp, name, NULL, butPtr->textPtr, + Tcl_SetVar2Ex(interp, name, NULL, butPtr->textPtr, TCL_GLOBAL_ONLY); Tcl_TraceVar(interp, name, TCL_GLOBAL_ONLY|TCL_TRACE_WRITES|TCL_TRACE_UNSETS, @@ -1608,7 +1589,7 @@ ButtonTextVarProc(clientData, interp, name1, name2, flags) return (char *) NULL; } - valuePtr = Tcl_GetObjVar2(interp, name, NULL, TCL_GLOBAL_ONLY); + valuePtr = Tcl_GetVar2Ex(interp, name, NULL, TCL_GLOBAL_ONLY); if (valuePtr == NULL) { valuePtr = Tcl_NewObj(); } diff --git a/generic/tkCanvLine.c b/generic/tkCanvLine.c index 177ffaf..a9601d5 100644 --- a/generic/tkCanvLine.c +++ b/generic/tkCanvLine.c @@ -5,11 +5,12 @@ * * Copyright (c) 1991-1994 The Regents of the University of California. * Copyright (c) 1994-1997 Sun Microsystems, Inc. + * Copyright (c) 1998-1999 by Scriptics Corporation. * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkCanvLine.c,v 1.1.4.3 1998/12/13 08:16:02 lfb Exp $ + * RCS: @(#) $Id: tkCanvLine.c,v 1.1.4.4 1999/02/11 04:13:45 stanton Exp $ */ #include <stdio.h> @@ -818,7 +819,7 @@ LineToPoint(canvas, itemPtr, pointPtr) double *coordPtr, *linePoints; double staticSpace[2*MAX_STATIC_POINTS]; double poly[10]; - double bestDist, dist; + double bestDist, dist, width; int numPoints, count; int changedMiterToBevel; /* Non-zero means that a mitered corner * had to be treated as beveled after all @@ -847,6 +848,11 @@ LineToPoint(canvas, itemPtr, pointPtr) linePoints = linePtr->coordPtr; } + width = (double) linePtr->width; + if (width < 1.0) { + width = 1.0; + } + /* * The overall idea is to iterate through all of the edges of * the line, computing a polygon for each edge and testing the @@ -867,7 +873,7 @@ LineToPoint(canvas, itemPtr, pointPtr) || ((linePtr->joinStyle == JoinRound) && (count != numPoints))) { dist = hypot(coordPtr[0] - pointPtr[0], coordPtr[1] - pointPtr[1]) - - linePtr->width/2.0; + - width/2.0; if (dist <= 0.0) { bestDist = 0.0; goto done; @@ -883,7 +889,7 @@ LineToPoint(canvas, itemPtr, pointPtr) */ if (count == numPoints) { - TkGetButtPoints(coordPtr+2, coordPtr, (double) linePtr->width, + TkGetButtPoints(coordPtr+2, coordPtr, width, linePtr->capStyle == CapProjecting, poly, poly+2); } else if ((linePtr->joinStyle == JoinMiter) && !changedMiterToBevel) { poly[0] = poly[6]; @@ -891,7 +897,7 @@ LineToPoint(canvas, itemPtr, pointPtr) poly[2] = poly[4]; poly[3] = poly[5]; } else { - TkGetButtPoints(coordPtr+2, coordPtr, (double) linePtr->width, 0, + TkGetButtPoints(coordPtr+2, coordPtr, width, 0, poly, poly+2); /* @@ -915,17 +921,17 @@ LineToPoint(canvas, itemPtr, pointPtr) } } if (count == 2) { - TkGetButtPoints(coordPtr, coordPtr+2, (double) linePtr->width, + TkGetButtPoints(coordPtr, coordPtr+2, width, linePtr->capStyle == CapProjecting, poly+4, poly+6); } else if (linePtr->joinStyle == JoinMiter) { if (TkGetMiterPoints(coordPtr, coordPtr+2, coordPtr+4, - (double) linePtr->width, poly+4, poly+6) == 0) { + width, poly+4, poly+6) == 0) { changedMiterToBevel = 1; - TkGetButtPoints(coordPtr, coordPtr+2, (double) linePtr->width, + TkGetButtPoints(coordPtr, coordPtr+2, width, 0, poly+4, poly+6); } } else { - TkGetButtPoints(coordPtr, coordPtr+2, (double) linePtr->width, 0, + TkGetButtPoints(coordPtr, coordPtr+2, width, 0, poly+4, poly+6); } poly[8] = poly[0]; @@ -946,7 +952,7 @@ LineToPoint(canvas, itemPtr, pointPtr) if (linePtr->capStyle == CapRound) { dist = hypot(coordPtr[0] - pointPtr[0], coordPtr[1] - pointPtr[1]) - - linePtr->width/2.0; + - width/2.0; if (dist <= 0.0) { bestDist = 0.0; goto done; @@ -1019,6 +1025,7 @@ LineToArea(canvas, itemPtr, rectPtr) LineItem *linePtr = (LineItem *) itemPtr; double staticSpace[2*MAX_STATIC_POINTS]; double *linePoints; + double width; int numPoints, result; /* @@ -1046,8 +1053,13 @@ LineToArea(canvas, itemPtr, rectPtr) * Check the segments of the line. */ + width = (double) linePtr->width; + if (width < 1.0) { + width = 1.0; + } + result = TkThickPolyLineToArea(linePoints, numPoints, - (double) linePtr->width, linePtr->capStyle, linePtr->joinStyle, + width, linePtr->capStyle, linePtr->joinStyle, rectPtr); if (result == 0) { goto done; diff --git a/generic/tkConsole.c b/generic/tkConsole.c index f4fd75e..3af6768 100644 --- a/generic/tkConsole.c +++ b/generic/tkConsole.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkConsole.c,v 1.1.4.3 1998/12/13 08:16:03 lfb Exp $ + * RCS: @(#) $Id: tkConsole.c,v 1.1.4.4 1999/02/11 04:13:45 stanton Exp $ */ #include "tk.h" @@ -415,12 +415,14 @@ ConsoleCmd(clientData, interp, argc, argv) Tcl_Eval(consoleInterp, Tcl_DStringValue(&dString)); Tcl_DStringFree(&dString); } else if ((c == 'h') && (strncmp(argv[1], "hide", length)) == 0) { - Tcl_Eval(info->consoleInterp, "wm withdraw ."); + Tcl_Eval(consoleInterp, "wm withdraw ."); } else if ((c == 's') && (strncmp(argv[1], "show", length)) == 0) { - Tcl_Eval(info->consoleInterp, "wm deiconify ."); + Tcl_Eval(consoleInterp, "wm deiconify ."); } else if ((c == 'e') && (strncmp(argv[1], "eval", length)) == 0) { if (argc == 3) { - Tcl_Eval(info->consoleInterp, argv[2]); + result = Tcl_Eval(consoleInterp, argv[2]); + Tcl_AppendResult(interp, Tcl_GetStringResult(consoleInterp), + (char *) NULL); } else { Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0], " eval command\"", (char *) NULL); @@ -482,6 +484,7 @@ InterpreterCmd(clientData, interp, argc, argv) } else if ((c == 'r') && (strncmp(argv[1], "record", length)) == 0) { Tcl_RecordAndEval(otherInterp, argv[2], TCL_EVAL_GLOBAL); result = TCL_OK; + Tcl_ResetResult(interp); Tcl_AppendResult(interp, otherInterp->result, (char *) NULL); } else { Tcl_AppendResult(interp, "bad option \"", argv[1], diff --git a/generic/tkFocus.c b/generic/tkFocus.c index 10bfa27..8e4156a 100644 --- a/generic/tkFocus.c +++ b/generic/tkFocus.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkFocus.c,v 1.1.4.3 1998/12/13 08:16:04 lfb Exp $ + * RCS: @(#) $Id: tkFocus.c,v 1.1.4.4 1999/02/11 04:13:45 stanton Exp $ */ #include "tkInt.h" @@ -559,7 +559,14 @@ SetFocus(winPtr, force) int allMapped, serial; displayFocusPtr = FindDisplayFocusInfo(winPtr->mainPtr, winPtr->dispPtr); - if (winPtr == displayFocusPtr->focusWinPtr) { + + /* + * If force is set, we should make sure we grab the focus regardless + * of the current focus window since under Windows, we may need to + * take control away from another application. + */ + + if (winPtr == displayFocusPtr->focusWinPtr && !force) { return; } diff --git a/generic/tkImgBmap.c b/generic/tkImgBmap.c index 5dde227..8acffc3 100644 --- a/generic/tkImgBmap.c +++ b/generic/tkImgBmap.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkImgBmap.c,v 1.1.4.2 1998/09/30 02:17:02 stanton Exp $ + * RCS: @(#) $Id: tkImgBmap.c,v 1.1.4.3 1999/02/11 04:13:46 stanton Exp $ */ #include "tkInt.h" @@ -342,6 +342,7 @@ ImgBmapConfigureInstance(instancePtr) XGCValues gcValues; GC gc; unsigned int mask; + Pixmap oldMask; /* * For each of the options in masterPtr, translate the string @@ -384,10 +385,14 @@ ImgBmapConfigureInstance(instancePtr) (unsigned) masterPtr->height); } - if (instancePtr->mask != None) { - Tk_FreePixmap(Tk_Display(instancePtr->tkwin), instancePtr->mask); - instancePtr->mask = None; - } + /* + * Careful: We have to allocate a new mask Pixmap before deleting + * the old one. Otherwise, The XID allocator will always return + * the same XID for the new Pixmap as was used for the old Pixmap. + * And that will prevent the mask from changing in the GC below. + */ + oldMask = instancePtr->mask; + instancePtr->mask = None; if (masterPtr->maskData != NULL) { instancePtr->mask = XCreateBitmapFromData( Tk_Display(instancePtr->tkwin), @@ -395,6 +400,9 @@ ImgBmapConfigureInstance(instancePtr) masterPtr->maskData, (unsigned) masterPtr->width, (unsigned) masterPtr->height); } + if (oldMask != None) { + Tk_FreePixmap(Tk_Display(instancePtr->tkwin), oldMask); + } if (masterPtr->data != NULL) { gcValues.foreground = instancePtr->fg->pixel; diff --git a/generic/tkImgPhoto.c b/generic/tkImgPhoto.c index 701698b..a07595c 100644 --- a/generic/tkImgPhoto.c +++ b/generic/tkImgPhoto.c @@ -15,7 +15,7 @@ * Department of Computer Science, * Australian National University. * - * RCS: @(#) $Id: tkImgPhoto.c,v 1.1.4.3 1998/12/13 08:16:07 lfb Exp $ + * RCS: @(#) $Id: tkImgPhoto.c,v 1.1.4.4 1999/02/11 04:13:46 stanton Exp $ */ #include "tkInt.h" @@ -361,7 +361,8 @@ static int IsValidPalette _ANSI_ARGS_((PhotoInstance *instancePtr, char *palette)); static int CountBits _ANSI_ARGS_((pixel mask)); static void GetColorTable _ANSI_ARGS_((PhotoInstance *instancePtr)); -static void FreeColorTable _ANSI_ARGS_((ColorTable *colorPtr)); +static void FreeColorTable _ANSI_ARGS_((ColorTable *colorPtr, + int force)); static void AllocateColors _ANSI_ARGS_((ColorTable *colorPtr)); static void DisposeColorTable _ANSI_ARGS_((ClientData clientData)); static void DisposeInstance _ANSI_ARGS_((ClientData clientData)); @@ -1491,7 +1492,7 @@ ImgPhotoConfigureInstance(instancePtr) if (colorTablePtr != NULL) { colorTablePtr->liveRefCount -= 1; - FreeColorTable(colorTablePtr); + FreeColorTable(colorTablePtr, 0); } GetColorTable(instancePtr); @@ -1651,7 +1652,7 @@ ImgPhotoGet(tkwin, masterData) Tcl_CancelIdleCall(DisposeInstance, (ClientData) instancePtr); if (instancePtr->colorTablePtr != NULL) { - FreeColorTable(instancePtr->colorTablePtr); + FreeColorTable(instancePtr->colorTablePtr, 0); } GetColorTable(instancePtr); } @@ -2489,15 +2490,22 @@ GetColorTable(instancePtr) */ static void -FreeColorTable(colorPtr) +FreeColorTable(colorPtr, force) ColorTable *colorPtr; /* Pointer to the color table which is * no longer required by an instance. */ + int force; /* Force free to happen immediately. */ { colorPtr->refCount--; if (colorPtr->refCount > 0) { return; } - if ((colorPtr->flags & DISPOSE_PENDING) == 0) { + if (force) { + if ((colorPtr->flags & DISPOSE_PENDING) != 0) { + Tcl_CancelIdleCall(DisposeColorTable, (ClientData) colorPtr); + colorPtr->flags &= ~DISPOSE_PENDING; + } + DisposeColorTable((ClientData) colorPtr); + } else if ((colorPtr->flags & DISPOSE_PENDING) == 0) { Tcl_DoWhenIdle(DisposeColorTable, (ClientData) colorPtr); colorPtr->flags |= DISPOSE_PENDING; } @@ -2963,7 +2971,7 @@ DisposeInstance(clientData) ckfree((char *) instancePtr->error); } if (instancePtr->colorTablePtr != NULL) { - FreeColorTable(instancePtr->colorTablePtr); + FreeColorTable(instancePtr->colorTablePtr, 1); } if (instancePtr->masterPtr->instancePtr == instancePtr) { diff --git a/generic/tkMenu.c b/generic/tkMenu.c index e02b44d..4100620 100644 --- a/generic/tkMenu.c +++ b/generic/tkMenu.c @@ -12,7 +12,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkMenu.c,v 1.1.4.5 1998/12/04 07:21:20 welch Exp $ + * RCS: @(#) $Id: tkMenu.c,v 1.1.4.6 1999/02/11 04:13:46 stanton Exp $ */ /* @@ -1056,7 +1056,6 @@ TkInvokeMenu(interp, menuPtr, index) } else if ((mePtr->type == CHECK_BUTTON_ENTRY) && (mePtr->namePtr != NULL)) { Tcl_Obj *valuePtr; - char *name; if (mePtr->entryFlags & ENTRY_SELECTED) { valuePtr = mePtr->offValuePtr; @@ -1067,8 +1066,7 @@ TkInvokeMenu(interp, menuPtr, index) valuePtr = Tcl_NewObj(); } Tcl_IncrRefCount(valuePtr); - name = Tcl_GetStringFromObj(mePtr->namePtr, NULL); - if (Tcl_SetObjVar2(interp, name, NULL, valuePtr, + if (Tcl_ObjSetVar2(interp, mePtr->namePtr, NULL, valuePtr, TCL_GLOBAL_ONLY|TCL_LEAVE_ERR_MSG) == NULL) { result = TCL_ERROR; } @@ -1076,13 +1074,12 @@ TkInvokeMenu(interp, menuPtr, index) } else if ((mePtr->type == RADIO_BUTTON_ENTRY) && (mePtr->namePtr != NULL)) { Tcl_Obj *valuePtr = mePtr->onValuePtr; - char *name = Tcl_GetStringFromObj(mePtr->namePtr, NULL); - + if (valuePtr == NULL) { valuePtr = Tcl_NewObj(); } Tcl_IncrRefCount(valuePtr); - if (Tcl_SetObjVar2(interp, name, NULL, valuePtr, + if (Tcl_ObjSetVar2(interp, mePtr->namePtr, NULL, valuePtr, TCL_GLOBAL_ONLY|TCL_LEAVE_ERR_MSG) == NULL) { result = TCL_ERROR; } @@ -1092,7 +1089,7 @@ TkInvokeMenu(interp, menuPtr, index) Tcl_Obj *commandPtr = mePtr->commandPtr; Tcl_IncrRefCount(commandPtr); - result = Tcl_EvalObj(interp, commandPtr, TCL_EVAL_GLOBAL); + result = Tcl_EvalObjEx(interp, commandPtr, TCL_EVAL_GLOBAL); Tcl_DecrRefCount(commandPtr); } Tcl_Release((ClientData) mePtr); @@ -1778,8 +1775,7 @@ PostProcessEntry(mePtr) */ if (mePtr->namePtr != NULL) { - char *name = Tcl_GetStringFromObj(mePtr->namePtr, NULL); - valuePtr = Tcl_GetObjVar2(menuPtr->interp, name, NULL, + valuePtr = Tcl_ObjGetVar2(menuPtr->interp, mePtr->namePtr, NULL, TCL_GLOBAL_ONLY); } else { valuePtr = NULL; @@ -1798,8 +1794,7 @@ PostProcessEntry(mePtr) } } else { if (mePtr->namePtr != NULL) { - char *name = Tcl_GetStringFromObj(mePtr->namePtr, NULL); - Tcl_SetObjVar2(menuPtr->interp, name, NULL, + Tcl_ObjSetVar2(menuPtr->interp, mePtr->namePtr, NULL, (mePtr->type == CHECK_BUTTON_ENTRY) ? mePtr->offValuePtr : Tcl_NewObj(), @@ -2564,7 +2559,7 @@ TkPostCommand(menuPtr) Tcl_Obj *postCommandPtr = menuPtr->postCommandPtr; Tcl_IncrRefCount(postCommandPtr); - result = Tcl_EvalObj(menuPtr->interp, postCommandPtr, + result = Tcl_EvalObjEx(menuPtr->interp, postCommandPtr, TCL_EVAL_GLOBAL); Tcl_DecrRefCount(postCommandPtr); if (result != TCL_OK) { diff --git a/generic/tkTest.c b/generic/tkTest.c index 09acfe9..e1cf611 100644 --- a/generic/tkTest.c +++ b/generic/tkTest.c @@ -8,11 +8,12 @@ * * Copyright (c) 1993-1994 The Regents of the University of California. * Copyright (c) 1994-1997 Sun Microsystems, Inc. + * Copyright (c) 1998-1999 by Scriptics Corporation. * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkTest.c,v 1.1.4.2 1998/09/30 02:17:20 stanton Exp $ + * RCS: @(#) $Id: tkTest.c,v 1.1.4.3 1999/02/11 04:13:47 stanton Exp $ */ #include "tkInt.h" @@ -201,7 +202,7 @@ static void TrivialEventProc _ANSI_ARGS_((ClientData clientData, * External (platform specific) initialization routine: */ -EXTERN int TkplatformtestInit _ANSI_ARGS_(( +extern int TkplatformtestInit _ANSI_ARGS_(( Tcl_Interp *interp)); #if !(defined(__WIN32__) || defined(MAC_TCL)) #define TkplatformtestInit(x) TCL_OK diff --git a/generic/tkText.c b/generic/tkText.c index a5e4b59..4baa957 100644 --- a/generic/tkText.c +++ b/generic/tkText.c @@ -13,7 +13,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkText.c,v 1.1.4.3 1999/01/07 02:42:51 lfb Exp $ + * RCS: @(#) $Id: tkText.c,v 1.1.4.4 1999/02/11 04:13:47 stanton Exp $ */ #include "default.h" @@ -138,9 +138,7 @@ static Tk_ConfigSpec configSpecs[] = { */ Tk_Uid tkTextCharUid = NULL; -Tk_Uid tkTextDisabledUid = NULL; Tk_Uid tkTextNoneUid = NULL; -Tk_Uid tkTextNormalUid = NULL; Tk_Uid tkTextWordUid = NULL; /* @@ -235,11 +233,9 @@ Tk_TextCmd(clientData, interp, argc, argv) * Perform once-only initialization: */ - if (tkTextNormalUid == NULL) { + if (tkTextCharUid == NULL) { tkTextCharUid = Tk_GetUid("char"); - tkTextDisabledUid = Tk_GetUid("disabled"); tkTextNoneUid = Tk_GetUid("none"); - tkTextNormalUid = Tk_GetUid("normal"); tkTextWordUid = Tk_GetUid("word"); } @@ -265,7 +261,7 @@ Tk_TextCmd(clientData, interp, argc, argv) Tcl_InitHashTable(&textPtr->markTable, TCL_STRING_KEYS); Tcl_InitHashTable(&textPtr->windowTable, TCL_STRING_KEYS); Tcl_InitHashTable(&textPtr->imageTable, TCL_STRING_KEYS); - textPtr->state = tkTextNormalUid; + textPtr->state = TK_STATE_NORMAL; textPtr->border = NULL; textPtr->borderWidth = 0; textPtr->padX = 0; @@ -501,7 +497,7 @@ TextWidgetCmd(clientData, interp, argc, argv) result = TCL_ERROR; goto done; } - if (textPtr->state == tkTextNormalUid) { + if (textPtr->state == TK_STATE_NORMAL) { result = DeleteChars(textPtr, argv[2], (argc == 4) ? argv[3] : (char *) NULL); } @@ -609,7 +605,7 @@ TextWidgetCmd(clientData, interp, argc, argv) result = TCL_ERROR; goto done; } - if (textPtr->state == tkTextNormalUid) { + if (textPtr->state == TK_STATE_NORMAL) { for (j = 3; j < argc; j += 2) { InsertChars(textPtr, &index1, argv[j]); if (argc > (j+1)) { @@ -785,11 +781,11 @@ ConfigureText(interp, textPtr, argc, argv, flags) * the geometry and setting the background from a 3-D border. */ - if ((textPtr->state != tkTextNormalUid) - && (textPtr->state != tkTextDisabledUid)) { + if ((textPtr->state != TK_STATE_NORMAL) + && (textPtr->state != TK_STATE_DISABLED)) { Tcl_AppendResult(interp, "bad state value \"", textPtr->state, "\": must be normal or disabled", (char *) NULL); - textPtr->state = tkTextNormalUid; + textPtr->state = TK_STATE_NORMAL; return TCL_ERROR; } diff --git a/generic/tkText.h b/generic/tkText.h index 983304f..8e2b12f 100644 --- a/generic/tkText.h +++ b/generic/tkText.h @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkText.h,v 1.1.4.2 1998/09/30 02:17:21 stanton Exp $ + * RCS: @(#) $Id: tkText.h,v 1.1.4.3 1999/02/11 04:13:47 stanton Exp $ */ #ifndef _TKTEXT @@ -470,8 +470,7 @@ typedef struct TkText { * image segment doesn't yet have an * associated image, there is no entry for * it here. */ - Tk_Uid state; /* Normal or disabled. Text is read-only - * when disabled. */ + int state; /* One of the TK_STATE_* values. */ /* * Default information for displaying (may be overridden by tags diff --git a/library/menu.tcl b/library/menu.tcl index 5711825..7d91583 100644 --- a/library/menu.tcl +++ b/library/menu.tcl @@ -4,10 +4,11 @@ # It also implements keyboard traversal of menus and implements a few # other utility procedures related to menus. # -# RCS: @(#) $Id: menu.tcl,v 1.1.4.2 1998/09/30 02:17:33 stanton Exp $ +# RCS: @(#) $Id: menu.tcl,v 1.1.4.3 1999/02/11 04:13:48 stanton Exp $ # # Copyright (c) 1992-1994 The Regents of the University of California. # Copyright (c) 1994-1997 Sun Microsystems, Inc. +# Copyright (c) 1998-1999 by Scriptics Corporation. # # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. @@ -885,6 +886,10 @@ proc tkMenuFind {w char} { set windowlist [winfo child $w] foreach child $windowlist { + # Don't descend into other toplevels. + if {[winfo toplevel [focus]] != [winfo toplevel $child] } { + continue + } switch [winfo class $child] { Menu { if {[$child cget -type] == "menubar"} { @@ -911,6 +916,10 @@ proc tkMenuFind {w char} { } foreach child $windowlist { + # Don't descend into other toplevels. + if {[winfo toplevel [focus]] != [winfo toplevel $child] } { + continue + } switch [winfo class $child] { Menubutton { set char2 [string index [$child cget -text] \ diff --git a/library/prolog.ps b/library/prolog.ps index 527cb08..37a5c26 100644 --- a/library/prolog.ps +++ b/library/prolog.ps @@ -3,7 +3,7 @@ % This is a standard prolog for Postscript generated by Tk's canvas % widget. -% RCS: @(#) $Id: prolog.ps,v 1.1.4.1 1998/09/30 02:17:35 stanton Exp $ +% RCS: @(#) $Id: prolog.ps,v 1.1.4.2 1999/02/11 04:13:48 stanton Exp $ % The definitions below just define all of the variables used in % any of the procedures here. This is needed for obscure reasons @@ -230,7 +230,7 @@ systemdict /ISOLatin1Encoding known not { % Compute the baseline offset and the actual font height. - 0 0 moveto (TXygqPZ) false charpath + 0 0 moveto (TXygqPZÄ) false charpath pathbbox dup /baseline exch def exch pop exch sub /height exch def pop newpath diff --git a/mac/tkMacAppInit.c b/mac/tkMacAppInit.c index 49fc109..eea97a9 100644 --- a/mac/tkMacAppInit.c +++ b/mac/tkMacAppInit.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkMacAppInit.c,v 1.1.4.3 1998/11/25 21:16:35 stanton Exp $ + * RCS: @(#) $Id: tkMacAppInit.c,v 1.1.4.4 1999/02/11 04:13:48 stanton Exp $ */ #include <Gestalt.h> @@ -26,14 +26,14 @@ #include "tclMac.h" #ifdef TK_TEST -EXTERN int Tktest_Init _ANSI_ARGS_((Tcl_Interp *interp)); +extern int Tktest_Init _ANSI_ARGS_((Tcl_Interp *interp)); #endif /* TK_TEST */ #ifdef TCL_TEST -EXTERN int Procbodytest_Init _ANSI_ARGS_((Tcl_Interp *interp)); -EXTERN int Procbodytest_SafeInit _ANSI_ARGS_((Tcl_Interp *interp)); -EXTERN int TclObjTest_Init _ANSI_ARGS_((Tcl_Interp *interp)); -EXTERN int Tcltest_Init _ANSI_ARGS_((Tcl_Interp *interp)); +extern int Procbodytest_Init _ANSI_ARGS_((Tcl_Interp *interp)); +extern int Procbodytest_SafeInit _ANSI_ARGS_((Tcl_Interp *interp)); +extern int TclObjTest_Init _ANSI_ARGS_((Tcl_Interp *interp)); +extern int Tcltest_Init _ANSI_ARGS_((Tcl_Interp *interp)); #endif /* TCL_TEST */ Tcl_Interp *gStdoutInterp = NULL; diff --git a/tests/main.test b/tests/main.test index eb7ac69..ab21e77 100644 --- a/tests/main.test +++ b/tests/main.test @@ -9,7 +9,7 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: main.test,v 1.1.4.2 1999/01/29 00:34:35 stanton Exp $ +# RCS: @(#) $Id: main.test,v 1.1.4.3 1999/02/11 04:13:49 stanton Exp $ if {[info procs test] != "test"} { source defs @@ -30,3 +30,8 @@ test main-1.1 {StdinProc} {unixOnly} { file delete -force script list $error $msg } {0 {}} + +# +# Clean up. +# +catch {removeFile script} diff --git a/tests/unixWm.test b/tests/unixWm.test index 05ca835..ca8bcd8 100644 --- a/tests/unixWm.test +++ b/tests/unixWm.test @@ -8,7 +8,7 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: unixWm.test,v 1.1.4.2 1998/09/30 02:19:03 stanton Exp $ +# RCS: @(#) $Id: unixWm.test,v 1.1.4.3 1999/02/11 04:13:49 stanton Exp $ if {$tcl_platform(platform) != "unix"} { return @@ -2386,4 +2386,5 @@ test unixWm-58.3 {exit processing} { catch {destroy .t} +catch {removeFile script} concat {} diff --git a/unix/README b/unix/README index 446ac10..1789386 100644 --- a/unix/README +++ b/unix/README @@ -10,7 +10,7 @@ SGI, as well as PCs running Linux, BSDI, and SCO UNIX. To compile for a PC running Windows, see the README file in the directory ../win. To compile for a Macintosh, see the README file in the directory ../mac. -RCS: @(#) $Id: README,v 1.1.4.2 1998/09/30 02:19:10 stanton Exp $ +RCS: @(#) $Id: README,v 1.1.4.3 1999/02/11 04:13:49 stanton Exp $ How To Compile And Install Tk: ------------------------------ @@ -82,19 +82,11 @@ How To Compile And Install Tk: versions, either specify the version number or create a symbolic link (e.g. from "wish" to "wish8.1"). -If you have trouble compiling Tk, read through the file "porting.notes". -It contains information that people have provided about changes they had -to make to compile Tcl in various environments. Or, check out the -following Web URL: - http://www.sunlabs.com/cgi-bin/tcl/info.8.1 -This is an on-line database of porting information. We make no guarantees -that this information is accurate, complete, or up-to-date, but you may -find it useful. If you get Tk running on a new configuration and had to -make non-trivial changes to do it, we'd be happy to receive new information -to add to "porting.notes". You can also make a new entry into the -on-line Web database. We're also interested in hearing how to change the -configuration setup so that Tcl compiles on additional platforms "out of -the box". +If you have trouble compiling Tk, read through the file +"porting.notes". It contains information that people have provided +about changes they had to make to compile Tcl in various environments. +We're also interested in hearing how to change the configuration setup +so that Tcl compiles on additional platforms "out of the box". Test suite ---------- diff --git a/unix/configure.in b/unix/configure.in index cce9f36..71ee237 100644 --- a/unix/configure.in +++ b/unix/configure.in @@ -2,7 +2,7 @@ dnl This file is an input file used by the GNU "autoconf" program to dnl generate the file "configure", which is run during Tk installation dnl to configure the system for the local environment. AC_INIT(../generic/tk.h) -# RCS: @(#) $Id: configure.in,v 1.1.4.7 1998/12/13 08:14:38 lfb Exp $ +# RCS: @(#) $Id: configure.in,v 1.1.4.8 1999/02/11 04:13:49 stanton Exp $ TK_VERSION=8.1 TK_MAJOR_VERSION=8 @@ -63,6 +63,23 @@ else CFLAGS_WARNING="" fi +#------------------------------------------------------------------------------ +# If we're using GCC, see if the compiler understands -pipe. If so, use it. +# It makes compiling go faster. (This is only a performance feature.) +#------------------------------------------------------------------------------ + +if test -z "$no_pipe"; then +if test -n "$GCC"; then + AC_MSG_CHECKING([if the compiler understands -pipe]) + OLDCC="$CC" + CC="$CC -pipe" + AC_TRY_COMPILE(,, + AC_MSG_RESULT(yes), + CC="$OLDCC" + AC_MSG_RESULT(no)) +fi +fi + #-------------------------------------------------------------------- # See if there was a command-line option for where Tcl is; if # not, assume that its top-level directory is a sibling of ours. @@ -280,7 +297,18 @@ fi # variable LIB_RUNTIME_DIR. eval "TK_CC_SEARCH_FLAGS=\"$TCL_LD_SEARCH_FLAGS\"" -TK_LD_SEARCH_FLAGS=`echo ${TK_CC_SEARCH_FLAGS} |sed -e "s|-Wl,||g" -e "s|,| |g"` + +# The following case handles the differences between linking with "ld" +# and the compiler + +case $SHLIB_LD in + *ld*) + TK_LD_SEARCH_FLAGS=`echo ${TK_CC_SEARCH_FLAGS} |sed -e "s|-Wl,||g" -e "s|,| |g"` + ;; + *) + TK_LD_SEARCH_FLAGS="${TK_CC_SEARCH_FLAGS}" + ;; +esac #-------------------------------------------------------------------- # Check for the existence of various libraries. The order here diff --git a/unix/tkAppInit.c b/unix/tkAppInit.c index 0616268..2104579 100644 --- a/unix/tkAppInit.c +++ b/unix/tkAppInit.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkAppInit.c,v 1.1.4.2 1998/09/30 02:19:12 stanton Exp $ + * RCS: @(#) $Id: tkAppInit.c,v 1.1.4.3 1999/02/11 04:13:50 stanton Exp $ */ #include "tk.h" @@ -25,8 +25,8 @@ extern int matherr(); int *tclDummyMathPtr = (int *) matherr; #ifdef TK_TEST -EXTERN int Tcltest_Init _ANSI_ARGS_((Tcl_Interp *interp)); -EXTERN int Tktest_Init _ANSI_ARGS_((Tcl_Interp *interp)); +extern int Tcltest_Init _ANSI_ARGS_((Tcl_Interp *interp)); +extern int Tktest_Init _ANSI_ARGS_((Tcl_Interp *interp)); #endif /* TK_TEST */ /* diff --git a/unix/tkUnixSend.c b/unix/tkUnixSend.c index d189fe4..3d13a3b 100644 --- a/unix/tkUnixSend.c +++ b/unix/tkUnixSend.c @@ -7,11 +7,12 @@ * * Copyright (c) 1989-1994 The Regents of the University of California. * Copyright (c) 1994-1996 Sun Microsystems, Inc. + * Copyright (c) 1998-1999 by Scriptics Corporation. * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkUnixSend.c,v 1.1.4.3 1998/12/13 08:14:40 lfb Exp $ + * RCS: @(#) $Id: tkUnixSend.c,v 1.1.4.4 1999/02/11 04:13:50 stanton Exp $ */ #include "tkPort.h" @@ -257,7 +258,7 @@ static int ValidateName _ANSI_ARGS_((TkDisplay *dispPtr, * If "lock" is set then the server will be locked. It is the * caller's responsibility to call RegClose when finished with * the registry, so that we can write back the registry if - * neeeded, unlock the server if needed, and free memory. + * needed, unlock the server if needed, and free memory. * *---------------------------------------------------------------------- */ @@ -781,6 +782,7 @@ Tk_SetAppName(tkwin, name) riPtr->dispPtr = winPtr->dispPtr; riPtr->nextPtr = tsdPtr->interpListPtr; tsdPtr->interpListPtr = riPtr; + riPtr->name = NULL; Tcl_CreateCommand(interp, "send", Tk_SendCmd, (ClientData) riPtr, DeleteProc); if (Tcl_IsSafe(interp)) { @@ -794,8 +796,10 @@ Tk_SetAppName(tkwin, name) * the name registry. */ - RegDeleteName(regPtr, riPtr->name); - ckfree(riPtr->name); + if (riPtr->name) { + RegDeleteName(regPtr, riPtr->name); + ckfree(riPtr->name); + } break; } } diff --git a/win/makefile.vc b/win/makefile.vc index e59953b..dc55ffa 100644 --- a/win/makefile.vc +++ b/win/makefile.vc @@ -4,7 +4,7 @@ # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # # Copyright (c) 1995-1997 Sun Microsystems, Inc. -# RCS: @(#) $Id: makefile.vc,v 1.1.4.6 1998/12/11 01:31:04 stanton Exp $ +# RCS: @(#) $Id: makefile.vc,v 1.1.4.7 1999/02/11 04:13:50 stanton Exp $ # Does not depend on the presence of any environment variables in # order to compile tcl; all needed information is derived from @@ -26,8 +26,8 @@ # ROOT = .. -TOOLS32 = c:\progra~1\devstudio\vc -TOOLS32_rc = c:\progra~1\devstudio\sharedide +TOOLS32 = c:\program files\devstudio\vc +TOOLS32_rc = c:\program files\devstudio\sharedide TCLDIR = ..\..\tcl8.1b1 # Set this to the appropriate value of /MACHINE: for your platform @@ -47,6 +47,7 @@ TCLNAMEPREFIX = tcl TKNAMEPREFIX = tk WISHNAMEPREFIX = wish VERSION = 81 +DOTVERSION = 8.1 BINROOT = . !IF "$(NODEBUG)" == "1" @@ -74,6 +75,11 @@ WISHP = $(OUTDIR)\$(WISHNAMEPREFIX)p$(VERSION)$(DBGX).exe TKTEST = $(OUTDIR)\$(TKNAMEPREFIX)test.exe DUMPEXTS = $(TMPDIR)\dumpexts.exe +BIN_INSTALL_DIR = $(INSTALLDIR)\bin +INCLUDE_INSTALL_DIR = $(INSTALLDIR)\include +LIB_INSTALL_DIR = $(INSTALLDIR)\lib +SCRIPT_INSTALL_DIR = $(LIB_INSTALL_DIR)\tk$(DOTVERSION) + WISHOBJS = \ $(TMPDIR)\winMain.obj @@ -188,10 +194,10 @@ TKOBJS = \ $(TMPDIR)\tkVisual.obj \ $(TMPDIR)\tkWindow.obj -cc32 = $(TOOLS32)\bin\cl.exe -link32 = $(TOOLS32)\bin\link.exe -rc32 = $(TOOLS32_rc)\bin\rc.exe -include32 = -I$(TOOLS32)\include +cc32 = "$(TOOLS32)\bin\cl.exe" +link32 = "$(TOOLS32)\bin\link.exe" +rc32 = "$(TOOLS32_rc)\bin\rc.exe" +include32 = -I"$(TOOLS32)\include" WINDIR = $(ROOT)\win GENERICDIR = $(ROOT)\generic @@ -223,7 +229,7 @@ lcommon = /NODEFAULTLIB /RELEASE /NOLOGO # declarations for use on Intel i386, i486, and Pentium systems !IF "$(MACHINE)" == "IX86" DLLENTRY = @12 -lflags = $(lcommon) -align:0x1000 /MACHINE:$(MACHINE) +lflags = $(lcommon) /MACHINE:$(MACHINE) !ELSE lflags = $(lcommon) /MACHINE:$(MACHINE) !ENDIF @@ -251,12 +257,7 @@ guilibsdll = $(libcdll) $(winlibs) ###################################################################### !IF "$(NODEBUG)" == "1" -!IF "$(MACHINE)" == "ALPHA" -# MSVC on Alpha doesn't understand -Ot -cdebug = -O2i -Gs -GD -!ELSE -cdebug = -Oti -Gs -GD -!ENDIF +cdebug = -O2 -Gs -GD !ELSE cdebug = -Z7 -Od -WX !ENDIF @@ -297,14 +298,36 @@ CON_CFLAGS = $(cdebug) $(cflags) $(cvars) $(include32) -DCONSOLE ###################################################################### all: setup $(WISH) -plugin: setup $(TKPLUGINDLL) $(WISHP) - test: setup $(TKTEST) +install: install-binaries install-libraries +plugin: setup $(TKPLUGINDLL) $(WISHP) +tktest: setup $(TKTEST) setup: @mkd $(TMPDIR) @mkd $(OUTDIR) +install-binaries: + @mkd "$(BIN_INSTALL_DIR)" + copy $(TKDLL) "$(BIN_INSTALL_DIR)" + copy $(WISH) "$(BIN_INSTALL_DIR)" + @mkd "$(LIB_INSTALL_DIR)" + copy $(TKLIB) "$(LIB_INSTALL_DIR)" + +install-libraries: + @mkd "$(INCLUDE_INSTALL_DIR)" + @mkd "$(INCLUDE_INSTALL_DIR)\X11" + copy "$(ROOT)\generic\tk.h" "$(INCLUDE_INSTALL_DIR)" + xcopy "$(ROOT)\xlib\X11\*.h" "$(INCLUDE_INSTALL_DIR)\X11" + @mkd "$(SCRIPT_INSTALL_DIR)" + @mkd "$(SCRIPT_INSTALL_DIR)\images" + @mkd "$(SCRIPT_INSTALL_DIR)\demos" + @mkd "$(SCRIPT_INSTALL_DIR)\demos\images" + xcopy "$(ROOT)\library" "$(SCRIPT_INSTALL_DIR)" + xcopy "$(ROOT)\library\images" "$(SCRIPT_INSTALL_DIR)\images" + xcopy "$(ROOT)\library\demos" "$(SCRIPT_INSTALL_DIR)\demos" + xcopy "$(ROOT)\library\demos\images" "$(SCRIPT_INSTALL_DIR)\demos\images" + $(TKLIB): $(TKDLL) $(TKDLL): $(TKOBJS) $(TMPDIR)\tk.res $(TMPDIR)\tk.def @@ -362,16 +385,16 @@ $(DUMPEXTS): $(TCLDIR)\win\winDumpExts.c # $(TMPDIR)\testMain.obj: $(ROOT)\win\winMain.c - $(cc32) $(TK_CFLAGS) -DSTATIC_BUILD -DTK_TEST -Fo$@ $? + $(cc32) $(TK_CFLAGS) -DTK_TEST -Fo$@ $? $(TMPDIR)\tkTest.obj: $(ROOT)\generic\tkTest.c - $(cc32) $(TK_CFLAGS) -DSTATIC_BUILD -Fo$@ $? + $(cc32) $(TK_CFLAGS) -Fo$@ $? $(TMPDIR)\tkSquare.obj: $(ROOT)\generic\tkSquare.c $(cc32) $(TK_CFLAGS) -Fo$@ $? $(TMPDIR)\winMain.obj: $(ROOT)\win\winMain.c - $(cc32) $(TK_CFLAGS) -DSTATIC_BUILD -Fo$@ $? + $(cc32) $(TK_CFLAGS) -Fo$@ $? # # Implicit rules @@ -390,7 +413,7 @@ $(TMPDIR)\winMain.obj: $(ROOT)\win\winMain.c $(cc32) -DDLL_BUILD -DBUILD_tk $(TK_CFLAGS) -Fo$(TMPDIR)\ $< {$(RCDIR)}.rc{$(TMPDIR)}.res: - $(rc32) -fo $@ -r -i $(GENERICDIR) -i $(TOOLS32)\include $< + $(rc32) -fo $@ -r -i "$(GENERICDIR)" -i "$(TOOLS32)\include" $< clean: -@del $(OUTDIR)\*.exp diff --git a/win/tkWinFont.c b/win/tkWinFont.c index 4e9db07..2194689 100644 --- a/win/tkWinFont.c +++ b/win/tkWinFont.c @@ -4,13 +4,14 @@ * Contains the Windows implementation of the platform-independant * font package interface. * - * Copyright (c) 1995-1997 Sun Microsystems, Inc. * Copyright (c) 1994 Software Research Associates, Inc. + * Copyright (c) 1995-1997 Sun Microsystems, Inc. + * Copyright (c) 1998-1999 by Scriptics Corporation. * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkWinFont.c,v 1.1.4.3 1998/12/13 08:16:18 lfb Exp $ + * RCS: @(#) $Id: tkWinFont.c,v 1.1.4.4 1999/02/11 04:13:50 stanton Exp $ */ #include "tkWinInt.h" diff --git a/win/tkWinInt.h b/win/tkWinInt.h index 48e0828..7e9a3f7 100644 --- a/win/tkWinInt.h +++ b/win/tkWinInt.h @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkWinInt.h,v 1.1.4.2 1998/09/30 02:19:34 stanton Exp $ + * RCS: @(#) $Id: tkWinInt.h,v 1.1.4.3 1999/02/11 04:13:51 stanton Exp $ */ #ifndef _TKWININT @@ -151,6 +151,7 @@ extern int tkpWinRopModes[]; * Internal procedures used by more than one source file. */ +extern void TkWinCancelMouseTimer _ANSI_ARGS_((void)); extern LRESULT CALLBACK TkWinChildProc _ANSI_ARGS_((HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)); extern void TkWinClipboardRender _ANSI_ARGS_((TkDisplay *dispPtr, diff --git a/win/tkWinMenu.c b/win/tkWinMenu.c index 52845d7..9cdfe72 100644 --- a/win/tkWinMenu.c +++ b/win/tkWinMenu.c @@ -4,11 +4,12 @@ * This module implements the Windows platform-specific features of menus. * * Copyright (c) 1996-1998 by Sun Microsystems, Inc. + * Copyright (c) 1998-1999 by Scriptics Corporation. * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkWinMenu.c,v 1.1.4.8 1998/12/13 09:54:45 lfb Exp $ + * RCS: @(#) $Id: tkWinMenu.c,v 1.1.4.9 1999/02/11 04:13:51 stanton Exp $ */ #define OEMRESOURCE @@ -384,6 +385,10 @@ TkpDestroyMenu(menuPtr) DestroyMenu(winMenuHdl); } menuPtr->platformData = NULL; + + if (menuPtr == tsdPtr->modalMenuPtr) { + tsdPtr->modalMenuPtr = NULL; + } } /* diff --git a/win/tkWinPointer.c b/win/tkWinPointer.c index 7820084..982e69c 100644 --- a/win/tkWinPointer.c +++ b/win/tkWinPointer.c @@ -4,11 +4,12 @@ * Windows specific mouse tracking code. * * Copyright (c) 1995-1997 Sun Microsystems, Inc. + * Copyright (c) 1998-1999 by Scriptics Corporation. * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkWinPointer.c,v 1.1.4.1 1998/09/30 02:19:36 stanton Exp $ + * RCS: @(#) $Id: tkWinPointer.c,v 1.1.4.2 1999/02/11 04:13:51 stanton Exp $ */ #include "tkWinInt.h" @@ -241,6 +242,31 @@ MouseTimerProc(clientData) /* *---------------------------------------------------------------------- * + * TkWinCancelMouseTimer -- + * + * If the mouse timer is set, cancel it. + * + * Results: + * None. + * + * Side effects: + * May cancel the mouse timer. + * + *---------------------------------------------------------------------- + */ + +void +TkWinCancelMouseTimer() +{ + if (mouseTimerSet) { + Tcl_DeleteTimerHandler(mouseTimer); + mouseTimerSet = 0; + } +} + +/* + *---------------------------------------------------------------------- + * * TkGetPointerCoords -- * * Fetch the position of the mouse pointer. diff --git a/win/tkWinSend.c b/win/tkWinSend.c index f32dcdb..8d1a339 100644 --- a/win/tkWinSend.c +++ b/win/tkWinSend.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkWinSend.c,v 1.1.4.3 1998/12/13 08:16:19 lfb Exp $ + * RCS: @(#) $Id: tkWinSend.c,v 1.1.4.4 1999/02/11 04:13:52 stanton Exp $ */ #include "tkWinInt.h" @@ -339,11 +339,11 @@ Tk_SendObjCmd( */ if (objc == 1) { - result = Tcl_EvalObj(sendInterp, objv[0], TCL_EVAL_GLOBAL); + result = Tcl_EvalObjEx(sendInterp, objv[0], TCL_EVAL_GLOBAL); } else { objPtr = Tcl_ConcatObj(objc, objv); Tcl_IncrRefCount(objPtr); - result = Tcl_EvalObj(sendInterp, objPtr, TCL_EVAL_GLOBAL); + result = Tcl_EvalObjEx(sendInterp, objPtr, TCL_EVAL_GLOBAL); Tcl_DecrRefCount(objPtr); } if (interp != sendInterp) { @@ -354,12 +354,12 @@ Tk_SendObjCmd( */ Tcl_ResetResult(interp); - objPtr = Tcl_GetObjVar2(sendInterp, "errorInfo", NULL, + objPtr = Tcl_GetVar2Ex(sendInterp, "errorInfo", NULL, TCL_GLOBAL_ONLY); string = Tcl_GetStringFromObj(objPtr, &length); Tcl_AddObjErrorInfo(interp, string, length); - objPtr = Tcl_GetObjVar2(sendInterp, "errorCode", NULL, + objPtr = Tcl_GetVar2Ex(sendInterp, "errorCode", NULL, TCL_GLOBAL_ONLY); Tcl_SetObjErrorCode(interp, objPtr); } @@ -613,17 +613,17 @@ ExecuteRemoteObject( Tcl_Obj *returnPackagePtr; int result; - result = Tcl_EvalObj(riPtr->interp, ddeObjectPtr, TCL_EVAL_GLOBAL); + result = Tcl_EvalObjEx(riPtr->interp, ddeObjectPtr, TCL_EVAL_GLOBAL); returnPackagePtr = Tcl_NewListObj(0, (Tcl_Obj **) NULL); Tcl_ListObjAppendElement(NULL, returnPackagePtr, Tcl_NewIntObj(result)); Tcl_ListObjAppendElement(NULL, returnPackagePtr, Tcl_GetObjResult(riPtr->interp)); if (result == TCL_ERROR) { - errorObjPtr = Tcl_GetObjVar2(riPtr->interp, "errorCode", NULL, + errorObjPtr = Tcl_GetVar2Ex(riPtr->interp, "errorCode", NULL, TCL_GLOBAL_ONLY); Tcl_ListObjAppendElement(NULL, returnPackagePtr, errorObjPtr); - errorObjPtr = Tcl_GetObjVar2(riPtr->interp, "errorInfo", NULL, + errorObjPtr = Tcl_GetVar2Ex(riPtr->interp, "errorInfo", NULL, TCL_GLOBAL_ONLY); Tcl_ListObjAppendElement(NULL, returnPackagePtr, errorObjPtr); } @@ -795,7 +795,7 @@ TkDdeServerProc ( returnString, len, 0, ddeItem, CF_TEXT, 0); } else { - Tcl_Obj *variableObjPtr = Tcl_GetObjVar2( + Tcl_Obj *variableObjPtr = Tcl_GetVar2Ex( convPtr->riPtr->interp, utilString, NULL, TCL_GLOBAL_ONLY); if (variableObjPtr != NULL) { diff --git a/win/tkWinWm.c b/win/tkWinWm.c index d9d7a19..40a4f48 100644 --- a/win/tkWinWm.c +++ b/win/tkWinWm.c @@ -7,12 +7,12 @@ * to the window manager. * * Copyright (c) 1995-1997 Sun Microsystems, Inc. - * Copyright (c) 1998 by Scriptics Corporation. + * Copyright (c) 1998-1999 by Scriptics Corporation. * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkWinWm.c,v 1.1.4.6 1998/12/13 08:16:20 lfb Exp $ + * RCS: @(#) $Id: tkWinWm.c,v 1.1.4.7 1999/02/11 04:13:52 stanton Exp $ */ #include "tkWinInt.h" @@ -666,6 +666,11 @@ UpdateWrapper(winPtr) wmPtr->exStyle = EX_TOPLEVEL_STYLE; } + if ((wmPtr->flags & WM_WIDTH_NOT_RESIZABLE) + && (wmPtr->flags & WM_HEIGHT_NOT_RESIZABLE)) { + wmPtr->style &= ~ (WS_MAXIMIZEBOX | WS_SIZEBOX); + } + /* * Compute the geometry of the parent and child windows. */ @@ -2406,6 +2411,11 @@ UpdateGeometryInfo(clientData) return; } + if (wmPtr->flags & WM_UPDATE_SIZE_HINTS) { + wmPtr->flags &= ~WM_UPDATE_SIZE_HINTS; + UpdateWrapper(winPtr); + } + /* * Compute the border size for the current window style. This * size will include the resize handles, the title bar and the @@ -3985,6 +3995,15 @@ WmProc(hwnd, message, wParam, lParam) case WM_ENTERSIZEMOVE: inMoveSize = 1; + + /* + * Cancel any current mouse timer. If the mouse timer + * fires during the size/move mouse capture, it will + * release the capture, which is wrong. + */ + + TkWinCancelMouseTimer(); + oldMode = Tcl_SetServiceMode(TCL_SERVICE_ALL); break; diff --git a/win/winMain.c b/win/winMain.c index 22b7bbc..48eac39 100644 --- a/win/winMain.c +++ b/win/winMain.c @@ -4,11 +4,12 @@ * Main entry point for wish and other Tk-based applications. * * Copyright (c) 1995-1997 Sun Microsystems, Inc. + * Copyright (c) 1998-1999 by Scriptics Corporation. * * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: winMain.c,v 1.1.4.2 1998/09/30 02:19:41 stanton Exp $ + * RCS: @(#) $Id: winMain.c,v 1.1.4.3 1999/02/11 04:13:52 stanton Exp $ */ #include <tk.h> @@ -34,12 +35,12 @@ static void setargv _ANSI_ARGS_((int *argcPtr, char ***argvPtr)); static void WishPanic _ANSI_ARGS_(TCL_VARARGS(char *,format)); #ifdef TK_TEST -EXTERN int Tktest_Init(Tcl_Interp *interp); +extern int Tktest_Init(Tcl_Interp *interp); #endif /* TK_TEST */ #ifdef TCL_TEST -EXTERN int TclObjTest_Init _ANSI_ARGS_((Tcl_Interp *interp)); -EXTERN int Tcltest_Init _ANSI_ARGS_((Tcl_Interp *interp)); +extern int TclObjTest_Init _ANSI_ARGS_((Tcl_Interp *interp)); +extern int Tcltest_Init _ANSI_ARGS_((Tcl_Interp *interp)); #endif /* TCL_TEST */ |