summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2016-04-18 09:50:47 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2016-04-18 09:50:47 (GMT)
commit16c6ee8bf0a30510f88cf3f32fd202fc5201d8c8 (patch)
tree861f284447313793f3d442ec22c9091d8f054182
parent741ee5b0cbad3670fe1bde6bf53866150d60951e (diff)
parentfa289415c7aaacc173ab97665af201a54eae611a (diff)
downloadtk-16c6ee8bf0a30510f88cf3f32fd202fc5201d8c8.zip
tk-16c6ee8bf0a30510f88cf3f32fd202fc5201d8c8.tar.gz
tk-16c6ee8bf0a30510f88cf3f32fd202fc5201d8c8.tar.bz2
merge core-8-6-branch. Selected harmless androwish changes.
-rw-r--r--debian/pkgIndex.tcl2
-rw-r--r--doc/FreeXId.320
-rw-r--r--doc/event.n6
-rw-r--r--doc/text.n2
-rw-r--r--generic/tkBind.c2
-rw-r--r--generic/tkGC.c7
-rw-r--r--generic/tkImgPhoto.c106
-rw-r--r--macosx/tkMacOSXEmbed.c2
-rw-r--r--sdl/tkSDLCursor.c1
-rw-r--r--sdl/tkSDLXId.c1
-rw-r--r--tests/text.test10
-rw-r--r--unix/tkUnixCursor.c1
-rw-r--r--unix/tkUnixXId.c1
13 files changed, 70 insertions, 91 deletions
diff --git a/debian/pkgIndex.tcl b/debian/pkgIndex.tcl
index 2ca5f92..c00f3d3 100644
--- a/debian/pkgIndex.tcl
+++ b/debian/pkgIndex.tcl
@@ -1,2 +1,2 @@
if {[catch {package present Tcl 8.6}]} {return}
-package ifneeded Tk 8.6.4 [list load [file join $dir .. libsdl2tk8.6[info sharedlibextension]] Tk]
+package ifneeded Tk 8.6.5 [list load [file join $dir .. libsdl2tk8.6[info sharedlibextension]] Tk]
diff --git a/doc/FreeXId.3 b/doc/FreeXId.3
index 56c7804..84fef26 100644
--- a/doc/FreeXId.3
+++ b/doc/FreeXId.3
@@ -25,24 +25,6 @@ context, or colormap) that is no longer in use.
.BE
.SH DESCRIPTION
.PP
-The default allocator for resource identifiers provided by Xlib is very
-simple-minded and does not allow resource identifiers to be re-used.
-If a long-running application reaches the end of the resource id
-space, it will generate an X protocol error and crash.
-Tk replaces the default id allocator with its own allocator, which
-allows identifiers to be reused.
-In order for this to work, \fBTk_FreeXId\fR must be called to
-tell the allocator about resources that have been freed.
-Tk automatically calls \fBTk_FreeXId\fR whenever it frees a
-resource, so if you use procedures like \fBTk_GetFont\fR,
-\fBTk_GetGC\fR, and \fBTk_GetPixmap\fR then you need not call
-\fBTk_FreeXId\fR.
-However, if you allocate resources directly from Xlib, for example
-by calling \fBXCreatePixmap\fR, then you should call \fBTk_FreeXId\fR
-when you call the corresponding Xlib free procedure, such as
-\fBXFreePixmap\fR.
-If you do not call \fBTk_FreeXId\fR then the resource identifier will
-be lost, which could cause problems if the application runs long enough
-to lose all of the available identifiers.
+This function is deprecated, it doesn't do anything since 2008-08-19.
.SH KEYWORDS
resource identifier
diff --git a/doc/event.n b/doc/event.n
index 12433cb..045339e 100644
--- a/doc/event.n
+++ b/doc/event.n
@@ -351,6 +351,12 @@ This is sent to a widget when the focus leaves the widget because of a
user-driven
.QW "tab to widget"
action.
+.TP
+\fB<<WidgetViewSync>>\fR
+This is sent to a text widget when its internal data become obsolete,
+and again when these internal data are back in sync with the widget
+view. The detail field (%d substitution) is either true (when the
+widget is in sync) or false (when it is not).
.PP
Tk defines the following virtual events for the purposes of unifying
bindings across multiple platforms. Users expect them to behave in the
diff --git a/doc/text.n b/doc/text.n
index 1925f5e..9e6a479 100644
--- a/doc/text.n
+++ b/doc/text.n
@@ -980,7 +980,7 @@ geometry manager), one can resort to \fIpathName \fBsync\fR and \fIpathName
\fBpendingsync\fR to control the synchronization of the view of text widgets.
.PP
The \fB<<WidgetViewSync>>\fR virtual event fires when the line heights of the
-text widget becomes obsolete (due to some editing command or configuration
+text widget become obsolete (due to some editing command or configuration
change), and again when the internal data of the text widget are back in sync
with the widget view. The detail field (%d substitution) is either true (when
the widget is in sync) or false (when it is not).
diff --git a/generic/tkBind.c b/generic/tkBind.c
index caecaba..72ba7b3 100644
--- a/generic/tkBind.c
+++ b/generic/tkBind.c
@@ -2881,7 +2881,7 @@ GetAllVirtualEvents(
* Any other fields in eventPtr which are not specified by the pattern
* string or the optional arguments, are set to 0.
*
- * The event may be handled sychronously or asynchronously, depending on
+ * The event may be handled synchronously or asynchronously, depending on
* the value specified by the optional "-when" option. The default
* setting is synchronous.
*
diff --git a/generic/tkGC.c b/generic/tkGC.c
index 5663ede..c424e30 100644
--- a/generic/tkGC.c
+++ b/generic/tkGC.c
@@ -314,7 +314,6 @@ Tk_FreeGC(
gcPtr = Tcl_GetHashValue(idHashPtr);
gcPtr->refCount--;
if (gcPtr->refCount == 0) {
- Tk_FreeXId(gcPtr->display, (XID) XGContextFromGC(gcPtr->gc));
XFreeGC(gcPtr->display, gcPtr->gc);
Tcl_DeleteHashEntry(gcPtr->valueHashPtr);
Tcl_DeleteHashEntry(idHashPtr);
@@ -351,12 +350,6 @@ TkGCCleanup(
entryPtr != NULL; entryPtr = Tcl_NextHashEntry(&search)) {
gcPtr = Tcl_GetHashValue(entryPtr);
- /*
- * This call is not needed, as it is only used on Unix to restore the
- * Id to the stack pool, and we don't want to use them anymore.
- * Tk_FreeXId(gcPtr->display, (XID) XGContextFromGC(gcPtr->gc));
- */
-
XFreeGC(gcPtr->display, gcPtr->gc);
Tcl_DeleteHashEntry(gcPtr->valueHashPtr);
Tcl_DeleteHashEntry(entryPtr);
diff --git a/generic/tkImgPhoto.c b/generic/tkImgPhoto.c
index 1365822..7ec39c5 100644
--- a/generic/tkImgPhoto.c
+++ b/generic/tkImgPhoto.c
@@ -641,16 +641,6 @@ ImgPhotoCmd(
PhotoMaster savedMaster;
savedMaster = *masterPtr;
- if (options.background == NULL) {
- options.background =
-#if defined(_WIN32) && !defined(PLATFORM_SDL)
- Tk_GetColor(interp,
- Tk_MainWindow(interp), Tk_GetUid("SystemButtonFace"));
-#else
- Tk_GetColor(interp,
- Tk_MainWindow(interp), Tk_GetUid("black"));
-#endif
- }
if (sameSrc) {
masterPtr->pix32 = NULL;
masterPtr->width = masterPtr->height = 0;
@@ -1752,7 +1742,7 @@ ParseSubcommandOptions(
return TCL_ERROR;
}
}
- }
+ }
} else {
Tcl_AppendResult(interp, "the \"-scale\" option ",
"requires one or two values", (char *) NULL);
@@ -1790,7 +1780,7 @@ ParseSubcommandOptions(
}
} else {
optPtr->filtername = "Mitchell";
- }
+ }
} else if (bit == OPT_SMOOTHEDGE) {
if (index + 1 < objc) {
char *temp;
@@ -4343,7 +4333,7 @@ Mitchell(
return 0.888888888889 + (-2.0 + 1.16666666667 * x) * x * x;
}
if (x < 2.0) {
- return 1.77777777778 + (-3.33333333333 +
+ return 1.77777777778 + (-3.33333333333 +
(2.0 - 0.388888888889 * x) * x) * x;
}
return 0.0;
@@ -4507,6 +4497,11 @@ ImgPhotoPutResizedRotatedBlock(
}
masterPtr = (PhotoMaster *) destHandle;
+ alphaOffset = srcBlkPtr->offset[3];
+ if ((alphaOffset >= srcBlkPtr->pixelSize) || (alphaOffset < 0)) {
+ alphaOffset = 0;
+ }
+
/*
* First, we juggle around a bit in order to decompose the rotation
* into a tilt between -45 and 45 degrees (inclusive) and an integral
@@ -4552,7 +4547,7 @@ ImgPhotoPutResizedRotatedBlock(
startY += srcBlkPtr->height;
}
if (endY <= 0) {
- endY += srcBlkPtr->height;
+ endY += srcBlkPtr->height;
}
if (endY > srcBlkPtr->height) {
endY = srcBlkPtr->height;
@@ -4565,7 +4560,7 @@ ImgPhotoPutResizedRotatedBlock(
bg0 = 0xFF;
bg1 = 0xFF;
bg2 = 0xFF;
- bg3 = 0xFF;
+ bg3 = alphaOffset ? 0x00 : 0xFF;
} else {
bg0 = (unsigned char) ((background->red) >> 8);
bg1 = (unsigned char) ((background->green) >> 8);
@@ -4638,14 +4633,16 @@ ImgPhotoPutResizedRotatedBlock(
val0 = val1 = val2 = val3 = 0.0;
for (N = 0; N < run; N++) {
if (((left + N) < 0) || ((left + N) >= width)) {
- val0 += weights[N] * bg0;
- val1 += weights[N] * bg1;
- val2 += weights[N] * bg2;
+ val0 += weights[N] * bg0;
+ val1 += weights[N] * bg1;
+ val2 += weights[N] * bg2;
+ val3 += weights[N] * bg3;
} else {
idX = iy * pitch + (left + N) * pixelSize;
- val0 += weights[N] * srcPixelPtr[idX];
- val1 += weights[N] * srcPixelPtr[idX + 1];
- val2 += weights[N] * srcPixelPtr[idX + 2];
+ val0 += weights[N] * srcPixelPtr[idX];
+ val1 += weights[N] * srcPixelPtr[idX + 1];
+ val2 += weights[N] * srcPixelPtr[idX + 2];
+ val3 += weights[N] * srcPixelPtr[idX + 3];
}
}
idY = 4 * (iy * (columns + xf2) + ix + xf);
@@ -4655,9 +4652,14 @@ ImgPhotoPutResizedRotatedBlock(
((val1 < 0) ? 0 : ((val1 > 255) ? 255 : val1));
transImg[idY + 2] = (unsigned char)
((val2 < 0) ? 0 : ((val2 > 255) ? 255 : val2));
- transImg[idY + 3] = 255;
+ if (alphaOffset) {
+ transImg[idY + 3] = (unsigned char)
+ ((val3 < 0) ? 0 : ((val3 > 255) ? 255 : val3));
+ } else {
+ transImg[idY + 3] = 255;
+ }
}
- }
+ }
columns += xf2;
@@ -4694,14 +4696,16 @@ ImgPhotoPutResizedRotatedBlock(
val0 = val1 = val2 = val3 = 0.0;
for (N = 0; N < run; N++) {
if (((left + N) < 0) || ((left + N) >= height)) {
- val0 += weights[N] * bg0;
- val1 += weights[N] * bg1;
- val2 += weights[N] * bg2;
+ val0 += weights[N] * bg0;
+ val1 += weights[N] * bg1;
+ val2 += weights[N] * bg2;
+ val3 += weights[N] * bg3;
} else {
idY = ix * pixelSize + (left + N) * pitch;
- val0 += weights[N] * srcPixelPtr[idY];
- val1 += weights[N] * srcPixelPtr[idY + 1];
- val2 += weights[N] * srcPixelPtr[idY + 2];
+ val0 += weights[N] * srcPixelPtr[idY];
+ val1 += weights[N] * srcPixelPtr[idY + 1];
+ val2 += weights[N] * srcPixelPtr[idY + 2];
+ val3 += weights[N] * srcPixelPtr[idY + 3];
}
}
idX = 4 * ((iy + xf) * columns + ix);
@@ -4711,9 +4715,14 @@ ImgPhotoPutResizedRotatedBlock(
((val1 < 0) ? 0 : ((val1 > 255) ? 255 : val1));
newImg[idX + 2] = (unsigned char)
((val2 < 0) ? 0 : ((val2 > 255) ? 255 : val2));
- newImg[idX + 3] = 255;
+ if (alphaOffset) {
+ newImg[idX + 3] = (unsigned char)
+ ((val3 < 0) ? 0 : ((val3 > 255) ? 255 : val3));
+ } else {
+ newImg[idX + 3] = 255;
+ }
}
- }
+ }
rows += xf2;
@@ -4762,7 +4771,7 @@ afterFiltering:
+ startY * srcBlkPtr->pitch;
break;
}
-
+
pixelSize = pxpx[dir_n_roll_n_mirror] * srcBlkPtr->pixelSize
+ pxpt[dir_n_roll_n_mirror] * srcBlkPtr->pitch;
pitch = ptpx[dir_n_roll_n_mirror] * srcBlkPtr->pixelSize
@@ -4839,7 +4848,7 @@ afterFiltering:
*/
yTi4 = (int) (yT4 + dispY) - dispY;
-
+
/*
* However, there may not be pixel grid points within the transformed
* area with either of the above coordinates.
@@ -4858,10 +4867,10 @@ afterFiltering:
/* Size and rows/columns of the transformed image. */
resSizeX = (int) (- 2 * xTi1);
- resSizeY = (int) (2 * yTi4);
+ resSizeY = (int) (2 * yTi4);
resWidth = resSizeX + 1;
resHeight = resSizeY + 1;
-
+
/*
* We have to steal a glance at the target image metrics before
* we can proceed. The task is to determine whether clipping by
@@ -4929,7 +4938,7 @@ afterFiltering:
+ startY * srcBlkPtr->pitch;
break;
}
-
+
pixelSize = pxpx[dir_n_roll_n_mirror] * srcBlkPtr->pixelSize
+ pxpt[dir_n_roll_n_mirror] * srcBlkPtr->pitch;
pitch = ptpx[dir_n_roll_n_mirror] * srcBlkPtr->pixelSize
@@ -4952,16 +4961,11 @@ afterFiltering:
* components, mark it as a color image.
*/
- alphaOffset = srcBlkPtr->offset[3];
- if ((alphaOffset >= srcBlkPtr->pixelSize) || (alphaOffset < 0)) {
- alphaOffset = 0;
- }
-
if (((srcBlkPtr->offset[1] - srcBlkPtr->offset[0]) != 0) ||
((srcBlkPtr->offset[2] - srcBlkPtr->offset[0]) != 0)) {
masterPtr->flags |= COLOR_IMAGE;
}
-
+
/*
* Now we have sufficient data to complete the *Tk_PhotoImageBlock*
* structure for the resulting transformed image.
@@ -5090,7 +5094,7 @@ afterFiltering:
* The faster notebook had only 32 bit TrueColor on which Tk
* had paniced!
*/
-
+
for (; xx < to; ++xx, sU = sU + dsU, sL = sL + dsL) {
sUi = (int) (sU + dispY) - dispY - ((sU < 0) ? 1 : 0);
if (sUi > bndU) {
@@ -5108,7 +5112,7 @@ afterFiltering:
if (xn > bndX) {
break;
}
- yn = (int) (resSizeY / 2.0 - sUi + 0.25) * resPitch;
+ yn = (int) (resSizeY / 2.0 - sUi + 0.25) * resPitch;
for (yy = sUi; yy >= sLb; --yy) {
sUx = sUx - SIN_X;
@@ -5116,7 +5120,7 @@ afterFiltering:
ssX = (int) sUx;
ssY = (int) sUy;
- fromPtr = srcPixelPtr + pixelSize * ssX + pitch * ssY;
+ fromPtr = srcPixelPtr + pixelSize * ssX + pitch * ssY;
toPtr = resPixelPtr + xn + yn;
yn += resPitch;
@@ -5133,7 +5137,7 @@ afterFiltering:
sx_sy = sx_ * sy;
sxsy_ = sx * sy_;
sx_sy_ = sx_ * sy_;
- val0 = val1 = val2 = val3= 0;
+ val0 = val1 = val2 = val3 = 0;
if ((ssX < 0) || (ssX > width) ||
(ssY < 0) || (ssY > height)) {
val0 += bg0 * sx_sy_;
@@ -5191,16 +5195,14 @@ afterFiltering:
} else {
alpha = ((ssX < 0) || (ssX > width) ||
(ssY < 0) || (ssY > height)) ?
- 0 : *fromPtr3 / 255.0;
- alpha_ = 1 - alpha;
+ 0.0 : (val3 / 255.0);
+ alpha_ = 1 - alpha;
if (*(toPtr + 3) == 255) {
*toPtr += (unsigned char) ((val0 - *toPtr) * alpha);
toPtr++;
*toPtr += (unsigned char) ((val1 - *toPtr) * alpha);
toPtr++;
*toPtr += (unsigned char) ((val2 - *toPtr) * alpha);
- toPtr++;
- *toPtr += 255;
} else {
beta = *(toPtr + 3) / 255.0;
*toPtr = (unsigned char)
@@ -5213,7 +5215,7 @@ afterFiltering:
(val2 * alpha - alpha_ * beta * *toPtr);
toPtr++;
*toPtr = (unsigned char)
- (*fromPtr3 + (255 - *fromPtr3) * beta);
+ (val3 + (255.0 - val3) * beta);
}
}
}
@@ -5229,7 +5231,7 @@ afterFiltering:
* The finishing touches are from *Tk_PhotoPutZoomedBlock*.
* Recompute the region of data for which we have valid pixels to plot.
*/
- if (alphaOffset) {
+ if (alphaOffset) {
int x1, y1, end;
if (compRule != TK_PHOTO_COMPOSITE_OVERLAY) {
diff --git a/macosx/tkMacOSXEmbed.c b/macosx/tkMacOSXEmbed.c
index 99f7584..5ea7603 100644
--- a/macosx/tkMacOSXEmbed.c
+++ b/macosx/tkMacOSXEmbed.c
@@ -193,7 +193,7 @@ TkpMakeWindow(
int
TkpScanWindowId(
Tcl_Interp *interp,
- CONST char * string,
+ const char * string,
Window *idPtr)
{
int code;
diff --git a/sdl/tkSDLCursor.c b/sdl/tkSDLCursor.c
index 9819fae..e16b61a 100644
--- a/sdl/tkSDLCursor.c
+++ b/sdl/tkSDLCursor.c
@@ -639,7 +639,6 @@ TkpFreeCursor(
TkSDLCursor *sdlCursorPtr = (TkSDLCursor *) cursorPtr;
XFreeCursor(sdlCursorPtr->display, (Cursor) sdlCursorPtr->info.cursor);
- Tk_FreeXId(sdlCursorPtr->display, (XID) sdlCursorPtr->info.cursor);
}
/*
diff --git a/sdl/tkSDLXId.c b/sdl/tkSDLXId.c
index e7e142d..76d85f9 100644
--- a/sdl/tkSDLXId.c
+++ b/sdl/tkSDLXId.c
@@ -96,7 +96,6 @@ Tk_FreePixmap(
Pixmap pixmap) /* Identifier for pixmap. */
{
XFreePixmap(display, pixmap);
- Tk_FreeXId(display, (XID) pixmap);
}
diff --git a/tests/text.test b/tests/text.test
index 10fb75f..0275ee8 100644
--- a/tests/text.test
+++ b/tests/text.test
@@ -6367,7 +6367,7 @@ test text-27.18 {patch 1469210 - inserting after undo} -setup {
} -cleanup {
destroy .t
} -result 1
-test text-25.19 {patch 1669632 (i) - undo after <Control-1>} -setup {
+test text-27.19 {patch 1669632 (i) - undo after <Control-1>} -setup {
destroy .t
} -body {
text .t -undo 1
@@ -6381,7 +6381,7 @@ test text-25.19 {patch 1669632 (i) - undo after <Control-1>} -setup {
} -cleanup {
destroy .t
} -result WORLD
-test text-25.20 {patch 1669632 (iv) - undo after <<SelectNone>>} -setup {
+test text-27.20 {patch 1669632 (iv) - undo after <<SelectNone>>} -setup {
destroy .top .top.t
} -body {
toplevel .top
@@ -6400,7 +6400,7 @@ test text-25.20 {patch 1669632 (iv) - undo after <<SelectNone>>} -setup {
} -cleanup {
destroy .top.t .top
} -result HELLO
-test text-25.21 {patch 1669632 (vii) - <<Undo>> shall not remove separators} -setup {
+test text-27.21 {patch 1669632 (vii) - <<Undo>> shall not remove separators} -setup {
destroy .t
} -body {
text .t -undo 1
@@ -6416,7 +6416,7 @@ test text-25.21 {patch 1669632 (vii) - <<Undo>> shall not remove separators} -se
} -cleanup {
destroy .t
} -result "This WORLD is an example text"
-test text-25.22 {patch 1669632 (v) - <<Clear>> is atomic} -setup {
+test text-27.22 {patch 1669632 (v) - <<Clear>> is atomic} -setup {
destroy .t
} -body {
toplevel .top
@@ -6436,7 +6436,7 @@ test text-25.22 {patch 1669632 (v) - <<Clear>> is atomic} -setup {
} -cleanup {
destroy .top.t .top
} -result "This A an example text"
- test text-25.23 {patch 1669632 (v) - <<Cut>> is atomic} -setup {
+ test text-27.23 {patch 1669632 (v) - <<Cut>> is atomic} -setup {
destroy .t
} -body {
toplevel .top
diff --git a/unix/tkUnixCursor.c b/unix/tkUnixCursor.c
index 5266bde..8afb92d 100644
--- a/unix/tkUnixCursor.c
+++ b/unix/tkUnixCursor.c
@@ -639,7 +639,6 @@ TkpFreeCursor(
TkUnixCursor *unixCursorPtr = (TkUnixCursor *) cursorPtr;
XFreeCursor(unixCursorPtr->display, (Cursor) unixCursorPtr->info.cursor);
- Tk_FreeXId(unixCursorPtr->display, (XID) unixCursorPtr->info.cursor);
}
/*
diff --git a/unix/tkUnixXId.c b/unix/tkUnixXId.c
index 668f228..ec2451c 100644
--- a/unix/tkUnixXId.c
+++ b/unix/tkUnixXId.c
@@ -96,7 +96,6 @@ Tk_FreePixmap(
Pixmap pixmap) /* Identifier for pixmap. */
{
XFreePixmap(display, pixmap);
- Tk_FreeXId(display, (XID) pixmap);
}