Check-in [767c0f0247]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:add tk upstream changes
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 767c0f0247b5129b4d4cbd03a9ebbedbe5b4d16f
User & Date: chw 2017-01-08 05:20:10
Context
2017-01-08
05:20
add dbus-tcl/dbus-intf upstream changes check-in: 6b2eeb1384 user: chw tags: trunk
05:20
add tk upstream changes check-in: 767c0f0247 user: chw tags: trunk
05:19
add selected tcllib upstream changes check-in: a9094c9722 user: chw tags: trunk
Changes

Changes to jni/sdl2tk/generic/tkTextDisp.c.

7820
7821
7822
7823
7824
7825
7826
7827
7828
7829
7830
7831
7832
7833
7834
	if (bstart == ciPtr->baseOffset) {
	    xDisplacement = startX - chunkPtr->x;
	} else {
	    int widthUntilStart = 0;

	    MeasureChars(tkfont, chars, charsLen, 0, bstart,
		    0, -1, 0, &widthUntilStart);
	    xDisplacement = startX - widthUntilStart - chunkPtr->x;
	}

	fit = MeasureChars(tkfont, chars, charsLen, 0, bend,
		ciPtr->baseChunkPtr->x + xDisplacement, maxX, flags, nextXPtr);

	if (fit < bstart) {
	    return 0;







|







7820
7821
7822
7823
7824
7825
7826
7827
7828
7829
7830
7831
7832
7833
7834
	if (bstart == ciPtr->baseOffset) {
	    xDisplacement = startX - chunkPtr->x;
	} else {
	    int widthUntilStart = 0;

	    MeasureChars(tkfont, chars, charsLen, 0, bstart,
		    0, -1, 0, &widthUntilStart);
	    xDisplacement = startX - widthUntilStart - ciPtr->baseChunkPtr->x;
	}

	fit = MeasureChars(tkfont, chars, charsLen, 0, bend,
		ciPtr->baseChunkPtr->x + xDisplacement, maxX, flags, nextXPtr);

	if (fit < bstart) {
	    return 0;

Changes to jni/sdl2tk/macosx/tkMacOSXFont.c.

866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
	    if (index <= start && (flags & TK_AT_LEAST_ONE)) {
		flags &= ~TK_WHOLE_WORDS;
	    }
	}
	if (index <= start && !(flags & TK_WHOLE_WORDS)) {
	    index = CTTypesetterSuggestClusterBreak(typesetter, start, maxWidth);
	}
	cs = (index < len || (flags & TK_WHOLE_WORDS)) ?
		whitespaceCharacterSet : lineendingCharacterSet;
	while (index > start &&
		[cs characterIsMember:[string characterAtIndex:(index - 1)]]) {
	    index--;
	}
	if (index <= start && (flags & TK_AT_LEAST_ONE)) {
	    index = start + 1;







|







866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
	    if (index <= start && (flags & TK_AT_LEAST_ONE)) {
		flags &= ~TK_WHOLE_WORDS;
	    }
	}
	if (index <= start && !(flags & TK_WHOLE_WORDS)) {
	    index = CTTypesetterSuggestClusterBreak(typesetter, start, maxWidth);
	}
	cs = (index <= len && (flags & TK_WHOLE_WORDS)) ?
		whitespaceCharacterSet : lineendingCharacterSet;
	while (index > start &&
		[cs characterIsMember:[string characterAtIndex:(index - 1)]]) {
	    index--;
	}
	if (index <= start && (flags & TK_AT_LEAST_ONE)) {
	    index = start + 1;

Changes to jni/sdl2tk/tests/constraints.tcl.

176
177
178
179
180
181
182

183



184
185
186
187
188
189
190
}

namespace import -force tk::test::*

namespace import -force tcltest::testConstraint
testConstraint notAqua [expr {[tk windowingsystem] ne "aqua"}]
testConstraint aqua [expr {[tk windowingsystem] eq "aqua"}]

testConstraint nonwin [expr {[tk windowingsystem] ne "win32"}]



testConstraint userInteraction 0
testConstraint nonUnixUserInteraction [expr {
    [testConstraint userInteraction] ||
    ([testConstraint unix] && [testConstraint notAqua])
}]
testConstraint haveDISPLAY [info exists env(DISPLAY)]
testConstraint altDisplay  [info exists env(TK_ALT_DISPLAY)]







>

>
>
>







176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
}

namespace import -force tk::test::*

namespace import -force tcltest::testConstraint
testConstraint notAqua [expr {[tk windowingsystem] ne "aqua"}]
testConstraint aqua [expr {[tk windowingsystem] eq "aqua"}]
testConstraint x11 [expr {[tk windowingsystem] eq "x11"}]
testConstraint nonwin [expr {[tk windowingsystem] ne "win32"}]
testConstraint aquaOrWin32 [expr {
    ([tk windowingsystem] eq "win32") || [testConstraint aqua]
}]
testConstraint userInteraction 0
testConstraint nonUnixUserInteraction [expr {
    [testConstraint userInteraction] ||
    ([testConstraint unix] && [testConstraint notAqua])
}]
testConstraint haveDISPLAY [info exists env(DISPLAY)]
testConstraint altDisplay  [info exists env(TK_ALT_DISPLAY)]

