Check-in [90b29fd7e9]
Not logged in

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

Overview
Comment:add selected tk upstream changes
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 90b29fd7e92e54d3d071f7b622209366d575cacb
User & Date: chw 2019-12-04 06:46:54
Context
2019-12-04
09:26
add selected SDL2 upstream changes check-in: c406aa0875 user: chw tags: trunk
06:47
merge with trunk check-in: 3020b516a5 user: chw tags: wtf-8-experiment
06:46
add selected tk upstream changes check-in: 90b29fd7e9 user: chw tags: trunk
2019-12-03
21:38
update awthemes to version 7.3 check-in: a4782b3770 user: chw tags: trunk
Changes

Changes to jni/sdl2tk/changes.

7568
7569
7570
7571
7572
7573
7574
7575
7576
7577
7578
7579
7580
7581
7582
7583
7584

2018-11-04 (bug)[6b22d4] [treeview] binding fix (ohagan)

- Released 8.6.9, November 16, 2018 - https://core.tcl-lang.org/tk/ for details

2018-11-19 (bug)[0a9c91] crash in text-11a.22 (vogel)

2018-11-20 (bug)[9705d1] crash activating "Alt" theme (culler) 

2018-11-24 (bug)[e3b954] cursor offset at full screen display (culler) 

2019-01-04 (bug)[18a4ba] cross-platform [winfo containing] (culler)

2019-01-08 (feature) local grab on Mac OSX (culler)

2019-01-10 (build) 'None', 'ControlMask' symbol conflicts (nijtmans)








|

|







7568
7569
7570
7571
7572
7573
7574
7575
7576
7577
7578
7579
7580
7581
7582
7583
7584

2018-11-04 (bug)[6b22d4] [treeview] binding fix (ohagan)

- Released 8.6.9, November 16, 2018 - https://core.tcl-lang.org/tk/ for details

2018-11-19 (bug)[0a9c91] crash in text-11a.22 (vogel)

2018-11-20 (bug)[9705d1] crash activating "Alt" theme (culler)

2018-11-24 (bug)[e3b954] cursor offset at full screen display (culler)

2019-01-04 (bug)[18a4ba] cross-platform [winfo containing] (culler)

2019-01-08 (feature) local grab on Mac OSX (culler)

2019-01-10 (build) 'None', 'ControlMask' symbol conflicts (nijtmans)

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

308
309
310
311
312
313
314

315
316
317
318
319
320
321
		}
		if (colorspace) {
		    CFRelease(colorspace);
		}
		if (bitmapImageRep) {
		    image = [[NSImage alloc] initWithSize:NSMakeSize(pix, pix)];
		    [image addRepresentation:bitmapImageRep];

		    [bitmapImageRep release];
		}

		uint16_t *hotSpotData = (uint16_t*)(bitmap + 2*pix*pix/8);
		hotSpot.y = CFSwapInt16BigToHost(*hotSpotData++);
		hotSpot.x = CFSwapInt16BigToHost(*hotSpotData);
		haveHotSpot = 1;







>







308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
		}
		if (colorspace) {
		    CFRelease(colorspace);
		}
		if (bitmapImageRep) {
		    image = [[NSImage alloc] initWithSize:NSMakeSize(pix, pix)];
		    [image addRepresentation:bitmapImageRep];
		    [image setTemplate:YES];
		    [bitmapImageRep release];
		}

		uint16_t *hotSpotData = (uint16_t*)(bitmap + 2*pix*pix/8);
		hotSpot.y = CFSwapInt16BigToHost(*hotSpotData++);
		hotSpot.x = CFSwapInt16BigToHost(*hotSpotData);
		haveHotSpot = 1;

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

148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
test font-4.12 {font command: actual} -body {
    font actual {-family times} -- \ud800
} -match glob -result {*}
test font-4.13 {font command: actual} -body {
    font actual {-family times} -- \udc00
} -match glob -result {*}
test font-4.14 {font command: actual} -constraints win -body {
    font actual {-family times} -family -- \ud800\udc00
} -result {Times New Roman}
test font-4.15 {font command: actual} -body {
    font actual {-family times} -- \udc00\ud800
} -returnCodes 1 -match glob -result {expected a single character but got "*"}


