Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Changes In Branch bug-00a27923ee Excluding Merge-Ins
This is equivalent to a diff from 8acca87b to 373e2f4f
2018-01-16
| ||
16:27 | Make Tk 8.6 loadable in a TIP #484-enhanced Tcl 8.7. Backported from trunk. check-in: 93487383 user: jan.nijtmans tags: core-8-6-branch | |
2018-01-14
| ||
15:18 | Take some proposals from kjnash in [b68710aed6], namely 1. Add test of -state normal to <Meta-d>, and 2. Don't add autoseparators when doing <<Cut>> if the widget is disabled and the operation is therefore only a <<Copy>>. check-in: b3f05000 user: fvogel tags: bug-b68710aed6 | |
14:54 | Fix [1821174fff] and [1938774fff]: RenderBadPicture (invalid Picture parameter) error returned on application exit when 'send' was renamed to {}. Patch from Christian Werner. check-in: a597a915 user: fvogel tags: bug-1938774fff, bug-1821174fff | |
2018-01-13
| ||
13:50 | Fix [657c389120] and [b4214b4712]: Segfault when destroying menu with checkbutton entry Closed-Leaf check-in: 95cf2308 user: fvogel tags: bug-b4214b4712, bug-657c389120 | |
2018-01-10
| ||
20:45 | Fix [382712ade6]: X11: 'event generate . <KeyPress>' segfaults. Patch from Christian Werner. check-in: 2f691822 user: fvogel tags: bug-382712ade6 | |
2018-01-09
| ||
15:18 | Always reserve 4 bytes for UTF-8 character storage: It might be that Tk is compiled with TCL_UTF_MAX=3, but running in Tcl 8.7 with TIP #389 (TCL_UTF_MAX=3). Leaf check-in: 373e2f4f user: jan.nijtmans tags: bug-00a27923ee | |
2018-01-08
| ||
11:22 | merge core-8-6-branch check-in: 06baa487 user: jan.nijtmans tags: trunk | |
10:12 | Some fixes for TCL_UTF_MAX == 4. Looks OK for other values of TCL_UTF_MAX. check-in: abd40ee6 user: jan.nijtmans tags: bug-00a27923ee | |
09:12 | merge core-8-6-branch check-in: 72b54f9a user: jan.nijtmans tags: bug-00a27923ee | |
09:03 | Some code cleanup, suggested by Christian Werner. Cherry-picked from bug-00a27923ee branch. check-in: 8acca87b user: jan.nijtmans tags: core-8-6-branch | |
2018-01-07
| ||
15:42 | Complement fix for [84af709826] about alphabetical order of the widget-specific options of ttk:spinbox. check-in: 72cf11e4 user: fvogel tags: core-8-6-branch | |
Changes to generic/tkSelect.c.
︙ | ︙ | |||
22 23 24 25 26 27 28 | typedef struct { Tcl_Interp *interp; /* Interpreter in which to invoke command. */ int cmdLength; /* # of non-NULL bytes in command. */ int charOffset; /* The offset of the next char to retrieve. */ int byteOffset; /* The expected byte offset of the next * chunk. */ | | | 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | typedef struct { Tcl_Interp *interp; /* Interpreter in which to invoke command. */ int cmdLength; /* # of non-NULL bytes in command. */ int charOffset; /* The offset of the next char to retrieve. */ int byteOffset; /* The expected byte offset of the next * chunk. */ char buffer[4]; /* A buffer to hold part of a UTF character * that is split across chunks. */ char command[1]; /* Command to invoke. Actual space is * allocated as large as necessary. This must * be the last entry in the structure. */ } CommandInfo; /* |
︙ | ︙ |
Changes to generic/tkUtil.c.
︙ | ︙ | |||
1183 1184 1185 1186 1187 1188 1189 | event.general.xany.type = VirtualEvent; event.general.xany.serial = NextRequest(Tk_Display(target)); event.general.xany.send_event = False; event.general.xany.window = Tk_WindowId(target); event.general.xany.display = Tk_Display(target); event.virtual.name = Tk_GetUid(eventName); if (detail != NULL) { | | | 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 | event.general.xany.type = VirtualEvent; event.general.xany.serial = NextRequest(Tk_Display(target)); event.general.xany.send_event = False; event.general.xany.window = Tk_WindowId(target); event.general.xany.display = Tk_Display(target); event.virtual.name = Tk_GetUid(eventName); if (detail != NULL) { event.virtual.user_data = detail; } Tk_QueueWindowEvent(&event.general, TCL_QUEUE_TAIL); } #if TCL_UTF_MAX <= 4 /* |
︙ | ︙ |
Changes to macosx/tkMacOSXClipboard.c.
︙ | ︙ | |||
24 25 26 27 28 29 30 31 32 33 34 35 36 | pasteboard: (NSPasteboard *) sender provideDataForType: (NSString *) type { NSMutableString *string = [NSMutableString new]; if (dispPtr && dispPtr->clipboardActive && [type isEqualToString:NSStringPboardType]) { for (TkClipboardTarget *targetPtr = dispPtr->clipTargetPtr; targetPtr; targetPtr = targetPtr->nextPtr) { if (targetPtr->type == XA_STRING || targetPtr->type == dispPtr->utf8Atom) { for (TkClipboardBuffer *cbPtr = targetPtr->firstBufferPtr; cbPtr; cbPtr = cbPtr->nextPtr) { | > > > > > > > | | > | | > > > > | 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 | pasteboard: (NSPasteboard *) sender provideDataForType: (NSString *) type { NSMutableString *string = [NSMutableString new]; if (dispPtr && dispPtr->clipboardActive && [type isEqualToString:NSStringPboardType]) { Tcl_Encoding utf8 = Tcl_GetEncoding(NULL, "utf-8"); Tcl_DString ds; Tcl_DStringInit(&ds); for (TkClipboardTarget *targetPtr = dispPtr->clipTargetPtr; targetPtr; targetPtr = targetPtr->nextPtr) { if (targetPtr->type == XA_STRING || targetPtr->type == dispPtr->utf8Atom) { for (TkClipboardBuffer *cbPtr = targetPtr->firstBufferPtr; cbPtr; cbPtr = cbPtr->nextPtr) { char *p = Tcl_UtfToExternalDString(utf8, cbPtr->buffer, cbPtr->length, &ds); int len = Tcl_DStringLength(&ds); NSString *s = [[NSString alloc] initWithBytesNoCopy:p length:len encoding:NSUTF8StringEncoding freeWhenDone:NO]; if (s) { [string appendString:s]; [s release]; } Tcl_DStringSetLength(&ds, 0); } break; } } Tcl_DStringFree(&ds); Tcl_FreeEncoding(utf8); } [sender setString:string forType:type]; [string release]; } - (void) tkProvidePasteboard: (TkDisplay *) dispPtr { |
︙ | ︙ | |||
127 128 129 130 131 132 133 134 135 136 137 | if (dispPtr && selection == dispPtr->clipboardAtom && (target == XA_STRING || target == dispPtr->utf8Atom)) { NSString *string = nil; NSPasteboard *pb = [NSPasteboard generalPasteboard]; NSString *type = [pb availableTypeFromArray:[NSArray arrayWithObject: NSStringPboardType]]; if (type) { string = [pb stringForType:type]; } | > > > > > > > > | > | 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 | if (dispPtr && selection == dispPtr->clipboardAtom && (target == XA_STRING || target == dispPtr->utf8Atom)) { NSString *string = nil; NSPasteboard *pb = [NSPasteboard generalPasteboard]; NSString *type = [pb availableTypeFromArray:[NSArray arrayWithObject: NSStringPboardType]]; Tcl_DString ds; if (type) { string = [pb stringForType:type]; } Tcl_DStringInit(&ds); if (string) { Tcl_Encoding utf8 = Tcl_GetEncoding(NULL, "utf-8"); Tcl_ExternalToUtfDString(utf8, [string UTF8String], -1, &ds); Tcl_FreeEncoding(utf8); } result = proc(clientData, interp, Tcl_DStringValue(&ds)); Tcl_DStringFree(&ds); } else { Tcl_SetObjResult(interp, Tcl_ObjPrintf( "%s selection doesn't exist or form \"%s\" not defined", Tk_GetAtomName(tkwin, selection), Tk_GetAtomName(tkwin, target))); Tcl_SetErrorCode(interp, "TK", "SELECTION", "EXISTS", NULL); } |
︙ | ︙ |
Changes to macosx/tkMacOSXFont.c.
︙ | ︙ | |||
115 116 117 118 119 120 121 122 123 124 125 126 127 128 | #define GetNSFontTraitsFromTkFontAttributes(faPtr) \ ((faPtr)->weight == TK_FW_BOLD ? NSBoldFontMask : NSUnboldFontMask) | \ ((faPtr)->slant == TK_FS_ITALIC ? NSItalicFontMask : NSUnitalicFontMask) /* *--------------------------------------------------------------------------- * * GetTkFontAttributesForNSFont -- * * Fill in TkFontAttributes for given NSFont. * * Results: * None. * | > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > | 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 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 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 | #define GetNSFontTraitsFromTkFontAttributes(faPtr) \ ((faPtr)->weight == TK_FW_BOLD ? NSBoldFontMask : NSUnboldFontMask) | \ ((faPtr)->slant == TK_FS_ITALIC ? NSItalicFontMask : NSUnitalicFontMask) /* *--------------------------------------------------------------------------- * * NumUTF16Chars -- * * Like Tcl_NumUtfChars() but result is count of UTF16Chars, * i.e. a surrogate pair counts as two UTF16Chars and not * as a single entity. * * Results: * As above. * * Side effects: * None. * *--------------------------------------------------------------------------- */ #if TCL_UTF_MAX <= 4 /* No special code for BMP needed. */ #define NumUTF16Chars Tcl_NumUtfChars #else static int NumUTF16Chars( const char *src, /* The UTF-8 string to measure. */ int length) /* The length of the string in bytes, or -1 * for strlen(string). */ { Tcl_UniChar ch = 0; int i = 0; if (length < 0) { while (*src != '\0') { src += Tcl_UtfToUniChar(src, &ch); if (ch > 0xFFFF) { /* A surrogate pair in UTF16Char representation. */ i++; } i++; } if (i < 0) { i = INT_MAX; } } else { const char *endPtr = src + length - 4; while (src < endPtr) { src += Tcl_UtfToUniChar(src, &ch); if (ch > 0xFFFF) { /* A surrogate pair in UTF16Char representation. */ i++; } i++; } endPtr += 4; while ((src < endPtr) && Tcl_UtfCharComplete(src, endPtr - src)) { src += Tcl_UtfToUniChar(src, &ch); if (ch > 0xFFFF) { /* A surrogate pair in UTF16Char representation. */ i++; } i++; } if (src < endPtr) { i += endPtr - src; } } return i; } #endif /* *--------------------------------------------------------------------------- * * UTF16CharAtIndex * * Like Tcl_UtfAtIndex() but counting in UTF16Char entities. * Returns a pointer to the specified character position in * the given UTF-8 string. * * Results: * As above. * * Side effects: * None. * *--------------------------------------------------------------------------- */ #if TCL_UTF_MAX <= 4 /* No special code for BMP needed. */ #define UTF16CharAtIndex Tcl_UtfAtIndex #else static const char * UTF16CharAtIndex( const char *src, /* The UTF-8 string. */ int index) /* The position of the desired character. */ { Tcl_UniChar ch = 0; while (index > 0) { --index; src += Tcl_UtfToUniChar(src, &ch); if (ch > 0xFFFF) { /* A surrogate pair in UTF16Char representation. */ --index; } } return src; } #endif /* *--------------------------------------------------------------------------- * * UtfToUTF16DString -- * * Convert an UTF-8 string to an UTF16Char string using the provided * Tcl_DString as result buffer. Invalid data is silently replaced * with "\uFFFD". The Tcl_DString is initialized by this function * and must be free'd by the caller. * * Results: * Pointer to UTF16Char string. * * Side effects: * None. * *--------------------------------------------------------------------------- */ static UTF16Char * UtfToUTF16DString( const char *src, /* Input UTF-8 string to be converted. * Need not be '\0' terminated. */ int numBytes, /* Maximum number of bytes to consider from * source string in all. */ Tcl_DString *dsPtr, /* Tcl_DString receiving the result. */ int *lengthPtr) /* Number of UTF16Chars in result buffer. */ { Tcl_UniChar ch = 0; UTF16Char utf16; const char *end; Tcl_DStringInit(dsPtr); if (numBytes > 0) { Tcl_DStringSetLength(dsPtr, numBytes * sizeof(utf16)); Tcl_DStringSetLength(dsPtr, 0); } end = src + numBytes; while (src < end) { int len = Tcl_UtfToUniChar(src, &ch); utf16 = (UTF16Char)ch; #if TCL_UTF_MAX > 4 if (ch >= 0xD800 && ch <= 0xDFFF) { utf16 = 0xFFFD; } else if (ch > 0xFFFF) { utf16 = (((ch - 0x10000) >> 10) & 0x3FF) | 0xD800; Tcl_DStringAppend(dsPtr, (char *) &utf16, sizeof(utf16)); utf16 = ((ch - 0x10000) & 0x3FF) | 0xDC00; } #endif Tcl_DStringAppend(dsPtr, (char *) &utf16, sizeof(utf16)); src += len; } *lengthPtr = Tcl_DStringLength(dsPtr) / sizeof(utf16); return (UTF16Char *) Tcl_DStringValue(dsPtr); } /* *--------------------------------------------------------------------------- * * GetTkFontAttributesForNSFont -- * * Fill in TkFontAttributes for given NSFont. * * Results: * None. * |
︙ | ︙ | |||
675 676 677 678 679 680 681 | int c, /* Character of interest */ TkFontAttributes* faPtr) /* Output: Font attributes */ { MacFont *fontPtr = (MacFont *) tkfont; NSFont *nsFont = fontPtr->nsFont; *faPtr = fontPtr->font.fa; if (nsFont && ![[nsFont coveredCharacterSet] characterIsMember:c]) { | | > > > | > > > > | > | 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 | int c, /* Character of interest */ TkFontAttributes* faPtr) /* Output: Font attributes */ { MacFont *fontPtr = (MacFont *) tkfont; NSFont *nsFont = fontPtr->nsFont; *faPtr = fontPtr->font.fa; if (nsFont && ![[nsFont coveredCharacterSet] characterIsMember:c]) { UTF16Char ch[2]; if (c > 0xFFFF) { ch[0] = (((c - 0x10000) >> 10) & 0x3FF) | 0xD800; ch[1] = ((c - 0x10000) & 0x3FF) | 0xDC00; nsFont = [nsFont bestMatchingFontForCharacters:ch length:2 attributes:nil actualCoveredLength:NULL]; } else { ch[0] = (UTF16Char) c; nsFont = [nsFont bestMatchingFontForCharacters:ch length:1 attributes:nil actualCoveredLength:NULL]; } if (nsFont) { GetTkFontAttributesForNSFont(nsFont, faPtr); } } } #pragma mark - |
︙ | ︙ | |||
807 808 809 810 811 812 813 | CTTypesetterRef typesetter; CFIndex start, len; CFRange range = {0, 0}; CTLineRef line; CGFloat offset = 0; CFIndex index; double width; | | > > > | | | | | 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 | CTTypesetterRef typesetter; CFIndex start, len; CFRange range = {0, 0}; CTLineRef line; CGFloat offset = 0; CFIndex index; double width; int length, fit, utf16Len; UTF16Char *utf16String; Tcl_DString ds; if (rangeStart < 0 || rangeLength <= 0 || rangeStart + rangeLength > numBytes || (maxLength == 0 && !(flags & TK_AT_LEAST_ONE))) { *lengthPtr = 0; return 0; } if (maxLength > 32767) { maxLength = 32767; } utf16String = UtfToUTF16DString(source, numBytes, &ds, &utf16Len); string = [[NSString alloc] initWithCharactersNoCopy:(void*)utf16String length:utf16Len freeWhenDone:NO]; if (!string) { length = 0; fit = rangeLength; goto done; } attributedString = [[NSAttributedString alloc] initWithString:string attributes:fontPtr->nsAttributes]; typesetter = CTTypesetterCreateWithAttributedString( (CFAttributedStringRef)attributedString); start = NumUTF16Chars(source, rangeStart); len = NumUTF16Chars(source, rangeStart + rangeLength); if (start > 0) { range.length = start; line = CTTypesetterCreateLine(typesetter, range); offset = CTLineGetTypographicBounds(line, NULL, NULL, NULL); CFRelease(line); } if (maxLength < 0) { |
︙ | ︙ | |||
897 898 899 900 901 902 903 | } } CFRelease(typesetter); [attributedString release]; [string release]; length = ceil(width - offset); | | > | 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 | } } CFRelease(typesetter); [attributedString release]; [string release]; length = ceil(width - offset); fit = (UTF16CharAtIndex(source, index) - source) - rangeStart; done: Tcl_DStringFree(&ds); #ifdef TK_MAC_DEBUG_FONTS TkMacOSXDbgMsg("measure: source=\"%s\" range=\"%.*s\" maxLength=%d " "flags='%s%s%s%s' -> width=%d bytesFit=%d\n", source, rangeLength, source+rangeStart, maxLength, flags & TK_PARTIAL_OK ? "partialOk " : "", flags & TK_WHOLE_WORDS ? "wholeWords " : "", flags & TK_AT_LEAST_ONE ? "atLeastOne " : "", |
︙ | ︙ | |||
1057 1058 1059 1060 1061 1062 1063 | CTLineRef line; MacDrawable *macWin = (MacDrawable *) drawable; TkMacOSXDrawingContext drawingContext; CGContextRef context; CGColorRef fg; NSFont *nsFont; CGAffineTransform t; | | > > > | | > | 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 | CTLineRef line; MacDrawable *macWin = (MacDrawable *) drawable; TkMacOSXDrawingContext drawingContext; CGContextRef context; CGColorRef fg; NSFont *nsFont; CGAffineTransform t; int h, utf16Len; Tcl_DString ds; UTF16Char *utf16String; if (rangeStart < 0 || rangeLength <= 0 || rangeStart + rangeLength > numBytes || !TkMacOSXSetupDrawingContext(drawable, gc, 1, &drawingContext)) { return; } utf16String = UtfToUTF16DString(source, numBytes, &ds, &utf16Len); string = [[NSString alloc] initWithCharactersNoCopy:(void*)utf16String length:utf16Len freeWhenDone:NO]; if (!string) { Tcl_DStringFree(&ds); return; } context = drawingContext.context; fg = TkMacOSXCreateCGColor(gc, gc->foreground); attributes = [fontPtr->nsAttributes mutableCopy]; [attributes setObject:(id)fg forKey:(id)kCTForegroundColorAttributeName]; CFRelease(fg); |
︙ | ︙ | |||
1093 1094 1095 1096 1097 1098 1099 | t = CGAffineTransformMake(1.0, 0.0, 0.0, -1.0, 0.0, h); if (angle != 0.0) { t = CGAffineTransformTranslate(CGAffineTransformRotate( CGAffineTransformTranslate(t, x, y), angle*PI/180.0), -x, -y); } CGContextConcatCTM(context, t); CGContextSetTextPosition(context, x, y); | | | > | 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 | t = CGAffineTransformMake(1.0, 0.0, 0.0, -1.0, 0.0, h); if (angle != 0.0) { t = CGAffineTransformTranslate(CGAffineTransformRotate( CGAffineTransformTranslate(t, x, y), angle*PI/180.0), -x, -y); } CGContextConcatCTM(context, t); CGContextSetTextPosition(context, x, y); start = NumUTF16Chars(source, rangeStart); len = NumUTF16Chars(source, rangeStart + rangeLength); if (start > 0) { CGRect clipRect = CGRectInfinite, startBounds; line = CTTypesetterCreateLine(typesetter, CFRangeMake(0, start)); startBounds = CTLineGetImageBounds(line, context); CFRelease(line); clipRect.origin.x = startBounds.origin.x + startBounds.size.width; CGContextClipToRect(context, clipRect); } line = CTTypesetterCreateLine(typesetter, CFRangeMake(0, len)); CTLineDraw(line, context); CFRelease(line); CFRelease(typesetter); [attributedString release]; [string release]; [attributes release]; Tcl_DStringFree(&ds); TkMacOSXRestoreDrawingContext(&drawingContext); } #pragma mark - #pragma mark Accessors: /* |
︙ | ︙ |
Changes to unix/tkUnixFont.c.
︙ | ︙ | |||
517 518 519 520 521 522 523 | srcLen--; } srcStart = src; srcEnd = src + srcLen; dstStart = dst; | | | 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 | srcLen--; } srcStart = src; srcEnd = src + srcLen; dstStart = dst; dstEnd = dst + dstLen - 4; for (numChars = 0; src < srcEnd; numChars++) { if (dst > dstEnd) { result = TCL_CONVERT_NOSPACE; break; } |
︙ | ︙ | |||
592 593 594 595 596 597 598 | int result, numChars; Tcl_UniChar ch; srcStart = src; srcEnd = src + srcLen; srcClose = srcEnd; if (!(flags & TCL_ENCODING_END)) { | | | 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 | int result, numChars; Tcl_UniChar ch; srcStart = src; srcEnd = src + srcLen; srcClose = srcEnd; if (!(flags & TCL_ENCODING_END)) { srcClose -= 4; } dstStart = dst; dstEnd = dst + dstLen - 2 /* sizeof(UCS-2) */; result = TCL_OK; for (numChars = 0; src < srcEnd; numChars++) { |
︙ | ︙ | |||
2209 2210 2211 2212 2213 2214 2215 | static void FontMapLoadPage( SubFont *subFontPtr, /* Contains font mapping cache to be * updated. */ int row) /* Index of the page to be loaded into the * cache. */ { | | | 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 | static void FontMapLoadPage( SubFont *subFontPtr, /* Contains font mapping cache to be * updated. */ int row) /* Index of the page to be loaded into the * cache. */ { char buf[16], src[4]; int minHi, maxHi, minLo, maxLo, scale, checkLo; int i, end, bitOffset, isTwoByteFont, n; Tcl_Encoding encoding; XFontStruct *fontStructPtr; XCharStruct *widths; ThreadSpecificData *tsdPtr = Tcl_GetThreadData(&dataKey, sizeof(ThreadSpecificData)); |
︙ | ︙ | |||
2413 2414 2415 2416 2417 2418 2419 | { int i, nameIdx, numNames, srcLen, numEncodings, bestIdx[2]; Tk_Uid hateFoundry; const char *charset, *hateCharset; unsigned bestScore[2]; char **nameList; char **nameListOrig; | | | 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 | { int i, nameIdx, numNames, srcLen, numEncodings, bestIdx[2]; Tk_Uid hateFoundry; const char *charset, *hateCharset; unsigned bestScore[2]; char **nameList; char **nameListOrig; char src[4]; FontAttributes want, got; Display *display; SubFont subFont; XFontStruct *fontStructPtr; Tcl_DString dsEncodings; Tcl_Encoding *encodingCachePtr; |
︙ | ︙ |
Changes to unix/tkUnixSelect.c.
︙ | ︙ | |||
17 18 19 20 21 22 23 | * for the next chunk; -1 means all data has * been transferred for this conversion. -2 * means only the final zero-length transfer * still has to be done. Otherwise it is the * offset of the next chunk of data to * transfer. */ Tcl_EncodingState state; /* The encoding state needed across chunks. */ | | | 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | * for the next chunk; -1 means all data has * been transferred for this conversion. -2 * means only the final zero-length transfer * still has to be done. Otherwise it is the * offset of the next chunk of data to * transfer. */ Tcl_EncodingState state; /* The encoding state needed across chunks. */ char buffer[4]; /* A buffer to hold part of a UTF character * that is split across chunks.*/ } ConvertInfo; /* * When handling INCR-style selection retrievals, the selection owner uses the * following data structure to communicate between the ConvertSelection * function and TkSelPropProc. |
︙ | ︙ | |||
442 443 444 445 446 447 448 | (unsigned char *) Tcl_DStringValue(&ds), Tcl_DStringLength(&ds)); /* * Preserve any left-over bytes. */ | | | 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 | (unsigned char *) Tcl_DStringValue(&ds), Tcl_DStringLength(&ds)); /* * Preserve any left-over bytes. */ if (srcLen > 4) { Tcl_Panic("selection conversion left too many bytes unconverted"); } memcpy(incrPtr->converts[i].buffer, src, (size_t) srcLen+1); Tcl_DStringFree(&ds); } else { /* * Set the property to the encoded string value. |
︙ | ︙ |