Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Changes In Branch tip-706 Excluding Merge-Ins
This is equivalent to a diff from e78b5c12 to da1031ef
2024-12-08
| ||
16:31 | Merge tip-706 following positive vote by the TCT. check-in: b48a78fd user: fvogel tags: trunk, main | |
2024-12-03
| ||
04:01 | Fix [8ce672d1a1]: Segfault with Tk >= 8.6.14 when using menu(button) with the -font option in a certain way. Patch from Christian Werner. check-in: 8a271b85 user: fvogel tags: trunk, main | |
2024-11-30
| ||
16:57 | merge trunk Closed-Leaf check-in: da1031ef user: fvogel tags: tip-706 | |
16:56 | Provide a potential fallback for proc menubarheight. check-in: bf3a9da6 user: fvogel tags: revised_text, tip-466 | |
16:55 | Provide a potential fallback for proc menubarheight. check-in: e78b5c12 user: fvogel tags: trunk, main | |
16:21 | Let this TIP implementation branch build and test. check-in: 5b428e68 user: fvogel tags: tip-706 | |
2024-11-28
| ||
11:14 | Updated file changes.md. check-in: 90693341 user: csaba tags: trunk, main | |
Changes to .github/workflows/linux-build.yml.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | + | name: Linux on: push: branches: - "main" - "core-8-branch" - "core-8-6-branch" - "tip-706" tags: - "core-**" permissions: contents: read defaults: run: shell: bash |
︙ |
Changes to .github/workflows/mac-build.yml.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | + | name: macOS on: push: branches: - "main" - "core-8-branch" - "core-8-6-branch" - "tip-706" tags: - "core-**" permissions: contents: read env: ERROR_ON_FAILURES: 1 jobs: |
︙ |
Changes to .github/workflows/win-build.yml.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | + | name: Windows on: push: branches: - "main" - "core-8-branch" - "core-8-6-branch" - "tip-706" tags: - "core-**" permissions: contents: read env: ERROR_ON_FAILURES: 1 jobs: |
︙ |
Changes to doc/MeasureChar.3.
1 2 3 4 5 6 7 8 9 10 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | + - + + + + + + + + | '\" '\" Copyright (c) 1996 Sun Microsystems, Inc. '\" '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" .TH Tk_MeasureChars 3 8.1 Tk "Tk Library Procedures" .so man.macros .BS .SH NAME Tk_MeasureChars, Tk_MeasureCharsInContext, Tk_TextWidth, Tk_DrawChars, Tk_DrawCharsInContext, |
︙ | |||
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 | 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 | + + + + + + + | \fBTK_WHOLE_WORDS\fR means stop on a word boundary, if possible. If \fBTK_AT_LEAST_ONE\fR is set, it means return at least one character even if no characters could fit in the length given by \fImaxPixels\fR. If \fBTK_AT_LEAST_ONE\fR is set and \fBTK_WHOLE_WORDS\fR is also set, it means that if not even one word fits on the line, return the first few letters of the word that did fit; if not even one letter of the word fit, then the first letter will still be returned. \fBTK_ISOLATE_END\fR means that the last character should not be considered in context with the rest of the string (used for breaking lines, with the Tk_*InContext variants of the functions only). .AP int *lengthPtr out Filled with the number of pixels occupied by the number of characters returned as the result of \fBTk_MeasureChars\fR. .AP Display *display in Display on which to draw. .AP Drawable drawable in Window or pixmap in which to draw. .AP GC gc in Graphics context for drawing characters. The font selected into this GC must be the same as the \fItkfont\fR. .AP int "x, y" in Coordinates at which to place the left edge of the baseline when displaying \fIstring\fR. .AP int firstByte in The index of the first byte of the first character to underline in the \fIstring\fR. Underlining begins at the left edge of this character. .AP int lastByte in The index of the first byte of the last character up to which the underline will be drawn. The character specified by \fIlastByte\fR will not itself be underlined. .AP Tcl_Size rangeStart in Index of first byte to draw or to measure. .AP Tcl_Size rangeLength in Length of range to draw or to measure, in bytes. .BE .SH DESCRIPTION .PP These routines are for measuring and displaying simple single-font, single-line strings. To measure and display single-font, multi-line, justified text, refer to the documentation for \fBTk_ComputeTextLayout\fR. There is no programming interface in the core of Tk that supports |
︙ | |||
117 118 119 120 121 122 123 124 125 126 127 | 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 | + + + + + + + | .PP \fBTk_UnderlineChars\fR underlines the given range of characters in the given \fIstring\fR. It does not draw the characters (which are assumed to have been displayed previously by \fBTk_DrawChars\fR); it just draws the underline. This procedure is used to underline a few characters without having to construct an underlined font. To produce natively underlined text, the appropriate underlined font should be constructed and used. .PP \fBTk_MeasureCharsInContext\fR, \fBTk_DrawCharsInContext\fR, \fBTk_UnderlineCharsInContext\fR are variants of respectively \fBTk_MeasureChars\fR, \fBTk_DrawChars\fR and \fBTk_UnderlineChars\fR, but with access to all the characters on the line for context. Except on macOS, this context isn't actually consulted (meaning the out of context variants are called). .SH "SEE ALSO" font(n), FontId(3) .SH KEYWORDS font, measurement |
Changes to generic/tk.decls.
︙ | |||
1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 | 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 | + + + + + + + + + + + + + + + + + + + + | declare 289 { void Tk_Get3DBorderColors(Tk_3DBorder border, XColor *bgColorPtr, XColor *darkColorPtr, XColor *lightColorPtr) } declare 290 { Window Tk_MakeWindow(Tk_Window tkwin, Window parent) } # TIP#706 declare 291 { void Tk_UnderlineCharsInContext(Display *display, Drawable drawable, GC gc, Tk_Font tkfont, const char *string, Tcl_Size numBytes, int x, int y, Tcl_Size firstByte, Tcl_Size lastByte) } declare 292 { void Tk_DrawCharsInContext(Display * display, Drawable drawable, GC gc, Tk_Font tkfont, const char *string, Tcl_Size numBytes, Tcl_Size rangeStart, Tcl_Size rangeLength, int x, int y) } declare 293 { int Tk_MeasureCharsInContext(Tk_Font tkfont, const char *string, Tcl_Size numBytes, Tcl_Size rangeStart, Tcl_Size rangeLength, int maxPixels, int flags, int *lengthPtr) } # Define the platform specific public Tk interface. These functions are # only available on the designated platform. interface tkPlat |
︙ |
Changes to generic/tk.h.
︙ | |||
559 560 561 562 563 564 565 566 567 568 569 570 571 572 | 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 | + | /* * Flags passed to Tk_MeasureChars: */ #define TK_WHOLE_WORDS 1 #define TK_AT_LEAST_ONE 2 #define TK_PARTIAL_OK 4 #define TK_ISOLATE_END 32 /* * Flags passed to Tk_ComputeTextLayout: */ #define TK_IGNORE_TABS 8 #define TK_IGNORE_NEWLINES 16 |
︙ |
Changes to generic/tkDecls.h.
︙ | |||
884 885 886 887 888 889 890 891 892 893 894 895 896 897 | 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 | + + + + + + + + + + + + + + + + | EXTERN Tk_Window Tk_GetOtherWindow(Tk_Window tkwin); /* 289 */ EXTERN void Tk_Get3DBorderColors(Tk_3DBorder border, XColor *bgColorPtr, XColor *darkColorPtr, XColor *lightColorPtr); /* 290 */ EXTERN Window Tk_MakeWindow(Tk_Window tkwin, Window parent); /* 291 */ EXTERN void Tk_UnderlineCharsInContext(Display *display, Drawable drawable, GC gc, Tk_Font tkfont, const char *string, Tcl_Size numBytes, int x, int y, Tcl_Size firstByte, Tcl_Size lastByte); /* 292 */ EXTERN void Tk_DrawCharsInContext(Display *display, Drawable drawable, GC gc, Tk_Font tkfont, const char *string, Tcl_Size numBytes, Tcl_Size rangeStart, Tcl_Size rangeLength, int x, int y); /* 293 */ EXTERN int Tk_MeasureCharsInContext(Tk_Font tkfont, const char *string, Tcl_Size numBytes, Tcl_Size rangeStart, Tcl_Size rangeLength, int maxPixels, int flags, int *lengthPtr); typedef struct { const struct TkPlatStubs *tkPlatStubs; const struct TkIntStubs *tkIntStubs; const struct TkIntPlatStubs *tkIntPlatStubs; const struct TkIntXlibStubs *tkIntXlibStubs; } TkStubHooks; |
︙ | |||
1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 | 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 | + + + | void (*tk_ClipDrawableToRect) (Display *display, Drawable d, int x, int y, int width, int height); /* 284 */ Tcl_Obj * (*tk_GetSystemDefault) (Tk_Window tkwin, const char *dbName, const char *className); /* 285 */ int (*tk_UseWindow) (Tcl_Interp *interp, Tk_Window tkwin, const char *string); /* 286 */ void (*tk_MakeContainer) (Tk_Window tkwin); /* 287 */ Tk_Window (*tk_GetOtherWindow) (Tk_Window tkwin); /* 288 */ void (*tk_Get3DBorderColors) (Tk_3DBorder border, XColor *bgColorPtr, XColor *darkColorPtr, XColor *lightColorPtr); /* 289 */ Window (*tk_MakeWindow) (Tk_Window tkwin, Window parent); /* 290 */ void (*tk_UnderlineCharsInContext) (Display *display, Drawable drawable, GC gc, Tk_Font tkfont, const char *string, Tcl_Size numBytes, int x, int y, Tcl_Size firstByte, Tcl_Size lastByte); /* 291 */ void (*tk_DrawCharsInContext) (Display *display, Drawable drawable, GC gc, Tk_Font tkfont, const char *string, Tcl_Size numBytes, Tcl_Size rangeStart, Tcl_Size rangeLength, int x, int y); /* 292 */ int (*tk_MeasureCharsInContext) (Tk_Font tkfont, const char *string, Tcl_Size numBytes, Tcl_Size rangeStart, Tcl_Size rangeLength, int maxPixels, int flags, int *lengthPtr); /* 293 */ } TkStubs; extern const TkStubs *tkStubsPtr; #ifdef __cplusplus } #endif |
︙ | |||
1766 1767 1768 1769 1770 1771 1772 1773 1774 1775 1776 1777 1778 1779 | 1785 1786 1787 1788 1789 1790 1791 1792 1793 1794 1795 1796 1797 1798 1799 1800 1801 1802 1803 1804 | + + + + + + | (tkStubsPtr->tk_MakeContainer) /* 287 */ #define Tk_GetOtherWindow \ (tkStubsPtr->tk_GetOtherWindow) /* 288 */ #define Tk_Get3DBorderColors \ (tkStubsPtr->tk_Get3DBorderColors) /* 289 */ #define Tk_MakeWindow \ (tkStubsPtr->tk_MakeWindow) /* 290 */ #define Tk_UnderlineCharsInContext \ (tkStubsPtr->tk_UnderlineCharsInContext) /* 291 */ #define Tk_DrawCharsInContext \ (tkStubsPtr->tk_DrawCharsInContext) /* 292 */ #define Tk_MeasureCharsInContext \ (tkStubsPtr->tk_MeasureCharsInContext) /* 293 */ #endif /* defined(USE_TK_STUBS) */ /* !END!: Do not edit above this line. */ #define Tk_GetImageMasterData Tk_GetImageModelData |
︙ |
Changes to generic/tkFont.c.
︙ | |||
1851 1852 1853 1854 1855 1856 1857 | 1851 1852 1853 1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 | - + | Tk_MeasureChars(tkfont, string, numBytes, -1, 0, &width); return width; } /* *--------------------------------------------------------------------------- * |
︙ | |||
1887 1888 1889 1890 1891 1892 1893 | 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 1898 1899 1900 1901 1902 1903 1904 1905 1906 1907 1908 1909 1910 1911 1912 1913 1914 1915 1916 1917 1918 1919 1920 1921 1922 1923 1924 1925 1926 1927 1928 | - + - + - + - + | * underlined or overstruck. */ int x, int y, /* Coordinates at which first character of * string is drawn. */ Tcl_Size firstByte, /* Index of first byte of first character. */ Tcl_Size lastByte) /* Index of first byte after the last * character. */ { |
︙ | |||
2338 2339 2340 2341 2342 2343 2344 | 2338 2339 2340 2341 2342 2343 2344 2345 2346 2347 2348 2349 2350 2351 2352 | - + | firstByte - chunkPtr->start, -1, 0, &drawX); } if (lastChar < numDisplayChars) { numDisplayChars = lastChar; } lastByte = Tcl_UtfAtIndex(chunkPtr->start, numDisplayChars); #ifdef TK_DRAW_IN_CONTEXT |
︙ | |||
2411 2412 2413 2414 2415 2416 2417 | 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 | - + | numDisplayChars = lastChar; } lastByte = Tcl_UtfAtIndex(chunkPtr->start, numDisplayChars); #ifdef TK_DRAW_IN_CONTEXT dx = cosA * (chunkPtr->x) + sinA * (chunkPtr->y); dy = -sinA * (chunkPtr->x) + cosA * (chunkPtr->y); if (angle == 0.0) { |
︙ |
Changes to generic/tkInt.h.
︙ | |||
987 988 989 990 991 992 993 | 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 | - - - - - - - - | */ #define TK_GRAB_NONE 0 #define TK_GRAB_IN_TREE 1 #define TK_GRAB_ANCESTOR 2 #define TK_GRAB_EXCLUDED 3 |
︙ | |||
1232 1233 1234 1235 1236 1237 1238 | 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 | - - - - - - - - - - - - | MODULE_SCOPE void TkAppendPadAmount(Tcl_Obj *bufferObj, const char *buffer, int pad1, int pad2); MODULE_SCOPE int TkParsePadAmount(Tcl_Interp *interp, Tk_Window tkwin, Tcl_Obj *objPtr, int *pad1Ptr, int *pad2Ptr); MODULE_SCOPE void TkFocusSplit(TkWindow *winPtr); MODULE_SCOPE void TkFocusJoin(TkWindow *winPtr); |
︙ |
Changes to generic/tkStubInit.c.
︙ | |||
1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 | 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 | + + + | Tk_ClipDrawableToRect, /* 284 */ Tk_GetSystemDefault, /* 285 */ Tk_UseWindow, /* 286 */ Tk_MakeContainer, /* 287 */ Tk_GetOtherWindow, /* 288 */ Tk_Get3DBorderColors, /* 289 */ Tk_MakeWindow, /* 290 */ Tk_UnderlineCharsInContext, /* 291 */ Tk_DrawCharsInContext, /* 292 */ Tk_MeasureCharsInContext, /* 293 */ }; /* !END!: Do not edit above this line. */ #ifdef __CYGWIN__ void *Tk_GetHINSTANCE(void) |
︙ |
Changes to generic/tkTextDisp.c.
︙ | |||
8052 8053 8054 8055 8056 8057 8058 | 8052 8053 8054 8055 8056 8057 8058 8059 8060 8061 8062 8063 8064 8065 8066 8067 8068 8069 8070 8071 8072 8073 8074 8075 8076 8077 8078 8079 8080 8081 8082 | - + - + - + | if ((len > 0) && (string[start + len - 1] == '\t')) { len--; } if (len <= 0) { return; } |
︙ | |||
8714 8715 8716 8717 8718 8719 8720 | 8714 8715 8716 8717 8718 8719 8720 8721 8722 8723 8724 8725 8726 8727 8728 | - + | * string). Process characters between start and special. */ if ((maxX >= 0) && (curX >= maxX)) { break; } #ifdef TK_DRAW_IN_CONTEXT |
︙ | |||
8998 8999 9000 9001 9002 9003 9004 | 8998 8999 9000 9001 9002 9003 9004 9005 9006 9007 9008 9009 9010 9011 9012 | - + | * IsSameFGStyle -- * * Compare the foreground attributes of two styles. Specifically must * consider: foreground color, font, font style and font decorations, * elide, "offset" and foreground stipple. Do *not* consider: background * color, border, relief or background stipple. * |
︙ |
Changes to macosx/tkMacOSXFont.c.
︙ | |||
950 951 952 953 954 955 956 | 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 | - + | * * Determine the number of characters from the string that will fit in * the given horizontal span. The measurement is done under the * assumption that Tk_DrawChars() will be used to actually display the * characters. * * With ATSUI we need the line context to do this right, so we have the |
︙ | |||
988 989 990 991 992 993 994 | 988 989 990 991 992 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 | - + - + - + - + | * TK_WHOLE_WORDS means stop on a word * boundary, if possible. TK_AT_LEAST_ONE * means return at least one character even if * no characters fit. */ int *lengthPtr) /* Filled with x-location just after the * terminating character. */ { |
︙ | |||
1263 1264 1265 1266 1267 1268 1269 | 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 | - + - + | TkpDrawAngledCharsInContext(display, drawable, gc, tkfont, source, numBytes, 0, numBytes, x, y, angle); } /* *--------------------------------------------------------------------------- * |
︙ |
Changes to unix/tkUnixFont.c.
︙ | |||
998 999 1000 1001 1002 1003 1004 | 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 | - + | *lengthPtr = curX; return curByte; } /* *--------------------------------------------------------------------------- * |
︙ | |||
1021 1022 1023 1024 1025 1026 1027 | 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 | - + | * Side effects: * None. * *--------------------------------------------------------------------------- */ int |
︙ | |||
1189 1190 1191 1192 1193 1194 1195 | 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 | - + - + - + | (unsigned) (x - xStart), (unsigned) fontPtr->barHeight); } } /* *--------------------------------------------------------------------------- * |
︙ |
Changes to unix/tkUnixRFont.c.
︙ | |||
826 827 828 829 830 831 832 | 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 | - + | DEBUG(("MeasureChars: %s length %d bytes %d\n", string, curX, curByte)); #endif /* DEBUG_FONTSEL */ *lengthPtr = curX; return curByte; } int |
︙ | |||
1344 1345 1346 1347 1348 1349 1350 | 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 | - + - + - + | } } } /* *--------------------------------------------------------------------------- * |
︙ |
Changes to win/tkWinFont.c.
︙ | |||
984 985 986 987 988 989 990 | 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 | - + | *lengthPtr = curX; return (int)(p - source); } /* *--------------------------------------------------------------------------- * |
︙ | |||
1007 1008 1009 1010 1011 1012 1013 | 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 | - + | * Side effects: * None. * *--------------------------------------------------------------------------- */ int |
︙ | |||
1351 1352 1353 1354 1355 1356 1357 | 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 | - + - + - + | } TkWinReleaseDrawableDC(drawable, dc, &state); } /* *--------------------------------------------------------------------------- * |
︙ |