test font-5.1 {font command: configure} -body {







|







148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
test font-4.12 {font command: actual} -body {
    font actual {-family times} -- \ud800
} -match glob -result {*}
test font-4.13 {font command: actual} -body {
    font actual {-family times} -- \udc00
} -match glob -result {*}
test font-4.14 {font command: actual} -constraints win -body {
    font actual {-family times} -family -- \uD800\uDC00
} -result {Times New Roman}
test font-4.15 {font command: actual} -body {
    font actual {-family times} -- \udc00\ud800
} -returnCodes 1 -match glob -result {expected a single character but got "*"}


test font-5.1 {font command: configure} -body {

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

132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
     * XParseColor for non-# names: this saves a server round-trip for those
     * names.
     */

    if (*name != '#') {
	XColor screen;

	if (((*name - 'A') & 0xdf) < sizeof(tkWebColors)/sizeof(tkWebColors[0])) {
	    if (!((name[0] - 'G') & 0xdf) && !((name[1] - 'R') & 0xdf)
		    && !((name[2] - 'A') & 0xdb) && !((name[3] - 'Y') & 0xdf)
		    && !name[4]) {
		name = "#808080808080";
		goto gotWebColor;
	    } else {
		const char *p = tkWebColors[((*name - 'A') & 0x1f)];
		if (p) {
		    const char *q = name;
		    while (!((*p - *(++q)) & 0xdf)) {
			if (!*p++) {
			    name = p;
			    goto gotWebColor;
			}
		    }
		}
	}







|
|
|




|


|







132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
     * XParseColor for non-# names: this saves a server round-trip for those
     * names.
     */

    if (*name != '#') {
	XColor screen;

	if (((*name - 'A') & 0xDF) < sizeof(tkWebColors)/sizeof(tkWebColors[0])) {
	    if (!((name[0] - 'G') & 0xDF) && !((name[1] - 'R') & 0xDF)
		    && !((name[2] - 'A') & 0xDB) && !((name[3] - 'Y') & 0xDF)
		    && !name[4]) {
		name = "#808080808080";
		goto gotWebColor;
	    } else {
		const char *p = tkWebColors[((*name - 'A') & 0x1F)];
		if (p) {
		    const char *q = name;
		    while (!((*p - *(++q)) & 0xDF)) {
			if (!*p++) {
			    name = p;
			    goto gotWebColor;
			}
		    }
		}
	}

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

63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
...
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
...
437
438
439
440
441
442
443
444
445
446
447
448
449
450








451
452
453
454
455
456
457
...
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615

    int isTwoByteFont;		/* 1 if this is a double-byte font, 0
				 * otherwise. */
    char *fontMap[FONTMAP_PAGES];
				/* Two-level sparse table used to determine
				 * quickly if the specified character exists.
				 * As characters are encountered, more pages
				 * in this table are dynamically alloced. The
				 * contents of each page is a bitmask
				 * consisting of FONTMAP_BITSPERPAGE bits,
				 * representing whether this font can be used
				 * to display the given character at the
				 * corresponding bit position. The high bits
				 * of the character are used to pick which
				 * page of the table is used. */
................................................................................
static Tcl_ThreadDataKey dataKey;

/*
 * The set of builtin encoding alises to convert the XLFD names for the
 * encodings into the names expected by the Tcl encoding package.
 */

static EncodingAlias encodingAliases[] = {
    {"gb2312-raw",	"gb2312*"},
    {"big5",		"big5*"},
    {"cns11643-1",	"cns11643*-1"},
    {"cns11643-1",	"cns11643*.1-0"},
    {"cns11643-2",	"cns11643*-2"},
    {"cns11643-2",	"cns11643*.2-0"},
    {"jis0201",		"jisx0201*"},
................................................................................
	    dst[1] = mapChars[ch];
	    dst += 2;
	} else if (ch < 256) {
	    dst[1] = 'x';
	    dst[2] = hexChars[(ch >> 4) & 0xf];
	    dst[3] = hexChars[ch & 0xf];
	    dst += 4;
	} else {
	    dst[1] = 'u';
	    dst[2] = hexChars[(ch >> 12) & 0xf];
	    dst[3] = hexChars[(ch >> 8) & 0xf];
	    dst[4] = hexChars[(ch >> 4) & 0xf];
	    dst[5] = hexChars[ch & 0xf];
	    dst += 6;








	}
    }
    *srcReadPtr = src - srcStart;
    *dstWrotePtr = dst - dstStart;
    *dstCharsPtr = dst - dstStart;
    return result;
}
................................................................................
    result = TCL_OK;
    for (numChars = 0; src < srcEnd; numChars++) {
	if ((src > srcClose) && (!Tcl_UtfCharComplete(src, srcEnd - src))) {
	    /*
	     * If there is more string to follow, this will ensure that the
	     * last UTF-8 character in the source buffer hasn't been cut off.
	     */

	    result = TCL_CONVERT_MULTIBYTE;
	    break;
	}
	if (dst > dstEnd) {
	    result = TCL_CONVERT_NOSPACE;
	    break;
        }







|







 







|







 







|






>
>
>
>
>
>
>
>







 







<







63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
...
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
...
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
...
609
610
611
612
613
614
615

616
617
618
619
620
621
622

    int isTwoByteFont;		/* 1 if this is a double-byte font, 0
				 * otherwise. */
    char *fontMap[FONTMAP_PAGES];
				/* Two-level sparse table used to determine
				 * quickly if the specified character exists.
				 * As characters are encountered, more pages
				 * in this table are dynamically allocated. The
				 * contents of each page is a bitmask
				 * consisting of FONTMAP_BITSPERPAGE bits,
				 * representing whether this font can be used
				 * to display the given character at the
				 * corresponding bit position. The high bits
				 * of the character are used to pick which
				 * page of the table is used. */
................................................................................
static Tcl_ThreadDataKey dataKey;

/*
 * The set of builtin encoding alises to convert the XLFD names for the
 * encodings into the names expected by the Tcl encoding package.
 */

static const EncodingAlias encodingAliases[] = {
    {"gb2312-raw",	"gb2312*"},
    {"big5",		"big5*"},
    {"cns11643-1",	"cns11643*-1"},
    {"cns11643-1",	"cns11643*.1-0"},
    {"cns11643-2",	"cns11643*-2"},
    {"cns11643-2",	"cns11643*.2-0"},
    {"jis0201",		"jisx0201*"},
................................................................................
	    dst[1] = mapChars[ch];
	    dst += 2;
	} else if (ch < 256) {
	    dst[1] = 'x';
	    dst[2] = hexChars[(ch >> 4) & 0xf];
	    dst[3] = hexChars[ch & 0xf];
	    dst += 4;
	} else if (ch < 0x10000) {
	    dst[1] = 'u';
	    dst[2] = hexChars[(ch >> 12) & 0xf];
	    dst[3] = hexChars[(ch >> 8) & 0xf];
	    dst[4] = hexChars[(ch >> 4) & 0xf];
	    dst[5] = hexChars[ch & 0xf];
	    dst += 6;
	} else {
	    /* TODO we can do better here */
	    dst[1] = 'u';
	    dst[2] = 'f';
	    dst[3] = 'f';
	    dst[4] = 'f';
	    dst[5] = 'd';
	    dst += 6;
	}
    }
    *srcReadPtr = src - srcStart;
    *dstWrotePtr = dst - dstStart;
    *dstCharsPtr = dst - dstStart;
    return result;
}
................................................................................
    result = TCL_OK;
    for (numChars = 0; src < srcEnd; numChars++) {
	if ((src > srcClose) && (!Tcl_UtfCharComplete(src, srcEnd - src))) {
	    /*
	     * If there is more string to follow, this will ensure that the
	     * last UTF-8 character in the source buffer hasn't been cut off.
	     */

	    result = TCL_CONVERT_MULTIBYTE;
	    break;
	}
	if (dst > dstEnd) {
	    result = TCL_CONVERT_NOSPACE;
	    break;
        }

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

1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
    if (menuPtr->numEntries == 0) {
	height = 0;
    } else {
	int borderWidth;

	maxWindowWidth = Tk_Width(menuPtr->tkwin);
	if (maxWindowWidth == 1) {
	    maxWindowWidth = 0x7ffffff;
	}
	currentRowHeight = 0;
	Tk_GetPixelsFromObj(NULL, menuPtr->tkwin, menuPtr->borderWidthPtr,
		&borderWidth);
	x = y = borderWidth;
	lastRowBreak = 0;








|







1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
    if (menuPtr->numEntries == 0) {
	height = 0;
    } else {
	int borderWidth;

	maxWindowWidth = Tk_Width(menuPtr->tkwin);
	if (maxWindowWidth == 1) {
	    maxWindowWidth = 0x7FFFFFF;
	}
	currentRowHeight = 0;
	Tk_GetPixelsFromObj(NULL, menuPtr->tkwin, menuPtr->borderWidthPtr,
		&borderWidth);
	x = y = borderWidth;
	lastRowBreak = 0;

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

826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
     */
    xcolor.pixel = pixel;
    XQueryColor(display, DefaultColormap(display, fontPtr->screen), &xcolor);

    fontPtr->colors[last].color.color.red = xcolor.red;
    fontPtr->colors[last].color.color.green = xcolor.green;
    fontPtr->colors[last].color.color.blue = xcolor.blue;
    fontPtr->colors[last].color.color.alpha = 0xffff;
    fontPtr->colors[last].color.pixel = pixel;

    /*
     * Put at the front of the list.
     */
    if (last2 >= 0) {
	fontPtr->colors[last2].next = fontPtr->colors[last].next;







|







826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
     */
    xcolor.pixel = pixel;
    XQueryColor(display, DefaultColormap(display, fontPtr->screen), &xcolor);

    fontPtr->colors[last].color.color.red = xcolor.red;
    fontPtr->colors[last].color.color.green = xcolor.green;
    fontPtr->colors[last].color.color.blue = xcolor.blue;
    fontPtr->colors[last].color.color.alpha = 0xFFFF;
    fontPtr->colors[last].color.pixel = pixel;

    /*
     * Put at the front of the list.
     */
    if (last2 >= 0) {
	fontPtr->colors[last2].next = fontPtr->colors[last].next;