Changes to jni/sdl2tk/tests/text.test.

3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
....
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
    .t tag add sel 1.0 end
    expr {[selection get] eq "$x\n"}
} -cleanup {
    destroy .t
} -result {1}


test text-21.1 {TkTextLostSelection procedure} -constraints unix -setup {
    text .t
    .t insert 1.0 "Line 1"
    entry .t.e
    .t.e insert end "abcdefg"
    text .t2
    .t2 insert 1.0 "abc\ndef\nghijk\n1234"
} -body {
................................................................................
    .t2 tag add sel 1.2 3.3
    .t.e select from 0
    .t.e select to 1
    .t2 tag ranges sel
} -cleanup {
    destroy .t .t2
} -result {}
test text-21.2 {TkTextLostSelection procedure} -constraints win -setup {
    text .t
    .t insert 1.0 "Line 1"
    entry .t.e
    .t.e insert end "abcdefg"
    text .t2
    .t2 insert 1.0 "abc\ndef\nghijk\n1234"
} -body {







|







 







|







3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
....
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
    .t tag add sel 1.0 end
    expr {[selection get] eq "$x\n"}
} -cleanup {
    destroy .t
} -result {1}


test text-21.1 {TkTextLostSelection procedure} -constraints {x11} -setup {
    text .t
    .t insert 1.0 "Line 1"
    entry .t.e
    .t.e insert end "abcdefg"
    text .t2
    .t2 insert 1.0 "abc\ndef\nghijk\n1234"
} -body {
................................................................................
    .t2 tag add sel 1.2 3.3
    .t.e select from 0
    .t.e select to 1
    .t2 tag ranges sel
} -cleanup {
    destroy .t .t2
} -result {}
test text-21.2 {TkTextLostSelection procedure} -constraints aquaOrWin32 -setup {
    text .t
    .t insert 1.0 "Line 1"
    entry .t.e
    .t.e insert end "abcdefg"
    text .t2
    .t2 insert 1.0 "abc\ndef\nghijk\n1234"
} -body {

Changes to jni/sdl2tk/unix/tkUnixFont.c.

1406
1407
1408
1409
1410
1411
1412


1413
1414

1415
1416
1417
1418
1419
1420
1421
1422
1423
    int numBytes,		/* Number of bytes in string. */
    int rangeStart,		/* Index of first byte to draw. */
    int rangeLength,		/* Length of range to draw in bytes. */
    int x, int y)		/* Coordinates at which to place origin of the
				 * whole (not just the range) string when
				 * drawing. */
{


    (void) numBytes; /*unused*/


    Tk_DrawChars(display, drawable, gc, tkfont, source + rangeStart,
	    rangeLength, x, y);
}
 
/*
 *-------------------------------------------------------------------------
 *
 * CreateClosestFont --
 *







>
>


>

|







1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
    int numBytes,		/* Number of bytes in string. */
    int rangeStart,		/* Index of first byte to draw. */
    int rangeLength,		/* Length of range to draw in bytes. */
    int x, int y)		/* Coordinates at which to place origin of the
				 * whole (not just the range) string when
				 * drawing. */
{
    int widthUntilStart;

    (void) numBytes; /*unused*/

    Tk_MeasureChars(tkfont, source, rangeStart, -1, 0, &widthUntilStart);
    Tk_DrawChars(display, drawable, gc, tkfont, source + rangeStart,
	    rangeLength, x+widthUntilStart, y);
}
 
/*
 *-------------------------------------------------------------------------
 *
 * CreateClosestFont --
 *

Changes to jni/sdl2tk/win/tkWinFont.c.

1407
1408
1409
1410
1411
1412
1413


1414


1415
1416
1417
1418
1419
1420
1421
1422
1423
    int numBytes,		/* Number of bytes in string. */
    int rangeStart,		/* Index of first byte to draw. */
    int rangeLength,		/* Length of range to draw in bytes. */
    int x, int y)		/* Coordinates at which to place origin of the
				 * whole (not just the range) string when
				 * drawing. */
{


    (void) numBytes; /*unused*/


    Tk_DrawChars(display, drawable, gc, tkfont, source + rangeStart,
	    rangeLength, x, y);
}
 
/*
 *-------------------------------------------------------------------------
 *
 * MultiFontTextOut --
 *







>
>

>
>

|







1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
    int numBytes,		/* Number of bytes in string. */
    int rangeStart,		/* Index of first byte to draw. */
    int rangeLength,		/* Length of range to draw in bytes. */
    int x, int y)		/* Coordinates at which to place origin of the
				 * whole (not just the range) string when
				 * drawing. */
{
    int widthUntilStart;

    (void) numBytes; /*unused*/

    Tk_MeasureChars(tkfont, source, rangeStart, -1, 0, &widthUntilStart);
    Tk_DrawChars(display, drawable, gc, tkfont, source + rangeStart,
	    rangeLength, x+widthUntilStart, y);
}
 
/*
 *-------------------------------------------------------------------------
 *
 * MultiFontTextOut --
 *